Contiki 2.5
Files | Functions | Variables
TR1001 radio tranciever device driver

Files

file  tr1001-gcr.c
 Device driver and packet framing for the RFM-TR1001 radio module.
 
file  tr1001.c
 Device driver and packet framing for the RFM-TR1001 radio module.
 

Functions

void tr1001_set_txpower (unsigned char p)
 Set the transmission power of the transceiver. More...
 
int tr1001_init (void)
 Initialize the radio transceiver. More...
 
int tr1001_send (const void *packet, unsigned short len)
 Send a packet. More...
 
int tr1001_read (void *buf, unsigned short bufsize)
 Check if an incoming packet has been received. More...
 
void tr1001_set_speed (unsigned char speed)
 Set the speed of the TR1001 radio device. More...
 
unsigned short tr1001_sstrength (void)
 Calculate the signal strength of a received packet. More...
 

Variables

struct radio_driver tr1001_driver
 Radio driver for TR1001.
 
struct radio_driver tr1001_driver
 Radio driver for TR1001.
 

Detailed Description

Function Documentation

int tr1001_init ( void  )

Initialize the radio transceiver.

Turns on reception of bytes and installs the receive interrupt handler.

Definition at line 358 of file tr1001-gcr.c.

int tr1001_read ( void *  buf,
unsigned short  bufsize 
)

Check if an incoming packet has been received.

This function checks the receive buffer to see if an entire packet has been received. The actual reception is handled by an interrupt handler.

This function should normally not be called from user programs. Rather, the uIP TCP/IP or Rime stack should be used.

Returns
The length of the received packet, or 0 if no packet has been received.

Definition at line 680 of file tr1001-gcr.c.

int tr1001_send ( const void *  packet,
unsigned short  len 
)

Send a packet.

This function causes a packet to be sent out after a small random delay, but without doing any MAC layer collision detection or back-offs. The packet is sent with a 4 byte header that contains a a "type" identifier, an 8-bit packet ID field and the length of the packet in network byte order.

This function should normally not be called from user programs. Rather, the uIP TCP/IP or Rime stack should be used.

Definition at line 580 of file tr1001-gcr.c.

References clock_delay(), and timer_expired().

void tr1001_set_speed ( unsigned char  s)

Set the speed of the TR1001 radio device.

This function sets the speed of the TR1001 radio transceiver. Both the sender and the receiver must have the same speed for communication to work.

Parameters
speedThe speed of the TR1001 radio: TR1001_19200, TR1001_38400, TR1001_57600 or TR1001_115200.

Definition at line 755 of file tr1001-gcr.c.

References tr1001_set_speed().

Referenced by tr1001_init(), and tr1001_set_speed().

void tr1001_set_txpower ( unsigned char  p)

Set the transmission power of the transceiver.

The sensor board is equipped with a DS1804 100 position trimmer potentiometer which is used to set the transmission input current to the radio transceiver chip, thus setting the transmission power of the radio transceiver.

This function sets the trimmer potentiometer to a value between 1 and 100.

Parameters
pThe power of the transceiver, between 1 (lowest) and 100 (highest).

Definition at line 328 of file tr1001-gcr.c.

Referenced by tr1001_init().

unsigned short tr1001_sstrength ( void  )

Calculate the signal strength of a received packet.

This function calculates the received signal strength of the last received packet. This function typically is called when a packet has been received.

Definition at line 782 of file tr1001-gcr.c.