Download gsm-based home intrusion detection device using sms messaging in
Transcript
16 = Row 3 mask
32 = Row 4 mask
//KeyPad(0): //Macro function declarations
char FCD_KeyPad0_GetKeypadNumber();
char FCD_KeyPad0_GetKeypadAscii();
//RS232(0): //Macro implementations
void FCD_RS2320_SendRS232Char(short nChar)
{
#if (RS232_462324_UART == 0)
char dMask;
char idx;
char count = 8;
#ifdef RS232_462324_HARDWARE
//wait until CTS is low
while (( RS232_462324_CTS_PORT & (1 <<
RS232_462324_CTS_PIN) ) != 0);
#endif
#if(RS232_462324_DATASIZE == 1)
count = 9;
#endif
#if(RS232_462324_DATASIZE == 2)
count = 7;
#endif
clear_bit( RS232_462324_TX_PORT, RS232_462324_SW_TX);
// Send Start bit
FCD_RS2320_RS232_Delay(0);
for (idx = 0; idx < count; idx++)
{
dMask = nChar & 0x01;
// Mask off data bit
if (dMask)
set_bit( RS232_462324_TX_PORT,
RS232_462324_SW_TX);
else
clear_bit( RS232_462324_TX_PORT,
RS232_462324_SW_TX);
FCD_RS2320_RS232_Delay(0);
nChar = nChar >> 1;
// Move to next data bit
}
set_bit( RS232_462324_TX_PORT, RS232_462324_SW_TX);
// Send Stop bit
FCD_RS2320_RS232_Delay(0);
#endif