rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
fsl_port.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015, Freescale Semiconductor, Inc.
3 * Copyright 2016-2017 NXP
4 * All rights reserved.
5 *
6 * SPDX-License-Identifier: BSD-3-Clause
7 */
8#ifndef _FSL_PORT_H_
9#define _FSL_PORT_H_
10
11#include "fsl_common.h"
12
13/*!
14 * @addtogroup port
15 * @{
16 */
17
18/*******************************************************************************
19 * Definitions
20 ******************************************************************************/
21
22/* Component ID definition, used by tools. */
23#ifndef FSL_COMPONENT_ID
24#define FSL_COMPONENT_ID "platform.drivers.port"
25#endif
26
27/*! @name Driver version */
28/*@{*/
29/*! Version 2.1.0. */
30#define FSL_PORT_DRIVER_VERSION (MAKE_VERSION(2, 1, 0))
31/*@}*/
32
33#if defined(FSL_FEATURE_PORT_HAS_PULL_ENABLE) && FSL_FEATURE_PORT_HAS_PULL_ENABLE
34/*! @brief Internal resistor pull feature selection */
36{
37 kPORT_PullDisable = 0U, /*!< Internal pull-up/down resistor is disabled. */
38 kPORT_PullDown = 2U, /*!< Internal pull-down resistor is enabled. */
39 kPORT_PullUp = 3U, /*!< Internal pull-up resistor is enabled. */
40};
41#endif /* FSL_FEATURE_PORT_HAS_PULL_ENABLE */
42
43#if defined(FSL_FEATURE_PORT_HAS_SLEW_RATE) && FSL_FEATURE_PORT_HAS_SLEW_RATE
44/*! @brief Slew rate selection */
46{
47 kPORT_FastSlewRate = 0U, /*!< Fast slew rate is configured. */
48 kPORT_SlowSlewRate = 1U, /*!< Slow slew rate is configured. */
49};
50#endif /* FSL_FEATURE_PORT_HAS_SLEW_RATE */
51
52#if defined(FSL_FEATURE_PORT_HAS_OPEN_DRAIN) && FSL_FEATURE_PORT_HAS_OPEN_DRAIN
53/*! @brief Open Drain feature enable/disable */
55{
56 kPORT_OpenDrainDisable = 0U, /*!< Open drain output is disabled. */
57 kPORT_OpenDrainEnable = 1U, /*!< Open drain output is enabled. */
58};
59#endif /* FSL_FEATURE_PORT_HAS_OPEN_DRAIN */
60
61#if defined(FSL_FEATURE_PORT_HAS_PASSIVE_FILTER) && FSL_FEATURE_PORT_HAS_PASSIVE_FILTER
62/*! @brief Passive filter feature enable/disable */
64{
65 kPORT_PassiveFilterDisable = 0U, /*!< Passive input filter is disabled. */
66 kPORT_PassiveFilterEnable = 1U, /*!< Passive input filter is enabled. */
67};
68#endif
69
70#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH
71/*! @brief Configures the drive strength. */
73{
74 kPORT_LowDriveStrength = 0U, /*!< Low-drive strength is configured. */
75 kPORT_HighDriveStrength = 1U, /*!< High-drive strength is configured. */
76};
77#endif /* FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH */
78
79#if defined(FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK) && FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK
80/*! @brief Unlock/lock the pin control register field[15:0] */
82{
83 kPORT_UnlockRegister = 0U, /*!< Pin Control Register fields [15:0] are not locked. */
84 kPORT_LockRegister = 1U, /*!< Pin Control Register fields [15:0] are locked. */
85};
86#endif /* FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK */
87
88#if defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && FSL_FEATURE_PORT_PCR_MUX_WIDTH
89/*! @brief Pin mux selection */
90typedef enum _port_mux
91{
92 kPORT_PinDisabledOrAnalog = 0U, /*!< Corresponding pin is disabled, but is used as an analog pin. */
93 kPORT_MuxAsGpio = 1U, /*!< Corresponding pin is configured as GPIO. */
94 kPORT_MuxAlt2 = 2U, /*!< Chip-specific */
95 kPORT_MuxAlt3 = 3U, /*!< Chip-specific */
96 kPORT_MuxAlt4 = 4U, /*!< Chip-specific */
97 kPORT_MuxAlt5 = 5U, /*!< Chip-specific */
98 kPORT_MuxAlt6 = 6U, /*!< Chip-specific */
99 kPORT_MuxAlt7 = 7U, /*!< Chip-specific */
100 kPORT_MuxAlt8 = 8U, /*!< Chip-specific */
101 kPORT_MuxAlt9 = 9U, /*!< Chip-specific */
102 kPORT_MuxAlt10 = 10U, /*!< Chip-specific */
103 kPORT_MuxAlt11 = 11U, /*!< Chip-specific */
104 kPORT_MuxAlt12 = 12U, /*!< Chip-specific */
105 kPORT_MuxAlt13 = 13U, /*!< Chip-specific */
106 kPORT_MuxAlt14 = 14U, /*!< Chip-specific */
107 kPORT_MuxAlt15 = 15U, /*!< Chip-specific */
109#endif /* FSL_FEATURE_PORT_PCR_MUX_WIDTH */
110
111#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT)
112/*! @brief Configures the interrupt generation condition. */
113typedef enum _port_interrupt
114{
115 kPORT_InterruptOrDMADisabled = 0x0U, /*!< Interrupt/DMA request is disabled. */
116#if defined(FSL_FEATURE_PORT_HAS_DMA_REQUEST) && FSL_FEATURE_PORT_HAS_DMA_REQUEST
117 kPORT_DMARisingEdge = 0x1U, /*!< DMA request on rising edge. */
118 kPORT_DMAFallingEdge = 0x2U, /*!< DMA request on falling edge. */
119 kPORT_DMAEitherEdge = 0x3U, /*!< DMA request on either edge. */
120#endif
121#if defined(FSL_FEATURE_PORT_HAS_IRQC_FLAG) && FSL_FEATURE_PORT_HAS_IRQC_FLAG
122 kPORT_FlagRisingEdge = 0x05U, /*!< Flag sets on rising edge. */
123 kPORT_FlagFallingEdge = 0x06U, /*!< Flag sets on falling edge. */
124 kPORT_FlagEitherEdge = 0x07U, /*!< Flag sets on either edge. */
125#endif
126 kPORT_InterruptLogicZero = 0x8U, /*!< Interrupt when logic zero. */
127 kPORT_InterruptRisingEdge = 0x9U, /*!< Interrupt on rising edge. */
128 kPORT_InterruptFallingEdge = 0xAU, /*!< Interrupt on falling edge. */
129 kPORT_InterruptEitherEdge = 0xBU, /*!< Interrupt on either edge. */
130 kPORT_InterruptLogicOne = 0xCU, /*!< Interrupt when logic one. */
131#if defined(FSL_FEATURE_PORT_HAS_IRQC_TRIGGER) && FSL_FEATURE_PORT_HAS_IRQC_TRIGGER
132 kPORT_ActiveHighTriggerOutputEnable = 0xDU, /*!< Enable active high-trigger output. */
133 kPORT_ActiveLowTriggerOutputEnable = 0xEU, /*!< Enable active low-trigger output. */
134#endif
136#endif
137
138#if defined(FSL_FEATURE_PORT_HAS_DIGITAL_FILTER) && FSL_FEATURE_PORT_HAS_DIGITAL_FILTER
139/*! @brief Digital filter clock source selection */
141{
142 kPORT_BusClock = 0U, /*!< Digital filters are clocked by the bus clock. */
143 kPORT_LpoClock = 1U, /*!< Digital filters are clocked by the 1 kHz LPO clock. */
145
146/*! @brief PORT digital filter feature configuration definition */
148{
149 uint32_t digitalFilterWidth; /*!< Set digital filter width */
150 port_digital_filter_clock_source_t clockSource; /*!< Set digital filter clockSource */
152#endif /* FSL_FEATURE_PORT_HAS_DIGITAL_FILTER */
153
154#if defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && FSL_FEATURE_PORT_PCR_MUX_WIDTH
155/*! @brief PORT pin configuration structure */
156typedef struct _port_pin_config
157{
158#if defined(FSL_FEATURE_PORT_HAS_PULL_ENABLE) && FSL_FEATURE_PORT_HAS_PULL_ENABLE
159 uint16_t pullSelect : 2; /*!< No-pull/pull-down/pull-up select */
160#else
161 uint16_t : 2;
162#endif /* FSL_FEATURE_PORT_HAS_PULL_ENABLE */
163
164#if defined(FSL_FEATURE_PORT_HAS_SLEW_RATE) && FSL_FEATURE_PORT_HAS_SLEW_RATE
165 uint16_t slewRate : 1; /*!< Fast/slow slew rate Configure */
166#else
167 uint16_t : 1;
168#endif /* FSL_FEATURE_PORT_HAS_SLEW_RATE */
169
170 uint16_t : 1;
171
172#if defined(FSL_FEATURE_PORT_HAS_PASSIVE_FILTER) && FSL_FEATURE_PORT_HAS_PASSIVE_FILTER
173 uint16_t passiveFilterEnable : 1; /*!< Passive filter enable/disable */
174#else
175 uint16_t : 1;
176#endif /* FSL_FEATURE_PORT_HAS_PASSIVE_FILTER */
177
178#if defined(FSL_FEATURE_PORT_HAS_OPEN_DRAIN) && FSL_FEATURE_PORT_HAS_OPEN_DRAIN
179 uint16_t openDrainEnable : 1; /*!< Open drain enable/disable */
180#else
181 uint16_t : 1;
182#endif /* FSL_FEATURE_PORT_HAS_OPEN_DRAIN */
183
184#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH
185 uint16_t driveStrength : 1; /*!< Fast/slow drive strength configure */
186#else
187 uint16_t : 1;
188#endif
189
190 uint16_t : 1;
191
192#if defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && (FSL_FEATURE_PORT_PCR_MUX_WIDTH == 3)
193 uint16_t mux : 3; /*!< Pin mux Configure */
194 uint16_t : 4;
195#elif defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && (FSL_FEATURE_PORT_PCR_MUX_WIDTH == 4)
196 uint16_t mux : 4; /*!< Pin mux Configure */
197 uint16_t : 3;
198#else
199 uint16_t : 7,
200#endif
201
202#if defined(FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK) && FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK
203 uint16_t lockRegister : 1; /*!< Lock/unlock the PCR field[15:0] */
204#else
205 uint16_t : 1;
206#endif /* FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK */
208#endif /* FSL_FEATURE_PORT_PCR_MUX_WIDTH */
209
210/*******************************************************************************
211* API
212******************************************************************************/
213
214#if defined(__cplusplus)
215extern "C" {
216#endif
217
218#if defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && FSL_FEATURE_PORT_PCR_MUX_WIDTH
219/*! @name Configuration */
220/*@{*/
221
222/*!
223 * @brief Sets the port PCR register.
224 *
225 * This is an example to define an input pin or output pin PCR configuration.
226 * @code
227 * // Define a digital input pin PCR configuration
228 * port_pin_config_t config = {
229 * kPORT_PullUp,
230 * kPORT_FastSlewRate,
231 * kPORT_PassiveFilterDisable,
232 * kPORT_OpenDrainDisable,
233 * kPORT_LowDriveStrength,
234 * kPORT_MuxAsGpio,
235 * kPORT_UnLockRegister,
236 * };
237 * @endcode
238 *
239 * @param base PORT peripheral base pointer.
240 * @param pin PORT pin number.
241 * @param config PORT PCR register configuration structure.
242 */
243static inline void PORT_SetPinConfig(PORT_Type *base, uint32_t pin, const port_pin_config_t *config)
244{
245 assert(config);
246 uint32_t addr = (uint32_t)&base->PCR[pin];
247 *(volatile uint16_t *)(addr) = *((const uint16_t *)config);
248}
249
250/*!
251 * @brief Sets the port PCR register for multiple pins.
252 *
253 * This is an example to define input pins or output pins PCR configuration.
254 * @code
255 * // Define a digital input pin PCR configuration
256 * port_pin_config_t config = {
257 * kPORT_PullUp ,
258 * kPORT_PullEnable,
259 * kPORT_FastSlewRate,
260 * kPORT_PassiveFilterDisable,
261 * kPORT_OpenDrainDisable,
262 * kPORT_LowDriveStrength,
263 * kPORT_MuxAsGpio,
264 * kPORT_UnlockRegister,
265 * };
266 * @endcode
267 *
268 * @param base PORT peripheral base pointer.
269 * @param mask PORT pin number macro.
270 * @param config PORT PCR register configuration structure.
271 */
272static inline void PORT_SetMultiplePinsConfig(PORT_Type *base, uint32_t mask, const port_pin_config_t *config)
273{
274 assert(config);
275
276 uint16_t pcrl = *((const uint16_t *)config);
277
278 if (mask & 0xffffU)
279 {
280 base->GPCLR = ((mask & 0xffffU) << 16) | pcrl;
281 }
282 if (mask >> 16)
283 {
284 base->GPCHR = (mask & 0xffff0000U) | pcrl;
285 }
286}
287
288#if defined(FSL_FEATURE_PORT_HAS_MULTIPLE_IRQ_CONFIG) && FSL_FEATURE_PORT_HAS_MULTIPLE_IRQ_CONFIG
289/*!
290 * @brief Sets the port interrupt configuration in PCR register for multiple pins.
291 *
292 * @param base PORT peripheral base pointer.
293 * @param mask PORT pin number macro.
294 * @param config PORT pin interrupt configuration.
295 * - #kPORT_InterruptOrDMADisabled: Interrupt/DMA request disabled.
296 * - #kPORT_DMARisingEdge : DMA request on rising edge(if the DMA requests exit).
297 * - #kPORT_DMAFallingEdge: DMA request on falling edge(if the DMA requests exit).
298 * - #kPORT_DMAEitherEdge : DMA request on either edge(if the DMA requests exit).
299 * - #kPORT_FlagRisingEdge : Flag sets on rising edge(if the Flag states exit).
300 * - #kPORT_FlagFallingEdge : Flag sets on falling edge(if the Flag states exit).
301 * - #kPORT_FlagEitherEdge : Flag sets on either edge(if the Flag states exit).
302 * - #kPORT_InterruptLogicZero : Interrupt when logic zero.
303 * - #kPORT_InterruptRisingEdge : Interrupt on rising edge.
304 * - #kPORT_InterruptFallingEdge: Interrupt on falling edge.
305 * - #kPORT_InterruptEitherEdge : Interrupt on either edge.
306 * - #kPORT_InterruptLogicOne : Interrupt when logic one.
307 * - #kPORT_ActiveHighTriggerOutputEnable : Enable active high-trigger output (if the trigger states exit).
308 * - #kPORT_ActiveLowTriggerOutputEnable : Enable active low-trigger output (if the trigger states exit)..
309 */
310static inline void PORT_SetMultipleInterruptPinsConfig(PORT_Type *base, uint32_t mask, port_interrupt_t config)
311{
312 assert(config);
313
314 if (mask & 0xffffU)
315 {
316 base->GICLR = (config << 16) | (mask & 0xffffU);
317 }
318 mask = mask >> 16;
319 if (mask)
320 {
321 base->GICHR = (config << 16) | (mask & 0xffffU);
322 }
323}
324#endif
325
326/*!
327 * @brief Configures the pin muxing.
328 *
329 * @param base PORT peripheral base pointer.
330 * @param pin PORT pin number.
331 * @param mux pin muxing slot selection.
332 * - #kPORT_PinDisabledOrAnalog: Pin disabled or work in analog function.
333 * - #kPORT_MuxAsGpio : Set as GPIO.
334 * - #kPORT_MuxAlt2 : chip-specific.
335 * - #kPORT_MuxAlt3 : chip-specific.
336 * - #kPORT_MuxAlt4 : chip-specific.
337 * - #kPORT_MuxAlt5 : chip-specific.
338 * - #kPORT_MuxAlt6 : chip-specific.
339 * - #kPORT_MuxAlt7 : chip-specific.
340 * @Note : This function is NOT recommended to use together with the PORT_SetPinsConfig, because
341 * the PORT_SetPinsConfig need to configure the pin mux anyway (Otherwise the pin mux is
342 * reset to zero : kPORT_PinDisabledOrAnalog).
343 * This function is recommended to use to reset the pin mux
344 *
345 */
346static inline void PORT_SetPinMux(PORT_Type *base, uint32_t pin, port_mux_t mux)
347{
348 base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_MUX_MASK) | PORT_PCR_MUX(mux);
349}
350#endif /* FSL_FEATURE_PORT_PCR_MUX_WIDTH */
351
352#if defined(FSL_FEATURE_PORT_HAS_DIGITAL_FILTER) && FSL_FEATURE_PORT_HAS_DIGITAL_FILTER
353
354/*!
355 * @brief Enables the digital filter in one port, each bit of the 32-bit register represents one pin.
356 *
357 * @param base PORT peripheral base pointer.
358 * @param mask PORT pin number macro.
359 */
360static inline void PORT_EnablePinsDigitalFilter(PORT_Type *base, uint32_t mask, bool enable)
361{
362 if (enable == true)
363 {
364 base->DFER |= mask;
365 }
366 else
367 {
368 base->DFER &= ~mask;
369 }
370}
371
372/*!
373 * @brief Sets the digital filter in one port, each bit of the 32-bit register represents one pin.
374 *
375 * @param base PORT peripheral base pointer.
376 * @param config PORT digital filter configuration structure.
377 */
378static inline void PORT_SetDigitalFilterConfig(PORT_Type *base, const port_digital_filter_config_t *config)
379{
380 assert(config);
381
382 base->DFCR = PORT_DFCR_CS(config->clockSource);
383 base->DFWR = PORT_DFWR_FILT(config->digitalFilterWidth);
384}
385
386#endif /* FSL_FEATURE_PORT_HAS_DIGITAL_FILTER */
387
388/*@}*/
389
390/*! @name Interrupt */
391/*@{*/
392
393#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT)
394/*!
395 * @brief Configures the port pin interrupt/DMA request.
396 *
397 * @param base PORT peripheral base pointer.
398 * @param pin PORT pin number.
399 * @param config PORT pin interrupt configuration.
400 * - #kPORT_InterruptOrDMADisabled: Interrupt/DMA request disabled.
401 * - #kPORT_DMARisingEdge : DMA request on rising edge(if the DMA requests exit).
402 * - #kPORT_DMAFallingEdge: DMA request on falling edge(if the DMA requests exit).
403 * - #kPORT_DMAEitherEdge : DMA request on either edge(if the DMA requests exit).
404 * - #kPORT_FlagRisingEdge : Flag sets on rising edge(if the Flag states exit).
405 * - #kPORT_FlagFallingEdge : Flag sets on falling edge(if the Flag states exit).
406 * - #kPORT_FlagEitherEdge : Flag sets on either edge(if the Flag states exit).
407 * - #kPORT_InterruptLogicZero : Interrupt when logic zero.
408 * - #kPORT_InterruptRisingEdge : Interrupt on rising edge.
409 * - #kPORT_InterruptFallingEdge: Interrupt on falling edge.
410 * - #kPORT_InterruptEitherEdge : Interrupt on either edge.
411 * - #kPORT_InterruptLogicOne : Interrupt when logic one.
412 * - #kPORT_ActiveHighTriggerOutputEnable : Enable active high-trigger output (if the trigger states exit).
413 * - #kPORT_ActiveLowTriggerOutputEnable : Enable active low-trigger output (if the trigger states exit).
414 */
415static inline void PORT_SetPinInterruptConfig(PORT_Type *base, uint32_t pin, port_interrupt_t config)
416{
417 base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_IRQC_MASK) | PORT_PCR_IRQC(config);
418}
419#endif
420
421#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH
422/*!
423 * @brief Configures the port pin drive strength.
424 *
425 * @param base PORT peripheral base pointer.
426 * @param pin PORT pin number.
427 * @param config PORT pin drive strength
428 * - #kPORT_LowDriveStrength = 0U - Low-drive strength is configured.
429 * - #kPORT_HighDriveStrength = 1U - High-drive strength is configured.
430 */
431static inline void PORT_SetPinDriveStrength(PORT_Type *base, uint32_t pin, uint8_t strength)
432{
433 base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_DSE_MASK) | PORT_PCR_DSE(strength);
434}
435#endif
436
437#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT)
438/*!
439 * @brief Reads the whole port status flag.
440 *
441 * If a pin is configured to generate the DMA request, the corresponding flag
442 * is cleared automatically at the completion of the requested DMA transfer.
443 * Otherwise, the flag remains set until a logic one is written to that flag.
444 * If configured for a level sensitive interrupt that remains asserted, the flag
445 * is set again immediately.
446 *
447 * @param base PORT peripheral base pointer.
448 * @return Current port interrupt status flags, for example, 0x00010001 means the
449 * pin 0 and 16 have the interrupt.
450 */
451static inline uint32_t PORT_GetPinsInterruptFlags(PORT_Type *base)
452{
453 return base->ISFR;
454}
455
456/*!
457 * @brief Clears the multiple pin interrupt status flag.
458 *
459 * @param base PORT peripheral base pointer.
460 * @param mask PORT pin number macro.
461 */
462static inline void PORT_ClearPinsInterruptFlags(PORT_Type *base, uint32_t mask)
463{
464 base->ISFR = mask;
465}
466#endif
467
468/*@}*/
469
470#if defined(__cplusplus)
471}
472#endif
473
474/*! @}*/
475
476#endif /* _FSL_PORT_H_ */
constexpr uint8_t addr
Definition ads1015.cpp:14
static constexpr persistent_config_s * config
static void PORT_SetPinInterruptConfig(PORT_Type *base, uint32_t pin, port_interrupt_t config)
Configures the port pin interrupt/DMA request.
Definition fsl_port.h:415
enum _port_interrupt port_interrupt_t
Configures the interrupt generation condition.
static void PORT_SetMultiplePinsConfig(PORT_Type *base, uint32_t mask, const port_pin_config_t *config)
Sets the port PCR register for multiple pins.
Definition fsl_port.h:272
struct _port_digital_filter_config port_digital_filter_config_t
PORT digital filter feature configuration definition.
_port_digital_filter_clock_source
Digital filter clock source selection.
Definition fsl_port.h:141
uint16_t passiveFilterEnable
Definition fsl_port.h:173
_port_drive_strength
Configures the drive strength.
Definition fsl_port.h:73
static void PORT_SetDigitalFilterConfig(PORT_Type *base, const port_digital_filter_config_t *config)
Sets the digital filter in one port, each bit of the 32-bit register represents one pin.
Definition fsl_port.h:378
static void PORT_SetPinDriveStrength(PORT_Type *base, uint32_t pin, uint8_t strength)
Configures the port pin drive strength.
Definition fsl_port.h:431
uint16_t driveStrength
Definition fsl_port.h:185
_port_slew_rate
Slew rate selection.
Definition fsl_port.h:46
uint16_t pullSelect
Definition fsl_port.h:159
static void PORT_SetPinMux(PORT_Type *base, uint32_t pin, port_mux_t mux)
Configures the pin muxing.
Definition fsl_port.h:346
static uint32_t PORT_GetPinsInterruptFlags(PORT_Type *base)
Reads the whole port status flag.
Definition fsl_port.h:451
struct _port_pin_config port_pin_config_t
PORT pin configuration structure.
uint16_t openDrainEnable
Definition fsl_port.h:179
uint16_t uint16_t lockRegister
Definition fsl_port.h:203
_port_open_drain_enable
Open Drain feature enable/disable.
Definition fsl_port.h:55
enum _port_digital_filter_clock_source port_digital_filter_clock_source_t
Digital filter clock source selection.
static void PORT_SetPinConfig(PORT_Type *base, uint32_t pin, const port_pin_config_t *config)
Sets the port PCR register.
Definition fsl_port.h:243
static void PORT_SetMultipleInterruptPinsConfig(PORT_Type *base, uint32_t mask, port_interrupt_t config)
Sets the port interrupt configuration in PCR register for multiple pins.
Definition fsl_port.h:310
_port_lock_register
Unlock/lock the pin control register field[15:0].
Definition fsl_port.h:82
_port_pull
Internal resistor pull feature selection.
Definition fsl_port.h:36
_port_mux
Pin mux selection.
Definition fsl_port.h:91
port_digital_filter_clock_source_t clockSource
Definition fsl_port.h:150
static void PORT_ClearPinsInterruptFlags(PORT_Type *base, uint32_t mask)
Clears the multiple pin interrupt status flag.
Definition fsl_port.h:462
enum _port_mux port_mux_t
Pin mux selection.
static void PORT_EnablePinsDigitalFilter(PORT_Type *base, uint32_t mask, bool enable)
Enables the digital filter in one port, each bit of the 32-bit register represents one pin.
Definition fsl_port.h:360
_port_passive_filter_enable
Passive filter feature enable/disable.
Definition fsl_port.h:64
uint16_t slewRate
Definition fsl_port.h:165
_port_interrupt
Configures the interrupt generation condition.
Definition fsl_port.h:114
@ kPORT_BusClock
Definition fsl_port.h:142
@ kPORT_LpoClock
Definition fsl_port.h:143
@ kPORT_LowDriveStrength
Definition fsl_port.h:74
@ kPORT_HighDriveStrength
Definition fsl_port.h:75
@ kPORT_SlowSlewRate
Definition fsl_port.h:48
@ kPORT_FastSlewRate
Definition fsl_port.h:47
@ kPORT_OpenDrainEnable
Definition fsl_port.h:57
@ kPORT_OpenDrainDisable
Definition fsl_port.h:56
@ kPORT_LockRegister
Definition fsl_port.h:84
@ kPORT_UnlockRegister
Definition fsl_port.h:83
@ kPORT_PullUp
Definition fsl_port.h:39
@ kPORT_PullDisable
Definition fsl_port.h:37
@ kPORT_PullDown
Definition fsl_port.h:38
@ kPORT_MuxAlt4
Definition fsl_port.h:96
@ kPORT_MuxAlt8
Definition fsl_port.h:100
@ kPORT_MuxAlt14
Definition fsl_port.h:106
@ kPORT_MuxAlt11
Definition fsl_port.h:103
@ kPORT_PinDisabledOrAnalog
Definition fsl_port.h:92
@ kPORT_MuxAlt12
Definition fsl_port.h:104
@ kPORT_MuxAlt3
Definition fsl_port.h:95
@ kPORT_MuxAlt7
Definition fsl_port.h:99
@ kPORT_MuxAlt2
Definition fsl_port.h:94
@ kPORT_MuxAlt6
Definition fsl_port.h:98
@ kPORT_MuxAlt5
Definition fsl_port.h:97
@ kPORT_MuxAlt13
Definition fsl_port.h:105
@ kPORT_MuxAsGpio
Definition fsl_port.h:93
@ kPORT_MuxAlt10
Definition fsl_port.h:102
@ kPORT_MuxAlt15
Definition fsl_port.h:107
@ kPORT_MuxAlt9
Definition fsl_port.h:101
@ kPORT_PassiveFilterEnable
Definition fsl_port.h:66
@ kPORT_PassiveFilterDisable
Definition fsl_port.h:65
@ kPORT_InterruptEitherEdge
Definition fsl_port.h:129
@ kPORT_InterruptRisingEdge
Definition fsl_port.h:127
@ kPORT_FlagEitherEdge
Definition fsl_port.h:124
@ kPORT_InterruptOrDMADisabled
Definition fsl_port.h:115
@ kPORT_InterruptLogicZero
Definition fsl_port.h:126
@ kPORT_ActiveHighTriggerOutputEnable
Definition fsl_port.h:132
@ kPORT_InterruptLogicOne
Definition fsl_port.h:130
@ kPORT_FlagFallingEdge
Definition fsl_port.h:123
@ kPORT_DMAEitherEdge
Definition fsl_port.h:119
@ kPORT_DMARisingEdge
Definition fsl_port.h:117
@ kPORT_FlagRisingEdge
Definition fsl_port.h:122
@ kPORT_DMAFallingEdge
Definition fsl_port.h:118
@ kPORT_ActiveLowTriggerOutputEnable
Definition fsl_port.h:133
@ kPORT_InterruptFallingEdge
Definition fsl_port.h:128
static void enable(const char *param)
Definition settings.cpp:441
brain_pin_e pin
Definition stm32_adc.cpp:15
PORT digital filter feature configuration definition.
Definition fsl_port.h:148
PORT pin configuration structure.
Definition fsl_port.h:157