Added core tools, added ADC abstractions for different registers
This commit is contained in:
@@ -64,7 +64,7 @@ SHAL_Result SHAL_ADC::calibrate() {
|
||||
return SHAL_Result::OKAY;
|
||||
}
|
||||
|
||||
uint16_t SHAL_ADC::singleConvertSingle(ADC_Channel channel, ADC_SampleTime time) {
|
||||
uint16_t SHAL_ADC::singleConvertSingle(SHAL_ADC_Channel channel, ADC_SampleTime time) {
|
||||
|
||||
ADC_TypeDef* ADC_reg = getADCRegister(m_ADCKey);
|
||||
|
||||
@@ -81,7 +81,7 @@ uint16_t SHAL_ADC::singleConvertSingle(ADC_Channel channel, ADC_SampleTime time)
|
||||
return result;
|
||||
}
|
||||
|
||||
void SHAL_ADC::multiConvertSingle(ADC_Channel* channels, const int numChannels, uint16_t* result, ADC_SampleTime time) {
|
||||
void SHAL_ADC::multiConvertSingle(SHAL_ADC_Channel* channels, const int numChannels, uint16_t* result, ADC_SampleTime time) {
|
||||
ADC_TypeDef* ADC_reg = getADCRegister(m_ADCKey);
|
||||
|
||||
ADC->CCR |= ADC_CCR_VREFEN | ADC_CCR_TSEN; //Enable VREFINT and Temp sensor in global ADC struct
|
||||
|
||||
@@ -109,7 +109,7 @@ void SHAL_GPIO::useAsExternalInterrupt(TriggerMode mode, EXTICallback callback)
|
||||
|
||||
uint16_t SHAL_GPIO::analogRead(ADC_SampleTime sampleTime) {
|
||||
|
||||
ADC_Channel channel = getGPIOPortInfo(m_GPIO_KEY).ADCChannel;
|
||||
SHAL_ADC_Channel channel = getGPIOPortInfo(m_GPIO_KEY).ADCChannel;
|
||||
|
||||
return GPIOManager::getGPIOADC().singleConvertSingle(channel,sampleTime);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user