hbridge15 2.1.0.0
|
API for configuring and manipulating H-Bridge 15 Click driver. More...
Topics | |
H-Bridge 15 Registers List | |
List of registers of H-Bridge 15 Click driver. | |
H-Bridge 15 Registers Settings | |
Settings for registers of H-Bridge 15 Click driver. | |
H-Bridge 15 MikroBUS Map | |
MikroBUS pin mapping of H-Bridge 15 Click driver. | |
Functions | |
void | hbridge15_cfg_setup (hbridge15_cfg_t *cfg) |
H-Bridge 15 configuration object setup function. | |
err_t | hbridge15_init (hbridge15_t *ctx, hbridge15_cfg_t *cfg) |
H-Bridge 15 initialization function. | |
err_t | hbridge15_default_cfg (hbridge15_t *ctx) |
H-Bridge 15 default configuration function. | |
err_t | hbridge15_generic_write (hbridge15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
H-Bridge 15 I2C writing function. | |
err_t | hbridge15_generic_read (hbridge15_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
H-Bridge 15 I2C reading function. | |
void | hbridge15_set_rst_pin (hbridge15_t *ctx, uint8_t pin_state) |
H-Bridge 15 set RST pin function. | |
void | hbridge15_set_ena_pin (hbridge15_t *ctx, uint8_t pin_state) |
H-Bridge 15 set ENA pin function. | |
uint8_t | hbridge15_get_int_state (hbridge15_t *ctx) |
H-Bridge 15 get INT pin state function. | |
void | hbridge15_reset_port_exp (hbridge15_t *ctx) |
H-Bridge 15 reset port expander function. | |
err_t | hbridge15_write_reg (hbridge15_t *ctx, uint8_t reg, uint8_t data_in) |
H-Bridge 15 write register function. | |
err_t | hbridge15_read_reg (hbridge15_t *ctx, uint8_t reg, uint8_t *data_out) |
H-Bridge 15 read register function. | |
err_t | hbridge15_set_pins (hbridge15_t *ctx, uint8_t set_mask, uint8_t clr_mask) |
H-Bridge 15 set pins function. | |
err_t | hbridge15_set_sleep (hbridge15_t *ctx, uint8_t sleep_state) |
H-Bridge 15 set sleep function. | |
err_t | hbridge15_set_out_state (hbridge15_t *ctx, uint8_t out_state) |
H-Bridge 15 set output function. | |
API for configuring and manipulating H-Bridge 15 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void hbridge15_cfg_setup | ( | hbridge15_cfg_t * | cfg | ) |
H-Bridge 15 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See hbridge15_cfg_t object definition for detailed explanation. |
err_t hbridge15_default_cfg | ( | hbridge15_t * | ctx | ) |
H-Bridge 15 default configuration function.
This function executes a default configuration of H-Bridge 15 click board.
[in] | ctx | : Click context object. See hbridge15_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge15_generic_read | ( | hbridge15_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
H-Bridge 15 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 hbridge15_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 hbridge15_generic_write | ( | hbridge15_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
H-Bridge 15 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 hbridge15_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 hbridge15_get_int_state | ( | hbridge15_t * | ctx | ) |
H-Bridge 15 get INT pin state function.
This function is used to get INT pin state.
[in] | ctx | : Click context object. See hbridge15_t object definition for detailed explanation. |
err_t hbridge15_init | ( | hbridge15_t * | ctx, |
hbridge15_cfg_t * | cfg ) |
H-Bridge 15 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See hbridge15_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See hbridge15_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge15_read_reg | ( | hbridge15_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
H-Bridge 15 read register function.
This function reads data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See hbridge15_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 hbridge15_reset_port_exp | ( | hbridge15_t * | ctx | ) |
H-Bridge 15 reset port expander function.
This function resets the port expander by toggling the RST pin.
[in] | ctx | : Click context object. See hbridge15_t object definition for detailed explanation. |
void hbridge15_set_ena_pin | ( | hbridge15_t * | ctx, |
uint8_t | pin_state ) |
H-Bridge 15 set ENA pin function.
This function is used to set state of the ENA pin.
[in] | ctx | : Click context object. See hbridge15_t object definition for detailed explanation. |
[in] | pin_state | : Pin state. |
err_t hbridge15_set_out_state | ( | hbridge15_t * | ctx, |
uint8_t | out_state ) |
H-Bridge 15 set output function.
This function is used to set output state of the H-Bridge 15 click board.
[in] | ctx | : Click context object. See hbridge15_t object definition for detailed explanation. |
[in] | out_state | : Output state. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge15_set_pins | ( | hbridge15_t * | ctx, |
uint8_t | set_mask, | ||
uint8_t | clr_mask ) |
H-Bridge 15 set pins function.
This function sets and clears the value of the selected pins of PCA9538A port expander.
[in] | ctx | : Click context object. See hbridge15_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 hbridge15_set_rst_pin | ( | hbridge15_t * | ctx, |
uint8_t | pin_state ) |
H-Bridge 15 set RST pin function.
This function is used to set state of the RST pin.
[in] | ctx | : Click context object. See hbridge15_t object definition for detailed explanation. |
[in] | pin_state | : Pin state. |
err_t hbridge15_set_sleep | ( | hbridge15_t * | ctx, |
uint8_t | sleep_state ) |
H-Bridge 15 set sleep function.
This function is used to set sleep state of the H-Bridge 15 click board.
[in] | ctx | : Click context object. See hbridge15_t object definition for detailed explanation. |
[in] | sleep_state | : Sleep state. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge15_write_reg | ( | hbridge15_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
H-Bridge 15 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 hbridge15_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.