ChanServ changed the topic of #rust-embedded to: Welcome to the Rust Embedded IRC channel! Bridged to #rust-embedded:matrix.org and logged at https://libera.irclog.whitequark.org/rust-embedded, code of conduct at https://www.rust-lang.org/conduct.html
IlPalazzo-ojiisa has quit [Quit: Leaving.]
<kenny> As a follow-up, using a local patch Input<PullUp> seemed to work. I don't have my meter close by to be sure the internal pullup is on, but I'm not seeing any noise, so I suspect it is.
lehmrob has quit [Ping timeout: 260 seconds]
lehmrob has joined #rust-embedded
rardiol has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<re_irc> <@firefrommoonlight:matrix.org> Has anyone here coded UBLOX GNSS for rust? I just wrote a bare-bones module, and am wondering if there's prior art. Of note, I found this crate (https://docs.rs/ublox/latest/ublox/), which remarkably doesn't seem to be no_std
<re_irc> <@firefrommoonlight:matrix.org> -which remarkably doesn't seem to be no_std
<re_irc> <@firefrommoonlight:matrix.org> Ie, have you used that? Have you adapted it to an embedded use case?
<re_irc> <@firefrommoonlight:matrix.org> I think most likely I will continue hacking at my own module and maybe publish it
<re_irc> <@korken89:matrix.org> : I'm doing a project with an uBlox SARA-R422-M10S but have not yet come to the GPS part of it, so I'm heading the same way as you soon :)
<re_irc> <@korken89:matrix.org> https://github.com/korken89/rusty-tracker/ is you want to checkout
<re_irc> <@korken89:matrix.org> * if
IlPalazzo-ojiisa has joined #rust-embedded
dc740 has joined #rust-embedded
rardiol has joined #rust-embedded
rardiol has quit [Ping timeout: 252 seconds]
rardiol has joined #rust-embedded
<re_irc> <@firefrommoonlight:matrix.org> Sounds great; let's chat
<re_irc> <@firefrommoonlight:matrix.org> Once you're further along
<re_irc> <@hartan:matrix.org> What's the least painful way to abstract generic types into their own modules? I'm building a project with a Waveshare epaper display. The "Display" object itself requires 6 generics, 4 of these are I/Os. The concrete type is so long rust-analyzer is dumping it into a text file for me... Essentially I just want a type alias for something implementing the Epaper displays trait, but without caring about the traits respective...
<re_irc> ... generics, and their generics, etc. Is that possible?
<re_irc> <@firefrommoonlight:matrix.org> I am waiting on getting the hardware prototype before continuing; want to test on hardware before adding new functionality
<re_irc> <@firefrommoonlight:matrix.org> I'll send you what I have so far if you'd like
<re_irc> <@korken89:matrix.org> : Sure, always interesting to see what people do :)
rardiol has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
emerent has quit [Ping timeout: 246 seconds]
emerent has joined #rust-embedded
rardiol has joined #rust-embedded
<re_irc> <@firefrommoonlight:matrix.org> Most of that file is the UBX protocol class/Id possible values
<re_irc> <@firefrommoonlight:matrix.org> It's set up with something that _should_ work, but historically has several errors that will show up once I plug it in
<re_irc> <@firefrommoonlight:matrix.org> In particular, there are likely some configuration settings I missed that need to be set up
<re_irc> <@firefrommoonlight:matrix.org> RTIC task in application code will likely look something like this; or maybe not!
<re_irc> #[task(binds = USART1, shared = [], local = [uart1], priority = 3)]
<re_irc> let uart = &mut cx.local.uart1; // Code shortener
<re_irc> fn gnss_isr(mut cx: crsf_isr::Context) {
<re_irc> uart.clear_interrupt(UsartInterrupt::CharDetect(None));
<re_irc> uart.clear_interrupt(UsartInterrupt::Idle);
<re_irc> // Stop the DMA read, since it will likely not have filled the buffer, due
<re_irc> // to the variable message sizes.
<re_irc> dma::stop(DmaPeriph::Dma1, setup::GNSS_RX_CH);
<re_irc> // todo: Attempting a software flag vice using interrupt flags, to TS CRSF
<re_irc> // todo anomolies.
<re_irc> if !gnss::TRANSFER_IN_PROG.load(Ordering::Relaxed) {
<re_irc> gnss::TRANSFER_IN_PROG.store(true, Ordering::Relaxed);
<re_irc> // Don't allow the starting char, as used in the middle of a message,
<re_irc> // to trigger an interrupt.
<re_irc> uart.disable_interrupt(UsartInterrupt::CharDetect(None));
<re_irc> unsafe {
<re_irc> uart.read_dma(
<re_irc> &mut gnss::RX_BUFFER,
<re_irc> setup::GNSS_RX_CH,
<re_irc> ChannelCfg {
<re_irc> priority: dma::Priority::Medium,
<re_irc> ..Default::default()
<re_irc> },
<re_irc> DmaPeriph::DMA1,
<re_irc> );
<re_irc> }
<re_irc> } else {
<re_irc> gnss::TRANSFER_IN_PROG.store(false, Ordering::Relaxed);
<re_irc> // Line is idle.
<re_irc> // A `None` value here re-enables the interrupt without changing the char to match.
<re_irc> uart.enable_interrupt(UsartInterrupt::CharDetect(None));
<re_irc> match gnss::handle_packet() {
<re_irc> Ok(packet_data) => {
<re_irc> match packet_data {
<re_irc> Some(fix) => {
<re_irc> // todo: Handle the fix
<re_irc> println!("Received a valid fix. Lat: {}", fix.latitude);
<re_irc> }
<re_irc> None => {
<re_irc> println!("Received a packet with no fix.")
<re_irc> // Received a valid packet, but no fix.
<re_irc> }
<re_irc> }
<re_irc> }
<re_irc> // Ie, a fault eetc.
<re_irc> Err(e) => {
<re_irc> println!("GNSS error while reading a fix")
<re_irc> }
<re_irc> }
<re_irc> }
<re_irc> }
<re_irc> <@firefrommoonlight:matrix.org> RTIC task in application code will likely look something like this; or maybe not!
<re_irc> #[task(binds = USART1, shared = [], local = [uart1], priority = 3)]
<re_irc> fn gnss_isr(mut cx: crsf_isr::Context) {
<re_irc> let uart = &mut cx.local.uart1; // Code shortener
<re_irc> uart.clear_interrupt(UsartInterrupt::CharDetect(None));
<re_irc> uart.clear_interrupt(UsartInterrupt::Idle);
<re_irc> // Stop the DMA read, since it will likely not have filled the buffer, due
<re_irc> // to the variable message sizes.
<re_irc> dma::stop(DmaPeriph::Dma1, setup::GNSS_RX_CH);
<re_irc> if !gnss::TRANSFER_IN_PROG.load(Ordering::Relaxed) {
<re_irc> gnss::TRANSFER_IN_PROG.store(true, Ordering::Relaxed);
<re_irc> // Don't allow the starting char, as used in the middle of a message,
<re_irc> // to trigger an interrupt.
<re_irc> uart.disable_interrupt(UsartInterrupt::CharDetect(None));
<re_irc> unsafe {
<re_irc> uart.read_dma(
<re_irc> &mut gnss::RX_BUFFER,
<re_irc> setup::GNSS_RX_CH,
<re_irc> ChannelCfg {
<re_irc> priority: dma::Priority::Medium,
<re_irc> ..Default::default()
<re_irc> },
<re_irc> DmaPeriph::DMA1,
<re_irc> );
<re_irc> }
<re_irc> } else {
<re_irc> gnss::TRANSFER_IN_PROG.store(false, Ordering::Relaxed);
<re_irc> // Line is idle.
<re_irc> // A `None` value here re-enables the interrupt without changing the char to match.
<re_irc> uart.enable_interrupt(UsartInterrupt::CharDetect(None));
<re_irc> match gnss::handle_packet() {
<re_irc> Ok(packet_data) => {
<re_irc> match packet_data {
<re_irc> Some(fix) => {
<re_irc> // todo: Handle the fix
<re_irc> println!("Received a valid fix. Lat: {}", fix.latitude);
<re_irc> }
<re_irc> None => {
<re_irc> println!("Received a packet with no fix.")
<re_irc> // Received a valid packet, but no fix.
<re_irc> }
<re_irc> }
<re_irc> }
<re_irc> // Ie, a fault eetc.
<re_irc> Err(e) => {
<re_irc> println!("GNSS error while reading a fix")
<re_irc> }
<re_irc> }
<re_irc> }
<re_irc> }
<re_irc> <@firefrommoonlight:matrix.org> * gnss_isr::Context)
emerent has quit [Ping timeout: 265 seconds]
emerent has joined #rust-embedded
rardiol has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
rardiol has joined #rust-embedded
dc_740 has joined #rust-embedded
dc740 has quit [Ping timeout: 276 seconds]
jcroisant has quit [Quit: Connection closed for inactivity]