2828#include <stdint.h>
2929
3030#include "py/runtime.h"
31- #include "common-hal/pulseio /PWMOut.h"
32- #include "shared-bindings/pulseio /PWMOut.h"
31+ #include "common-hal/pwmio /PWMOut.h"
32+ #include "shared-bindings/pwmio /PWMOut.h"
3333#include "shared-bindings/microcontroller/Processor.h"
3434#include "timer_handler.h"
3535
@@ -78,13 +78,13 @@ void timer_reset_ok(int index, bool is_tc) {
7878}
7979
8080
81- void common_hal_pulseio_pwmout_never_reset ( pulseio_pwmout_obj_t * self ) {
81+ void common_hal_pwmio_pwmout_never_reset ( pwmio_pwmout_obj_t * self ) {
8282 timer_never_reset (self -> timer -> index , self -> timer -> is_tc );
8383
8484 never_reset_pin_number (self -> pin -> number );
8585}
8686
87- void common_hal_pulseio_pwmout_reset_ok ( pulseio_pwmout_obj_t * self ) {
87+ void common_hal_pwmio_pwmout_reset_ok ( pwmio_pwmout_obj_t * self ) {
8888 timer_reset_ok (self -> timer -> index , self -> timer -> is_tc );
8989}
9090
@@ -137,7 +137,7 @@ bool channel_ok(const pin_timer_t* t) {
137137 t -> is_tc ;
138138}
139139
140- pwmout_result_t common_hal_pulseio_pwmout_construct ( pulseio_pwmout_obj_t * self ,
140+ pwmout_result_t common_hal_pwmio_pwmout_construct ( pwmio_pwmout_obj_t * self ,
141141 const mcu_pin_obj_t * pin ,
142142 uint16_t duty ,
143143 uint32_t frequency ,
@@ -296,16 +296,16 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self,
296296
297297 gpio_set_pin_function (pin -> number , GPIO_PIN_FUNCTION_E + mux_position );
298298
299- common_hal_pulseio_pwmout_set_duty_cycle (self , duty );
299+ common_hal_pwmio_pwmout_set_duty_cycle (self , duty );
300300 return PWMOUT_OK ;
301301}
302302
303- bool common_hal_pulseio_pwmout_deinited ( pulseio_pwmout_obj_t * self ) {
303+ bool common_hal_pwmio_pwmout_deinited ( pwmio_pwmout_obj_t * self ) {
304304 return self -> pin == NULL ;
305305}
306306
307- void common_hal_pulseio_pwmout_deinit ( pulseio_pwmout_obj_t * self ) {
308- if (common_hal_pulseio_pwmout_deinited (self )) {
307+ void common_hal_pwmio_pwmout_deinit ( pwmio_pwmout_obj_t * self ) {
308+ if (common_hal_pwmio_pwmout_deinited (self )) {
309309 return ;
310310 }
311311 const pin_timer_t * t = self -> timer ;
@@ -331,7 +331,7 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) {
331331 self -> pin = NULL ;
332332}
333333
334- extern void common_hal_pulseio_pwmout_set_duty_cycle ( pulseio_pwmout_obj_t * self , uint16_t duty ) {
334+ extern void common_hal_pwmio_pwmout_set_duty_cycle ( pwmio_pwmout_obj_t * self , uint16_t duty ) {
335335 // Store the unadjusted duty cycle. It turns out the the process of adjusting and calculating
336336 // the duty cycle here and reading it back is lossy - the value will decay over time.
337337 // Track it here so that if frequency is changed we can use this value to recalculate the
@@ -373,7 +373,7 @@ extern void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self,
373373 }
374374}
375375
376- uint16_t common_hal_pulseio_pwmout_get_duty_cycle ( pulseio_pwmout_obj_t * self ) {
376+ uint16_t common_hal_pwmio_pwmout_get_duty_cycle ( pwmio_pwmout_obj_t * self ) {
377377 const pin_timer_t * t = self -> timer ;
378378 if (t -> is_tc ) {
379379 Tc * tc = tc_insts [t -> index ];
@@ -411,7 +411,7 @@ uint16_t common_hal_pulseio_pwmout_get_duty_cycle(pulseio_pwmout_obj_t* self) {
411411}
412412
413413
414- void common_hal_pulseio_pwmout_set_frequency ( pulseio_pwmout_obj_t * self ,
414+ void common_hal_pwmio_pwmout_set_frequency ( pwmio_pwmout_obj_t * self ,
415415 uint32_t frequency ) {
416416 if (frequency == 0 || frequency > 6000000 ) {
417417 mp_raise_ValueError (translate ("Invalid PWM frequency" ));
@@ -466,10 +466,10 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self,
466466 #endif
467467 }
468468
469- common_hal_pulseio_pwmout_set_duty_cycle (self , self -> duty_cycle );
469+ common_hal_pwmio_pwmout_set_duty_cycle (self , self -> duty_cycle );
470470}
471471
472- uint32_t common_hal_pulseio_pwmout_get_frequency ( pulseio_pwmout_obj_t * self ) {
472+ uint32_t common_hal_pwmio_pwmout_get_frequency ( pwmio_pwmout_obj_t * self ) {
473473 uint32_t system_clock = common_hal_mcu_processor_get_frequency ();
474474 const pin_timer_t * t = self -> timer ;
475475 uint8_t divisor ;
@@ -484,6 +484,6 @@ uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self) {
484484 return (system_clock / prescaler [divisor ]) / (top + 1 );
485485}
486486
487- bool common_hal_pulseio_pwmout_get_variable_frequency ( pulseio_pwmout_obj_t * self ) {
487+ bool common_hal_pwmio_pwmout_get_variable_frequency ( pwmio_pwmout_obj_t * self ) {
488488 return self -> variable_frequency ;
489489}
0 commit comments