expand12
2.0.0.0
|
API for configuring and manipulating Expand 12 Click driver. More...
Modules | |
Expand 12 Registers List | |
List of registers of Expand 12 Click driver. | |
Expand 12 Registers Settings | |
Settings for registers of Expand 12 Click driver. | |
Expand 12 MikroBUS Map | |
MikroBUS pin mapping of Expand 12 Click driver. | |
Functions | |
void | expand12_cfg_setup (expand12_cfg_t *cfg) |
Expand 12 configuration object setup function. More... | |
err_t | expand12_init (expand12_t *ctx, expand12_cfg_t *cfg) |
Expand 12 initialization function. More... | |
err_t | expand12_default_cfg (expand12_t *ctx) |
Expand 12 default configuration function. More... | |
err_t | expand12_generic_write (expand12_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
Expand 12 I2C writing function. More... | |
err_t | expand12_generic_read (expand12_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
Expand 12 I2C reading function. More... | |
err_t | expand12_write_register (expand12_t *ctx, uint8_t reg, uint8_t data_in) |
Expand 12 write register function. More... | |
err_t | expand12_read_register (expand12_t *ctx, uint8_t reg, uint8_t *data_out) |
Expand 12 read register function. More... | |
err_t | expand12_set_operating_mode (expand12_t *ctx, uint8_t state) |
Expand 12 set operating mode function. More... | |
err_t | expand12_set_pin_direction (expand12_t *ctx, uint8_t pin, uint8_t direction) |
Expand 12 set pin direction function. More... | |
err_t | expand12_set_port_direction (expand12_t *ctx, uint8_t port, uint8_t direction) |
Expand 12 set port direction function. More... | |
err_t | expand12_set_all_pins_direction (expand12_t *ctx, uint8_t direction) |
Expand 12 set all pins direction function. More... | |
err_t | expand12_set_pin_value (expand12_t *ctx, uint8_t pin, uint8_t pin_value) |
Expand 12 set pin value function. More... | |
err_t | expand12_set_port_value (expand12_t *ctx, uint8_t port, uint8_t clr_mask, uint8_t set_mask) |
Expand 12 set port value function. More... | |
err_t | expand12_set_all_pins_value (expand12_t *ctx, uint8_t pin_value) |
Expand 12 set all pins value function. More... | |
err_t | expand12_read_pin_value (expand12_t *ctx, uint8_t pin, uint8_t *pin_value) |
Expand 12 read pin value function. More... | |
err_t | expand12_read_port_value (expand12_t *ctx, uint8_t port, uint8_t *port_value) |
Expand 12 read port value function. More... | |
err_t | expand12_read_all_pins_value (expand12_t *ctx, uint32_t *pins_value) |
Expand 12 read all pins value function. More... | |
API for configuring and manipulating Expand 12 Click driver.
void expand12_cfg_setup | ( | expand12_cfg_t * | cfg | ) |
Expand 12 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See expand12_cfg_t object definition for detailed explanation. |
err_t expand12_default_cfg | ( | expand12_t * | ctx | ) |
Expand 12 default configuration function.
This function executes a default configuration of Expand 12 click board.
[in] | ctx | : Click context object. See expand12_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t expand12_generic_read | ( | expand12_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len | ||
) |
Expand 12 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 expand12_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 expand12_generic_write | ( | expand12_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len | ||
) |
Expand 12 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 expand12_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.err_t expand12_init | ( | expand12_t * | ctx, |
expand12_cfg_t * | cfg | ||
) |
Expand 12 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See expand12_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See expand12_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t expand12_read_all_pins_value | ( | expand12_t * | ctx, |
uint32_t * | pins_value | ||
) |
Expand 12 read all pins value function.
This function reads all pins logic levels.
[in] | ctx | : Click context object. See expand12_t object definition for detailed explanation. |
[out] | pins_value | : All pins value (32-bit). |
0
- Success, -1
- Error.err_t expand12_read_pin_value | ( | expand12_t * | ctx, |
uint8_t | pin, | ||
uint8_t * | pin_value | ||
) |
Expand 12 read pin value function.
This function reads the logic level of the selected pin.
[in] | ctx | : Click context object. See expand12_t object definition for detailed explanation. |
[in] | pin | : Pin selection value [0,27]. |
[out] | pin_value | :
|
0
- Success, -1
- Error.err_t expand12_read_port_value | ( | expand12_t * | ctx, |
uint8_t | port, | ||
uint8_t * | port_value | ||
) |
Expand 12 read port value function.
This function reads the pins logic level of the selected port.
[in] | ctx | : Click context object. See expand12_t object definition for detailed explanation. |
[in] | port | :
|
[out] | port_value | : Port value (8-bit). |
0
- Success, -1
- Error.err_t expand12_read_register | ( | expand12_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out | ||
) |
Expand 12 read register function.
This function reads a data byte from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See expand12_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output data read. |
0
- Success, -1
- Error.err_t expand12_set_all_pins_direction | ( | expand12_t * | ctx, |
uint8_t | direction | ||
) |
Expand 12 set all pins direction function.
This function sets the direction of all pins.
[in] | ctx | : Click context object. See expand12_t object definition for detailed explanation. |
[in] | direction | :
|
0
- Success, -1
- Error.err_t expand12_set_all_pins_value | ( | expand12_t * | ctx, |
uint8_t | pin_value | ||
) |
Expand 12 set all pins value function.
This function sets the logic level of all output pins.
[in] | ctx | : Click context object. See expand12_t object definition for detailed explanation. |
[in] | pin_value | :
|
0
- Success, -1
- Error.err_t expand12_set_operating_mode | ( | expand12_t * | ctx, |
uint8_t | state | ||
) |
Expand 12 set operating mode function.
This function sets a device operating mode.
[in] | ctx | : Click context object. See expand12_t object definition for detailed explanation. |
[in] | state | :
|
0
- Success, -1
- Error.err_t expand12_set_pin_direction | ( | expand12_t * | ctx, |
uint8_t | pin, | ||
uint8_t | direction | ||
) |
Expand 12 set pin direction function.
This function sets the direction of the selected pin.
[in] | ctx | : Click context object. See expand12_t object definition for detailed explanation. |
[in] | pin | : Pin selection value [0,27]. |
[in] | direction | :
|
0
- Success, -1
- Error.err_t expand12_set_pin_value | ( | expand12_t * | ctx, |
uint8_t | pin, | ||
uint8_t | pin_value | ||
) |
Expand 12 set pin value function.
This function sets the logic level of the selected pin.
[in] | ctx | : Click context object. See expand12_t object definition for detailed explanation. |
[in] | pin | : Pin selection value [0,27]. |
[in] | pin_value | :
|
0
- Success, -1
- Error.err_t expand12_set_port_direction | ( | expand12_t * | ctx, |
uint8_t | port, | ||
uint8_t | direction | ||
) |
Expand 12 set port direction function.
This function sets the direction of the selected port.
[in] | ctx | : Click context object. See expand12_t object definition for detailed explanation. |
[in] | port | :
|
[in] | direction | :
|
0
- Success, -1
- Error.err_t expand12_set_port_value | ( | expand12_t * | ctx, |
uint8_t | port, | ||
uint8_t | clr_mask, | ||
uint8_t | set_mask | ||
) |
Expand 12 set port value function.
This function sets the pins level value of the selected port.
[in] | ctx | : Click context object. See expand12_t object definition for detailed explanation. |
[in] | port | :
|
[in] | clr_mask | : Pin clear mask. |
[in] | set_mask | : Pin set mask. |
0
- Success, -1
- Error.err_t expand12_write_register | ( | expand12_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in | ||
) |
Expand 12 write register function.
This function writes a desired data byte to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See expand12_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error.