PX4 Firmware
PX4 Autopilot Software http://px4.io
drv_adc.h File Reference

ADC driver interface. More...

#include <stdint.h>
#include <sys/ioctl.h>
Include dependency graph for drv_adc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PX4_MAX_ADC_CHANNELS   12
 
#define ADC0_DEVICE_PATH   "/dev/adc0"
 

Functions

struct __attribute__ ((packed)) px4_adc_msg_t
 
__BEGIN_DECLS int px4_arch_adc_init (uint32_t base_address)
 Initialize ADC hardware. More...
 
void px4_arch_adc_uninit (uint32_t base_address)
 Uninitialize ADC hardware. More...
 
uint32_t px4_arch_adc_sample (uint32_t base_address, unsigned channel)
 Read a sample from the ADC. More...
 
uint32_t px4_arch_adc_temp_sensor_mask (void)
 Get the temperature sensor channel bitmask. More...
 
uint32_t px4_arch_adc_dn_fullcount (void)
 Get the adc digital number full count. More...
 

Variables

 px4_adc_msg_t
 

Detailed Description

ADC driver interface.

Definition in file drv_adc.h.

Macro Definition Documentation

◆ ADC0_DEVICE_PATH

#define ADC0_DEVICE_PATH   "/dev/adc0"

◆ PX4_MAX_ADC_CHANNELS

#define PX4_MAX_ADC_CHANNELS   12

Function Documentation

◆ __attribute__()

struct __attribute__ ( (packed)  )

Definition at line 53 of file drv_adc.h.

◆ px4_arch_adc_dn_fullcount()

uint32_t px4_arch_adc_dn_fullcount ( void  )

Get the adc digital number full count.

Referenced by ADC::update_adc_report(), battery_status::update_parameters(), and ADC::update_system_power().

Here is the caller graph for this function:

◆ px4_arch_adc_init()

__BEGIN_DECLS int px4_arch_adc_init ( uint32_t  base_address)

Initialize ADC hardware.

Parameters
base_addressarchitecture-specific address to specify the ADC
Returns
0 on success, <0 error otherwise

Referenced by ADC::init().

Here is the caller graph for this function:

◆ px4_arch_adc_sample()

uint32_t px4_arch_adc_sample ( uint32_t  base_address,
unsigned  channel 
)

Read a sample from the ADC.

Parameters
base_addressarchitecture-specific address to specify the ADC
channelspecify the channel
Returns
sample, 0xffffffff on error

Referenced by ADC::sample().

Here is the caller graph for this function:

◆ px4_arch_adc_temp_sensor_mask()

uint32_t px4_arch_adc_temp_sensor_mask ( void  )

Get the temperature sensor channel bitmask.

Referenced by ADC::ADC().

Here is the caller graph for this function:

◆ px4_arch_adc_uninit()

void px4_arch_adc_uninit ( uint32_t  base_address)

Uninitialize ADC hardware.

Parameters
base_addressarchitecture-specific address to specify the ADC

Referenced by ADC::~ADC().

Here is the caller graph for this function:

Variable Documentation

◆ px4_adc_msg_t