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

@ -78,14 +78,6 @@
#undef pgm_read_word
#define pgm_read_word(addr) (*((uint16_t*)(addr)))
#define RST_POWER_ON 1
#define RST_EXTERNAL 2
#define RST_BROWN_OUT 4
#define RST_WATCHDOG 8
#define RST_JTAG 16
#define RST_SOFTWARE 32
#define RST_BACKUP 64
typedef int8_t pin_t;
#define HAL_SERVO_LIB Servo
@ -143,13 +135,6 @@ inline void HAL_adc_init(void) {}//todo
void HAL_adc_start_conversion(const uint8_t adc_pin);
uint16_t HAL_adc_get_result(void);
uint16_t HAL_getAdcReading(uint8_t chan);
void HAL_startAdcConversion(uint8_t chan);
uint8_t HAL_pinToAdcChannel(int pin);
uint16_t HAL_getAdcFreerun(uint8_t chan, bool wait_for_conversion = false);
//uint16_t HAL_getAdcSuperSample(uint8_t chan);
void HAL_enable_AdcFreerun(void);
//void HAL_disable_AdcFreerun(uint8_t chan);
//
// Pin Map

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); }