2020-03-28 12:23:22 +00:00
|
|
|
// SPDX-License-Identifier: MIT OR Apache-2.0
|
|
|
|
//
|
|
|
|
// Copyright (c) 2018-2020 Andre Richter <andre.o.richter@gmail.com>
|
|
|
|
|
|
|
|
//! Top-level BSP file for the Raspberry Pi 3 and 4.
|
|
|
|
|
|
|
|
pub mod console;
|
|
|
|
pub mod cpu;
|
|
|
|
pub mod driver;
|
|
|
|
pub mod memory;
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
// Global instances
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
use super::device_driver;
|
|
|
|
|
|
|
|
static GPIO: device_driver::GPIO =
|
2020-09-30 19:51:31 +00:00
|
|
|
unsafe { device_driver::GPIO::new(memory::map::mmio::GPIO_START) };
|
2020-03-28 12:23:22 +00:00
|
|
|
|
|
|
|
static PL011_UART: device_driver::PL011Uart =
|
2020-09-30 19:51:31 +00:00
|
|
|
unsafe { device_driver::PL011Uart::new(memory::map::mmio::PL011_UART_START) };
|
2020-03-28 12:23:22 +00:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
// Public Code
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
/// Board identification.
|
|
|
|
pub fn board_name() -> &'static str {
|
|
|
|
#[cfg(feature = "bsp_rpi3")]
|
|
|
|
{
|
|
|
|
"Raspberry Pi 3"
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(feature = "bsp_rpi4")]
|
|
|
|
{
|
|
|
|
"Raspberry Pi 4"
|
|
|
|
}
|
|
|
|
}
|