aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkrolyxon <me@krolyxon.com>2026-06-20 00:47:08 +0530
committerkrolyxon <me@krolyxon.com>2026-06-20 00:47:08 +0530
commitab699e4c1387aee7bfdd116d35eb1b9289fc0a71 (patch)
tree355fd3e7ea818b0db14f1c694adbd7c7d3bfe49e
parent7e4cfad53699fabbecb6696508e5addcffc1b095 (diff)
add display module stubsHEADmaster
-rw-r--r--Cargo.toml3
-rw-r--r--src/board/mod.rs1
-rw-r--r--src/board/pins.rs31
-rw-r--r--src/drivers/buttons.rs0
-rw-r--r--src/drivers/display.rs18
-rw-r--r--src/drivers/mod.rs1
-rw-r--r--src/main.rs13
7 files changed, 66 insertions, 1 deletions
diff --git a/Cargo.toml b/Cargo.toml
index ef2d8eb..75308f2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -23,5 +23,8 @@ esp-idf-svc = { version = "0.52.1", features = ["critical-section", "embassy-tim
# Remove `generic-queue-8` if you plan to use `embassy-time` WITH `embassy-executor`
embassy-time = { version = "0.5", features = ["generic-queue-8"] }
+embedded-graphics = "0.8.2"
+ssd1306 = "0.10.0"
+
[build-dependencies]
embuild = "0.33"
diff --git a/src/board/mod.rs b/src/board/mod.rs
new file mode 100644
index 0000000..2babc83
--- /dev/null
+++ b/src/board/mod.rs
@@ -0,0 +1 @@
+pub mod pins;
diff --git a/src/board/pins.rs b/src/board/pins.rs
new file mode 100644
index 0000000..71e471b
--- /dev/null
+++ b/src/board/pins.rs
@@ -0,0 +1,31 @@
+// OLED
+pub const OLED_SDA_PIN: i32 = 8;
+pub const OLED_SCL_PIN: i32 = 9;
+
+// NRF24
+pub const CE1_PIN: i32 = 10;
+pub const CSN1_PIN: i32 = 11;
+
+pub const CE2_PIN: i32 = 12;
+pub const CSN2_PIN: i32 = 13;
+
+pub const NRF_SCK: i32 = 18;
+pub const NRF_MISO: i32 = 16;
+pub const NRF_MOSI: i32 = 17;
+
+// CC1101 FSPI
+pub const CC1101_SCK: i32 = 15;
+pub const CC1101_MISO: i32 = 41;
+pub const CC1101_MOSI: i32 = 35;
+
+pub const CC1101_CS: i32 = 40;
+pub const CC1101_GDO0: i32 = 39;
+pub const CC1101_GDO2: i32 = 42;
+
+// Buttons
+pub const BTN_UP: i32 = 4;
+pub const BTN_DOWN: i32 = 5;
+pub const BTN_SELECT: i32 = 6;
+pub const BTN_BACK: i32 = 7;
+pub const BTN_RIGHT: i32 = 1;
+pub const BTN_LEFT: i32 = 2;
diff --git a/src/drivers/buttons.rs b/src/drivers/buttons.rs
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/drivers/buttons.rs
diff --git a/src/drivers/display.rs b/src/drivers/display.rs
new file mode 100644
index 0000000..77bacf6
--- /dev/null
+++ b/src/drivers/display.rs
@@ -0,0 +1,18 @@
+use crate::board::pins::*;
+
+pub struct Display {
+}
+
+impl Display {
+ pub fn new() -> Self {
+ Self {}
+ }
+
+ pub fn init(&mut self) {
+ log::info!("display Initialized!!");
+ }
+
+ pub fn draw_text(&mut self, text: &str) {
+ log::info!("{}", text);
+ }
+}
diff --git a/src/drivers/mod.rs b/src/drivers/mod.rs
new file mode 100644
index 0000000..8754563
--- /dev/null
+++ b/src/drivers/mod.rs
@@ -0,0 +1 @@
+pub mod display;
diff --git a/src/main.rs b/src/main.rs
index 419e7f7..ee48cf8 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,3 +1,9 @@
+
+mod board;
+mod drivers;
+
+use drivers::display::Display;
+
fn main() {
// It is necessary to call this function once. Otherwise, some patches to the runtime
// 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() {
// Bind the log crate to the ESP Logging facilities
esp_idf_svc::log::EspLogger::initialize_default();
- log::info!("Hello, world!");
+ log::info!("ORION-RF Booted!!");
+ let mut display = Display::new();
+
+ display.init();
+ display.draw_text("ORION-RF");
+
}