23 #include "api/deprecated-avr-comp/avr/dtostrf.h"
29 #define CRYPTO_LITTLE_ENDIAN
31 #ifndef MY_SERIALDEVICE
32 #define MY_SERIALDEVICE SerialUSB
35 #ifndef MY_DEBUGDEVICE
36 #define MY_DEBUGDEVICE MY_SERIALDEVICE
39 #ifndef MY_SAMD_TEMPERATURE_OFFSET
40 #define MY_SAMD_TEMPERATURE_OFFSET (0.0f)
43 #ifndef MY_SAMD_TEMPERATURE_GAIN
44 #define MY_SAMD_TEMPERATURE_GAIN (1.0f)
48 #define MY_EXT_EEPROM_I2C_ADDRESS (0x50u)
49 #define MY_EXT_EEPROM_SIZE (kbits_512)
50 #define MY_EXT_EEPROM_PAGE_SIZE (32u)
52 extEEPROM eep(MY_EXT_EEPROM_SIZE, 1, MY_EXT_EEPROM_PAGE_SIZE,
53 MY_EXT_EEPROM_I2C_ADDRESS);
55 #define MY_EXT_EEPROM_TWI_CLOCK (eep.twiClock100kHz) // can be set to 400kHz with precaution if other i2c devices on bus
57 #define snprintf_P(s, f, ...) snprintf((s), (f), __VA_ARGS__)
58 #define vsnprintf_P(s, n, f, ...) vsnprintf((s), (n), (f), __VA_ARGS__)
85 #define PRIdLEAST8 "d"
86 #define PRIiLEAST8 "i"
87 #define PRIoLEAST8 "o"
88 #define PRIuLEAST8 "u"
89 #define PRIxLEAST8 "x"
90 #define PRIXLEAST8 "X"
99 #define hwDigitalWrite(__pin, __value) digitalWrite(__pin, __value)
100 #define hwDigitalRead(__pin) digitalRead(__pin)
101 #define hwPinMode(__pin, __value) pinMode(__pin, __value)
102 #define hwMillis() millis()
103 #define hwRandomNumberInit() randomSeed(analogRead(MY_SIGNING_SOFT_RANDOMSEED_PIN))
104 #define hwGetSleepRemaining() (0ul)
107 void hwWatchdogReset(
void);
109 void hwReadConfigBlock(
void *buf,
void *addr,
size_t length);
110 void hwWriteConfigBlock(
void *buf,
void *addr,
size_t length);
111 void hwWriteConfig(
const int addr, uint8_t value);
112 uint8_t hwReadConfig(
const int addr);
116 #error Soft SPI is not available on this architecture!
125 static __inline__ uint8_t __disableIntsRetVal(
void)
135 static __inline__
void __priMaskRestore(
const uint32_t *priMask)
137 __set_PRIMASK(*priMask);
141 #define MY_CRITICAL_SECTION for ( uint32_t __savePriMask __attribute__((__cleanup__(__priMaskRestore))) = __get_PRIMASK(), __ToDo = __disableIntsRetVal(); __ToDo ; __ToDo = 0 )
144 #endif // #ifdef ARDUINO_ARCH_SAMD