Functions


Functions

void trx_aes_io (aes_access_t mode, uint8_t cmd, bool start, uint8_t *idata, uint8_t *odata)
void trx_aes_read (uint8_t cmd, uint8_t *odata)
void trx_aes_write (uint8_t cmd, bool start, uint8_t *idata)
void trx_aes_wrrd (uint8_t cmd, bool start, uint8_t *idata, uint8_t *odata)
radio_reg_t trx_bit_read (radio_addr_t addr, radio_reg_t mask, uint8_t pos)
void trx_bit_write (radio_addr_t addr, radio_reg_t mask, uint8_t pos, radio_reg_t val)
uint8_t trx_frame_length_read (void)
uint8_t trx_frame_read (uint8_t *frame)
uint8_t trx_frame_read_blm (uint8_t *d)
void trx_frame_write (uint8_t length, uint8_t *frame)
void trx_io_init (void)
void trx_irq_init (void)
void trx_pinset_reset (bool val)
void trx_pinset_slptr (bool val)
void trx_pinset_tst (bool val)
radio_reg_t trx_reg_read (radio_addr_t addr)
void trx_reg_write (radio_addr_t addr, radio_reg_t val)
void trx_require_irq_callback (void)
void trx_sram_read (radio_ram_t addr, uint8_t length, uint8_t *data)
void trx_sram_write (radio_ram_t addr, uint8_t length, uint8_t *data)
void usr_trx_main_irq (uint8_t irqstatus)


Function Documentation

void trx_aes_io ( aes_access_t  mode,
uint8_t  cmd,
bool  start,
uint8_t *  idata,
uint8_t *  odata 
)

Low Level AES access function.

Parameters:
mode AES access mode, one of the macros:
cmd AES control byte (excluding start bit)
start flag that indicates, if the start bit will be set for these transaction
idata 16 byte data array, written to the AES block
Return values:
odata 16 byte data array, read from the AES block

void trx_aes_read ( uint8_t  cmd,
uint8_t *  odata 
)

Read data from AES block.

Parameters:
cmd AES control byte (excluding start bit)
Return values:
odata 16 byte data array, read from the AES block.

void trx_aes_write ( uint8_t  cmd,
bool  start,
uint8_t *  idata 
)

Write data to the AES block.

Parameters:
cmd AES control byte (excluding start bit)
start flag that indicates, if the start bit will be set for these transaction
idata 16 byte data array, written to the AES block

void trx_aes_wrrd ( uint8_t  cmd,
bool  start,
uint8_t *  idata,
uint8_t *  odata 
)

Write and read data from AES block simultaneously.

Parameters:
cmd AES control byte (excluding start bit)
start flag that indicates, if the start bit will be set for these transaction
idata 16 byte data array, written to the AES block
Return values:
odata 16 byte data array, read from the AES block

radio_reg_t trx_bit_read ( radio_addr_t  addr,
radio_reg_t  mask,
uint8_t  pos 
)

Read a value from a subregister.

Parameters:
addr value or variable of uint8_t, the offset of the register
mask mask value of the bit group (at original position)
pos shift value of the bit group
Returns:
value which is read from the sub register.
Note:
For any meaningful combination of the parameters (addr,mask,pos) there exist SR_* macros, which are described in the radio-specific registermap. The appropriate function call is then with the macros: stat = trx_bit_read(SR_TRX_STATUS);

void trx_bit_write ( radio_addr_t  addr,
radio_reg_t  mask,
uint8_t  pos,
radio_reg_t  val 
)

Write a value to a subregister.

Parameters:
addr value or variable of uint8_t, the offset of the register
mask mask value of the bit group (at original position)
pos shift value of the bit group
val value which is written to the sub register
Note:
For any meaningful combination of the parameters (addr,mask,pos) there exist SR_* macros, which are described in the radio-specific registermap. The appropriate function call is then with the macros: trx_bit_write(SR_TRX_CMD,CMD_TRX_OFF);

uint8_t trx_frame_length_read ( void   ) 

Read the length of a received frame.

Returns:
length of the received frame

uint8_t trx_frame_read ( uint8_t *  frame  ) 

Read a frame from the radio transceiver.

Return values:
frame Pointer to an array that takes the received bytes. The array must be able to store (aMaxPHYPacketSize + 2) bytes. The array will receive the frame length byte at index 0, followed by the received frame data, and finally an LQI byte. The length byte accounts for the frame length and the LQI byte, but not for its own size.
Returns:
length of the downloaded frame (including the LQI byte, if radio is AT86RF230), which is stored as the first element of the array frame.

uint8_t trx_frame_read_blm ( uint8_t *  d  ) 

Read frame in buffer level mode.

This function does a frame read in buffer level mode. The frame should be read out during reception of the frame and should be finished after the end of the frame was received. The buffer empty signal should never occur. For it, the interrupt pin is overloaded in the buffer level mode to indicate an empty buffer. A buffer empty is signalled by overwriting the frame length byte with zero. Thus, a check of the frame length byte==0 is sufficient.

Parameters:
d Pointer to an array of Payload bytes that should be read
Returns:
length octet of the downloaded frame

void trx_frame_write ( uint8_t  length,
uint8_t *  frame 
)

Write a frame to the radio transceiver.

Parameters:
length Number of the bytes in the data array.
frame Pointer to an array of bytes that will be sent.

void trx_io_init ( void   ) 

Transceiver IO initialization function.

This function must be called before any other function in the API. It configures the radio IO pins.

void trx_irq_init ( void   ) 

Transceiver IRQ initialization function.

This function have to be called in order to enable the transceiver interrupts in the AVR.

void trx_pinset_reset ( bool  val  ) 

Set the level of the RESET pin.

Parameters:
val 0 for LOW or 1 for HIGH level of the pin
Returns:
void

void trx_pinset_slptr ( bool  val  ) 

Set the level of the SLP_TR pin.

Parameters:
val 0 for LOW or 1 for HIGH level of the pin
Returns:
void

void trx_pinset_tst ( bool  val  ) 

Set the level of the TST pin.

Parameters:
val 0 for LOW or 1 for HIGH level of the pin
Note:
Not all plattforms support this pin.

radio_reg_t trx_reg_read ( radio_addr_t  addr  ) 

Read the value from a register.

Parameters:
addr a value or variable of uint8_t, the offset of the register
Returns:
register value

void trx_reg_write ( radio_addr_t  addr,
radio_reg_t  val 
)

Write a value to a register.

Parameters:
addr a value or variable of uint8_t, the offset of the register
val a variable name of radio_reg_t
Returns:
void

void trx_require_irq_callback ( void   ) 

Linker hook to the library provided ISR.

A call to this dummy function causes the linker to link the predefined interrupt service routine.

See also Interrupt Configuration and Handling.

void trx_sram_read ( radio_ram_t  addr,
uint8_t  length,
uint8_t *  data 
)

Read data from SRAM.

Parameters:
addr start address in the SRAM
length number of bytes to be read
Return values:
data pointer to an array of bytes, where the read from the SRAM are stored.

void trx_sram_write ( radio_ram_t  addr,
uint8_t  length,
uint8_t *  data 
)

Write data to SRAM.

Parameters:
addr start address in the SRAM
length number of bytes to be written
data pointer to an array of bytes

void usr_trx_main_irq ( uint8_t  irqstatus  ) 

Callback for library defined IRQ service routine.

If the library defined ISR is linked, this function will be called, if a radio transceiver interrupt occurs.

See also Interrupt Configuration and Handling .

Parameters:
irqstatus current value of the RG_IRQ_STATUS register


Generated on Mon Aug 17 13:35:02 2009 for SWPM AT86RF212 by  doxygen 1.5.6