forked from rust-embedded/rust-raspberrypi-OS-tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevice_driver.rs
More file actions
24 lines (19 loc) · 726 Bytes
/
device_driver.rs
File metadata and controls
24 lines (19 loc) · 726 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// SPDX-License-Identifier: MIT OR Apache-2.0
//
// Copyright (c) 2018-2025 Andre Richter <andre.o.richter@gmail.com>
//! Device driver.
#[cfg(any(feature = "bsp_rpi3", feature = "bsp_rpi4", feature = "bsp_rpi5"))]
mod bcm;
#[cfg(feature = "bsp_rpi5")]
mod rp1_gpio;
mod common;
// For RPi3 and RPi4, re-export everything from the `bcm` module, which includes
// both the GPIO and UART drivers.
#[cfg(any(feature = "bsp_rpi3", feature = "bsp_rpi4"))]
pub use bcm::*;
// For RPi5, re-export only the drivers it uses: the common PL011Uart from the bcm
// module and its specific GPIO driver from the rp1_gpio module.
#[cfg(feature = "bsp_rpi5")]
pub use bcm::PL011Uart;
#[cfg(feature = "bsp_rpi5")]
pub use rp1_gpio::GPIO;