My Project
Loading...
Searching...
No Matches
touchpad_driver.h
Go to the documentation of this file.
1
19#ifndef INC_TOUCHPAD_DRIVER_H_
20#define INC_TOUCHPAD_DRIVER_H_
21
22#include "stm32f3xx_hal.h"
23
29public:
30
32 TSC_IOConfigTypeDef all_ios = {0b00000000101110111011000010111011,0,0b00000000010001000100000001000100};
34 TSC_IOConfigTypeDef io1 = {0b00000000000100010000000100010001,0,0b00000000010001000000010001000100};
36 TSC_IOConfigTypeDef io2 = {0b00000000001000100000001000100010,0,0b00000000010001000000010001000100};
38 TSC_IOConfigTypeDef io4 = {0b00000000100010000000100010001000,0,0b00000000010001000000010001000100};
39
42
45 uint32_t pad1;
46 uint32_t pad2;
47 uint32_t pad3;
48 uint32_t pad4;
49 uint32_t pad5;
50 uint32_t pad6;
51 uint32_t pad7;
52 uint32_t pad8;
53 uint32_t pad9;
54 uint32_t pad10;
55 uint32_t pad11;
56 uint32_t pad12;
57 uint32_t pad13;
58 uint32_t pad14;
60
61 uint32_t read_touchpads(uint32_t tsc_readings[14]);
62 uint32_t discern_press(uint32_t tsc_readings[14]);
63 void init();
64
65 // Class constructor
67 }
68};
69
70
71#endif /* INC_TOUCHPAD_DRIVER_H_ */
The touchpads class implements some easier ways to work with the MCU's capacitive touch architecture.
Definition: touchpad_driver.h:28
TSC_IOConfigTypeDef io4
Bit mask to activate the third pin in each TSC group.
Definition: touchpad_driver.h:38
TSC_IOConfigTypeDef io1
Bit mask to activate the first pin in each TSC group.
Definition: touchpad_driver.h:34
touchpads(TSC_HandleTypeDef *htsc)
Definition: touchpad_driver.h:66
uint32_t discern_press(uint32_t tsc_readings[14])
discern_press() compares capacitive touch readings with the calibration values in order to discern if...
Definition: touchpad_driver.cpp:349
struct touchpads::calibrationvalues_t calibration_values
uint32_t read_touchpads(uint32_t tsc_readings[14])
read_touchpads() checks if someone is touching the capacitive touch pads.
Definition: touchpad_driver.cpp:187
TSC_HandleTypeDef * touch
Touch sensor object type (defined by the HAL)
Definition: touchpad_driver.h:41
TSC_IOConfigTypeDef io2
Bit mask to activate the second pin in each TSC group.
Definition: touchpad_driver.h:36
TSC_IOConfigTypeDef all_ios
Bit mask to activate all TSC pins.
Definition: touchpad_driver.h:32
void init()
The init function essentially runs the read_touchpads function and places the readings into a calibra...
Definition: touchpad_driver.cpp:26
TSC_HandleTypeDef htsc
Definition: main.cpp:68
This file contains all the functions prototypes for the HAL module driver.
TSC handle Structure definition.
Definition: stm32f3xx_hal_tsc.h:114
TSC IOs configuration structure definition.
Definition: stm32f3xx_hal_tsc.h:100
Struct containing calibration thresholds for each touchpad.
Definition: touchpad_driver.h:44
uint32_t pad4
Definition: touchpad_driver.h:48
uint32_t pad6
Definition: touchpad_driver.h:50
uint32_t pad7
Definition: touchpad_driver.h:51
uint32_t pad5
Definition: touchpad_driver.h:49
uint32_t pad11
Definition: touchpad_driver.h:55
uint32_t pad10
Definition: touchpad_driver.h:54
uint32_t pad3
Definition: touchpad_driver.h:47
uint32_t pad9
Definition: touchpad_driver.h:53
uint32_t pad1
Definition: touchpad_driver.h:45
uint32_t pad14
Definition: touchpad_driver.h:58
uint32_t pad2
Definition: touchpad_driver.h:46
uint32_t pad12
Definition: touchpad_driver.h:56
uint32_t pad13
Definition: touchpad_driver.h:57
uint32_t pad8
Definition: touchpad_driver.h:52