app_gpiote.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file app_gpiote.h
5 * @author BLE Driver Team
6 * @brief Header file containing functions prototypes of GPIO Interrupt app library.
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_GPIO_INTERRUPT GPIO INTERRUPT
47 * @brief GPIO INTERRUPT APP module driver.
48 * @{
49 */
50
51
52 #ifndef _APP_GPIOTE_H_
53 #define _APP_GPIOTE_H_
54
55 #include "app_io.h"
56 #include "app_drv_error.h"
57
58 /** @addtogroup APP_GPIO_INTERRUPT_STRUCTURES Structures
59 * @{
60 */
61
62 /**
63 * @brief GPIOTE Interrupt parameters structure definition
64 */
65 typedef struct
66 {
67 app_io_type_t type; /**< Specifies IO type */
68 uint32_t pin; /**< Specifies the IO pins to be configured. */
69 app_io_mode_t mode; /**< Specifies the IO mode for the selected pins. */
70 app_io_pull_t pull; /**< Specifies the Pull-up or Pull-Down activation for the selected pins. */
71 app_io_callback_t io_evt_cb; /**< IO callback function. */
72 } app_gpiote_param_t;
73
74 /** @} */
75
76 /* Exported functions --------------------------------------------------------*/
77 /** @addtogroup APP_GPIOTE_DRIVER_FUNCTIONS Functions
78 * @{
79 */
80
81 /**
82 ****************************************************************************************
83 * @brief Initialize the APP GPIO Interrupt DRIVER according to the specified parameters
84 * in the app_gpiote_param_t and app_gpiote_event_handler_t.
85 *
86 * @param[in] p_params: Pointer to app_gpiote_param_t parameter which contains the
87 * configuration information for the specified GPIO.
88 * @param[in] table_cnt: Used GPIO number.
89 *
90 * @return Result of initialization.
91 ****************************************************************************************
92 */
93 uint16_t app_gpiote_init(const app_gpiote_param_t *p_params, uint8_t table_cnt);
94
95 /**
96 ****************************************************************************************
97 * @brief Config the APP GPIO Interrupt DRIVER according to the specified parameters
98 * in the app_gpiote_param_t.
99 *
100 * @param[in] p_config: Pointer to app_gpiote_param_t parameter which contains the
101 * configuration information for the specified GPIO.
102 *
103 * @return Result of initialization.
104 ****************************************************************************************
105 */
106 uint16_t app_gpiote_config(const app_gpiote_param_t *p_config);
107
108 /**
109 ****************************************************************************************
110 * @brief De-initialize the APP GPIO Interrupt DRIVER peripheral.
111 *
112 * @param[in] type: GPIO type, See app_io_type_t.
113 * @param[in] pin: The pin want to unregister.
114 *
115 * @return Result of unregister.
116 ****************************************************************************************
117 */
118 uint16_t app_gpiote_deinit(app_io_type_t type, uint32_t pin);
119
120 /** @} */
121
122 #endif
123
124 /** @} */
125 /** @} */
126 /** @} */
app_gpiote_param_t::pull
app_io_pull_t pull
Specifies the Pull-up or Pull-Down activation for the selected pins.
Definition: app_gpiote.h:70
app_io_callback_t
void(* app_io_callback_t)(app_io_evt_t *p_evt)
GPIO callback type.
Definition: app_io.h:339
app_gpiote_config
uint16_t app_gpiote_config(const app_gpiote_param_t *p_config)
Config the APP GPIO Interrupt DRIVER according to the specified parameters in the app_gpiote_param_t.
app_gpiote_param_t::mode
app_io_mode_t mode
Specifies the IO mode for the selected pins.
Definition: app_gpiote.h:69
app_io_pull_t
app_io_pull_t
GPIO pull Enumerations definition.
Definition: app_io.h:181
app_io_type_t
app_io_type_t
GPIO type Enumerations definition.
Definition: app_io.h:145
app_io_mode_t
app_io_mode_t
GPIO mode Enumerations definition.
Definition: app_io.h:161
app_gpiote_init
uint16_t app_gpiote_init(const app_gpiote_param_t *p_params, uint8_t table_cnt)
Initialize the APP GPIO Interrupt DRIVER according to the specified parameters in the app_gpiote_para...
app_io.h
Header file containing functions prototypes of GPIO app library.
app_gpiote_deinit
uint16_t app_gpiote_deinit(app_io_type_t type, uint32_t pin)
De-initialize the APP GPIO Interrupt DRIVER peripheral.
app_gpiote_param_t::io_evt_cb
app_io_callback_t io_evt_cb
IO callback function.
Definition: app_gpiote.h:71
app_gpiote_param_t
GPIOTE Interrupt parameters structure definition.
Definition: app_gpiote.h:66
app_gpiote_param_t::pin
uint32_t pin
Specifies the IO pins to be configured.
Definition: app_gpiote.h:68
app_gpiote_param_t::type
app_io_type_t type
Specifies IO type.
Definition: app_gpiote.h:67
app_drv_error.h
Header file of app driver error code.