| 1 |
#define MICROPY_HW_BOARD_NAME "B-L475E-IOT01A" |
| 2 |
#define MICROPY_HW_MCU_NAME "STM32L475" |
| 3 |
|
| 4 |
#define MICROPY_HW_HAS_SWITCH (1) |
| 5 |
#define MICROPY_HW_ENABLE_RNG (1) |
| 6 |
#define MICROPY_HW_ENABLE_RTC (1) |
| 7 |
#define MICROPY_HW_ENABLE_USB (1) |
| 8 |
|
| 9 |
// MSI is used and is 4MHz |
| 10 |
#define MICROPY_HW_CLK_PLLM (1) |
| 11 |
#define MICROPY_HW_CLK_PLLN (40) |
| 12 |
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV7) |
| 13 |
#define MICROPY_HW_CLK_PLLR (RCC_PLLR_DIV2) |
| 14 |
#define MICROPY_HW_CLK_PLLQ (RCC_PLLQ_DIV4) |
| 15 |
#define MICROPY_HW_FLASH_LATENCY FLASH_LATENCY_4 |
| 16 |
|
| 17 |
// The board has an external 32kHz crystal |
| 18 |
#define MICROPY_HW_RTC_USE_LSE (1) |
| 19 |
|
| 20 |
// USART1 config connected to ST-Link |
| 21 |
#define MICROPY_HW_UART1_TX (pin_B6) |
| 22 |
#define MICROPY_HW_UART1_RX (pin_B7) |
| 23 |
// USART2 config connected to PMOD: Flow control is defined and therefore used |
| 24 |
#define MICROPY_HW_UART2_CTS (pin_D3) |
| 25 |
#define MICROPY_HW_UART2_RTS (pin_D4) |
| 26 |
#define MICROPY_HW_UART2_TX (pin_D5) |
| 27 |
#define MICROPY_HW_UART2_RX (pin_D6) |
| 28 |
// USART3 config for internal use |
| 29 |
#define MICROPY_HW_UART3_TX (pin_D8) |
| 30 |
#define MICROPY_HW_UART3_RX (pin_D9) |
| 31 |
// USART4 config |
| 32 |
#define MICROPY_HW_UART4_TX (pin_A0) |
| 33 |
#define MICROPY_HW_UART4_RX (pin_A1) |
| 34 |
// USART 1 is connected to the virtual com port on the ST-LINK |
| 35 |
#define MICROPY_HW_UART_REPL PYB_UART_1 |
| 36 |
#define MICROPY_HW_UART_REPL_BAUD 115200 |
| 37 |
|
| 38 |
// I2C buses |
| 39 |
#define MICROPY_HW_I2C1_SCL (pin_B8) |
| 40 |
#define MICROPY_HW_I2C1_SDA (pin_B9) |
| 41 |
#define MICROPY_HW_I2C2_SCL (pin_B10) |
| 42 |
#define MICROPY_HW_I2C2_SDA (pin_B11) |
| 43 |
|
| 44 |
// SPI buses |
| 45 |
#define MICROPY_HW_SPI1_NSS (pin_A4) |
| 46 |
#define MICROPY_HW_SPI1_SCK (pin_A5) |
| 47 |
#define MICROPY_HW_SPI1_MISO (pin_A6) |
| 48 |
#define MICROPY_HW_SPI1_MOSI (pin_A7) |
| 49 |
|
| 50 |
#define MICROPY_HW_SPI2_NSS (pin_D0) |
| 51 |
#define MICROPY_HW_SPI2_SCK (pin_D1) |
| 52 |
#define MICROPY_HW_SPI2_MISO (pin_D3) |
| 53 |
#define MICROPY_HW_SPI2_MOSI (pin_D4) |
| 54 |
|
| 55 |
#define MICROPY_HW_SPI3_NSS (pin_A15) |
| 56 |
#define MICROPY_HW_SPI3_SCK (pin_C10) |
| 57 |
#define MICROPY_HW_SPI3_MISO (pin_C11) |
| 58 |
#define MICROPY_HW_SPI3_MOSI (pin_C12) |
| 59 |
|
| 60 |
// User and wake-up switch. Pressing the button makes the input go low. |
| 61 |
#define MICROPY_HW_USRSW_PIN (pin_C13) |
| 62 |
#define MICROPY_HW_USRSW_PULL (GPIO_NOPULL) |
| 63 |
#define MICROPY_HW_USRSW_EXTI_MODE (GPIO_MODE_IT_FALLING) |
| 64 |
#define MICROPY_HW_USRSW_PRESSED (0) |
| 65 |
|
| 66 |
// LEDs |
| 67 |
#define MICROPY_HW_LED1 (pin_A5) // green |
| 68 |
#define MICROPY_HW_LED2 (pin_B14) // green |
| 69 |
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_high(pin)) |
| 70 |
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin)) |
| 71 |
|
| 72 |
// USB config |
| 73 |
#define MICROPY_HW_USB_FS (1) |