diff options
| -rw-r--r-- | examples/stm32l0/src/bin/tsc_multipin.rs | 8 | ||||
| -rw-r--r-- | examples/stm32l4/src/bin/tsc_multipin.rs | 4 |
2 files changed, 6 insertions, 6 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() { |
diff --git a/examples/stm32l4/src/bin/tsc_multipin.rs b/examples/stm32l4/src/bin/tsc_multipin.rs index 2fadbe16a..8fec5ddc4 100644 --- a/examples/stm32l4/src/bin/tsc_multipin.rs +++ b/examples/stm32l4/src/bin/tsc_multipin.rs | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | // ## This example demonstrates how to: | 12 | // ## This example demonstrates how to: |
| 13 | // | 13 | // |
| 14 | // 1. Configure multiple channel pins within a single TSC group | 14 | // 1. Configure multiple channel pins within a single TSC group |
| 15 | // 2. Use the set_active_channels method to switch between different channels | 15 | // 2. Use the set_active_channels_bank method to switch between sets of different channels (acquisition banks) |
| 16 | // 3. Read and interpret touch values from multiple channels in the same group | 16 | // 3. Read and interpret touch values from multiple channels in the same group |
| 17 | // | 17 | // |
| 18 | // ## Suggested physical setup on STM32L4R5ZI-P board: | 18 | // ## Suggested physical setup on STM32L4R5ZI-P board: |
| @@ -76,7 +76,7 @@ async fn acquire_sensors( | |||
| 76 | touch_controller: &mut Tsc<'static, peripherals::TSC, mode::Async>, | 76 | touch_controller: &mut Tsc<'static, peripherals::TSC, mode::Async>, |
| 77 | tsc_acquisition_bank: &AcquisitionBank, | 77 | tsc_acquisition_bank: &AcquisitionBank, |
| 78 | ) { | 78 | ) { |
| 79 | touch_controller.set_active_channels_mask(tsc_acquisition_bank.mask()); | 79 | touch_controller.set_active_channels_bank(tsc_acquisition_bank); |
| 80 | touch_controller.start(); | 80 | touch_controller.start(); |
| 81 | touch_controller.pend_for_acquisition().await; | 81 | touch_controller.pend_for_acquisition().await; |
| 82 | touch_controller.discharge_io(true); | 82 | touch_controller.discharge_io(true); |
