15static const uint8_t RX_STAT_HIGH_AVE = 0;
16static const uint8_t RX_STAT_HIGH_MAX = 1;
17static const uint8_t RX_STAT_HIGH_MIN = 2;
18static const uint8_t RX_STAT_LOW0_AVE = 3;
19static const uint8_t RX_STAT_LOW0_MAX = 4;
20static const uint8_t RX_STAT_LOW0_MIN = 5;
21static const uint8_t RX_STAT_LOW1_AVE = 6;
22static const uint8_t RX_STAT_LOW1_MAX = 7;
23static const uint8_t RX_STAT_LOW1_MIN = 8;
24static const uint8_t RX_STAT_COUNT = 9;
27static const uint8_t RX_MAXPAIRS = 10;
29static const uint8_t RX_NIBBLE[] = {0xF6, 0xEE, 0xED, 0xEB, 0xDE, 0xDD, 0xDB, 0xBE,
30 0xBD, 0xBB, 0xB7, 0x7E, 0x7D, 0x7B, 0x77, 0x6F};
31static const uint8_t RX_CMD_OFF = 0xF6;
32static const uint8_t RX_CMD_ON = 0xEE;
33static const uint8_t RX_CMD_MOOD = 0xED;
34static const uint8_t RX_PAR0_ALLOFF = 0x7D;
35static const uint8_t RX_DEV_15 = 0x6F;
37static const uint8_t RX_MSGLEN = 10;
39static const uint8_t RX_STATE_IDLE = 0;
40static const uint8_t RX_STATE_MSGSTARTFOUND = 1;
41static const uint8_t RX_STATE_BYTESTARTFOUND = 2;
42static const uint8_t RX_STATE_GETBYTE = 3;
45static const uint16_t LWRX_STATSDFLT[RX_STAT_COUNT] = {5000, 0, 5000, 20000, 0, 2500, 4000, 0, 500};
70 uint8_t
lwrx_getpair(uint8_t *pairdata, uint8_t pairnumber);
Copy of GPIOPin that is safe to use from ISRs (with no virtual functions)
int16_t rx_find_nibble_(uint8_t data)
Find nibble from byte returns -1 if none found.
uint8_t rx_buf[RX_MSGLEN]
bool rx_report_message_()
Check a message to see if it should be reported under pairing / mood / all off rules returns -1 if no...
void rx_paircommit_()
check and commit pair
uint16_t lwrx_stats[RX_STAT_COUNT]
int16_t rx_check_pairs_(const uint8_t *buf, bool all_devices)
Check to see if message matches one of the pairs if mode is pairBase only then ignore device and room...
bool lwrx_getstats_(uint16_t *stats)
Return stats on high and low pulses.
uint32_t lwrx_packetinterval()
Return time in milliseconds since last packet received.
ISRInternalGPIOPin rx_pin_isr_
void lwrx_set_pair_mode(bool pair_enforce, bool pair_base_only)
Set pairs behaviour.
void lwrx_setup(InternalGPIOPin *pin)
Set things up to receive LightWaveRF 434Mhz messages pin must be 2 or 3 to trigger interrupts !...
void rx_addpairfrommsg_()
add pair from message buffer
uint8_t lwrx_getpair(uint8_t *pairdata, uint8_t pairnumber)
Get pair data (translated back to nibble form.
InternalGPIOPin * rx_pin_
uint32_t rx_pairstarttime
uint8_t rx_msg[RX_MSGLEN]
void lwrx_setstatsenable_(bool rx_stats_enable)
Set stats mode.
uint8_t lwrx_addpair(const uint8_t *pairdata)
Add a pair to filter received messages pairdata is device,dummy,5*addr,room pairdata is held in trans...
bool lwrx_message()
Test if a message has arrived.
void rx_remove_pair_(uint8_t *buf)
Remove an existing pair matching the buffer.
uint8_t rx_pairs[RX_MAXPAIRS][8]
static void rx_process_bits(LwRx *arg)
Pin change interrupt routine that identifies 1 and 0 LightwaveRF bits and constructs a message when a...
void lwrx_setfilter(uint8_t repeats, uint8_t timeout)
Set up repeat filtering of received messages.
void lwrx_settranslate(bool translate)
Set translate mode.
void lwrx_makepair(uint8_t timeout)
Make a pair from next message successfully received.
void lwrx_clearpairing_()
Clear all pairing.
bool lwrx_getmessage(uint8_t *buf, uint8_t len)
Transfer a message to user buffer.
Providing packet encoding functions for exchanging data with a remote host.