mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-05 16:26:06 +08:00
33d5cfc393
date: 2025-12-18T23:23:16 master commit: 3cdee7b54718ee14bd85befd6c5bad3d699c5479
21 lines
483 B
C
21 lines
483 B
C
#pragma once
|
|
|
|
typedef enum {
|
|
SAMPLETIME_3_CYCLES = 0,
|
|
SAMPLETIME_15_CYCLES = 1,
|
|
SAMPLETIME_28_CYCLES = 2,
|
|
SAMPLETIME_56_CYCLES = 3,
|
|
SAMPLETIME_84_CYCLES = 4,
|
|
SAMPLETIME_112_CYCLES = 5,
|
|
SAMPLETIME_144_CYCLES = 6,
|
|
SAMPLETIME_480_CYCLES = 7
|
|
} adc_sample_time_t;
|
|
|
|
typedef struct {
|
|
ADC_TypeDef *adc;
|
|
uint8_t channel;
|
|
adc_sample_time_t sample_time;
|
|
} adc_signal_t;
|
|
|
|
#define ADC_CHANNEL_DEFAULT(a, c) {.adc = (a), .channel = (c), .sample_time = SAMPLETIME_480_CYCLES}
|