1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
//! `nesso` is the public Rust facade crate for the Arduino Nesso N1.
//!
//! It re-exports the board crate and subsystem crates that make up the SDK:
//!
//! - [`bsp`]: Nesso N1 board wiring and board-owned constructors
//! - [`display`]: ST7789P3 display support
//! - [`touch`]: FT6336U touch support
//! - [`imu`]: BMI270 IMU support
//! - [`audio`]: passive buzzer support
//! - [`power`]: battery and charger status support
//! - [`wifi`]: ESP32-C6 Wi-Fi support
//! - [`storage`]: small settings storage primitives
//! - [`input`]: input event state machines
//!
//! Applications that want board-owned setup should usually start with
//! [`bsp::NessoN1Board`], then construct a higher-level application state or a
//! [`Nesso`] facade from the returned parts.
//!
//! # Scope
//!
//! This crate targets only the Arduino Nesso N1 and does not provide a generic
//! board abstraction layer for other ESP32-C6 boards.
//!
//! # Example
//!
//! ```rust,ignore
//! #![no_std]
//! #![no_main]
//!
//! use embedded_graphics::{pixelcolor::Rgb565, prelude::RgbColor};
//! use embedded_hal::delay::DelayNs;
//! use esp_hal::{clock::CpuClock, delay::Delay, main};
//! use nesso::bsp::NessoN1Board;
//!
//! #[main]
//! fn main() -> ! {
//! let config = esp_hal::Config::default().with_cpu_clock(CpuClock::max());
//! let peripherals = esp_hal::init(config);
//! let mut delay = Delay::new();
//! let mut display = NessoN1Board::new(peripherals).into_display().unwrap();
//!
//! display.clear(Rgb565::BLACK).unwrap();
//! display
//! .print_centered("Hello from nesso", 120, Rgb565::WHITE)
//! .unwrap();
//!
//! loop {
//! delay.delay_ms(1000);
//! }
//! }
//! ```
/// Audio support for the Nesso N1 passive buzzer.
pub use nesso_audio as audio;
/// Display support for the Nesso N1 ST7789P3 LCD.
pub use nesso_display as display;
/// IMU support for the Nesso N1 BMI270.
pub use nesso_imu as imu;
/// Button and input event helpers.
pub use nesso_input as input;
/// Board constants and board-specific setup helpers.
pub use nesso_n1 as bsp;
/// Battery, charger, and power-management support.
pub use nesso_power as power;
/// Settings and key/value storage primitives.
pub use nesso_storage as storage;
/// Touch support for the Nesso N1 FT6336U controller.
pub use nesso_touch as touch;
/// Wi-Fi support for the ESP32-C6 radio.
pub use nesso_wifi as wifi;
use Board;
/// Aggregated Nesso N1 SDK facade.
///
/// This type owns the board marker and all initialized subsystems supplied
/// through [`NessoParts`]. The current constructor is explicit so applications
/// can decide how hardware buses are shared. A higher-level `begin` constructor
/// is planned once the I2C ownership model is finalized.
/// Parts used to construct a [`Nesso`] facade.