1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
use
super::*;
pub const ADC_DMA_CHANNEL: u32 = 1;
pub const ADC_CHANNEL_MAX: u32 = 12;
pub type __int32_t = ::cty::c_int;
pub type __uint32_t = ::cty::c_uint;
pub type bl_adc_cb_t = ::core::option::Option<
unsafe extern "C" fn(mode: ::cty::c_int, data_ptr: *mut u32, data_size: u32),
>;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct adc_ctx {
pub mode: ::cty::c_int,
pub channel_data: *mut u32,
pub adc_lli: *mut ::cty::c_void,
pub lli_flag: ::cty::c_int,
pub chan_init_table: u32,
pub data_size: u32,
pub cb: bl_adc_cb_t,
}
impl Default for adc_ctx {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
pub type adc_ctx_t = adc_ctx;
#[safe_wrap(_)] extern "C" {
pub fn bl_adc_init(mode: ::cty::c_int, gpio_num: ::cty::c_int) -> ::cty::c_int;
}
#[safe_wrap(_)] extern "C" {
pub fn bl_adc_dma_init(mode: ::cty::c_int, data_num: u32) -> ::cty::c_int;
}
#[safe_wrap(_)] extern "C" {
pub fn bl_adc_start() -> ::cty::c_int;
}
#[safe_wrap(_)] extern "C" {
pub fn bl_adc_gpio_init(gpio_num: ::cty::c_int) -> ::cty::c_int;
}
#[safe_wrap(_)] extern "C" {
pub fn bl_adc_get_channel_by_gpio(gpio_num: ::cty::c_int) -> ::cty::c_int;
}
#[safe_wrap(_)] extern "C" {
pub fn bl_adc_freq_init(mode: ::cty::c_int, freq: u32) -> ::cty::c_int;
}
#[safe_wrap(_)] extern "C" {
pub fn bl_adc_parse_data(
parr: *mut u32,
data_size: ::cty::c_int,
channel: ::cty::c_int,
raw_flag: ::cty::c_int,
) -> i32;
}