Start implementation of PT1000 ADC measurement

This commit is contained in:
2020-02-02 01:49:37 +01:00
parent f9eb3c676b
commit 02a673546e
5 changed files with 145 additions and 1 deletions

View File

@@ -0,0 +1,11 @@
#ifndef __STM32GPIOMACROS_H__
#define __STM32GPIOMACROS_H__
#define OUTPUT(pin) (0x01U << (pin * 2))
#define PULLUP(pin) (0x1U << (pin* 2))
#define ALTFUNC(pin) ((0x2) << (pin * 2))
#define PINMASK(pin) ((0x3) << (pin * 2))
#define SETAF(PORT,PIN,AF) PORT->AFR[(PIN < 8 ? 0 : 1)] |= AF << ((PIN < 8 ? PIN : (PIN - 8)) * 4)
#define ANALOG(pin) (0x03 << (pin * 2))
#endif /* __STM32GPIOMACROS_H__ */