changes to support seeed xiao esp32s3

This commit is contained in:
Daniel Morgan 2024-01-16 16:24:27 +01:00
parent 5ad684867f
commit f81d4a39f5
2 changed files with 43 additions and 0 deletions

View file

@ -48,6 +48,8 @@ typedef MAX3421e<P20, P19> MAX3421E; // Balanduino
typedef MAX3421e<P3, P2> MAX3421E; // The Intel Galileo supports much faster read and write speed at pin 2 and 3 typedef MAX3421e<P3, P2> MAX3421E; // The Intel Galileo supports much faster read and write speed at pin 2 and 3
#elif defined(ESP8266) #elif defined(ESP8266)
typedef MAX3421e<P15, P5> MAX3421E; // ESP8266 boards typedef MAX3421e<P15, P5> MAX3421E; // ESP8266 boards
#elif defined(ARDUINO_XIAO_ESP32S3)
typedef MAX3421e<P44, P4> MAX3421E; // ESP32 XIAO boards
#elif defined(ESP32) #elif defined(ESP32)
typedef MAX3421e<P5, P17> MAX3421E; // ESP32 boards typedef MAX3421e<P5, P17> MAX3421E; // ESP32 boards
#elif defined(MIGHTYCORE) #elif defined(MIGHTYCORE)

View file

@ -1661,6 +1661,47 @@ MAKE_PIN(P13, 13); // MOSI
MAKE_PIN(P14, 14); // SCK MAKE_PIN(P14, 14); // SCK
MAKE_PIN(P15, 15); // SS MAKE_PIN(P15, 15); // SS
#elif defined(ARDUINO_XIAO_ESP32S3)
// Workaround strict-aliasing warnings
#ifdef pgm_read_word
#undef pgm_read_word
#endif
#ifdef pgm_read_dword
#undef pgm_read_dword
#endif
#ifdef pgm_read_float
#undef pgm_read_float
#endif
#ifdef pgm_read_ptr
#undef pgm_read_ptr
#endif
#define pgm_read_word(addr) ({ \
typeof(addr) _addr = (addr); \
*(const unsigned short *)(_addr); \
})
#define pgm_read_dword(addr) ({ \
typeof(addr) _addr = (addr); \
*(const unsigned long *)(_addr); \
})
#define pgm_read_float(addr) ({ \
typeof(addr) _addr = (addr); \
*(const float *)(_addr); \
})
#define pgm_read_ptr(addr) ({ \
typeof(addr) _addr = (addr); \
*(void * const *)(_addr); \
})
// Pinout for ESP32 dev module
MAKE_PIN(P8, 8); // MISO
MAKE_PIN(P9, 9); // MOSI
MAKE_PIN(P7, 7); // SCK
MAKE_PIN(P44, 44); // SS
MAKE_PIN(P4, 4); // INT
#elif defined(ESP32) #elif defined(ESP32)
// Workaround strict-aliasing warnings // Workaround strict-aliasing warnings