libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
DEPRECATED-OLD-GPIO

Deprecated C API for GPIO is staying in place for a few versions to support backwards compatibility. More...

Detailed Description

Deprecated C API for GPIO is staying in place for a few versions to support backwards compatibility.

This should not be used for anything new.

Deprecated:
These should only be used for casting to configs, and are planned to be reomved in a future version.

Classes

struct  dsy_gpio
 

Enumerations

enum  dsy_gpio_mode {
  DSY_GPIO_MODE_INPUT , DSY_GPIO_MODE_OUTPUT_PP , DSY_GPIO_MODE_OUTPUT_OD , DSY_GPIO_MODE_ANALOG ,
  DSY_GPIO_MODE_LAST
}
 
enum  dsy_gpio_pull { DSY_GPIO_NOPULL , DSY_GPIO_PULLUP , DSY_GPIO_PULLDOWN }
 

Functions

void dsy_gpio_init (const dsy_gpio *p)
 
void dsy_gpio_deinit (const dsy_gpio *p)
 
uint8_t dsy_gpio_read (const dsy_gpio *p)
 
void dsy_gpio_write (const dsy_gpio *p, uint8_t state)
 
void dsy_gpio_toggle (const dsy_gpio *p)
 

Enumeration Type Documentation

◆ dsy_gpio_mode

General Purpose IO driver Sets the mode of the GPIO

Enumerator
DSY_GPIO_MODE_INPUT 

&

DSY_GPIO_MODE_OUTPUT_PP 

Push-Pull

DSY_GPIO_MODE_OUTPUT_OD 

Open-Drain

DSY_GPIO_MODE_ANALOG 

&

DSY_GPIO_MODE_LAST 

&

◆ dsy_gpio_pull

Configures whether an internal Pull up or Pull down resistor is used

Enumerator
DSY_GPIO_NOPULL 

&

DSY_GPIO_PULLUP 

&

DSY_GPIO_PULLDOWN 

&

Function Documentation

◆ dsy_gpio_deinit()

void dsy_gpio_deinit ( const dsy_gpio p)

Deinitializes the gpio pin

Parameters
*pPin pointer

◆ dsy_gpio_init()

void dsy_gpio_init ( const dsy_gpio p)

Initializes the gpio with the settings configured.

Parameters
*pPin pointer

◆ dsy_gpio_read()

uint8_t dsy_gpio_read ( const dsy_gpio p)

Reads the state of the gpio pin

Parameters
*pPin pointer
Returns
1 if the pin is HIGH, and 0 if the pin is LOW

◆ dsy_gpio_toggle()

void dsy_gpio_toggle ( const dsy_gpio p)

Toggles the state of the pin so that it is not at the same state as it was previously.

Parameters
*pPin pointer

◆ dsy_gpio_write()

void dsy_gpio_write ( const dsy_gpio p,
uint8_t  state 
)

Writes the state to the gpio pin Pin will be set to 3v3 when state is 1, and 0V when state is 0

Parameters
*pPin pointer
stateState to write