init Modification

This commit is contained in:
Rajput R Vikramsingh Vikramsingh 2024-11-25 12:24:05 +05:30
parent d463406438
commit d964a92748
1 changed files with 3 additions and 3 deletions

6
main.c
View File

@ -49,9 +49,9 @@ void ADC0_Init(void) {
SYSCTL_RCGCGPIO_R |= 0x10; // Enable clock for Port E SYSCTL_RCGCGPIO_R |= 0x10; // Enable clock for Port E
// while ((SYSCTL_PRGPIO_R & (1U << 4)) == 0); // Wait for Port E to be ready // while ((SYSCTL_PRGPIO_R & (1U << 4)) == 0); // Wait for Port E to be ready
GPIO_PORTE_AFSEL_R |= (1U << 3); // Enable alternate function on PE3 GPIO_PORTE_AFSEL_R |= 0x08; // Enable alternate function on PE3
GPIO_PORTE_DEN_R &= ~(1U << 3); // Disable digital I/O on PE3 GPIO_PORTE_DEN_R &= ~(1U << 3); // Disable digital I/O on PE3 // GPIO_PORTE_DEN_R &= ~(0x08);
GPIO_PORTE_AMSEL_R |= (1U << 3); // Enable analog function on PE3 GPIO_PORTE_AMSEL_R |= 0x08; // Enable analog function on PE3
ADC0_ACTSS_R &= ~8; // Disable sample sequencer 3 ADC0_ACTSS_R &= ~8; // Disable sample sequencer 3
ADC0_EMUX_R = (ADC0_EMUX_R & 0xFFFF0FFF); // Software trigger for SS3 ADC0_EMUX_R = (ADC0_EMUX_R & 0xFFFF0FFF); // Software trigger for SS3