aboutsummaryrefslogtreecommitdiff
path: root/src/flash/winbond.rs
diff options
context:
space:
mode:
authorIan McIntyre <me@mciantyre.dev>2025-12-20 16:48:32 -0500
committerIan McIntyre <me@mciantyre.dev>2025-12-21 07:38:02 -0500
commitb3732747cf52a743d7c4dd4a07479cc533ad5416 (patch)
treef59add163dd429f6d46a25649c034cb9de8adde1 /src/flash/winbond.rs
parenta800ee097af0c2334318d39dec2c0a40dbd5c0d9 (diff)
Consolidate flash algorithm init
Diffstat (limited to 'src/flash/winbond.rs')
-rw-r--r--src/flash/winbond.rs92
1 files changed, 0 insertions, 92 deletions
diff --git a/src/flash/winbond.rs b/src/flash/winbond.rs
deleted file mode 100644
index afac605..0000000
--- a/src/flash/winbond.rs
+++ /dev/null
@@ -1,92 +0,0 @@
-//! Winbond Serial NOR Flash.
-
-use super::*;
-use crate::{ImxrtFlashAlgorithm, sequences::common as sequences};
-
-pub type W25q64 = Winbond<{ 64 / 8 * 1024 * 1024 }>;
-
-/// A Winbond serial NOR flash driver.
-pub struct Winbond<const FLASH_CAPACITY_BYTES: usize>;
-
-impl<const FLASH_CAPACITY_BYTES: usize> ImxrtFlashAlgorithm for Winbond<FLASH_CAPACITY_BYTES> {
- const FLASH_CAPACITY_BYTES: usize = FLASH_CAPACITY_BYTES;
- const FLASH_PAGE_SIZE_BYTES: usize = 256;
- const FLASH_SECTOR_SIZE_BYTES: usize = 4096;
-
- fn initialize(flexspi: imxrt_drivers_flexspi::Instance) {
- defmt::assert_eq!(
- READ,
- defmt::unwrap!(crate::install_ip_cmd(
- flexspi,
- READ.seq_id,
- &[sequences::seq_fast_read_quad_io(6)],
- ))
- );
-
- defmt::assert_eq!(
- SET_READ_PARAMS,
- defmt::unwrap!(crate::install_ip_cmd(
- flexspi,
- SET_READ_PARAMS.seq_id,
- &[sequences::SEQ_SET_READ_PARAMS_VOL]
- ))
- );
-
- defmt::assert_eq!(
- WRITE_ENABLE,
- defmt::unwrap!(crate::install_ip_cmd(
- flexspi,
- WRITE_ENABLE.seq_id,
- &[sequences::SEQ_WRITE_ENABLE]
- ))
- );
-
- defmt::assert_eq!(
- ERASE_SECTOR,
- defmt::unwrap!(crate::install_ip_cmd(
- flexspi,
- ERASE_SECTOR.seq_id,
- &[sequences::SEQ_WRITE_ENABLE, sequences::SEQ_ERASE_SECTOR]
- ))
- );
-
- defmt::assert_eq!(
- READ_STATUS,
- defmt::unwrap!(crate::install_ip_cmd(
- flexspi,
- READ_STATUS.seq_id,
- &[sequences::SEQ_READ_STATUS]
- ))
- );
-
- defmt::assert_eq!(
- PAGE_PROGRAM,
- defmt::unwrap!(crate::install_ip_cmd(
- flexspi,
- PAGE_PROGRAM.seq_id,
- &[
- sequences::SEQ_WRITE_ENABLE,
- sequences::SEQ_PAGE_PROGRAM_QUAD_INPUT
- ]
- ))
- );
-
- defmt::assert_eq!(
- CHIP_ERASE,
- defmt::unwrap!(crate::install_ip_cmd(
- flexspi,
- CHIP_ERASE.seq_id,
- &[sequences::SEQ_WRITE_ENABLE, sequences::SEQ_ERASE_CHIP]
- ))
- );
-
- defmt::assert_eq!(
- RESET,
- defmt::unwrap!(crate::install_ip_cmd(
- flexspi,
- RESET.seq_id,
- &[sequences::SEQ_RSTEN, sequences::SEQ_RST]
- ))
- );
- }
-}