piezodriver 2.1.0.0
|
API for configuring and manipulating Piezo Driver Click driver. More...
Modules | |
Piezo Driver PWM Settings | |
Settings for configuration of Piezo Driver Click driver. | |
Piezo Driver MikroBUS Map | |
MikroBUS pin mapping of Piezo Driver Click driver. | |
Functions | |
void | piezodriver_cfg_setup (piezodriver_cfg_t *cfg) |
Piezo Driver configuration object setup function. More... | |
err_t | piezodriver_init (piezodriver_t *ctx, piezodriver_cfg_t *cfg) |
Piezo Driver initialization function. More... | |
err_t | piezodriver_default_cfg (piezodriver_t *ctx) |
Piezo Driver default configuration function. More... | |
err_t | piezodriver_set_duty_cycle (piezodriver_t *ctx, float duty_cycle) |
Piezo Driver sets PWM duty cycle. More... | |
err_t | piezodriver_pwm_stop (piezodriver_t *ctx) |
Piezo Driver stop PWM module. More... | |
err_t | piezodriver_pwm_start (piezodriver_t *ctx) |
Piezo Driver start PWM module. More... | |
void | piezodriver_play_sound (piezodriver_t *ctx, uint16_t freq, uint8_t level, uint16_t duration) |
Piezo Driver play sound function. More... | |
API for configuring and manipulating Piezo Driver Click driver.
void piezodriver_cfg_setup | ( | piezodriver_cfg_t * | cfg | ) |
Piezo Driver configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See piezodriver_cfg_t object definition for detailed explanation. |
err_t piezodriver_default_cfg | ( | piezodriver_t * | ctx | ) |
Piezo Driver default configuration function.
This function executes a default configuration of Piezo Driver click board.
[in] | ctx | : Click context object. See piezodriver_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t piezodriver_init | ( | piezodriver_t * | ctx, |
piezodriver_cfg_t * | cfg | ||
) |
Piezo Driver initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See piezodriver_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See piezodriver_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void piezodriver_play_sound | ( | piezodriver_t * | ctx, |
uint16_t | freq, | ||
uint8_t | level, | ||
uint16_t | duration | ||
) |
Piezo Driver play sound function.
This function is used to play sound on the buzzer.
[in] | ctx | : Click object. See piezodriver_t object definition for detailed explanation. |
[in] | freq | : Buzz sound frequency. |
[in] | level | : Buzz sound level. ( min = 0, max = 100 ) |
[in] | duration | : Buzz sound duration in miliseconds. |
err_t piezodriver_pwm_start | ( | piezodriver_t * | ctx | ) |
Piezo Driver start PWM module.
This function starts the PWM module output.
[in] | ctx | : Click context object. See piezodriver_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t piezodriver_pwm_stop | ( | piezodriver_t * | ctx | ) |
Piezo Driver stop PWM module.
This function stops the PWM module output.
[in] | ctx | : Click context object. See piezodriver_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t piezodriver_set_duty_cycle | ( | piezodriver_t * | ctx, |
float | duty_cycle | ||
) |
Piezo Driver sets PWM duty cycle.
This function sets the PWM duty cycle in percentages ( Range[ 0..1 ] ).
[in] | ctx | : Click context object. See piezodriver_t object definition for detailed explanation. |
[in] | duty_cycle | : PWM duty cycle. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.