Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework #5

Merged
merged 91 commits into from
Jun 19, 2022
Merged
Show file tree
Hide file tree
Changes from 90 commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
53bc517
start rework branch, document what going on
YruamaLairba Apr 17, 2022
aa92a1d
rename and delete stuff, see details
YruamaLairba Apr 17, 2022
3d91b23
implement enable/disable, read/write, interrupt and dma
YruamaLairba Apr 18, 2022
398d29e
skeleton method for ws line reading
YruamaLairba Apr 18, 2022
16e39c8
placeholder for getting a ws pin handle
YruamaLairba Apr 18, 2022
a8a9ed5
oops, i don't use WsState
YruamaLairba Apr 18, 2022
320846f
implement status method and struct
YruamaLairba Apr 19, 2022
a7a5d15
draft of aconfig builder
YruamaLairba Apr 19, 2022
92d8f12
use a nicer alias type for internal status representation
YruamaLairba Apr 19, 2022
bb793cf
I2s standard config
YruamaLairba Apr 19, 2022
1310825
Steady state clock polarity configuration
YruamaLairba Apr 19, 2022
513f07c
data and channel lenght config
YruamaLairba Apr 20, 2022
b9d139b
master clock config
YruamaLairba Apr 20, 2022
9764e4b
prescaler setting
YruamaLairba Apr 21, 2022
bb361bc
Request and require frequency (not fully implemented)
YruamaLairba Apr 21, 2022
6045d51
require a new function for I2sPeripheral trait
YruamaLairba Apr 21, 2022
cc02e0d
implement setting prescaler with requested freq
YruamaLairba Apr 22, 2022
163697a
fix mistake about div max
YruamaLairba Apr 22, 2022
cf54f56
implment setting prescaler with a required frequency
YruamaLairba Apr 22, 2022
8258dbe
method to get reference to the i2s device
YruamaLairba Apr 26, 2022
2fe74e4
add ctor and dtor
YruamaLairba Apr 26, 2022
d597fc6
release unconfigured device, fix missing reset in instantiation
YruamaLairba Apr 26, 2022
eb5da76
fix, markers wasn't public
YruamaLairba Apr 26, 2022
a60f293
implement to master and slave conversion
YruamaLairba Apr 27, 2022
1fbc0ec
fix, missing derive on marker
YruamaLairba Apr 27, 2022
3089149
finally,i think reset_regiters() would never used
YruamaLairba Apr 28, 2022
9679e05
delete an empty source
YruamaLairba Apr 28, 2022
573ad47
remove unused source files
YruamaLairba Apr 28, 2022
ddac2aa
wip on ws_level
YruamaLairba Apr 29, 2022
142bf83
be closer to other hal convention to get pin state
YruamaLairba May 1, 2022
08b7e85
fix, select data format was missing
YruamaLairba May 2, 2022
61d4918
fix errors when converting slave <-> master config
YruamaLairba May 2, 2022
ff3d33c
fix getting channel from status
YruamaLairba May 5, 2022
eaab8f1
put my names into authors field
YruamaLairba May 6, 2022
f066d29
add Transmit Receive marker to Config
YruamaLairba May 7, 2022
d6e2efb
typestate the I2sDriver to prevent irrelevant operation
YruamaLairba May 7, 2022
4881a2c
move markers in dedicated module
YruamaLairba May 7, 2022
bbbc88a
Use a Mode marker to improve redability
YruamaLairba May 7, 2022
b7dc179
fix, wrong marker for receive methods
YruamaLairba May 7, 2022
be5c547
method to get actual sample rate
YruamaLairba May 7, 2022
99a8b42
remove set_error_interrupt for master transmit mode
YruamaLairba May 7, 2022
35265bc
use marker on status to prevent getting irrelevant flags
YruamaLairba May 7, 2022
c476d56
orthograph and typo fixes
YruamaLairba May 7, 2022
2654588
documment some generic parameters
YruamaLairba May 7, 2022
1958a3c
TransferConfig that wrap driver config
YruamaLairba May 9, 2022
ab34877
POC of writer_iter function
YruamaLairba May 11, 2022
7bddc99
POC, non blocking write
YruamaLairba May 12, 2022
157d275
remove the "Mode" on Transfer, this trick is actually a bad idea
YruamaLairba May 12, 2022
bf4fa1c
not working slave transmit transfer write
YruamaLairba May 12, 2022
83c159a
fix write_iter to avoid problem when mixing with nb version
YruamaLairba May 13, 2022
3c55d7a
impl 16 bit master transmit transfer
YruamaLairba May 13, 2022
5cbed6e
16 bits slave transmit write_iter poc
YruamaLairba May 13, 2022
89d4c1e
16 bit slave transmit non blocking write Poc
YruamaLairba May 13, 2022
a3fbb19
fix i32 slave transmission, write data before enable
YruamaLairba May 14, 2022
e0f8b94
forgot testing flags,
YruamaLairba May 14, 2022
25b3901
remove adriver enable that cause issue
YruamaLairba May 14, 2022
776aeb9
remove useless disable
YruamaLairba May 14, 2022
d16fe37
transpose i32 slave transmit logic back to i16
YruamaLairba May 14, 2022
2c54891
add I2S standard to the transfer typestate
YruamaLairba May 15, 2022
c20fe5d
adapte slave sync to support all standard
YruamaLairba May 15, 2022
d1be182
impl master receive 16 bits
YruamaLairba May 15, 2022
a1f01da
32 bits master receive transfer, (PCM not supported)
YruamaLairba May 22, 2022
2020bd0
remake 16 bit master receive, unsupport PCM
YruamaLairba May 22, 2022
3a2f851
slave receive mode, (can't check read_while)
YruamaLairba May 22, 2022
81c2475
slave receive 32 bit , (can't test read_while)
YruamaLairba May 22, 2022
90fcbb5
reorganisation, one module for driver, one module for transfer
YruamaLairba May 23, 2022
0fd8994
add some panics doc, fix some typo
YruamaLairba May 24, 2022
eb346f8
document some panics
YruamaLairba May 25, 2022
00d00ee
add 'I2s' prefix to 'Transfer', fix doc
YruamaLairba May 25, 2022
06a4d02
rename to I2SDriverConfig and fix doc
YruamaLairba May 25, 2022
e087af8
fix error in channel doc
YruamaLairba May 26, 2022
d8ce8af
change marker module description
YruamaLairba May 26, 2022
8a3a979
document driver module
YruamaLairba May 27, 2022
46b5938
document transfer module
YruamaLairba May 27, 2022
1fca2c5
note about how work config
YruamaLairba May 27, 2022
1336280
note on method taking a marker as parameter
YruamaLairba May 27, 2022
20c003b
rexport markers in driver and transfer modules
YruamaLairba May 28, 2022
7e26cfd
add STD typestate on driver
YruamaLairba May 28, 2022
81b4a56
remove I2sStandard from public API
YruamaLairba May 28, 2022
4fb1924
make Cside flag unavailable in PCM mode
YruamaLairba May 28, 2022
3e448ea
update doc example
YruamaLairba May 28, 2022
0c4ddbe
remove examples (they are actually test)
YruamaLairba May 28, 2022
b3ad69f
remove "Mode" marker, not very usefull
YruamaLairba May 29, 2022
8373b36
doc, associated const of trait marker are for internal use only
YruamaLairba May 29, 2022
7e73f3a
fix the test
YruamaLairba May 29, 2022
70b3b14
carte presentation
YruamaLairba May 29, 2022
a0dff70
complete transfer doc
YruamaLairba May 30, 2022
9297bf7
complete driver doc with usage example
YruamaLairba May 30, 2022
d4feaf4
fix doc example producing error with cargo test
YruamaLairba May 30, 2022
47f9cc1
Update README remove branch.md (ready for merge)
YruamaLairba May 30, 2022
c518921
fix errors and remove some commented code
YruamaLairba Jun 19, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "stm32_i2s_v12x"
version = "0.2.0"
authors = ["Sam Crow <[email protected]>"]
authors = ["Sam Crow <[email protected]>", "Amaury Abrial aka Yruama_Lairba <[email protected]"]
edition = "2018"
description = "Driver for I2S communication (using SPI peripherals) for some STM32 microcontrollers"
license = "0BSD"
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# STM32 I2S driver

This library provides a driver for I2S communication using the SPI peripherals on some STM32 microcontrollers.
This library provides driver and abstractions for I2S communication using the
SPI peripherals on some STM32 microcontrollers.

## Differences between STM32 models

According to application note [AN5543](https://www.st.com/resource/en/application_note/dm00725181-enhanced-methods-to-handle-spi-communication-on-stm32-devices-stmicroelectronics.pdf),
there are four major versions of the SPI/I2S peripheral used on STM32 microcontrollers:
According to application note
[AN5543](https://www.st.com/resource/en/application_note/dm00725181-enhanced-methods-to-handle-spi-communication-on-stm32-devices-stmicroelectronics.pdf),
there are four major versions of the SPI/I2S peripheral used on STM32
microcontrollers:

* 1.2.x: F1, F2, F4, L0, L1
* 1.3.x: F0, F3, F7, L4, L5, WB, WL
Expand All @@ -17,8 +20,9 @@ This library currently has code for SPI version 1.2 (STM32F1, STM32F2, STM32F4,
## Status

This library has been tested on a few different STM32F4 microcontrollers. The
other models that use the same SPI version (F1, F2, L0, and L1) may work,
but I have not tested any of them.
other models that use the same SPI version (F1, F2, L0, and L1) may work, but
we haven't tested any of them. Trait implementation and working example will be
availaible in stm32f4xx-hal.

## License

Expand Down
117 changes: 0 additions & 117 deletions examples/master_transmit_d16f16.rs

This file was deleted.

118 changes: 0 additions & 118 deletions examples/master_transmit_d16f32.rs

This file was deleted.

118 changes: 0 additions & 118 deletions examples/master_transmit_d24f32.rs

This file was deleted.

Loading