aboutsummaryrefslogtreecommitdiff
path: root/examples/nrf/src/bin
Commit message (Collapse)AuthorAgeFilesLines
...
| * rename to UsbBusJacob Rosenthal2021-12-151-2/+2
| |
| * sorta works, too many interupts?Jacob Rosenthal2021-12-141-3/+3
| |
| * dont expose embedded_hal_common::usbJacob Rosenthal2021-12-141-6/+2
| |
| * revertJacob Rosenthal2021-12-141-2/+4
| |
| * make send, consolidate usb typesJacob Rosenthal2021-12-131-4/+2
| |
| * stub out the embassy registers for usbdJacob Rosenthal2021-12-131-2/+4
| |
| * usb feature gateJacob Rosenthal2021-12-121-1/+1
| |
| * nrf-usbdJacob Rosenthal2021-12-121-0/+94
| |
* | nrf/gpio: add infallible inherent methods, remove some duplication.Dario Nieuwenhuis2021-12-203-16/+12
| | | | | | | | This implements Input and Output using FlexPin, to avoid some code duplication.
* | Merge #544bors[bot]2021-12-161-0/+68
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 544: Introduces split on the nRF Uarte r=Dirbaio a=huntc A new `split` method is introduced such that the Uarte tx and rx can be used from separate tasks. An MPSC is used in an example to illustrate how data may be passed between these tasks. The approach taken within the `Uarte` struct is to split into tx and rx fields on calling `Uarte::new`. These fields are returned given a call to `Uarte::split`, but otherwise, if that call isn't made, then the API remains as it was before. Here's a snippet from a new example introduced: ```rust #[embassy::main] async fn main(spawner: Spawner, p: Peripherals) { // ... let uart = uarte::Uarte::new(p.UARTE0, irq, p.P0_08, p.P0_06, NoPin, NoPin, config); let (mut tx, rx) = uart.split(); // ... // Spawn a task responsible purely for reading unwrap!(spawner.spawn(reader(rx, s))); // ... // Continue reading in this main task and write // back out the buffer we receive from the read // task. loop { if let Some(buf) = r.recv().await { info!("writing..."); unwrap!(tx.write(&buf).await); } } } #[embassy::task] async fn reader(mut rx: UarteRx<'static, UARTE0>, s: Sender<'static, Noop, [u8; 8], 1>) { let mut buf = [0; 8]; loop { info!("reading..."); unwrap!(rx.read(&mut buf).await); unwrap!(s.send(buf).await); } } ``` Co-authored-by: huntc <[email protected]>
| * | Introduces split on the nRF Uartehuntc2021-12-151-0/+68
| | | | | | | | | | | | A new `split` method is introduced such that the Uarte tx and rx can be used from separate tasks. An MPSC is used to illustrate how data may be passed between these tasks.
* | | Merge #542bors[bot]2021-12-142-8/+6
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 542: nrf/gpiote: remove PortInput, move impls to Input/FlexPin. r=Dirbaio a=Dirbaio `PortInput` is just a dumb wrapper around `Input`, it has no reason whatsoever to exist. This PR moves the `wait_for_x` functionality to `Input` directly. It also adds it to `FlexPin` for completeness and consistency with `Input`. (The reason `PortInput` exists is a while ago `GPIOTE` was an owned singleton that you had to initialize, so `PortInput::new()` would require it to enforce it's been initialized. This doesn't apply anymore now that GPIOTE is "global") Co-authored-by: Dario Nieuwenhuis <[email protected]>
| * | nrf/gpiote: remove PortInput, move impls to Input.Dario Nieuwenhuis2021-12-142-8/+6
| | |
| * | Revert blinky changes for nowUlf Lilleengen2021-12-101-11/+8
| | |
| * | More contentUlf Lilleengen2021-12-101-8/+11
| | |
* | | Documents the nRF BufferedUarte problemhuntc2021-12-121-3/+3
| |/ |/| | | | | Please see https://github.com/embassy-rs/embassy/issues/536 for the rationale.
* | Provides AsyncWrite with flushhuntc2021-12-101-0/+3
|/ | | | As per Tokio and others, this commit provides a `poll_flush` method on `AsyncWrite` so that a best-effort attempt at wakening once all bytes are flushed can be made.
* Removed unsafe from uartehuntc2021-12-012-19/+16
| | | | The constructors themselves are not strictly unsafe. Interactions with DMA can be generally unsafe if a future is dropped, but that's a separate issue. It is important that we use the `unsafe` keyword diligently as it can lead to confusion otherwise.
* Merge #486bors[bot]2021-11-261-0/+73
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 486: Pwm ppi events r=Dirbaio a=jacobrosenthal More PWM yak shaving. I was going to do some safe pwm ppi events stuff but I just dont think it fits this api design.. ppi is just very low level, im not sure how safe it will be in general * first we should probably have borrows of handlers for ppi with lifetime of the peripheral? hal does https://github.com/nrf-rs/nrf-hal/blob/eb4ba6ae4204c7f58fc968e57b2995df15f5ac77/nrf-hal-common/src/pwm.rs#L714-L716 * in general having access to tasks can put the state in some configuration the api doesnt understand anymore. for `SequencePwm` ideally id hand you back either only seq_start0 or seq_start1 because youd only use one based on if your `Times` is even or odd.. but again we only know that with this api AFTER start has been called. I dont think were ready for typestates SO I figured why not add the pwm ppi events but make them unsafe and commit this example since I started it. Somewhat related drop IS removing the last duty cycle from the pin correctly, but stop DOES NOT..the only thing that sets the pin back is pin.conf() as far as I can tell, so I tried to document that better and got rid of stop for the `SimplePwm` again since that doesnt need it then. However its ackward we dont have a way to unset the pwm without setting a new sequence of 0s, or dropping the peripheral Co-authored-by: Jacob Rosenthal <[email protected]>
| * nrf: sequencepwm add eventsJacob Rosenthal2021-11-131-0/+73
| |
* | Fix interrupt_take macro by specifying path to panic macro.Matous Hybl2021-11-2313-13/+4
|/
* pwm_sequence show implicit and explicit stop functionalityJacob Rosenthal2021-11-111-3/+6
|
* pwm_servo example comment for clarityJacob Rosenthal2021-11-111-0/+1
|
* nrf: dump the pwm_sequence example for clarityJacob Rosenthal2021-11-112-129/+9
| | | | It is basically impossible to directly convert that example to a sequence for various reasons. You cant have multiple channels on same buffer with one sequence instance for starters, also at that clock rate and max_duty 1 period is far longer than the 3ms it was using, which would require using a new max_duty and thus require regenerating the sine table which makes it not representitive of the original example anymore
* nrf: sequencepwm rename top to max_duty for consistancyJacob Rosenthal2021-11-111-1/+1
|
* fixJacob Rosenthal2021-11-111-2/+2
|
* fixJacob Rosenthal2021-11-111-2/+8
|
* pwm_sequence consume bufferJacob Rosenthal2021-11-111-7/+1
|
* remove unstable feature and dependency, and make pwm_sequence a near mirror ↵Jacob Rosenthal2021-11-102-58/+87
| | | | of pwm example
* fix examples for mut self set_dutyJacob Rosenthal2021-11-103-3/+3
|
* make SequenceConfig struct is consistent with other Config structs, that are ↵Jacob Rosenthal2021-11-032-26/+23
| | | | always non_exhaustive and have a Default
* rename to SimplePwm and SequencePwmJacob Rosenthal2021-11-035-11/+12
|
* restore example and add set_time_stretch apiJacob Rosenthal2021-11-032-29/+132
|
* rename error enum againJacob Rosenthal2021-11-022-2/+2
|
* seperate start from pwmseq::newJacob Rosenthal2021-11-012-3/+3
|
* seperate sequence from duty cycle pwm structJacob Rosenthal2021-11-012-7/+11
|
* led dimming example, dont need to keep all examples, just covering ground to ↵Jacob Rosenthal2021-11-011-0/+47
| | | | test api
* generalize new and change pwm example to a servoJacob Rosenthal2021-11-011-82/+29
|
* better not as a constructor?Jacob Rosenthal2021-11-012-12/+10
|
* reduce complexity of loopmodeJacob Rosenthal2021-11-012-3/+3
|
* documentationJacob Rosenthal2021-11-012-2/+2
|
* stop->sequence_stopJacob Rosenthal2021-10-311-1/+1
|
* add ability to configure loop count from 1 to infiniteJacob Rosenthal2021-10-302-11/+14
|
* a runtime generated sin table exampleJacob Rosenthal2021-10-291-0/+41
|
* simplify api, more interesting exampleJacob Rosenthal2021-10-291-7/+7
|
* simple_playback api from nrf sdkJacob Rosenthal2021-10-291-0/+41
|
* Fixed examplesDion Dokter2021-10-262-4/+2
|
* Another redo using the feedback.Dion Dokter2021-10-263-18/+14
| | | | | PPI is now split up into PPI and DPPI under the name 'interconnect'. The tasks and events are tracked and reset in the drop function.
* Fixed examples and added defmt format to the new error typesDion Dokter2021-10-262-4/+4
|
* - Added _ppi and _dppi to distinguish between the new and the old peripheral.Dion Dokter2021-10-261-9/+9
| | | | | | - Removed ConfigurableChannel and added capacity numbers to the channels - Replaced the PPI api with a new one using the DPPI terminology (publish & subscribe) - Updated all tasks and event registers for DPPI