36 Commits

Author SHA1 Message Date
ivmarkov
48834fb1ae Make the TX and RX side more coherent 2022-11-12 14:08:26 +02:00
ivmarkov
35609be6b6 Convenience methods and types for the single SPI device case 2022-11-12 13:48:23 +02:00
ivmarkov
a78dc8c86d Fix the RMT driver 2022-11-12 13:30:32 +02:00
enelson1001
8e312529b9
Add RMT receiver (#104)
* Add RMT receiver

* Changed line 891 to rmt_item32_t,
Changed line 835 to carrier_rm

* rmt.rs - changed line 891 to rmt_item32_t
rmt.rs - changed line 835 to carrier_rm

* Changed rmt channel implementation

* wrong rx_config_t field name

* More cleanup from rebase

* Fix cargo fmt check errors

* guess #1 to fix errors

* Try to fix clippy error

* Can't use log change to println
Change gpio pins for esp32-c3

* old update to esp-idf-hal newer one coming

* Fix format errors

* Update TxRmtDriver and RxRmtDriver

* Fix compile errors

* fix rmt_morse_code.rs error

* Fix format failure

* Fix more errors

* Fix examples

* Change PulsePair durationX type
 - use u16 instead of PulseTicks

Co-authored-by: enelson1001 <ednelson5080@gmail>
2022-11-12 13:01:37 +02:00
ivmarkov
fcbba08fe3 Symmetry with SPI 2022-11-12 12:56:54 +02:00
Frederick Vollbrecht
13ba61fb0b
RFC: Multi CS Spi Implementation (#150)
* initial draft

* working alternative without using i32 id's

* EspSpiDevice + SpiDriverMaster / no global statics

* start splitting implementation in spi & spi_pool

* impl SpiDevice for EspSpiDevice

* spi2_pool draft (spi with software based cs)

* pre master fetch up

* Driver accepts Optional DMA channel + fetch master

* replaced: std with core, mutex with hal's cs

* replaced HashMap with Array

* merged spi2 into spi

* clean up

* replace std with core

* updated loopback example,  spi takes dma directly

* moved criticalsection guard out of spi to spi_pool

* added paragraph to the release.md

* rm fn to add / rm device from bus or update config

* rm stored config from EspSpiDevice

* fmt'd

* grammer + changelog update

* implements inverted chipselect for spi.rs #119

* device with optional cs + guarded soft_cs wrapper

* fmt'd

* add pre / post cs delay functionality for wrapper

* no bus.finish for dev with no cs. partial fix #99

* spi driver renaming

* updated naming + locking with &mut SpiDeviceDriver

* updated naming + locking with &mut SpiDeviceDriver

* clean up

* updated CHANGELOG
2022-11-12 08:54:16 +02:00
monacoprinsen
8cd8c8c207
spi/adc_st7789_example (#125)
* spi_st7789_example

* added adc example

* added ADC example

* spi and adc examples

* updated adc_st7789 example

* removed st7789 adc example

* adc up to date

* clippy and fmt

* added dependencies

* adjusted path to assets

* changed adc pin

* added compile flags

* path
2022-11-08 18:27:37 +02:00
ivmarkov
d6370068ef Move all peripheral generics into the constructors 2022-11-01 10:00:24 +02:00
Ronen Ulanovsky
db54a533b1 Fixup riscv-ulp-hal delay and examples 2022-10-07 20:53:26 +03:00
ivmarkov
22ab6f272a Native delay API does not need self 2022-09-25 12:17:59 +03:00
ivmarkov
83c1ebf4b7 Native delay API does not need self 2022-09-25 12:00:51 +03:00
ivmarkov
f094e1c688 Native delay API does not need self 2022-09-25 11:11:02 +03:00
ivmarkov
574e9764e7 Native delay API does not need self 2022-09-25 11:08:08 +03:00
ivmarkov
bdd6205a09 Replace STD delays with HAL ones 2022-09-25 10:44:24 +03:00
ivmarkov
ace34ce3e5 Remove unused imports 2022-09-25 10:42:13 +03:00
ivmarkov
98b3d98884 Fix the i2c example 2022-09-25 10:41:46 +03:00
ivmarkov
0a2687234a Rename Config back to TransmitConfig 2022-09-22 09:34:58 +03:00
ivmarkov
7d780ab62a fix uart example 2022-09-18 11:01:33 +03:00
ivmarkov
7dc4d9cc5f Fix examples 2022-09-18 11:01:33 +03:00
Ivan Markov
7f1f23e2aa Fix examples
Fix examples

Fix examples

Fix examples

Fix examples

Fix examples
2022-09-18 11:01:33 +03:00
Ivan Markov
905cd5233e Fix examples
Fix examples
2022-09-18 11:01:33 +03:00
Ivan Markov
dce2a16401 fix examples
Fix examples
2022-09-18 11:01:33 +03:00
Ivan Markov
21fb86b36b Fix examples
Fix examples
2022-09-18 11:01:33 +03:00
Ivan Markov
baf9bae9a9 Fix examples
Fix examples

Fix examples

Fix examples

Fix examples
2022-09-18 11:01:33 +03:00
Ivan Markov
9a1ade644f Update examples
Restore LedcTimerDriver

Fix the ledc driver code
2022-09-18 11:01:33 +03:00
Albin Hedman
617a7b3dcb Make RMT examples compile for ESP32 and ESP32-C2 2022-07-07 19:08:30 +03:00
Brendan Horan
076390200a
Fix SPI loopback exmaple -- mixed up SDI and SDO (#72)
* Fix SPI loopback exmaple

Fix SDI and SDO been mixed up in example
Update to new names

* change SPI println back to orignal

* run cargo fmt
2022-05-16 13:52:58 +01:00
Dominic Fischer
b134d3dbc6
Migrate to e-hal 1.0.0-alpha.8 (#61)
* Migrate e-hal 1.0.0-alpha.8

* Implement SpiDevice trait

* Fix bugs after real testing

* Fix transfer
2022-04-17 08:14:39 +03:00
gak
2b6fe48fa0
WIP: RMT (tx) (#44)
* WIP: Initial tx rmt implementation

* Rename Bulder to Config to line up with other mods

* WIP Potential traits for a "pulses" mod in embedded-hal

* WIP: Initial tx rmt implementation

* Rename Bulder to Config to line up with other mods

* WIP Potential traits for a "pulses" mod in embedded-hal

* Copied example code from ledc fork. Semi-working example.

* Rename level to pulse. dev-dep versions.

* WIP RMT, Examples

* WIP RMT Fix neopixel example

* WIP RMT morse code work

* WIP RMT fixed morse example

* WIP RMT more config, docs.

* WIP RMT fix compilation

* WIP RMT Fix doc comment in example.

* WIP RMT: notes on examples

* WIP RMT Group up same level config items.

* WIP RMT Change half_inserted to an Option

* WIP RMT Don't need to return Result in clear()

* WIP RMT Config refactor. Into for enum.

* Result instead of Option in PulseTick

* Don't use floats for ticks calcs

* WIP Duration for ticks

* Cleanups.

* Moved Duration logic into PulseDuration.

* Remove unused tick_hz field.

* Cleanups.

* WIP playing around with generics

* Refactored out Vec storage out of Writer

* WIP Heap and Stack implementations for data

* WIP about to nuke tricky const code

* Cleanups

* Own PinState. start/start_blocking.

* Wrap duty percent with range safety.

* Use units::Hertz

* Use Hertz in ticks_hz

* Stop transmitting implementation

* Fix morse example

* rmt peripheral for channels (4 for now)

* Small tweaks

* Morse example to demo more functionality

* WIP Fixes and testing functionality

* Cleanups and notes

* Assign devices to number of channels. Cleanups.

* Sprinkled TODO's around for docs/fixes

* Longer messages don't repeat so remove it for now

* Rename data to signal because data is a too generic term

* More docs

* Don't mention receiving in description.

* More docs

* Rename `add` to `push` like Vec. More docs.

* Rename `Writer` to `Transmit` to line up with rmt docs.

* Accidentally had idle_level in carrier config.

* More docs and cleanups. std compatibility.

* Remove chip::HwChannel import because of a * import later.

* Separate duration to ticks calc. Music example.

* Added comment on example.

* clippy: ok_or_else, Default.

* fixes: mut self, allows/features, alloc, &Pulse.

* only need feature alloc for the use warning.

* rename Signal implementations

* Alloc, morse example fix.

* Didn't need that map. iter does the ref.

* Clippy repairs. println! instead of info!
2022-03-02 19:11:30 +02:00
ivmarkov
c09abd72f7 Examples should build now 2022-02-20 20:11:46 +02:00
ivmarkov
a47d38b919 Remove esp_idf_svc references from examples 2022-02-20 19:26:37 +02:00
ivmarkov
fe7fca8c0a Fix the example that relies on e-hal-1.0... 2022-02-20 19:06:38 +02:00
ivmarkov
36e146c615 Remove the esp-idf-svc dependency 2022-02-20 18:18:27 +02:00
ivmarkov
04b124921c Update to e-hal-1.0.alpha7 and e-hal-0.2.7 2022-02-20 18:08:31 +02:00
Björn Quentin
e57736e4c2
Add some basic examples (#46) 2022-02-20 15:14:36 +02:00
Christian Meusel
8fc7e6d35d
Add basic driver for LEDC (#43)
* Add basic LEDC driver

This driver allows to configure timers and channels but does not provide
advanced features like fading

* Added missing impl_channels.

* Use non-raw types for LEDC hw "handle" markers

This makes Timer and Channel Sync again.

* Add missing config and deps for dev building examples

* Add simple example for LEDC driver

* Channel changed to hold Timer as Borrow<>, to allow Arc etc.

* Provide unstable options from config.toml

This allows to build and run examples of this crate with cargo-espflash
1.2.0 which does not support passing unstable options.

* Provide ESP_IDF_SDKCONFIG_DEFAULTS from config.toml

This requires only to specify the target for a build explicitly.

* Use main task stack size from rust-esp32-std-demo

* Add multi-threaded example for LEDC

* Clean up ledc example and formatting

* Add note on running examples from this repository

* Fix build for ULP HAL

This LEDC interface is not available there.

* Build examples in CI too

* Use core types for no_std build of ledc

* Init channel config and hpoint with Default

This makes the initialization compatible with ESP IDF 4.3 and 4.4 where
the new field 'flag' has been added. As the default for hpoint was
previously zero, omitting it allows to use ..Default::default() in the
struct initialization in both cases.

* Install ldproxy in CI for building examples

It gets installed just before building examples because this takes its
time and should not delay other builds.

Co-authored-by: yunta <maciej.blomberg@mikoton.com>
2022-02-05 18:57:46 +02:00