diff options
| author | arturo182 <arturo182@tlen.pl> | 2018-07-08 17:48:32 +0200 |
|---|---|---|
| committer | arturo182 <arturo182@tlen.pl> | 2018-07-08 17:48:32 +0200 |
| commit | 388f554ff6516ce19ad52830f26b623ded395bb5 (patch) | |
| tree | 302fb9f8d4b65214851c42df9e96ea088361a720 /ports/nrf/common-hal/pulseio/PWMOut.c | |
| parent | 25ece8fb3d96969dffb0726ba57d42cf7ed95b4d (diff) | |
nrf: Rewrite the DigitalInOut hal using nRFx
Diffstat (limited to 'ports/nrf/common-hal/pulseio/PWMOut.c')
| -rw-r--r-- | ports/nrf/common-hal/pulseio/PWMOut.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ports/nrf/common-hal/pulseio/PWMOut.c b/ports/nrf/common-hal/pulseio/PWMOut.c index ea9ba3f0e..d23662948 100644 --- a/ports/nrf/common-hal/pulseio/PWMOut.c +++ b/ports/nrf/common-hal/pulseio/PWMOut.c @@ -30,6 +30,7 @@ #include "py/runtime.h" #include "common-hal/pulseio/PWMOut.h" +#include "nrf_gpio.h" #include "shared-bindings/pulseio/PWMOut.h" #define PWM_MAX_MODULE 3 @@ -161,7 +162,7 @@ void common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, if (self->pwm) { - hal_gpio_cfg_pin(pin->port, pin->pin, HAL_GPIO_MODE_OUTPUT, HAL_GPIO_PULL_DISABLED); + nrf_gpio_cfg_output(NRF_GPIO_PIN_MAP(pin->port, pin->pin)); // disable before mapping pin channel self->pwm->ENABLE = 0; @@ -201,7 +202,7 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { } } - hal_gpio_cfg_pin(self->pin->port, self->pin->pin, HAL_GPIO_MODE_INPUT, HAL_GPIO_PULL_DISABLED); + nrf_gpio_cfg_default(NRF_GPIO_PIN_MAP(self->pin->port, self->pin->pin)); self->pwm = NULL; self->pin = mp_const_none; |
