S32 SDK
pins_driver.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 - 2015, Freescale Semiconductor, Inc.
3  * Copyright 2016 NXP
4  * All rights reserved.
5  *
6  * THIS SOFTWARE IS PROVIDED BY NXP "AS IS" AND ANY EXPRESSED OR
7  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
8  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
9  * IN NO EVENT SHALL NXP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
10  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
11  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
12  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
13  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
14  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
15  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
16  * THE POSSIBILITY OF SUCH DAMAGE.
17  */
18 
19 #ifndef Pins_DRIVER_H
20 #define Pins_DRIVER_H
21 
22 #include <stdint.h>
23 #include "device_registers.h"
24 #include "status.h"
25 #include "port_hal.h"
26 #include "gpio_hal.h"
27 
113 /*******************************************************************************
114  * Definitions
115  ******************************************************************************/
116 
117 
122 typedef enum {
127 
134 typedef struct
135 {
137  uint32_t pinPortIdx;
138 #if FEATURE_PORT_HAS_PULL_SELECTION
140 #endif
141 #if FEATURE_PORT_HAS_SLEW_RATE
142  port_slew_rate_t rateSelect;
143 #endif
144 #if FEATURE_PORT_HAS_PASSIVE_FILTER
146 #endif
147 #if FEATURE_PORT_HAS_OPEN_DRAIN
148  bool openDrain;
149 #endif
150 #if FEATURE_PORT_HAS_DRIVE_STRENGTH
152 #endif
154 #if FEATURE_PORT_HAS_PIN_CONTROL_LOCK
155  bool pinLock;
156 #endif
163 
164 /*******************************************************************************
165  * API
166  ******************************************************************************/
172 #if defined(__cplusplus)
173 extern "C" {
174 #endif
175 
186 status_t PINS_DRV_Init(const uint32_t pin_count, const pin_settings_config_t config[]);
187 
188 
190 #if defined(__cplusplus)
191 }
192 #endif
193 
196 #endif /* Pins_DRIVER_H */
197 /*******************************************************************************
198  * EOF
199  ******************************************************************************/
port_pull_config_t pullConfig
Definition: pins_driver.h:139
port_interrupt_config_t intConfig
Definition: pins_driver.h:157
port_mux_t mux
Configures the drive strength.
Definition: pins_driver.h:153
GPIO_Type * gpioBase
Definition: pins_driver.h:159
port_drive_strength_t driveSelect
Definition: pins_driver.h:151
port_pull_config_t
Internal resistor pull feature selection Implements : port_pull_config_t_Class.
Definition: port_hal.h:64
port_interrupt_config_t
Configures the interrupt generation condition. Implements : port_interrupt_config_t_Class.
Definition: port_hal.h:123
port_drive_strength_t
Configures the drive strength. Implements : port_drive_strength_t_Class.
Definition: port_hal.h:87
status_t
Status return codes. Common error codes will be a unified enumeration (C enum) that will contain all ...
Definition: status.h:31
port_data_direction_t
Configures the port data direction Implements : port_data_direction_t_Class.
Definition: pins_driver.h:122
Defines the converter configuration.
Definition: pins_driver.h:134
port_data_direction_t direction
Definition: pins_driver.h:160
bool pinLock
Pin mux selection.
Definition: pins_driver.h:155
port_mux_t
Pin mux selection Implements : port_mux_t_Class.
Definition: port_hal.h:97
status_t PINS_DRV_Init(const uint32_t pin_count, const pin_settings_config_t config[])
Initializes the pins with the given configuration structure.
Definition: pins_driver.c:58