diff --git a/drivers/0x01_uart_rust/src/uart.rs b/drivers/0x01_uart_rust/src/uart.rs index 47db024..23f9e9a 100644 --- a/drivers/0x01_uart_rust/src/uart.rs +++ b/drivers/0x01_uart_rust/src/uart.rs @@ -25,12 +25,19 @@ //! OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE //! SOFTWARE. +// Rate extension trait for .Hz() baud rate construction use fugit::RateExtU32; +// Non-blocking I/O helper for UART read/write use nb::block; +// Alias our HAL crate use rp235x_hal as hal; +// Clock trait for accessing system clock frequency use hal::Clock; +// UART configuration and peripheral types use hal::uart::{DataBits, Enabled, StopBits, UartConfig, UartPeripheral}; +// GPIO pin types and function selectors use hal::gpio::{FunctionNull, FunctionUart, Pin, PullDown, PullNone}; +// UART0 peripheral singleton type use hal::pac::UART0; /// Type alias for the configured TX pin (GPIO 0, UART function, no pull). @@ -158,6 +165,7 @@ impl UartDriver { #[cfg(test)] mod tests { + // Import all parent module items use super::*; #[test] diff --git a/drivers/0x02_blink_rust/src/blink.rs b/drivers/0x02_blink_rust/src/blink.rs index 46fb660..41f3975 100644 --- a/drivers/0x02_blink_rust/src/blink.rs +++ b/drivers/0x02_blink_rust/src/blink.rs @@ -25,6 +25,7 @@ //! OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE //! SOFTWARE. +// Embedded HAL digital output traits for GPIO pin control use embedded_hal::digital::{OutputPin, StatefulOutputPin}; /// GPIO output / LED blink driver that owns a single output pin. @@ -95,8 +96,11 @@ impl BlinkDriver

{ #[cfg(test)] mod tests { + // Import all parent module items use super::*; + // Infallible error type for mock pin implementations use core::convert::Infallible; + // Error type trait for mock pin implementations use embedded_hal::digital::ErrorType; struct MockPin { diff --git a/drivers/0x03_button_rust/src/button.rs b/drivers/0x03_button_rust/src/button.rs index c98376e..ff576d5 100644 --- a/drivers/0x03_button_rust/src/button.rs +++ b/drivers/0x03_button_rust/src/button.rs @@ -25,6 +25,7 @@ //! OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE //! SOFTWARE. +// Embedded HAL digital I/O traits for GPIO pin control use embedded_hal::digital::{InputPin, OutputPin, StatefulOutputPin}; /// Push-button GPIO input driver with debounce. @@ -123,8 +124,11 @@ impl ButtonLed { #[cfg(test)] mod tests { + // Import all parent module items use super::*; + // Infallible error type for mock pin implementations use core::convert::Infallible; + // Error type trait for mock pin implementations use embedded_hal::digital::ErrorType; struct MockInputPin { diff --git a/drivers/0x04_pwm_rust/src/pwm.rs b/drivers/0x04_pwm_rust/src/pwm.rs index d9906fd..d92ba07 100644 --- a/drivers/0x04_pwm_rust/src/pwm.rs +++ b/drivers/0x04_pwm_rust/src/pwm.rs @@ -79,6 +79,7 @@ pub fn duty_to_level(percent: u8, wrap: u32) -> u32 { #[cfg(test)] mod tests { + // Import all parent module items use super::*; #[test] diff --git a/drivers/0x05_servo_rust/src/servo.rs b/drivers/0x05_servo_rust/src/servo.rs index 72b3eb5..e5fd848 100644 --- a/drivers/0x05_servo_rust/src/servo.rs +++ b/drivers/0x05_servo_rust/src/servo.rs @@ -124,6 +124,7 @@ pub fn calc_clk_div(sys_hz: u32, servo_hz: f32, wrap: u32) -> f32 { #[cfg(test)] mod tests { + // Import all parent module items use super::*; #[test] diff --git a/drivers/0x06_adc_rust/src/adc.rs b/drivers/0x06_adc_rust/src/adc.rs index 69a8fe6..640e965 100644 --- a/drivers/0x06_adc_rust/src/adc.rs +++ b/drivers/0x06_adc_rust/src/adc.rs @@ -65,6 +65,7 @@ pub fn raw_to_celsius(raw: u16) -> f32 { #[cfg(test)] mod tests { + // Import all parent module items use super::*; #[test] diff --git a/drivers/0x07_i2c_rust/src/i2c.rs b/drivers/0x07_i2c_rust/src/i2c.rs index f846333..8e41be5 100644 --- a/drivers/0x07_i2c_rust/src/i2c.rs +++ b/drivers/0x07_i2c_rust/src/i2c.rs @@ -116,6 +116,7 @@ pub fn format_scan_entry(buf: &mut [u8], addr: u8, found: bool) -> usize { #[cfg(test)] mod tests { + // Import all parent module items use super::*; #[test] diff --git a/drivers/0x08_lcd1602_rust/src/lcd1602.rs b/drivers/0x08_lcd1602_rust/src/lcd1602.rs index 82569d6..5324cdc 100644 --- a/drivers/0x08_lcd1602_rust/src/lcd1602.rs +++ b/drivers/0x08_lcd1602_rust/src/lcd1602.rs @@ -130,6 +130,7 @@ pub fn format_counter(buf: &mut [u8], count: u32) -> usize { #[cfg(test)] mod tests { + // Import all parent module items use super::*; #[test]