-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
- Loading branch information
Showing
19 changed files
with
317 additions
and
25 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// SPDX-FileCopyrightText: 2023 Foundation Devices, Inc. <hello@foundationdevices.com> | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
pub mod spi_nor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// SPDX-FileCopyrightText: 2023 Foundation Devices, Inc. <hello@foundationdevices.com> | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
#[repr(C)] | ||
pub struct SPI_Flash_t { | ||
flash: passport_platform::io::Flash, | ||
} | ||
|
||
/// Read from the SPI NOR flash memory. | ||
pub fn spi_nor_read(dev: &mut spi_nor_t, address: u32, buf: *mut u8, len: usize) { | ||
let buf = unsafe { core::slice::from_raw_parts(buf, len) }; | ||
todo!() | ||
//dev.flash.read(address, buf).unwrap() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
// SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
pub mod spi; | ||
pub mod spi_nor; | ||
|
||
use crate::stm32::ffi; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// SPDX-FileCopyrightText: © 2023 Foundation Devices, Inc. <hello@foundationdevices.com> | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
use crate::io::spi::Spi; | ||
use stm32h753_hal::gpio::{Output, gpioe::PE11}; | ||
|
||
pub type Flash = Flash<Spi, PE11<Output>>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// SPDX-FileCopyrightText: © 2023 Foundation Devices, Inc. <hello@foundationdevices.com> | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
|
||
pub type Flash = spi_nor::Flash<EmulatedSpiBus, EmulatedPin>; | ||
|
||
pub struct EmulatedSpiBus; | ||
|
||
pub struct EmulatedPin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.