Skip to content

Commit 0ea975e

Browse files
committed
Add baseAddr function to HwPWM instance
This allows for PWM configuration when direct register access is required.
1 parent 8a39786 commit 0ea975e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cores/nRF5/HardwarePWM.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ class HardwarePWM
6868

6969
void setClockDiv(uint8_t div); // value is PWM_PRESCALER_PRESCALER_DIV_x, DIV1 is 16Mhz
7070

71+
// Direct access to peripheral base address
72+
NRF_PWM_Type * const baseAddr(void)
73+
{
74+
return _pwm;
75+
}
76+
7177
// Cooperative ownership sharing
7278

7379
// returns true ONLY when (1) no PWM channel has a pin, and (2) the owner token is nullptr

0 commit comments

Comments
 (0)