rtt_board.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * Copyright (c) 2021 hpmicro
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #ifndef _RTT_BOARD_H
  8. #define _RTT_BOARD_H
  9. #include "hpm_common.h"
  10. #include "hpm_soc.h"
  11. /* gpio section */
  12. #define APP_LED0_GPIO_CTRL HPM_GPIO0
  13. #define APP_LED0_GPIO_INDEX GPIO_DI_GPIOF
  14. #define APP_LED0_GPIO_PIN 1
  15. #define APP_LED1_GPIO_CTRL HPM_GPIO0
  16. #define APP_LED1_GPIO_INDEX GPIO_DI_GPIOF
  17. #define APP_LED1_GPIO_PIN 2
  18. #define APP_LED2_GPIO_CTRL HPM_GPIO0
  19. #define APP_LED2_GPIO_INDEX GPIO_DI_GPIOF
  20. #define APP_LED2_GPIO_PIN 5
  21. #define APP_LED_ON (1)
  22. #define APP_LED_OFF (0)
  23. /* mchtimer section */
  24. #define BOARD_MCHTMR_FREQ_IN_HZ (24000000UL)
  25. /* CAN section */
  26. #define BOARD_CAN_NAME "can3"
  27. #define BOARD_CAN_HWFILTER_INDEX (3U)
  28. /* UART section */
  29. #define BOARD_UART_NAME "uart3"
  30. #define BOARD_UART_RX_BUFFER_SIZE BSP_UART3_RX_BUFSIZE
  31. /* eeprom section */
  32. #define BOARD_EEPROM_I2C_NAME "i2c1"
  33. #define BOARD_SD_NAME "sd1"
  34. /* audio section */
  35. #define BOARD_AUDIO_CODEC_I2C_NAME "i2c3"
  36. #define BOARD_AUDIO_CODEC_I2S_NAME "i2s3"
  37. #define IRQn_PendSV IRQn_DEBUG0
  38. /***************************************************************
  39. *
  40. * RT-Thread related definitions
  41. *
  42. **************************************************************/
  43. extern unsigned int __heap_start__;
  44. extern unsigned int __heap_end__;
  45. #define RT_HW_HEAP_BEGIN ((void*)&__heap_start__)
  46. #define RT_HW_HEAP_END ((void*)&__heap_end__)
  47. typedef struct {
  48. uint16_t vdd;
  49. uint8_t bus_width;
  50. uint8_t drive_strength;
  51. }sdxc_io_cfg_t;
  52. #if defined(__cplusplus)
  53. extern "C" {
  54. #endif /* __cplusplus */
  55. void app_init_led_pins(void);
  56. void app_led_write(uint32_t index, bool state);
  57. void app_init_usb_pins(void);
  58. #if defined(__cplusplus)
  59. }
  60. #endif /* __cplusplus */
  61. #endif /* _RTT_BOARD_H */