hbridge16 2.1.0.0
|
API for configuring and manipulating H-Bridge 16 Click driver. More...
Topics | |
H-Bridge 16 Registers List | |
List of registers of H-Bridge 16 Click driver. | |
H-Bridge 16 Registers Settings | |
Settings for registers of H-Bridge 16 Click driver. | |
H-Bridge 16 MikroBUS Map | |
MikroBUS pin mapping of H-Bridge 16 Click driver. | |
Functions | |
void | hbridge16_cfg_setup (hbridge16_cfg_t *cfg) |
H-Bridge 16 configuration object setup function. | |
err_t | hbridge16_init (hbridge16_t *ctx, hbridge16_cfg_t *cfg) |
H-Bridge 16 initialization function. | |
err_t | hbridge16_default_cfg (hbridge16_t *ctx) |
H-Bridge 16 default configuration function. | |
err_t | hbridge16_generic_write (hbridge16_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
H-Bridge 16 I2C writing function. | |
err_t | hbridge16_generic_read (hbridge16_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
H-Bridge 16 I2C reading function. | |
void | hbridge16_reset_port_exp (hbridge16_t *ctx) |
H-Bridge 16 reset port expander function. | |
uint8_t | hbridge16_get_int_pin (hbridge16_t *ctx) |
H-Bridge 16 get Interrupt pin function. | |
void | hbridge16_set_slp_pin (hbridge16_t *ctx, uint8_t pin_state) |
H-Bridge 15 set Sleep pin function. | |
err_t | hbridge16_write_reg (hbridge16_t *ctx, uint8_t reg, uint8_t data_in) |
H-Bridge 16 write register function. | |
err_t | hbridge16_read_reg (hbridge16_t *ctx, uint8_t reg, uint8_t *data_out) |
H-Bridge 16 read register function. | |
err_t | hbridge16_set_pins (hbridge16_t *ctx, uint8_t set_mask, uint8_t clr_mask) |
H-Bridge 16 set pins function. | |
err_t | hbridge16_set_mode (hbridge16_t *ctx, uint8_t mode_sel) |
H-Bridge 16 set mode function. | |
err_t | hbridge16_set_out_state (hbridge16_t *ctx, uint8_t out_state) |
H-Bridge 16 set output function. | |
API for configuring and manipulating H-Bridge 16 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void hbridge16_cfg_setup | ( | hbridge16_cfg_t * | cfg | ) |
H-Bridge 16 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See hbridge16_cfg_t object definition for detailed explanation. |
err_t hbridge16_default_cfg | ( | hbridge16_t * | ctx | ) |
H-Bridge 16 default configuration function.
This function executes a default configuration of H-Bridge 16 click board.
[in] | ctx | : Click context object. See hbridge16_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge16_generic_read | ( | hbridge16_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
H-Bridge 16 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 hbridge16_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. See #err_t definition for detailed explanation. err_t hbridge16_generic_write | ( | hbridge16_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
H-Bridge 16 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 hbridge16_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. See #err_t definition for detailed explanation. uint8_t hbridge16_get_int_pin | ( | hbridge16_t * | ctx | ) |
H-Bridge 16 get Interrupt pin function.
This function is used to get Interrupt pin state.
[in] | ctx | : Click context object. See hbridge16_t object definition for detailed explanation. |
0
- Pin state low, 1
- Pin state high. err_t hbridge16_init | ( | hbridge16_t * | ctx, |
hbridge16_cfg_t * | cfg ) |
H-Bridge 16 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See hbridge16_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See hbridge16_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge16_read_reg | ( | hbridge16_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
H-Bridge 16 read register function.
This function reads data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See hbridge16_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void hbridge16_reset_port_exp | ( | hbridge16_t * | ctx | ) |
H-Bridge 16 reset port expander function.
This function resets the port expander by toggling the RST pin.
[in] | ctx | : Click context object. See hbridge16_t object definition for detailed explanation. |
err_t hbridge16_set_mode | ( | hbridge16_t * | ctx, |
uint8_t | mode_sel ) |
H-Bridge 16 set mode function.
This function sets interface mode.
[in] | ctx | : Click context object. See hbridge16_t object definition for detailed explanation. |
[in] | mode_sel | : Mode selection. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge16_set_out_state | ( | hbridge16_t * | ctx, |
uint8_t | out_state ) |
H-Bridge 16 set output function.
This function is used to set output state of the H-Bridge 16 click board.
[in] | ctx | : Click context object. See hbridge16_t object definition for detailed explanation. |
[in] | out_state | : Output state. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge16_set_pins | ( | hbridge16_t * | ctx, |
uint8_t | set_mask, | ||
uint8_t | clr_mask ) |
H-Bridge 16 set pins function.
This function sets and clears the value of the selected pins of PCA9538A port expander.
[in] | ctx | : Click context object. See hbridge16_t object definition for detailed explanation. |
[in] | clr_mask | : Pin clear mask. |
[in] | set_mask | : Pin set mask. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void hbridge16_set_slp_pin | ( | hbridge16_t * | ctx, |
uint8_t | pin_state ) |
H-Bridge 15 set Sleep pin function.
This function is used to set state of the Sleep pin.
[in] | ctx | : Click context object. See #hbridge15_t object definition for detailed explanation. |
[in] | pin_state | : Pin state. |
err_t hbridge16_write_reg | ( | hbridge16_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
H-Bridge 16 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 hbridge16_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.