app_drv_config.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file app_drv_config.h
5 * @author BLE Driver Team
6 * @brief Header file of app driver config code.
7 *
8 ****************************************************************************************
9 * @attention
10 #####Copyright (c) 2019 GOODIX
11 All rights reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15 * Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright
18 notice, this list of conditions and the following disclaimer in the
19 documentation and/or other materials provided with the distribution.
20 * Neither the name of GOODIX nor the names of its contributors may be used
21 to endorse or promote products derived from this software without
22 specific prior written permission.
23
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35 ****************************************************************************************
36 */
37
38 /** @addtogroup PERIPHERAL Peripheral Driver
39 * @{
40 */
41
42 /** @addtogroup APP_DRIVER APP DRIVER
43 * @{
44 */
45
46 /** @defgroup APP_DRIVER_CONFIG DRIVER CONFIG
47 * @brief APP DRIVER CONFIG
48 * @{
49 */
50
51
52 #ifndef _APP_DRV_CONFIG_H_
53 #define _APP_DRV_CONFIG_H_
54
55 #include "custom_config.h"
56
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 #define APP_DVR_LOG_LVL_NONE (0) /**< None log level define */
61 #define APP_DVR_LOG_LVL_ERR (1) /**< Error log level define */
62 #define APP_DVR_LOG_LVL_WARN (2) /**< Warning log level define */
63 #define APP_DVR_LOG_LVL_INFO (3) /**< Info log level define */
64
65 #ifndef APP_DRV_LOG_LEVEL
66 #define APP_DRV_LOG_LEVEL APP_DVR_LOG_LVL_NONE /**< App driver log level setting */
67 #endif
68 #ifndef APP_DRV_LOG_INTERFACE
69 #define APP_DRV_LOG_INTERFACE printf /**< App driver log interface setting */
70 #endif
71 #ifndef APP_DRV_ASSERT_ENABLE
72 #define APP_DRV_ASSERT_ENABLE 0 /**< App driver assert enable */
73 #endif
74
75 #define APP_DRIVER_GR551X 0x0 /**< APP_DRIVER for GR551X */
76 #define APP_DRIVER_GR5525X 0x1 /**< APP_DRIVER for GR5525X */
77 #define APP_DRIVER_GR5526X 0x2 /**< APP_DRIVER for GR5526X */
78 #define APP_DRIVER_GR5332X 0x3 /**< APP_DRIVER for GR5332X */
79 #define APP_DRIVER_GR5405 0x3 /**< APP_DRIVER for GR5405 */
80
81 #ifdef SOC_GR5515
82 #define APP_DRIVER_CHIP_TYPE APP_DRIVER_GR551X /**< GR5515 chip type*/
83 #define SOC_GPIO_PINS_MAX (32) /**< GR5515 max gpio pins */
84 #define SOC_AON_PINS_MAX (8) /**< GR5515 max aon pins */
85 #elif defined(SOC_GR5X25)
86 #define APP_DRIVER_CHIP_TYPE APP_DRIVER_GR5525X /**< GR5525 chip type*/
87 #define SOC_GPIO_PINS_MAX (32) /**< GR5525 max gpio pins */
88 #define SOC_AON_PINS_MAX (8) /**< GR5525 max aon pins */
89 #elif defined(SOC_GR5526)
90 #define APP_DRIVER_CHIP_TYPE APP_DRIVER_GR5526X /**< GR5526 chip type*/
91 #define SOC_GPIO_PINS_MAX (34) /**< GR5526 max gpio pins */
92 #define SOC_AON_PINS_MAX (8) /**< GR5526 max aon pins */
93 #elif defined(SOC_GR533X)
94 #define APP_DRIVER_CHIP_TYPE APP_DRIVER_GR5332X /**< GR533X chip type*/
95 #define SOC_GPIO_PINS_MAX (14) /**< GR533X max gpio pins */
96 #define SOC_AON_PINS_MAX (8) /**< GR533X max aon pins */
97 #elif defined(SOC_GR5405)
98 #define APP_DRIVER_CHIP_TYPE APP_DRIVER_GR5405 /**< GR5405 chip type*/
99 #define SOC_GPIO_PINS_MAX (14) /**< GR5405 max gpio pins */
100 #define SOC_AON_PINS_MAX (8) /**< GR5405 max aon pins */
101 #endif
102 /**
103 * @defgroup APP_DRV_PERIPHERAL_PRIORITY_DEFINE Defines
104 * @{
105 */
106 /**@brief APP driver peripheral priority define. */
107 #ifndef APP_DRIVER_ADC_WAKEUP_PRIORITY
108 #define APP_DRIVER_ADC_WAKEUP_PRIORITY WAKEUP_PRIORITY_HIGH /**< ADC Wakeup priority High */
109 #endif
110
111 #ifndef APP_DRIVER_AES_WAKEUP_PRIORITY
112 #define APP_DRIVER_AES_WAKEUP_PRIORITY WAKEUP_PRIORITY_MID /**< AES Wakeup priority Mid */
113 #endif
114
115 #ifndef APP_DRIVER_COMP_WAKEUP_PRIORITY
116 #define APP_DRIVER_COMP_WAKEUP_PRIORITY WAKEUP_PRIORITY_LOW /**< COMP Wakeup priority Low */
117 #endif
118
119 #ifndef APP_DRIVER_DUAL_TIM_WAKEUP_PRIORITY
120 #define APP_DRIVER_DUAL_TIM_WAKEUP_PRIORITY WAKEUP_PRIORITY_MID /**< DUAL TIM Wakeup priority Mid */
121 #endif
122
123 #ifndef APP_DRIVER_DMA_WAKEUP_PRIORITY
124 #define APP_DRIVER_DMA_WAKEUP_PRIORITY WAKEUP_PRIORITY_HIGH /**< DMA Wakeup priority High */
125 #endif
126
127 #ifndef APP_DRIVER_UART_WAKEUP_PRIORITY
128 #define APP_DRIVER_UART_WAKEUP_PRIORITY WAKEUP_PRIORITY_HIGH /**< Uart Wakeup priority High */
129 #endif
130
131 #ifndef APP_DRIVER_HMAC_WAKEUP_PRIORITY
132 #define APP_DRIVER_HMAC_WAKEUP_PRIORITY WAKEUP_PRIORITY_MID /**< Hmac Wakeup priority Mid */
133 #endif
134
135 #ifndef APP_DRIVER_I2C_WAKEUP_PRIORITY
136 #define APP_DRIVER_I2C_WAKEUP_PRIORITY WAKEUP_PRIORITY_HIGH /**< I2C Wakeup priority High */
137 #endif
138
139 #ifndef APP_DRIVER_I2S_WAKEUP_PRIORITY
140 #define APP_DRIVER_I2S_WAKEUP_PRIORITY WAKEUP_PRIORITY_HIGH /**< I2S Wakeup priority High */
141 #endif
142
143 #ifndef APP_DRIVER_QSPI_WAKEUP_PRIORITY
144 #define APP_DRIVER_QSPI_WAKEUP_PRIORITY WAKEUP_PRIORITY_HIGH /**< QSPI Wakeup priority High */
145 #endif
146
147 #ifndef APP_DRIVER_RNG_WAKEUP_PRIORITY
148 #define APP_DRIVER_RNG_WAKEUP_PRIORITY WAKEUP_PRIORITY_MID /**< RNG Wakeup priority Mid */
149 #endif
150
151 #ifndef APP_DRIVER_SPI_WAKEUP_PRIORITY
152 #define APP_DRIVER_SPI_WAKEUP_PRIORITY WAKEUP_PRIORITY_HIGH /**< SPI Wakeup priority High */
153 #endif
154
155 #ifndef APP_DRIVER_TIM_WAKEUP_PRIORITY
156 #define APP_DRIVER_TIM_WAKEUP_PRIORITY WAKEUP_PRIORITY_MID /**< TIM Wakeup priority Mid */
157 #endif
158
159 #ifndef APP_DRIVER_PWM_WAKEUP_PRIORITY
160 #define APP_DRIVER_PWM_WAKEUP_PRIORITY WAKEUP_PRIORITY_MID /**< PWM Wakeup priority Mid */
161 #endif
162
163 #ifndef APP_DRIVER_ISO7816_WAKEUP_PRIORITY
164 #define APP_DRIVER_ISO7816_WAKEUP_PRIORITY WAKEUP_PRIORITY_HIGH /**< ISO7816 Wakeup priority High */
165 #endif
166
167 #ifndef APP_DRIVER_PKC_WAKEUP_PRIORITY
168 #define APP_DRIVER_PKC_WAKEUP_PRIORITY WAKEUP_PRIORITY_HIGH /**< PKC Wakeup priority High */
169 #endif
170
171 #if (APP_DRIVER_CHIP_TYPE == APP_DRIVER_GR5526X || APP_DRIVER_CHIP_TYPE == APP_DRIVER_GR5525X)
172 #ifndef APP_DRIVER_DSPI_WAKEUP_PRIORITY
173 #define APP_DRIVER_DSPI_WAKEUP_PRIORITY WAKEUP_PRIORITY_HIGH /**< DSPI Wakeup priority High */
174 #endif
175
176 #ifndef APP_DRIVER_PDM_WAKEUP_PRIORITY
177 #define APP_DRIVER_PDM_WAKEUP_PRIORITY WAKEUP_PRIORITY_HIGH /**< PDM Wakeup priority High */
178 #endif
179 #endif
180
181 /**@} */
182
183
184 /**@addtogroup APP_DRV_WAKEUP_PRIORITY_ENUM Enumerations
185 * @{
186 */
187 /**@brief APP driver peripheral wakeup priority define. */
188 typedef enum
189 {
190 WAKEUP_PRIORITY_LOW = 1, /**< Wakeup priority low */
191 WAKEUP_PRIORITY_MID, /**< Wakeup priority mid */
192 WAKEUP_PRIORITY_HIGH /**< Wakeup priority high */
193 } wakeup_priority_t;
194 /** @} */
195
196 #ifndef APP_DRIVER_WAKEUP_CALL_FUN
197 //#define APP_DRIVER_WAKEUP_CALL_FUN
198 #endif
199
200 #ifdef __cplusplus
201 }
202 #endif
203
204 #endif
205
206 /** @} */
207 /** @} */
208 /** @} */
209
WAKEUP_PRIORITY_LOW
@ WAKEUP_PRIORITY_LOW
Definition: app_drv_config.h:190
wakeup_priority_t
wakeup_priority_t
APP driver peripheral wakeup priority define.
Definition: app_drv_config.h:189
WAKEUP_PRIORITY_MID
@ WAKEUP_PRIORITY_MID
Definition: app_drv_config.h:191
WAKEUP_PRIORITY_HIGH
@ WAKEUP_PRIORITY_HIGH
Definition: app_drv_config.h:192