EFM32 Giant Gecko Software Documentation  efm32gg-doc-5.1.2
cpt112s_i2c.h
Go to the documentation of this file.
1 /**************************************************************************/
16 #ifndef CPT112S_I2C_H
17 #define CPT112S_I2C_H
18 
19 #include <stdint.h>
20 
21 /***************************************************************************/
26 /***************************************************************************/
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 /*******************************************************************************
36  ******************************* DEFINES ***********************************
37  ******************************************************************************/
38 
39 #define CPT112S_I2C_ADDRESS 0xE0
40 #define CPT112S_I2C_RXBUFFER_SIZE 3
41 
42 #define CPT112S_I2C_TOUCH_EVENT 0
43 #define CPT112S_I2C_RELEASE_EVENT 1
44 #define CPT112S_I2C_SLIDER_ACTIVITY 2
45 
46 /*******************************************************************************
47  ******************************* FUNCTIONS ***********************************
48  ******************************************************************************/
49 
50 /******************************************************************************
51  * @brief Return a bitmask containing the current state for all capsense
52  * buttons
53  *****************************************************************************/
54 uint16_t CPT112S_getCapsenseCurrent(void);
55 
56 /******************************************************************************
57  * @brief Return a bitmask containing the previous state for all capsense
58  * buttons
59  *****************************************************************************/
60 uint16_t CPT112S_getCapsensePrevious(void);
61 
62 /******************************************************************************
63  * @brief Return the current slider value
64  *****************************************************************************/
65 uint16_t CPT112S_getSliderCurrent(void);
66 
67 /******************************************************************************
68  * @brief Return the previous slider value
69  *****************************************************************************/
70 uint16_t CPT112S_getSliderPrevious(void);
71 
72 /******************************************************************************
73  * SMBUS data structure initialization
74  *****************************************************************************/
75 void CPT112S_init(void);
76 
77 /******************************************************************************
78  * update SMBUS data structure from current packet of I2C
79  *****************************************************************************/
80 void CPT112S_update(void);
81 
82 #ifdef __cplusplus
83 }
84 #endif
85 
89 #endif /* CPT112S_I2C_H */