style: lowercase
This commit is contained in:
parent
82c9f0406c
commit
b03493a411
@ -2,5 +2,5 @@
|
|||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
void ADC0_Init();
|
void adc0_Init();
|
||||||
int16_t ADC0_TR_DATA();
|
int16_t adc0_TR_DATA();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "adc.h"
|
#include "adc.h"
|
||||||
#include "derivative.h"
|
#include "derivative.h"
|
||||||
|
|
||||||
void ADC0_Init() {
|
void adc0_Init() {
|
||||||
// Enable ADC0 and PORTE clock
|
// Enable ADC0 and PORTE clock
|
||||||
SIM->SCGC6 |= SIM_SCGC6_ADC0_MASK;
|
SIM->SCGC6 |= SIM_SCGC6_ADC0_MASK;
|
||||||
SIM->SCGC5 |= SIM_SCGC5_PORTE_MASK;
|
SIM->SCGC5 |= SIM_SCGC5_PORTE_MASK;
|
||||||
@ -17,7 +17,7 @@ void ADC0_Init() {
|
|||||||
ADC0->SC1[0] = ADC_SC1_ADCH(0x04); // Input channel select, AD4a is selected as input
|
ADC0->SC1[0] = ADC_SC1_ADCH(0x04); // Input channel select, AD4a is selected as input
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t ADC0_TR_DATA() {
|
int16_t adc0_TR_DATA() {
|
||||||
while (!(ADC0->SC1[0] & ADC_SC1_COCO_MASK)) asm("nop");
|
while (!(ADC0->SC1[0] & ADC_SC1_COCO_MASK)) asm("nop");
|
||||||
int16_t ADC_Result = ADC0->R[0];
|
int16_t ADC_Result = ADC0->R[0];
|
||||||
ADC0->SC1[0] &= ~ADC_SC1_COCO_MASK;
|
ADC0->SC1[0] &= ~ADC_SC1_COCO_MASK;
|
||||||
|
Reference in New Issue
Block a user