@@ -164,7 +164,7 @@ where
164164 #[ cfg( not( target_os = "none" ) ) ]
165165 #[ cfg( feature = "std" ) ]
166166 fn print_details ( & mut self ) -> Result < ( ) , Self :: DetailsErrorType > {
167- use crate :: radio:: rf24:: Config ;
167+ use crate :: radio:: rf24:: ConfigReg ;
168168
169169 std:: println!( "Is a plus variant_________{}" , self . is_plus_variant( ) ) ;
170170
@@ -178,7 +178,7 @@ where
178178 std:: println!( "RF Power Amplifier________{}" , self . get_pa_level( ) ?) ;
179179
180180 self . spi_read ( 1 , registers:: RF_SETUP ) ?;
181- let rf_setup = self . _buf [ 1 ] ;
181+ let rf_setup = self . buf [ 1 ] ;
182182 std:: println!( "RF LNA enabled____________{}" , rf_setup & 1 > 0 ) ;
183183
184184 std:: println!( "CRC Length________________{}" , self . get_crc_length( ) ?) ;
@@ -194,70 +194,70 @@ where
194194 ) ;
195195
196196 self . spi_read ( 1 , registers:: SETUP_RETR ) ?;
197- let retry_setup = self . _buf [ 1 ] ;
197+ let retry_setup = self . buf [ 1 ] ;
198198 std:: println!(
199199 "Auto retry delay__________{} microseconds" ,
200200 ( retry_setup >> 4 ) as u16 * 250 + 250
201201 ) ;
202202 std:: println!( "Auto retry attempts_______{} maximum" , retry_setup & 0x0F ) ;
203203
204204 self . spi_read ( 1 , registers:: FIFO_STATUS ) ?;
205- std:: println!( "Re-use TX FIFO____________{}" , ( self . _buf [ 1 ] & 0x80 ) > 0 ) ;
205+ std:: println!( "Re-use TX FIFO____________{}" , ( self . buf [ 1 ] & 0x80 ) > 0 ) ;
206206
207207 self . spi_read ( 1 , registers:: OBSERVE_TX ) ?;
208- let observer = self . _buf [ 1 ] ;
208+ let observer = self . buf [ 1 ] ;
209209 std:: println!( "Packets lost\n on current channel____{}" , observer >> 4 ) ;
210210 std:: println!(
211211 "Retry attempts made\n for last transmission_{}" ,
212212 observer & 0xF
213213 ) ;
214214
215215 self . spi_read ( 1 , registers:: CONFIG ) ?;
216- self . _config_reg = Config :: from_bits ( self . _buf [ 1 ] ) ;
217- std:: println!( "IRQ on Data Ready_________{}" , self . _config_reg . rx_dr( ) ) ;
218- std:: println!( " Data Ready triggered__{}" , self . _status . rx_dr( ) ) ;
219- std:: println!( "IRQ on Data Sent__________{}" , self . _config_reg . tx_ds( ) ) ;
220- std:: println!( " Data Sent triggered___{}" , self . _status . tx_ds( ) ) ;
221- std:: println!( "IRQ on Data Fail__________{}" , self . _config_reg . tx_df( ) ) ;
222- std:: println!( " Data Fail triggered___{}" , self . _status . tx_df( ) ) ;
216+ self . config_reg = ConfigReg :: from_bits ( self . buf [ 1 ] ) ;
217+ std:: println!( "IRQ on Data Ready_________{}" , self . config_reg . rx_dr( ) ) ;
218+ std:: println!( " Data Ready triggered__{}" , self . status . rx_dr( ) ) ;
219+ std:: println!( "IRQ on Data Sent__________{}" , self . config_reg . tx_ds( ) ) ;
220+ std:: println!( " Data Sent triggered___{}" , self . status . tx_ds( ) ) ;
221+ std:: println!( "IRQ on Data Fail__________{}" , self . config_reg . tx_df( ) ) ;
222+ std:: println!( " Data Fail triggered___{}" , self . status . tx_df( ) ) ;
223223
224224 let fifo = self . get_fifo_state ( true ) ?;
225225 std:: println!( "TX FIFO___________________{}" , fifo) ;
226226 let fifo = self . get_fifo_state ( false ) ?;
227227 std:: println!( "RX FIFO___________________{}" , fifo) ;
228228
229229 self . spi_read ( 1 , registers:: FEATURE ) ?;
230- let features = self . _buf [ 1 ] ;
230+ let features = self . buf [ 1 ] ;
231231 std:: println!( "Ask no ACK allowed________{}" , features & 1 > 0 ) ;
232232 std:: println!( "ACK Payload enabled_______{}" , features & 2 > 0 ) ;
233233
234234 self . spi_read ( 1 , registers:: DYNPD ) ?;
235- std:: println!( "Dynamic Payloads__________{:#010b}" , self . _buf [ 1 ] ) ;
235+ std:: println!( "Dynamic Payloads__________{:#010b}" , self . buf [ 1 ] ) ;
236236
237237 self . spi_read ( 1 , registers:: EN_AA ) ?;
238- std:: println!( "Auto Acknowledgment_______{:#010b}" , self . _buf [ 1 ] ) ;
238+ std:: println!( "Auto Acknowledgment_______{:#010b}" , self . buf [ 1 ] ) ;
239239
240240 std:: println!(
241241 "Primary Mode______________{}X" ,
242- if self . _config_reg . is_rx( ) { "R" } else { "T" }
242+ if self . config_reg . is_rx( ) { "R" } else { "T" }
243243 ) ;
244244 std:: println!( "Powered Up________________{}" , self . is_powered( ) ) ;
245245
246246 // print pipe addresses
247247 self . spi_read ( 5 , registers:: TX_ADDR ) ?;
248248 let mut address = [ 0u8 ; 4 ] ;
249- address. copy_from_slice ( & self . _buf [ 2 ..6 ] ) ;
249+ address. copy_from_slice ( & self . buf [ 2 ..6 ] ) ;
250250 std:: println!(
251251 "TX address_______________{:#08X}{:02X}" ,
252252 u32 :: from_le_bytes( address) ,
253- self . _buf [ 1 ]
253+ self . buf [ 1 ]
254254 ) ;
255255 self . spi_read ( 1 , registers:: EN_RXADDR ) ?;
256- let open_pipes = self . _buf [ 1 ] ;
256+ let open_pipes = self . buf [ 1 ] ;
257257 for pipe in 0 ..=5 {
258258 self . spi_read ( if pipe < 2 { 5 } else { 1 } , registers:: RX_ADDR_P0 + pipe) ?;
259259 if pipe < 2 {
260- address. copy_from_slice ( & self . _buf [ 2 ..6 ] ) ;
260+ address. copy_from_slice ( & self . buf [ 2 ..6 ] ) ;
261261 }
262262 std:: println!(
263263 "Pipe {pipe} ({}) bound to {:#08X}{:02X}" ,
@@ -268,7 +268,7 @@ where
268268 } ,
269269 // reverse the bytes read to represent how memory is stored
270270 u32 :: from_le_bytes( address) ,
271- self . _buf [ 1 ] ,
271+ self . buf [ 1 ] ,
272272 ) ;
273273 }
274274 Ok ( ( ) )
0 commit comments