|
TTK4155 Lab Node 1
Term project in the NTNU course TTK4155 Embedded and Industrial Computer Systems Design
|
Data Structures | |
| struct | ADC_meas |
| Container for ADC measurement results. More... | |
Functions | |
| void | ADC_init (void) |
| Initialize the external memory–mapped ADC interface. | |
| void | ADC_start_conv (void) |
| Start a conversion on the external ADC and wait for completion. | |
| uint8_t | ADC_read_ch (void) |
| Read the current ADC channel sample. | |
| void | ADC_read_all (struct ADC_meas *output) |
| Perform a full four-channel ADC conversion and return all results. | |
| void | ADC_test (void) |
| Internal ADC test routine. (Currently disabled in implementation.). | |
| void ADC_init | ( | void | ) |
#include <adc.h>
Initialize the external memory–mapped ADC interface.
This prepares communication with the external ADC connected on the XMEM bus. All low-level XMEM configuration must already be handled elsewhere (e.g., via xmem_init()).
Definition at line 12 of file adc.c.
Referenced by io_joystick_init().
| void ADC_read_all | ( | struct ADC_meas * | output | ) |
#include <adc.h>
Perform a full four-channel ADC conversion and return all results.
Starts a conversion, then reads each channel sequentially with a small delay to satisfy ADC timing requirements.
| [out] | output | Pointer to a structure that will receive channel data. |
Definition at line 36 of file adc.c.
Referenced by io_joystick_read_position(), utils_joystick_print_pos(), and utils_joystick_print_raw().
| uint8_t ADC_read_ch | ( | void | ) |
#include <adc.h>
Read the current ADC channel sample.
Reads a single byte from the ADC's memory-mapped interface.
Definition at line 30 of file adc.c.
Referenced by ADC_read_all().
| void ADC_start_conv | ( | void | ) |
#include <adc.h>
Start a conversion on the external ADC and wait for completion.
Triggers a write strobe through the ADC's memory interface and waits for the BUSY flag (PD4) to clear.
Definition at line 21 of file adc.c.
Referenced by ADC_read_all().
| void ADC_test | ( | void | ) |
#include <adc.h>
Internal ADC test routine. (Currently disabled in implementation.).
Prints ADC values for channels 0–3 via UART.