-
Notifications
You must be signed in to change notification settings - Fork 1
ADC v0.2 #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: samr21
Are you sure you want to change the base?
ADC v0.2 #3
Conversation
Great to see the progress. I saw you imported a lot of functions from the Atmel library. The basic philosophy of the periph driver interface is to work with as little overhead as possible e.g. there shouldn't be wrapping functions or similar. To illustrate what I mean you could take a look at the ADC implementation for the stm32f4 MCU |
OK I spotted another thing that needs to be implemented. Regarding the Positive/Negative pins. I will go refactor must of the ADC code now, the RTC will be set on standby... |
For example I meant that void adc_poweroff(adc_t dev)
{
switch (dev)
{
#if ADC_0_EN
case ADC_0:
while((&ADC_0_DEV)->STATUS.reg & ADC_STATUS_SYNCBUSY);
(&ADC_0_DEV)->CTRLA.reg &= ~ADC_CTRLA_ENABLE;
break;
#endif
}
}
void adc_poweron(adc_t dev)
{
switch (dev)
{
#if ADC_0_EN
case ADC_0:
while((&ADC_0_DEV)->STATUS.reg & ADC_STATUS_SYNCBUSY);
(&ADC_0_DEV)->CTRLA.reg |= ADC_CTRLA_ENABLE;
break;
#endif
}
} This holds for all the |
3337900
to
bf256f6
Compare
I have implemented the ADC with the interface defined resolution except 6BIT & 14BIT because it's not a valid resolution.
I have tested all the valid resolutions with success!
I have made a example project to test if needed?
There are still a few TODOs:
but minor ones!