board.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Copyright (c) 2006-2023, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2023-05-26 RealThread first version
  9. */
  10. #ifndef __BOARD_H__
  11. #define __BOARD_H__
  12. #include <stm32g0xx.h>
  13. #include <drv_common.h>
  14. #ifdef __cplusplus
  15. extern "C"
  16. {
  17. #endif
  18. /*-------------------------- CHIP CONFIG BEGIN --------------------------*/
  19. #define CHIP_FAMILY_STM32
  20. #define CHIP_SERIES_STM32G0
  21. #define CHIP_NAME_STM32G030C8TX
  22. /*-------------------------- CHIP CONFIG END --------------------------*/
  23. /*-------------------------- ROM/RAM CONFIG BEGIN --------------------------*/
  24. #define ROM_START ((uint32_t)0x08000000)
  25. #define ROM_SIZE (64 * 1024)
  26. #define ROM_END ((uint32_t)(ROM_START + ROM_SIZE))
  27. #define RAM_START (0x20000000)
  28. #define RAM_SIZE (8 * 1024)
  29. #define RAM_END (RAM_START + RAM_SIZE)
  30. /*-------------------------- ROM/RAM CONFIG END --------------------------*/
  31. /*-------------------------- CLOCK CONFIG BEGIN --------------------------*/
  32. #define BSP_CLOCK_SOURCE ("HSI")
  33. #define BSP_CLOCK_SOURCE_FREQ_MHZ ((int32_t)0)
  34. #define BSP_CLOCK_SYSTEM_FREQ_MHZ ((int32_t)64)
  35. /*-------------------------- CLOCK CONFIG END --------------------------*/
  36. /*-------------------------- UART CONFIG BEGIN --------------------------*/
  37. /** After configuring corresponding UART or UART DMA, you can use it.
  38. *
  39. * STEP 1, define macro define related to the serial port opening based on the serial port number
  40. * such as #define BSP_USING_UART1
  41. *
  42. * STEP 2, according to the corresponding pin of serial port, define the related serial port information macro
  43. * such as #define BSP_UART1_TX_PIN "PA9"
  44. * #define BSP_UART1_RX_PIN "PA10"
  45. *
  46. */
  47. #define BSP_USING_UART2
  48. #define BSP_UART2_TX_PIN "PA2"
  49. #define BSP_UART2_RX_PIN "PA3"
  50. /*-------------------------- UART CONFIG END --------------------------*/
  51. #ifdef __cplusplus
  52. }
  53. #endif
  54. #endif /* __BOARD_H__ */