rtt_board.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. #include <drv_gpio.h>
  12. /* gpio section */
  13. #define APP_LED0_PIN_NUM GET_PIN(A, 10)
  14. #define APP_LED_ON (1)
  15. #define APP_LED_OFF (0)
  16. /* mchtimer section */
  17. #define BOARD_MCHTMR_FREQ_IN_HZ (24000000UL)
  18. /* CAN section */
  19. #define BOARD_CAN_NAME "can0"
  20. #define BOARD_CAN_HWFILTER_INDEX (0U)
  21. /* UART section */
  22. #define BOARD_UART_NAME "uart2"
  23. #define BOARD_UART_RX_BUFFER_SIZE BSP_UART2_RX_BUFSIZE
  24. #define IRQn_PendSV IRQn_DEBUG0
  25. /***************************************************************
  26. *
  27. * RT-Thread related definitions
  28. *
  29. **************************************************************/
  30. extern unsigned int __heap_start__;
  31. extern unsigned int __heap_end__;
  32. #define RT_HW_HEAP_BEGIN ((void*)&__heap_start__)
  33. #define RT_HW_HEAP_END ((void*)&__heap_end__)
  34. typedef struct {
  35. uint16_t vdd;
  36. uint8_t bus_width;
  37. uint8_t drive_strength;
  38. }sdxc_io_cfg_t;
  39. void app_init_led_pins(void);
  40. void app_led_write(uint32_t index, bool state);
  41. void app_init_usb_pins(void);
  42. #if defined(__cplusplus)
  43. extern "C" {
  44. #endif /* __cplusplus */
  45. #if defined(__cplusplus)
  46. }
  47. #endif /* __cplusplus */
  48. #endif /* _RTT_BOARD_H */