hbridge11 2.1.0.0
|
API for configuring and manipulating H-Bridge 11 Click driver. More...
Topics | |
H-Bridge 11 Registers List | |
List of registers of H-Bridge 11 Click driver. | |
H-Bridge 11 Registers Settings | |
Settings for registers of H-Bridge 11 Click driver. | |
H-Bridge 11 MikroBUS Map | |
MikroBUS pin mapping of H-Bridge 11 Click driver. | |
Functions | |
void | hbridge11_cfg_setup (hbridge11_cfg_t *cfg) |
H-Bridge 11 configuration object setup function. | |
err_t | hbridge11_init (hbridge11_t *ctx, hbridge11_cfg_t *cfg) |
H-Bridge 11 initialization function. | |
err_t | hbridge11_default_cfg (hbridge11_t *ctx) |
H-Bridge 11 default configuration function. | |
err_t | hbridge11_write_8bit_register (hbridge11_t *ctx, uint8_t reg, uint8_t data_in) |
H-Bridge 11 write 8bit register function. | |
err_t | hbridge11_read_8bit_register (hbridge11_t *ctx, uint8_t reg, uint8_t *data_out) |
H-Bridge 11 read 8bit register function. | |
err_t | hbridge11_write_32bit_register (hbridge11_t *ctx, uint8_t reg, uint32_t data_in) |
H-Bridge 11 write 32bit register function. | |
err_t | hbridge11_read_32bit_register (hbridge11_t *ctx, uint8_t reg, uint32_t *data_out) |
H-Bridge 11 read 32bit register function. | |
void | hbridge11_enable_device (hbridge11_t *ctx) |
H-Bridge 11 enable device function. | |
void | hbridge11_disable_device (hbridge11_t *ctx) |
H-Bridge 11 disable device function. | |
uint8_t | hbridge11_get_fault_pin (hbridge11_t *ctx) |
H-Bridge 11 get fault pin function. | |
err_t | hbridge11_read_flags (hbridge11_t *ctx, uint8_t *fault_flags) |
H-Bridge 11 read flags function. | |
err_t | hbridge11_set_motor_state (hbridge11_t *ctx, uint8_t motor, uint8_t state) |
H-Bridge 11 set motor state function. | |
API for configuring and manipulating H-Bridge 11 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void hbridge11_cfg_setup | ( | hbridge11_cfg_t * | cfg | ) |
H-Bridge 11 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See hbridge11_cfg_t object definition for detailed explanation. |
err_t hbridge11_default_cfg | ( | hbridge11_t * | ctx | ) |
H-Bridge 11 default configuration function.
This function executes a default configuration of H-Bridge 11 click board.
[in] | ctx | : Click context object. See hbridge11_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void hbridge11_disable_device | ( | hbridge11_t * | ctx | ) |
H-Bridge 11 disable device function.
This function disables the device by setting the EN pin to low logic state.
[in] | ctx | : Click context object. See hbridge11_t object definition for detailed explanation. |
void hbridge11_enable_device | ( | hbridge11_t * | ctx | ) |
H-Bridge 11 enable device function.
This function enables the device by setting the EN pin to high logic state.
[in] | ctx | : Click context object. See hbridge11_t object definition for detailed explanation. |
uint8_t hbridge11_get_fault_pin | ( | hbridge11_t * | ctx | ) |
H-Bridge 11 get fault pin function.
This function returns the fault pin logic state.
[in] | ctx | : Click context object. See hbridge11_t object definition for detailed explanation. |
err_t hbridge11_init | ( | hbridge11_t * | ctx, |
hbridge11_cfg_t * | cfg ) |
H-Bridge 11 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See hbridge11_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See hbridge11_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge11_read_32bit_register | ( | hbridge11_t * | ctx, |
uint8_t | reg, | ||
uint32_t * | data_out ) |
H-Bridge 11 read 32bit register function.
This function reads 32-bit data from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See hbridge11_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. err_t hbridge11_read_8bit_register | ( | hbridge11_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
H-Bridge 11 read 8bit register function.
This function reads a MSB data byte from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See hbridge11_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. err_t hbridge11_read_flags | ( | hbridge11_t * | ctx, |
uint8_t * | fault_flags ) |
H-Bridge 11 read flags function.
This function reads and clears the fault flags from the status register.
[in] | ctx | : Click context object. See hbridge11_t object definition for detailed explanation. |
[out] | fault_flags | : Fault flags from the status register [bits 7-0]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge11_set_motor_state | ( | hbridge11_t * | ctx, |
uint8_t | motor, | ||
uint8_t | state ) |
H-Bridge 11 set motor state function.
This function sets the operating state for the selected motor from the half-bridge pairs 0–1, 2–3, 4–5, or 6–7.
[in] | ctx | : Click context object. See hbridge11_t object definition for detailed explanation. |
[in] | motor | : Motor selection [0-3] related to the half-bridge pairs 0–1, 2–3, 4–5, and 6–7. |
[in] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge11_write_32bit_register | ( | hbridge11_t * | ctx, |
uint8_t | reg, | ||
uint32_t | data_in ) |
H-Bridge 11 write 32bit register function.
This function writes 32-bit data to the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See hbridge11_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. err_t hbridge11_write_8bit_register | ( | hbridge11_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
H-Bridge 11 write 8bit register function.
This function writes a data byte to the selected register MSB by using SPI serial interface.
[in] | ctx | : Click context object. See hbridge11_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.