Debian Codegraph @

ports/stm32/boards/STM32L496GDISC/mpconfigboard.h

raw
1 #define MICROPY_HW_BOARD_NAME "L496G-DISCO"
2 #define MICROPY_HW_MCU_NAME "STM32L496"
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 // Resulting core frequency is 80MHz:
11 #define MICROPY_HW_CLK_PLLM (1)
12 #define MICROPY_HW_CLK_PLLN (40)
13 #define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV7)
14 #define MICROPY_HW_CLK_PLLR (RCC_PLLR_DIV2)
15 #define MICROPY_HW_CLK_PLLQ (RCC_PLLQ_DIV2)
16 #define MICROPY_HW_FLASH_LATENCY FLASH_LATENCY_4
17
18 // The board has an external 32kHz crystal
19 #define MICROPY_HW_RTC_USE_LSE (1)
20
21 // USART config
22 #define MICROPY_HW_UART2_TX (pin_A2)
23 #define MICROPY_HW_UART2_RX (pin_D6)
24 // USART 2 is connected to the virtual com port on the ST-LINK
25 #define MICROPY_HW_UART_REPL PYB_UART_2
26 #define MICROPY_HW_UART_REPL_BAUD 115200
27
28 // I2C buses
29 #define MICROPY_HW_I2C1_SCL (pin_G14)
30 #define MICROPY_HW_I2C1_SDA (pin_G13)
31 #define MICROPY_HW_I2C2_SCL (pin_H4)
32 #define MICROPY_HW_I2C2_SDA (pin_B14)
33
34 // SPI buses
35 // -> To the arduino connector
36 #define MICROPY_HW_SPI1_NSS (pin_A15)
37 #define MICROPY_HW_SPI1_SCK (pin_A5)
38 #define MICROPY_HW_SPI1_MISO (pin_B4)
39 #define MICROPY_HW_SPI1_MOSI (pin_B5)
40
41 // Use Sel from joystick. Joystick is pulled low. Pressing the button makes the input go high.
42 #define MICROPY_HW_USRSW_PIN (pin_C13)
43 #define MICROPY_HW_USRSW_PULL (GPIO_PULLDOWN)
44 #define MICROPY_HW_USRSW_EXTI_MODE (GPIO_MODE_IT_RISING)
45 #define MICROPY_HW_USRSW_PRESSED (1)
46
47 // LED (The orange LED is controlled over MFX)
48 #define MICROPY_HW_LED1 (pin_B13) // Green
49 #define MICROPY_HW_LED_ON(pin) (mp_hal_pin_low(pin))
50 #define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_high(pin))
51 // USB config
52 #define MICROPY_HW_USB_FS (1)
53 #define MICROPY_HW_USB_OTG_ID_PIN (pin_A10)