expand8 2.0.0.0
|
API for configuring and manipulating Expand 8 Click driver. More...
Topics | |
Expand 8 Registers Settings | |
Settings for registers of Expand 8 Click driver. | |
Expand 8 MikroBUS Map | |
MikroBUS pin mapping of Expand 8 Click driver. | |
Functions | |
void | expand8_cfg_setup (expand8_cfg_t *cfg) |
Expand 8 configuration object setup function. | |
err_t | expand8_init (expand8_t *ctx, expand8_cfg_t *cfg) |
Expand 8 initialization function. | |
err_t | expand8_generic_write (expand8_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Expand 8 data writing function. | |
err_t | expand8_generic_read (expand8_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Expand 8 data reading function. | |
void | expand8_write_data (expand8_t *ctx, uint8_t addr, uint8_t tx_data) |
Generic write data function. | |
uint8_t | expand8_read_data (expand8_t *ctx, uint8_t addr) |
Generic read data function. | |
err_t | expand8_set_port (expand8_t *ctx, uint8_t sel_port, uint8_t sel_imped) |
Set port function. | |
API for configuring and manipulating Expand 8 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void expand8_cfg_setup | ( | expand8_cfg_t * | cfg | ) |
Expand 8 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See expand8_cfg_t object definition for detailed explanation. |
err_t expand8_generic_read | ( | expand8_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Expand 8 data reading function.
This function reads a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See expand8_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t expand8_generic_write | ( | expand8_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Expand 8 data writing function.
This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See expand8_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error.err_t expand8_init | ( | expand8_t * | ctx, |
expand8_cfg_t * | cfg ) |
Expand 8 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See expand8_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See expand8_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.uint8_t expand8_read_data | ( | expand8_t * | ctx, |
uint8_t | addr ) |
Generic read data function.
The function read the the byte of data from the target 8-bit register address of the MAX7317, 10-Port SPI-Interfaced I/O Expander with Overvoltage and Hot-Insertion Protection on Expand 8 click boar.
[in] | ctx | : Click context object. See expand8_t object definition for detailed explanation. |
[in] | addr | : 7-bit Command Address. |
err_t expand8_set_port | ( | expand8_t * | ctx, |
uint8_t | sel_port, | ||
uint8_t | sel_imped ) |
Set port function.
The function set and configur the target port of the MAX7317, 10-Port SPI-Interfaced I/O Expander with Overvoltage and Hot-Insertion Protection on Expand 8 click board.
[in] | ctx | : Click context object. See expand8_t object definition for detailed explanation. |
sel_port | : Selected Port [ 0 : 9 ]. | |
sel_imped | : Selected Impedance. |
0
- Success, -1
- Error.void expand8_write_data | ( | expand8_t * | ctx, |
uint8_t | addr, | ||
uint8_t | tx_data ) |
Generic write data function.
The function write the byte of data to the target 8-bit register address of the MAX7317, 10-Port SPI-Interfaced I/O Expander with Overvoltage and Hot-Insertion Protection on Expand 8 click board.
[in] | ctx | : Click context object. See expand8_t object definition for detailed explanation. |
[in] | addr | : 7-bit Command Address. |
[in] | tx_data | : Byte of data to write. |