hbridge10 2.0.0.0
|
API for configuring and manipulating H-Bridge 10 Click driver. More...
Topics | |
H-Bridge 10 Settings | |
Settings of H-Bridge 10 Click driver. | |
H-Bridge 10 MikroBUS Map | |
MikroBUS pin mapping of H-Bridge 10 Click driver. | |
Functions | |
void | hbridge10_cfg_setup (hbridge10_cfg_t *cfg) |
H-Bridge 10 configuration object setup function. | |
err_t | hbridge10_init (hbridge10_t *ctx, hbridge10_cfg_t *cfg) |
H-Bridge 10 initialization function. | |
err_t | hbridge10_default_cfg (hbridge10_t *ctx) |
H-Bridge 10 default configuration function. | |
err_t | hbridge10_transfer_data (hbridge10_t *ctx, uint16_t data_in, uint16_t *data_out) |
H-Bridge 10 transfer data function. | |
err_t | hbridge10_set_output_state (hbridge10_t *ctx, uint8_t channel, uint8_t state) |
H-Bridge 10 set output state function. | |
err_t | hbridge10_get_status (hbridge10_t *ctx, uint16_t *status) |
H-Bridge 10 get status function. | |
err_t | hbridge10_read_an_pin_value (hbridge10_t *ctx, uint16_t *data_out) |
H-Bridge 10 read AN pin value function. | |
err_t | hbridge10_read_an_pin_voltage (hbridge10_t *ctx, float *data_out) |
H-Bridge 10 read AN pin voltage level function. | |
void | hbridge10_enable_device (hbridge10_t *ctx) |
H-Bridge 10 enable device function. | |
void | hbridge10_disable_device (hbridge10_t *ctx) |
H-Bridge 10 disable device function. | |
uint8_t | hbridge10_get_fault_pin (hbridge10_t *ctx) |
H-Bridge 10 get fault function. | |
API for configuring and manipulating H-Bridge 10 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void hbridge10_cfg_setup | ( | hbridge10_cfg_t * | cfg | ) |
H-Bridge 10 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See hbridge10_cfg_t object definition for detailed explanation. |
err_t hbridge10_default_cfg | ( | hbridge10_t * | ctx | ) |
H-Bridge 10 default configuration function.
This function executes a default configuration of H-Bridge 10 click board.
[in] | ctx | : Click context object. See hbridge10_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void hbridge10_disable_device | ( | hbridge10_t * | ctx | ) |
H-Bridge 10 disable device function.
This function disables the device by setting the EN pin to LOW logic state.
[in] | ctx | : Click context object. See hbridge10_t object definition for detailed explanation. |
void hbridge10_enable_device | ( | hbridge10_t * | ctx | ) |
H-Bridge 10 enable device function.
This function enables the device by setting the EN pin to HIGH logic state.
[in] | ctx | : Click context object. See hbridge10_t object definition for detailed explanation. |
uint8_t hbridge10_get_fault_pin | ( | hbridge10_t * | ctx | ) |
H-Bridge 10 get fault function.
This function returns the fault (FLT) pin logic state.
[in] | ctx | : Click context object. See hbridge10_t object definition for detailed explanation. |
err_t hbridge10_get_status | ( | hbridge10_t * | ctx, |
uint16_t * | status ) |
H-Bridge 10 get status function.
This function reads the status of output register.
[in] | ctx | : Click context object. See hbridge10_t object definition for detailed explanation. |
[out] | status | : Status read from output register. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge10_init | ( | hbridge10_t * | ctx, |
hbridge10_cfg_t * | cfg ) |
H-Bridge 10 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See hbridge10_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See hbridge10_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge10_read_an_pin_value | ( | hbridge10_t * | ctx, |
uint16_t * | data_out ) |
H-Bridge 10 read AN pin value function.
This function reads results of AD conversion of the AN pin.
[in] | ctx | : Click context object. See hbridge10_t object definition for detailed explanation. |
[out] | data_out | : Output ADC result. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge10_read_an_pin_voltage | ( | hbridge10_t * | ctx, |
float * | data_out ) |
H-Bridge 10 read AN pin voltage level function.
This function reads results of AD conversion of the AN pin and converts them to proportional voltage level.
[in] | ctx | : Click context object. See hbridge10_t object definition for detailed explanation. |
[out] | data_out | : Output voltage level of the analog pin [V]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge10_set_output_state | ( | hbridge10_t * | ctx, |
uint8_t | channel, | ||
uint8_t | state ) |
H-Bridge 10 set output state function.
This function sets the output channel state.
[in] | ctx | : Click context object. See hbridge10_t object definition for detailed explanation. |
[in] | channel | : Output channel selection [1-3]. |
[in] | state | : Channel state -
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hbridge10_transfer_data | ( | hbridge10_t * | ctx, |
uint16_t | data_in, | ||
uint16_t * | data_out ) |
H-Bridge 10 transfer data function.
This function writes 16-bit data from input and performs an immediate read of 16-bit output data by using SPI serial interface.
[in] | ctx | : Click context object. See hbridge10_t object definition for detailed explanation. |
[in] | data_in | : Data to be written. |
[in] | data_out | : Output data read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.