Krolyxon
Commit ab699e4

Branches

Tags

Refs →

orion-rfab699e4

add display module stubs

Author
krolyxon
Date
2026-06-20 00:47 +0530
Parent
7e4cfad
Commit
ab699e4c1387aee7bfdd116d35eb1b9289fc0a71

+66 −1

7 files changed

  1. M Cargo.toml +3 −0
  2. A src/board/mod.rs +1 −0
  3. A src/board/pins.rs +31 −0
  4. A src/drivers/buttons.rs +0 −0
  5. A src/drivers/display.rs +18 −0
  6. A src/drivers/mod.rs +1 −0
  7. M src/main.rs +12 −1
M Cargo.toml View
@@ -23,5 +23,8 @@ esp-idf-svc = { version = "0.52.1", features = ["critical-section", "embassy-tim
2323 # Remove `generic-queue-8` if you plan to use `embassy-time` WITH `embassy-executor`
2424 embassy-time = { version = "0.5", features = ["generic-queue-8"] }
2525
26+embedded-graphics = "0.8.2"
27+ssd1306 = "0.10.0"
28+
2629 [build-dependencies]
2730 embuild = "0.33"
A src/board/mod.rs View
@@ -0,0 +1 @@
1+pub mod pins;
A src/board/pins.rs View
@@ -0,0 +1,31 @@
1+// OLED
2+pub const OLED_SDA_PIN: i32 = 8;
3+pub const OLED_SCL_PIN: i32 = 9;
4+
5+// NRF24
6+pub const CE1_PIN: i32 = 10;
7+pub const CSN1_PIN: i32 = 11;
8+
9+pub const CE2_PIN: i32 = 12;
10+pub const CSN2_PIN: i32 = 13;
11+
12+pub const NRF_SCK: i32 = 18;
13+pub const NRF_MISO: i32 = 16;
14+pub const NRF_MOSI: i32 = 17;
15+
16+// CC1101 FSPI
17+pub const CC1101_SCK: i32 = 15;
18+pub const CC1101_MISO: i32 = 41;
19+pub const CC1101_MOSI: i32 = 35;
20+
21+pub const CC1101_CS: i32 = 40;
22+pub const CC1101_GDO0: i32 = 39;
23+pub const CC1101_GDO2: i32 = 42;
24+
25+// Buttons
26+pub const BTN_UP: i32 = 4;
27+pub const BTN_DOWN: i32 = 5;
28+pub const BTN_SELECT: i32 = 6;
29+pub const BTN_BACK: i32 = 7;
30+pub const BTN_RIGHT: i32 = 1;
31+pub const BTN_LEFT: i32 = 2;
A src/drivers/buttons.rs View

[No content changes]

A src/drivers/display.rs View
@@ -0,0 +1,18 @@
1+use crate::board::pins::*;
2+
3+pub struct Display {
4+}
5+
6+impl Display {
7+ pub fn new() -> Self {
8+ Self {}
9+ }
10+
11+ pub fn init(&mut self) {
12+ log::info!("display Initialized!!");
13+ }
14+
15+ pub fn draw_text(&mut self, text: &str) {
16+ log::info!("{}", text);
17+ }
18+}
A src/drivers/mod.rs View
@@ -0,0 +1 @@
1+pub mod display;
M src/main.rs View
@@ -1,3 +1,9 @@
1+
2+mod board;
3+mod drivers;
4+
5+use drivers::display::Display;
6+
17 fn main() {
28 // It is necessary to call this function once. Otherwise, some patches to the runtime
39 // implemented by esp-idf-sys might not link properly. See https://github.com/esp-rs/esp-idf-template/issues/71
@@ -6,5 +12,10 @@ fn main() {
612 // Bind the log crate to the ESP Logging facilities
713 esp_idf_svc::log::EspLogger::initialize_default();
814
9− log::info!("Hello, world!");
15+ log::info!("ORION-RF Booted!!");
16+ let mut display = Display::new();
17+
18+ display.init();
19+ display.draw_text("ORION-RF");
20+
1021 }