161 static Board* instance;
169#error F_CPU not defined. This must be fixed.
172#if ! defined(ARDUINO)
177#elif defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__)
184#elif defined(__AVR_ATmega2560__)
194#elif defined(__AVR_ATmega32U4__)
196#if defined(ARDUINO_AVR_LEONARDO) || defined(ARDUINO_AVR_MICRO)
204#error Unsupported board. Please fix boarddefs.h.
207#elif defined(__AVR_ATmega4809__)
214#elif defined(__SAM3X8E__) || defined(__SAM3X8H__)
236#elif defined(ARDUINO_TEENSY30) || defined(ARDUINO_TEENSY32)
241#elif defined(ARDUINO_ARCH_SAM) || defined(ARDUINO_ARCH_SAMD)
258#warning The present board is either unknown, or does not support (Hardware) PWM \
259or equidistant timer sampling. The classes IrReceiverSampler and \
260IrSenderPwmHard will not be available.
276 digitalWrite(DEBUG_PIN, HIGH);
282 digitalWrite(DEBUG_PIN, LOW);
291#ifdef HAS_HARDWARE_PWM
Hardware dependent definitions for boards based on the ATMega 2560.
Hardware dependent definitions for boards based on the ATMega 328P.
Hardware dependent definitions for Leonardo like boards like Leonardo and Micro.
Hardware dependent definitions for boards based on the ATMega 4809.
Hardware dependent definitions for Esp32 boards.
int8_t dutycycle_t
Type for duty cycle in percent.
uint16_t microseconds_t
Type for durations in micro seconds.
uint32_t frequency_t
Type for modulation frequency in Hz.
uint8_t pin_t
Type for GPIO pin, compatible with Arduino libs.
This file make sure that the types PinMode and PinStatus, as well as the values HIGH and LOW are avai...
int PinMode
Different operating modes of a GPIO pin.
Hardware dependent definitions for Teensy 3.1/3.2 and probably more.
This class serves as an HAL (Hardware Abstraction Layer).
virtual void timerEnableIntr()=0
Start periodic sampling routine.
virtual void enableSampler(pin_t pin __attribute__((unused)))
Start the periodic ISR sampler routine.
virtual void writeHigh(pin_t pin)
void sendPwmMark(microseconds_t time)
virtual void disableSampler()
Turn off sampler routine.
static void debugPinHigh()
bool readDigital(pin_t pin)
void enablePwm(pin_t pin, frequency_t frequency, dutycycle_t dutyCycle)
Start PWM, making output active.
static Board * getInstance()
virtual void checkValidSendPin(pin_t pin __attribute__((unused)))
static void setupDebugPin()
static void debugPinLow()
virtual void timerDisablePwm()=0
Turn off PWM output.
virtual void timerConfigHz(frequency_t hz, dutycycle_t dutyCycle=defaultDutyCycle)=0
Configure hardware PWM, but do not enable it.
static const unsigned long microsPerTick
static constexpr bool hasHardwarePwm()
static constexpr pin_t defaultPwmPin()
virtual void timerDisableIntr()=0
Turn off periodic interrupts.
virtual void writeLow(pin_t pin)
void disablePwm()
Turn off PWM.
void setPinMode(pin_t pin, PinMode mode)
virtual void timerEnablePwm()=0
Start PWM output.
static void delayMicroseconds(microseconds_t)
Version of delayMicroseconds able to grok more than 16383 micros.
virtual void timerConfigNormal()=0
Disables the PWM configuration.
static constexpr dutycycle_t defaultDutyCycle
Default duty cycle to use.
static constexpr pin_t NO_PIN
Constant indicating no or invalid pin.
virtual void timerReset()
TODO.
virtual pin_t getPwmPin() const