добавлена функция, отключающая А4, А5 от ацп после преобразования
This commit is contained in:
parent
30715cb3d5
commit
a5b21d6065
@ -71,6 +71,7 @@ volatile uint32_t* portOutputRegister(GPIO_TypeDef* GPIO_x);
|
||||
volatile uint32_t* portInputRegister(GPIO_TypeDef* GPIO_x);
|
||||
// the function initializes additional MCU pins depending on the specified pin number
|
||||
void additionalPinsInit(uint32_t PinNumber);
|
||||
void additionalPinsDeinit(uint32_t PinNumber);
|
||||
|
||||
// UART
|
||||
// available uarts quantity
|
||||
|
||||
@ -142,6 +142,16 @@ void additionalPinsInit(uint32_t PinNumber)
|
||||
}
|
||||
}
|
||||
|
||||
void additionalPinsDeinit(uint32_t PinNumber)
|
||||
{
|
||||
if (PinNumber == A4 || PinNumber == A5)
|
||||
{
|
||||
// select A7 via switches selaA, selaB to allow using A4 and A5 as digital outputs
|
||||
HAL_GPIO_WritePin(SELA_A_PORT, SELA_A_PIN, GPIO_PIN_HIGH);
|
||||
HAL_GPIO_WritePin(SELA_B_PORT, SELA_B_PIN, GPIO_PIN_HIGH);
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------- ADC ---------------------- //
|
||||
// determines the ADC channel number by the board pin number
|
||||
uint32_t analogInputToChannelNumber(uint32_t PinNumber)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user