libftdi1_sys/
lib.rs

1// SPDX-License-Identifier: MIT
2
3//! libftdi1 is a library for working with FTDI chips like FT232BM, FT245BM,
4//! FT2232C, FT2232D, FT245R, FT232H, FT230X. The documentation for it is
5//! available [upstream].
6//!
7//! [upstream]: http://www.intra2net.com/en/developer/libftdi/documentation/
8//!
9//! This wrapper was generated using rust-bindgen.
10#![allow(non_upper_case_globals)]
11#![allow(non_camel_case_types)]
12#![allow(non_snake_case)]
13
14use crate::libusb1_sys::{libusb_context, libusb_device, libusb_device_handle, libusb_transfer};
15
16cfg_if::cfg_if! {
17    if #[cfg(feature = "bindgen")] {
18        include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
19    } else {
20        include!("pregenerated.rs");
21    }
22}
23
24cfg_if::cfg_if! {
25    if #[cfg(feature = "libusb1-sys")] {
26        pub use libusb1_sys;
27    } else {
28        /// Opaque placeholder types for `libusb` types.
29        pub mod libusb1_sys {
30            #[repr(C)]
31            pub struct libusb_transfer {
32                _data: [u8; 0],
33                _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
34            }
35            #[repr(C)]
36            pub struct libusb_context {
37                _data: [u8; 0],
38                _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
39            }
40            #[repr(C)]
41            pub struct libusb_device_handle {
42                _data: [u8; 0],
43                _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
44            }
45            #[repr(C)]
46            pub struct libusb_device {
47                _data: [u8; 0],
48                _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
49            }
50        }
51    }
52}