Commit Graph

6369 Commits

Author SHA1 Message Date
bors[bot]
e5d3f01bc4
Merge #868
868: Rename XXBusDevice to XXDevice. r=Dirbaio a=Dirbaio

I think the current naming is a bit odd, the EH traits are organized as "Bus" vs "Device", and XxxBusDevice is a Device (not a Bus, not both)

`@kalkyl` 

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-07-18 18:15:03 +00:00
Dario Nieuwenhuis
a3a40bad6c Rename XXBusDevice to XXDevice. 2022-07-18 20:02:05 +02:00
Dario Nieuwenhuis
726d68a706 Add status and instructions in README. 2022-07-17 00:34:41 +02:00
Dario Nieuwenhuis
54269a0761 Switch default log to debug.
Trace is very VRYY verbose.
2022-07-17 00:34:27 +02:00
Dario Nieuwenhuis
13c88a9ca3 Obtain the firmware blobs from the user instead of hardcoding magic flash addrs. 2022-07-17 00:33:30 +02:00
Dario Nieuwenhuis
4205eef3ec Fix iovar_get, unhardcode MAC addr. 2022-07-16 19:25:35 +02:00
bors[bot]
4dc800710d
Merge #853
853: Add embedded_hal_async support for embassy-rp r=Dirbaio a=danbev

This commit adds support for embedded-hal-async to the Embassy
Raspberry PI crate.

Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com>
2022-07-16 16:11:37 +00:00
Dario Nieuwenhuis
931e3d7ee0 Switch to 32bit SPI. 2022-07-16 18:06:57 +02:00
Dario Nieuwenhuis
7dfdea8797 Switch to embedded-hal SPI, GPIO traits. 2022-07-16 08:26:54 +02:00
bors[bot]
9d388d357a
Merge #866
866: F4 flash fixes r=Dirbaio a=chemicstry

This discontinuous flash sector layout is too cursed and I left some mistakes in last PR. Erasing last sector did not work and it wasn't possible to erase between memory banks for 1MB dual-bank devices. So I changed the erase function to iterate over memory addresses (which is continuous) instead of sector numbers.

It should also be possible to implement erase across memory banks for H7, but it requires special handling for write too. I don't have an H7 to test now so left it as is.

I wasn't sure how to add tests to `embassy-stm32` and it seems that there are none, except for `subghz`, but no test runner? Anyway, I tested the `get_sector` on playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=13b59339fe6c70a3249e6183e81f869e

Also fixed erase alignment requirements on `Flash::blocking_erase()`, as it previously only checked alignment on size, but not on offsets.

P.S. the diff is a bit messed up, I recommend looking at files directly

Co-authored-by: chemicstry <chemicstry@gmail.com>
2022-07-15 06:19:05 +00:00
chemicstry
0b70cc554e Fix unused imports 2022-07-14 21:45:44 +03:00
chemicstry
f0027c9fe0 Require erase address to be aligned to page size 2022-07-14 21:21:46 +03:00
chemicstry
5a265661bb Fix erasing across banks 2022-07-14 20:58:01 +03:00
chemicstry
039acda3a8 Fix writing to last sector of F4 flash 2022-07-14 19:41:39 +03:00
Daniel Bevenius
8979959dd1 Add embedded_hal_async support for embassy-rp
This commit adds support for embedded-hal-async to the Embassy
Raspberry PI crate.
2022-07-14 13:52:22 +02:00
Dario Nieuwenhuis
31410aa5b7 update rust nightly to match embassy. 2022-07-13 21:22:52 +02:00
bors[bot]
5318fe404b
Merge #865
865: Update Rust nightly. r=Dirbaio a=Dirbaio

Includes fix for https://github.com/rust-lang/rust/issues/98890 which has been annoying me in a few projects.

bors r+

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-07-13 18:41:57 +00:00
Dario Nieuwenhuis
b602a28374 Update Rust nightly. 2022-07-13 20:40:58 +02:00
Dario Nieuwenhuis
5e0f392aa3
Merge pull request #864 from jdswensen/jds/fixes
fix: doc: use master branch for basic example link
2022-07-13 04:11:46 +02:00
Jake Swensen
a38f9e03fa fix: doc: use master branch for basic example link 2022-07-12 20:58:19 -05:00
bors[bot]
7c8dffeb12
Merge #863
863: Add more convenience GPIO functions r=Dirbaio a=chemicstry

This reduces boilerplate code from:
```rs
if config.pin_high {
    pin.set_high()
} else {
    pin.set_low()
}
```
to
```rs
pin.set_level(config.pin_high.into());
```

Co-authored-by: chemicstry <chemicstry@gmail.com>
2022-07-12 23:56:45 +00:00
chemicstry
53e40860c1 Move all gpio logic to Flex 2022-07-13 02:45:37 +03:00
chemicstry
a335589f34 Change get_set_level to get_output_level 2022-07-13 02:25:09 +03:00
chemicstry
57002875d6 Add convenience GPIO functions to RP 2022-07-13 02:22:46 +03:00
chemicstry
8cebbde101 Add convenience GPIO functions to NRF 2022-07-13 02:21:42 +03:00
chemicstry
329955f718 Use Into conversions instead of matches 2022-07-13 02:08:31 +03:00
chemicstry
98dcce81ca Add more convenience GPIO functions 2022-07-13 01:43:22 +03:00
bors[bot]
e4cacc3bb8
Merge #862
862: Reintroduce Gp16 trait for advanced timers r=Dirbaio a=chemicstry

Based on discussion in #582


Co-authored-by: chemicstry <chemicstry@gmail.com>
2022-07-12 22:12:10 +00:00
chemicstry
2df665da8a Revert "Make advanced timer trait not require general purpose timer trait as the timers are too different."
This reverts commit 4988dfe981.
2022-07-12 15:11:57 +03:00
Dario Nieuwenhuis
ce7353fba4 Hook up embassy-net. IT WORKS. 2022-07-12 07:52:16 +02:00
Dario Nieuwenhuis
de879dba4f
Merge pull request #860 from ant32/typos
fix 2 typos
2022-07-12 05:56:50 +02:00
Philip A Reimer
4070a375c7 fix typo 2022-07-11 21:29:01 -06:00
Dario Nieuwenhuis
f60407feb3 ITS DOING SOMETHING 2022-07-12 05:06:29 +02:00
Dario Nieuwenhuis
e1fd7dfc40 wpa2 join... still nothing. 2022-07-12 04:17:07 +02:00
Dario Nieuwenhuis
18b11e7417 check clmload_status. 2022-07-12 03:34:27 +02:00
Dario Nieuwenhuis
d96ad248b3 Add LICENSEs 2022-07-11 22:53:57 +02:00
Dario Nieuwenhuis
3ffdbd2ca3 stuff 2022-07-11 22:44:42 +02:00
Dario Nieuwenhuis
30b7800f9a add event printing, add join but not working yet. 2022-07-11 05:19:31 +02:00
bors[bot]
2adee4af38
Merge #858
858: embassy-stm32: Simplify time r=Dirbaio a=GrantM11235

- Remove unused `MilliSeconds`, `MicroSeconds`, and `NanoSeconds` types
- Remove `Bps`, `KiloHertz`, and `MegaHertz` types that were only used
for converting to `Hertz`
- Replace all instances of `impl Into<Hertz>` with `Hertz`
- Add `hz`, `khz`, and `mhz` methods to `Hertz`, as well as
free function shortcuts
- Remove `U32Ext` extension trait

Co-authored-by: Grant Miller <GrantM11235@gmail.com>
2022-07-11 02:51:06 +00:00
Grant Miller
5ecbe5c918 embassy-stm32: Simplify time
- Remove unused `MilliSeconds`, `MicroSeconds`, and `NanoSeconds` types
- Remove `Bps`, `KiloHertz`, and `MegaHertz` types that were only used
for converting to `Hertz`
- Replace all instances of `impl Into<Hertz>` with `Hertz`
- Add `hz`, `khz`, and `mhz` methods to `Hertz`, as well as
free function shortcuts
- Remove `U32Ext` extension trait
2022-07-10 21:46:45 -05:00
bors[bot]
99f4fd33b4
Merge #859
859: Add F4 flash driver r=Dirbaio a=chemicstry

Pending on https://github.com/embassy-rs/stm32-data/pull/152

Co-authored-by: chemicstry <chemicstry@gmail.com>
2022-07-11 01:37:19 +00:00
Dario Nieuwenhuis
7ddcacac7b clm download, country config. 2022-07-11 03:07:39 +02:00
chemicstry
3271ba36e4 Fix cfg flags 2022-07-11 04:07:28 +03:00
chemicstry
c19667f05e Update stm32-data 2022-07-11 04:00:03 +03:00
chemicstry
734c38eb9c Add F4 flash driver 2022-07-11 03:57:46 +03:00
bors[bot]
9753f76794
Merge #810
810: Takes care of power for nRF USB devices r=Dirbaio a=huntc

Modifies the usb-serial example to illustrate how to setup USB for situations where the USB power can be detected and removed.

Gaps:

~~* No support for the nrf-softdevices as yet, although this should be possible via another constructor.~~
* No support for the nrf5340, although this should be possible via USBREG.

The change is tested and appears to work. Some notes:

* There's an existing field named self_powered as a UsbDevice field. It doesn't ever appear to get set. I'm wondering if this field is intended to signal that a device has the nRF VBUS power situation or not. I'm not presently using it.
* The new PowerDetected event is generated on the bus initially in situations where just new is used i.e. without power management, including on STM. We can therefore rely on this event always being generated.

Old description:

~~EnabledUsbDevice is a wrapper around the `UsbDevice` where its 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 signaling for enablement.~~

Co-authored-by: huntc <huntchr@gmail.com>
2022-07-11 00:01:41 +00:00
Dario Nieuwenhuis
163cf1f335
Merge pull request #857 from chemicstry/windows_ci
Fix ci for windows (msys, git bash)
2022-07-11 01:47:59 +02:00
chemicstry
5bd2324275 Fix ci for windows (msys, git bash) 2022-07-11 02:32:30 +03:00
Dario Nieuwenhuis
069a57fcf8 async ioctls working. 2022-07-11 00:25:35 +02:00
bors[bot]
c6a11db39e
Merge #854
854: Implement IWDG timeout calculation r=Dirbaio a=chemicstry

Allow specifying `IndependentWatchdog` timeout as `Duration` instead of prescaler value.

Since IWDG is clocked from LSI, which differs between families, I standardized HSI/LSI definitions in RCC and used that.

Co-authored-by: chemicstry <chemicstry@gmail.com>
2022-07-10 21:45:34 +00:00