aboutsummaryrefslogtreecommitdiff
path: root/examples/nrf
Commit message (Collapse)AuthorAgeFilesLines
...
* futures: move select* and join* to separate modules.Dario Nieuwenhuis2022-08-291-1/+1
|
* sync: flatten module structure.Dario Nieuwenhuis2022-08-226-6/+6
|
* split `embassy-util` into `embassy-futures`, `embassy-sync`.Dario Nieuwenhuis2022-08-228-15/+16
|
* Remove Forever, switch to static_cell.Dario Nieuwenhuis2022-08-226-23/+24
|
* Split embassy-time from embassy-executor.Dario Nieuwenhuis2022-08-1843-67/+68
|
* Remove HAL initialization from #[embassy::main] macro.Dario Nieuwenhuis2022-08-1740-79/+100
|
* Update to critical-section 1.0, atomic-polyfill 1.0Dario Nieuwenhuis2022-08-171-1/+1
|
* Split embassy crate into embassy-executor, embassy-util.Dario Nieuwenhuis2022-07-2943-157/+157
|
* Trait for UsbSupplyhuntc2022-07-095-90/+24
| | | | Eliminated a signal by using a simpler trait method that returns whether VBus power is available. Also includes a UsbSupply that can be signalled for use with the nRF softdevice. Includes the requirement for waiting for power to become available.
* Puts in the machinery to handle power detected/removedhuntc2022-07-071-33/+5
|
* Introduces EnabledUsbDevicehuntc2022-07-071-7/+31
| | | | EnabledUsbDevice is a wrapper around the UsbDevice where their enablement is also subject to external events, such as POWER events for nRF. It is introduced generically to support other platforms should they also require external signalling for enablement.
* Merge #817bors[bot]2022-06-211-0/+106
|\ | | | | | | | | | | | | | | | | | | | | | | 817: Added a pubsub channel implementation r=lulf a=diondokter This is similar to Tokio's Broadcast channel, except that it doesn't allocate. The publishers and subscribers are dynamic. They use an &dyn channel reference because it's really annoying to have to specify the mutex and const generics every time. Do we need fully generic types as well? Co-authored-by: Dion Dokter <[email protected]> Co-authored-by: Dion Dokter <[email protected]>
| * Added example and some defmtDion Dokter2022-06-211-0/+106
| |
* | Merge pull request #822 from embassy-rs/remove-authorsDario Nieuwenhuis2022-06-181-1/+0
|\ \ | | | | | | Remove the authors field from Cargo.tomls
| * | Remove the authors field from Cargo.tomlsDario Nieuwenhuis2022-06-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It currently contains whoever was first to write some code for the crate, even if many more people have contributed to it later. The field is "sort of" deprecated, it was made optional recently: https://rust-lang.github.io/rfcs/3052-optional-authors-field.html Due the the reasons listed there I believe removing it is better than setting it to generic fluff like "The Embassy contributors".
* | | Add env DEFMT_LOG=trace to all examples.Dario Nieuwenhuis2022-06-181-0/+3
|/ /
* / Update rust nightly. (#819)Dario Nieuwenhuis2022-06-181-1/+0
|/
* Run rustfmt.Dario Nieuwenhuis2022-06-1241-268/+138
|
* Merge #806bors[bot]2022-06-122-3/+3
|\ | | | | | | | | | | | | | | | | | | 806: Add embassy-cortex-m crate. r=Dirbaio a=Dirbaio - Move Interrupt and InterruptExecutor from `embassy` to `embassy-cortex-m`. - Move Unborrow from `embassy` to `embassy-hal-common` (nothing in `embassy` requires it anymore) - Move PeripheralMutex from `embassy-hal-common` to `embassy-cortex-m`. Co-authored-by: Dario Nieuwenhuis <[email protected]>
| * Add embassy-cortex-m crate.Dario Nieuwenhuis2022-06-122-3/+3
| | | | | | | | | | | | - Move Interrupt and InterruptExecutor from `embassy` to `embassy-cortex-m`. - Move Unborrow from `embassy` to `embassy-hal-common` (nothing in `embassy` requires it anymore) - Move PeripheralMutex from `embassy-hal-common` to `embassy-cortex-m`.
* | Rename channel to mpmchuntc2022-06-125-5/+5
|/ | | | I've renamed the channel module for the MPMC as mpmc. There was a previous debate about this, but I feel that the strategy here avoids importing `channel::channel`. The change leaves `signal::Signal`, but I think that's ok. It is all a bit subjective of course. The bottom line for me is that I really like the term mpmc - it means something to me and aligns with broader naming e.g. in Tokio.
* Merge #781 #785bors[bot]2022-05-311-35/+40
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 781: embassy-net v2 r=Dirbaio a=Dirbaio - No more `dyn` - It's no longer a global singleton, you can create muliple net stacks at once. - You can't tear them down though, the Device it still has to be `'static` due to restrictions with smoltcp's "fake GAT" in the Device trait. :( - Removed `_embassy_rand` hack, random seed is passed on creation. 785: stm32: g0: add PLL clock source r=Dirbaio a=willglynn STM32G0 SYSCLK can be sourced from PLLRCLK. Given that the HSI runs at 16 MHz and the HSE range is 4-48 MHz, the PLL is the only way to reach 64 MHz. This commit adds `ClockSrc::PLL`. The PLL sources from either HSI16 or HSE, divides it by `m`, and locks its VCO to multiple `n`. It then divides the VCO by `r`, `p`, and `q` to produce up to three associated clock signals: * PLLRCLK is one of the inputs on the SYSCLK mux. This is the main reason the user will configure the PLL, so `r` is mandatory and the output is enabled unconditionally. * PLLPCLK is available as a clock source for the ADC and I2S peripherals, so `p` is optional and the output is conditional. * PLLQCLK exists only on STM32G0B0xx, and exists only to feed the MCO and MCO2 peripherals, so `q` is optional and the output is conditional. When the user specifies `ClockSrc::PLL(PllConfig)`, `rcc::init()` calls `PllConfig::init()` which initializes the PLL per [RM0454]. It disables the PLL, waits for it to stop, enables the source oscillator, configures the PLL, waits for it to lock, and then enables the appropriate outputs. `rcc::init()` then switches the clock source to PLLRCLK. `rcc::init()` is now also resonsible for calculating and setting flash wait states. SYSCLCK < 24 MHz is fine in the reset state, but 24-48 MHz requires waiting 1 cycle and 48-64 MHz requires waiting 2 cycles. (This was likely a blocker for anyone using HSE >= 24 MHz, with or without the PLL.) Flash accesses are now automatically slowed down as needed before changing the clock source, and sped up as permitted after changing the clock source. The number of flash wait states also determines if flash prefetching will be profitable, so that is now handled automatically too. [RM0454]: https://www.st.com/resource/en/reference_manual/rm0454-stm32g0x0-advanced-armbased-32bit-mcus-stmicroelectronics.pdf Co-authored-by: Dario Nieuwenhuis <[email protected]> Co-authored-by: Will Glynn <[email protected]>
| * WIP embassy-net v2Dario Nieuwenhuis2022-05-251-35/+40
| |
* | Implement BufRead for nrf BufferedUartechemicstry2022-05-261-15/+5
|/
* Make embassy-net nightly-only.Dario Nieuwenhuis2022-05-191-2/+2
| | | | | It's useless without async traits, so juggling the `nightly` feature around is not worth the pain.
* Update embedded-io to 0.3Dario Nieuwenhuis2022-05-191-1/+1
|
* Merge branch 'embassy-rs:master' into qdecHenrik Alsér2022-05-124-5/+19
|\
| *-. Merge #763 #766bors[bot]2022-05-124-5/+19
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 763: Misc USB improvements r=Dirbaio a=Dirbaio The "simplify control in/out handlng" commit gives a -2kb code size improvement. 766: Make usb_serial examples work on windows r=Dirbaio a=timokroeger Windows shows `error 10` when using CDC ACM on non composite devices. Workaround is to use IADS: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help Co-authored-by: Dario Nieuwenhuis <[email protected]> Co-authored-by: Timo Kröger <[email protected]>
| | | * Make usb_serial examples work on windowsTimo Kröger2022-05-122-0/+14
| | |/ | |/| | | | | | | | | | | | | Windows shows `error 10` when using CDC ACM on non composite devices. Workaround is to use IADS: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
| | * usb: remove address arg from endpoint allocation.Dario Nieuwenhuis2022-05-094-5/+5
| |/
* | Merge branch 'embassy-rs:master' into qdecHenrik Alsér2022-05-073-5/+8
|\|
| * Replace embassy::io with embedded_io.Dario Nieuwenhuis2022-05-073-5/+8
| |
* | Change example pinsHenrik Alsér2022-05-071-3/+2
| |
* | Add qdec moduleHenrik Alsér2022-05-071-0/+29
|/
* net: add functions to get current Eth and IP configDario Nieuwenhuis2022-05-021-1/+1
|
* executor: Add `Spawner::for_current_executor`.Dario Nieuwenhuis2022-04-261-0/+24
|
* examples/nrf: add self_spawn example.Dario Nieuwenhuis2022-04-251-0/+24
| | | | | This serves as a compile-test of possible typecheck loops due to TAIT shenanigans.
* executor: fix unsoundness in InterruptExecutor::start.Dario Nieuwenhuis2022-04-251-6/+4
| | | | | | | The initial closure is not actually called in the interrupt, so this is illegally sending non-Send futures to the interrupt. Remove the closure, and return a SendSpawner instead.
* examples/nrf: add product strings to all usb examples.Dario Nieuwenhuis2022-04-244-6/+17
|
* Add embassy-usb-ncm. Implements USBB CDC NCM (Ethernet over USB)Dario Nieuwenhuis2022-04-242-1/+280
|
* Add embedded-storage trait impls for QSPIUlf Lilleengen2022-04-192-6/+4
| | | | | | | | | | * Adds implementations of embedded-storage and embedded-storage-async for QSPI * Add blocking implementations of QSPI * Use blocking implementation in new() and embedded-storage impls * Use async implementation in embedded-storage-async impls * Add FLASH_SIZE const generic parameter * Own IRQ in Qspi to disable it on drop
* usb: rename UsbDeviceBuilder -> Builder.Dario Nieuwenhuis2022-04-164-8/+8
|
* usb-hid: add Config struct, to avoid too many params.Dario Nieuwenhuis2022-04-162-17/+16
|
* usb-hid: Simplify API.Dario Nieuwenhuis2022-04-162-11/+11
| | | | | | | | | | - Renamed structs to HidReaderWriter, HidReader, HidWriter. - Removed unused const generics on `State`. - Simplified generics on `HidReaderWriter`. The class type previously was `HidClass<D, Driver<'d, USBD>, ReportReader<'d, Driver<'d, USBD>, OUT_N>, IN_N>` It's now `HidClass<D, Driver<'d, USBD>, IN_N, OUT_N>`. Note that the driver type `Driver<'d, USBD>` is no longer repeated. - Constructors are now: `HidWriter::new()` for IN-only, `HidReaderWriter::new()` for IN+OUT. No complicated bounds. - HidReaderWriter has all the methods from HidReader, HidWriter.
* Split UsbDevice::run into run and run_until_suspendalexmoon2022-04-131-28/+32
|
* Remove channel and make run future cancelablealexmoon2022-04-131-14/+49
|
* Remote wakeup bug fixesalexmoon2022-04-131-12/+12
|
* Add DeviceStateHandler, DeviceCommand channel, and remote wakeup supportalexmoon2022-04-134-10/+113
|
* Unify ReadError and WriteError into EndpointErroralexmoon2022-04-092-28/+10
|
* Merge #657bors[bot]2022-04-077-161/+520
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 657: Async usb stack r=Dirbaio a=Dirbaio TODO - [x] Make it work on nRF - [x] Add a way for classes to handle their own EP0 control requests - thanks `@alexmoon!` - [x] Handle CONTROL OUT requests with data. - [ ] Impl AsyncRead/AsyncWrite for CDC ACM -- will do later, it's not trivial - [x] Cleanup unwraps/asserts/panics - [x] Cleanup logs (make everything trace/debug, not info) - [ ] Port synopsys-usb-otg - [ ] Port stm32-usbd - [ ] Add more classes? HID, MSD? Co-authored-by: Dario Nieuwenhuis <[email protected]> Co-authored-by: alexmoon <[email protected]>