Removed the cyw43-pio overclock feature
This commit is contained in:
parent
388103275e
commit
147fd60255
2
ci.sh
2
ci.sh
@ -178,7 +178,7 @@ cargo batch \
|
|||||||
--- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'log,firmware-logs,bluetooth' \
|
--- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'log,firmware-logs,bluetooth' \
|
||||||
--- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'defmt,firmware-logs,bluetooth' \
|
--- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'defmt,firmware-logs,bluetooth' \
|
||||||
--- build --release --manifest-path cyw43-pio/Cargo.toml --target thumbv6m-none-eabi --features 'embassy-rp/rp2040' \
|
--- build --release --manifest-path cyw43-pio/Cargo.toml --target thumbv6m-none-eabi --features 'embassy-rp/rp2040' \
|
||||||
--- build --release --manifest-path cyw43-pio/Cargo.toml --target thumbv6m-none-eabi --features 'embassy-rp/rp2040,overclock' \
|
--- build --release --manifest-path cyw43-pio/Cargo.toml --target thumbv6m-none-eabi --features 'embassy-rp/rp2040' \
|
||||||
--- build --release --manifest-path embassy-boot-nrf/Cargo.toml --target thumbv7em-none-eabi --features embassy-nrf/nrf52840 \
|
--- build --release --manifest-path embassy-boot-nrf/Cargo.toml --target thumbv7em-none-eabi --features embassy-nrf/nrf52840 \
|
||||||
--- build --release --manifest-path embassy-boot-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9160-ns \
|
--- build --release --manifest-path embassy-boot-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9160-ns \
|
||||||
--- build --release --manifest-path embassy-boot-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9120-ns \
|
--- build --release --manifest-path embassy-boot-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9120-ns \
|
||||||
|
|||||||
@ -9,11 +9,6 @@ license = "MIT OR Apache-2.0"
|
|||||||
repository = "https://github.com/embassy-rs/embassy"
|
repository = "https://github.com/embassy-rs/embassy"
|
||||||
documentation = "https://docs.embassy.dev/cyw43-pio"
|
documentation = "https://docs.embassy.dev/cyw43-pio"
|
||||||
|
|
||||||
[features]
|
|
||||||
# If disabled, SPI runs at 31.25MHz
|
|
||||||
# If enabled, SPI runs at 62.5MHz, which is 25% higher than 50Mhz which is the maximum according to the CYW43439 datasheet.
|
|
||||||
overclock = []
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cyw43 = { version = "0.2.0", path = "../cyw43" }
|
cyw43 = { version = "0.2.0", path = "../cyw43" }
|
||||||
embassy-rp = { version = "0.2.0", path = "../embassy-rp" }
|
embassy-rp = { version = "0.2.0", path = "../embassy-rp" }
|
||||||
|
|||||||
@ -40,7 +40,6 @@ pub const OVERCLOCK_CLOCK_DIVIDER: FixedU32<U8> = FixedU32::from_bits(0x0100);
|
|||||||
|
|
||||||
/// The clock divider for the RM2 module. Found to be needed for the Pimoroni Pico Plus 2 W,
|
/// The clock divider for the RM2 module. Found to be needed for the Pimoroni Pico Plus 2 W,
|
||||||
/// Pico Plus 2 Non w with the RM2 breakout module, and the Pico 2 with the RM2 breakout module.
|
/// Pico Plus 2 Non w with the RM2 breakout module, and the Pico 2 with the RM2 breakout module.
|
||||||
/// Does not work with the feature "overclock".
|
|
||||||
pub const RM2_CLOCK_DIVIDER: FixedU32<U8> = FixedU32::from_bits(0x0300);
|
pub const RM2_CLOCK_DIVIDER: FixedU32<U8> = FixedU32::from_bits(0x0300);
|
||||||
|
|
||||||
impl<'d, PIO, const SM: usize, DMA> PioSpi<'d, PIO, SM, DMA>
|
impl<'d, PIO, const SM: usize, DMA> PioSpi<'d, PIO, SM, DMA>
|
||||||
@ -63,53 +62,56 @@ where
|
|||||||
DIO: PioPin,
|
DIO: PioPin,
|
||||||
CLK: PioPin,
|
CLK: PioPin,
|
||||||
{
|
{
|
||||||
#[cfg(feature = "overclock")]
|
let loaded_program = if clock_divider < DEFAULT_CLOCK_DIVIDER {
|
||||||
let program = pio_asm!(
|
let overclock_program = pio_asm!(
|
||||||
".side_set 1"
|
".side_set 1"
|
||||||
|
|
||||||
".wrap_target"
|
".wrap_target"
|
||||||
// write out x-1 bits
|
// write out x-1 bits
|
||||||
"lp:"
|
"lp:"
|
||||||
"out pins, 1 side 0"
|
"out pins, 1 side 0"
|
||||||
"jmp x-- lp side 1"
|
"jmp x-- lp side 1"
|
||||||
// switch directions
|
// switch directions
|
||||||
"set pindirs, 0 side 0"
|
"set pindirs, 0 side 0"
|
||||||
"nop side 1" // necessary for clkdiv=1.
|
"nop side 1" // necessary for clkdiv=1.
|
||||||
"nop side 0"
|
"nop side 0"
|
||||||
// read in y-1 bits
|
// read in y-1 bits
|
||||||
"lp2:"
|
"lp2:"
|
||||||
"in pins, 1 side 1"
|
"in pins, 1 side 1"
|
||||||
"jmp y-- lp2 side 0"
|
"jmp y-- lp2 side 0"
|
||||||
|
|
||||||
// wait for event and irq host
|
// wait for event and irq host
|
||||||
"wait 1 pin 0 side 0"
|
"wait 1 pin 0 side 0"
|
||||||
"irq 0 side 0"
|
"irq 0 side 0"
|
||||||
|
|
||||||
".wrap"
|
".wrap"
|
||||||
);
|
);
|
||||||
#[cfg(not(feature = "overclock"))]
|
common.load_program(&overclock_program.program)
|
||||||
let program = pio_asm!(
|
} else {
|
||||||
".side_set 1"
|
let default_program = pio_asm!(
|
||||||
|
".side_set 1"
|
||||||
|
|
||||||
".wrap_target"
|
".wrap_target"
|
||||||
// write out x-1 bits
|
// write out x-1 bits
|
||||||
"lp:"
|
"lp:"
|
||||||
"out pins, 1 side 0"
|
"out pins, 1 side 0"
|
||||||
"jmp x-- lp side 1"
|
"jmp x-- lp side 1"
|
||||||
// switch directions
|
// switch directions
|
||||||
"set pindirs, 0 side 0"
|
"set pindirs, 0 side 0"
|
||||||
"nop side 0"
|
"nop side 0"
|
||||||
// read in y-1 bits
|
// read in y-1 bits
|
||||||
"lp2:"
|
"lp2:"
|
||||||
"in pins, 1 side 1"
|
"in pins, 1 side 1"
|
||||||
"jmp y-- lp2 side 0"
|
"jmp y-- lp2 side 0"
|
||||||
|
|
||||||
// wait for event and irq host
|
// wait for event and irq host
|
||||||
"wait 1 pin 0 side 0"
|
"wait 1 pin 0 side 0"
|
||||||
"irq 0 side 0"
|
"irq 0 side 0"
|
||||||
|
|
||||||
".wrap"
|
".wrap"
|
||||||
);
|
);
|
||||||
|
common.load_program(&default_program.program)
|
||||||
|
};
|
||||||
|
|
||||||
let mut pin_io: embassy_rp::pio::Pin<PIO> = common.make_pio_pin(dio);
|
let mut pin_io: embassy_rp::pio::Pin<PIO> = common.make_pio_pin(dio);
|
||||||
pin_io.set_pull(Pull::None);
|
pin_io.set_pull(Pull::None);
|
||||||
@ -123,7 +125,6 @@ where
|
|||||||
pin_clk.set_slew_rate(SlewRate::Fast);
|
pin_clk.set_slew_rate(SlewRate::Fast);
|
||||||
|
|
||||||
let mut cfg = Config::default();
|
let mut cfg = Config::default();
|
||||||
let loaded_program = common.load_program(&program.program);
|
|
||||||
cfg.use_program(&loaded_program, &[&pin_clk]);
|
cfg.use_program(&loaded_program, &[&pin_clk]);
|
||||||
cfg.set_out_pins(&[&pin_io]);
|
cfg.set_out_pins(&[&pin_io]);
|
||||||
cfg.set_in_pins(&[&pin_io]);
|
cfg.set_in_pins(&[&pin_io]);
|
||||||
|
|||||||
@ -16,7 +16,7 @@ embassy-net = { version = "0.5.0", path = "../../embassy-net", features = ["defm
|
|||||||
embassy-net-wiznet = { version = "0.1.0", path = "../../embassy-net-wiznet", features = ["defmt"] }
|
embassy-net-wiznet = { version = "0.1.0", path = "../../embassy-net-wiznet", features = ["defmt"] }
|
||||||
embassy-embedded-hal = { version = "0.2.0", path = "../../embassy-embedded-hal/"}
|
embassy-embedded-hal = { version = "0.2.0", path = "../../embassy-embedded-hal/"}
|
||||||
cyw43 = { path = "../../cyw43", features = ["defmt", "firmware-logs"] }
|
cyw43 = { path = "../../cyw43", features = ["defmt", "firmware-logs"] }
|
||||||
cyw43-pio = { path = "../../cyw43-pio", features = ["defmt", "overclock"] }
|
cyw43-pio = { path = "../../cyw43-pio", features = ["defmt"] }
|
||||||
perf-client = { path = "../perf-client" }
|
perf-client = { path = "../perf-client" }
|
||||||
|
|
||||||
defmt = "0.3.0"
|
defmt = "0.3.0"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user