mirror of https://github.com/ArduPilot/ardupilot
uncrustify libraries/AP_ADC/AP_ADC.h
This commit is contained in:
parent
549950ee2d
commit
2ff3af5e01
|
@ -6,44 +6,45 @@
|
||||||
#include <../AP_PeriodicProcess/AP_PeriodicProcess.h>
|
#include <../AP_PeriodicProcess/AP_PeriodicProcess.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
AP_ADC.cpp - Analog Digital Converter Base Class for Ardupilot Mega
|
* AP_ADC.cpp - Analog Digital Converter Base Class for Ardupilot Mega
|
||||||
Code by James Goppert. DIYDrones.com
|
* Code by James Goppert. DIYDrones.com
|
||||||
|
*
|
||||||
This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
License as published by the Free Software Foundation; either
|
* License as published by the Free Software Foundation; either
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
Methods:
|
* Methods:
|
||||||
Init() : Initialization of ADC. (interrupts etc)
|
* Init() : Initialization of ADC. (interrupts etc)
|
||||||
Ch(ch_num) : Return the ADC channel value
|
* Ch(ch_num) : Return the ADC channel value
|
||||||
Ch6(channel_numbers, result) : Return 6 ADC channel values
|
* Ch6(channel_numbers, result) : Return 6 ADC channel values
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class AP_ADC
|
class AP_ADC
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AP_ADC() {}; // Constructor
|
AP_ADC() {
|
||||||
virtual void Init(AP_PeriodicProcess * scheduler = NULL) = 0;
|
}; // Constructor
|
||||||
|
virtual void Init(AP_PeriodicProcess * scheduler = NULL) = 0;
|
||||||
|
|
||||||
/* read one channel value */
|
/* read one channel value */
|
||||||
virtual float Ch(uint8_t ch_num) = 0;
|
virtual float Ch(uint8_t ch_num) = 0;
|
||||||
|
|
||||||
/* read 6 channels values as a set, used by IMU for 3 gyros
|
/* read 6 channels values as a set, used by IMU for 3 gyros
|
||||||
and 3 accelerometeres.
|
* and 3 accelerometeres.
|
||||||
|
*
|
||||||
|
* Pass in an array of 6 channel numbers and results are
|
||||||
|
* returned in result[]
|
||||||
|
*
|
||||||
|
* The function returns the amount of time (in microseconds)
|
||||||
|
* since the last call to Ch6().
|
||||||
|
*/
|
||||||
|
virtual uint32_t Ch6(const uint8_t *channel_numbers, float *result) = 0;
|
||||||
|
|
||||||
Pass in an array of 6 channel numbers and results are
|
// check if Ch6() can return new data
|
||||||
returned in result[]
|
virtual bool new_data_available(const uint8_t *channel_numbers) = 0;
|
||||||
|
|
||||||
The function returns the amount of time (in microseconds)
|
private:
|
||||||
since the last call to Ch6().
|
|
||||||
*/
|
|
||||||
virtual uint32_t Ch6(const uint8_t *channel_numbers, float *result) = 0;
|
|
||||||
|
|
||||||
// check if Ch6() can return new data
|
|
||||||
virtual bool new_data_available(const uint8_t *channel_numbers) = 0;
|
|
||||||
|
|
||||||
private:
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#include "AP_ADC_ADS7844.h"
|
#include "AP_ADC_ADS7844.h"
|
||||||
|
|
Loading…
Reference in New Issue