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
80 #ifdef SOC_GR5515
81 #define APP_DRIVER_CHIP_TYPE APP_DRIVER_GR551X /**< GR5515 chip type*/
82 #define SOC_GPIO_PINS_MAX (32) /**< GR5515 max gpio pins */
83 #define SOC_AON_PINS_MAX (8) /**< GR5515 max aon pins */
84 #elif defined(SOC_GR5X25)
85 #define APP_DRIVER_CHIP_TYPE APP_DRIVER_GR5525X /**< GR5525 chip type*/
86 #define SOC_GPIO_PINS_MAX (32) /**< GR5525 max gpio pins */
87 #define SOC_AON_PINS_MAX (8) /**< GR5525 max aon pins */
88 #elif defined(SOC_GR5526)
89 #define APP_DRIVER_CHIP_TYPE APP_DRIVER_GR5526X /**< GR5526 chip type*/
90 #define SOC_GPIO_PINS_MAX (34) /**< GR5526 max gpio pins */
91 #define SOC_AON_PINS_MAX (8) /**< GR5526 max aon pins */
92 #elif defined(SOC_GR533X)
93 #define APP_DRIVER_CHIP_TYPE APP_DRIVER_GR5332X /**< GR533X chip type*/
94 #define SOC_GPIO_PINS_MAX (14) /**< GR533X max gpio pins */
95 #define SOC_AON_PINS_MAX (8) /**< GR533X max aon pins */
96 #endif
97
98 /**
99 * @defgroup APP_DRV_PERIPHERAL_PRIORITY_DEFINE Defines
100 * @{
101 */
102 /**@brief APP driver peripheral priority define. */
103 #ifndef APP_DRIVER_ADC_WAKEUP_PRIORITY
104 #define APP_DRIVER_ADC_WAKEUP_PRIORITY WAKEUP_PRIORITY_HIGH /**< ADC Wakeup priority High */
105 #endif
106
107 #ifndef APP_DRIVER_AES_WAKEUP_PRIORITY
108 #define APP_DRIVER_AES_WAKEUP_PRIORITY WAKEUP_PRIORITY_MID /**< AES Wakeup priority Mid */
109 #endif
110
111 #ifndef APP_DRIVER_COMP_WAKEUP_PRIORITY
112 #define APP_DRIVER_COMP_WAKEUP_PRIORITY WAKEUP_PRIORITY_LOW /**< COMP Wakeup priority Low */
113 #endif
114
115 #ifndef APP_DRIVER_DUAL_TIM_WAKEUP_PRIORITY
116 #define APP_DRIVER_DUAL_TIM_WAKEUP_PRIORITY WAKEUP_PRIORITY_MID /**< DUAL TIM Wakeup priority Mid */
117 #endif
118
119 #ifndef APP_DRIVER_DMA_WAKEUP_PRIORITY
120 #define APP_DRIVER_DMA_WAKEUP_PRIORITY WAKEUP_PRIORITY_HIGH /**< DMA Wakeup priority High */
121 #endif
122
123 #ifndef APP_DRIVER_UART_WAKEUP_PRIORITY
124 #define APP_DRIVER_UART_WAKEUP_PRIORITY WAKEUP_PRIORITY_HIGH /**< Uart Wakeup priority High */
125 #endif
126
127 #ifndef APP_DRIVER_HMAC_WAKEUP_PRIORITY
128 #define APP_DRIVER_HMAC_WAKEUP_PRIORITY WAKEUP_PRIORITY_MID /**< Hmac Wakeup priority Mid */
129 #endif
130
131 #ifndef APP_DRIVER_I2C_WAKEUP_PRIORITY
132 #define APP_DRIVER_I2C_WAKEUP_PRIORITY WAKEUP_PRIORITY_HIGH /**< I2C Wakeup priority High */
133 #endif
134
135 #ifndef APP_DRIVER_I2S_WAKEUP_PRIORITY
136 #define APP_DRIVER_I2S_WAKEUP_PRIORITY WAKEUP_PRIORITY_HIGH /**< I2S Wakeup priority High */
137 #endif
138
139 #ifndef APP_DRIVER_QSPI_WAKEUP_PRIORITY
140 #define APP_DRIVER_QSPI_WAKEUP_PRIORITY WAKEUP_PRIORITY_HIGH /**< QSPI Wakeup priority High */
141 #endif
142
143 #ifndef APP_DRIVER_RNG_WAKEUP_PRIORITY
144 #define APP_DRIVER_RNG_WAKEUP_PRIORITY WAKEUP_PRIORITY_MID /**< RNG Wakeup priority Mid */
145 #endif
146
147 #ifndef APP_DRIVER_SPI_WAKEUP_PRIORITY
148 #define APP_DRIVER_SPI_WAKEUP_PRIORITY WAKEUP_PRIORITY_HIGH /**< SPI Wakeup priority High */
149 #endif
150
151 #ifndef APP_DRIVER_TIM_WAKEUP_PRIORITY
152 #define APP_DRIVER_TIM_WAKEUP_PRIORITY WAKEUP_PRIORITY_MID /**< TIM Wakeup priority Mid */
153 #endif
154
155 #ifndef APP_DRIVER_PWM_WAKEUP_PRIORITY
156 #define APP_DRIVER_PWM_WAKEUP_PRIORITY WAKEUP_PRIORITY_MID /**< PWM Wakeup priority Mid */
157 #endif
158
159 #ifndef APP_DRIVER_ISO7816_WAKEUP_PRIORITY
160 #define APP_DRIVER_ISO7816_WAKEUP_PRIORITY WAKEUP_PRIORITY_HIGH /**< ISO7816 Wakeup priority High */
161 #endif
162
163 #ifndef APP_DRIVER_PKC_WAKEUP_PRIORITY
164 #define APP_DRIVER_PKC_WAKEUP_PRIORITY WAKEUP_PRIORITY_HIGH /**< PKC Wakeup priority High */
165 #endif
166
167 #if (APP_DRIVER_CHIP_TYPE == APP_DRIVER_GR5526X || APP_DRIVER_CHIP_TYPE == APP_DRIVER_GR5525X)
168 #ifndef APP_DRIVER_DSPI_WAKEUP_PRIORITY
169 #define APP_DRIVER_DSPI_WAKEUP_PRIORITY WAKEUP_PRIORITY_HIGH /**< DSPI Wakeup priority High */
170 #endif
171
172 #ifndef APP_DRIVER_PDM_WAKEUP_PRIORITY
173 #define APP_DRIVER_PDM_WAKEUP_PRIORITY WAKEUP_PRIORITY_HIGH /**< PDM Wakeup priority High */
174 #endif
175 #endif
176
177 /**@} */
178
179
180 /**@addtogroup APP_DRV_WAKEUP_PRIORITY_ENUM Enumerations
181 * @{
182 */
183 /**@brief APP driver peripheral wakeup priority define. */
184 typedef enum
185 {
186 WAKEUP_PRIORITY_LOW = 1, /**< Wakeup priority low */
187 WAKEUP_PRIORITY_MID, /**< Wakeup priority mid */
188 WAKEUP_PRIORITY_HIGH /**< Wakeup priority high */
189 } wakeup_priority_t;
190 /** @} */
191
192 #ifndef APP_DRIVER_WAKEUP_CALL_FUN
193 //#define APP_DRIVER_WAKEUP_CALL_FUN
194 #endif
195
196 #ifdef __cplusplus
197 }
198 #endif
199
200 #endif
201
202 /** @} */
203 /** @} */
204 /** @} */
205
WAKEUP_PRIORITY_LOW
@ WAKEUP_PRIORITY_LOW
Definition: app_drv_config.h:186
wakeup_priority_t
wakeup_priority_t
APP driver peripheral wakeup priority define.
Definition: app_drv_config.h:185
WAKEUP_PRIORITY_MID
@ WAKEUP_PRIORITY_MID
Definition: app_drv_config.h:187
WAKEUP_PRIORITY_HIGH
@ WAKEUP_PRIORITY_HIGH
Definition: app_drv_config.h:188