Hide {spi,rx,tx} except {spi::interfaces,rx::RxPacket,tx::TxPacket}
This commit is contained in:
parent
512fd154bd
commit
272e21c787
10
src/lib.rs
10
src/lib.rs
|
@ -1,6 +1,7 @@
|
||||||
#![no_std]
|
#![no_std]
|
||||||
|
|
||||||
pub mod spi;
|
mod spi;
|
||||||
|
pub use crate::spi::interfaces as SpiInterfaces;
|
||||||
use embedded_hal::{
|
use embedded_hal::{
|
||||||
blocking::{
|
blocking::{
|
||||||
spi::Transfer,
|
spi::Transfer,
|
||||||
|
@ -9,8 +10,11 @@ use embedded_hal::{
|
||||||
digital::v2::OutputPin,
|
digital::v2::OutputPin,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub mod rx;
|
mod rx;
|
||||||
pub mod tx;
|
mod tx;
|
||||||
|
pub use crate::{
|
||||||
|
rx::RxPacket, tx::TxPacket,
|
||||||
|
};
|
||||||
|
|
||||||
#[cfg(feature="smoltcp")]
|
#[cfg(feature="smoltcp")]
|
||||||
pub mod smoltcp_phy;
|
pub mod smoltcp_phy;
|
||||||
|
|
|
@ -14,6 +14,7 @@ pub mod interfaces {
|
||||||
pub const SPI_CLOCK_FREQ: u32 = 14_000_000;
|
pub const SPI_CLOCK_FREQ: u32 = 14_000_000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
pub mod opcodes {
|
pub mod opcodes {
|
||||||
/// 1-byte Instructions
|
/// 1-byte Instructions
|
||||||
pub const SETETHRST: u8 = 0b1100_1010;
|
pub const SETETHRST: u8 = 0b1100_1010;
|
||||||
|
@ -32,6 +33,7 @@ pub mod opcodes {
|
||||||
pub const WGPDATA: u8 = 0b0010_1010; // 8-bit opcode followed by data
|
pub const WGPDATA: u8 = 0b0010_1010; // 8-bit opcode followed by data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
pub mod addrs {
|
pub mod addrs {
|
||||||
/// SPI Register Mapping
|
/// SPI Register Mapping
|
||||||
/// Note: PSP interface use different address mapping
|
/// Note: PSP interface use different address mapping
|
||||||
|
|
Loading…
Reference in New Issue