Merge pull request #760 from jgartrel/master
Add helper functions to HwPWM Instance
This commit is contained in:
2 files changed
+12
No files matched your search
@@ -205,6 +205,15 @@ bool HardwarePWM::removePin(uint8_t pin)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool HardwarePWM::removeAllPins(void)
|
||||
{
|
||||
for(int ch=0; ch<MAX_CHANNELS; ch++)
|
||||
{
|
||||
_set_psel(ch, 0xFFFFFFFFUL);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool HardwarePWM::writeChannel(uint8_t ch, uint16_t value, bool inverted)
|
||||
{
|
||||
VERIFY( ch < MAX_CHANNELS );
|
||||
|
||||
@@ -88,6 +88,9 @@ class HardwarePWM
|
||||
// Remove a pin from PWM module
|
||||
bool removePin (uint8_t pin);
|
||||
|
||||
// Remove all pins from PWM module
|
||||
bool removeAllPins (void);
|
||||
|
||||
// Get the mapped channel of a pin
|
||||
int pin2channel(uint8_t pin) const
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user