@@ -126,7 +126,6 @@ use crate::mode::BasicMode;
126
126
use brightness:: Brightness ;
127
127
use command:: { AddrMode , Command , VcomhLevel } ;
128
128
use display_interface:: { DataFormat :: U8 , DisplayError , WriteOnlyDataCommand } ;
129
- use display_interface_spi:: { SPIInterface , SPIInterfaceNoCS } ;
130
129
use embedded_hal:: { blocking:: delay:: DelayMs , digital:: v2:: OutputPin } ;
131
130
use error:: Error ;
132
131
use mode:: { BufferedGraphicsMode , TerminalMode } ;
@@ -412,7 +411,7 @@ where
412
411
}
413
412
414
413
// SPI-only reset
415
- impl < SPI , DC , SIZE , MODE > Ssd1306 < SPIInterfaceNoCS < SPI , DC > , SIZE , MODE > {
414
+ impl < DI , SIZE , MODE > Ssd1306 < DI , SIZE , MODE > {
416
415
/// Reset the display.
417
416
pub fn reset < RST , DELAY > (
418
417
& mut self ,
@@ -423,34 +422,18 @@ impl<SPI, DC, SIZE, MODE> Ssd1306<SPIInterfaceNoCS<SPI, DC>, SIZE, MODE> {
423
422
RST : OutputPin ,
424
423
DELAY : DelayMs < u8 > ,
425
424
{
426
- inner_reset ( rst, delay) . map_err ( Error :: Pin )
427
- }
428
- }
425
+ fn inner_reset < RST , DELAY > ( rst : & mut RST , delay : & mut DELAY ) -> Result < ( ) , RST :: Error >
426
+ where
427
+ RST : OutputPin ,
428
+ DELAY : DelayMs < u8 > ,
429
+ {
430
+ rst. set_high ( ) ?;
431
+ delay. delay_ms ( 1 ) ;
432
+ rst. set_low ( ) ?;
433
+ delay. delay_ms ( 10 ) ;
434
+ rst. set_high ( )
435
+ }
429
436
430
- // SPI-only reset
431
- impl < SPI , DC , CS , SIZE , MODE > Ssd1306 < SPIInterface < SPI , DC , CS > , SIZE , MODE > {
432
- /// Reset the display.
433
- pub fn reset < RST , DELAY > (
434
- & mut self ,
435
- rst : & mut RST ,
436
- delay : & mut DELAY ,
437
- ) -> Result < ( ) , Error < Infallible , RST :: Error > >
438
- where
439
- RST : OutputPin ,
440
- DELAY : DelayMs < u8 > ,
441
- {
442
437
inner_reset ( rst, delay) . map_err ( Error :: Pin )
443
438
}
444
439
}
445
-
446
- fn inner_reset < RST , DELAY > ( rst : & mut RST , delay : & mut DELAY ) -> Result < ( ) , RST :: Error >
447
- where
448
- RST : OutputPin ,
449
- DELAY : DelayMs < u8 > ,
450
- {
451
- rst. set_high ( ) ?;
452
- delay. delay_ms ( 1 ) ;
453
- rst. set_low ( ) ?;
454
- delay. delay_ms ( 10 ) ;
455
- rst. set_high ( )
456
- }
0 commit comments