bl602_sdk/
i2c.rs

1/* automatically generated by rust-bindgen 0.58.1 */
2
3use
4super::*;
5
6pub const I2C_M_READ: u32 = 1;
7pub const I2C_M_WRITE: u32 = 0;
8pub const I2C_M_BLOCK: u32 = 0;
9pub const I2C_M_NO_BLOCK: u32 = 1;
10pub type __uint8_t = ::cty::c_uchar;
11pub type __uint16_t = ::cty::c_ushort;
12pub type __uint32_t = ::cty::c_uint;
13#[repr(C)]
14#[derive(Copy, Clone)]
15pub struct i2c_msg {
16    pub addr: u16,
17    pub direct: u8,
18    pub subflag: u8,
19    pub subaddr: u32,
20    pub sublen: u8,
21    pub len: u32,
22    pub buf: *mut u8,
23    pub event: ::cty::c_int,
24    pub idex: ::cty::c_int,
25    pub block: ::cty::c_int,
26    pub stop: ::cty::c_int,
27    pub ins_num: ::cty::c_int,
28    pub i2cx: ::cty::c_int,
29}
30impl Default for i2c_msg {
31    fn default() -> Self {
32        unsafe { ::core::mem::zeroed() }
33    }
34}
35pub type i2c_msg_t = i2c_msg;
36#[safe_wrap(_)] extern "C" {
37    pub fn i2c_set_freq(freq: ::cty::c_int, i2cx: ::cty::c_int);
38}
39#[safe_wrap(_)] extern "C" {
40    pub fn i2c_gpio_init(i2cx: ::cty::c_int);
41}
42#[safe_wrap(_)] extern "C" {
43    pub fn i2c_clear_status(i2cx: ::cty::c_int);
44}
45#[safe_wrap(_)] extern "C" {
46    pub fn i2c_transfer_start(pstmsg: *mut i2c_msg_t);
47}