@@ -11,6 +11,10 @@ compile_error!("The `ip101` feature can only be built for the `xtensa-esp32-espi
11
11
#[ cfg( all( feature = "kaluga" , not( esp32s2) ) ) ]
12
12
compile_error ! ( "The `kaluga` feature can only be built for the `xtensa-esp32s2-espidf` target." ) ;
13
13
14
+ #[ cfg( all( feature = "aztouchmod" , not( esp32) ) ) ]
15
+ compile_error ! ( "The `aztouchmod` feature can only be built for the `xtensa-esp32-espidf` target." ) ;
16
+
17
+
14
18
#[ cfg( all( feature = "ttgo" , not( esp32) ) ) ]
15
19
compile_error ! ( "The `ttgo` feature can only be built for the `xtensa-esp32-espidf` target." ) ;
16
20
@@ -88,7 +92,7 @@ use embedded_graphics::prelude::*;
88
92
use embedded_graphics:: primitives:: * ;
89
93
use embedded_graphics:: text:: * ;
90
94
91
- use ili9341;
95
+ use ili9341:: { DisplaySize240x320 , Ili9341 , Orientation } ;
92
96
use ssd1306;
93
97
use ssd1306:: mode:: DisplayConfig ;
94
98
use st7789;
@@ -166,6 +170,17 @@ fn main() -> Result<()> {
166
170
pins. gpio26 ,
167
171
) ?;
168
172
173
+ #[ cfg( feature = "aztouchmod" ) ]
174
+ aztouchmod_hello_world (
175
+ pins. gpio15 ,
176
+ pins. gpio4 ,
177
+ pins. gpio22 ,
178
+ peripherals. spi3 ,
179
+ pins. gpio18 ,
180
+ pins. gpio23 ,
181
+ pins. gpio5 ,
182
+ ) ?;
183
+
169
184
#[ cfg( feature = "kaluga" ) ]
170
185
kaluga_hello_world (
171
186
pins. gpio6 ,
@@ -873,6 +888,54 @@ fn kaluga_hello_world(
873
888
}
874
889
}
875
890
891
+ #[ cfg( feature = "aztouchmod" ) ]
892
+ fn aztouchmod_hello_world (
893
+ backlight : gpio:: Gpio15 < gpio:: Unknown > ,
894
+ dc : gpio:: Gpio4 < gpio:: Unknown > ,
895
+ rst : gpio:: Gpio22 < gpio:: Unknown > ,
896
+ spi : spi:: SPI3 ,
897
+ sclk : gpio:: Gpio18 < gpio:: Unknown > ,
898
+ sdo : gpio:: Gpio23 < gpio:: Unknown > ,
899
+ cs : gpio:: Gpio5 < gpio:: Unknown > ,
900
+ ) -> Result < ( ) > {
901
+ info ! (
902
+ "About to initialize the AZTouchMod ILI9341 SPI LED driver" ,
903
+ ) ;
904
+
905
+ let config = <spi:: config:: Config as Default >:: default ( )
906
+ . baudrate ( 40 . MHz ( ) . into ( ) ) ;
907
+
908
+ let mut backlight = backlight. into_output ( ) ?;
909
+ backlight. set_low ( ) ?;
910
+
911
+ let di = SPIInterfaceNoCS :: new (
912
+ spi:: Master :: < spi:: SPI3 , _ , _ , _ , _ > :: new (
913
+ spi,
914
+ spi:: Pins {
915
+ sclk,
916
+ sdo,
917
+ sdi : Option :: < gpio:: Gpio19 < gpio:: Unknown > > :: None ,
918
+ cs : Some ( cs) ,
919
+ } ,
920
+ config,
921
+ ) ?,
922
+ dc. into_output ( ) ?,
923
+ ) ;
924
+
925
+ let reset = rst. into_output ( ) ?;
926
+
927
+ let mut display = ili9341:: Ili9341 :: new (
928
+ di,
929
+ reset,
930
+ & mut delay:: Ets ,
931
+ Orientation :: LandscapeFlipped ,
932
+ ili9341:: DisplaySize240x320 ,
933
+ )
934
+ . map_err ( |e| anyhow:: anyhow!( "Display error: {:?}" , e) ) ?;
935
+
936
+ led_draw ( & mut display) . map_err ( |e| anyhow:: anyhow!( "Display error: {:?}" , e) )
937
+ }
938
+
876
939
#[ cfg( feature = "heltec" ) ]
877
940
fn heltec_hello_world (
878
941
rst : gpio:: Gpio16 < gpio:: Unknown > ,
0 commit comments