Merged with dev0.1.0

This commit is contained in:
klassents committed 2024-09-03 08:02:24 +03:00
1 parent fa310cfa0d
commit 687984b356
22 files changed
+71 -84

No files matched your search

+4 -4
View File
@@ -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;