1 /*
2  * Copyright (C) 2015-2019 Alibaba Group Holding Limited
3  */
4 
5 #ifndef BE_BOARD_MARKER_H
6 #define BE_BOARD_MARKER_H
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 
11 /* app.json configuration */
12 #define APP_CONFIG_PAGES    "pages"
13 #define APP_CONFIG_IO       "io"
14 #define APP_CONFIG_AUDIO    "audio"
15 #define APP_CONFIG_NET      "net"
16 #define APP_CONFIG_DEBUG    "debugLevel"
17 #define APP_CONFIG_REPL     "repl"
18 #define APP_CONFIG_VERSION  "version"
19 
20 #define MARKER_ID           "type"
21 #define MARKER_PORT         "port"
22 
23 /* GPIO */
24 #define MARKER_GPIO         "GPIO"
25 #define GPIO_DIR            "dir"
26 #define GPIO_PULL           "pull"
27 #define GPIO_INTMODE        "intMode"
28 
29 #define GPIO_DIR_OUTPUT     "output"
30 #define GPIO_DIR_INPUT      "input"
31 #define GPIO_DIR_IRQ        "irq"
32 #define GPIO_DIR_ANALOG     "analog"
33 
34 #define GPIO_PULL_DOWN      "pulldown"
35 #define GPIO_PULL_UP        "pullup"
36 #define GPIO_PULL_OPEN      "opendrain"
37 
38 #define GPIO_INT_RISING     "rising"
39 #define GPIO_INT_FALLING    "falling"
40 #define GPIO_INT_BOTH       "both"
41 #define GPIO_INT_HIGH_LEVEL  "high"
42 #define GPIO_INT_LOW_LEVEL   "low"
43 
44 /* UART */
45 #define MARKER_UART         "UART"
46 #define UART_DATA_WIDTH     "dataWidth"
47 #define UART_BAUD_RATE      "baudRate"
48 #define UART_STOP_BITS      "stopBits"
49 #define UART_FLOW_CONTROL   "flowControl"
50 #define UART_PARITY_CONFIG  "parity"
51 #define UART_MODE           "mode"
52 
53 #define UART_FC_DISABLE     "disable"
54 #define UART_FC_CTS         "cts"
55 #define UART_FC_RTS         "rts"
56 #define UART_FC_RTSCTS      "rtscts"
57 
58 #define UART_PARITY_NONE    "none"
59 #define UART_PARITY_ODD     "odd"
60 #define UART_PARITY_EVEN    "even"
61 
62 /* I2C */
63 #define MARKER_I2C          "I2C"
64 #define I2C_ADDR_WIDTH      "addrWidth"
65 #define I2C_FREQ            "freq"
66 #define I2C_MODE            "mode"
67 #define I2C_ADDR_DEV        "devAddr"
68 
69 #define I2C_MASTER          "master"
70 #define I2C_SLAVE           "slave"
71 
72 /* SPI */
73 #define MARKER_SPI          "SPI"
74 #define SPI_MODE            "mode"
75 #define SPI_FREQ            "freq"
76 
77 #define SPI_MODE_0          "mode0"
78 #define SPI_MODE_1          "mode1"
79 #define SPI_MODE_2          "mode2"
80 #define SPI_MODE_3          "mode3"
81 
82 /* ADC */
83 #define MARKER_ADC          "ADC"
84 #define ADC_SAMPLING        "sampling"
85 
86 /* DAC */
87 #define MARKER_DAC          "DAC"
88 
89 /* CAN */
90 #define MARKER_CAN          "CAN"
91 #define CAN_BAUD_RATE       "baudRate"
92 #define CAN_IDE             "ide"
93 #define CAN_AUTO_BUS_OFF    "auto_bus_off"
94 #define CAN_RETRY_TRANSMIT  "retry_transmit"
95 
96 #define IDE_NORMAL_CAN      "normal"
97 #define IDE_EXTEND_CAN      "extend"
98 
99 #define CAN_DISABLE         "disable"
100 #define CAN_ENABLE          "enable"
101 
102 /* PWM */
103 #define MARKER_PWM          "PWM"
104 
105 /* TIMER */
106 #define MARKER_TIMER        "TIMER"
107 
108 /* AUDIO */
109 #define MARKER_AUDIO        "AUDIO"
110 #define OUT_DEVICE          "out_device"
111 #define EXTERNAL_PA         "external_pa"
112 #define EXTERNAL_PA_PIN     "external_pa_pin"
113 #define EXTERNAL_PA_DELAY   "external_pa_delay_ms"
114 #define EXTERNAL_PA_ACTIVE  "external_pa_active_level"
115 
116 #ifdef __cplusplus
117 }
118 #endif
119 
120 #endif /* BE_BOARD_MARKER_H */
121