You are on page 1of 2

/*

* SCMP_Transciever.c
*
* File description: the implementation file of SCMP_Transciver module
*
* Functions: 1-void_SCMP_Transceiver_init(void)
* 2-void_SCMP_Transceiver_sendFrame(u8_t data[5])
*
* Created on: September 21, 2010
*
* Author: H Said
*
*/

#include "SCMP_Transciever.h"
U8_t SCM_FRAME[8];
/*
* ***************************************************************
* function name: void_SCMP_Transceiver_init
*
* function discrption: this function initializes the SCMP Transciever m
odule
*
* function input: none
*
* function output: none
*
* created in: September 21, 2010
*
* created by: H Said
*
*
* ***************************************************************
*/
void void_SCMP_Transceiver_init(void)
{
//initialize the UART module
void_UART_init();
}
/*
* *****************************************************************
* function name: void_SCMP_Transceiver_sendFrame
*
* function discrption: this function sends frame of data according to S
CM protocl
* requirements.
*
* function input: U8_t[5] data
*
*
* function output: none
*
*
* created in: September 21, 2010
*
* created by: H Siad
*
*
* *****************************************************************
*/
void void_SCMP_Transceiver_sendFrame(U8_t data[5])
{
//add the frame header byte
SCM_FRAME[0] = 'S';
//add data to the frame
for (U8_t i=0;i<=4;++i)
{
SCM_FRAME[i+1] = data[i];
}
//adding end of the frame
SCM_FRAME[6] = 'E';
SCM_FRAME[7] = 'F';
for (U8_t j=0; j<=7; ++j)
{
void_UART_sendByte(SCM_FRAME[j]);
}
}

You might also like