ChibiOS/HAL  7.0.3
hal_adc.h File Reference

ADC Driver macros and structures. More...

#include "hal_adc_lld.h"

Go to the source code of this file.

Data Structures

struct  hal_adc_configuration_group
 Conversion group configuration structure. More...
 
struct  hal_adc_config
 Driver configuration structure. More...
 
struct  hal_adc_driver
 Structure representing an ADC driver. More...
 

Macros

ADC configuration options
#define ADC_USE_WAIT   TRUE
 Enables synchronous APIs. More...
 
#define ADC_USE_MUTUAL_EXCLUSION   TRUE
 Enables the adcAcquireBus() and adcReleaseBus() APIs. More...
 
Macro Functions
#define adcIsBufferComplete(adcp)   ((bool)((adcp)->state == ADC_COMPLETE))
 Buffer state. More...
 
Low level driver helper macros
#define _adc_reset_i(adcp)   osalThreadResumeI(&(adcp)->thread, MSG_RESET)
 Resumes a thread waiting for a conversion completion. More...
 
#define _adc_reset_s(adcp)   osalThreadResumeS(&(adcp)->thread, MSG_RESET)
 Resumes a thread waiting for a conversion completion. More...
 
#define _adc_wakeup_isr(adcp)
 Wakes up the waiting thread. More...
 
#define _adc_timeout_isr(adcp)
 Wakes up the waiting thread with a timeout message. More...
 
#define _adc_isr_half_code(adcp)
 Common ISR code, half buffer event. More...
 
#define _adc_isr_full_code(adcp)
 Common ISR code, full buffer event. More...
 
#define _adc_isr_error_code(adcp, err)
 Common ISR code, error event. More...
 

Typedefs

typedef struct hal_adc_driver ADCDriver
 Type of a structure representing an ADC driver. More...
 
typedef struct hal_adc_config ADCConfig
 Type of a structure representing an ADC driver configuration. More...
 
typedef struct hal_adc_configuration_group ADCConversionGroup
 Conversion group configuration structure. More...
 
typedef void(* adccallback_t) (ADCDriver *adcp)
 Type of an ADC notification callback. More...
 
typedef void(* adcerrorcallback_t) (ADCDriver *adcp, adcerror_t err)
 Type of an ADC error callback. More...
 

Enumerations

Functions

void adcInit (void)
 ADC Driver initialization. More...
 
void adcObjectInit (ADCDriver *adcp)
 Initializes the standard part of a ADCDriver structure. More...
 
void adcStart (ADCDriver *adcp, const ADCConfig *config)
 Configures and activates the ADC peripheral. More...
 
void adcStop (ADCDriver *adcp)
 Deactivates the ADC peripheral. More...
 
void adcStartConversion (ADCDriver *adcp, const ADCConversionGroup *grpp, adcsample_t *samples, size_t depth)
 Starts an ADC conversion. More...
 
void adcStartConversionI (ADCDriver *adcp, const ADCConversionGroup *grpp, adcsample_t *samples, size_t depth)
 Starts an ADC conversion. More...
 
void adcStopConversion (ADCDriver *adcp)
 Stops an ongoing conversion. More...
 
void adcStopConversionI (ADCDriver *adcp)
 Stops an ongoing conversion. More...
 
msg_t adcConvert (ADCDriver *adcp, const ADCConversionGroup *grpp, adcsample_t *samples, size_t depth)
 Performs an ADC conversion. More...
 
void adcAcquireBus (ADCDriver *adcp)
 Gains exclusive access to the ADC peripheral. More...
 
void adcReleaseBus (ADCDriver *adcp)
 Releases exclusive access to the ADC peripheral. More...
 

Detailed Description

ADC Driver macros and structures.

Definition in file hal_adc.h.