mpconfigboard.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #define MICROPY_HW_BOARD_NAME "L496G-DISCO"
  2. #define MICROPY_HW_MCU_NAME "STM32L496"
  3. #define MICROPY_HW_HAS_SWITCH (1)
  4. #define MICROPY_HW_ENABLE_RNG (1)
  5. #define MICROPY_HW_ENABLE_RTC (1)
  6. #define MICROPY_HW_ENABLE_TIMER (1)
  7. #define MICROPY_HW_ENABLE_USB (1)
  8. // MSI is used and is 4MHz,
  9. // Resulting core frequency is 80MHz:
  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_DIV2)
  15. #define MICROPY_HW_FLASH_LATENCY FLASH_LATENCY_4
  16. // USART config
  17. #define MICROPY_HW_UART2_TX (pin_A2)
  18. #define MICROPY_HW_UART2_RX (pin_D6)
  19. // USART 2 is connected to the virtual com port on the ST-LINK
  20. #define MICROPY_HW_UART_REPL PYB_UART_2
  21. #define MICROPY_HW_UART_REPL_BAUD 115200
  22. // I2C busses
  23. #define MICROPY_HW_I2C1_SCL (pin_G14)
  24. #define MICROPY_HW_I2C1_SDA (pin_G13)
  25. #define MICROPY_HW_I2C2_SCL (pin_H4)
  26. #define MICROPY_HW_I2C2_SDA (pin_B14)
  27. // SPI busses
  28. // -> To the arduino connector
  29. #define MICROPY_HW_SPI1_NSS (pin_A15)
  30. #define MICROPY_HW_SPI1_SCK (pin_A5)
  31. #define MICROPY_HW_SPI1_MISO (pin_B4)
  32. #define MICROPY_HW_SPI1_MOSI (pin_B5)
  33. // Use Sel from joystick. Joystick is pulled low. Pressing the button makes the input go high.
  34. #define MICROPY_HW_USRSW_PIN (pin_C13)
  35. #define MICROPY_HW_USRSW_PULL (GPIO_PULLDOWN)
  36. #define MICROPY_HW_USRSW_EXTI_MODE (GPIO_MODE_IT_RISING)
  37. #define MICROPY_HW_USRSW_PRESSED (1)
  38. // LED (The orange LED is controlled over MFX)
  39. #define MICROPY_HW_LED1 (pin_B13) // Green
  40. #define MICROPY_HW_LED_ON(pin) (mp_hal_pin_low(pin))
  41. #define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_high(pin))
  42. // USB config
  43. #define MICROPY_HW_USB_FS (1)
  44. #define MICROPY_HW_USB_OTG_ID_PIN (pin_A10)