piezodriver 2.1.0.0
|
API for configuring and manipulating Piezo Driver Click driver. More...
Topics | |
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. | |
err_t | piezodriver_init (piezodriver_t *ctx, piezodriver_cfg_t *cfg) |
Piezo Driver initialization function. | |
err_t | piezodriver_default_cfg (piezodriver_t *ctx) |
Piezo Driver default configuration function. | |
err_t | piezodriver_set_duty_cycle (piezodriver_t *ctx, float duty_cycle) |
Piezo Driver sets PWM duty cycle. | |
err_t | piezodriver_pwm_stop (piezodriver_t *ctx) |
Piezo Driver stop PWM module. | |
err_t | piezodriver_pwm_start (piezodriver_t *ctx) |
Piezo Driver start PWM module. | |
void | piezodriver_play_sound (piezodriver_t *ctx, uint16_t freq, uint8_t level, uint16_t duration) |
Piezo Driver play sound function. | |
API for configuring and manipulating Piezo Driver Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
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.