Skip to content

Commit 632e2e5

Browse files
committed
WIP: Trying out the I2S traits
1 parent 42a73cf commit 632e2e5

File tree

4 files changed

+63
-73
lines changed

4 files changed

+63
-73
lines changed

.vscode/tasks.json

+53-61
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,55 @@
11
{
2-
// See https://go.microsoft.com/fwlink/?LinkId=733558
3-
// for the documentation about the tasks.json format
4-
"version": "2.0.0",
5-
"tasks": [
6-
{
7-
/*
8-
* This is the default cargo build task,
9-
* but we need to provide a label for it,
10-
* so we can invoke it from the debug launcher.
11-
*/
12-
"label": "cargo build",
13-
"type": "process",
14-
"command": "cargo",
15-
"args": ["build"],
16-
"problemMatcher": [
17-
"$rustc"
18-
],
19-
"group": {
20-
"kind": "build",
21-
"isDefault": true
22-
}
23-
},
24-
{
25-
"label": "cargo build --release",
26-
"type": "process",
27-
"command": "cargo",
28-
"args": ["build", "--release"],
29-
"problemMatcher": [
30-
"$rustc"
31-
],
32-
"group": "build"
33-
},
34-
{
35-
"label": "cargo build --examples",
36-
"type": "process",
37-
"command": "cargo",
38-
"args": ["build","--examples"],
39-
"problemMatcher": [
40-
"$rustc"
41-
],
42-
"group": "build"
43-
},
44-
{
45-
"label": "cargo build --examples --release",
46-
"type": "process",
47-
"command": "cargo",
48-
"args": ["build","--examples", "--release"],
49-
"problemMatcher": [
50-
"$rustc"
51-
],
52-
"group": "build"
53-
},
54-
{
55-
"label": "cargo clean",
56-
"type": "process",
57-
"command": "cargo",
58-
"args": ["clean"],
59-
"problemMatcher": [],
60-
"group": "build"
61-
},
62-
]
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
/*
8+
* This is the default cargo build task,
9+
* but we need to provide a label for it,
10+
* so we can invoke it from the debug launcher.
11+
*/
12+
"label": "cargo build",
13+
"type": "process",
14+
"command": "cargo",
15+
"args": ["build"],
16+
"problemMatcher": ["$rustc"],
17+
"group": {
18+
"kind": "build",
19+
"isDefault": true
20+
}
21+
},
22+
{
23+
"label": "cargo build --release",
24+
"type": "process",
25+
"command": "cargo",
26+
"args": ["build", "--release"],
27+
"problemMatcher": ["$rustc"],
28+
"group": "build"
29+
},
30+
{
31+
"label": "cargo build --examples",
32+
"type": "process",
33+
"command": "cargo",
34+
"args": ["build", "--example", "audio"],
35+
"problemMatcher": ["$rustc"],
36+
"group": "build"
37+
},
38+
{
39+
"label": "cargo build --examples --release",
40+
"type": "process",
41+
"command": "cargo",
42+
"args": ["build", "--examples", "--release"],
43+
"problemMatcher": ["$rustc"],
44+
"group": "build"
45+
},
46+
{
47+
"label": "cargo clean",
48+
"type": "process",
49+
"command": "cargo",
50+
"args": ["clean"],
51+
"problemMatcher": [],
52+
"group": "build"
53+
}
54+
]
6355
}

Cargo.toml

+5-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ readme = "README.md"
2222
accelerometer = "0.11.0"
2323
cortex-m = "0.6"
2424
cortex-m-rt = "0.6"
25-
lis302dl = "0.1.0"
25+
# lis302dl = "0.1.0"
26+
27+
[dependencies.lis302dl]
28+
path = "../lis302dl"
2629

2730
[dependencies.cs43l22]
2831
# git = "https://github.com/maxekman/cs43l22/"
@@ -35,7 +38,7 @@ path = "../cs43l22"
3538
features = ["unproven"]
3639
# version = "0.2.3"
3740
# git = "https://github.com/eldruin/embedded-hal/"
38-
# branch = "i2s"
41+
# branch = "i2s-v0.2.x"
3942
path = "../embedded-hal"
4043

4144
[dependencies.stm32f4xx-hal]

examples/audio.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ fn main() -> ! {
5252
let mut y: u16 = 100;
5353
loop {
5454
// Send both left and right word.
55-
audio_out.i2s.send(s).unwrap();
56-
audio_out.i2s.send(s).unwrap();
55+
// audio_out.i2s.send(s).unwrap();
56+
// audio_out.i2s.send(s).unwrap();
57+
audio_out.i2s.try_write(&[s], &[s]).unwrap();
5758

5859
// Sawtooth with incrementing pitch each cycle.
5960
if s >= (65535 - y) {

openocd.gdb

+2-8
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,8 @@ break main
1919
# 168000000 is the core clock frequency
2020
monitor tpiu config internal itm.txt uart off 168000000
2121

22-
23-
# # send captured ITM to the file itm.fifo
24-
# # (the microcontroller SWO pin must be connected to the programmer SWO pin)
25-
# # 16000000 must match the core clock frequency
26-
monitor tpiu config internal itm.txt uart off 168000000
27-
28-
# # OR: make the microcontroller SWO pin output compatible with UART (8N1)
29-
# # 8000000 is the frequency of the SWO pin
22+
# OR: make the microcontroller SWO (PB3) pin output compatible with UART (8N1)
23+
# 8000000 is the frequency of the SWO pin
3024
# monitor tpiu config external uart off 8000000 2000000
3125

3226
# # enable ITM port 1

0 commit comments

Comments
 (0)