1 /*
2  * Copyright (C) 2017-2019 Alibaba Group Holding Limited
3  */
4 
5 /******************************************************************************
6  * @file     pin.h
7  * @brief    header File for pin definition
8  * @version  V1.0
9  * @date     02. June 2018
10  ******************************************************************************/
11 #ifndef _PIN_H_
12 #define _PIN_H_
13 
14 #include <stdint.h>
15 #include "pin_name.h"
16 #include "pinmux.h"
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 #define CLOCK_GETTIME_USE_TIMER_ID 0
23 #define UART_TXD0       1
24 #define UART_RXD0       2
25 
26 #define CONSOLE_TXD     PAD_UART0_SIN
27 #define CONSOLE_RXD     PAD_UART0_SOUT
28 #define CONSOLE_IDX     0
29 
30 /* example pin manager */
31 #define EXAMPLE_USART_IDX       0
32 #define EXAMPLE_PIN_USART_TX    PAD_UART0_SIN
33 #define EXAMPLE_PIN_USART_RX    PAD_UART0_SOUT
34 #define EXAMPLE_PIN_USART_TX_FUNC   0
35 #define EXAMPLE_PIN_USART_RX_FUNC   0
36 
37 #define EXAMPLE_GPIO_PIN    PA1
38 #define EXAMPLE_BOARD_GPIO_PIN_NAME "A1"
39 #define EXAMPLE_GPIO_PIN_FUNC   0
40 
41 /* tests pin manager */
42 #define TEST_USART_IDX       0
43 #define TEST_PIN_USART_TX    PAD_UART0_SIN
44 #define TEST_PIN_USART_RX    PAD_UART0_SOUT
45 #define TEST_PIN_USART_TX_FUNC      0
46 #define TEST_PIN_USART_RX_FUNC      0
47 
48 #define TEST_GPIO_PIN    PA0
49 #define TEST_BOARD_GPIO_PIN_NAME "A0"
50 #define TEST_GPIO_PIN_FUNC   0
51 
52 #define UART_TXD2       3
53 #define UART_RXD2       4
54 
55 #define UART_TXD3       5
56 #define UART_RXD3       6
57 
58 #define UART_PINs  { {PA0, PA1},\
59         {PA10, PA11},\
60         {PA23, PA22},\
61         {PA26, PA27} }
62 
63 #define GPIO_EXAMPLE_PORT   PORTB
64 #define GPIO_EXAMPLE_PIN    PA1
65 #define CTS_GPIO_TEST_PORT  PORTA
66 #define CTS_GPIO_TEST_PIN   PA0
67 #define EXAMPLE_BOARD_GPIO_PIN_NAME "A1"
68 #define CTS_BOARD_GPIO_PIN_NAME     "A0"
69 #define SENSOR_UART_DIR     PA3
70 
71 #ifdef __cplusplus
72 }
73 #endif
74 
75 #endif /* _PIN_H_ */
76 
77