summaryrefslogtreecommitdiff
path: root/boards/ek-lm4f120xl-boost-capsense/drivers/CTS_structure.c
blob: db1465e3473248182e4443a82939152bf7781fbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
//*****************************************************************************
//
// CTS_structure.c - Capacative Sense structures.
//
// Copyright (c) 2012 Texas Instruments Incorporated.  All rights reserved.
// Software License Agreement
// 
// Texas Instruments (TI) is supplying this software for use solely and
// exclusively on TI's microcontroller products. The software is owned by
// TI and/or its suppliers, and is protected under applicable copyright
// laws. You may not combine this software with "viral" open-source
// software in order to form a larger program.
// 
// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
// DAMAGES, FOR ANY REASON WHATSOEVER.
// 
// This is part of revision 9453 of the EK-LM4F120XL Firmware Package.
//
//*****************************************************************************
 
//*****************************************************************************
//
// 4 elements configured as a wheel.
// 1 element configured as a button. [Center Button] 
// 1 element configured as a proximity sensor.
// This file contains the structure names and the variable assingments.
//
// Revision 1.00 Baseline
// Developed with IAR 5.10.4 [Kickstart] (5.10.4.30168)
//
// 09/24/10 Rev1.00 Pre-Alpha Version. Added "max_cnts" slider variable in 
//                  CT_Handler object.
//
// 09/29/10 0.02    Update naming convention for elements and sensors.
//
// 10/11/10 0.03    Update
//
//******************************************************************************

#include "inc/hw_types.h"
#include "inc/hw_gpio.h"
#include "inc/hw_memmap.h"
#include "driverlib/gpio.h"
#include "drivers/CTS_structure.h"

//
// Volume down button on PD3
//
const tCapTouchElement g_sVolumeDownElement =
{
    GPIO_PORTA_AHB_BASE,//ulGPIOPort
    GPIO_PIN_7,//ulGPIOPin
    100,//ulThreshold
    2000//ulMaxResponse
};

//
// Left button on PD2
//
const tCapTouchElement g_sLeftElement =
{
    GPIO_PORTA_AHB_BASE,//ulGPIOPort
    GPIO_PIN_6,//ulGPIOPin
    100,//ulThreshold
    2000//ulMaxResponse
};

//
// Right button on PE3
//
const tCapTouchElement g_sRightElement =
{
    GPIO_PORTA_AHB_BASE,//ulGPIOPort
    GPIO_PIN_2,//ulGPIOPin
    100,//ulThreshold
    2000//ulMaxResponse
};

//
// Volume up button on PE2
//
const tCapTouchElement g_sVolumeUpElement =
{
    GPIO_PORTA_AHB_BASE,//ulGPIOPort
    GPIO_PIN_3,//ulGPIOPin
    100,//ulThreshold
    2000//ulMaxResponse
};

//
// Middle button on PE1
//
const tCapTouchElement g_sMiddleElement =
{
    GPIO_PORTA_AHB_BASE,//ulGPIOPort
    GPIO_PIN_4,//ulGPIOPin
    100,//ulThreshold
    1800//ulMaxResponse
};

const tSensor g_sSensorWheel =
{
    4,//unsigned char ucNumElements;
    100,//unsigned long ulNumSamples;
    64,//unsigned char ucPoints;
    75,//unsigned char ucSensorThreshold;
    0,//unsigned long ulBaseOffset;
    {
        &g_sVolumeUpElement, 
        &g_sRightElement,
        &g_sVolumeDownElement,
        &g_sLeftElement
    }//const tCapTouchElement *Element[MAXIMUM_NUMBER_OF_ELEMENTS_PER_SENSOR];
};

const tSensor g_sMiddleButton = 
{
    1,//unsigned char ucNumElements;
    100,//unsigned long ulNumSamples;
    0,//unsigned char ucPoints;
    0,//unsigned char ucSensorThreshold;
    4,//unsigned long ulBaseOffset;
    {
        &g_sMiddleElement
    }//const tCapTouchElement *Element[MAXIMUM_NUMBER_OF_ELEMENTS_PER_SENSOR];
};