driver2 2.0.0.0
|
API for configuring and manipulating Driver 2 Click driver. More...
Topics | |
Driver 2 PWM Settings | |
Settings for configuration of Driver 2 Click driver. | |
Driver 2 MikroBUS Map | |
MikroBUS pin mapping of Driver 2 Click driver. | |
Driver2_cfg | |
Functions | |
void | driver2_cfg_setup (driver2_cfg_t *cfg) |
Driver 2 configuration object setup function. | |
err_t | driver2_init (driver2_t *ctx, driver2_cfg_t *cfg) |
Driver 2 initialization function. | |
err_t | driver2_default_cfg (driver2_t *ctx) |
Driver 2 default configuration function. | |
err_t | driver2_set_duty_cycle (driver2_t *ctx, float duty_cycle) |
Driver 2 sets PWM duty cycle. | |
err_t | driver2_pwm_stop (driver2_t *ctx) |
Driver 2 stop PWM module. | |
err_t | driver2_pwm_start (driver2_t *ctx) |
Driver 2 start PWM module. | |
void | driver2_set_sd_pin (driver2_t *ctx, uint8_t state) |
Set SD pin. | |
void | driver2_set_pwm_pin (driver2_t *ctx, uint8_t state) |
Set PWM pin. | |
uint8_t | driver2_get_fb_pin (driver2_t *ctx) |
Get FB pin. | |
API for configuring and manipulating Driver 2 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void driver2_cfg_setup | ( | driver2_cfg_t * | cfg | ) |
Driver 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See driver2_cfg_t object definition for detailed explanation. |
err_t driver2_default_cfg | ( | driver2_t * | ctx | ) |
Driver 2 default configuration function.
This function executes a default configuration of Driver 2 click board.
[in] | ctx | : Click context object. See driver2_t object definition for detailed explanation. |
0
- Success, -1
- Error.uint8_t driver2_get_fb_pin | ( | driver2_t * | ctx | ) |
Get FB pin.
This function is reading state of the FB pin.
[in] | ctx | : Click context object. See driver2_t object definition for detailed explanation. |
err_t driver2_init | ( | driver2_t * | ctx, |
driver2_cfg_t * | cfg ) |
Driver 2 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See driver2_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See driver2_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t driver2_pwm_start | ( | driver2_t * | ctx | ) |
Driver 2 start PWM module.
This function starts the PWM module output.
[out] | ctx | : Click context object. See driver2_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t driver2_pwm_stop | ( | driver2_t * | ctx | ) |
Driver 2 stop PWM module.
This function stops the PWM module output.
[out] | ctx | : Click context object. See driver2_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t driver2_set_duty_cycle | ( | driver2_t * | ctx, |
float | duty_cycle ) |
Driver 2 sets PWM duty cycle.
This function sets the PWM duty cycle in percentages ( Range[ 0..1 ] ).
[out] | ctx | : Click context object. See driver2_t object definition for detailed explanation. |
[in] | duty_ratio | : PWM duty_ratio. |
0
- Success, -1
- Error.void driver2_set_pwm_pin | ( | driver2_t * | ctx, |
uint8_t | state ) |
Set PWM pin.
This function sets state of the PWM pin.
[out] | ctx | : Click context object. See driver2_t object definition for detailed explanation. |
[in] | state | : State of pin. |