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(B, 19)
16 #define APP_LED_ON (1)
17 #define APP_LED_OFF (0)
18 
19 
20 
21 /* mchtimer section */
22 #define BOARD_MCHTMR_FREQ_IN_HZ (24000000UL)
23 
24 /* CAN section */
25 #define BOARD_CAN_NAME                        "can0"
26 #define BOARD_CAN_HWFILTER_INDEX               (0U)
27 
28 /* UART section */
29 #define BOARD_UART_NAME                        "uart2"
30 #define BOARD_UART_RX_BUFFER_SIZE              BSP_UART2_RX_BUFSIZE
31 
32 /* PWM section */
33 #define BOARD_PWM_NAME                        "pwm0"
34 #define BOARD_PWM_CHANNEL                     (0)
35 
36 #define IRQn_PendSV IRQn_DEBUG_0
37 
38 /***************************************************************
39  *
40  * RT-Thread related definitions
41  *
42  **************************************************************/
43 extern unsigned int __heap_start__;
44 extern unsigned int __heap_end__;
45 
46 #define RT_HW_HEAP_BEGIN ((void*)&__heap_start__)
47 #define RT_HW_HEAP_END ((void*)&__heap_end__)
48 
49 
50 typedef struct {
51     uint16_t vdd;
52     uint8_t bus_width;
53     uint8_t drive_strength;
54 }sdxc_io_cfg_t;
55 
56 void app_init_led_pins(void);
57 void app_led_write(uint32_t index, bool state);
58 void app_init_usb_pins(void);
59 
60 #if defined(__cplusplus)
61 extern "C" {
62 #endif /* __cplusplus */
63 
64 
65 
66 
67 #if defined(__cplusplus)
68 }
69 #endif /* __cplusplus */
70 #endif /* _RTT_BOARD_H */
71