There is no support for LCD nor touch screen on Kinetis K60. I'm not sure what do you mean by "Touch Screen Sensor". It's probably a misunderstanding, the TSS_Library (stands for Touch Sensing Software) component does not handle resistive panels, it can handle only capacitive electrode touch sensors.
I think that the only option on K60 is to connect the touch panel to some 4 pins with ADC input of K60.
The application would basically need to :
Set X+ to some voltage, X- to GND and read voltage on Y+ and Y-.
Then vice versa - Set Y+ to voltage and Y- to GND and read voltage on X+ and X- .
You can do the PEx project setup following way:
1) Add ADC_LDD usin Components Library to your project and configure it in inspector view:
- add four channels on pins that have also GPIO function available and ideally on the same port (e.g. on MK60FN1M0VLQ15 I found ADC0_SE8, ADC0_SE9, ADC0_SE12, ADC0_SE13 with GPIO PTB0,1,2,3)
- Enable 'Static sample groups' property and create two sample groups, one with channels 0 and 1 (inputs X+ and X-) and second with channels 2 and 3.
- Set 'Conversion time' using the dialog (press the button) to some higher value (for higher precision)
- Set Initialization / Auto initialization to 'yes'.
- switch to the methods tab in the inspector and set ConnectPin method to 'generate code'.
2) Add GPIO_LDD, slect the port from step1 (e.g. PTB) and add four pins same as in ADC.
- Error is reported on the pin rrow (Peripheral is already used) - so select "pin sharing enabled" from the pop-up menu of the pin.
- Set Initial pin direction of each pin to Output.
- Set Initialization / Auto initialization to 'yes'.
- switch to the methods tab in the inspector and set ConnectPin method to 'generate code'.
3) Add Init_GPIO component to initialize electrical features (pull-ups) of the pins. In the properties select the same port device (e.g. PTB).
In Pins group enable the pins you are using (e.g. 0,1,2,3). Enable the pin sharing the same way you did in step 2 othewise error is reported.
For two pins connected to X+ and Y+ that will provide voltage you'll need to enable 'Pull-up resistor' property.
Then in your application you shoul do in a loop :
a) Call GPIO1_ConnectPin function (method of GPIO_LDD component) to connect X+ and X- pins to GPIO peripheral
- e.g. GPIO1_ConnectPin( GPIO1_DeviceData, LDD_GPIO_PIN_0 | , LDD_GPIO_PIN_1);
b) Call AD1_ConnectPin function (method of ADC_LDD component) to connect Y+ and Y- pins to ADC peripheral for channels where you have connected Ys, so for example if you have Y+ on channel2 and Y- on channel3:
AD1_ConnectPin(AD1_DeviceData, LDD_ADC_CHANNEL_2_PIN | LDD_ADC_CHANNEL_3_PIN);
c) Call AD1_SelectSampleGroup (AD1_DeviceData, 1) to select sample group 1, i.e. channels for Y+ and Y-
d) Peform ADC measurement by e.g.
//variables declaration
AD1_TResultData MeasuredValues[2];
LDD_TError Error;
...
...
Error = AD1_StartSingleMeasurement(AD1_DeviceData); /* Start continuous measurement */
while (!AD1_GetMeasurementCompleteStatus(MyADCPtr)) {}; /* Wait for conversion completeness */
Error = AD1_GetMeasuredValues(MyADCPtr, (LDD_TData *)MeasuredValues)
...
note: This code is taken from "Typical usage page" from the ADC_LDD help.
You can also use interrupt enabled and place the code to event handler so you won't need wait for ADC to complete.
e) Now you have two Y values in MeaduredValues array and you can use it to compute Y position.
Then you need to do a-e steps but the other set of pins (X <-> Y) and you'll get X values.
I know this from-scratch-guide is brief and incomplete but is should help you get started with the project.
best regards
Petr Hradsky
Processor Expert Support Team