7 #ifndef DIGITAL_MODULE_H_
8 #define DIGITAL_MODULE_H_
11 #include "ChipObject.h"
15 const uint32_t kExpectedLoopTiming = 260;
27 void SetPWM(uint32_t channel, uint8_t value);
28 uint8_t
GetPWM(uint32_t channel);
38 void SetDIO(uint32_t channel,
short value);
39 bool GetDIO(uint32_t channel);
43 void Pulse(uint32_t channel,
float pulseLength);
56 static uint8_t RemapDigitalChannel(uint32_t channel) {
return 15 - channel; };
57 static uint8_t UnmapDigitalChannel(uint32_t channel) {
return 15 - channel; };
60 SEM_ID m_digitalSemaphore;
61 SEM_ID m_relaySemaphore;
62 SEM_ID m_doPwmSemaphore;
void SetRelayForward(uint32_t channel, bool on)
Definition: DigitalModule.cpp:160
bool IsPulsing()
Definition: DigitalModule.cpp:419
uint16_t GetDIODirection()
Definition: DigitalModule.cpp:376
void SetDIO(uint32_t channel, short value)
Definition: DigitalModule.cpp:294
void SetRelayReverse(uint32_t channel, bool on)
Definition: DigitalModule.cpp:181
void SetDO_PWMDutyCycle(uint32_t pwmGenerator, float dutyCycle)
Definition: DigitalModule.cpp:502
uint32_t AllocateDO_PWM()
Definition: DigitalModule.cpp:433
void FreeDIO(uint32_t channel)
Definition: DigitalModule.cpp:282
void SetDO_PWMOutputChannel(uint32_t pwmGenerator, uint32_t channel)
Definition: DigitalModule.cpp:474
uint16_t GetLoopTiming()
Definition: DigitalModule.cpp:528
void SetDO_PWMRate(float rate)
Definition: DigitalModule.cpp:458
void Pulse(uint32_t channel, float pulseLength)
Definition: DigitalModule.cpp:391
void SetPWM(uint32_t channel, uint8_t value)
Definition: DigitalModule.cpp:119
uint8_t GetPWM(uint32_t channel)
Definition: DigitalModule.cpp:133
bool AllocateDIO(uint32_t channel, bool input)
Definition: DigitalModule.cpp:252
uint8_t GetRelayReverse()
Definition: DigitalModule.cpp:234
uint16_t GetDIO()
Definition: DigitalModule.cpp:343
static DigitalModule * GetInstance(uint8_t moduleNumber)
Definition: DigitalModule.cpp:26
uint8_t GetRelayForward()
Definition: DigitalModule.cpp:211
void FreeDO_PWM(uint32_t pwmGenerator)
Definition: DigitalModule.cpp:445
void SetPWMPeriodScale(uint32_t channel, uint32_t squelchMask)
Definition: DigitalModule.cpp:147
Definition: DigitalModule.h:17
DigitalModule(uint8_t moduleNumber)
Definition: DigitalModule.cpp:51
I2C * GetI2C(uint32_t address)
Definition: DigitalModule.cpp:544