Content-Length: 591384 | pFad | http://github.com/micropython/micropython/commit/b9b4f1b40b9f97a5b8893afe9cb139a09fb76fd9

60 samd/boards: Provide default IDs for UART, I2C and SPI. · micropython/micropython@b9b4f1b · GitHub
Skip to content

Commit b9b4f1b

Browse files
robert-hhdpgeorge
authored andcommitted
samd/boards: Provide default IDs for UART, I2C and SPI.
In combination with the defautl Pins the default device can now be instantiated e.g. as: uart = UART(). Similar for I2C and SPI. Signed-off-by: robert-hh <robert@hammelrath.com>
1 parent 4cbaab1 commit b9b4f1b

File tree

12 files changed

+53
-0
lines changed

12 files changed

+53
-0
lines changed

ports/samd/boards/ADAFRUIT_FEATHER_M0_EXPRESS/mpconfigboard.h

+4
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@
33

44
#define MICROPY_HW_XOSC32K (1)
55

6+
#define MICROPY_HW_DEFAULT_UART_ID (2)
7+
#define MICROPY_HW_DEFAULT_I2C_ID (3)
8+
#define MICROPY_HW_DEFAULT_SPI_ID (4)
9+
610
#define MICROPY_HW_SPIFLASH (1)
711
#define MICROPY_HW_SPIFLASH_ID (2)

ports/samd/boards/ADAFRUIT_FEATHER_M4_EXPRESS/mpconfigboard.h

+4
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@
44
#define MICROPY_HW_XOSC32K (1)
55
#define MICROPY_HW_MCU_OSC32KULP (1)
66

7+
#define MICROPY_HW_DEFAULT_UART_ID (5)
8+
#define MICROPY_HW_DEFAULT_I2C_ID (2)
9+
#define MICROPY_HW_DEFAULT_SPI_ID (1)
10+
711
#define MICROPY_HW_QSPIFLASH GD25Q16C

ports/samd/boards/ADAFRUIT_ITSYBITSY_M0_EXPRESS/mpconfigboard.h

+4
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@
33

44
#define MICROPY_HW_DFLL_USB_SYNC (1)
55

6+
#define MICROPY_HW_DEFAULT_SPI_ID (4)
7+
#define MICROPY_HW_DEFAULT_I2C_ID (3)
8+
#define MICROPY_HW_DEFAULT_UART_ID (0)
9+
610
#define MICROPY_HW_SPIFLASH (1)
711
#define MICROPY_HW_SPIFLASH_ID (5)

ports/samd/boards/ADAFRUIT_ITSYBITSY_M4_EXPRESS/mpconfigboard.h

+4
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@
33

44
#define MICROPY_HW_DFLL_USB_SYNC (1)
55

6+
#define MICROPY_HW_DEFAULT_SPI_ID (1)
7+
#define MICROPY_HW_DEFAULT_I2C_ID (2)
8+
#define MICROPY_HW_DEFAULT_UART_ID (3)
9+
610
#define MICROPY_HW_QSPIFLASH GD25Q16C

ports/samd/boards/ADAFRUIT_METRO_M4_EXPRESS/mpconfigboard.h

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
#define MICROPY_HW_XOSC32K (1)
55
#define MICROPY_HW_QSPIFLASH GD25Q16C
66

7+
#define MICROPY_HW_DEFAULT_UART_ID (3)
8+
#define MICROPY_HW_DEFAULT_I2C_ID (5)
9+
#define MICROPY_HW_DEFAULT_SPI_ID (2)
10+
711
// defines for WLAN
812
#define MICROPY_HW_WIFI_SPI_ID (2)
913
#define MICROPY_HW_WIFI_SPI_BAUDRATE (8000000)

ports/samd/boards/ADAFRUIT_QTPY_SAMD21/mpconfigboard.h

+4
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@
33

44
#define MICROPY_HW_DFLL_USB_SYNC (1)
55

6+
#define MICROPY_HW_DEFAULT_UART_ID (0)
7+
#define MICROPY_HW_DEFAULT_I2C_ID (1)
8+
#define MICROPY_HW_DEFAULT_SPI_ID (0)
9+
610
#define MICROPY_HW_SPIFLASH_ID (3)

ports/samd/boards/ADAFRUIT_TRINKET_M0/mpconfigboard.h

+4
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
#define MICROPY_HW_MCU_NAME "SAMD21E18A"
33

44
#define MICROPY_HW_DFLL_USB_SYNC (1)
5+
6+
#define MICROPY_HW_DEFAULT_UART_ID (0)
7+
#define MICROPY_HW_DEFAULT_I2C_ID (2)
8+
#define MICROPY_HW_DEFAULT_SPI_ID (0)

ports/samd/boards/MINISAM_M4/mpconfigboard.h

+4
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@
33

44
#define MICROPY_HW_DFLL_USB_SYNC (1)
55

6+
#define MICROPY_HW_DEFAULT_UART_ID (3)
7+
#define MICROPY_HW_DEFAULT_I2C_ID (2)
8+
#define MICROPY_HW_DEFAULT_SPI_ID (1)
9+
610
#define MICROPY_HW_QSPIFLASH GD25Q16C

ports/samd/boards/SEEED_WIO_TERMINAL/mpconfigboard.h

+4
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@
33

44
#define MICROPY_HW_XOSC32K (1)
55

6+
#define MICROPY_HW_DEFAULT_UART_ID (2)
7+
#define MICROPY_HW_DEFAULT_I2C_ID (4)
8+
#define MICROPY_HW_DEFAULT_SPI_ID (5)
9+
610
#define MICROPY_HW_QSPIFLASH W25Q32JV_IQ

ports/samd/boards/SEEED_XIAO_SAMD21/mpconfigboard.h

+4
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@
33

44
#define MICROPY_HW_XOSC32K (1)
55
#define MICROPY_HW_ADC_VREF (2)
6+
7+
#define MICROPY_HW_DEFAULT_UART_ID (4)
8+
#define MICROPY_HW_DEFAULT_I2C_ID (2)
9+
#define MICROPY_HW_DEFAULT_SPI_ID (0)

ports/samd/boards/SPARKFUN_SAMD51_THING_PLUS/mpconfigboard.h

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
#define MICROPY_HW_XOSC32K (1)
55

6+
#define MICROPY_HW_DEFAULT_UART_ID (2)
7+
#define MICROPY_HW_DEFAULT_I2C_ID (3)
8+
#define MICROPY_HW_DEFAULT_SPI_ID (4)
9+
610
// There seems to be an inconsistency in the SAMD51 Thing bootloader in that
711
// the bootloader magic address is at the end of a 192k RAM area, instead of
812
// 256k. Since the SAMD51x20A has 256k RAM, the loader symbol is at that address

ports/samd/mpconfigport.h

+9
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,15 @@
138138
#ifndef MICROPY_HW_USB_PID
139139
#define MICROPY_HW_USB_PID (0x9802)
140140
#endif
141+
#ifndef MICROPY_HW_DEFAULT_UART_ID
142+
#define MICROPY_HW_DEFAULT_UART_ID (-1)
143+
#endif
144+
#ifndef MICROPY_HW_DEFAULT_I2C_ID
145+
#define MICROPY_HW_DEFAULT_I2C_ID (-1)
146+
#endif
147+
#ifndef MICROPY_HW_DEFAULT_SPI_ID
148+
#define MICROPY_HW_DEFAULT_SPI_ID (-1)
149+
#endif
141150

142151
// Additional entries for use with pendsv_schedule_dispatch.
143152
#ifndef MICROPY_BOARD_PENDSV_ENTRIES

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/micropython/micropython/commit/b9b4f1b40b9f97a5b8893afe9cb139a09fb76fd9

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy