brushless21
2.0.0.0
|
API for configuring and manipulating Brushless 21 Click driver. More...
Modules | |
Brushless 21 Registers List | |
List of registers of Brushless 21 Click driver. | |
Brushless 21 Settings | |
Settings for configuration of Brushless 21 Click driver. | |
Brushless 21 MikroBUS Map | |
MikroBUS pin mapping of Brushless 21 Click driver. | |
Functions | |
void | brushless21_cfg_setup (brushless21_cfg_t *cfg) |
Brushless 21 configuration object setup function. More... | |
void | brushless21_drv_interface_selection (brushless21_cfg_t *cfg, brushless21_drv_t drv_sel) |
Brushless 21 driver interface setup function. More... | |
err_t | brushless21_init (brushless21_t *ctx, brushless21_cfg_t *cfg) |
Brushless 21 initialization function. More... | |
err_t | brushless21_default_cfg (brushless21_t *ctx) |
Brushless 21 default configuration function. More... | |
err_t | brushless21_pwm_stop (brushless21_t *ctx) |
Brushless 21 stop PWM module. More... | |
err_t | brushless21_pwm_start (brushless21_t *ctx) |
Brushless 21 start PWM module. More... | |
err_t | brushless21_set_duty_cycle (brushless21_t *ctx, float duty_cycle) |
Brushless 21 set duty cycle function. More... | |
err_t | brushless21_write_register (brushless21_t *ctx, uint8_t reg, uint16_t data_in) |
Brushless 21 write register function. More... | |
err_t | brushless21_read_register (brushless21_t *ctx, uint8_t reg, uint16_t *data_out) |
Brushless 21 read register function. More... | |
void | brushless21_enable_device (brushless21_t *ctx) |
Brushless 21 enable device function. More... | |
void | brushless21_disable_device (brushless21_t *ctx) |
Brushless 21 disable device function. More... | |
uint8_t | brushless21_get_fg_pin (brushless21_t *ctx) |
Brushless 21 get fg pin function. More... | |
err_t | brushless21_get_temperature (brushless21_t *ctx, int8_t *temperature) |
Brushless 21 get temperature function. More... | |
err_t | brushless21_get_motor_speed (brushless21_t *ctx, float *motor_speed_hz) |
Brushless 21 get motor speed function. More... | |
err_t | brushless21_get_vbb_voltage (brushless21_t *ctx, float *vbb_voltage) |
Brushless 21 get vbb voltage function. More... | |
err_t | brushless21_set_direction (brushless21_t *ctx, uint8_t direction) |
Brushless 21 set direction function. More... | |
err_t | brushless21_switch_direction (brushless21_t *ctx) |
Brushless 21 switch direction function. More... | |
API for configuring and manipulating Brushless 21 Click driver.
void brushless21_cfg_setup | ( | brushless21_cfg_t * | cfg | ) |
Brushless 21 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See brushless21_cfg_t object definition for detailed explanation. |
err_t brushless21_default_cfg | ( | brushless21_t * | ctx | ) |
Brushless 21 default configuration function.
This function executes a default configuration of Brushless 21 click board.
[in] | ctx | : Click context object. See brushless21_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void brushless21_disable_device | ( | brushless21_t * | ctx | ) |
Brushless 21 disable device function.
This function disables the device by setting the EN pin to low logic state.
[in] | ctx | : Click context object. See brushless21_t object definition for detailed explanation. |
void brushless21_drv_interface_selection | ( | brushless21_cfg_t * | cfg, |
brushless21_drv_t | drv_sel | ||
) |
Brushless 21 driver interface setup function.
This function sets a serial driver interface which will be used further in the click driver.
[out] | cfg | : Click configuration structure. See brushless21_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See brushless21_drv_t object definition for detailed explanation. |
void brushless21_enable_device | ( | brushless21_t * | ctx | ) |
Brushless 21 enable device function.
This function enables the device by setting the EN pin to high logic state.
[in] | ctx | : Click context object. See brushless21_t object definition for detailed explanation. |
uint8_t brushless21_get_fg_pin | ( | brushless21_t * | ctx | ) |
Brushless 21 get fg pin function.
This function returns the FG pin logic state.
[in] | ctx | : Click context object. See brushless21_t object definition for detailed explanation. |
err_t brushless21_get_motor_speed | ( | brushless21_t * | ctx, |
float * | motor_speed_hz | ||
) |
Brushless 21 get motor speed function.
This function reads the motor speed in Hz.
[in] | ctx | : Click context object. See brushless21_t object definition for detailed explanation. |
[out] | motor_speed_hz | : Motor speed in Hz. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t brushless21_get_temperature | ( | brushless21_t * | ctx, |
int8_t * | temperature | ||
) |
Brushless 21 get temperature function.
This function reads the chip internal temperature in Celsius.
[in] | ctx | : Click context object. See brushless21_t object definition for detailed explanation. |
[out] | temperature | : Temperature in Celsius. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t brushless21_get_vbb_voltage | ( | brushless21_t * | ctx, |
float * | vbb_voltage | ||
) |
Brushless 21 get vbb voltage function.
This function reads the VBB voltage.
[in] | ctx | : Click context object. See brushless21_t object definition for detailed explanation. |
[out] | vbb_voltage | : VBB voltage. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t brushless21_init | ( | brushless21_t * | ctx, |
brushless21_cfg_t * | cfg | ||
) |
Brushless 21 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See brushless21_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See brushless21_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t brushless21_pwm_start | ( | brushless21_t * | ctx | ) |
Brushless 21 start PWM module.
This function starts the PWM module output.
[in] | ctx | : Click context object. See brushless21_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t brushless21_pwm_stop | ( | brushless21_t * | ctx | ) |
Brushless 21 stop PWM module.
This function stops the PWM module output.
[in] | ctx | : Click context object. See brushless21_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t brushless21_read_register | ( | brushless21_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out | ||
) |
Brushless 21 read register function.
This function reads data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See brushless21_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data (16-bit). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t brushless21_set_direction | ( | brushless21_t * | ctx, |
uint8_t | direction | ||
) |
Brushless 21 set direction function.
This function sets the motor direction.
[in] | ctx | : Click context object. See brushless21_t object definition for detailed explanation. |
[in] | direction | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t brushless21_set_duty_cycle | ( | brushless21_t * | ctx, |
float | duty_cycle | ||
) |
Brushless 21 set duty cycle function.
This function sets the duty cycle in percentages ( Range[ 0..1 ] ).
[in] | ctx | : Click context object. See brushless21_t object definition for detailed explanation. |
[in] | duty_cycle | : Duty cycle. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t brushless21_switch_direction | ( | brushless21_t * | ctx | ) |
Brushless 21 switch direction function.
This function switches the motor direction by toggling the DIR bit.
[in] | ctx | : Click context object. See brushless21_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t brushless21_write_register | ( | brushless21_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in | ||
) |
Brushless 21 write register function.
This function writes a desired data to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See brushless21_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written (16-bit). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.