Karl Zweimüller
/
eth_comfort_test
Programm for decoding radio-signals sent by a ETH-Window-Shutter-Contact, received with a RFM12B-module
Diff: eth_comfort.h
- Revision:
- 0:96794c9fc5a3
- Child:
- 1:fc72e0bdb693
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/eth_comfort.h Wed Mar 02 20:46:57 2011 +0000 @@ -0,0 +1,45 @@ +#ifndef ETH_COMFORT_H +#define ETH_COMFORT_H + +#include "mbed.h" + + + + +extern volatile uint8_t transmit,start,phase,bit_cnt,data; +extern volatile uint16_t buffer_cnt; + + +extern volatile unsigned char old ; + +extern volatile uint8_t rbyte; + +extern volatile uint8_t buf[1024]; +extern volatile uint8_t pack_ok,startbit; +extern volatile uint8_t decode,bcnt,lastbit; +extern volatile uint8_t state; + +struct eth_message{ + uint8_t cnt; + uint8_t len; + uint32_t adr; + uint8_t cmd; + uint8_t data; + uint8_t xdata; + uint16_t crc; +}; + +// led3 shows received bits +extern DigitalOut led3; + +// calcualte the crc for eth +uint16_t calcCRC16r( uint16_t c,uint16_t crc, uint16_t mask); + +// initialize eth_comfort-receiver +void eth_init(); + +// interupt-routine for received data +void ISR(); + +#endif +