expand10 2.0.0.0
|
API for configuring and manipulating Expand 10 Click driver. More...
Topics | |
Expand 10 Registers List | |
List of registers of Expand 10 Click driver. | |
Expand 10 Registers Settings | |
Settings for registers of Expand 10 Click driver. | |
Expand 10 MikroBUS Map | |
MikroBUS pin mapping of Expand 10 Click driver. | |
Functions | |
void | expand10_cfg_setup (expand10_cfg_t *cfg) |
Expand 10 configuration object setup function. | |
err_t | expand10_init (expand10_t *ctx, expand10_cfg_t *cfg) |
Expand 10 initialization function. | |
err_t | expand10_default_cfg (expand10_t *ctx) |
Expand 10 default configuration function. | |
err_t | expand10_generic_write (expand10_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
Expand 10 I2C writing function. | |
err_t | expand10_generic_read (expand10_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
Expand 10 I2C reading function. | |
void | expand10_set_rst_pin (expand10_t *ctx, uint8_t logic_level) |
Expand 10 set RST pin function. | |
uint8_t | expand10_get_int_pin (expand10_t *ctx) |
Expand 10 get INT pin function. | |
err_t | expand10_write_register (expand10_t *ctx, uint8_t reg, uint8_t data_in) |
Expand 10 write register function. | |
err_t | expand10_read_register (expand10_t *ctx, uint8_t reg, uint8_t *data_out) |
Expand 10 read register function. | |
err_t | expand10_check_device_id (expand10_t *ctx) |
Expand 10 check device ID function. | |
err_t | expand10_software_reset (expand10_t *ctx) |
Expand 10 software reset function. | |
err_t | expand10_set_pin_direction (expand10_t *ctx, uint8_t direction, uint8_t port, uint8_t pin_mask) |
Expand 10 set pin direction function. | |
err_t | expand10_set_all_pins_direction (expand10_t *ctx, uint8_t direction) |
Expand 10 set all pins direction function. | |
err_t | expand10_set_all_pins_value (expand10_t *ctx, uint8_t set_mask) |
Expand 10 set all pins value function. | |
err_t | expand10_set_pin_value (expand10_t *ctx, uint8_t port, uint8_t clr_mask, uint8_t set_mask) |
Expand 10 set pin value function. | |
err_t | expand10_read_port_value (expand10_t *ctx, uint8_t port, uint8_t *data_out) |
Expand 10 read port value function. | |
API for configuring and manipulating Expand 10 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void expand10_cfg_setup | ( | expand10_cfg_t * | cfg | ) |
Expand 10 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See expand10_cfg_t object definition for detailed explanation. |
err_t expand10_check_device_id | ( | expand10_t * | ctx | ) |
Expand 10 check device ID function.
This function reads and verifies the device ID.
[in] | ctx | : Click context object. See expand10_t object definition for detailed explanation. |
0
- Correct device ID read, -1
- Error.err_t expand10_default_cfg | ( | expand10_t * | ctx | ) |
Expand 10 default configuration function.
This function executes a default configuration of Expand 10 click board.
[in] | ctx | : Click context object. See expand10_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t expand10_generic_read | ( | expand10_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
Expand 10 I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See expand10_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t expand10_generic_write | ( | expand10_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len ) |
Expand 10 I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See expand10_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_buf | : Data to be written. |
[in] | tx_len | : Number of bytes to be written. |
0
- Success, -1
- Error.uint8_t expand10_get_int_pin | ( | expand10_t * | ctx | ) |
Expand 10 get INT pin function.
This function returns the logic level of the INT pin.
[in] | ctx | : Click context object. See expand10_t object definition for detailed explanation. |
err_t expand10_init | ( | expand10_t * | ctx, |
expand10_cfg_t * | cfg ) |
Expand 10 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See expand10_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See expand10_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t expand10_read_port_value | ( | expand10_t * | ctx, |
uint8_t | port, | ||
uint8_t * | data_out ) |
Expand 10 read port value function.
This function reads the value of the selected port input pins.
[in] | ctx | : Click context object. See expand10_t object definition for detailed explanation. |
[in] | port | :
|
[out] | data_out | : Port value. |
0
- Success, -1
- Error.err_t expand10_read_register | ( | expand10_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
Expand 10 read register function.
This function reads a data byte from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See expand10_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error.err_t expand10_set_all_pins_direction | ( | expand10_t * | ctx, |
uint8_t | direction ) |
Expand 10 set all pins direction function.
This function sets the direction of all pins.
[in] | ctx | : Click context object. See expand10_t object definition for detailed explanation. |
[in] | direction | :
|
0
- Success, -1
- Error.err_t expand10_set_all_pins_value | ( | expand10_t * | ctx, |
uint8_t | set_mask ) |
Expand 10 set all pins value function.
This function sets the value of all output pins.
[in] | ctx | : Click context object. See expand10_t object definition for detailed explanation. |
[in] | set_mask | : Pin set mask. |
0
- Success, -1
- Error.err_t expand10_set_pin_direction | ( | expand10_t * | ctx, |
uint8_t | direction, | ||
uint8_t | port, | ||
uint8_t | pin_mask ) |
Expand 10 set pin direction function.
This function sets the direction of the selected pins.
[in] | ctx | : Click context object. See expand10_t object definition for detailed explanation. |
[in] | direction | :
|
[in] | port | :
|
[in] | pin_mask | : Pin mask. |
0
- Success, -1
- Error.err_t expand10_set_pin_value | ( | expand10_t * | ctx, |
uint8_t | port, | ||
uint8_t | clr_mask, | ||
uint8_t | set_mask ) |
Expand 10 set pin value function.
This function sets the value of the selected pins.
[in] | ctx | : Click context object. See expand10_t object definition for detailed explanation. |
[in] | port | :
|
[in] | clr_mask | : Pin clear mask. |
[in] | set_mask | : Pin set mask. |
0
- Success, -1
- Error.void expand10_set_rst_pin | ( | expand10_t * | ctx, |
uint8_t | logic_level ) |
Expand 10 set RST pin function.
This function sets the logic level of the RST pin.
[in] | ctx | : Click context object. See expand10_t object definition for detailed explanation. |
[in] | logic_level | : Pin logic level. |
err_t expand10_software_reset | ( | expand10_t * | ctx | ) |
Expand 10 software reset function.
This function performs the software reset.
[in] | ctx | : Click context object. See expand10_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t expand10_write_register | ( | expand10_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Expand 10 write register function.
This function writes a data byte to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See expand10_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error.