Sensorian
1.0
C API Reference Guide Library
Main Page
Related Pages
Modules
Data Structures
Files
Examples
File List
Globals
main.c
Go to the documentation of this file.
1
/****************************************************************************
2
* Copyright (C) 2015 Sensorian
3
* *
4
* This file is part of Sensorian. *
5
* *
6
* Sensorian is free software: you can redistribute it and/or modify it *
7
* under the terms of the GNU Lesser General Public License as published *
8
* by the Free Software Foundation, either version 3 of the License, or *
9
* (at your option) any later version. *
10
* *
11
* Sensorian is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
* GNU Lesser General Public License for more details. *
15
* *
16
* You should have received a copy of the GNU Lesser General Public *
17
* License along with Sensorian. *
18
* If not, see <http://www.gnu.org/licenses/>. *
19
****************************************************************************/
20
29
#include <bcm2835.h>
30
#include "
CAP1203.h
"
31
#include "
Utilities.h
"
32
#include "
i2c.h
"
33
34
int
main
(
int
argc,
char
**argv)
35
{
36
I2C_Initialize
(
CAP1203ADDR
);
37
CAP1203_Initialize
();
38
39
CAP1203_ConfigureMultiTouch
(
TWO
,
CS2_PTRN
|
CS1_PTRN
);
40
41
while
(1)
42
{
43
if
(
CAP1203_MultitouchEvent
())
44
{
45
printf(
"Multitouch Event \r\n"
);
46
CAP1203_ClearInterrupt
();
47
}
48
delay_ms
(500);
49
}
50
I2C_Close
();
51
52
return
0;
53
}
54
Utilities.h
CAP1203_MultitouchEvent
unsigned char CAP1203_MultitouchEvent(void)
Return true if a multitouch event was detected.
Definition:
CAP1203.c:114
TWO
Definition:
CAP1203.h:202
I2C_Close
void I2C_Close(void)
Closes the I2C peripheral.
Definition:
i2c.c:174
CAP1203_Initialize
void CAP1203_Initialize(void)
Basic configuration for the capacitive touch controller. Configures the sensor inactive mode and acti...
Definition:
CAP1203.c:41
CAP1203ADDR
#define CAP1203ADDR
The I2C address of the CAP1203 capacitive touch controller.
Definition:
CAP1203.h:36
I2C_Initialize
void I2C_Initialize(unsigned char address)
Initializes the I2C peripheral.
Definition:
i2c.c:36
main
int main(int argc, char **argv)
Definition:
main.c:34
CAP1203_ConfigureMultiTouch
void CAP1203_ConfigureMultiTouch(touch_type number, unsigned char mulchan)
Enables the multi-touch capability of the controller.
Definition:
CAP1203.c:103
delay_ms
void delay_ms(unsigned int ms)
Delay in ms.
Definition:
Utilities.c:39
CAP1203.h
CAP1203 driver header.
i2c.h
CAP1203_ClearInterrupt
unsigned char CAP1203_ClearInterrupt(void)
Clears any impending interrupts.
Definition:
CAP1203.c:232
CS1_PTRN
#define CS1_PTRN
Definition:
CAP1203.h:182
CS2_PTRN
#define CS2_PTRN
Definition:
CAP1203.h:181
CAP1203
Example2
main.c
Generated on Sun Jul 12 2015 20:25:27 for Sensorian by
1.8.9.1