AVR Z-LINKŪ


tat.c File Reference


Detailed Description

This files implements the Transceiver Access Toolbox.

Application note:
AVR2001: AT86RF230 Software Programmer's Guide
Documentation
For comprehensive code documentation, supported compilers, compiler settings and supported devices see readme.html
Author:
Atmel Corporation: http://www.atmel.com
Support email: avr@atmel.com
$Name$
Revision
613
$RCSfile$
Date
2006-04-07 14:40:07 +0200 (fr, 07 apr 2006)

Copyright (c) 2006, Atmel Corporation All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. The name of ATMEL may not be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file tat.c.

#include <stdint.h>
#include <stdbool.h>
#include "at86rf230_registermap.h"
#include "compiler.h"
#include "tat.h"
#include "hal.h"

Include dependency graph for tat.c:

Go to the source code of this file.

Defines

#define TAT_BUSY_CHANNEL   ( 3 )
#define TAT_CCA_DONE_MASK   ( 1 << 7 )
 Mask used to check the CCA_DONE bit.
#define TAT_CCA_IDLE_MASK   ( 1 << 6 )
 Mask used to check the CCA_STATUS bit.
#define TAT_MIN_IEEE_FRAME_LENGTH   ( 5 )
#define TAT_START_CCA   ( 1 )
 Value in the CCA_REQUEST subregister that initiate a cca.
#define TAT_TRANSMISSION_SUCCESS   ( 0 )

Enumerations

enum  tat_trx_timing_t {
  TIME_P_ON_TO_TRX_OFF = 510, TIME_SLEEP_TO_TRX_OFF = 880, TIME_RESET = 6, TIME_ED_MEASUREMENT = 140,
  TIME_CCA = 140, TIME_PLL_LOCK = 150, TIME_FTN_TUNING = 25, TIME_NOCLK_TO_WAKE = 6,
  TIME_CMD_FORCE_TRX_OFF = 1, TIME_TRX_OFF_TO_PLL_ACTIVE = 180, TIME_STATE_TRANSITION_PLL_ACTIVE = 1
}
 This enumeration defines the necessary timing information for the AT86RF230 radio transceiver. All times are in microseconds. More...

Functions

static bool is_sleeping (void)
 This function checks if the radio transceiver is sleeping.
tat_status_t tat_batmon_configure (bool range, uint8_t voltage_threshold)
 This function is used to configure the battery monitor module.
tat_status_t tat_batmon_get_status (void)
 This function returns the status of the Battery Monitor module.
uint8_t tat_batmon_get_voltage_range (void)
 This function returns if high or low voltage range is used.
uint8_t tat_batmon_get_voltage_threshold (void)
 This function returns the current threshold volatge used by the battery monitor (BATMON_VTH).
tat_status_t tat_calibrate_filter (void)
 This function calibrates the Single Side Band Filter.
tat_status_t tat_calibrate_pll (void)
 This function calibrates the PLL.
tat_status_t tat_configure_csma (uint8_t seed0, uint8_t be_csma_seed1)
 This function will configure the CSMA algorithm used by the radio transceiver when transmitting data from TX_ARET_ON state.
tat_status_t tat_do_cca (void)
 This function will perform a Clear Channel Assessment.
tat_status_t tat_do_ed_scan (uint8_t *ed_level)
 This function will measure the amount of energy sensed on the antenna pins.
tat_status_t tat_enter_sleep_mode (void)
 This function will put the radio transceiver to sleep.
uint8_t tat_get_cca_mode (void)
 This function returns the current CCA mode used.
uint8_t tat_get_clock_speed (void)
 This function returns the current clock setting for the CLKM pin.
uint8_t tat_get_ed_threshold (void)
 This function returns the current ED threshold used by the CCA algorithm.
uint64_t tat_get_extended_address (void)
 This function will read the extended address used by the address filter.
uint8_t tat_get_operating_channel (void)
 This function will return the channel used by the radio transceiver.
uint16_t tat_get_pan_id (void)
 This function will return the PANID used by the address filter.
tat_status_t tat_get_rssi_value (uint8_t *rssi)
 This function returns the Received Signal Strength Indication.
uint16_t tat_get_short_address (void)
 This function will return the current short address used by the address filter.
uint8_t tat_get_trx_state (void)
 This function return the Radio Transceivers current state.
uint8_t tat_get_tx_power_level (void)
 This function will read and return the output power level.
tat_status_t tat_init (void)
 Initialize the Transceiver Access Toolbox and lower layers.
tat_status_t tat_leave_sleep_mode (void)
 This function will take the radio transceiver from sleep mode and put it into the TRX_OFF state.
void tat_reset_state_machine (void)
 This function will reset the state machine (to TRX_OFF) from any of its states, except for the SLEEP state.
void tat_reset_trx (void)
 This function will reset all the registers and the state machine of the radio transceiver.
tat_status_t tat_send_data (uint8_t *data, uint8_t data_length)
 This function will download a frame to the radio transceiver's transmit buffer and send it.
tat_status_t tat_send_data_with_retry (uint8_t frame_length, uint8_t *frame, uint8_t retries)
 This function uses the .
tat_status_t tat_set_cca_mode (uint8_t mode, uint8_t ed_threshold)
 This function will configure the Clear Channel Assessment algorithm.
tat_status_t tat_set_clock_speed (bool direct, uint8_t clock_speed)
 This function changes the prescaler on the CLKM pin.
void tat_set_extended_address (uint64_t new_extended_address)
 This function will set a new extended address to be used by the address filter.
tat_status_t tat_set_operating_channel (uint8_t channel)
 This function will change the operating channel.
void tat_set_pan_id (uint16_t new_pan_id)
 This function will set the PANID used by the address filter.
void tat_set_short_address (uint16_t new_short_address)
 This function will set the short address used by the address filter.
tat_status_t tat_set_trx_state (uint8_t new_state)
 This function will change the current state of the radio transceiver's internal state machine.
tat_status_t tat_set_tx_power_level (uint8_t power_level)
 This function will change the output power level.
void tat_use_auto_tx_crc (bool auto_crc_on)
 This function will enable or disable automatic CRC during frame transmission.


Define Documentation

#define TAT_BUSY_CHANNEL   ( 3 )

Definition at line 64 of file tat.c.

Referenced by tat_send_data_with_retry().

#define TAT_CCA_DONE_MASK   ( 1 << 7 )

Mask used to check the CCA_DONE bit.

Definition at line 58 of file tat.c.

Referenced by tat_do_cca().

#define TAT_CCA_IDLE_MASK   ( 1 << 6 )

Mask used to check the CCA_STATUS bit.

Definition at line 59 of file tat.c.

Referenced by tat_do_cca().

#define TAT_MIN_IEEE_FRAME_LENGTH   ( 5 )

Definition at line 65 of file tat.c.

Referenced by tat_send_data_with_retry().

#define TAT_START_CCA   ( 1 )

Value in the CCA_REQUEST subregister that initiate a cca.

Definition at line 61 of file tat.c.

Referenced by tat_do_cca().

#define TAT_TRANSMISSION_SUCCESS   ( 0 )

Definition at line 63 of file tat.c.

Referenced by tat_send_data_with_retry().

@DOC_TITLE@
Generated on Wed Jul 11 18:16:31 2007 for AVR2001 AT86RF230 Software Programmer's Manual by doxygen 1.4.7