hal.c File Reference

This file contains low-level radio driver code. More...

#include <stdlib.h>
#include "hal.h"
#include "at86rf230_registermap.h"

Go to the source code of this file.

Defines

#define HAL_DUMMY_READ   (0x00)
 Dummy value for the SPI.
#define HAL_TRX_CMD_RW   (0xC0)
 Register Write (short mode).
#define HAL_TRX_CMD_RR   (0x80)
 Register Read (short mode).
#define HAL_TRX_CMD_FW   (0x60)
 Frame Transmit Mode (long mode).
#define HAL_TRX_CMD_FR   (0x20)
 Frame Receive Mode (long mode).
#define HAL_TRX_CMD_SW   (0x40)
 SRAM Write.
#define HAL_TRX_CMD_SR   (0x00)
 SRAM Read.
#define HAL_TRX_CMD_RADDRM   (0x7F)
 Register Address Mask.
#define HAL_CALCULATED_CRC_OK   (0)
 CRC calculated over the frame including the CRC field should be 0.

Functions

void hal_init (void)
 This function initializes the Hardware Abstraction Layer.
void hal_reset_flags (void)
 This function reset the interrupt flags and interrupt event handlers (Callbacks) to their default value.
uint8_t hal_get_bat_low_flag (void)
 This function returns the current value of the BAT_LOW flag.
void hal_clear_bat_low_flag (void)
 This function clears the BAT_LOW flag.
hal_trx_end_isr_event_handler_t hal_get_trx_end_event_handler (void)
 This function is used to set new TRX_END event handler, overriding old handler reference.
void hal_set_trx_end_event_handler (hal_trx_end_isr_event_handler_t trx_end_callback_handle)
 This function is used to set new TRX_END event handler, overriding old handler reference.
void hal_clear_trx_end_event_handler (void)
 Remove event handler reference.
hal_rx_start_isr_event_handler_t hal_get_rx_start_event_handler (void)
 This function returns the active RX_START event handler.
void hal_set_rx_start_event_handler (hal_rx_start_isr_event_handler_t rx_start_callback_handle)
 This function is used to set new RX_START event handler, overriding old handler reference.
void hal_clear_rx_start_event_handler (void)
 Remove event handler reference.
uint8_t hal_get_pll_lock_flag (void)
 This function returns the current value of the PLL_LOCK flag.
void hal_clear_pll_lock_flag (void)
 This function clears the PLL_LOCK flag.
uint8_t hal_register_read (uint8_t address)
 This function reads data from one of the radio transceiver's registers.
void hal_register_write (uint8_t address, uint8_t value)
 This function writes a new value to one of the radio transceiver's registers.
uint8_t hal_subregister_read (uint8_t address, uint8_t mask, uint8_t position)
 This function reads the value of a specific subregister.
void hal_subregister_write (uint8_t address, uint8_t mask, uint8_t position, uint8_t value)
 This function writes a new value to one of the radio transceiver's subregisters.
void hal_frame_read (hal_rx_frame_t *rx_frame, rx_callback_t rx_callback)
 This function will upload a frame from the radio transceiver's frame buffer.
void hal_frame_write (uint8_t *write_buffer, uint8_t length)
 This function will download a frame to the radio transceiver's frame buffer.
void hal_sram_read (uint8_t address, uint8_t length, uint8_t *data)
 Read SRAM.
void hal_sram_write (uint8_t address, uint8_t length, uint8_t *data)
 Write SRAM.
void RADIO_VECT (void)
 ISR for the radio IRQ line, triggered by the input capture.
void TIMER1_OVF_vect (void)
 Timer Overflow ISR This is the interrupt service routine for timer1 overflow.

Detailed Description

This file contains low-level radio driver code.

Definition in file hal.c.


Generated on Mon Apr 11 14:23:48 2011 for Contiki 2.5 by  doxygen 1.6.1