Added analogRead to GPIO

This commit is contained in:
Ea-r-th
2025-09-22 22:12:57 -07:00
parent 8214617e3a
commit 03dcfd6bbe
6 changed files with 104 additions and 3 deletions

View File

@@ -107,6 +107,13 @@ void SHAL_GPIO::useAsExternalInterrupt(TriggerMode mode, EXTICallback callback)
__enable_irq(); //Enable IRQ just in case
}
uint16_t SHAL_GPIO::analogRead(ADC_SampleTime sampleTime) {
ADC_Channel channel = getGPIOPortInfo(m_GPIO_KEY).ADCChannel;
return GPIOManager::getGPIOADC().singleConvertSingle(channel,sampleTime);
}
SHAL_GPIO& GPIOManager::get(GPIO_Key key) {