#include "gpio_17xx_40xx.h"
Go to the source code of this file.
|
| #define | LPC17_GPIO_H_ |
| | GPIO functions redirection for LPC17xx.
|
| |
| #define | GPIO_LEVEL_LOW 0 |
| |
| #define | GPIO_LEVEL_HIGH 1 |
| |
| #define | GPIO_DIR_INPUT 0 |
| |
| #define | GPIO_DIR_OUTPUT 1 |
| |
| #define | gpio_init() |
| | Initialize GPIO block.
|
| |
| #define | gpio_read_pin(port, pin) |
| | Reads a GPIO pin state.
|
| |
| #define | gpio_read_port(port) |
| | Reads a GPIO port state.
|
| |
| #define | gpio_set_pin_high(port, pin) |
| | Set an individual GPIO output pin to the high state.
|
| |
| #define | gpio_set_port_high(port, mask) |
| | Set selected GPIO output pins to the high state.
|
| |
| #define | gpio_set_pin_low(port, pin) |
| | Set an individual GPIO output pin to the high state.
|
| |
| #define | gpio_set_port_low(port, mask) |
| | Set selected GPIO output pins to the high state.
|
| |
| #define | gpio_pin_toggle(port, pin) |
| | Toggle an individual GPIO output pin to the opposite state.
|
| |
| #define | gpio_set_pin_state(port, pin, state) |
| | Set a GPIO pin to the specified state.
|
| |
| #define | gpio_set_pin_dir(port, pin, dir) |
| | Set a GPIO pin direction.
|
| |
| #define | gpio_get_pin_dir(port, pin) |
| | Get a GPIO pin direction.
|
| |
| #define | gpio_set_port_dir(port, dir) |
| | Set a GPIO port direction.
|
| |
| #define | gpio_get_port_dir(port) |
| | Get a GPIO port direction.
|
| |
◆ GPIO_DIR_INPUT
◆ GPIO_DIR_OUTPUT
| #define GPIO_DIR_OUTPUT 1 |
◆ gpio_get_pin_dir
| #define gpio_get_pin_dir |
( |
| port, |
|
|
| pin ) |
Value:Chip_GPIO_GetPinDIR(
LPC_GPIO, port, pin )
#define LPC_GPIO
Definition LPC176x5x.h:1793
Get a GPIO pin direction.
- Parameters
-
| port | : GPIO Port number where pin is located |
| pin | : pin number |
- Returns
- Current pin direction ( 0 for INPUT, 1 for OUTPUT )
◆ gpio_get_port_dir
| #define gpio_get_port_dir |
( |
| port | ) |
|
Value:
Get a GPIO port direction.
- Parameters
-
- Returns
- Bitfield indicating all pins current direction (true (1) for OUTPUT, false (0) for INPUT )
◆ gpio_init
Value:
Initialize GPIO block.
- Returns
- Nothing
◆ GPIO_LEVEL_HIGH
| #define GPIO_LEVEL_HIGH 1 |
◆ GPIO_LEVEL_LOW
◆ gpio_pin_toggle
| #define gpio_pin_toggle |
( |
| port, |
|
|
| pin ) |
Value:Chip_GPIO_SetPinToggle(
LPC_GPIO, port, pin )
Toggle an individual GPIO output pin to the opposite state.
- Parameters
-
| port | : GPIO Port number where the pin is located |
| pin | : pin number |
- Note
- This commands only applies for pins selected as outputs. Writing '0' shouldn't affect the pin state
◆ gpio_read_pin
| #define gpio_read_pin |
( |
| port, |
|
|
| pin ) |
Value:Chip_GPIO_GetPinState(
LPC_GPIO, port, pin )
Reads a GPIO pin state.
- Parameters
-
| port | : GPIO Port number where pin is located |
| pin | : GPIO pin to get state for |
- Returns
- true (1) if the GPIO is high, false (0) if low
◆ gpio_read_port
| #define gpio_read_port |
( |
| port | ) |
|
Value:Chip_GPIO_GetPortValue(
LPC_GPIO, port )
Reads a GPIO port state.
- Parameters
-
- Returns
- Current state of all pins in the specified port
◆ gpio_set_pin_dir
| #define gpio_set_pin_dir |
( |
| port, |
|
|
| pin, |
|
|
| dir ) |
Value:Chip_GPIO_SetPinDIR(
LPC_GPIO, port, pin, dir )
Set a GPIO pin direction.
- Parameters
-
| port | : GPIO Port number where pin is located |
| pin | : pin number |
| dir | : true (1) for OUTPUT, false (0) for INPUT |
◆ gpio_set_pin_high
| #define gpio_set_pin_high |
( |
| port, |
|
|
| pin ) |
Value:Chip_GPIO_SetPinOutHigh(
LPC_GPIO, port, pin )
Set an individual GPIO output pin to the high state.
- Parameters
-
| port | : GPIO Port number where pin is located |
| pin | : pin number |
- Note
- This commands only applies for pins selected as outputs. Writing '0' shouldn't affect the pin state
◆ gpio_set_pin_low
| #define gpio_set_pin_low |
( |
| port, |
|
|
| pin ) |
Value:Chip_GPIO_SetPinOutLow(
LPC_GPIO, port, pin )
Set an individual GPIO output pin to the high state.
- Parameters
-
| port | : GPIO Port number where pin is located |
| pin | : pin number |
- Note
- This commands only applies for pins selected as outputs. Writing '0' shouldn't affect the pin state
◆ gpio_set_pin_state
| #define gpio_set_pin_state |
( |
| port, |
|
|
| pin, |
|
|
| state ) |
Value:Chip_GPIO_SetPinState(
LPC_GPIO, port, pin, state )
Set a GPIO pin to the specified state.
- Parameters
-
| port | : GPIO Port number where pin is located |
| pin | : pin number |
| state | : true (1) for high, false (0) for low |
◆ gpio_set_port_dir
| #define gpio_set_port_dir |
( |
| port, |
|
|
| dir ) |
Value:Chip_GPIO_SetPortDIR(
LPC_GPIO, port, dir )
Set a GPIO port direction.
- Parameters
-
| port | : GPIO Port number |
| dir | : Bitfield indicating all pins direction (true (1) for OUTPUT, false (0) for INPUT ) |
◆ gpio_set_port_high
| #define gpio_set_port_high |
( |
| port, |
|
|
| mask ) |
Value:Chip_GPIO_SetPortOutHigh(
LPC_GPIO, port, mask )
Set selected GPIO output pins to the high state.
- Parameters
-
| port | : GPIO Port number where pin is located |
| mask | : Selected pins to set high |
- Note
- This commands only applies for pins selected as outputs. Writing '0' shouldn't affect the pin state
◆ gpio_set_port_low
| #define gpio_set_port_low |
( |
| port, |
|
|
| mask ) |
Value:Chip_GPIO_SetPortOutLow(
LPC_GPIO, port, mask )
Set selected GPIO output pins to the high state.
- Parameters
-
| port | : GPIO Port number where pin is located |
| mask | : Selected pins to set high |
- Note
- This commands only applies for pins selected as outputs. Writing '0' shouldn't affect the pin state
◆ LPC17_GPIO_H_