app_drv.h
Go to the documentation of this file.
1 #ifndef __APP_DRV_H__
2 #define __APP_DRV_H__
3
4 #include "app_drv_config.h"
5 #include "app_drv_error.h"
6
7 #ifndef APP_DRV_DEPRECATED
8 #if defined ( __CC_ARM ) || defined ( __GNUC__ )
9 #define APP_DRV_DEPRECATED __attribute__ ((deprecated))
10 #else
11 #define APP_DRV_DEPRECATED
12 #endif
13 #endif
14
15 #ifndef APP_DRV_LOG_INFO
16 #if APP_DRV_LOG_LEVEL >= APP_DVR_LOG_LVL_INFO
17 #define APP_DRV_LOG_INFO(format, ...) APP_DRV_LOG_INTERFACE(format, ##__VA_ARGS__)
18 #else
19 #define APP_DRV_LOG_INFO(...)
20 #endif
21 #endif
22
23 #ifndef APP_DRV_LOG_WARN
24 #if APP_DRV_LOG_LEVEL >= APP_DVR_LOG_LVL_WARN
25 #define APP_DRV_LOG_WARN(format, ...) APP_DRV_LOG_INTERFACE(format, ##__VA_ARGS__)
26 #else
27 #define APP_DRV_LOG_WARN(...)
28 #endif
29 #endif
30
31 #ifndef APP_DRV_LOG_ERR
32 #if APP_DRV_LOG_LEVEL >= APP_DVR_LOG_LVL_ERR
33 #define APP_DRV_LOG_ERR(format, ...) APP_DRV_LOG_INTERFACE(format, ##__VA_ARGS__)
34 #else
35 #define APP_DRV_LOG_ERR(...)
36 #endif
37 #endif
38
39 #ifndef APP_DRV_ASSERT
40 #if APP_DRV_ASSERT_ENABLE
41 #define APP_DRV_ASSERT(x) if(!(x)) { __set_PRIMASK(1); while(1); }
42 #else
43 #define APP_DRV_ASSERT(ignore) ((void)0)
44 #endif
45 #endif
46
47 #ifndef HAL_MAX_DELAY
48 /* 20000ms is the max delay time in 96MHz system clock. */
49 #define APP_DRV_MAX_TIMEOUT (20000U)
50 #else
51 #define APP_DRV_MAX_TIMEOUT HAL_MAX_DELAY
52 #endif
53
54 #ifndef HAL_NEVER_TIMEOUT
55 #define APP_DRV_NEVER_TIMEOUT (0xFFFFFFFFU)
56 #else
57 #define APP_DRV_NEVER_TIMEOUT HAL_NEVER_TIMEOUT
58 #endif
59
60 #endif /* __APP_DRV_H__ */
app_drv_error.h
Header file of app driver error code.
app_drv_config.h
Header file of app driver config code.