Searched refs:ccr_counter (Results 1 – 3 of 3) sorted by relevance
| /bsp/wch/arm/Libraries/ch32_drivers/ |
| A D | drv_pwm_ch32f10x.c | 200 rt_uint32_t arr_counter, ccr_counter, prescaler, sample_freq; in ch32f1_pwm_device_get() local 218 ccr_counter = pwm_device->periph->CH1CVR + 1; in ch32f1_pwm_device_get() 219 configuration->pulse = ((ccr_counter * 100) / arr_counter) * configuration->period / 100; in ch32f1_pwm_device_get() 223 ccr_counter = pwm_device->periph->CH2CVR + 1; in ch32f1_pwm_device_get() 228 ccr_counter = pwm_device->periph->CH3CVR + 1; in ch32f1_pwm_device_get() 233 ccr_counter = pwm_device->periph->CH4CVR + 1; in ch32f1_pwm_device_get() 245 rt_uint32_t arr_counter, ccr_counter, prescaler, sample_freq; in ch32f1_pwm_device_set() local 282 ccr_counter = (configuration->pulse * 100 / configuration->period) * arr_counter / 100; in ch32f1_pwm_device_set() 290 if (ccr_counter < MIN_PULSE) in ch32f1_pwm_device_set() 292 ccr_counter = MIN_PULSE; in ch32f1_pwm_device_set() [all …]
|
| A D | drv_pwm_ch32f20x.c | 321 rt_uint32_t arr_counter, ccr_counter, prescaler, sample_freq; in ch32f2_pwm_device_get() local 339 ccr_counter = pwm_device->periph->CH1CVR + 1; in ch32f2_pwm_device_get() 340 configuration->pulse = ((ccr_counter * 100) / arr_counter) * configuration->period / 100; in ch32f2_pwm_device_get() 344 ccr_counter = pwm_device->periph->CH2CVR + 1; in ch32f2_pwm_device_get() 349 ccr_counter = pwm_device->periph->CH3CVR + 1; in ch32f2_pwm_device_get() 354 ccr_counter = pwm_device->periph->CH4CVR + 1; in ch32f2_pwm_device_get() 366 rt_uint32_t arr_counter, ccr_counter, prescaler, sample_freq; in ch32f2_pwm_device_set() local 403 ccr_counter = (configuration->pulse * 100 / configuration->period) * arr_counter / 100; in ch32f2_pwm_device_set() 411 if (ccr_counter < MIN_PULSE) in ch32f2_pwm_device_set() 413 ccr_counter = MIN_PULSE; in ch32f2_pwm_device_set() [all …]
|
| /bsp/wch/risc-v/Libraries/ch32_drivers/ |
| A D | drv_pwm.c | 771 rt_uint32_t arr_counter, ccr_counter, prescaler, sample_freq; in ch32_pwm_device_get() local 787 ccr_counter = pwm_device->periph->CH1CVR + 1; in ch32_pwm_device_get() 788 configuration->pulse = ((ccr_counter * 100) / arr_counter) * configuration->period / 100; in ch32_pwm_device_get() 792 ccr_counter = pwm_device->periph->CH2CVR + 1; in ch32_pwm_device_get() 797 ccr_counter = pwm_device->periph->CH3CVR + 1; in ch32_pwm_device_get() 802 ccr_counter = pwm_device->periph->CH4CVR + 1; in ch32_pwm_device_get() 816 rt_uint32_t arr_counter, ccr_counter, prescaler, sample_freq; in ch32_pwm_device_set() local 849 ccr_counter = (configuration->pulse * 100 / configuration->period) * arr_counter / 100; in ch32_pwm_device_set() 856 if (ccr_counter < MIN_PULSE) in ch32_pwm_device_set() 858 ccr_counter = MIN_PULSE; in ch32_pwm_device_set() [all …]
|
Completed in 15 milliseconds