rtt_board.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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, 23)
  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. /* PWM section */
  25. #define BOARD_PWM_NAME "pwm0"
  26. #define BOARD_PWM_CHANNEL (6)
  27. #define IRQn_PendSV IRQn_DEBUG0
  28. /***************************************************************
  29. *
  30. * RT-Thread related definitions
  31. *
  32. **************************************************************/
  33. extern unsigned int __heap_start__;
  34. extern unsigned int __heap_end__;
  35. #define RT_HW_HEAP_BEGIN ((void*)&__heap_start__)
  36. #define RT_HW_HEAP_END ((void*)&__heap_end__)
  37. typedef struct {
  38. uint16_t vdd;
  39. uint8_t bus_width;
  40. uint8_t drive_strength;
  41. }sdxc_io_cfg_t;
  42. void app_init_led_pins(void);
  43. void app_led_write(uint32_t index, bool state);
  44. void app_init_usb_pins(void);
  45. #if defined(__cplusplus)
  46. extern "C" {
  47. #endif /* __cplusplus */
  48. #if defined(__cplusplus)
  49. }
  50. #endif /* __cplusplus */
  51. #endif /* _RTT_BOARD_H */