diff options
| author | michel <[email protected]> | 2024-11-22 16:48:18 +0100 |
|---|---|---|
| committer | michel <[email protected]> | 2024-11-29 17:58:35 +0100 |
| commit | efbe7fb8e8ac77eaad2787bb0ea981b1e0f875c0 (patch) | |
| tree | b39c30e8de7d9eb67ee74d6bdcc7670cdf46d8d1 /examples/stm32l0/src/bin | |
| parent | 31da5155e840d97e432cf2fa06c6fa4c2a19bf9a (diff) | |
stm32 tsc examples: minor corrections
Diffstat (limited to 'examples/stm32l0/src/bin')
| -rw-r--r-- | examples/stm32l0/src/bin/tsc_multipin.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/stm32l0/src/bin/tsc_multipin.rs b/examples/stm32l0/src/bin/tsc_multipin.rs index bf75a5657..6343de141 100644 --- a/examples/stm32l0/src/bin/tsc_multipin.rs +++ b/examples/stm32l0/src/bin/tsc_multipin.rs | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | // | 9 | // |
| 10 | // This example demonstrates how to: | 10 | // This example demonstrates how to: |
| 11 | // 1. Configure multiple channel pins within a single TSC group | 11 | // 1. Configure multiple channel pins within a single TSC group |
| 12 | // 2. Use the set_active_channels method to switch between different channels | 12 | // 2. Use the set_active_channels_bank method to switch between sets of different channels (acquisition banks) |
| 13 | // 3. Read and interpret touch values from multiple channels in the same group | 13 | // 3. Read and interpret touch values from multiple channels in the same group |
| 14 | // | 14 | // |
| 15 | // Suggested physical setup on STM32L073RZ Nucleo board: | 15 | // Suggested physical setup on STM32L073RZ Nucleo board: |
| @@ -29,7 +29,7 @@ | |||
| 29 | // - PA0 as sampling capacitor, TSC group 1 IO1 (label A0) | 29 | // - PA0 as sampling capacitor, TSC group 1 IO1 (label A0) |
| 30 | // - PA1 as channel, TSC group 1 IO2 (label A1) | 30 | // - PA1 as channel, TSC group 1 IO2 (label A1) |
| 31 | // - PB3 as sampling capacitor, TSC group 5 IO1 (label D3) | 31 | // - PB3 as sampling capacitor, TSC group 5 IO1 (label D3) |
| 32 | // - PB4 as channel, TSC group 5 IO2 (label D3) | 32 | // - PB4 as channel, TSC group 5 IO2 (label D10) |
| 33 | // - PB6 as channel, TSC group 5 IO3 (label D5) | 33 | // - PB6 as channel, TSC group 5 IO3 (label D5) |
| 34 | // | 34 | // |
| 35 | // The pins have been chosen to make it easy to simply add capacitors directly onto the board and | 35 | // The pins have been chosen to make it easy to simply add capacitors directly onto the board and |
| @@ -80,7 +80,7 @@ async fn acquire_sensors( | |||
| 80 | touch_controller: &mut Tsc<'static, peripherals::TSC, mode::Async>, | 80 | touch_controller: &mut Tsc<'static, peripherals::TSC, mode::Async>, |
| 81 | tsc_acquisition_bank: &AcquisitionBank, | 81 | tsc_acquisition_bank: &AcquisitionBank, |
| 82 | ) { | 82 | ) { |
| 83 | touch_controller.set_active_channels_mask(tsc_acquisition_bank.mask()); | 83 | touch_controller.set_active_channels_bank(tsc_acquisition_bank); |
| 84 | touch_controller.start(); | 84 | touch_controller.start(); |
| 85 | touch_controller.pend_for_acquisition().await; | 85 | touch_controller.pend_for_acquisition().await; |
| 86 | touch_controller.discharge_io(true); | 86 | touch_controller.discharge_io(true); |
| @@ -156,7 +156,7 @@ async fn main(_spawner: embassy_executor::Spawner) { | |||
| 156 | acquire_sensors(&mut touch_controller, &bank1).await; | 156 | acquire_sensors(&mut touch_controller, &bank1).await; |
| 157 | let readings1 = touch_controller.get_acquisition_bank_values(&bank1); | 157 | let readings1 = touch_controller.get_acquisition_bank_values(&bank1); |
| 158 | acquire_sensors(&mut touch_controller, &bank2).await; | 158 | acquire_sensors(&mut touch_controller, &bank2).await; |
| 159 | let readings2 = touch_controller.get_acquisition_bank_values(&bank1); | 159 | let readings2 = touch_controller.get_acquisition_bank_values(&bank2); |
| 160 | 160 | ||
| 161 | let mut touched_sensors_count = 0; | 161 | let mut touched_sensors_count = 0; |
| 162 | for reading in readings1.iter() { | 162 | for reading in readings1.iter() { |
