Nordic Thingy:52
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
SX1509 GPIO extender driver

SX1509 GPIO extender API. More...

Data Structures

struct  drv_sx1509_cfg_t
 The ccs811 configuration. More...
 

Enumerations

enum  { DRV_SX1509_STATUS_CODE_SUCCESS, DRV_SX1509_STATUS_CODE_DISALLOWED, DRV_SX1509_STATUS_CODE_INVALID_PARAM, DRV_SX1509_STATUS_CODE_NOT_SUPPORTED }
 The sx1509 status codes. More...
 

Functions

uint32_t drv_sx1509_clock_get (uint8_t *p_clock)
 Gets the clock configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_clock_modify (uint8_t set_mask, uint8_t clr_mask)
 Modifies the clock configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_close (void)
 Closes the sx1509 driver. More...
 
uint32_t drv_sx1509_data_get (uint16_t *p_data)
 Gets the data to be output to the output-configured IOs of the sx1509 device. More...
 
uint32_t drv_sx1509_data_modify (uint16_t set_mask, uint16_t clr_mask)
 Modifies the data to be output to the output-configured IOs of the sx1509 device. More...
 
uint32_t drv_sx1509_debounceconfig_get (uint8_t *p_debounceconfig)
 Gets the debounce configruation of the sx1509 device. More...
 
uint32_t drv_sx1509_debounceconfig_modify (uint8_t set_mask, uint8_t clr_mask)
 Modifies the debounce configruation of the sx1509 device. More...
 
uint32_t drv_sx1509_debounceenable_get (uint16_t *p_debounceenable)
 Gets the debounce enable configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_debounceenable_modify (uint16_t set_mask, uint16_t clr_mask)
 Modifies the debounce enable configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_dir_get (uint16_t *p_dir)
 Gets the pin direction configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_dir_modify (uint16_t set_mask, uint16_t clr_mask)
 Modifies the pin direction configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_eventstatus_clr (uint16_t clr_mask)
 Modifies the event status of the sx1509 device. More...
 
uint32_t drv_sx1509_eventstatus_get (uint16_t *p_eventstatus)
 Gets the event status of the sx1509 device. More...
 
uint32_t drv_sx1509_highinpmode_get (uint16_t *p_highinpmode)
 Gets the enable configuration for high-voltage input mode of the sx1509 device. More...
 
uint32_t drv_sx1509_highinpmode_modify (uint16_t set_mask, uint16_t clr_mask)
 Modifies the enable configuration for high-voltage input mode of the sx1509 device. More...
 
void drv_sx1509_init (void)
 Initializes the driver.
 
uint32_t drv_sx1509_inpbufdisable_get (uint16_t *p_inputdisable)
 Gets the input buffer disable register of the sx1509 device. More...
 
uint32_t drv_sx1509_inpbufdisable_modify (uint16_t set_mask, uint16_t clr_mask)
 Modifies the input buffer disable register of the sx1509 device. More...
 
uint32_t drv_sx1509_interruptmask_get (uint16_t *p_interruptmask)
 Gets the interrupt mask of the sx1509 device. More...
 
uint32_t drv_sx1509_interruptmask_modify (uint16_t set_mask, uint16_t clr_mask)
 Modifies the interrupt mask of the sx1509 device. More...
 
uint32_t drv_sx1509_interruptsource_clr (uint16_t clr_mask)
 Clears the interrupt source status of the sx1509 device. More...
 
uint32_t drv_sx1509_interruptsource_get (uint16_t *p_interruptsource)
 Gets the interrupt source status of the sx1509 device. More...
 
uint32_t drv_sx1509_keyconfig_get (uint16_t *p_keyconfig)
 Gets the key configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_keyconfig_modify (uint16_t set_mask, uint16_t clr_mask)
 Modifies the key configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_keydata_get (uint16_t *p_keydata)
 Gets the key data status of the sx1509 device. More...
 
uint32_t drv_sx1509_leddriverenable_get (uint16_t *p_leddriverenable)
 Gets the LED driver enable configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_leddriverenable_modify (uint16_t set_mask, uint16_t clr_mask)
 Modifies the LED driver enable configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_levelshifter_get (uint16_t *p_levelshifter)
 Gets the level shifter configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_levelshifter_modify (uint16_t set_mask, uint16_t clr_mask)
 Modifies the level shifter configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_longslewrate_get (uint16_t *p_longslewrate)
 Gets the long slew rate configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_longslewrate_modify (uint16_t set_mask, uint16_t clr_mask)
 Modifies the long slew rate configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_lowdrive_get (uint16_t *p_lowdrive)
 Gets the low drive configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_lowdrive_modify (uint16_t set_mask, uint16_t clr_mask)
 Modifies the low drive configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_misc_get (uint8_t *p_misc)
 Gets the miscellaneous configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_misc_modify (uint8_t set_mask, uint8_t clr_mask)
 Modifies the miscellaneous configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_onoffcfgx_get (uint8_t pin_no, uint32_t *p_onoffcfgx)
 Gets the the on/off time and intensity configuration (RegTOn15, RegIOnX & RegOffX registers) of the sx1509 device. More...
 
uint32_t drv_sx1509_onoffcfgx_modify (uint8_t pin_no, uint32_t set_mask, uint32_t clr_mask)
 Modifies the on/off time and intensity configuration (RegTOn15, RegIOnX & RegOffX registers) of the sx1509 device. More...
 
uint32_t drv_sx1509_open (drv_sx1509_cfg_t const *const p_drv_sx1509_cfg)
 Opens the sx1509 driver according to the specified configuration. More...
 
uint32_t drv_sx1509_opendrain_get (uint16_t *p_opendrain)
 Gets the open drain operation enable configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_opendrain_modify (uint16_t set_mask, uint16_t clr_mask)
 Modifies the open drain operation enable configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_polarity_get (uint16_t *p_polarity)
 Gets the polarity inversion enable status of the sx1509 device. More...
 
uint32_t drv_sx1509_polarity_modify (uint16_t set_mask, uint16_t clr_mask)
 Modifies the polarity inversion enable status of the sx1509 device. More...
 
uint32_t drv_sx1509_pulldown_get (uint16_t *p_pulldown)
 Gets the pull-down enable configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_pulldown_modify (uint16_t set_mask, uint16_t clr_mask)
 Modifies the pull-down enable configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_pullup_get (uint16_t *p_pullup)
 Gets the pull-up enable configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_pullup_modify (uint16_t set_mask, uint16_t clr_mask)
 Modifies the pull-up enable configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_reg_get (uint8_t reg_addr, uint8_t *p_value)
 Get any register from the sx1509.
 
uint32_t drv_sx1509_reset (void)
 Resets the sx1509 device. More...
 
uint32_t drv_sx1509_risefallcfgx_get (uint8_t pin_no, uint16_t *p_risefallcfgx)
 Gets the fade in/out configuration (RegTRiseX & RegTFallX registers) of the sx1509 device. More...
 
uint32_t drv_sx1509_risefallcfgx_modify (uint8_t pin_no, uint16_t set_mask, uint16_t clr_mask)
 Modifies the fade in/out configuration (RegTRiseX & RegTFallX registers) of the sx1509 device. More...
 
uint32_t drv_sx1509_sense_get (uint32_t *p_sense)
 Gets the edge sensitivity configuration of the sx1509 device. More...
 
uint32_t drv_sx1509_sense_modify (uint32_t set_mask, uint32_t clr_mask)
 Modifies the edge sensitivity configuration of the sx1509 device. More...
 

Detailed Description

SX1509 GPIO extender API.

Enumeration Type Documentation

anonymous enum

The sx1509 status codes.

Enumerator
DRV_SX1509_STATUS_CODE_SUCCESS 

Successfull.

DRV_SX1509_STATUS_CODE_DISALLOWED 

Disallowed.

DRV_SX1509_STATUS_CODE_INVALID_PARAM 

Invalid parameters.

DRV_SX1509_STATUS_CODE_NOT_SUPPORTED 

Not supported.

Function Documentation

uint32_t drv_sx1509_clock_get ( uint8_t *  p_clock)

Gets the clock configuration of the sx1509 device.

Parameters
[in]p_clockA pointer to where the value is to be stored.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_clock_modify ( uint8_t  set_mask,
uint8_t  clr_mask 
)

Modifies the clock configuration of the sx1509 device.

Parameters
[in]set_maskA mask specifying what bits to set.
[in]clr_maskA mask specifying what bits to clear.
Note
Clear mask may overlap with set mask to make it easier to set new values for multi-bit fields (i.e. the clear mask will be applied first so that the set mask gets priority to override the clear mask).
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
DRV_SX1509_STATUS_INVALID_PARAM If specified masks overlaps.
uint32_t drv_sx1509_close ( void  )

Closes the sx1509 driver.

Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_data_get ( uint16_t *  p_data)

Gets the data to be output to the output-configured IOs of the sx1509 device.

Parameters
[in]p_dataA pointer to where the value is to be stored.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_data_modify ( uint16_t  set_mask,
uint16_t  clr_mask 
)

Modifies the data to be output to the output-configured IOs of the sx1509 device.

Parameters
[in]set_maskA mask specifying what bits to set.
[in]clr_maskA mask specifying what bits to clear.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
DRV_SX1509_STATUS_INVALID_PARAM If specified masks overlaps.
uint32_t drv_sx1509_debounceconfig_get ( uint8_t *  p_debounceconfig)

Gets the debounce configruation of the sx1509 device.

Parameters
[in]p_debounceconfigA pointer to where the value is to be stored.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_debounceconfig_modify ( uint8_t  set_mask,
uint8_t  clr_mask 
)

Modifies the debounce configruation of the sx1509 device.

Parameters
[in]set_maskA mask specifying what bits to set.
[in]clr_maskA mask specifying what bits to clear.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
DRV_SX1509_STATUS_INVALID_PARAM If specified masks overlaps.
uint32_t drv_sx1509_debounceenable_get ( uint16_t *  p_debounceenable)

Gets the debounce enable configuration of the sx1509 device.

Parameters
[in]p_debounceenableA pointer to where the value is to be stored.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_debounceenable_modify ( uint16_t  set_mask,
uint16_t  clr_mask 
)

Modifies the debounce enable configuration of the sx1509 device.

Parameters
[in]set_maskA mask specifying what bits to set.
[in]clr_maskA mask specifying what bits to clear.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
DRV_SX1509_STATUS_INVALID_PARAM If specified masks overlaps.
uint32_t drv_sx1509_dir_get ( uint16_t *  p_dir)

Gets the pin direction configuration of the sx1509 device.

Parameters
[in]p_dirA pointer to where the value is to be stored.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_dir_modify ( uint16_t  set_mask,
uint16_t  clr_mask 
)

Modifies the pin direction configuration of the sx1509 device.

Parameters
[in]set_maskA mask specifying what bits to set.
[in]clr_maskA mask specifying what bits to clear.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
DRV_SX1509_STATUS_INVALID_PARAM If specified masks overlaps.
uint32_t drv_sx1509_eventstatus_clr ( uint16_t  clr_mask)

Modifies the event status of the sx1509 device.

Parameters
[in]clr_maskA mask specifying what bits to clear.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
DRV_SX1509_STATUS_INVALID_PARAM If specified mask is empty.
uint32_t drv_sx1509_eventstatus_get ( uint16_t *  p_eventstatus)

Gets the event status of the sx1509 device.

Parameters
[in]p_eventstatusA pointer to where the value is to be stored.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_highinpmode_get ( uint16_t *  p_highinpmode)

Gets the enable configuration for high-voltage input mode of the sx1509 device.

Parameters
[in]p_highinpmodeA pointer to where the value is to be stored.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_highinpmode_modify ( uint16_t  set_mask,
uint16_t  clr_mask 
)

Modifies the enable configuration for high-voltage input mode of the sx1509 device.

Parameters
[in]set_maskA mask specifying what bits to set.
[in]clr_maskA mask specifying what bits to clear.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
DRV_SX1509_STATUS_INVALID_PARAM If specified masks overlaps.
uint32_t drv_sx1509_inpbufdisable_get ( uint16_t *  p_inputdisable)

Gets the input buffer disable register of the sx1509 device.

Parameters
[in]p_inputdisableA pointer to where the value is to be stored.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_inpbufdisable_modify ( uint16_t  set_mask,
uint16_t  clr_mask 
)

Modifies the input buffer disable register of the sx1509 device.

Parameters
[in]set_maskA mask specifying what bits to set.
[in]clr_maskA mask specifying what bits to clear.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
DRV_SX1509_STATUS_INVALID_PARAM If specified masks overlaps.
uint32_t drv_sx1509_interruptmask_get ( uint16_t *  p_interruptmask)

Gets the interrupt mask of the sx1509 device.

Parameters
[in]p_interruptmaskA pointer to where the value is to be stored.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_interruptmask_modify ( uint16_t  set_mask,
uint16_t  clr_mask 
)

Modifies the interrupt mask of the sx1509 device.

Parameters
[in]set_maskA mask specifying what bits to set.
[in]clr_maskA mask specifying what bits to clear.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
DRV_SX1509_STATUS_INVALID_PARAM If specified masks overlaps.
uint32_t drv_sx1509_interruptsource_clr ( uint16_t  clr_mask)

Clears the interrupt source status of the sx1509 device.

Parameters
[in]clr_maskA mask specifying what bits to clear.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
DRV_SX1509_STATUS_INVALID_PARAM If specified mask is empty.
uint32_t drv_sx1509_interruptsource_get ( uint16_t *  p_interruptsource)

Gets the interrupt source status of the sx1509 device.

Parameters
[in]p_interruptsourceA pointer to where the value is to be stored.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_keyconfig_get ( uint16_t *  p_keyconfig)

Gets the key configuration of the sx1509 device.

Parameters
[in]p_keyconfigA pointer to where the value is to be stored.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_keyconfig_modify ( uint16_t  set_mask,
uint16_t  clr_mask 
)

Modifies the key configuration of the sx1509 device.

Parameters
[in]set_maskA mask specifying what bits to set.
[in]clr_maskA mask specifying what bits to clear.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
DRV_SX1509_STATUS_INVALID_PARAM If specified masks overlaps.
uint32_t drv_sx1509_keydata_get ( uint16_t *  p_keydata)

Gets the key data status of the sx1509 device.

Note
The keydata value is intentionally of oposite polarity than HW to work in the same way as the InterruptSource and EventStatus registers (i.e. active high interrupts).
Parameters
[in]p_keydataA pointer to where the value is to be stored.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_leddriverenable_get ( uint16_t *  p_leddriverenable)

Gets the LED driver enable configuration of the sx1509 device.

Parameters
[in]p_leddriverenableA pointer to where the value is to be stored.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_leddriverenable_modify ( uint16_t  set_mask,
uint16_t  clr_mask 
)

Modifies the LED driver enable configuration of the sx1509 device.

Parameters
[in]set_maskA mask specifying what bits to set.
[in]clr_maskA mask specifying what bits to clear.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
DRV_SX1509_STATUS_INVALID_PARAM If specified masks overlaps.
uint32_t drv_sx1509_levelshifter_get ( uint16_t *  p_levelshifter)

Gets the level shifter configuration of the sx1509 device.

Parameters
[in]p_levelshifterA pointer to where the value is to be stored.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_levelshifter_modify ( uint16_t  set_mask,
uint16_t  clr_mask 
)

Modifies the level shifter configuration of the sx1509 device.

Parameters
[in]set_maskA mask specifying what bits to set.
[in]clr_maskA mask specifying what bits to clear.
Note
Clear mask may overlap with set mask to make it easier to set new values for multi-bit fields (i.e. the clear mask will be applied first so that the set mask gets priority to override the clear mask).
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
DRV_SX1509_STATUS_INVALID_PARAM If specified masks overlaps.
uint32_t drv_sx1509_longslewrate_get ( uint16_t *  p_longslewrate)

Gets the long slew rate configuration of the sx1509 device.

Parameters
[in]p_longslewrateA pointer to where the value is to be stored.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_longslewrate_modify ( uint16_t  set_mask,
uint16_t  clr_mask 
)

Modifies the long slew rate configuration of the sx1509 device.

Parameters
[in]set_maskA mask specifying what bits to set.
[in]clr_maskA mask specifying what bits to clear.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
DRV_SX1509_STATUS_INVALID_PARAM If specified masks overlaps.
uint32_t drv_sx1509_lowdrive_get ( uint16_t *  p_lowdrive)

Gets the low drive configuration of the sx1509 device.

Parameters
[in]p_lowdriveA pointer to where the value is to be stored.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_lowdrive_modify ( uint16_t  set_mask,
uint16_t  clr_mask 
)

Modifies the low drive configuration of the sx1509 device.

Parameters
[in]set_maskA mask specifying what bits to set.
[in]clr_maskA mask specifying what bits to clear.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
DRV_SX1509_STATUS_INVALID_PARAM If specified masks overlaps.
uint32_t drv_sx1509_misc_get ( uint8_t *  p_misc)

Gets the miscellaneous configuration of the sx1509 device.

Parameters
[in]p_miscA pointer to where the value is to be stored.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_misc_modify ( uint8_t  set_mask,
uint8_t  clr_mask 
)

Modifies the miscellaneous configuration of the sx1509 device.

Parameters
[in]set_maskA mask specifying what bits to set.
[in]clr_maskA mask specifying what bits to clear.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
DRV_SX1509_STATUS_INVALID_PARAM If specified masks overlaps.
uint32_t drv_sx1509_onoffcfgx_get ( uint8_t  pin_no,
uint32_t *  p_onoffcfgx 
)

Gets the the on/off time and intensity configuration (RegTOn15, RegIOnX & RegOffX registers) of the sx1509 device.

Parameters
[in]pin_noThe pin number to configure.
[in]p_onoffcfgxA pointer to where the value is to be stored.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_onoffcfgx_modify ( uint8_t  pin_no,
uint32_t  set_mask,
uint32_t  clr_mask 
)

Modifies the on/off time and intensity configuration (RegTOn15, RegIOnX & RegOffX registers) of the sx1509 device.

Parameters
[in]pin_noThe pin number to configure.
[in]set_maskA mask specifying what bits to set.
[in]clr_maskA mask specifying what bits to clear.
Note
Clear mask may overlap with set mask to make it easier to set new values for multi-bit fields (i.e. the clear mask will be applied first so that the set mask gets priority to override the clear mask).
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
DRV_SX1509_STATUS_INVALID_PARAM Invalid pin number, or masks specify unused bits.
uint32_t drv_sx1509_open ( drv_sx1509_cfg_t const *const  p_drv_sx1509_cfg)

Opens the sx1509 driver according to the specified configuration.

Parameters
[in]p_drv_sx1509_cfgPointer to the driver configuration for the session to be opened.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_opendrain_get ( uint16_t *  p_opendrain)

Gets the open drain operation enable configuration of the sx1509 device.

Parameters
[in]p_opendrainA pointer to where the value is to be stored.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_opendrain_modify ( uint16_t  set_mask,
uint16_t  clr_mask 
)

Modifies the open drain operation enable configuration of the sx1509 device.

Parameters
[in]set_maskA mask specifying what bits to set.
[in]clr_maskA mask specifying what bits to clear.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
DRV_SX1509_STATUS_INVALID_PARAM If specified masks overlaps.
uint32_t drv_sx1509_polarity_get ( uint16_t *  p_polarity)

Gets the polarity inversion enable status of the sx1509 device.

Parameters
[in]p_polarityA pointer to where the value is to be stored.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_polarity_modify ( uint16_t  set_mask,
uint16_t  clr_mask 
)

Modifies the polarity inversion enable status of the sx1509 device.

Parameters
[in]set_maskA mask specifying what bits to set.
[in]clr_maskA mask specifying what bits to clear.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
DRV_SX1509_STATUS_INVALID_PARAM If specified masks overlaps.
uint32_t drv_sx1509_pulldown_get ( uint16_t *  p_pulldown)

Gets the pull-down enable configuration of the sx1509 device.

Parameters
[in]p_pulldownA pointer to where the value is to be stored.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_pulldown_modify ( uint16_t  set_mask,
uint16_t  clr_mask 
)

Modifies the pull-down enable configuration of the sx1509 device.

Parameters
[in]set_maskA mask specifying what bits to set.
[in]clr_maskA mask specifying what bits to clear.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
DRV_SX1509_STATUS_INVALID_PARAM If specified masks overlaps.
uint32_t drv_sx1509_pullup_get ( uint16_t *  p_pullup)

Gets the pull-up enable configuration of the sx1509 device.

Parameters
[in]p_pullupA pointer to where the value is to be stored.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_pullup_modify ( uint16_t  set_mask,
uint16_t  clr_mask 
)

Modifies the pull-up enable configuration of the sx1509 device.

Parameters
[in]set_maskA mask specifying what bits to set.
[in]clr_maskA mask specifying what bits to clear.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
DRV_SX1509_STATUS_INVALID_PARAM If specified masks overlaps.
uint32_t drv_sx1509_reset ( void  )

Resets the sx1509 device.

Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_risefallcfgx_get ( uint8_t  pin_no,
uint16_t *  p_risefallcfgx 
)

Gets the fade in/out configuration (RegTRiseX & RegTFallX registers) of the sx1509 device.

Parameters
[in]pin_noThe pin number to configure.
[in]p_risefallcfgxA pointer to where the value is to be stored.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_risefallcfgx_modify ( uint8_t  pin_no,
uint16_t  set_mask,
uint16_t  clr_mask 
)

Modifies the fade in/out configuration (RegTRiseX & RegTFallX registers) of the sx1509 device.

Parameters
[in]pin_noThe pin number to configure.
[in]set_maskA mask specifying what bits to set.
[in]clr_maskA mask specifying what bits to clear.
Note
Clear mask may overlap with set mask to make it easier to set new values for multi-bit fields (i.e. the clear mask will be applied first so that the set mask gets priority to override the clear mask).
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
DRV_SX1509_STATUS_INVALID_PARAM Invalid pin number, or masks specify unused bits.
uint32_t drv_sx1509_sense_get ( uint32_t *  p_sense)

Gets the edge sensitivity configuration of the sx1509 device.

Parameters
[in]p_senseA pointer to where the value is to be stored.
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
uint32_t drv_sx1509_sense_modify ( uint32_t  set_mask,
uint32_t  clr_mask 
)

Modifies the edge sensitivity configuration of the sx1509 device.

Parameters
[in]set_maskA mask specifying what bits to set.
[in]clr_maskA mask specifying what bits to clear.
Note
Clear mask may overlap with set mask to make it easier to set new values for multi-bit fields (i.e. the clear mask will be applied first so that the set mask gets priority to override the clear mask).
Returns
DRV_SX1509_STATUS_CODE_SUCCESS If the call was successful.
DRV_SX1509_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
DRV_SX1509_STATUS_INVALID_PARAM If specified masks overlaps.