1 /*
2  * Copyright (c) 2021 hpmicro
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #ifndef _RTT_BOARD_H
9 #define _RTT_BOARD_H
10 #include "hpm_common.h"
11 #include "hpm_soc.h"
12 #include <drv_gpio.h>
13 
14 /* gpio section */
15 #define APP_LED0_PIN_NUM GET_PIN(A, 23)
16 #define APP_LED_ON (1)
17 #define APP_LED_OFF (0)
18 
19 /* mchtimer section */
20 #define BOARD_MCHTMR_FREQ_IN_HZ (24000000UL)
21 
22 /* CAN section */
23 #define BOARD_CAN_NAME                        "can0"
24 #define BOARD_CAN_HWFILTER_INDEX              (0U)
25 
26 /* UART section */
27 #define BOARD_UART_NAME                        "uart2"
28 #define BOARD_UART_RX_BUFFER_SIZE              BSP_UART2_RX_BUFSIZE
29 
30 /* PWM section */
31 #define BOARD_PWM_NAME                        "pwm0"
32 #define BOARD_PWM_CHANNEL                     (6)
33 
34 #define IRQn_PendSV IRQn_DEBUG0
35 
36 /***************************************************************
37  *
38  * RT-Thread related definitions
39  *
40  **************************************************************/
41 extern unsigned int __heap_start__;
42 extern unsigned int __heap_end__;
43 
44 #define RT_HW_HEAP_BEGIN ((void*)&__heap_start__)
45 #define RT_HW_HEAP_END ((void*)&__heap_end__)
46 
47 
48 typedef struct {
49     uint16_t vdd;
50     uint8_t bus_width;
51     uint8_t drive_strength;
52 }sdxc_io_cfg_t;
53 
54 void app_init_led_pins(void);
55 void app_led_write(uint32_t index, bool state);
56 void app_init_usb_pins(void);
57 
58 #if defined(__cplusplus)
59 extern "C" {
60 #endif /* __cplusplus */
61 
62 
63 
64 
65 #if defined(__cplusplus)
66 }
67 #endif /* __cplusplus */
68 #endif /* _RTT_BOARD_H */
69