The Electrostatic-Sandbox SDK Suite 0.0.0-primer
A complete WIP SDK suite written purely in C for distributed simulation systems based on IEEE-1516 and NASA DSES.
|
#include <avr/io.h>
#include <avr/interrupt.h>
#include <string.h>
#include <stdlib.h>
#include <electrostatic/electroio/electromio/avr/adc/control/clkprescaler.h>
#include <electrostatic/electroio/electromio/avr/adc/admux/channel.h>
#include <electrostatic/electroio/electromio/avr/adc/admux/vref.h>
Go to the source code of this file.
Classes | |
struct | adc_callbacks |
Functions | |
static void | adc_assign_callbacks (volatile adc_callbacks *in_callbacks) |
Assigns the callbacks for the ADC conversion. | |
void | adc_start_protocol () |
Starts the ADC protocol and enable the adc interrupt service by setting the [ADEN] and [ADIE]. | |
void | adc_stop_protocol () |
Stops the ADC protocol by setting [ADEN] to 0x00 through [ADCSRA = 0x00] and formatting the output pins. | |
void | adc_enable_isr () |
Enables the adc conversion complete interrupt service routine. | |
void | adc_start_conversion (const uint8_t PIN, const uint8_t V_REF, const uint8_t CONVERSION_SPEED) |
Starts the Analog to Digital conversion. | |
volatile uint16_t | adc_read () |
Combines the readings of [ADCL] and [ADCH] data registers in a 16-bit software register. | |
Variables | |
volatile adc_callbacks * | adc_internal_callbacks |
Interrupt-safe re-assignable callbacks. | |
Operates and controls the ADC protocol through the ADC mulitplexers and status control registers.
Definition in file adc.h.
|
inlinestatic |
void adc_enable_isr | ( | ) |
Enables the adc conversion complete interrupt service routine.
Definition at line 14 of file adc_conversion_isr.c.
volatile uint16_t adc_read | ( | ) |
Combines the readings of [ADCL] and [ADCH] data registers in a 16-bit software register.
Definition at line 3 of file adc_read.c.
void adc_start_conversion | ( | const uint8_t | PIN, |
const uint8_t | V_REF, | ||
const uint8_t | CONVERSION_SPEED ) |
Starts the Analog to Digital conversion.
PIN | the ADC MUX pin to read from. |
V_REF | the reference voltage to use for the ADC, the reference voltage represents the voltage to compare against. |
CONVERSION_SPEED | the speed of the adc conversion in relation to the crystal oscillator. |
Definition at line 3 of file adc_start_conversion.c.
void adc_start_protocol | ( | ) |
Starts the ADC protocol and enable the adc interrupt service by setting the [ADEN] and [ADIE].
Definition at line 13 of file adc_start_protocol.c.
void adc_stop_protocol | ( | ) |
Stops the ADC protocol by setting [ADEN] to 0x00 through [ADCSRA = 0x00] and formatting the output pins.
Definition at line 3 of file adc_stop_protocol.c.
volatile adc_callbacks* adc_internal_callbacks |
Interrupt-safe re-assignable callbacks.