spiextend 2.0.0.0
SPI Extend Click Driver

API for configuring and manipulating SPI Extend Click driver. More...

Topics

 SPI Extend Registers List
 List of registers of SPI Extend Click driver.
 
 SPI Extend Registers Settings
 Settings for registers of SPI Extend Click driver.
 
 SPI Extend MikroBUS Map
 MikroBUS pin mapping of SPI Extend Click driver.
 

Functions

void spiextend_cfg_setup (spiextend_cfg_t *cfg)
 SPI Extend configuration object setup function.
 
err_t spiextend_init (spiextend_t *ctx, spiextend_cfg_t *cfg)
 SPI Extend initialization function.
 
err_t spiextend_default_cfg (spiextend_t *ctx)
 SPI Extend default configuration function.
 
err_t spiextend_generic_write (spiextend_t *ctx, uint8_t reg, uint8_t data_in)
 SPI Extend data writing function.
 
err_t spiextend_generic_read (spiextend_t *ctx, uint8_t reg, uint8_t *data_out)
 SPI Extend data reading function.
 
void spiextend_get_config (spiextend_t *ctx, spiextend_config_data_t *config_data)
 SPI Extend get the configuration function.
 
void spiextend_set_config (spiextend_t *ctx, spiextend_config_data_t config_data)
 SPI Extend set the configuration function.
 
void spiextend_get_status (spiextend_t *ctx, spiextend_status_data_t *status_data)
 SPI Extend get the status function.
 
void spiextend_get_event (spiextend_t *ctx, spiextend_event_data_t *event_data)
 SPI Extend get the event function.
 
void spiextend_clear_event (spiextend_t *ctx)
 SPI Extend clear the event function.
 
void spiextend_enable_int (spiextend_t *ctx, spiextend_event_data_t event_data)
 SPI Extend enable int function.
 
void spiextend_get_fault (spiextend_t *ctx, spiextend_fault_data_t *fault_data)
 SPI Extend get the fault state function.
 
uint8_t spiextend_get_word_length (spiextend_t *ctx)
 SPI Extend get the word length function.
 
void spiextend_set_word_length (spiextend_t *ctx, uint8_t word_length)
 SPI Extend set the word length function.
 
uint8_t spiextend_get_scratch (spiextend_t *ctx)
 SPI Extend get scratch function.
 
void spiextend_set_scratch (spiextend_t *ctx, uint8_t scratch)
 SPI Extend set scratch function.
 
void spiextend_set_ss1 (spiextend_t *ctx, uint8_t en_cs)
 SPI Extend set SS1 pin state function.
 
void spiextend_set_ss2 (spiextend_t *ctx, uint8_t en_rst)
 SPI Extend set SS2 pin state function.
 
void spiextend_set_ss3 (spiextend_t *ctx, uint8_t en_an)
 SPI Extend set SS3 pin state function.
 
uint8_t spiextend_check_int (spiextend_t *ctx)
 SPI Extend check interrupt status function.
 
void spiextend_rmt_spi_write (spiextend_t *ctx, uint8_t *p_tx_data, uint16_t n_bytes)
 SPI Extend generic SPI write data in Remote Mode function.
 
void spiextend_rmt_spi_read (spiextend_t *ctx, uint8_t *p_rx_data, uint16_t n_bytes)
 SPI Extend generic SPI read data in Remote Mode function.
 
void spiextend_rmt_write (spiextend_t *ctx, uint8_t reg, uint8_t tx_data, uint8_t sel_slave)
 SPI Extend generic write data in Remote Mode function.
 
uint8_t spiextend_rmt_read (spiextend_t *ctx, uint8_t reg, uint8_t sel_slave)
 SPI Extend generic read data in Remote Mode function.
 
void spiextend_rmt_multi_write (spiextend_t *ctx, uint8_t reg, uint8_t *p_tx_data, uint16_t n_bytes, uint8_t sel_slave)
 SPI Extend generic multi write data in Remote Mode function.
 
void spiextend_rmt_multi_read (spiextend_t *ctx, uint8_t reg, uint8_t *p_rx_data, uint8_t n_bytes, uint8_t sel_slave)
 SPI Extend generic multi read data in Remote Mode function.
 

Detailed Description

API for configuring and manipulating SPI Extend Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ spiextend_cfg_setup()

void spiextend_cfg_setup ( spiextend_cfg_t * cfg)

SPI Extend configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See spiextend_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ spiextend_check_int()

uint8_t spiextend_check_int ( spiextend_t * ctx)

SPI Extend check interrupt status function.

Function check interrupt state by return state of the INT pin of the LTC4332 SPI Extender Over Rugged Differential Link on the SPI Extend click board.

Parameters
[in]ctx: Click context object. See spiextend_t object definition for detailed explanation.
Returns
  • 0 - State high,
  • 1 - State low.

◆ spiextend_clear_event()

void spiextend_clear_event ( spiextend_t * ctx)

SPI Extend clear the event function.

Function clear events of the LTC4332 SPI Extender Over Rugged Differential Link on the SPI Extend click board.

Parameters
[in]ctx: Click context object. See spiextend_t object definition for detailed explanation.
Returns
Nothing.

◆ spiextend_default_cfg()

err_t spiextend_default_cfg ( spiextend_t * ctx)

SPI Extend default configuration function.

This function executes a default configuration of SPI Extend click board.

Parameters
[in]ctx: Click context object. See spiextend_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ spiextend_enable_int()

void spiextend_enable_int ( spiextend_t * ctx,
spiextend_event_data_t event_data )

SPI Extend enable int function.

Function enable int of the LTC4332 SPI Extender Over Rugged Differential Link on the SPI Extend click board.

Parameters
[in]ctx: Click context object. See spiextend_t object definition for detailed explanation.
[in]event_data: Memory location where data be stored.
Returns
Nothing.

◆ spiextend_generic_read()

err_t spiextend_generic_read ( spiextend_t * ctx,
uint8_t reg,
uint8_t * data_out )

SPI Extend data reading function.

This function reads a desired number of data bytes starting from the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See spiextend_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ spiextend_generic_write()

err_t spiextend_generic_write ( spiextend_t * ctx,
uint8_t reg,
uint8_t data_in )

SPI Extend data writing function.

This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See spiextend_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ spiextend_get_config()

void spiextend_get_config ( spiextend_t * ctx,
spiextend_config_data_t * config_data )

SPI Extend get the configuration function.

Function get configuration of the LTC4332 SPI Extender Over Rugged Differential Link on the SPI Extend click board.

Parameters
[in]ctx: Click context object. See spiextend_t object definition for detailed explanation.
[out]config_data: structure where data be stored.
Returns
Nothing.

◆ spiextend_get_event()

void spiextend_get_event ( spiextend_t * ctx,
spiextend_event_data_t * event_data )

SPI Extend get the event function.

Function get events of the LTC4332 SPI Extender Over Rugged Differential Link on the SPI Extend click board.

Parameters
[in]ctx: Click context object. See spiextend_t object definition for detailed explanation.
[out]event_data: Pointer to the memory location where data be stored.
Returns
Nothing.
Note
Set by the system and cleared by the user.

◆ spiextend_get_fault()

void spiextend_get_fault ( spiextend_t * ctx,
spiextend_fault_data_t * fault_data )

SPI Extend get the fault state function.

Function read fault register and update fault state data structe of the LTC4332 SPI Extender Over Rugged Differential Link on the SPI Extend click board.

Parameters
[in]ctx: Click context object. See spiextend_t object definition for detailed explanation.
[out]fault_data: Pointer to the memory location where data be stored.
Returns
Nothing.

◆ spiextend_get_scratch()

uint8_t spiextend_get_scratch ( spiextend_t * ctx)

SPI Extend get scratch function.

Function read scratch register and return scratch data of the LTC4332 SPI Extender Over Rugged Differential Link on the SPI Extend click board.

Parameters
[in]ctx: Click context object. See spiextend_t object definition for detailed explanation.
Returns
8-bit scratch data.

◆ spiextend_get_status()

void spiextend_get_status ( spiextend_t * ctx,
spiextend_status_data_t * status_data )

SPI Extend get the status function.

Function set configuration of the LTC4332 SPI Extender Over Rugged Differential Link on the SPI Extend click board.

Parameters
[in]ctx: Click context object. See spiextend_t object definition for detailed explanation.
[out]status_data: Pointer to the memory location where data be stored.
Returns
Nothing.

◆ spiextend_get_word_length()

uint8_t spiextend_get_word_length ( spiextend_t * ctx)

SPI Extend get the word length function.

Function read word length register and return word length data of the LTC4332 SPI Extender Over Rugged Differential Link on the SPI Extend click board.

Parameters
[in]ctx: Click context object. See spiextend_t object definition for detailed explanation.
Returns
8-bit word length.

◆ spiextend_init()

err_t spiextend_init ( spiextend_t * ctx,
spiextend_cfg_t * cfg )

SPI Extend initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See spiextend_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See spiextend_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ spiextend_rmt_multi_read()

void spiextend_rmt_multi_read ( spiextend_t * ctx,
uint8_t reg,
uint8_t * p_rx_data,
uint8_t n_bytes,
uint8_t sel_slave )

SPI Extend generic multi read data in Remote Mode function.

Function multi read a the byte of data to the targeted 8-bit register address of the click board connected to the LTC4332 SPI Extender Over Rugged Differential Link on the SPI Extend click board.

Parameters
[in]ctx: Click context object. See spiextend_t object definition for detailed explanation.
[in]reg: 8-bit register address.
[out]p_rx_data: Pointer to the memory location where data be stored.
[in]n_bytes: 16-bit number of bytes to be written.
[in]sel_slave: Slave select.
Returns
Nothing.

◆ spiextend_rmt_multi_write()

void spiextend_rmt_multi_write ( spiextend_t * ctx,
uint8_t reg,
uint8_t * p_tx_data,
uint16_t n_bytes,
uint8_t sel_slave )

SPI Extend generic multi write data in Remote Mode function.

Function writes a the byte of data to the targeted 8-bit register address of the click board connected to the LTC4332 SPI Extender Over Rugged Differential Link on the SPI Extend click board.

Parameters
[in]ctx: Click context object. See spiextend_t object definition for detailed explanation.
[in]reg: 8-bit register address.
[in]p_tx_data: Pointer to the memory location where data be stored.
[in]n_bytes: 16-bit number of bytes to be written.
[in]sel_slave: Slave select.
Returns
Nothing.

◆ spiextend_rmt_read()

uint8_t spiextend_rmt_read ( spiextend_t * ctx,
uint8_t reg,
uint8_t sel_slave )

SPI Extend generic read data in Remote Mode function.

Function read a the byte of data from the targeted 8-bit register address of the click board connected to the LTC4332 SPI Extender Over Rugged Differential Link on the SPI Extend click board.

Parameters
[in]ctx: Click context object. See spiextend_t object definition for detailed explanation.
[in]reg: 8-bit register address.
[in]sel_slave: Slave select.
Returns
8-bit read data.

◆ spiextend_rmt_spi_read()

void spiextend_rmt_spi_read ( spiextend_t * ctx,
uint8_t * p_rx_data,
uint16_t n_bytes )

SPI Extend generic SPI read data in Remote Mode function.

Function SPI read a the byte of data to the targeted 8-bit register address of the click board connected to the LTC4332 SPI Extender Over Rugged Differential Link on the SPI Extend click board.

Parameters
[in]ctx: Click context object. See spiextend_t object definition for detailed explanation.
[out]p_rx_data: Pointer to the memory location where data be stored.
[in]n_bytes: 16-bit number of bytes to be read.
Returns
Nothing.

◆ spiextend_rmt_spi_write()

void spiextend_rmt_spi_write ( spiextend_t * ctx,
uint8_t * p_tx_data,
uint16_t n_bytes )

SPI Extend generic SPI write data in Remote Mode function.

Function SPI writes a the byte of data to the targeted 8-bit register address of the click board connected to the LTC4332 SPI Extender Over Rugged Differential Link on the SPI Extend click board.

Parameters
[in]ctx: Click context object. See spiextend_t object definition for detailed explanation.
[in]p_tx_data: Pointer to the memory location where data be stored.
[in]n_bytes: 16-bit number of bytes to be written.
Returns
Nothing.

◆ spiextend_rmt_write()

void spiextend_rmt_write ( spiextend_t * ctx,
uint8_t reg,
uint8_t tx_data,
uint8_t sel_slave )

SPI Extend generic write data in Remote Mode function.

Function writes a the byte of data to the targeted 8-bit register address of the click board connected to the LTC4332 SPI Extender Over Rugged Differential Link on the SPI Extend click board.

Parameters
[in]ctx: Click context object. See spiextend_t object definition for detailed explanation.
[in]reg: 8-bit register address.
[in]tx_data: Data to be written.
[in]sel_slave: Slave select.
Returns
Nothing.

◆ spiextend_set_config()

void spiextend_set_config ( spiextend_t * ctx,
spiextend_config_data_t config_data )

SPI Extend set the configuration function.

Function set configuration of the LTC4332 SPI Extender Over Rugged Differential Link on the SPI Extend click board.

Parameters
[in]ctx: Click context object. See spiextend_t object definition for detailed explanation.
[in]config_data: Structure where data be stored.
Returns
Nothing.

◆ spiextend_set_scratch()

void spiextend_set_scratch ( spiextend_t * ctx,
uint8_t scratch )

SPI Extend set scratch function.

Function set scratch data of the LTC4332 SPI Extender Over Rugged Differential Link on the SPI Extend click board.

Parameters
[in]ctx: Click context object. See spiextend_t object definition for detailed explanation.
[in]scratch: 8-bit scratch data.
Returns
Nothing

◆ spiextend_set_ss1()

void spiextend_set_ss1 ( spiextend_t * ctx,
uint8_t en_cs )

SPI Extend set SS1 pin state function.

Function set SS1 pin state of the LTC4332 SPI Extender Over Rugged Differential Link on the SPI Extend click board.

Parameters
[in]ctx: Click context object. See spiextend_t object definition for detailed explanation.
[in]en_cs: SS1 pin state.
Returns
Nothing

◆ spiextend_set_ss2()

void spiextend_set_ss2 ( spiextend_t * ctx,
uint8_t en_rst )

SPI Extend set SS2 pin state function.

Function set SS2 pin state of the LTC4332 SPI Extender Over Rugged Differential Link on the SPI Extend click board.

Parameters
[in]ctx: Click context object. See spiextend_t object definition for detailed explanation.
[in]en_rst: SS2 pin state.
Returns
Nothing

◆ spiextend_set_ss3()

void spiextend_set_ss3 ( spiextend_t * ctx,
uint8_t en_an )

SPI Extend set SS3 pin state function.

Function set SS3 pin state of the LTC4332 SPI Extender Over Rugged Differential Link on the SPI Extend click board.

Parameters
[in]ctx: Click context object. See spiextend_t object definition for detailed explanation.
[in]en_an: SS3 pin state.
Returns
Nothing

◆ spiextend_set_word_length()

void spiextend_set_word_length ( spiextend_t * ctx,
uint8_t word_length )

SPI Extend set the word length function.

Function read fault register and update fault state data structe of the LTC4332 SPI Extender Over Rugged Differential Link on the SPI Extend click board.

Parameters
[in]ctx: Click context object. See spiextend_t object definition for detailed explanation.
[in]word_length: 8-bit word length ( from 8 to 32 ).
Returns
Nothing.