1- use adv_shift_registers:: wrappers:: { ShifterPin , ShifterValue } ;
21use alloc:: { rc:: Rc , string:: ToString } ;
32use embassy_sync:: { blocking_mutex:: raw:: NoopRawMutex , signal:: Signal } ;
43use embassy_time:: { Delay , Duration , Instant , Timer } ;
5- use embedded_hal:: digital:: OutputPin ;
6- use esp_hal:: { i2c:: master:: I2c , Async , Blocking } ;
74use hd44780_driver:: {
8- bus:: { FourBitBus , FourBitBusPins , I2CBus } ,
95 charset:: { CharsetA02 , CharsetWithFallback } ,
106 memory_map:: { MemoryMap1602 , StandardMemoryMap } ,
11- setup:: { DisplayOptions4Bit , DisplayOptionsI2C } ,
127 DisplayMode , HD44780 ,
138} ;
149
@@ -21,11 +16,14 @@ use crate::{
2116 } ,
2217} ;
2318
19+ #[ cfg( feature = "esp32c3" ) ]
20+ use embedded_hal:: digital:: OutputPin ;
21+
2422#[ embassy_executor:: task]
2523pub async fn lcd_task (
26- #[ cfg( feature = "esp32" ) ] i2c : I2c < ' static , Blocking > ,
24+ #[ cfg( feature = "esp32" ) ] i2c : esp_hal :: i2c :: master :: I2c < ' static , esp_hal :: Blocking > ,
2725
28- #[ cfg( feature = "esp32c3" ) ] lcd_shifter : ShifterValue ,
26+ #[ cfg( feature = "esp32c3" ) ] lcd_shifter : adv_shift_registers :: wrappers :: ShifterValue ,
2927
3028 global_state : GlobalState ,
3129 wifi_setup_sig : Rc < Signal < NoopRawMutex , ( ) > > ,
@@ -42,8 +40,8 @@ pub async fn lcd_task(
4240 let d6_pin = lcd_shifter. get_pin_mut ( 5 , false ) ;
4341 let d7_pin = lcd_shifter. get_pin_mut ( 4 , false ) ;
4442
45- DisplayOptions4Bit :: new ( MemoryMap1602 :: new ( ) )
46- . with_pins ( FourBitBusPins {
43+ hd44780_driver :: setup :: DisplayOptions4Bit :: new ( MemoryMap1602 :: new ( ) )
44+ . with_pins ( hd44780_driver :: bus :: FourBitBusPins {
4745 rs : reg_sel_pin,
4846 en : e_pin,
4947 d4 : d4_pin,
@@ -56,7 +54,7 @@ pub async fn lcd_task(
5654
5755 #[ cfg( feature = "esp32" ) ]
5856 let mut options = {
59- DisplayOptionsI2C :: new ( MemoryMap1602 :: new ( ) )
57+ hd44780_driver :: setup :: DisplayOptionsI2C :: new ( MemoryMap1602 :: new ( ) )
6058 . with_i2c_bus ( i2c, 0x27 )
6159 . with_charset ( CharsetA02 :: QUESTION_FALLBACK )
6260 } ;
@@ -167,11 +165,22 @@ pub async fn lcd_task(
167165}
168166
169167#[ cfg( feature = "esp32" ) ]
170- type LcdType < C > = HD44780 < I2CBus < I2c < ' static , Blocking > > , StandardMemoryMap < 16 , 2 > , C > ;
168+ type LcdType < C > = HD44780 <
169+ hd44780_driver:: bus:: I2CBus < esp_hal:: i2c:: master:: I2c < ' static , esp_hal:: Blocking > > ,
170+ StandardMemoryMap < 16 , 2 > ,
171+ C ,
172+ > ;
171173
172174#[ cfg( feature = "esp32c3" ) ]
173175type LcdType < C > = HD44780 <
174- FourBitBus < ShifterPin , ShifterPin , ShifterPin , ShifterPin , ShifterPin , ShifterPin > ,
176+ hd44780_driver:: bus:: FourBitBus <
177+ adv_shift_registers:: wrappers:: ShifterPin ,
178+ adv_shift_registers:: wrappers:: ShifterPin ,
179+ adv_shift_registers:: wrappers:: ShifterPin ,
180+ adv_shift_registers:: wrappers:: ShifterPin ,
181+ adv_shift_registers:: wrappers:: ShifterPin ,
182+ adv_shift_registers:: wrappers:: ShifterPin ,
183+ > ,
175184 StandardMemoryMap < 16 , 2 > ,
176185 C ,
177186> ;
0 commit comments