![]() |
EVE 1.0
|
|
Modules | |
| PCAL9535a GPIO driver | |
| SC16IS7x0 GPIO driver | |
Data Structures | |
| struct | gpio_ext_state_t |
| struct | gpio_ext_init_pin_t |
| struct | gpio_ext_api_t |
| struct | gpio_ext_t |
Typedefs | |
| typedef void(* | gpio_ext_init_t) (const struct gpio_ext_t *GpioExt) |
| Virtual function initializes pins of an gpio expander to default values based on DRIVER_PORT_EXT_INIT_TABLE. | |
| typedef uint16_t(* | gpio_ext_inport_t) (const struct gpio_ext_t *GpioExt) |
| Virtual function reads from gpio expander port. | |
| typedef void(* | gpio_ext_outport_t) (const struct gpio_ext_t *GpioExt, uint16_t Value) |
| Virtual function writes to gpio expander port / pin direction register / pull select register / pull enable register / interrupt enable register / latch enable register. | |
| typedef void(* | gpio_ext_setdrive_t) (const struct gpio_ext_t *GpioExt, uint8_t Values[]) |
| Virtual function sets drive force to gpio expander pins. | |
Enumerations |
Functions called from application programs | |
| void | GpioExtInit (const struct gpio_ext_t *GpioExt) |
| Initialize IO expander driver and chip. More... | |
| static void | GpioExtPortWrite (const struct gpio_ext_t *GpioExt, uint16_t Value, uint16_t Mask) |
| Write 16-bits data to the GPIO port. More... | |
| static void | GpioExtPortSet (const struct gpio_ext_t *GpioExt, uint16_t Mask) |
| Set bits by mask in the GPIO port. More... | |
| static void | GpioExtPortClear (const struct gpio_ext_t *GpioExt, uint16_t Mask) |
| Clear bits by mask in the GPIO port. More... | |
| static void | GpioExtPortToggle (const struct gpio_ext_t *GpioExt, uint16_t Mask) |
| Invert bits by mask in the GPIO port. More... | |
| static void | GpioExtPinWrite (const struct gpio_ext_t *GpioExt, uint16_t Pin, uint16_t Value) |
| Set/clear 1 pin in the GPIO port. More... | |
| static void | GpioExtPinSet (const struct gpio_ext_t *GpioExt, uint16_t Pin) |
| Set 1 pin in the GPIO port. More... | |
| static void | GpioExtPinClear (const struct gpio_ext_t *GpioExt, uint16_t Pin) |
| Clear 1 pin in the GPIO port. More... | |
| static void | GpioExtPinToggle (const struct gpio_ext_t *GpioExt, uint16_t Pin) |
| Invert 1 pin in the GPIO port. More... | |
| static uint16_t | GpioExtPortRead (const struct gpio_ext_t *GpioExt) |
| Read all the pins from the GPIO port. More... | |
| static uint8_t | GpioExtPinRead (const struct gpio_ext_t *GpioExt, uint16_t Pin) |
| Read a pin value from the GPIO port. More... | |
| void | GpioExtPortSetup (const struct gpio_ext_t *GpioExt, uint16_t Direction, uint16_t PullSelect, uint16_t PullEnable, uint16_t Mask) |
| Set IO expander ports to input or output. More... | |
| static uint16_t | GpioExtInterruptsClear (const struct gpio_ext_t *GpioExt, uint16_t Mask) |
| static uint16_t | GpioExtInterruptsRead (const struct gpio_ext_t *GpioExt) |
| static void | GpioExtInterruptsEnable (const struct gpio_ext_t *GpioExt, uint16_t Mask) |
| static void | GpioExtInterruptsDisable (const struct gpio_ext_t *GpioExt, uint16_t Mask) |
| static void | GpioExtSetDrive (const struct gpio_ext_t *GpioExt, uint8_t Values[]) |
| static void | GpioExtSetLatch (const struct gpio_ext_t *GpioExt, uint16_t Mask) |
| static uint8_t | GpioExtCheckStatus (const struct gpio_ext_t *GpioExt) |
| Check status of GpioExt operations and reset status to GPIO_EXT_STATUS_OK. More... | |
| enum gpio_ext_status_t |
GPIO driver SPI/I2C bus operation statuse
| Enumerator | |
|---|---|
| GPIO_EXT_STATUS_OK |
Operation completed successfully. |
| GPIO_EXT_STATUS_COMM_ERROR |
SPI/I2C bus error. |
Definition at line 72 of file gpio-ext.h.
| enum gpio_ext_pin_dir_t |
Pin direction setting
| Enumerator | |
|---|---|
| DIR_UNCHANGED |
Do not touch pin direction setting (leave as is) |
| DIR_IN |
Set pin as input. |
| DIR_OUT |
Set pin as output. |
Definition at line 81 of file gpio-ext.h.
| enum gpio_ext_pin_pull_t |
Pin pullup / pulldown setting
| Enumerator | |
|---|---|
| PULL_UNCHANGED |
Do not touch pin pullup / pulldown setting (leave as is) |
| PULL_NONE |
Disconnect pin pullup / pulldown. |
| PULL_UP |
Pullup the pin. |
| PULL_DOWN |
Pulldown the pin. |
Definition at line 91 of file gpio-ext.h.
| void GpioExtInit | ( | const struct gpio_ext_t * | GpioExt | ) |
Initialize IO expander driver and chip.
| GpioExt | Parameters for the IO port expander to be used |
|
inlinestatic |
Write 16-bits data to the GPIO port.
| GpioExt | Parameters for the IO port expander to be used |
| Value | Data to be written to IO expander ports |
| Mask | Mask of pins in the port to be written |
Definition at line 213 of file gpio-ext.h.
References gpio_ext_t::Func, gpio_ext_api_t::GpioExtOutPort, gpio_ext_state_t::OutputValues, and gpio_ext_t::State.
Referenced by GpioExtPortClear(), and GpioExtPortSet().
|
inlinestatic |
Set bits by mask in the GPIO port.
| GpioExt | Parameters for the IO port expander to be used |
| Mask | Mask of pins in the port to be written |
Definition at line 227 of file gpio-ext.h.
References GpioExtPortWrite().
|
inlinestatic |
Clear bits by mask in the GPIO port.
| GpioExt | Parameters for the IO port expander to be used |
| Mask | Mask of pins in the port to be written |
Definition at line 238 of file gpio-ext.h.
References GpioExtPortWrite().
|
inlinestatic |
Invert bits by mask in the GPIO port.
| GpioExt | Parameters for the IO port expander to be used |
| Mask | Mask of pins in the port to be written |
Definition at line 249 of file gpio-ext.h.
References atomic_xor16(), gpio_ext_t::Func, gpio_ext_api_t::GpioExtOutPort, gpio_ext_state_t::OutputValues, and gpio_ext_t::State.
|
inlinestatic |
Set/clear 1 pin in the GPIO port.
| GpioExt | Parameters for the IO port expander to be used |
| Pin | Pin number to set/clear |
| Value | 0 clears the pin, any other value sets it to 1 |
Definition at line 263 of file gpio-ext.h.
References gpio_ext_t::Func, gpio_ext_api_t::GpioExtOutPort, gpio_ext_state_t::OutputValues, and gpio_ext_t::State.
|
inlinestatic |
Set 1 pin in the GPIO port.
| GpioExt | Parameters for the IO port expander to be used |
| Pin | Pin number to set |
Definition at line 277 of file gpio-ext.h.
References gpio_ext_t::Func, gpio_ext_api_t::GpioExtOutPort, gpio_ext_state_t::OutputValues, and gpio_ext_t::State.
|
inlinestatic |
Clear 1 pin in the GPIO port.
| GpioExt | Parameters for the IO port expander to be used |
| Pin | Pin number to clear |
Definition at line 290 of file gpio-ext.h.
References gpio_ext_t::Func, gpio_ext_api_t::GpioExtOutPort, gpio_ext_state_t::OutputValues, and gpio_ext_t::State.
|
inlinestatic |
Invert 1 pin in the GPIO port.
| GpioExt | Parameters for the IO port expander to be used |
| Pin | Pin number to toggle |
Definition at line 303 of file gpio-ext.h.
References atomic_xor16(), gpio_ext_t::Func, gpio_ext_api_t::GpioExtOutPort, gpio_ext_state_t::OutputValues, and gpio_ext_t::State.
|
inlinestatic |
Read all the pins from the GPIO port.
| GpioExt | Parameters for the IO port expander to be used |
Definition at line 317 of file gpio-ext.h.
Referenced by GpioExtPinRead().
|
inlinestatic |
Read a pin value from the GPIO port.
| GpioExt | Parameters for the IO port expander to be used |
| Pin | Global pin number to be read |
Definition at line 329 of file gpio-ext.h.
References gpio_ext_state_t::Direction, gpio_ext_t::Func, GpioExtPortRead(), GpioExtPortSetup(), gpio_ext_api_t::GpioExtSetDrive, gpio_ext_api_t::GpioExtSetInterrupts, gpio_ext_api_t::GpioExtSetLatch, gpio_ext_state_t::InterruptMask, gpio_ext_state_t::InterruptStatus, IrqTriggerExternal(), gpio_ext_state_t::PullEnable, gpio_ext_state_t::PullSelect, and gpio_ext_t::State.
| void GpioExtPortSetup | ( | const struct gpio_ext_t * | GpioExt, |
| uint16_t | Direction, | ||
| uint16_t | PullSelect, | ||
| uint16_t | PullEnable, | ||
| uint16_t | Mask | ||
| ) |
Set IO expander ports to input or output.
| GpioExt | Parameters for the IO port expander to be used |
| Direction | 0 = input, 1 = output |
| PullSelect | 0 = pulldown, 1 = pullup |
| PullEnable | 0 = no pull, 1 = pullup/pulldown |
| Mask | Mask of pins in the port to be changed |
Referenced by GpioExtPinRead().
|
inlinestatic |
Check status of GpioExt operations and reset status to GPIO_EXT_STATUS_OK.
| GpioExt | Parameters for the IO port expander to be used |
Definition at line 401 of file gpio-ext.h.
References GPIO_EXT_STATUS_OK, and gpio_ext_t::State.