Rust Embedded

314 Members
Welcome to the Rust Embedded chat room! | Bridged to Freenode IRC: #rust-embedded | Public logs: https://freenode.logbot.info/rust-embedded/ | Discuss, coordinate, help: https://github.com/rust-embedded/wg | Code of conduct: https://www.rust-lang.org/conduct.html41 Servers

Load older messages

2 Jul 2020
@mtthw.meyer:matrix.orgmtthw.meyerDMA def feels a bit raw still17:59:39
@mtthw.meyer:matrix.orgmtthw.meyerI'm going to hardcode settings that work for my board first then go back and make it more general. We'll need to discuss how much of it we want to generalize because there are ALOT of settings.18:10:43
@mtthw.meyer:matrix.orgmtthw.meyerMaking it somewhat generalized as I go.18:11:30
@bobmcwhirter:matrix.orgbobmcwhirtergiven I'm a new rust coder, anyone willing to critique this nowhere-near-done embedded-nal TcpStack for an esp8266? https://github.com/drogue-iot/drogue-esp8266/blob/master/src/lib.rs18:24:49
@bobmcwhirter:matrix.orgbobmcwhirterliberally cribbed from someone's ublox TcpStack.18:25:01
@freenode_agg:matrix.orgagg mtthw.meyer: I think you can directly get the address of the register, rather than peripheral base and adding an offset yourself 18:35:43
@mtthw.meyer:matrix.orgmtthw.meyerHmm, it says it wants the "base address". So it just wants the block location vs the specific data reg?18:38:18
@freenode_agg:matrix.orgaggNot sure for SAI, does it have its own DMA or is this using the main DMA peripheral? Usually you program the specific register address you want it to read/write18:39:18
@mtthw.meyer:matrix.orgmtthw.meyerMain DMA. DMA_SxPAR18:40:03
@mtthw.meyer:matrix.orgmtthw.meyerYeah I guess it wants the data reg addr directly18:41:44
@freenode_Lumpio-:matrix.orgLumpio-Which chip is it18:41:58
@freenode_Lumpio-:matrix.orgLumpio-lol how many DMA controllers does this thing have18:42:57
@mtthw.meyer:matrix.orgmtthw.meyerAll of them.18:43:04
@freenode_Lumpio-:matrix.orgLumpio- >MDMA controller 18:43:10
@freenode_Lumpio-:matrix.orgLumpio- That's illegal 18:43:12
@freenode_Lumpio-:matrix.orgLumpio- Anyways I'm pretty sure the DMA just wants the peripheral address to write to and nothing else 18:48:19
@freenode_Lumpio-:matrix.orgLumpio-And indeed you can get the register address by just taking the address of the register field and casting it to a suitable integer18:48:46
@mtthw.meyer:matrix.orgmtthw.meyerstm32::SAI1::ptr() as u3218:50:37
@freenode_Lumpio-:matrix.orgLumpio- That's the entire register block 18:52:02
@mtthw.meyer:matrix.orgmtthw.meyerOk well I don't see anything to extract the data reg directly so I can just offset it19:03:48
@adamgreig:matrix.orgadamgreigJust dereference the struct field19:05:20
@adamgreig:matrix.orgadamgreig If you alret have the peripheral instance just like &sai.data as *const u32 as u32 19:05:47
@mtthw.meyer:matrix.orgmtthw.meyerThose structs actually point directly to the reg block like that?19:06:55
@freenode_agg:matrix.orgaggThe struct implements Deref to the RegisterBlock19:14:51
@mtthw.meyer:matrix.orgmtthw.meyer casting &stm32h7::generic::Reg<u32, stm32h7::stm32h743v::sai4::ch::_DR> as *const u32 is invalid 19:19:36
@mtthw.meyer:matrix.orgmtthw.meyeraudio_ch: &stm32::sai4::CH19:20:33
@mtthw.meyer:matrix.orgmtthw.meyer&audio_ch.dr as *const u32 as u3219:20:38

There are no newer messages yet.

Back to Room List