LPCOpen Platform
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
CHIP: LPC18xx/43xx GPIO Driver

Functions

STATIC INLINE void Chip_GPIO_Init (void)
 Initialize GPIO block.
 
STATIC INLINE void Chip_GPIO_WritePortBit (uint32_t Port, uint8_t Bit, bool Setting)
 Set a GPIO port/bit state.
 
STATIC INLINE void Chip_GPIO_WriteDirBit (uint32_t Port, uint8_t Bit, bool Setting)
 Seta GPIO direction.
 
STATIC INLINE bool Chip_GPIO_ReadPortBit (uint32_t Port, uint8_t Bit)
 Read a GPIO state.
 
STATIC INLINE bool Chip_GPIO_ReadDirBit (uint32_t Port, uint8_t Bit)
 Read a GPIO direction (out ot in)
 
STATIC INLINE void Chip_GPIO_IntCmd (uint8_t PortNum, uint8_t BitValue, Gpio_PinInt_Mode_Enum IntMode)
 Enable GPIO Interrupt.
 
STATIC INLINE bool Chip_GPIO_IntGetStatus (uint8_t PortNum, uint8_t PinNum, uint8_t IntMode)
 Get GPIO Interrupt Status.
 
STATIC INLINE void Chip_GPIO_IntClear (uint8_t PortNum, uint8_t BitValue)
 Clear GPIO Interrupt (Edge interrupt cases only)
 
STATIC INLINE void Chip_GPIOGP_IntInit (IP_GPIOGROUPINT_001_Type *pGPIOGPINT, uint8_t PortComb, uint8_t PortTrigger)
 GPIO Group Interrupt Pin Initialization.
 
STATIC INLINE void Chip_GPIOGP_IntPinAdd (IP_GPIOGROUPINT_001_Type *pGPIOGPINT, uint8_t PortNum, uint8_t PinNum, bool ActiveMode)
 GPIO Group Interrupt Pin Add to Group.
 
STATIC INLINE void Chip_GPIOGP_IntPinRemove (IP_GPIOGROUPINT_001_Type *pGPIOGPINT, uint8_t PortNum, uint8_t PinNum)
 GPIO Group Interrupt Pin Remove from Group.
 
STATIC INLINE bool Chip_GPIOGP_IntGetStatus (IP_GPIOGROUPINT_001_Type *pGPIOGPINT)
 Get GPIO Group Interrupt Get Status.
 
STATIC INLINE void Chip_GPIOGP_IntClear (IP_GPIOGROUPINT_001_Type *pGPIOGPINT)
 Clear GPIO Group Interrupt.
 
void Chip_GPIO_SetDir (uint8_t portNum, uint32_t bitValue, uint8_t out)
 Set Direction for a GPIO port.
 
STATIC INLINE void Chip_FIO_SetDir (uint8_t portNum, uint32_t bitValue, uint8_t out)
 Set Direction for a GPIO port.
 
STATIC INLINE void Chip_FIO_SetValue (uint8_t portNum, uint32_t bitValue)
 Set a GPIO port/bit to the high state.
 
STATIC INLINE void Chip_FIO_ClearValue (uint8_t portNum, uint32_t bitValue)
 Set a GPIO port/bit to the low state.
 
STATIC INLINE uint32_t Chip_FIO_ReadValue (uint8_t portNum)
 Read current bit states for the selected port.
 
STATIC INLINE void Chip_GPIO_SetValue (uint8_t portNum, uint32_t bitValue)
 Set a GPIO port/bit to the high state.
 
STATIC INLINE void Chip_GPIO_ClearValue (uint8_t portNum, uint32_t bitValue)
 Set a GPIO port/bit to the low state.
 
STATIC INLINE uint32_t Chip_GPIO_ReadValue (uint8_t portNum)
 Read current bit states for the selected port.
 

Detailed Description

Function Documentation

STATIC INLINE void Chip_FIO_ClearValue ( uint8_t  portNum,
uint32_t  bitValue 
)

Set a GPIO port/bit to the low state.

Parameters
portNum: Port number
bitValue: Bit(s) in the port to set low
Returns
None Any bit set as a '0' will not have it's state changed. This only applies to ports configured as an output.

Definition at line 243 of file gpio_18xx_43xx.h.

STATIC INLINE uint32_t Chip_FIO_ReadValue ( uint8_t  portNum)

Read current bit states for the selected port.

Parameters
portNum: Port number to read
Returns
Current value of GPIO port The current states of the bits for the port are read, regardless of whether the GPIO port bits are input or output.

Definition at line 256 of file gpio_18xx_43xx.h.

STATIC INLINE void Chip_FIO_SetDir ( uint8_t  portNum,
uint32_t  bitValue,
uint8_t  out 
)

Set Direction for a GPIO port.

Parameters
portNum: Port Number
bitValue: GPIO bit to set
out: Direction value, 0 = input, !0 = output
Returns
None Bits set to '0' are not altered.

Definition at line 215 of file gpio_18xx_43xx.h.

STATIC INLINE void Chip_FIO_SetValue ( uint8_t  portNum,
uint32_t  bitValue 
)

Set a GPIO port/bit to the high state.

Parameters
portNum: Port number
bitValue: Bit(s) in the port to set high
Returns
None Any bit set as a '0' will not have it's state changed. This only applies to ports configured as an output.

Definition at line 229 of file gpio_18xx_43xx.h.

STATIC INLINE void Chip_GPIO_ClearValue ( uint8_t  portNum,
uint32_t  bitValue 
)

Set a GPIO port/bit to the low state.

Parameters
portNum: Port number
bitValue: Bit(s) in the port to set low
Returns
None Any bit set as a '0' will not have it's state changed. This only applies to ports configured as an output.

Definition at line 283 of file gpio_18xx_43xx.h.

STATIC INLINE void Chip_GPIO_Init ( void  )

Initialize GPIO block.

Returns
Nothing

Definition at line 47 of file gpio_18xx_43xx.h.

STATIC INLINE void Chip_GPIO_IntClear ( uint8_t  PortNum,
uint8_t  BitValue 
)

Clear GPIO Interrupt (Edge interrupt cases only)

Parameters
PortNum: GPIO port number interrupt, should be: 0 to 7
BitValue: GPIO bit to clear (Not used)
Returns
None

Definition at line 132 of file gpio_18xx_43xx.h.

STATIC INLINE void Chip_GPIO_IntCmd ( uint8_t  PortNum,
uint8_t  BitValue,
Gpio_PinInt_Mode_Enum  IntMode 
)

Enable GPIO Interrupt.

Parameters
PortNum: GPIO port number interrupt, should be: 0 to 7
BitValue: GPIO bit to enable (Not used)
IntMode: Interrupt mode, should be: 0: Rising edge interrupt mode 1: Falling edge interrupt mode 2: Active-High interrupt mode 3: Active-Low interrupt mode
Returns
None

Definition at line 109 of file gpio_18xx_43xx.h.

STATIC INLINE bool Chip_GPIO_IntGetStatus ( uint8_t  PortNum,
uint8_t  PinNum,
uint8_t  IntMode 
)

Get GPIO Interrupt Status.

Parameters
PortNum: GPIO port number interrupt, should be: 0 to 7
PinNum: GPIO pin to check (Not used)
IntMode: Interrupt mode (Not used)
Returns
true if interrupt is pending, otherwise false

Definition at line 121 of file gpio_18xx_43xx.h.

STATIC INLINE bool Chip_GPIO_ReadDirBit ( uint32_t  Port,
uint8_t  Bit 
)

Read a GPIO direction (out ot in)

Parameters
Port: GPIO port to read
Bit: GPIO bit to read
Returns
true of the GPIO is an output, false if input

Definition at line 93 of file gpio_18xx_43xx.h.

STATIC INLINE bool Chip_GPIO_ReadPortBit ( uint32_t  Port,
uint8_t  Bit 
)

Read a GPIO state.

Parameters
Port: GPIO port to read
Bit: GPIO bit to read
Returns
true of the GPIO is high, false if low

Definition at line 82 of file gpio_18xx_43xx.h.

STATIC INLINE uint32_t Chip_GPIO_ReadValue ( uint8_t  portNum)

Read current bit states for the selected port.

Parameters
portNum: Port number to read
Returns
Current value of GPIO port The current states of the bits for the port are read, regardless of whether the GPIO port bits are input or output.

Definition at line 295 of file gpio_18xx_43xx.h.

void Chip_GPIO_SetDir ( uint8_t  portNum,
uint32_t  bitValue,
uint8_t  out 
)

Set Direction for a GPIO port.

Parameters
portNum: Port Number
bitValue: GPIO bit to set
out: Direction value, 0 = input, !0 = output
Returns
None Bits set to '0' are not altered.

Set Direction for a GPIO port.

Software that is described herein is for illustrative purposes only which provides customers with programming information regarding the LPC products. This software is supplied "AS IS" without any warranties of any kind, and NXP Semiconductors and its licensor disclaim any and all warranties, express or implied, including all implied warranties of merchantability, fitness for a particular purpose and non-infringement of intellectual property rights. NXP Semiconductors assumes no responsibility or liability for the use of the software, conveys no license or rights under any patent, copyright, mask work right, or any other intellectual property rights in or to any products. NXP Semiconductors reserves the right to make changes in the software without notification. NXP Semiconductors also makes no representation or warranty that such application will be suitable for the specified use without further testing or modification.

Permission to use, copy, modify, and distribute this software and its documentation is hereby granted, under NXP Semiconductors' and its licensor's relevant copyrights in the software, without fee, provided that it is used in conjunction with NXP Semiconductors microcontrollers. This copyright, permission, and disclaimer notice must appear in all copies of this code.

Definition at line 45 of file gpio_18xx_43xx.c.

STATIC INLINE void Chip_GPIO_SetValue ( uint8_t  portNum,
uint32_t  bitValue 
)

Set a GPIO port/bit to the high state.

Parameters
portNum: Port number
bitValue: Bit(s) in the port to set high
Returns
None Any bit set as a '0' will not have it's state changed. This only applies to ports configured as an output.

Definition at line 270 of file gpio_18xx_43xx.h.

STATIC INLINE void Chip_GPIO_WriteDirBit ( uint32_t  Port,
uint8_t  Bit,
bool  Setting 
)

Seta GPIO direction.

Parameters
Port: GPIO port to set
Bit: GPIO bit to set
Setting: true for output, false for input
Returns
Nothing

Definition at line 71 of file gpio_18xx_43xx.h.

STATIC INLINE void Chip_GPIO_WritePortBit ( uint32_t  Port,
uint8_t  Bit,
bool  Setting 
)

Set a GPIO port/bit state.

Parameters
Port: GPIO port to set
Bit: GPIO bit to set
Setting: true for high, false for low
Returns
Nothing

Definition at line 59 of file gpio_18xx_43xx.h.

STATIC INLINE void Chip_GPIOGP_IntClear ( IP_GPIOGROUPINT_001_Type pGPIOGPINT)

Clear GPIO Group Interrupt.

Parameters
pGPIOGPINT: Pointer to GPIOIR register block
Returns
None

Definition at line 192 of file gpio_18xx_43xx.h.

STATIC INLINE bool Chip_GPIOGP_IntGetStatus ( IP_GPIOGROUPINT_001_Type pGPIOGPINT)

Get GPIO Group Interrupt Get Status.

Parameters
pGPIOGPINT: Pointer to GPIOIR register block
Returns
true if interrupt is pending, otherwise false

Definition at line 182 of file gpio_18xx_43xx.h.

STATIC INLINE void Chip_GPIOGP_IntInit ( IP_GPIOGROUPINT_001_Type pGPIOGPINT,
uint8_t  PortComb,
uint8_t  PortTrigger 
)

GPIO Group Interrupt Pin Initialization.

Parameters
pGPIOGPINT: Pointer to GPIOIR register block
PortComb: GPIO group combined enable, should be: 0 (OR functionality) and 1 (AND functionality)
PortTrigger: GPIO group interrupt trigger, should be: 0 (Edge-triggered) 1 (Level triggered)
Returns
None

Definition at line 144 of file gpio_18xx_43xx.h.

STATIC INLINE void Chip_GPIOGP_IntPinAdd ( IP_GPIOGROUPINT_001_Type pGPIOGPINT,
uint8_t  PortNum,
uint8_t  PinNum,
bool  ActiveMode 
)

GPIO Group Interrupt Pin Add to Group.

Parameters
pGPIOGPINT: Pointer to GPIOIR register block
PortNum: GPIO port number, should be 0 to 7
PinNum: GPIO pin number, should be 0 to 31
ActiveMode: GPIO active mode, should be 0 (active LOW) and 1 (active HIGH)
Returns
None

Definition at line 157 of file gpio_18xx_43xx.h.

STATIC INLINE void Chip_GPIOGP_IntPinRemove ( IP_GPIOGROUPINT_001_Type pGPIOGPINT,
uint8_t  PortNum,
uint8_t  PinNum 
)

GPIO Group Interrupt Pin Remove from Group.

Parameters
pGPIOGPINT: Pointer to GPIOIR register block
PortNum: GPIO port number, should be 0 to 7
PinNum: GPIO pin number, should be 0 to 31
Returns
None

Definition at line 172 of file gpio_18xx_43xx.h.