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;
126 inline bool IsLeftDir()
const {
return this->state == PORT_LEFT; }
130 inline bool IsRightDir()
const {
return this->state == PORT_RIGHT; }
134 inline bool IsStopped()
const {
return this->state == PORT_STOP; }
139 inline virtual void MoveLeftDir(
unsigned long inDuration = 0) { this->state = PORT_LEFT; }
143 inline virtual void MoveRightDir(
unsigned long inDuration = 0) { this->state = PORT_RIGHT; }
150 void MoveLeftDir(
unsigned long inDuration,
int inSpeed);
157 void MoveRightDir(
unsigned long inDuration,
int inSpeed);
161 PORT_STATE
MoveToggle(
unsigned long inDuration = 0);
163 inline virtual void MoveStop() { this->state = PORT_STOP; }
169 inline virtual void MovePosition(
unsigned long inDuration,
int inEndPosition) {}
176 #ifdef ACCESSORIES_DEBUG_MODE 177 #ifdef ARDUINO_ARCH_SAM 178 static void CheckPinNb(
int inPin,
const char *infunc);
179 static void CheckDIOPinNb(GPIO_pin_t inPin,
const char *infunc);
181 static void CheckPinNb(
int inPin, PIN_TYPE inType,
const __FlashStringHelper *infunc);
184 #ifdef ACCESSORIES_PRINT_ACCESSORIES 188 virtual void printPort();
192 static void printPortPin(
int inPin, PIN_TYPE inType);
PORT_STATE MoveToggle(unsigned long inDuration = 0)
virtual void MoveRightDir(unsigned long inDuration = 0)
virtual void MoveLeftDir(unsigned long inDuration = 0)
virtual void MovePosition(unsigned long inDuration, int inEndPosition)
virtual int GetPosition()
virtual int SetSpeed(int inSpeed)
PORT_STATE GetState() 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