starblue1 has quit [Ping timeout: 240 seconds]
starblue1 has joined #rust-embedded
emerent has quit [Ping timeout: 250 seconds]
emerent has joined #rust-embedded
gsalazar has joined #rust-embedded
gsalazar_ has joined #rust-embedded
gsalazar has quit [Ping timeout: 256 seconds]
gsalazar_ has quit [Quit: Leaving]
gsalazar has joined #rust-embedded
starblue1 has quit [Ping timeout: 256 seconds]
starblue1 has joined #rust-embedded
_whitelogger has joined #rust-embedded
edm_ is now known as edm
darknighte_ is now known as darknighte
VShell is now known as Shell
rektide_ has quit [Ping timeout: 256 seconds]
rektide has joined #rust-embedded
cr1901_ is now known as cr1901
cr1901 has quit [Ping timeout: 240 seconds]
cr1901 has joined #rust-embedded
<re_irc> <@urbanaut78:matrix.org> Is there a place where I can find a description how to read an analog input pin? I'm using the Micro:bit v2.
<re_irc> <@dngrs:matrix.org> urbanaut78:matrix.org: [this](https://github.com/nrf-rs/microbit/blob/main/examples/v2-microphone/src/main.rs) reads the board microphone using SAADC, does that help to get started?
<re_irc> <@urbanaut78:matrix.org> great, that's exactly what I'm using right now. but I would like to read m:B ring 0 (Pin0.02?) as input
<re_irc> <@k900:0upti.me> Looks like there's `board.pins.p0_02`
<re_irc> <@k900:0upti.me> And `board.pins.pX_YZ` in general
<re_irc> <@urbanaut78:matrix.org> In the example they also enable the microphone like this:
<re_irc> <@urbanaut78:matrix.org> board
<re_irc> <@urbanaut78:matrix.org> .microphone_pins
<re_irc> <@urbanaut78:matrix.org> // enable microphone
<re_irc> <@urbanaut78:matrix.org> do I need something similar?
<re_irc> <@k900:0upti.me> No
<re_irc> <@k900:0upti.me> That's to provide power to the microphone
<re_irc> <@k900:0upti.me> Whatever you're reading is probably powered externally
<re_irc> <@urbanaut78:matrix.org> ah, okay. that makes sense. thank you!
xnor has quit [Quit: leaving]
xnor has joined #rust-embedded
<re_irc> <@unrelentingtech:mozilla.org> re: the nrf5340 discussions from a couple days ago, looks like nimble has support https://github.com/apache/mynewt-nimble/tree/master/nimble/drivers/nrf5340/src
<re_irc> <@unrelentingtech:mozilla.org> which makes me think.. would it be possible to run all the C nimble stuff on the radio core and a Rust app on the other core, with the Rust app only knowing that "HCI" interface and them being independently built?
<re_irc> <@dirbaio:matrix.org> HCI is below the "host" part of the stack, so it's still quite lowlevel. The host part still needs certification
<re_irc> <@dirbaio:matrix.org> so you'd have to invent your own IPC that's above the host layer, ie not HCI
<re_irc> <@dirbaio:matrix.org> but otherwise yes, I guess..?
<re_irc> <@dirbaio:matrix.org> also huh, it has its own radio driver from scratch, using the registers directly. I wonder how mature it is
<re_irc> <@dirbaio:matrix.org> so, on the SPI ManagedCs traits
<re_irc> <@dirbaio:matrix.org> Would this make sense?
<re_irc> <@dirbaio:matrix.org> pub trait SpiDevice {
<re_irc> <@dirbaio:matrix.org> ```rust
<re_irc> <@dirbaio:matrix.org> type Transaction<'a>: spi::ReadWrite where Self: 'a;
<re_irc> <@dirbaio:matrix.org> fn transaction<'a>(&'a mut self) -> Result<Self::Transaction<'a>, Self::Error>;
<re_irc> <@dirbaio:matrix.org> }
<re_irc> <@dirbaio:matrix.org> `spi::ReadWrite` is the "classic" SPI trait that has read/write/transfer/etc
<re_irc> <@dirbaio:matrix.org> it represents "ownership over the bus"
<re_irc> <@dirbaio:matrix.org> while SpiDevice represents "ownership over a single SPI device in the (possibly shared) bus"
<re_irc> <@dirbaio:matrix.org> so you can't directly read/write to it, you "start a transaction", which locks the entire bus and lowers CS
<re_irc> <@dirbaio:matrix.org> then you can read/write/transfer etc on the Transaction, possibly multiple times
<re_irc> <@dirbaio:matrix.org> then you drop it, which automatically deasserts CS
<re_irc> <@dirbaio:matrix.org> it's implementing the idea here, although slightly differently https://github.com/rust-embedded/embedded-hal/issues/299
<re_irc> <@dirbaio:matrix.org> what I like about it is you "explicitly" start the transaction, so you can do multiple reads/writes on it
<re_irc> <@dirbaio:matrix.org> so the Transactional traits to do "multiple operations within a single transaction" are no longer needed maybe...??