Contiki 3.x
Macros | Functions | Variables
halbb.c File Reference

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

#include <stdlib.h>
#include "hal.h"
#include "at86rf230_registermap.h"
#include "stdio.h"
#include "K60.h"
#include "llwu.h"

Go to the source code of this file.

Macros

#define HAL_DUMMY_READ   (0x00)
 Dummy value for the SPI. More...
 
#define HAL_TRX_CMD_RW   (0xC0)
 Register Write (short mode). More...
 
#define HAL_TRX_CMD_RR   (0x80)
 Register Read (short mode). More...
 
#define HAL_TRX_CMD_FW   (0x60)
 Frame Transmit Mode (long mode). More...
 
#define HAL_TRX_CMD_FR   (0x20)
 Frame Receive Mode (long mode). More...
 
#define HAL_TRX_CMD_SW   (0x40)
 SRAM Write. More...
 
#define HAL_TRX_CMD_SR   (0x00)
 SRAM Read. More...
 
#define HAL_TRX_CMD_RADDRM   (0x7F)
 Register Address Mask. More...
 
#define HAL_CALCULATED_CRC_OK   (0)
 CRC calculated over the frame including the CRC field should be 0. More...
 
#define HAL_SPI_TRANSFER_OPEN()   HAL_ENTER_CRITICAL_REGION();
 This function is called when a rx_start interrupt is signaled. More...
 

Functions

void hal_init (void)
 This function initializes the Hardware Abstraction Layer.
 
uint8_t hal_register_read (uint8_t address)
 This function reads data from one of the radio transceiver's registers. More...
 
void hal_register_write (uint8_t address, uint8_t value)
 This function writes a new value to one of the radio transceiver's registers. More...
 
uint8_t hal_subregister_read (uint8_t address, uint8_t mask, uint8_t position)
 This function reads the value of a specific subregister. More...
 
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. More...
 
void hal_frame_read (hal_rx_frame_t *rx_frame)
 Transfer a frame from the radio transceiver to a RAM buffer. More...
 
void hal_frame_write (uint8_t *write_buffer, uint8_t length)
 This function will download a frame to the radio transceiver's frame buffer. More...
 
void RADIO_VECT (void)
 ISR for the radio IRQ line, triggered by the input capture. More...
 

Variables

volatile signed char rf230_last_rssi
 This is a file internal variable that contains the 16 MSB of the system time. More...
 

Detailed Description

This file contains low-level radio driver code.

This version is optimized for use with the "barebones" RF230bb driver, which communicates directly with the contiki core MAC layer. It is optimized for speed at the expense of generality.

Definition in file halbb.c.