ChibiOS/HAL 9.0.0
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.
#define ADC_USE_MUTUAL_EXCLUSION   TRUE
 Enables the adcAcquireBus() and adcReleaseBus() APIs.
Macro Functions
#define adcIsBufferComplete(adcp)
 Buffer state.
Low level driver helper macros
#define _adc_reset_i(adcp)
 Resumes a thread waiting for a conversion completion.
#define _adc_reset_s(adcp)
 Resumes a thread waiting for a conversion completion.
#define _adc_wakeup_isr(adcp)
 Wakes up the waiting thread.
#define _adc_timeout_isr(adcp)
 Wakes up the waiting thread with a timeout message.
#define _adc_isr_half_code(adcp)
 Common ISR code, half buffer event.
#define _adc_isr_full_code(adcp)
 Common ISR code, full buffer event.
#define _adc_isr_error_code(adcp, err)
 Common ISR code, error event.

Typedefs

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

Enumerations

enum  adcstate_t {
  ADC_UNINIT = 0 , ADC_STOP = 1 , ADC_READY = 2 , ADC_ACTIVE = 3 ,
  ADC_COMPLETE = 4 , ADC_ERROR = 5
}
 Driver state machine possible states. More...

Functions

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

Detailed Description

ADC Driver macros and structures.

Definition in file hal_adc.h.