Clean up HALs / FastIO (#14082)

This commit is contained in:
Giuliano Zaro
2019-05-22 01:28:12 +02:00
committed by Scott Lahteine
parent 4ef364a073
commit a74aad3b4a
21 changed files with 17 additions and 187 deletions

View File

@@ -46,7 +46,6 @@
// Due has 12 PWMs assigned to logical pins 2-13.
// 6, 7, 8 & 9 come from the PWM controller. The others come from the timers.
#define PWM_PIN(P) WITHIN(P, 2, 13)
#define USEABLE_HARDWARE_PWM(P) PWM_PIN(P)
#ifndef MASK
#define MASK(PIN) (1 << PIN)
@@ -180,8 +179,6 @@
#define IS_INPUT(IO) ((digitalPinToPort(IO)->PIO_OSR & digitalPinToBitMask(IO)) == 0)
// Check if pin is an output
#define IS_OUTPUT(IO) ((digitalPinToPort(IO)->PIO_OSR & digitalPinToBitMask(IO)) != 0)
// Check if pin is a timer - Must be a constexpr
#define HAS_TIMER(IO) ((IO) >= 2 && (IO) <= 13)
// Shorthand
#define OUT_WRITE(IO,V) { SET_OUTPUT(IO); WRITE(IO,V); }