Merged with dev0.1.0
This commit is contained in:
1 parent
49882b2eb6
commit
0cc714ccf9
22 files changed
+71
-84
No files matched your search
@@ -63,9 +63,9 @@ HAL_PinsTypeDef digitalPinToBitMask(uint32_t digPinNumber);
|
||||
// total number of pins available for initialization
|
||||
uint16_t pinCommonQty(void);
|
||||
// the function returns a reference to the OUTPUT address of the GPIO register
|
||||
uint32_t* portOutputRegister(GPIO_TypeDef* GPIO_x);
|
||||
volatile uint32_t* portOutputRegister(GPIO_TypeDef* GPIO_x);
|
||||
// the function returns a reference to the STATE address of the GPIO register
|
||||
uint32_t* portInputRegister(GPIO_TypeDef* GPIO_x);
|
||||
volatile uint32_t* portInputRegister(GPIO_TypeDef* GPIO_x);
|
||||
|
||||
// ADC
|
||||
// determines the ADC channel number by the board pin number
|
||||
@@ -110,7 +110,6 @@ static const uint8_t SCL = PIN_WIRE_SCL;
|
||||
#define WIRE_FREQ_1000K 1000000
|
||||
|
||||
// interrupts
|
||||
#define EXTERNAL_NUM_INTERRUPTS 7
|
||||
// determines the board pin number by interrupt number
|
||||
uint32_t interruptToDigitalPin(uint8_t interruptNum);
|
||||
// determines interrupt number by the board pin number
|
||||
|
||||
@@ -95,24 +95,24 @@ uint16_t pinCommonQty(void)
|
||||
}
|
||||
|
||||
// the function returns a reference to the OUTPUT address of the GPIO register
|
||||
uint32_t* portOutputRegister(GPIO_TypeDef* GPIO_x)
|
||||
volatile uint32_t* portOutputRegister(GPIO_TypeDef* GPIO_x)
|
||||
{
|
||||
return &GPIO_x->OUTPUT_;
|
||||
}
|
||||
|
||||
// the function returns a reference to the STATE address of the GPIO register
|
||||
uint32_t* portInputRegister(GPIO_TypeDef* GPIO_x)
|
||||
volatile uint32_t* portInputRegister(GPIO_TypeDef* GPIO_x)
|
||||
{
|
||||
return &GPIO_x->STATE;
|
||||
}
|
||||
|
||||
// ---------------------- АЦП ---------------------- //
|
||||
// ---------------------- ADC ---------------------- //
|
||||
// determines the ADC channel number by the board pin number
|
||||
uint32_t analogInputToChannelNumber(uint32_t PinNumber)
|
||||
{
|
||||
uint32_t adcChannel = 0;
|
||||
|
||||
// if passed a value from 0 - 5, instead of A0 - A5
|
||||
// if get a value 0...5 instead of A0...A5
|
||||
if (PinNumber < 4) PinNumber += 14;
|
||||
else if (PinNumber < 6) PinNumber += 16;
|
||||
|
||||
|
||||
Reference in new issue
Block a user