AN2575 Freescale Semiconductor / Motorola, AN2575 Datasheet - Page 18

no-image

AN2575

Manufacturer Part Number
AN2575
Description
MC68HC908EY16 ESCI LIN Drivers
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2575/D
/******************************************************************************
*
*
*
*
*
*
*
*
*
*
*
*
******************************************************************************/
void Read_buttons (void)
{
}
18
if ((PTA & 0x08) == 0)
{
}
else
{
}
Function name: Read_buttons
Originator:
Date:
Function:
if ((PTA & 0x04) == 0)
{
}
else
{
}
bounce = 1;
if (((PTA & 0x04) == 0) && (bounce == 0)) /* PTA2 key pressed ?
{
}
else if ((PTA & 0x04) != 0)
{
}
if (PTD & 0x02)
{
}
else
{
}
if (PTD & 0x02)
{
}
else
{
}
ICGTR += (512*(delta0-cnt1024))/cnt1024;
bounce = 1;
bounce = 0;
ICGTR += 1;
ICGMR += 1;
ICGTR -= 1;
ICGMR -= 1;
P. Topping
26th March 2003
PTA3 PTA2 PTD1
1
1
0
0
0
0
1
0
1
1
0
0
Freescale Semiconductor, Inc.
For More Information On This Product,
x
x
0
1
0
1
MC68HC908EY16 ESCI LIN Drivers
PTA2 & 3 are low if their key is pressed
no key function (release debounce lock)
calculate trim and adjust ICGTR
decrement multiplier register ICGMR
decrement trim register ICGTR
increment multiplier register ICGMR
increment trim register ICGTR
Go to: www.freescale.com
/* PTA3 key pressed ?
/* yes, PTA2 key pressed ? */
/* yes, check PTD1
/* inc. trim if high
/* or multiplier if low
/* PTA3 but not PTA2
/* check PTD1
/* decrement trim if high
/* or multiplier if low
/* inhibit trimming
/* PTA3 key not pressed
/* and inhibit repeat
/* neither pressed so
/* re-enable trimming
/* yes, trim
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
MOTOROLA

Related parts for AN2575