11pub mod operation;
22
33use super :: * ;
4+ use spi:: * ;
45
56use embedded_hal:: blocking:: delay:: DelayMs ;
67
@@ -10,14 +11,14 @@ pub const MAX_NINA_PARAM_LENGTH: usize = 255;
1011
1112#[ repr( u8 ) ]
1213#[ derive( Copy , Clone , Debug ) ]
13- pub enum NinaCommand {
14+ pub ( crate ) enum NinaCommand {
1415 GetFwVersion = 0x37u8 ,
1516 SetPassphrase = 0x11u8 ,
1617 GetConnStatus = 0x20u8 ,
1718 Disconnect = 0x30u8 ,
1819}
1920
20- pub trait NinaParam {
21+ pub ( crate ) trait NinaParam {
2122 // Length of parameter in bytes
2223 type LengthAsBytes : IntoIterator < Item = u8 > ;
2324
@@ -33,7 +34,7 @@ pub trait NinaParam {
3334}
3435
3536// Used for Nina protocol commands with no parameters
36- pub struct NinaNoParams {
37+ pub ( crate ) struct NinaNoParams {
3738 _placeholder : u8 ,
3839}
3940
@@ -62,25 +63,25 @@ impl NinaParam for NinaNoParams {
6263}
6364
6465// Used for single byte params
65- pub struct NinaByteParam {
66+ pub ( crate ) struct NinaByteParam {
6667 length : u8 ,
6768 data : Vec < u8 , 1 > ,
6869}
6970
7071// Used for 2-byte params
71- pub struct NinaWordParam {
72+ pub ( crate ) struct NinaWordParam {
7273 length : u8 ,
7374 data : Vec < u8 , 2 > ,
7475}
7576
7677// Used for params that are smaller than 255 bytes
77- pub struct NinaSmallArrayParam {
78+ pub ( crate ) struct NinaSmallArrayParam {
7879 length : u8 ,
7980 data : Vec < u8 , MAX_NINA_PARAM_LENGTH > ,
8081}
8182
8283// Used for params that can be larger than 255 bytes up to MAX_NINA_PARAM_LENGTH
83- pub struct NinaLargeArrayParam {
84+ pub ( crate ) struct NinaLargeArrayParam {
8485 length : u16 ,
8586 data : Vec < u8 , MAX_NINA_PARAM_LENGTH > ,
8687}
@@ -220,7 +221,7 @@ impl NinaParam for NinaLargeArrayParam {
220221 }
221222}
222223
223- pub trait ProtocolInterface {
224+ pub ( crate ) trait ProtocolInterface {
224225 fn init ( & mut self ) ;
225226 fn reset < D : DelayMs < u16 > > ( & mut self , delay : & mut D ) ;
226227 fn get_fw_version ( & mut self ) -> Result < FirmwareVersion , self :: Error > ;
@@ -230,7 +231,7 @@ pub trait ProtocolInterface {
230231}
231232
232233#[ derive( Debug , Default ) ]
233- pub struct NinaProtocolHandler < B , C > {
234+ pub ( crate ) struct NinaProtocolHandler < B , C > {
234235 /// A Spi or I2c instance
235236 pub bus : B ,
236237 /// An EspControlPins instance
0 commit comments