Print AT responses to screen
This commit is contained in:
parent
f5e2775a04
commit
d03b00e3f0
70
src/main.rs
70
src/main.rs
@ -103,26 +103,10 @@ fn main() -> ! {
|
|||||||
});
|
});
|
||||||
display.set_tearing(display::TearingMode::Off);
|
display.set_tearing(display::TearingMode::Off);
|
||||||
|
|
||||||
display.draw_rect(
|
|
||||||
Position::new(0, 0),
|
|
||||||
Position::new(32, 32),
|
|
||||||
Rgb565::yellow().as_color(),
|
|
||||||
);
|
|
||||||
|
|
||||||
let font_renderer = FontRenderer::create(30);
|
let font_renderer = FontRenderer::create(30);
|
||||||
|
|
||||||
font_renderer.render(
|
let sim_rst = Output::new(peripherals.GPIO27, Level::High, OutputConfig::default());
|
||||||
&mut display,
|
let sim_pwr_key = Output::new(peripherals.GPIO12, Level::High, OutputConfig::default());
|
||||||
"Hello\nWorld!",
|
|
||||||
Position::new(0, 0),
|
|
||||||
HorizontalAlignment::LeftToRight,
|
|
||||||
VerticalAlignment::TopToBottom,
|
|
||||||
Rgb565::black(),
|
|
||||||
Rgb565::white(),
|
|
||||||
);
|
|
||||||
|
|
||||||
let sim_rst = Output::new(peripherals.GPIO15, Level::High, OutputConfig::default());
|
|
||||||
let sim_pwr_key = Output::new(peripherals.GPIO33, Level::High, OutputConfig::default());
|
|
||||||
|
|
||||||
let uart = Uart::new(
|
let uart = Uart::new(
|
||||||
peripherals.UART2,
|
peripherals.UART2,
|
||||||
@ -143,20 +127,44 @@ fn main() -> ! {
|
|||||||
delay: Delay::new(),
|
delay: Delay::new(),
|
||||||
};
|
};
|
||||||
|
|
||||||
// at_commands.init();
|
font_renderer.render(
|
||||||
// log::info!("{}", at_commands.raw_command("ATI".to_owned()));
|
&mut display,
|
||||||
// log::info!("{}", at_commands.raw_command("AT+CMGF?".to_owned()));
|
"Hello\nWorld!",
|
||||||
// log::info!("{}", at_commands.raw_command("AT+CPIN=1234".to_owned()));
|
Position::new(0, 0),
|
||||||
// log::info!("{}", at_commands.raw_command("AT+CPIN?".to_owned()));
|
HorizontalAlignment::LeftToRight,
|
||||||
// log::info!("{}", at_commands.raw_command("AT+CMGF=1".to_owned()));
|
VerticalAlignment::TopToBottom,
|
||||||
// log::info!("{}", at_commands.raw_command("AT+CSCS=?".to_owned()));
|
Rgb565::black(),
|
||||||
|
Rgb565::white(),
|
||||||
|
);
|
||||||
|
|
||||||
// log::info!(
|
let mut render_response = |response: alloc::string::String| {
|
||||||
// "{}",
|
log::info!("Rendering: {}", response);
|
||||||
// at_commands.raw_two_part_command(
|
display.draw_rect(
|
||||||
// "AT+CMGS=\"number\"".to_owned(),
|
Position::new(0, 0),
|
||||||
// "hello".to_owned()
|
Position::new(240, 240),
|
||||||
// )
|
Rgb565::black().as_color(),
|
||||||
|
);
|
||||||
|
|
||||||
|
font_renderer.render(
|
||||||
|
&mut display,
|
||||||
|
response,
|
||||||
|
Position::new(0, 0),
|
||||||
|
HorizontalAlignment::LeftToRight,
|
||||||
|
VerticalAlignment::TopToBottom,
|
||||||
|
Rgb565::black(),
|
||||||
|
Rgb565::white(),
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
at_commands.init();
|
||||||
|
render_response(at_commands.raw_command("ATI".to_owned()));
|
||||||
|
render_response(at_commands.raw_command("AT+CMGF?".to_owned()));
|
||||||
|
render_response(at_commands.raw_command("AT+CPIN=1234".to_owned()));
|
||||||
|
render_response(at_commands.raw_command("AT+CPIN?".to_owned()));
|
||||||
|
render_response(at_commands.raw_command("AT+CMGF=1".to_owned()));
|
||||||
|
render_response(at_commands.raw_command("AT+CSCS=?".to_owned()));
|
||||||
|
// render_response(
|
||||||
|
// at_commands.raw_two_part_command("AT+CMGS=\"number\"".to_owned(), "hello".to_owned()),
|
||||||
// );
|
// );
|
||||||
|
|
||||||
let pull_down_cfg = InputConfig::default().with_pull(esp_hal::gpio::Pull::None);
|
let pull_down_cfg = InputConfig::default().with_pull(esp_hal::gpio::Pull::None);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user