2018-11-30 20:39:34 -05:00
|
|
|
#define MICROPY_HW_BOARD_NAME "NUCLEO-L432KC"
|
|
|
|
#define MICROPY_HW_MCU_NAME "STM32L432KC"
|
|
|
|
|
|
|
|
#define MICROPY_EMIT_THUMB (0)
|
|
|
|
#define MICROPY_EMIT_INLINE_THUMB (0)
|
2022-02-03 22:28:21 -05:00
|
|
|
#define MICROPY_OPT_COMPUTED_GOTO (0)
|
2019-04-08 21:23:08 -04:00
|
|
|
#define MICROPY_PY_BUILTINS_COMPLEX (0)
|
2020-03-27 22:52:51 -04:00
|
|
|
#define MICROPY_PY_GENERATOR_PEND_THROW (0)
|
2022-08-18 01:01:26 -04:00
|
|
|
#define MICROPY_PY_SOCKET (0)
|
2018-11-30 20:39:34 -05:00
|
|
|
#define MICROPY_PY_NETWORK (0)
|
2021-02-16 21:05:28 -05:00
|
|
|
#define MICROPY_PY_ONEWIRE (0)
|
2018-11-30 20:39:34 -05:00
|
|
|
#define MICROPY_PY_STM (0)
|
|
|
|
#define MICROPY_PY_PYB_LEGACY (0)
|
2022-08-18 01:01:26 -04:00
|
|
|
#define MICROPY_PY_HEAPQ (0)
|
|
|
|
#define MICROPY_PY_TIMEQ (0)
|
2018-11-30 20:39:34 -05:00
|
|
|
|
|
|
|
#define MICROPY_HW_ENABLE_RTC (1)
|
|
|
|
#define MICROPY_HW_ENABLE_ADC (1)
|
|
|
|
#define MICROPY_HW_ENABLE_DAC (1)
|
2019-08-14 22:46:34 -04:00
|
|
|
#define MICROPY_HW_ENABLE_USB (0) // requires a custom USB connector on PA11/PA12
|
2018-11-30 20:39:34 -05:00
|
|
|
#define MICROPY_HW_HAS_SWITCH (0)
|
2021-05-26 08:37:27 -04:00
|
|
|
#define MICROPY_HW_HAS_FLASH (1)
|
2018-11-30 20:39:34 -05:00
|
|
|
|
|
|
|
// MSI is used and is 4MHz
|
|
|
|
#define MICROPY_HW_CLK_PLLM (1)
|
|
|
|
#define MICROPY_HW_CLK_PLLN (16)
|
|
|
|
#define MICROPY_HW_CLK_PLLR (2)
|
|
|
|
#define MICROPY_HW_CLK_PLLP (7)
|
|
|
|
#define MICROPY_HW_CLK_PLLQ (2)
|
|
|
|
|
2019-10-04 02:03:37 -04:00
|
|
|
// The board has an external 32kHz crystal
|
|
|
|
#define MICROPY_HW_RTC_USE_LSE (1)
|
|
|
|
|
2018-11-30 20:39:34 -05:00
|
|
|
// UART config
|
|
|
|
#define MICROPY_HW_UART1_TX (pin_B6)
|
|
|
|
#define MICROPY_HW_UART1_RX (pin_B7)
|
|
|
|
#define MICROPY_HW_UART2_TX (pin_A2) // VCP TX
|
|
|
|
#define MICROPY_HW_UART2_RX (pin_A15) // VCP RX
|
|
|
|
|
|
|
|
#define MICROPY_HW_UART_REPL PYB_UART_2
|
|
|
|
#define MICROPY_HW_UART_REPL_BAUD 115200
|
|
|
|
|
|
|
|
#define MICROPY_HW_FLASH_LATENCY FLASH_LATENCY_4
|
|
|
|
|
2021-05-20 02:21:47 -04:00
|
|
|
// I2C buses
|
2018-11-30 20:39:34 -05:00
|
|
|
#define MICROPY_HW_I2C1_SCL (pin_A9)
|
|
|
|
#define MICROPY_HW_I2C1_SDA (pin_A10)
|
|
|
|
#define MICROPY_HW_I2C3_SCL (pin_A7)
|
|
|
|
#define MICROPY_HW_I2C3_SDA (pin_B4)
|
|
|
|
|
2021-05-20 02:21:47 -04:00
|
|
|
// SPI buses
|
2018-11-30 20:39:34 -05:00
|
|
|
#define MICROPY_HW_SPI1_NSS (pin_B0)
|
|
|
|
#define MICROPY_HW_SPI1_SCK (pin_A5)
|
|
|
|
#define MICROPY_HW_SPI1_MISO (pin_A6)
|
|
|
|
#define MICROPY_HW_SPI1_MOSI (pin_A7)
|
|
|
|
#define MICROPY_HW_SPI3_NSS (pin_A4)
|
|
|
|
#define MICROPY_HW_SPI3_SCK (pin_B3)
|
|
|
|
#define MICROPY_HW_SPI3_MISO (pin_B4)
|
|
|
|
#define MICROPY_HW_SPI3_MOSI (pin_B5)
|
|
|
|
|
|
|
|
// LEDs
|
|
|
|
#define MICROPY_HW_LED1 (pin_B3) // Green LD3 LED on Nucleo
|
|
|
|
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_high(pin))
|
|
|
|
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
|
|
|
|
|
|
|
|
// USB config
|
2019-08-14 22:46:34 -04:00
|
|
|
#define MICROPY_HW_USB_FS (MICROPY_HW_ENABLE_USB)
|
|
|
|
#define MICROPY_HW_USB_MSC (0)
|
|
|
|
#define MICROPY_HW_USB_HID (0)
|
2021-08-04 22:21:58 -04:00
|
|
|
#define MICROPY_HW_USB_CDC_RX_DATA_SIZE (256)
|
|
|
|
#define MICROPY_HW_USB_CDC_TX_DATA_SIZE (256)
|