SmartSnippets DA1459x SDK
Files | Data Structures | Enumerations | Functions

Common definitions for I/O adapters. More...

Files

file  ad.h
 Adapters shared definitions.
 

Data Structures

struct  ad_pin_conf_t
 Adapters pin configuration. More...
 
struct  ad_io_conf_t
 Adapters IO configuration. More...
 

Enumerations

enum  AD_IO_CONF_STATE { AD_IO_CONF_OFF = 0, AD_IO_CONF_ON = 1 }
 Adapters IO configuration state. More...
 
enum  AD_IO_PAD_LATCHES_OP { AD_IO_PAD_LATCHES_OP_DISABLE = 0, AD_IO_PAD_LATCHES_OP_ENABLE = 1, AD_IO_PAD_LATCHES_OP_TOGGLE = 2 }
 Pad latch operation. More...
 
enum  AD_IO_ERROR { AD_IO_ERROR_NONE = 0, AD_IO_ERROR_INVALID_PIN = -1, AD_IO_ERROR_INVALID_CFG = -2 }
 ad_io_configure return value More...
 

Functions

AD_IO_ERROR ad_io_configure (const ad_io_conf_t *io, uint8_t size, AD_IO_CONF_STATE state)
 Apply a list of IO configurations. More...
 
AD_IO_ERROR ad_io_set_pad_latch (const ad_io_conf_t *io, uint8_t size, AD_IO_PAD_LATCHES_OP operation)
 Apply a list of io pad latch operations. More...
 

Detailed Description

Common definitions for I/O adapters.

Enumeration Type Documentation

◆ AD_IO_CONF_STATE

Adapters IO configuration state.

Enumerator
AD_IO_CONF_OFF 

Off configuration

AD_IO_CONF_ON 

On configuration

◆ AD_IO_ERROR

ad_io_configure return value

Enumerator
AD_IO_ERROR_NONE 

Configuration set

AD_IO_ERROR_INVALID_PIN 

Invalid pin passed

AD_IO_ERROR_INVALID_CFG 

Invalid IO configuration passed

◆ AD_IO_PAD_LATCHES_OP

Pad latch operation.

Enumerator
AD_IO_PAD_LATCHES_OP_DISABLE 

Pad latch disabled. The pad retains its current state (e.g. during sleep).

AD_IO_PAD_LATCHES_OP_ENABLE 

Pad latch enabled. The pad can change state, either by external drive (input) or by us (output).

AD_IO_PAD_LATCHES_OP_TOGGLE 

Pad latch enabled and then disabled

Function Documentation

◆ ad_io_configure()

AD_IO_ERROR ad_io_configure ( const ad_io_conf_t io,
uint8_t  size,
AD_IO_CONF_STATE  state 
)

Apply a list of IO configurations.

This function applies the on or off configuration of a list of IO pins. It configures :

  • IO pin function
  • Pad voltage level
Parameters
[in]iolist of configurations of gpio pins
[in]sizenumber of pins to configure
[in]stateconfiguration to be applied (AD_IO_CONF_OFF/AD_IO_CONF_ON)
Returns
AD_IO_ERROR

◆ ad_io_set_pad_latch()

AD_IO_ERROR ad_io_set_pad_latch ( const ad_io_conf_t io,
uint8_t  size,
AD_IO_PAD_LATCHES_OP  operation 
)

Apply a list of io pad latch operations.

Parameters
[in]iolist of configurations of io pins
[in]sizenumber of pins to configure
[in]operationlatch state
Returns
AD_IO_ERROR