Bouffalo SDK
1.0
Bouffalolab Software Development Kit
|
![]() |
Data Structures | |
struct | bflb_pwm_v2_channel_config_s |
PWM channel configuration structure. More... | |
struct | bflb_pwm_v2_config_s |
PWM configuration structure. More... | |
Functions | |
void | bflb_pwm_v2_init (struct bflb_device_s *dev, const struct bflb_pwm_v2_config_s *config) |
Initialize pwm. More... | |
void | bflb_pwm_v2_deinit (struct bflb_device_s *dev) |
Deinitialize pwm. More... | |
void | bflb_pwm_v2_start (struct bflb_device_s *dev) |
Start pwm output. More... | |
void | bflb_pwm_v2_stop (struct bflb_device_s *dev) |
Stop pwm output. More... | |
void | bflb_pwm_v2_set_period (struct bflb_device_s *dev, uint16_t period) |
Set pwm period to change pwm frequence. Frequcence(hz) = pwm source clock /div/period. More... | |
float | bflb_pwm_v2_get_frequency (struct bflb_device_s *dev) |
Get pwm frequcency. More... | |
void | bflb_pwm_v2_channel_init (struct bflb_device_s *dev, uint8_t ch, struct bflb_pwm_v2_channel_config_s *config) |
Config pwm channel. More... | |
void | bflb_pwm_v2_channel_set_threshold (struct bflb_device_s *dev, uint8_t ch, uint16_t low_threhold, uint16_t high_threhold) |
Set pwm dutycycle. Dutycycle(%) = (high_threhold - low_threhold)/period * 100%. More... | |
void | bflb_pwm_v2_channel_positive_start (struct bflb_device_s *dev, uint8_t ch) |
Start pwm positive output. More... | |
void | bflb_pwm_v2_channel_negative_start (struct bflb_device_s *dev, uint8_t ch) |
Start pwm negative output. More... | |
void | bflb_pwm_v2_channel_positive_stop (struct bflb_device_s *dev, uint8_t ch) |
Stop pwm positive output. More... | |
void | bflb_pwm_v2_channel_negative_stop (struct bflb_device_s *dev, uint8_t ch) |
Stop pwm negative output. More... | |
void | bflb_pwm_v2_int_enable (struct bflb_device_s *dev, uint32_t int_en, bool enable) |
Enable pwm interrupt. More... | |
uint32_t | bflb_pwm_v2_get_intstatus (struct bflb_device_s *dev) |
Get pwm interrupt status. More... | |
void | bflb_pwm_v2_int_clear (struct bflb_device_s *dev, uint32_t int_clear) |
Clear pwm interrupt status. More... | |
int | bflb_pwm_v2_feature_control (struct bflb_device_s *dev, int cmd, size_t arg) |
Control pwm feature. More... | |
void bflb_pwm_v2_channel_init | ( | struct bflb_device_s * | dev, |
uint8_t | ch, | ||
struct bflb_pwm_v2_channel_config_s * | config | ||
) |
Config pwm channel.
[in] | dev | device handle |
[in] | ch | channel number |
[in] | config | pointer to save pwm channel config |
void bflb_pwm_v2_channel_negative_start | ( | struct bflb_device_s * | dev, |
uint8_t | ch | ||
) |
Start pwm negative output.
[in] | dev | device handle |
[in] | ch | channel number |
void bflb_pwm_v2_channel_negative_stop | ( | struct bflb_device_s * | dev, |
uint8_t | ch | ||
) |
Stop pwm negative output.
[in] | dev | device handle |
[in] | ch | channel number |
void bflb_pwm_v2_channel_positive_start | ( | struct bflb_device_s * | dev, |
uint8_t | ch | ||
) |
Start pwm positive output.
[in] | dev | device handle |
[in] | ch | channel number |
void bflb_pwm_v2_channel_positive_stop | ( | struct bflb_device_s * | dev, |
uint8_t | ch | ||
) |
Stop pwm positive output.
[in] | dev | device handle |
[in] | ch | channel number |
void bflb_pwm_v2_channel_set_threshold | ( | struct bflb_device_s * | dev, |
uint8_t | ch, | ||
uint16_t | low_threhold, | ||
uint16_t | high_threhold | ||
) |
Set pwm dutycycle. Dutycycle(%) = (high_threhold - low_threhold)/period * 100%.
[in] | dev | device handle |
[in] | ch | channel number |
[in] | low_threhold | pwm low threhold |
[in] | high_threhold | pwm high threhold |
void bflb_pwm_v2_deinit | ( | struct bflb_device_s * | dev | ) |
Deinitialize pwm.
[in] | dev | device handle |
int bflb_pwm_v2_feature_control | ( | struct bflb_device_s * | dev, |
int | cmd, | ||
size_t | arg | ||
) |
Control pwm feature.
[in] | dev | device handle |
[in] | cmd | feature command, use pwm feature control cmd definition |
[in] | arg | user data |
float bflb_pwm_v2_get_frequency | ( | struct bflb_device_s * | dev | ) |
Get pwm frequcency.
[in] | dev | device handle |
uint32_t bflb_pwm_v2_get_intstatus | ( | struct bflb_device_s * | dev | ) |
Get pwm interrupt status.
[in] | dev | device handle |
void bflb_pwm_v2_init | ( | struct bflb_device_s * | dev, |
const struct bflb_pwm_v2_config_s * | config | ||
) |
Initialize pwm.
[in] | dev | device handle |
[in] | config | pointer to save pwm config |
void bflb_pwm_v2_int_clear | ( | struct bflb_device_s * | dev, |
uint32_t | int_clear | ||
) |
Clear pwm interrupt status.
[in] | dev | device handle |
[in] | int_clear | clear value, use pwm interrupt clear definition |
void bflb_pwm_v2_int_enable | ( | struct bflb_device_s * | dev, |
uint32_t | int_en, | ||
bool | enable | ||
) |
Enable pwm interrupt.
[in] | dev | device handle |
[in] | int_en | interrupt type |
[in] | enable | true means enable, otherwise disable |
void bflb_pwm_v2_set_period | ( | struct bflb_device_s * | dev, |
uint16_t | period | ||
) |
Set pwm period to change pwm frequence. Frequcence(hz) = pwm source clock /div/period.
[in] | dev | device handle |
[in] | period | pwm period |
void bflb_pwm_v2_start | ( | struct bflb_device_s * | dev | ) |
Start pwm output.
[in] | dev | device handle |
void bflb_pwm_v2_stop | ( | struct bflb_device_s * | dev | ) |
Stop pwm output.
[in] | dev | device handle |