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
.section ".text.<embassy_rp::critical_section_impl::RpSpinlockCs as critical_section::Impl>::acquire","ax",%progbits | |
.p2align 1 | |
.type <embassy_rp::critical_section_impl::RpSpinlockCs as critical_section::Impl>::acquire,%function | |
.code 16 | |
.thumb_func | |
<embassy_rp::critical_section_impl::RpSpinlockCs as critical_section::Impl>::acquire: | |
.fnstart | |
.cfi_startproc | |
.save {r7, lr} | |
push {r7, lr} |
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
#![no_std] | |
#![no_main] | |
use embassy_executor::{Executor, Spawner}; | |
use embassy_futures::join::join; | |
use embassy_futures::join::join3; | |
use embassy_rp::block::ImageDef; | |
use embassy_rp::multicore::{spawn_core1, Stack}; | |
use embassy_rp::peripherals::{PIN_12, PIN_13, PIN_14, PIN_15, USB}; | |
use embassy_rp::usb; |
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
diff --git a/.cargo/config.toml b/.cargo/config.toml | |
index a87e324..51c8973 100644 | |
--- a/.cargo/config.toml | |
+++ b/.cargo/config.toml | |
@@ -1,8 +1,10 @@ | |
[target.'cfg(all(target_arch = "arm", target_os = "none"))'] | |
-runner = "probe-rs run --chip RP2040" | |
+#runner = "probe-rs run --chip RP2040" | |
+#runner = "elf2uf2-rs -d" | |
+runner = "picotool load -u -v -x -t elf" |
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
#![no_std] | |
#![no_main] | |
use defmt::*; | |
use embassy_executor::Spawner; | |
use embassy_rp::{ | |
gpio::{Level, Output}, | |
spi::{self, Spi}, | |
}; | |
use {defmt_rtt as _, panic_probe as _}; |
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
#![no_std] | |
#![no_main] | |
/** | |
* Basic RP2040 DMA example, just copying one value in memory to another place in memory using DMA | |
*/ | |
use bsp::entry; | |
use cortex_m::singleton; | |
use defmt::*; | |
use defmt_rtt as _; |
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
/** | |
* Configure DMA to copy ADC FIFO round-robin values into memory | |
* | |
* The strategy is as follows: | |
* - Have a static array which is the DMA target address, holding 3 u16 values | |
* - Enable DMA with a data-size of halfword (16bits), increase the write address after each transfer and wrap at 8 bytes | |
* - Start the ADC according to datasheet section 4.9.2.5 (round robin with FIFO enabled and DREQ threshold 1) | |
* | |
* The result will be an array with 16bit values of ADC results where the first bit indicates an error if set | |
*/ |
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
//! # I²C Example | |
//! | |
//! This application demonstrates how to talk to I²C devices with an RP2040. | |
//! | |
//! It may need to be adapted to your particular board layout and/or pin assignment. | |
//! | |
//! See the `Cargo.toml` file for Copyright and licence details. | |
#![no_std] | |
#![no_main] |
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
use core::cell::RefCell; | |
use embedded_hal::blocking::spi::{Transfer, Write}; | |
use embedded_hal::digital::v2::OutputPin; | |
use heapless::Vec; | |
use seq_macro::seq; | |
/// Static device id | |
const DEVICE_ID: u16 = 0x0424; | |
/// Highest addressable register address |
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
lattice = require("lattice") | |
function createGridState() | |
local grid = {} | |
for i = 1, 16 do | |
grid[i] = {} | |
for j = 1, 8 do | |
grid[i][j] = 0 | |
end |
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
use std::convert::TryFrom; | |
use wmidi::MidiMessage; | |
fn create_midi_message(bytes: &[u8]) -> Option<MidiMessage> { | |
MidiMessage::try_from(bytes).ok() | |
} | |
fn main() { | |
let mut message_buffer: [u8; 1024] = [0; 1024]; | |
let mut stream_parser = StreamParser::new(&mut message_buffer); |
NewerOlder