Unify derivation of Clone, Copy and defmt::format for all *SPI configs

This commit is contained in:
goodhoko 2025-09-16 00:23:52 +02:00
parent 92a6fd2946
commit 542ae72ca7
4 changed files with 10 additions and 0 deletions

View File

@ -86,6 +86,8 @@ impl Default for Config {
}
/// HSPI transfer configuration.
#[derive(Clone, Copy)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct TransferConfig {
/// Instruction width (IMODE)
pub iwidth: HspiWidth,

View File

@ -23,6 +23,7 @@ use crate::{peripherals, Peri};
/// OPSI driver config.
#[derive(Clone, Copy)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct Config {
/// Fifo threshold used by the peripheral to generate the interrupt indicating data
/// or space is available in the FIFO
@ -83,6 +84,8 @@ impl Default for Config {
}
/// OSPI transfer configuration.
#[derive(Clone, Copy)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct TransferConfig {
/// Instruction width (IMODE)
pub iwidth: OspiWidth,

View File

@ -18,6 +18,7 @@ use crate::{peripherals, Peri};
/// QSPI transfer configuration.
#[derive(Clone, Copy)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct TransferConfig {
/// Instruction width (IMODE)
pub iwidth: QspiWidth,
@ -48,6 +49,7 @@ impl Default for TransferConfig {
/// QSPI driver configuration.
#[derive(Clone, Copy)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[non_exhaustive]
pub struct Config {
/// Flash memory size representend as 2^[0-32], as reasonable minimum 1KiB(9) was chosen.

View File

@ -23,6 +23,7 @@ use crate::{peripherals, Peri};
/// XPSI driver config.
#[derive(Clone, Copy)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct Config {
/// Fifo threshold used by the peripheral to generate the interrupt indicating data
/// or space is available in the FIFO
@ -80,6 +81,8 @@ impl Default for Config {
}
/// XSPI transfer configuration.
#[derive(Clone, Copy)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct TransferConfig {
/// Instruction width (IMODE)
pub iwidth: XspiWidth,