You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

575 line
20 KiB

  1. /*
  2. * Copyright (c) 2015, Freescale Semiconductor, Inc.
  3. * Copyright 2016-2019 NXP
  4. * All rights reserved.
  5. *
  6. * SPDX-License-Identifier: BSD-3-Clause
  7. */
  8. #ifndef _FSL_GPIO_H_
  9. #define _FSL_GPIO_H_
  10. #include "fsl_common.h"
  11. /*!
  12. * @addtogroup gpio
  13. * @{
  14. */
  15. /*******************************************************************************
  16. * Definitions
  17. ******************************************************************************/
  18. /*! @name Driver version */
  19. /*@{*/
  20. /*! @brief GPIO driver version 2.5.1. */
  21. #define FSL_GPIO_DRIVER_VERSION (MAKE_VERSION(2, 5, 1))
  22. /*@}*/
  23. #if defined(FSL_FEATURE_GPIO_REGISTERS_WIDTH) && (FSL_FEATURE_GPIO_REGISTERS_WIDTH == 8U)
  24. #define GPIO_FIT_REG(value) \
  25. ((uint8_t)(value)) /*!< For some platforms with 8-bit register width, cast the type to uint8_t */
  26. #else
  27. #define GPIO_FIT_REG(value) (value)
  28. #endif /*FSL_FEATURE_GPIO_REGISTERS_WIDTH*/
  29. /*! @brief GPIO direction definition */
  30. typedef enum _gpio_pin_direction
  31. {
  32. kGPIO_DigitalInput = 0U, /*!< Set current pin as digital input*/
  33. kGPIO_DigitalOutput = 1U, /*!< Set current pin as digital output*/
  34. } gpio_pin_direction_t;
  35. #if defined(FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER
  36. /*! @brief GPIO checker attribute */
  37. typedef enum _gpio_checker_attribute
  38. {
  39. kGPIO_UsernonsecureRWUsersecureRWPrivilegedsecureRW =
  40. 0x00U, /*!< User nonsecure:Read+Write; User Secure:Read+Write; Privileged Secure:Read+Write */
  41. kGPIO_UsernonsecureRUsersecureRWPrivilegedsecureRW =
  42. 0x01U, /*!< User nonsecure:Read; User Secure:Read+Write; Privileged Secure:Read+Write */
  43. kGPIO_UsernonsecureNUsersecureRWPrivilegedsecureRW =
  44. 0x02U, /*!< User nonsecure:None; User Secure:Read+Write; Privileged Secure:Read+Write */
  45. kGPIO_UsernonsecureRUsersecureRPrivilegedsecureRW =
  46. 0x03U, /*!< User nonsecure:Read; User Secure:Read; Privileged Secure:Read+Write */
  47. kGPIO_UsernonsecureNUsersecureRPrivilegedsecureRW =
  48. 0x04U, /*!< User nonsecure:None; User Secure:Read; Privileged Secure:Read+Write */
  49. kGPIO_UsernonsecureNUsersecureNPrivilegedsecureRW =
  50. 0x05U, /*!< User nonsecure:None; User Secure:None; Privileged Secure:Read+Write */
  51. kGPIO_UsernonsecureNUsersecureNPrivilegedsecureR =
  52. 0x06U, /*!< User nonsecure:None; User Secure:None; Privileged Secure:Read */
  53. kGPIO_UsernonsecureNUsersecureNPrivilegedsecureN =
  54. 0x07U, /*!< User nonsecure:None; User Secure:None; Privileged Secure:None */
  55. kGPIO_IgnoreAttributeCheck = 0x80U, /*!< Ignores the attribute check */
  56. } gpio_checker_attribute_t;
  57. #endif
  58. /*!
  59. * @brief The GPIO pin configuration structure.
  60. *
  61. * Each pin can only be configured as either an output pin or an input pin at a time.
  62. * If configured as an input pin, leave the outputConfig unused.
  63. * Note that in some use cases, the corresponding port property should be configured in advance
  64. * with the PORT_SetPinConfig().
  65. */
  66. typedef struct _gpio_pin_config
  67. {
  68. gpio_pin_direction_t pinDirection; /*!< GPIO direction, input or output */
  69. /* Output configurations; ignore if configured as an input pin */
  70. uint8_t outputLogic; /*!< Set a default output logic, which has no use in input */
  71. } gpio_pin_config_t;
  72. #if (defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT)
  73. /*! @brief Configures the interrupt generation condition. */
  74. typedef enum _gpio_interrupt_config
  75. {
  76. kGPIO_InterruptStatusFlagDisabled = 0x0U, /*!< Interrupt status flag is disabled. */
  77. kGPIO_DMARisingEdge = 0x1U, /*!< ISF flag and DMA request on rising edge. */
  78. kGPIO_DMAFallingEdge = 0x2U, /*!< ISF flag and DMA request on falling edge. */
  79. kGPIO_DMAEitherEdge = 0x3U, /*!< ISF flag and DMA request on either edge. */
  80. kGPIO_FlagRisingEdge = 0x05U, /*!< Flag sets on rising edge. */
  81. kGPIO_FlagFallingEdge = 0x06U, /*!< Flag sets on falling edge. */
  82. kGPIO_FlagEitherEdge = 0x07U, /*!< Flag sets on either edge. */
  83. kGPIO_InterruptLogicZero = 0x8U, /*!< Interrupt when logic zero. */
  84. kGPIO_InterruptRisingEdge = 0x9U, /*!< Interrupt on rising edge. */
  85. kGPIO_InterruptFallingEdge = 0xAU, /*!< Interrupt on falling edge. */
  86. kGPIO_InterruptEitherEdge = 0xBU, /*!< Interrupt on either edge. */
  87. kGPIO_InterruptLogicOne = 0xCU, /*!< Interrupt when logic one. */
  88. kGPIO_ActiveHighTriggerOutputEnable = 0xDU, /*!< Enable active high-trigger output. */
  89. kGPIO_ActiveLowTriggerOutputEnable = 0xEU, /*!< Enable active low-trigger output. */
  90. } gpio_interrupt_config_t;
  91. #endif
  92. /*! @} */
  93. /*******************************************************************************
  94. * API
  95. ******************************************************************************/
  96. #if defined(__cplusplus)
  97. extern "C" {
  98. #endif
  99. /*!
  100. * @addtogroup gpio_driver
  101. * @{
  102. */
  103. /*! @name GPIO Configuration */
  104. /*@{*/
  105. /*!
  106. * @brief Initializes a GPIO pin used by the board.
  107. *
  108. * To initialize the GPIO, define a pin configuration, as either input or output, in the user file.
  109. * Then, call the GPIO_PinInit() function.
  110. *
  111. * This is an example to define an input pin or an output pin configuration.
  112. * @code
  113. * Define a digital input pin configuration,
  114. * gpio_pin_config_t config =
  115. * {
  116. * kGPIO_DigitalInput,
  117. * 0,
  118. * }
  119. * Define a digital output pin configuration,
  120. * gpio_pin_config_t config =
  121. * {
  122. * kGPIO_DigitalOutput,
  123. * 0,
  124. * }
  125. * @endcode
  126. *
  127. * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.)
  128. * @param pin GPIO port pin number
  129. * @param config GPIO pin configuration pointer
  130. */
  131. void GPIO_PinInit(GPIO_Type *base, uint32_t pin, const gpio_pin_config_t *config);
  132. /*@}*/
  133. /*! @name GPIO Output Operations */
  134. /*@{*/
  135. /*!
  136. * @brief Sets the output level of the multiple GPIO pins to the logic 1 or 0.
  137. *
  138. * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.)
  139. * @param pin GPIO pin number
  140. * @param output GPIO pin output logic level.
  141. * - 0: corresponding pin output low-logic level.
  142. * - 1: corresponding pin output high-logic level.
  143. */
  144. static inline void GPIO_PinWrite(GPIO_Type *base, uint32_t pin, uint8_t output)
  145. {
  146. uint32_t u32flag = 1;
  147. if (output == 0U)
  148. {
  149. base->PCOR = GPIO_FIT_REG(u32flag << pin);
  150. }
  151. else
  152. {
  153. base->PSOR = GPIO_FIT_REG(u32flag << pin);
  154. }
  155. }
  156. /*!
  157. * @brief Sets the output level of the multiple GPIO pins to the logic 1.
  158. *
  159. * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.)
  160. * @param mask GPIO pin number macro
  161. */
  162. static inline void GPIO_PortSet(GPIO_Type *base, uint32_t mask)
  163. {
  164. base->PSOR = GPIO_FIT_REG(mask);
  165. }
  166. /*!
  167. * @brief Sets the output level of the multiple GPIO pins to the logic 0.
  168. *
  169. * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.)
  170. * @param mask GPIO pin number macro
  171. */
  172. static inline void GPIO_PortClear(GPIO_Type *base, uint32_t mask)
  173. {
  174. base->PCOR = GPIO_FIT_REG(mask);
  175. }
  176. /*!
  177. * @brief Reverses the current output logic of the multiple GPIO pins.
  178. *
  179. * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.)
  180. * @param mask GPIO pin number macro
  181. */
  182. static inline void GPIO_PortToggle(GPIO_Type *base, uint32_t mask)
  183. {
  184. base->PTOR = GPIO_FIT_REG(mask);
  185. }
  186. /*@}*/
  187. /*! @name GPIO Input Operations */
  188. /*@{*/
  189. /*!
  190. * @brief Reads the current input value of the GPIO port.
  191. *
  192. * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.)
  193. * @param pin GPIO pin number
  194. * @retval GPIO port input value
  195. * - 0: corresponding pin input low-logic level.
  196. * - 1: corresponding pin input high-logic level.
  197. */
  198. static inline uint32_t GPIO_PinRead(GPIO_Type *base, uint32_t pin)
  199. {
  200. return (((uint32_t)(base->PDIR) >> pin) & 0x01UL);
  201. }
  202. /*@}*/
  203. /*! @name GPIO Interrupt */
  204. /*@{*/
  205. #if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT)
  206. /*!
  207. * @brief Reads the GPIO port interrupt status flag.
  208. *
  209. * If a pin is configured to generate the DMA request, the corresponding flag
  210. * is cleared automatically at the completion of the requested DMA transfer.
  211. * Otherwise, the flag remains set until a logic one is written to that flag.
  212. * If configured for a level sensitive interrupt that remains asserted, the flag
  213. * is set again immediately.
  214. *
  215. * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.)
  216. * @retval The current GPIO port interrupt status flag, for example, 0x00010001 means the
  217. * pin 0 and 17 have the interrupt.
  218. */
  219. uint32_t GPIO_PortGetInterruptFlags(GPIO_Type *base);
  220. /*!
  221. * @brief Clears multiple GPIO pin interrupt status flags.
  222. *
  223. * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.)
  224. * @param mask GPIO pin number macro
  225. */
  226. void GPIO_PortClearInterruptFlags(GPIO_Type *base, uint32_t mask);
  227. #else
  228. /*!
  229. * @brief Configures the gpio pin interrupt/DMA request.
  230. *
  231. * @param base GPIO peripheral base pointer.
  232. * @param pin GPIO pin number.
  233. * @param config GPIO pin interrupt configuration.
  234. * - #kGPIO_InterruptStatusFlagDisabled: Interrupt/DMA request disabled.
  235. * - #kGPIO_DMARisingEdge : DMA request on rising edge(if the DMA requests exit).
  236. * - #kGPIO_DMAFallingEdge: DMA request on falling edge(if the DMA requests exit).
  237. * - #kGPIO_DMAEitherEdge : DMA request on either edge(if the DMA requests exit).
  238. * - #kGPIO_FlagRisingEdge : Flag sets on rising edge(if the Flag states exit).
  239. * - #kGPIO_FlagFallingEdge : Flag sets on falling edge(if the Flag states exit).
  240. * - #kGPIO_FlagEitherEdge : Flag sets on either edge(if the Flag states exit).
  241. * - #kGPIO_InterruptLogicZero : Interrupt when logic zero.
  242. * - #kGPIO_InterruptRisingEdge : Interrupt on rising edge.
  243. * - #kGPIO_InterruptFallingEdge: Interrupt on falling edge.
  244. * - #kGPIO_InterruptEitherEdge : Interrupt on either edge.
  245. * - #kGPIO_InterruptLogicOne : Interrupt when logic one.
  246. * - #kGPIO_ActiveHighTriggerOutputEnable : Enable active high-trigger output (if the trigger states exit).
  247. * - #kGPIO_ActiveLowTriggerOutputEnable : Enable active low-trigger output (if the trigger states exit).
  248. */
  249. static inline void GPIO_SetPinInterruptConfig(GPIO_Type *base, uint32_t pin, gpio_interrupt_config_t config)
  250. {
  251. assert(base);
  252. base->ICR[pin] = GPIO_FIT_REG((base->ICR[pin] & ~GPIO_ICR_IRQC_MASK) | GPIO_ICR_IRQC(config));
  253. }
  254. /*!
  255. * @brief Read the GPIO interrupt status flags.
  256. *
  257. * @param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on.)
  258. * @return The current GPIO's interrupt status flag.
  259. * '1' means the related pin's flag is set, '0' means the related pin's flag not set.
  260. * For example, the return value 0x00010001 means the pin 0 and 17 have the interrupt pending.
  261. */
  262. uint32_t GPIO_GpioGetInterruptFlags(GPIO_Type *base);
  263. /*!
  264. * @brief Read individual pin's interrupt status flag.
  265. *
  266. * @param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on)
  267. * @param pin GPIO specific pin number.
  268. * @return The current selected pin's interrupt status flag.
  269. */
  270. uint8_t GPIO_PinGetInterruptFlag(GPIO_Type *base, uint32_t pin);
  271. /*!
  272. * @brief Clears GPIO pin interrupt status flags.
  273. *
  274. * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.)
  275. * @param mask GPIO pin number macro
  276. */
  277. void GPIO_GpioClearInterruptFlags(GPIO_Type *base, uint32_t mask);
  278. /*!
  279. * @brief Clear GPIO individual pin's interrupt status flag.
  280. *
  281. * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on).
  282. * @param pin GPIO specific pin number.
  283. */
  284. void GPIO_PinClearInterruptFlag(GPIO_Type *base, uint32_t pin);
  285. /*!
  286. * @brief Reads the GPIO DMA request flags.
  287. * The corresponding flag will be cleared automatically at the completion of the requested
  288. * DMA transfer
  289. */
  290. static inline uint32_t GPIO_GetPinsDMARequestFlags(GPIO_Type *base)
  291. {
  292. assert(base);
  293. return (base->ISFR[1]);
  294. }
  295. /*!
  296. * @brief Sets the GPIO interrupt configuration in PCR register for multiple pins.
  297. *
  298. * @param base GPIO peripheral base pointer.
  299. * @param mask GPIO pin number macro.
  300. * @param config GPIO pin interrupt configuration.
  301. * - #kGPIO_InterruptStatusFlagDisabled: Interrupt disabled.
  302. * - #kGPIO_DMARisingEdge : DMA request on rising edge(if the DMA requests exit).
  303. * - #kGPIO_DMAFallingEdge: DMA request on falling edge(if the DMA requests exit).
  304. * - #kGPIO_DMAEitherEdge : DMA request on either edge(if the DMA requests exit).
  305. * - #kGPIO_FlagRisingEdge : Flag sets on rising edge(if the Flag states exit).
  306. * - #kGPIO_FlagFallingEdge : Flag sets on falling edge(if the Flag states exit).
  307. * - #kGPIO_FlagEitherEdge : Flag sets on either edge(if the Flag states exit).
  308. * - #kGPIO_InterruptLogicZero : Interrupt when logic zero.
  309. * - #kGPIO_InterruptRisingEdge : Interrupt on rising edge.
  310. * - #kGPIO_InterruptFallingEdge: Interrupt on falling edge.
  311. * - #kGPIO_InterruptEitherEdge : Interrupt on either edge.
  312. * - #kGPIO_InterruptLogicOne : Interrupt when logic one.
  313. * - #kGPIO_ActiveHighTriggerOutputEnable : Enable active high-trigger output (if the trigger states exit).
  314. * - #kGPIO_ActiveLowTriggerOutputEnable : Enable active low-trigger output (if the trigger states exit)..
  315. */
  316. static inline void GPIO_SetMultipleInterruptPinsConfig(GPIO_Type *base, uint32_t mask, gpio_interrupt_config_t config)
  317. {
  318. assert(base);
  319. if (mask & 0xffffU)
  320. {
  321. base->GICLR = GPIO_FIT_REG((GPIO_ICR_IRQC(config)) | (mask & 0xffffU));
  322. }
  323. mask = mask >> 16U;
  324. if (mask)
  325. {
  326. base->GICHR = GPIO_FIT_REG((GPIO_ICR_IRQC(config)) | (mask & 0xffffU));
  327. }
  328. }
  329. #endif
  330. #if defined(FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER
  331. /*!
  332. * brief The GPIO module supports a device-specific number of data ports, organized as 32-bit
  333. * words/8-bit Bytes. Each 32-bit/8-bit data port includes a GACR register, which defines the byte-level
  334. * attributes required for a successful access to the GPIO programming model. If the GPIO module's GACR register
  335. * organized as 32-bit words, the attribute controls for the 4 data bytes in the GACR follow a standard little
  336. * endian data convention.
  337. *
  338. * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.)
  339. * @param attribute GPIO checker attribute
  340. */
  341. void GPIO_CheckAttributeBytes(GPIO_Type *base, gpio_checker_attribute_t attribute);
  342. #endif
  343. /*@}*/
  344. /*! @} */
  345. /*!
  346. * @addtogroup fgpio_driver
  347. * @{
  348. */
  349. /*
  350. * Introduces the FGPIO feature.
  351. *
  352. * The FGPIO features are only support on some Kinetis MCUs. The FGPIO registers are aliased to the IOPORT
  353. * interface. Accesses via the IOPORT interface occur in parallel with any instruction fetches and
  354. * complete in a single cycle. This aliased Fast GPIO memory map is called FGPIO.
  355. */
  356. #if defined(FSL_FEATURE_SOC_FGPIO_COUNT) && FSL_FEATURE_SOC_FGPIO_COUNT
  357. /*! @name FGPIO Configuration */
  358. /*@{*/
  359. #if defined(FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL) && FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL
  360. /*!
  361. * @brief Initializes the FGPIO peripheral.
  362. *
  363. * This function ungates the FGPIO clock.
  364. *
  365. * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.)
  366. */
  367. void FGPIO_PortInit(FGPIO_Type *base);
  368. #endif /* FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL */
  369. /*!
  370. * @brief Initializes a FGPIO pin used by the board.
  371. *
  372. * To initialize the FGPIO driver, define a pin configuration, as either input or output, in the user file.
  373. * Then, call the FGPIO_PinInit() function.
  374. *
  375. * This is an example to define an input pin or an output pin configuration:
  376. * @code
  377. * Define a digital input pin configuration,
  378. * gpio_pin_config_t config =
  379. * {
  380. * kGPIO_DigitalInput,
  381. * 0,
  382. * }
  383. * Define a digital output pin configuration,
  384. * gpio_pin_config_t config =
  385. * {
  386. * kGPIO_DigitalOutput,
  387. * 0,
  388. * }
  389. * @endcode
  390. *
  391. * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.)
  392. * @param pin FGPIO port pin number
  393. * @param config FGPIO pin configuration pointer
  394. */
  395. void FGPIO_PinInit(FGPIO_Type *base, uint32_t pin, const gpio_pin_config_t *config);
  396. /*@}*/
  397. /*! @name FGPIO Output Operations */
  398. /*@{*/
  399. /*!
  400. * @brief Sets the output level of the multiple FGPIO pins to the logic 1 or 0.
  401. *
  402. * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.)
  403. * @param pin FGPIO pin number
  404. * @param output FGPIOpin output logic level.
  405. * - 0: corresponding pin output low-logic level.
  406. * - 1: corresponding pin output high-logic level.
  407. */
  408. static inline void FGPIO_PinWrite(FGPIO_Type *base, uint32_t pin, uint8_t output)
  409. {
  410. uint32_t u32flag = 1;
  411. if (output == 0U)
  412. {
  413. base->PCOR = u32flag << pin;
  414. }
  415. else
  416. {
  417. base->PSOR = u32flag << pin;
  418. }
  419. }
  420. /*!
  421. * @brief Sets the output level of the multiple FGPIO pins to the logic 1.
  422. *
  423. * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.)
  424. * @param mask FGPIO pin number macro
  425. */
  426. static inline void FGPIO_PortSet(FGPIO_Type *base, uint32_t mask)
  427. {
  428. base->PSOR = mask;
  429. }
  430. /*!
  431. * @brief Sets the output level of the multiple FGPIO pins to the logic 0.
  432. *
  433. * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.)
  434. * @param mask FGPIO pin number macro
  435. */
  436. static inline void FGPIO_PortClear(FGPIO_Type *base, uint32_t mask)
  437. {
  438. base->PCOR = mask;
  439. }
  440. /*!
  441. * @brief Reverses the current output logic of the multiple FGPIO pins.
  442. *
  443. * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.)
  444. * @param mask FGPIO pin number macro
  445. */
  446. static inline void FGPIO_PortToggle(FGPIO_Type *base, uint32_t mask)
  447. {
  448. base->PTOR = mask;
  449. }
  450. /*@}*/
  451. /*! @name FGPIO Input Operations */
  452. /*@{*/
  453. /*!
  454. * @brief Reads the current input value of the FGPIO port.
  455. *
  456. * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.)
  457. * @param pin FGPIO pin number
  458. * @retval FGPIO port input value
  459. * - 0: corresponding pin input low-logic level.
  460. * - 1: corresponding pin input high-logic level.
  461. */
  462. static inline uint32_t FGPIO_PinRead(FGPIO_Type *base, uint32_t pin)
  463. {
  464. return (((base->PDIR) >> pin) & 0x01U);
  465. }
  466. /*@}*/
  467. /*! @name FGPIO Interrupt */
  468. /*@{*/
  469. #if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT)
  470. /*!
  471. * @brief Reads the FGPIO port interrupt status flag.
  472. *
  473. * If a pin is configured to generate the DMA request, the corresponding flag
  474. * is cleared automatically at the completion of the requested DMA transfer.
  475. * Otherwise, the flag remains set until a logic one is written to that flag.
  476. * If configured for a level-sensitive interrupt that remains asserted, the flag
  477. * is set again immediately.
  478. *
  479. * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.)
  480. * @retval The current FGPIO port interrupt status flags, for example, 0x00010001 means the
  481. * pin 0 and 17 have the interrupt.
  482. */
  483. uint32_t FGPIO_PortGetInterruptFlags(FGPIO_Type *base);
  484. /*!
  485. * @brief Clears the multiple FGPIO pin interrupt status flag.
  486. *
  487. * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.)
  488. * @param mask FGPIO pin number macro
  489. */
  490. void FGPIO_PortClearInterruptFlags(FGPIO_Type *base, uint32_t mask);
  491. #endif
  492. #if defined(FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER
  493. /*!
  494. * @brief The FGPIO module supports a device-specific number of data ports, organized as 32-bit
  495. * words. Each 32-bit data port includes a GACR register, which defines the byte-level
  496. * attributes required for a successful access to the GPIO programming model. The attribute controls for the 4 data
  497. * bytes in the GACR follow a standard little endian
  498. * data convention.
  499. *
  500. * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.)
  501. * @param attribute FGPIO checker attribute
  502. */
  503. void FGPIO_CheckAttributeBytes(FGPIO_Type *base, gpio_checker_attribute_t attribute);
  504. #endif /* FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER */
  505. /*@}*/
  506. #endif /* FSL_FEATURE_SOC_FGPIO_COUNT */
  507. #if defined(__cplusplus)
  508. }
  509. #endif
  510. /*!
  511. * @}
  512. */
  513. #endif /* _FSL_GPIO_H_*/