hbridge14 2.1.0.0
|
API for configuring and manipulating H-Bridge 14 Click driver. More...
Topics | |
H-Bridge 14 Registers List | |
List of registers of H-Bridge 14 Click driver. | |
H-Bridge 14 Registers Settings | |
Settings for registers of H-Bridge 14 Click driver. | |
H-Bridge 14 MikroBUS Map | |
MikroBUS pin mapping of H-Bridge 14 Click driver. | |
Functions | |
void | hbridge14_cfg_setup (hbridge14_cfg_t *cfg) |
H-Bridge 14 configuration object setup function. | |
err_t | hbridge14_init (hbridge14_t *ctx, hbridge14_cfg_t *cfg) |
H-Bridge 14 initialization function. | |
err_t | hbridge14_default_cfg (hbridge14_t *ctx) |
H-Bridge 14 default configuration function. | |
err_t | hbridge14_generic_write (hbridge14_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
H-Bridge 14 data writing function. | |
err_t | hbridge14_generic_read (hbridge14_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
H-Bridge 14 data reading function. | |
void | hbridge14_set_in1_pin (hbridge14_t *ctx, uint8_t pin_state) |
H-Bridge 14 set IN1 pin function. | |
void | hbridge14_set_rst_pin (hbridge14_t *ctx, uint8_t pin_state) |
H-Bridge 14 set RST pin function. | |
uint8_t | hbridge14_get_ip_pin (hbridge14_t *ctx) |
H-Bridge 14 get IP pin function. | |
uint8_t | hbridge14_get_int_pin (hbridge14_t *ctx) |
H-Bridge 14 get INT pin function. | |
err_t | hbridge14_register_write (hbridge14_t *ctx, uint8_t reg, uint8_t data_in) |
H-Bridge 14 data register writing function. | |
err_t | hbridge14_register_read (hbridge14_t *ctx, uint8_t reg, uint8_t *data_out) |
H-Bridge 14 data register reading function. | |
err_t | hbridge14_port_expander_write (hbridge14_t *ctx, uint8_t reg, uint8_t data_in) |
H-Bridge 14 port ecpander write register function. | |
err_t | hbridge14_port_expander_read (hbridge14_t *ctx, uint8_t reg, uint8_t *data_out) |
H-Bridge 14 port ecpander read register function. | |
err_t | hbridge14_set_pins (hbridge14_t *ctx, uint8_t set_mask, uint8_t clr_mask) |
H-Bridge 14 set pins function. | |
err_t | hbridge14_disable_state (hbridge14_t *ctx, uint8_t dis_state) |
H-Bridge 14 control disable function. | |
err_t | hbridge14_sleep_state (hbridge14_t *ctx, uint8_t sleep_state) |
H-Bridge 14 control sleep function. | |
err_t | hbridge14_drive_motor (hbridge14_t *ctx, uint8_t state) |
H-Bridge 14 drive motor function. | |
API for configuring and manipulating H-Bridge 14 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void hbridge14_cfg_setup | ( | hbridge14_cfg_t * | cfg | ) |
H-Bridge 14 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See hbridge14_cfg_t object definition for detailed explanation. |
err_t hbridge14_default_cfg | ( | hbridge14_t * | ctx | ) |
H-Bridge 14 default configuration function.
This function executes a default configuration of H-Bridge 14 click board.
[in] | ctx | : Click context object. See hbridge14_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge14_disable_state | ( | hbridge14_t * | ctx, |
uint8_t | dis_state ) |
H-Bridge 14 control disable function.
This function sets the state of the DIS pin, enabling or disabling outputs.
[in] | ctx | : Click context object. See hbridge14_t object definition for detailed explanation. |
[in] | dis_state | : State of the DIS pin. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge14_drive_motor | ( | hbridge14_t * | ctx, |
uint8_t | state ) |
H-Bridge 14 drive motor function.
This function sets motor driver into the selected state.
[in] | ctx | : Click context object. See hbridge14_t object definition for detailed explanation. |
[in] | state | : State of the driver. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge14_generic_read | ( | hbridge14_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
H-Bridge 14 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 hbridge14_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 hbridge14_generic_write | ( | hbridge14_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
H-Bridge 14 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 hbridge14_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 hbridge14_get_int_pin | ( | hbridge14_t * | ctx | ) |
H-Bridge 14 get INT pin function.
This function is used to get state of the INT pin.
[in] | ctx | : Click context object. See hbridge14_t object definition for detailed explanation. |
uint8_t hbridge14_get_ip_pin | ( | hbridge14_t * | ctx | ) |
H-Bridge 14 get IP pin function.
This function is used to get state of the IP pin.
[in] | ctx | : Click context object. See hbridge14_t object definition for detailed explanation. |
err_t hbridge14_init | ( | hbridge14_t * | ctx, |
hbridge14_cfg_t * | cfg ) |
H-Bridge 14 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See hbridge14_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See hbridge14_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge14_port_expander_read | ( | hbridge14_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
H-Bridge 14 port ecpander read register function.
This function reads a data byte from the selected register of the port expander.
[in] | ctx | : Click context object. See hbridge14_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge14_port_expander_write | ( | hbridge14_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
H-Bridge 14 port ecpander write register function.
This function writes a data byte into the selected register of the port expander.
[in] | ctx | : Click context object. See hbridge14_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. err_t hbridge14_register_read | ( | hbridge14_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
H-Bridge 14 data register reading function.
This function reads a data byte from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See hbridge14_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge14_register_write | ( | hbridge14_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
H-Bridge 14 data register writing function.
This function writes a data byte into the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See hbridge14_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. void hbridge14_set_in1_pin | ( | hbridge14_t * | ctx, |
uint8_t | pin_state ) |
H-Bridge 14 set IN1 pin function.
This function is used to set state of the IN1 pin.
[in] | ctx | : Click context object. See hbridge14_t object definition for detailed explanation. |
[in] | pin_state | : Pin state. |
err_t hbridge14_set_pins | ( | hbridge14_t * | ctx, |
uint8_t | set_mask, | ||
uint8_t | clr_mask ) |
H-Bridge 14 set pins function.
This function sets and clears the value of the selected pins of PCA9538A port expander.
[in] | ctx | : Click context object. See hbridge14_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 hbridge14_set_rst_pin | ( | hbridge14_t * | ctx, |
uint8_t | pin_state ) |
H-Bridge 14 set RST pin function.
This function is used to set state of the RST pin.
[in] | ctx | : Click context object. See hbridge14_t object definition for detailed explanation. |
[in] | pin_state | : Pin state. |
err_t hbridge14_sleep_state | ( | hbridge14_t * | ctx, |
uint8_t | sleep_state ) |
H-Bridge 14 control sleep function.
This function sets the state of the SLP pin, enabling or disabling sleep mode.
[in] | ctx | : Click context object. See hbridge14_t object definition for detailed explanation. |
[in] | sleep_state | : State of the SLP pin. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.