AN2504 Freescale Semiconductor / Motorola, AN2504 Datasheet - Page 24

no-image

AN2504

Manufacturer Part Number
AN2504
Description
On-Chip FLASH Programming API for CodeWarrior Software
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2504/D
24
On-Chip FLASH Programming API for CodeWarrior Software
/********************************************************************
Byte ReadByte(void) {
}
/********************************************************************
void TransmitByte(Byte _data) {
}
* ReadByte: It reads a byte from the communication port
*
*
* Parameters:
*
* Entry Conditions: None.
*
* Exit Conditions:
*
* Return:
*
* Remarks:
*
*/
* TransmitByte: It sends a byte out the communication port.
*
* Parameters:
*
* Entry Conditions: None.
*
* Exit Conditions:
*
* Return:
*
* Remarks:
*
*/
Freescale Semiconductor, Inc.
Byte _backup1, _backup2;
Byte _data;
_backup1 = COMMPORT;
_backup2 = COMMPORT_DIR;
COMMPORT_DIR &= 0xFE;
COMMPORT &= 0xFE;
GETBYTE();
__asm sta _data;
COMMPORT = _backup1;
COMMPORT_DIR = _backup2;
return _data;
Byte _backup1, _backup2;
_backup1 = COMMPORT;
_backup2 = COMMPORT_DIR;
COMMPORT_DIR &= 0xFE;
COMMPORT &= 0xFE;
__asm LDA _data;
PUT_BYTE();
COMMPORT = _backup1;
COMMPORT_DIR = _backup2;
return;
For More Information On This Product,
Go to: www.freescale.com
and returns it.
None.
None.
The byte received.
The function will not exit until a byte
is received.
_data: the byte to be sent.
None.
The byte received.
The function will not exit until a byte
is received.
// Backup port values.
// Configure COMMPORT as input.
// Call ROM-resident routine.
// Restore port values.
// Backup port values.
// Configure COMMPORT as input.
// Call ROM-resident routine.
// Restore port values.
MOTOROLA

Related parts for AN2504