1 /*
2  * Copyright (C) 2015-2017 Alibaba Group Holding Limited
3  */
4 #pragma once
5 
6 #ifdef __cplusplus
7 extern "C"
8 {
9 #endif
10 
11 
12 #define HARDWARE_REVISION   "V1.0"
13 #define MODEL               "AmebaD"
14 
15 #ifdef BOOTLOADER
16 #define STDIO_UART 0
17 #define STDIO_UART_BUADRATE 921600
18 #else
19 #define STDIO_UART 0
20 #define STDIO_UART_BUADRATE 921600
21 #endif
22 
23 
24 
25 /******************************************************
26  *                      Macros
27  ******************************************************/
28 
29 /******************************************************
30  *                    Constants
31  ******************************************************/
32 
33 /******************************************************
34  *                   Enumerations
35  ******************************************************/
36 
37 #define MICO_UNUSED 0xFF
38 
39 typedef enum
40 {
41     MICO_GPIO_1,
42     MICO_GPIO_2,
43     MICO_GPIO_3,
44     MICO_GPIO_4,
45     MICO_GPIO_5,
46     MICO_GPIO_6,
47     MICO_GPIO_7,
48     MICO_GPIO_8,
49     MICO_GPIO_9,
50     MICO_GPIO_10,
51     MICO_GPIO_11,
52     MICO_GPIO_12,
53     MICO_GPIO_13,
54     MICO_GPIO_14,
55     MICO_GPIO_15,
56     MICO_GPIO_16,
57     MICO_GPIO_17,
58     MICO_GPIO_18,
59     MICO_GPIO_19,
60     MICO_GPIO_20,
61     MICO_GPIO_21,
62     MICO_GPIO_22,
63     MICO_GPIO_23,
64     MICO_GPIO_24,
65     //MICO_GPIO_26,
66     //MICO_GPIO_27,
67     //MICO_GPIO_28,
68     //MICO_GPIO_29,
69     //MICO_GPIO_30,
70     MICO_GPIO_MAX, /* Denotes the total number of GPIO port aliases. Not a valid GPIO alias */
71     MICO_GPIO_NONE,
72 } mico_gpio_t;
73 
74 typedef enum
75 {
76     MICO_SPI_1,
77     MICO_SPI_2,
78     MICO_SPI_3,
79     MICO_SPI_MAX, /* Denotes the total number of SPI port aliases. Not a valid SPI alias */
80     MICO_SPI_NONE,
81 } mico_spi_t;
82 
83 typedef enum
84 {
85     MICO_I2C_1,
86     MICO_I2C_2,
87     MICO_I2C_MAX, /* Denotes the total number of I2C port aliases. Not a valid I2C alias */
88     MICO_I2C_NONE,
89 } mico_i2c_t;
90 
91 typedef enum
92 {
93     MICO_PWM_1,
94     MICO_PWM_2,
95     MICO_PWM_3,
96     MICO_PWM_4,
97     MICO_PWM_5,
98     MICO_PWM_6,
99     MICO_PWM_7,
100     MICO_PWM_8,
101     MICO_PWM_9,
102     MICO_PWM_10,
103     MICO_PWM_11,
104     MICO_PWM_12,
105     MICO_PWM_13,
106     MICO_PWM_14,
107     MICO_PWM_15,
108     MICO_PWM_16,
109     MICO_PWM_17,
110     MICO_PWM_18,
111     MICO_PWM_MAX, /* Denotes the total number of PWM port aliases. Not a valid PWM alias */
112     MICO_PWM_NONE,
113 } mico_pwm_t;
114 
115 typedef enum
116 {
117     MICO_ADC_1,
118     MICO_ADC_2,
119     MICO_ADC_3,
120     MICO_ADC_4,
121     MICO_ADC_5,
122     MICO_ADC_6,
123     MICO_ADC_7,
124     MICO_ADC_8,
125     MICO_ADC_MAX, /* Denotes the total number of ADC port aliases. Not a valid ADC alias */
126     MICO_ADC_NONE,
127 } mico_adc_t;
128 
129 typedef enum
130 {
131     MICO_UART_1,    /*km4 hs_uart*/
132     MICO_UART_2,	/*km4 bt uart*/
133     MICO_UART_3,	/*km0 loguart*/
134     MICO_UART_4,	/*km0 lp_uart*/
135     MICO_UART_MAX, /* Denotes the total number of UART port aliases. Not a valid UART alias */
136     MICO_UART_NONE,
137 } mico_uart_t;
138 
139 typedef enum
140 {
141   MICO_FLASH_EMBEDDED,
142   MICO_FLASH_SPI,
143   MICO_FLASH_MAX,
144   MICO_FLASH_NONE,
145 } mico_flash_t;
146 
147 typedef enum
148 {
149   MICO_PARTITION_USER_MAX
150 } mico_user_partition_t;
151 
152 typedef enum
153 {
154     MICO_TIMER_0,
155     MICO_TIMER_1,
156     MICO_TIMER_2,
157     MICO_TIMER_3,
158     MICO_TIMER_MAX,
159 } mico_timer_t;
160 
161 #ifdef BOOTLOADER
162 #define STDIO_UART          MICO_UART_NONE
163 #define STDIO_UART_BAUDRATE (115200)
164 #else
165 #define STDIO_UART          MICO_UART_NONE
166 #define STDIO_UART_BAUDRATE (115200)
167 #endif
168 
169 #define UART_FOR_APP     MICO_UART_1
170 #define MFG_TEST         MICO_UART_1
171 #define CLI_UART         MICO_UART_1
172 
173 /* Components connected to external I/Os*/
174 #define Standby_SEL      (MICO_GPIO_29)
175 
176 /* I/O connection <-> Peripheral Connections */
177 #define MICO_I2C_CP      (MICO_I2C_1)
178 
179 //#define USE_MICO_SPI_FLASH
180 
181 #define MICO_FLASH_FOR_PARA         MICO_FLASH_SPI
182 #define PARA_START_ADDRESS          (uint32_t)0x00000020
183 #define PARA_END_ADDRESS            (uint32_t)0x00003FFF
184 #define PARA_FLASH_SIZE             (PARA_END_ADDRESS - PARA_START_ADDRESS + 1)   /* 4k bytes*/
185 
186 
187 #ifdef __cplusplus
188 } /*extern "C" */
189 #endif
190