ADC: replace ioctl with uorb message (#14087)

This commit is contained in:
SalimTerryLi
2020-03-20 11:23:32 +01:00
committed by GitHub
parent 40af5b0fbe
commit dc8e775d8f
30 changed files with 345 additions and 486 deletions
+4 -2
View File
@@ -42,6 +42,8 @@
#include <stdint.h>
#include <sys/ioctl.h>
#include <systemlib/px4_macros.h>
#include <uORB/topics/adc_report.h>
/* Define the PX4 low level format ADC and the maximum
* number of channels that can be returned by a lowlevel
@@ -49,14 +51,14 @@
* but no more than PX4_MAX_ADC_CHANNELS.
*
*/
#define PX4_MAX_ADC_CHANNELS 12
#define PX4_MAX_ADC_CHANNELS arraySize(adc_report_s::channel_id)
typedef struct __attribute__((packed)) px4_adc_msg_t {
uint8_t am_channel; /* The 8-bit ADC Channel */
int32_t am_data; /* ADC convert result (4 bytes) */
} px4_adc_msg_t;
#define ADC0_DEVICE_PATH "/dev/adc0"
#define BUILTIN_ADC_DEVID 0xffffffff // TODO: integrate into existing ID management
__BEGIN_DECLS