From 0ea975e6e3969f4ca58130622e4f1600d0f5a8e6 Mon Sep 17 00:00:00 2001 From: James Gartrell Date: Thu, 16 Feb 2023 09:24:42 -0800 Subject: [PATCH] Add baseAddr function to HwPWM instance This allows for PWM configuration when direct register access is required. --- cores/nRF5/HardwarePWM.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cores/nRF5/HardwarePWM.h b/cores/nRF5/HardwarePWM.h index 2002c8a1..f85424d3 100644 --- a/cores/nRF5/HardwarePWM.h +++ b/cores/nRF5/HardwarePWM.h @@ -68,6 +68,12 @@ class HardwarePWM void setClockDiv(uint8_t div); // value is PWM_PRESCALER_PRESCALER_DIV_x, DIV1 is 16Mhz + // Direct access to peripheral base address + NRF_PWM_Type * const baseAddr(void) + { + return _pwm; + } + // Cooperative ownership sharing // returns true ONLY when (1) no PWM channel has a pin, and (2) the owner token is nullptr