MC9S08PT8.
When i use processor expert to generate code it will produce code like this in Bit.c
how to use it to blink led and if i want to interfce switch how i will give the condition to blink led as i am not getting the code flow
bool Bit1_GetDir(void)
{
return (bool)((getReg8(PORT_PTAOE) & 0x02U)); /* Return pin direction, 0==GPI, nonzero==GPO */
}
/*
** ===================================================================
** Method : Bit1_SetDir (component BitIO)
** Description :
** This method sets direction of the component.
** Parameters :
** NAME - DESCRIPTION
** Dir - Direction to set (FALSE or TRUE)
** FALSE = Input, TRUE = Output
** Returns : Nothing
** ===================================================================
*/
void Bit1_SetDir(bool Dir)
{
if (Dir) {
setReg8(PORT_PTAD, (getReg8(PORT_PTAD) & (byte)(~(byte)0x02U)) | (Shadow_PTA & 0x02U)); /* PTAD1=Shadow_PTA[bit 1] */
setReg8Bits(PORT_PTAOE, 0x02U); /* PTAOE1=0x01U */
clrReg8Bits(PORT_PTAIE, 0x02U); /* PTAIE1=0x00U */
} else { /* !Dir */
clrReg8Bits(PORT_PTAOE, 0x02U); /* PTAOE1=0x00U */
setReg8Bits(PORT_PTAIE, 0x02U); /* PTAIE1=0x01U */
} /* !Dir */
}
/*
** ===================================================================
** Method : Bit1_SetOutput (component BitIO)
** Description :
** This method sets direction of the component to output.
** Parameters : None
** Returns : Nothing
** ===================================================================
*/
void Bit1_SetOutput(void)
{
setReg8(PORT_PTAD, (getReg8(PORT_PTAD) & (byte)(~(byte)0x02U)) | (Shadow_PTA & 0x02U)); /* PTAD1=Shadow_PTA[bit 1] */
setReg8Bits(PORT_PTAOE, 0x02U); /* PTAOE1=0x01U */
clrReg8Bits(PORT_PTAIE, 0x02U); /* PTAIE1=0x00U */
}