hbridge9 2.0.0.0
|
API for configuring and manipulating H-Bridge 9 Click driver. More...
Topics | |
H-Bridge 9 Registers List | |
List of registers of H-Bridge 9 Click driver. | |
H-Bridge 9 Registers Settings | |
Settings for registers of H-Bridge 9 Click driver. | |
H-Bridge 9 MikroBUS Map | |
MikroBUS pin mapping of H-Bridge 9 Click driver. | |
Functions | |
void | hbridge9_cfg_setup (hbridge9_cfg_t *cfg) |
H-Bridge 9 configuration object setup function. | |
err_t | hbridge9_init (hbridge9_t *ctx, hbridge9_cfg_t *cfg) |
H-Bridge 9 initialization function. | |
err_t | hbridge9_default_cfg (hbridge9_t *ctx) |
H-Bridge 9 default configuration function. | |
err_t | hbridge9_spi_transfer (hbridge9_t *ctx, uint8_t *data_in, uint8_t tx_len, uint8_t *data_out, uint8_t rx_len) |
H-Bridge 9 spi transfer function. | |
err_t | hbridge9_write_register (hbridge9_t *ctx, uint8_t reg, uint16_t data_in) |
H-Bridge 9 write register function. | |
err_t | hbridge9_read_register (hbridge9_t *ctx, uint8_t reg, uint16_t *data_out) |
H-Bridge 9 read register function. | |
err_t | hbridge9_modify_register_bits (hbridge9_t *ctx, uint8_t reg, uint16_t clr_mask, uint16_t set_mask) |
H-Bridge 9 modify register bits function. | |
err_t | hbridge9_read_register_and_clear (hbridge9_t *ctx, uint8_t reg, uint16_t *data_out) |
H-Bridge 9 read register and clear function. | |
err_t | hbridge9_read_info_register (hbridge9_t *ctx, uint8_t reg, uint8_t *data_out) |
H-Bridge 9 read info register function. | |
err_t | hbridge9_set_default (hbridge9_t *ctx) |
H-Bridge 9 set default function. | |
err_t | hbridge9_clear_all_status (hbridge9_t *ctx) |
H-Bridge 9 clear all status function. | |
err_t | hbridge9_check_communication (hbridge9_t *ctx) |
H-Bridge 9 check communication function. | |
void | hbridge9_set_en_out_pin (hbridge9_t *ctx, uint8_t state) |
H-Bridge 9 set en out pin function. | |
void | hbridge9_send_actuation_pulse (hbridge9_t *ctx) |
H-Bridge 9 send actuation pulse function. | |
uint8_t | hbridge9_get_dout_pin (hbridge9_t *ctx) |
H-Bridge 9 get dout pin function. | |
API for configuring and manipulating H-Bridge 9 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void hbridge9_cfg_setup | ( | hbridge9_cfg_t * | cfg | ) |
H-Bridge 9 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See hbridge9_cfg_t object definition for detailed explanation. |
err_t hbridge9_check_communication | ( | hbridge9_t * | ctx | ) |
H-Bridge 9 check communication function.
This function checks the communication by reading and verifying the SPI CPHA Test register.
[in] | ctx | : Click context object. See hbridge9_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge9_clear_all_status | ( | hbridge9_t * | ctx | ) |
H-Bridge 9 clear all status function.
This function sends the clear all status registers command.
[in] | ctx | : Click context object. See hbridge9_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge9_default_cfg | ( | hbridge9_t * | ctx | ) |
H-Bridge 9 default configuration function.
This function executes a default configuration of H-Bridge 9 click board.
[in] | ctx | : Click context object. See hbridge9_t object definition for detailed explanation. |
0
- Success, -1
- Error.uint8_t hbridge9_get_dout_pin | ( | hbridge9_t * | ctx | ) |
H-Bridge 9 get dout pin function.
This function returns the DO pin logic state.
[in] | ctx | : Click context object. See hbridge9_t object definition for detailed explanation. |
err_t hbridge9_init | ( | hbridge9_t * | ctx, |
hbridge9_cfg_t * | cfg ) |
H-Bridge 9 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See hbridge9_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See hbridge9_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t hbridge9_modify_register_bits | ( | hbridge9_t * | ctx, |
uint8_t | reg, | ||
uint16_t | clr_mask, | ||
uint16_t | set_mask ) |
H-Bridge 9 modify register bits function.
This function modifies the specified register bits.
[in] | ctx | : Click context object. See hbridge9_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | clr_mask | : Clear bit mask. |
[in] | set_mask | : Set bit mask. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge9_read_info_register | ( | hbridge9_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
H-Bridge 9 read info register function.
This function reads the selected info register.
[in] | ctx | : Click context object. See hbridge9_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge9_read_register | ( | hbridge9_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out ) |
H-Bridge 9 read register function.
This function reads a desired data from the selected register.
[in] | ctx | : Click context object. See hbridge9_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Read data ( with parity bit ). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge9_read_register_and_clear | ( | hbridge9_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out ) |
H-Bridge 9 read register and clear function.
This function reads the selected register and clears its status if needed.
[in] | ctx | : Click context object. See hbridge9_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Read data ( with parity bit ). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void hbridge9_send_actuation_pulse | ( | hbridge9_t * | ctx | ) |
H-Bridge 9 send actuation pulse function.
This function sends an actuation pulse by toggling the ENO pin.
[in] | ctx | : Click context object. See hbridge9_t object definition for detailed explanation. |
err_t hbridge9_set_default | ( | hbridge9_t * | ctx | ) |
H-Bridge 9 set default function.
This function sends the set all register to default state command.
[in] | ctx | : Click context object. See hbridge9_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void hbridge9_set_en_out_pin | ( | hbridge9_t * | ctx, |
uint8_t | state ) |
H-Bridge 9 set en out pin function.
This function sets the ENO pin logic state.
[in] | ctx | : Click context object. See hbridge9_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
err_t hbridge9_spi_transfer | ( | hbridge9_t * | ctx, |
uint8_t * | data_in, | ||
uint8_t | tx_len, | ||
uint8_t * | data_out, | ||
uint8_t | rx_len ) |
H-Bridge 9 spi transfer function.
This function writes and reads a desired number of data bytes simultaneously by using SPI serial interface.
[in] | ctx | : Click context object. See hbridge9_t object definition for detailed explanation. |
[in] | data_in | : Data to be written. |
[in] | tx_len | : Number of bytes to be written. |
[out] | data_out | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge9_write_register | ( | hbridge9_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in ) |
H-Bridge 9 write register function.
This function writes a desired data to the selected register.
[in] | ctx | : Click context object. See hbridge9_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written ( without parity bit ). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.