239 #ifndef VirtualWire_h
240 #define VirtualWire_h
243 #include "VirtualWire_Config.h"
246 #define VW_PLATFORM_ARDUINO 1
247 #define VW_PLATFORM_MSP430 2
248 #define VW_PLATFORM_STM32 3
249 #define VW_PLATFORM_GENERIC_AVR8 4
250 #define VW_PLATFORM_UNO32 5
255 #define VW_PLATFORM VW_PLATFORM_ARDUINO
256 #elif defined(__MSP430G2452__) || defined(__MSP430G2553__)
257 #define VW_PLATFORM VW_PLATFORM_MSP430
258 #elif defined(MCU_STM32F103RE)
259 #define VW_PLATFORM VW_PLATFORM_STM32
261 #define VW_PLATFORM VW_PLATFORM_UNO32
263 #error Platform not defined!
267 #if (VW_PLATFORM == VW_PLATFORM_ARDUINO)
273 #elif (VW_PLATFORM == VW_PLATFORM_MSP430)// LaunchPad specific
274 #include "legacymsp430.h"
276 #elif (VW_PLATFORM == VW_PLATFORM_STM32) // Maple etc
279 #define MAPLE_TIMER 1
280 #elif (VW_PLATFORM == VW_PLATFORM_UNO32)
281 #elif (VW_PLATFORM != VW_PLATFORM_GENERIC_AVR8)
282 #error Platform unknown!
290 #ifndef VW_MAX_MESSAGE_LEN
292 #define VW_MAX_MESSAGE_LEN 80
293 #endif //VW_MAX_MESSAGE_LEN
295 #if !defined(VW_RX_SAMPLES_PER_BIT)
297 #define VW_RX_SAMPLES_PER_BIT 8
298 #endif //VW_RX_SAMPLES_PER_BIT
301 #define VW_MAX_PAYLOAD VW_MAX_MESSAGE_LEN-3
304 #define VW_RX_RAMP_LEN 160
312 #define VW_RAMP_INC (VW_RX_RAMP_LEN/VW_RX_SAMPLES_PER_BIT)
314 #define VW_RAMP_TRANSITION VW_RX_RAMP_LEN/2
316 #define VW_RAMP_ADJUST 9
318 #define VW_RAMP_INC_RETARD (VW_RAMP_INC-VW_RAMP_ADJUST)
320 #define VW_RAMP_INC_ADVANCE (VW_RAMP_INC+VW_RAMP_ADJUST)
329 #define VW_HEADER_LEN 8
338 #if (VW_PLATFORM != VW_PLATFORM_GENERIC_AVR8 )
374 extern void vw_setup(uint16_t speed);
410 extern uint8_t
vw_send(uint8_t* buf, uint8_t len);
void vw_set_ptt_pin(uint8_t pin)
Definition: VirtualWire.cpp:287
uint8_t vw_wait_rx_max(unsigned long milliseconds)
Definition: VirtualWire.cpp:652
uint8_t vw_have_message()
Definition: VirtualWire.cpp:731
void vw_wait_tx()
Definition: VirtualWire.cpp:633
void vw_wait_rx()
Definition: VirtualWire.cpp:642
void vw_rx_start()
Definition: VirtualWire.cpp:610
uint8_t vw_tx_active()
Definition: VirtualWire.cpp:626
uint8_t vw_get_message(uint8_t *buf, uint8_t *len)
Definition: VirtualWire.cpp:739
void vw_set_rx_pin(uint8_t pin)
Definition: VirtualWire.cpp:281
uint8_t vw_get_rx_bad()
Definition: VirtualWire.cpp:767
uint8_t vw_send(uint8_t *buf, uint8_t len)
Definition: VirtualWire.cpp:684
void vw_set_rx_inverted(uint8_t inverted)
Definition: VirtualWire.cpp:261
void vw_set_tx_pin(uint8_t pin)
Definition: VirtualWire.cpp:275
void vw_set_ptt_inverted(uint8_t inverted)
Definition: VirtualWire.cpp:267
void vw_rx_stop()
Definition: VirtualWire.cpp:620
void vw_setup(uint16_t speed)
uint8_t vw_get_rx_good()
Definition: VirtualWire.cpp:762