rfm12_extra.h File Reference

rfm12 library extra features header More...

Go to the source code of this file.

Data Structures

struct  rfm12_rfrxbuf_t
 The receive buffer structure for the amplitude modulated receive feature. More...

Defines

States and buffer size for the amplitude modulated receive feature.

Note:
You need to define RFM12_RECEIVE_ASK as 1 to enable this.
See also:
rfrxbuf_t and ISR(ADC_vect, ISR_NOBLOCK)


#define RFM12_ASK_RFRXBUF_SIZE   55
 The ASK receive buffer size.
#define RFM12_ASK_STATE_EMPTY   0
 The ASK receive buffer is empty.
#define RFM12_ASK_STATE_RECEIVING   1
 The ASK receive buffer is active.
#define RFM12_ASK_STATE_FULL   2
 The ASK receive buffer is full.
States for the low battery detection feature .
#define RFM12_BATT_OKAY   0
 Battery voltage is okay.
#define RFM12_BATT_LOW   1
 Low battery voltage detected.

Functions

void adc_init (void)
 ASK mode ADC interrupt setup.
void rfm12_ask_tx_mode (uint8_t setting)
 En- or disable ASK transmissions.
void rfm12_tx_on (void)
 Enable the transmitter immediately (ASK transmission mode).
void rfm12_tx_off (void)
 Set default power mode (usually transmitter off, receiver on).
void rfm12_set_wakeup_timer (uint16_t val)
 This function sets the wakeup timer register.
void rfm12_set_batt_detector (uint16_t val)
 This function sets the low battery detector and microcontroller clock divider register.
uint8_t rfm12_get_batt_status (void)
 Return the current low battery detector status.

Variables

rfm12_rfrxbuf_t ask_rxbuf
 The ASK mode receive buffer structure.

Detailed Description

rfm12 library extra features header

Author:
Hans-Gert Dahmen
Peter Fuhrmann
Soeren Heisrath
Version:
0.9.0
Date:
08.09.09

This header declares all stuff related to extra features.

Note:
It is usually not required to explicitly include this header, as this is already done by rfm12.h.

Define Documentation

#define RFM12_ASK_RFRXBUF_SIZE   55

The ASK receive buffer size.

#define RFM12_ASK_STATE_EMPTY   0

The ASK receive buffer is empty.

#define RFM12_ASK_STATE_FULL   2

The ASK receive buffer is full.

#define RFM12_ASK_STATE_RECEIVING   1

The ASK receive buffer is active.

#define RFM12_BATT_LOW   1

Low battery voltage detected.

#define RFM12_BATT_OKAY   0

Battery voltage is okay.


Function Documentation

void adc_init ( void   ) 

ASK mode ADC interrupt setup.

This will setup the ADC interrupt to receive ASK modulated signals. rfm12_init() calls this function automatically if ASK receive mode is enabled.

Note:
You need to define RFM12_RECEIVE_ASK as 1 to enable this.
See also:
ISR(ADC_vect, ISR_NOBLOCK) and rfm12_rfrxbuf_t
void rfm12_ask_tx_mode ( uint8_t  setting  ) 

En- or disable ASK transmissions.

When enabling ASK tx mode, this function puts the internal state machine into transmit mode and disables the interrupt. Otherwise it will restore normale operation.

Parameters:
[setting] Pass 1 to enable the raw mode, 0 to disable it.
Note:
You need to define RFM12_TRANSMIT_ASK as 1 to enable this.
Warning:
This will interfere with the wakeup timer feature.
Todo:
Use power management shadow register if the wakeup timer feature is enabled.
See also:
rfm12_tx_on() and rfm12_tx_off()
uint8_t rfm12_get_batt_status ( void   ) 

Return the current low battery detector status.

Returns:
One of these battery states .
See also:
rfm12_set_batt_detector() and the battery state defines
void rfm12_set_batt_detector ( uint16_t  val  ) 

This function sets the low battery detector and microcontroller clock divider register.

Parameters:
[val] The register value to be passed to the rf12.
See the rf12 datasheet for valid values.
See also:
rfm12_get_batt_status()
void rfm12_set_wakeup_timer ( uint16_t  val  ) 

This function sets the wakeup timer register.

Parameters:
[val] The wakeup timer period value to be passed to the rf12.
See the rf12 datasheet for valid values.
void rfm12_tx_off ( void   )  [inline]

Set default power mode (usually transmitter off, receiver on).

This will usually stop a transmission. This function is used to emulate amplitude modulated signals.

Note:
You need to define RFM12_TRANSMIT_ASK as 1 to enable this.
Warning:
This will interfere with the wakeup timer feature.
Todo:
Use power management shadow register if the wakeup timer feature is enabled.
See also:
rfm12_tx_on() and rfm12_ask_tx_mode()
void rfm12_tx_on ( void   )  [inline]

Enable the transmitter immediately (ASK transmission mode).

This will send out the current buffer contents. This function is used to emulate amplitude modulated signals.

Note:
You need to define RFM12_TRANSMIT_ASK as 1 to enable this.
Warning:
This will interfere with the wakeup timer feature.
Todo:
Use power management shadow register if the wakeup timer feature is enabled.
See also:
rfm12_tx_off() and rfm12_ask_tx_mode()

Variable Documentation

The ASK mode receive buffer structure.

You will need to poll the state field of this structure to determine if data is available, see ASK mode defines.
Received data can be read from the buf field. It is necessary to reset the state field to RFM12_ASK_STATE_EMPTY after reading.

Note:
You need to define RFM12_RECEIVE_ASK as 1 to enable this.


Das LABOR
Generated on Tue Dec 1 17:24:00 2009 for rfm12lib by doxygen 1.6.1