6 #define DEFAULTSPEED 255 7 #define DEFAULTDURATION 100 28 #ifdef ACCESSORIES_DEBUG_MODE 29 #ifdef ARDUINO_ARCH_SAM 30 #define CHECKPIN(val, type, text) Port::CheckPinNb(val, type, text) 32 #define CHECKPIN(val, type, text) Port::CheckPinNb(val, type, F(text)) 35 #define CHECKPIN(val, type, text) 79 int MapValue(
int inValue, PIN_TYPE inType = UNDEFINED)
const;
85 int beginPin(
int inPin, PIN_TYPE inType = UNDEFINED)
const;
92 void MovePin(
int inPin,
int inValue, PIN_TYPE inType = UNDEFINED)
const;
130 inline bool IsLeftDir()
const {
return this->state == PORT_LEFT; }
134 inline bool IsRightDir()
const {
return this->state == PORT_RIGHT; }
138 inline bool IsStopped()
const {
return this->state == PORT_STOP; }
143 inline virtual void MoveLeftDir(
unsigned long inDuration = 0) { this->state = PORT_LEFT; }
147 inline virtual void MoveRightDir(
unsigned long inDuration = 0) { this->state = PORT_RIGHT; }
154 void MoveLeftDir(
unsigned long inDuration,
int inSpeed);
161 void MoveRightDir(
unsigned long inDuration,
int inSpeed);
165 PORT_STATE
MoveToggle(
unsigned long inDuration = 0);
167 inline virtual void MoveStop() { this->state = PORT_STOP; }
173 inline virtual void MovePosition(
unsigned long inDuration,
int inEndPosition) {}
180 #ifdef ACCESSORIES_DEBUG_MODE 181 #ifdef ARDUINO_ARCH_SAM 182 static void CheckPinNb(
int inPin,
const char *infunc);
183 static void CheckDIOPinNb(GPIO_pin_t inPin,
const char *infunc);
185 static void CheckPinNb(
int inPin, PIN_TYPE inType,
const __FlashStringHelper *infunc);
188 #ifdef ACCESSORIES_PRINT_ACCESSORIES 192 virtual void printPort();
196 static void printPortPin(
int inPin, PIN_TYPE inType);
virtual void MovePosition(unsigned long inDuration, int inEndPosition)
PORT_STATE MoveToggle(unsigned long inDuration = 0)
virtual void MoveRightDir(unsigned long inDuration = 0)
virtual void MoveLeftDir(unsigned long inDuration = 0)
virtual int GetPosition()
virtual int SetSpeed(int inSpeed)
PORT_STATE GetState() const
PIN_TYPE GetPinType() const
void MovePin(int inPin, int inValue, PIN_TYPE inType = UNDEFINED) const
int beginPin(int inPin, PIN_TYPE inType = UNDEFINED) const
virtual void beginByAccessory(int inStartingPosition)
int MapValue(int inValue, PIN_TYPE inType = UNDEFINED) const