Hide {spi,rx,tx} except {spi::interfaces,rx::RxPacket,tx::TxPacket}

fix-visibility
Harry Ho 2021-06-04 10:19:59 +08:00
parent 512fd154bd
commit 272e21c787
2 changed files with 9 additions and 3 deletions

View File

@ -1,6 +1,7 @@
#![no_std]
pub mod spi;
mod spi;
pub use crate::spi::interfaces as SpiInterfaces;
use embedded_hal::{
blocking::{
spi::Transfer,
@ -9,8 +10,11 @@ use embedded_hal::{
digital::v2::OutputPin,
};
pub mod rx;
pub mod tx;
mod rx;
mod tx;
pub use crate::{
rx::RxPacket, tx::TxPacket,
};
#[cfg(feature="smoltcp")]
pub mod smoltcp_phy;

View File

@ -14,6 +14,7 @@ pub mod interfaces {
pub const SPI_CLOCK_FREQ: u32 = 14_000_000;
}
#[allow(dead_code)]
pub mod opcodes {
/// 1-byte Instructions
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
}
#[allow(dead_code)]
pub mod addrs {
/// SPI Register Mapping
/// Note: PSP interface use different address mapping