bnx_sal/lib.rs
1
2//! # Bnx System Abstraction Layer
3//!
4//! **S**ystem **A**bstraction library abstracts a system.
5//! It provides interfaces to HAL layer above such that
6//! HAL layer above is void of any core and system specific information and core and
7//! system agnostic. However RISC-V standard specific core details that are common acrosss all RISC-V cores
8//! aret part of **C**ommon **C**ore **A**bstraction **L**ayer .
9//! System Abstraction Layer abstracts a system and Core Abstraction Layer abstracts a core.
10//!
11//! # Example
12//! **E31** - a core and its abstracted in Core Abstraction Layer. <br>
13//! **FE310** - a system with E31 core and peripherals is abstracted in System Abstraction Layer. <br>
14//! <br>
15//! SAL dont cover that are abstracted in CAL instead might use them.
16//! In software architecture, CAL & SAL are beside each other as below.
17//!
18//! ```
19//! ---------------- Hardware Abstraction Layer --------------------------
20//! ----------------------------------------------------------------------
21//! | System Abstraction Layer | Core Abstraction Layer
22//! ----------------------------------------------------------------------
23//! ```
24//!
25//! SAL abstracts: <br>
26//! > **G**pio <br>
27//! > **U**art <br>
28//! > **S**pi <br>
29//! > **I**2c <br>
30//!
31//! Whereas CAL abstracts: <br>
32//! > **C**ore Clock <br>
33//! > **C**ore Boot <br>
34//!
35
36#![no_std]
37
38pub mod fe310;
39
40
41#[cfg(test)]
42mod tests {
43 #[test]
44 fn it_works() {
45 let result = 2 + 2;
46 assert_eq!(result, 4);
47 }
48}