![]() |
EVE 1.0
|
![]() |
Data Structures | |
struct | adc_state_t |
struct | adc_streamer_state_t |
struct | adc_mux_config_t |
struct | adc_analog_config_t |
struct | adc_digital_config_t |
struct | adc_channel_t |
struct | adc_streamer_t |
struct | adc_schedule_t |
Typedefs | |
typedef void(* | adc_callback_t) (enum adc_cb_parameter_t AdcCbParameter) |
typedef void(* | adc_streamer_callback_t) (const struct adc_streamer_t *Adc, uint8_t SampleBufIndex) |
Enumerations |
Functions called from application programs | |
void | Adc0Init (const struct adc_schedule_t *AdcSchedule) |
Name: Adc0Init Initializes pointers used by ADC scheduler. Called from main program level. More... | |
bool | Adc0ChannelConfig (const struct adc_channel_t *Adc, int Index, const struct adc_analog_config_t *Config) |
Name: Adc0ChannelConfig Configures an analog channel in scan mode. More... | |
bool | Adc0ChannelStart (const struct adc_channel_t *Adc, uint32_t TimeRef) |
Name: Adc0ChannelStart Starts one ADC channel scheduler based on input parameters. More... | |
void | Adc0ManualScheduler (const struct adc_channel_t *Adc) |
Name: Adc0ManualScheduler Called by application for manual data scheduling. More... | |
void | Adc0ChannelDisable (const struct adc_channel_t *Adc) |
Name: Adc0ChannelDisable Disables one ADC channel scheduler based on input parameters. When all channels are disabled, the scheduler is stopped. More... | |
void | Adc0ChannelDisableAll (void) |
Name: Adc0ChannelDisableAll Disables all ADC channel schedulers and stops the scheduler. | |
uint16_t | Adc0GetMuxValue (const struct adc_channel_t *Adc, uint8_t MuxChannel) |
Name: Adc0GetMuxValue Starts ADC for selected ADC channel and mux input. More... | |
static uint16_t | Adc0GetValue (const struct adc_channel_t *Adc) |
Name: Adc0GetValue Starts ADC for selected ADC channel. More... | |
uint16_t | Adc0GetLastMuxValue (const struct adc_channel_t *Adc, uint8_t MuxChannel) |
Name: Adc0GetLastMuxValue Returns last converted ADC value for selected ADC channel and mux input. More... | |
static uint16_t | Adc0GetLastValue (const struct adc_channel_t *Adc) |
Name: Adc0GetLastValue Returns last converted ADC value for selected ADC channel. More... | |
uint32_t | Adc0GetIntegratedMuxValue (const struct adc_channel_t *Adc, uint8_t MuxChannel, uint16_t *Count) |
Name: Adc0GetIntegratedMuxValue Returns integrated ADC value for selected ADC channel and mux input. More... | |
static uint32_t | Adc0GetIntegratedValue (const struct adc_channel_t *Adc, uint16_t *Count) |
Name: Adc0GetIntegratedValue Returns integrated ADC value for selected ADC channel. More... | |
uint16_t | Adc0GetMeanMuxValue (const struct adc_channel_t *Adc, uint8_t MuxChannel) |
Name: Adc0GetMeanMuxValue Returns mean ADC value for selected ADC channel and mux input. More... | |
static uint16_t | Adc0GetMeanValue (const struct adc_channel_t *Adc) |
Name: Adc0GetMeanValue Returns mean ADC value for selected ADC channel. More... | |
bool | Adc0StreamerStart (const struct adc_streamer_t *Adc) |
Name: Adc0StreamerStart Starts continous sampling and streaming of data. More... | |
void | Adc0StreamerDisable (const struct adc_streamer_t *Adc) |
Name: Adc0StreamerDisable Stops continous sampling and streaming of data. More... | |
This ADC driver can be used for ADC0.
All ADC channels must be initialized before the ADC driver may be used. An ADC channel can be configured to have an analog mux (1-64 mux inputs). If an ADC channel has an analog multiplexer, the MUX control lines must be controlled by the same IO port with consecutive port pins. For each configured ADC input, individually voltage reference etc. can be set. Individual buffers must be allocated.
It is possible to just start a single AD convertion. It is also possible that each configured ADC input can be started with its own scanning scheduler. Scanning interval is is set with resolution 1/1.024 ms and is based on the mwork scheduler. If multiple configured ADC channels should have the same starting time in the scheduler even though they are started sequentially, they can be started based on a common read time reference. If the Interval parameter is set to zero/0, the application may call the Adc0ManualScheduler() function and do the scheduler timing itself. This manual scheduler will use the same Buffer and IntegratedValue as the automatic mwork scheduler.
If the configured ADC input has mux, the allocated buffer will be shared linearly for all the mux inputs. While AD convertion is in progress, or while the scheduler is doing AD convertions, the clock is locked and energy mode EM1 is minimum required.
typedef void(* adc_callback_t) (enum adc_cb_parameter_t AdcCbParameter) |
typedef void(* adc_streamer_callback_t) (const struct adc_streamer_t *Adc, uint8_t SampleBufIndex) |
enum adc_cb_parameter_t |
void Adc0Init | ( | const struct adc_schedule_t * | AdcSchedule | ) |
Name: Adc0Init
Initializes pointers used by ADC scheduler. Called from main program level.
AdcSchedule | Pointer to ADC scheduler table in application layer. |
bool Adc0ChannelConfig | ( | const struct adc_channel_t * | Adc, |
int | Index, | ||
const struct adc_analog_config_t * | Config | ||
) |
Name: Adc0ChannelConfig
Configures an analog channel in scan mode.
Adc | Configuration structure for ADC input to be used |
Index | Scan index. 0 for the main channel, > 0 enables scan and correspondes to the particular scan slot. |
Config | Analog channel configuration |
bool Adc0ChannelStart | ( | const struct adc_channel_t * | Adc, |
uint32_t | TimeRef | ||
) |
Name: Adc0ChannelStart
Starts one ADC channel scheduler based on input parameters.
Adc | Configuration structure for ADC input to be used |
TimeRef | Time reference tick got from clock_time() function |
void Adc0ManualScheduler | ( | const struct adc_channel_t * | Adc | ) |
Name: Adc0ManualScheduler
Called by application for manual data scheduling.
Adc | Configuration structure for ADC input to be used |
void Adc0ChannelDisable | ( | const struct adc_channel_t * | Adc | ) |
Name: Adc0ChannelDisable
Disables one ADC channel scheduler based on input parameters. When all channels are disabled, the scheduler is stopped.
Adc | Configuration structure for ADC input to be used |
uint16_t Adc0GetMuxValue | ( | const struct adc_channel_t * | Adc, |
uint8_t | MuxChannel | ||
) |
Name: Adc0GetMuxValue
Starts ADC for selected ADC channel and mux input.
Adc | Configuration structure for ADC input to be used |
MuxChannel |
Referenced by Adc0GetValue().
|
inlinestatic |
Name: Adc0GetValue
Starts ADC for selected ADC channel.
Adc | Configuration structure for ADC input to be used |
Definition at line 300 of file adc0.h.
References Adc0GetLastMuxValue(), and Adc0GetMuxValue().
uint16_t Adc0GetLastMuxValue | ( | const struct adc_channel_t * | Adc, |
uint8_t | MuxChannel | ||
) |
Name: Adc0GetLastMuxValue Returns last converted ADC value for selected ADC channel and mux input.
Adc | Configuration structure for ADC input to be used |
MuxChannel |
Referenced by Adc0GetLastValue(), and Adc0GetValue().
|
inlinestatic |
Name: Adc0GetLastValue Returns last converted ADC value for selected ADC channel.
Adc | Configuration structure for ADC input to be used |
Definition at line 324 of file adc0.h.
References Adc0GetIntegratedMuxValue(), and Adc0GetLastMuxValue().
uint32_t Adc0GetIntegratedMuxValue | ( | const struct adc_channel_t * | Adc, |
uint8_t | MuxChannel, | ||
uint16_t * | Count | ||
) |
Name: Adc0GetIntegratedMuxValue Returns integrated ADC value for selected ADC channel and mux input.
Adc | Configuration structure for ADC input to be used |
MuxChannel | |
Count | Number of samples in the integrated value is returned in Count |
Referenced by Adc0GetIntegratedValue(), and Adc0GetLastValue().
|
inlinestatic |
Name: Adc0GetIntegratedValue Returns integrated ADC value for selected ADC channel.
Adc | Configuration structure for ADC input to be used |
Count | Number of samples in the integrated value is returned in Count |
Definition at line 350 of file adc0.h.
References Adc0GetIntegratedMuxValue(), and Adc0GetMeanMuxValue().
uint16_t Adc0GetMeanMuxValue | ( | const struct adc_channel_t * | Adc, |
uint8_t | MuxChannel | ||
) |
Name: Adc0GetMeanMuxValue Returns mean ADC value for selected ADC channel and mux input.
Adc | Configuration structure for ADC input to be used |
MuxChannel |
Referenced by Adc0GetIntegratedValue(), and Adc0GetMeanValue().
|
inlinestatic |
Name: Adc0GetMeanValue Returns mean ADC value for selected ADC channel.
Adc | Configuration structure for ADC input to be used |
Definition at line 374 of file adc0.h.
References Adc0GetMeanMuxValue(), Adc0StreamerDisable(), and Adc0StreamerStart().
bool Adc0StreamerStart | ( | const struct adc_streamer_t * | Adc | ) |
Name: Adc0StreamerStart
Starts continous sampling and streaming of data.
Adc | Configuration structure for the streamer |
Referenced by Adc0GetMeanValue().
void Adc0StreamerDisable | ( | const struct adc_streamer_t * | Adc | ) |
Name: Adc0StreamerDisable
Stops continous sampling and streaming of data.
Adc | Configuration structure for the streamer |
Referenced by Adc0GetMeanValue().