hbridge6 2.0.0.0
|
API for configuring and manipulating H-Bridge 6 Click driver. More...
Topics | |
H-Bridge 6 Registers Settings | |
Settings for registers of H-Bridge 6 Click driver. | |
H-Bridge 6 MikroBUS Map | |
MikroBUS pin mapping of H-Bridge 6 Click driver. | |
Functions | |
void | hbridge6_cfg_setup (hbridge6_cfg_t *cfg) |
H-Bridge 6 configuration object setup function. | |
err_t | hbridge6_init (hbridge6_t *ctx, hbridge6_cfg_t *cfg) |
H-Bridge 6 initialization function. | |
void | hbridge6_generic_write (hbridge6_t *ctx, uint8_t reg, uint8_t tx_buf) |
H-Bridge 6 I2C writing function. | |
uint8_t | hbridge6_generic_read (hbridge6_t *ctx, uint8_t reg) |
H-Bridge 6 I2C reading function. | |
err_t | hbridge6_default_cfg (hbridge6_t *ctx) |
H-Bridge 6 default configuration function. | |
err_t | hbridge6_set_duty_cycle (hbridge6_t *ctx, float duty_cycle) |
H-Bridge 6 sets PWM duty cycle. | |
err_t | hbridge6_pwm_stop (hbridge6_t *ctx) |
H-Bridge 6 stop PWM module. | |
err_t | hbridge6_pwm_start (hbridge6_t *ctx) |
H-Bridge 6 start PWM module. | |
void | hbridge6_reset (hbridge6_t *ctx) |
HW reset function. | |
void | hbridge6_set_output (hbridge6_t *ctx, uint8_t n_out_port, hbridge6_cfg_t cfg_data) |
Set output function. | |
void | hbridge6_get_output (hbridge6_t *ctx, uint8_t n_out_port, hbridge6_cfg_t *cfg_data) |
Get output function. | |
void | hbridge6_default_config (hbridge6_t *ctx) |
Default config function. | |
void | hbridge6_set_input_port_a (hbridge6_t *ctx, uint8_t pin_state) |
Set input port A function. | |
void | hbridge6_set_input_port_b (hbridge6_t *ctx, uint8_t pin_state) |
Set input port B function. | |
void | hbridge6_enable_diagnostic (hbridge6_t *ctx, uint8_t en_state) |
Enable the diagnostic function. | |
void | hbridge6_set_multi_sense (hbridge6_t *ctx, uint8_t sel_num, uint8_t pin_state) |
Set multi sense function. | |
void | hbridge6_set_direction (hbridge6_t *ctx, uint8_t direction) |
Adjust the direction function. | |
uint8_t | hbridge6_get_an_diagnostic (hbridge6_t *ctx) |
Get diagnostic function. | |
API for configuring and manipulating H-Bridge 6 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void hbridge6_cfg_setup | ( | hbridge6_cfg_t * | cfg | ) |
H-Bridge 6 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See hbridge6_cfg_t object definition for detailed explanation. |
err_t hbridge6_default_cfg | ( | hbridge6_t * | ctx | ) |
H-Bridge 6 default configuration function.
This function executes a default configuration of H-Bridge 6 click board.
[in] | ctx | : Click context object. See hbridge6_t object definition for detailed explanation. |
0
- Success, -1
- Error.void hbridge6_default_config | ( | hbridge6_t * | ctx | ) |
Default config function.
The function set the default config of the PCA9538A Low-voltage 8-bit I2C-bus I/O port with interrupt and reset on H-Bridge 6 Click board.
[out] | ctx | : Click context object. See hbridge6_t object definition for detailed explanation. |
void hbridge6_enable_diagnostic | ( | hbridge6_t * | ctx, |
uint8_t | en_state ) |
Enable the diagnostic function.
The function enable or disable the diagnostic of the PCA9538A Low-voltage 8-bit I2C-bus I/O port with interrupt and reset on H-Bridge 6 Click board.
[out] | ctx | : Click context object. See hbridge6_t object definition for detailed explanation. |
[in] | en_state | : The function for enabling diagnostic. |
uint8_t hbridge6_generic_read | ( | hbridge6_t * | ctx, |
uint8_t | reg ) |
H-Bridge 6 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 hbridge6_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
void hbridge6_generic_write | ( | hbridge6_t * | ctx, |
uint8_t | reg, | ||
uint8_t | tx_buf ) |
H-Bridge 6 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 hbridge6_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_buf | : Data to be written. |
uint8_t hbridge6_get_an_diagnostic | ( | hbridge6_t * | ctx | ) |
Get diagnostic function.
The function get the diagnostic on H-Bridge 6 Click board.
[in] | ctx | : Click context object. See hbridge6_t object definition for detailed explanation. |
void hbridge6_get_output | ( | hbridge6_t * | ctx, |
uint8_t | n_out_port, | ||
hbridge6_cfg_t * | cfg_data ) |
Get output function.
The function get output configuration data of the PCA9538A Low-voltage 8-bit I2C-bus I/O port with interrupt and reset on H-Bridge 6 Click board.
[out] | ctx | : Click context object. See hbridge6_t object definition for detailed explanation. |
[in] | n_out_port | : Port number. |
[in] | cfg_data | : Pointer to the memory location where configuration data be stored. |
err_t hbridge6_init | ( | hbridge6_t * | ctx, |
hbridge6_cfg_t * | cfg ) |
H-Bridge 6 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See hbridge6_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See hbridge6_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t hbridge6_pwm_start | ( | hbridge6_t * | ctx | ) |
H-Bridge 6 start PWM module.
This function starts the PWM moudle output.
[out] | ctx | : Click context object. See hbridge6_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t hbridge6_pwm_stop | ( | hbridge6_t * | ctx | ) |
H-Bridge 6 stop PWM module.
This function stops the PWM moudle output.
[out] | ctx | : Click context object. See hbridge6_t object definition for detailed explanation. |
0
- Success, -1
- Error.void hbridge6_reset | ( | hbridge6_t * | ctx | ) |
HW reset function.
The function HW reset, reset the PCA9538A Low-voltage 8-bit I2C-bus I/O port on H-Bridge 6 Click board.
[out] | ctx | : Click context object. See hbridge6_t object definition for detailed explanation. |
void hbridge6_set_direction | ( | hbridge6_t * | ctx, |
uint8_t | direction ) |
Adjust the direction function.
The function adjust the engine direction on H-Bridge 6 Click board.
[out] | ctx | : Click context object. See hbridge6_t object definition for detailed explanation. |
[in] | direction | : Direction of rotation: |
err_t hbridge6_set_duty_cycle | ( | hbridge6_t * | ctx, |
float | duty_cycle ) |
H-Bridge 6 sets PWM duty cycle.
This function sets the PWM duty cycle in percentages ( Range[ 0..1 ] ).
[out] | ctx | : Click context object. See hbridge6_t object definition for detailed explanation. |
[in] | duty_cycle | : PWM duty_ratio. |
0
- Success, -1
- Error.void hbridge6_set_input_port_a | ( | hbridge6_t * | ctx, |
uint8_t | pin_state ) |
Set input port A function.
The function set input port A of the PCA9538A Low-voltage 8-bit I2C-bus I/O port with interrupt and reset on H-Bridge 6 Click board.
[out] | ctx | : Click context object. See hbridge6_t object definition for detailed explanation. |
[in] | pin_state | : Input port A state. |
void hbridge6_set_input_port_b | ( | hbridge6_t * | ctx, |
uint8_t | pin_state ) |
Set input port B function.
The function set input port B of the PCA9538A Low-voltage 8-bit I2C-bus I/O port with interrupt and reset on H-Bridge 6 Click board.
[out] | ctx | : Click context object. See hbridge6_t object definition for detailed explanation. |
[in] | pin_state | : Input port B state. |
void hbridge6_set_multi_sense | ( | hbridge6_t * | ctx, |
uint8_t | sel_num, | ||
uint8_t | pin_state ) |
Set multi sense function.
The function set multi sense of the PCA9538A Low-voltage 8-bit I2C-bus I/O port with interrupt and reset on H-Bridge 6 Click board.
[in] | ctx | : Click context object. See hbridge6_t object definition for detailed explanation. |
[in] | sel_num | : Port number. |
[in] | pin_state | : Port pin state. |
void hbridge6_set_output | ( | hbridge6_t * | ctx, |
uint8_t | n_out_port, | ||
hbridge6_cfg_t | cfg_data ) |
Set output function.
The function set output of the desired port of the PCA9538A Low-voltage 8-bit I2C-bus I/O port with interrupt and reset on H-Bridge 6 Click board.
[out] | ctx | : Click context object. See hbridge6_t object definition for detailed explanation. |
[in] | n_out_port | : Port number. |
[in] | cfg_data | : Structure where configuration data be stored. |