mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-12 02:31:36 +08:00
ADC: replace ioctl with uorb message (#14087)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user