|
Contiki-Inga 3.x
|
This file contains low-level radio driver code. More...
#include <stdint.h>#include <stdbool.h>#include "contiki-conf.h"Go to the source code of this file.
Data Structures | |
| struct | hal_rx_frame_t |
| This struct defines the rx data container. More... | |
Macros | |
| #define | HAL_SS_HIGH() (HAL_PORT_SS |= ( 1 << HAL_SS_PIN )) |
| MACRO for pulling SS high. More... | |
| #define | HAL_SS_LOW() (HAL_PORT_SS &= ~( 1 << HAL_SS_PIN )) |
| MACRO for pulling SS low. More... | |
| #define | HAL_ENTER_CRITICAL_REGION() MULLE_ENTER_CRITICAL_REGION( ) |
| This macro will protect the following code from interrupts. More... | |
| #define | HAL_LEAVE_CRITICAL_REGION() MULLE_LEAVE_CRITICAL_REGION( ) |
| This macro must always be used in conjunction with HAL_ENTER_CRITICAL_REGION so that interrupts are enabled again. More... | |
| #define | hal_enable_trx_interrupt() HAL_ENABLE_RADIO_INTERRUPT( ) |
| Enable the interrupt from the radio transceiver. | |
| #define | hal_disable_trx_interrupt() HAL_DISABLE_RADIO_INTERRUPT( ) |
| Disable the interrupt from the radio transceiver. More... | |
This is the list of pin configurations needed for a given platform. | |
Change these values to port to other platforms. | |
| #define | RAVENUSB_C 1 |
| #define | INGA_12 1 |
| #define | RCB_B 3 |
| #define | ZIGBIT 4 |
| #define | IRIS 5 |
| #define | ATMEGA128RFA1 6 |
| #define | SSPORT B |
| #define | SSPIN (0x04) |
| #define | SPIPORT B |
| #define | MOSIPIN (0x05) |
| #define | MISOPIN (0x06) |
| #define | SCKPIN (0x07) |
| #define | RSTPORT B |
| #define | RSTPIN (0x01) |
| #define | IRQPORT D |
| #define | IRQPIN (0x06) |
| #define | SLPTRPORT B |
| #define | SLPTRPIN (0x03) |
| #define | TXCWPORT B |
| #define | TXCWPIN (0x00) |
| #define | USART 0 |
| #define | USARTVECT USART0_RX_vect |
| #define | TICKTIMER 3 |
| #define | HAS_CW_MODE |
| #define | HAS_SPARE_TIMER |
| #define | SCKPORT SPIPORT |
| #define | MOSIPORT SPIPORT |
| #define | MISOPORT SPIPORT |
Pin macros | |
These macros convert the platform-specific pin defines into names and functions that the source code can directly use. | |
| #define | SLP_TR SLPTRPIN |
| Pin number that corresponds to the SLP_TR pin. More... | |
| #define | DDR_SLP_TR DDR( SLPTRPORT ) |
| Data Direction Register that corresponds to the port where SLP_TR is connected. More... | |
| #define | PORT_SLP_TR PORT( SLPTRPORT ) |
| Port (Write Access) where SLP_TR is connected. More... | |
| #define | PIN_SLP_TR PIN( SLPTRPORT ) |
| Pin (Read Access) where SLP_TR is connected. More... | |
| #define | hal_set_slptr_high() ( PORT_SLP_TR |= ( 1 << SLP_TR ) ) |
| This macro pulls the SLP_TR pin high. More... | |
| #define | hal_set_slptr_low() ( PORT_SLP_TR &= ~( 1 << SLP_TR ) ) |
| This macro pulls the SLP_TR pin low. More... | |
| #define | hal_get_slptr() ( PIN_SLP_TR & ( 1 << SLP_TR ) ) |
| Read current state of the SLP_TR pin (High/Low). More... | |
| #define | RST RSTPIN |
| Pin number that corresponds to the RST pin. More... | |
| #define | DDR_RST DDR( RSTPORT ) |
| Data Direction Register that corresponds to the port where RST is. | |
| #define | PORT_RST PORT( RSTPORT ) |
| Port (Write Access) where RST is connected. More... | |
| #define | PIN_RST PIN( RSTPORT /* BUG? */) |
| Pin (Read Access) where RST is connected. More... | |
| #define | hal_set_rst_high() ( PORT_RST |= ( 1 << RST ) ) |
| This macro pulls the RST pin high. More... | |
| #define | hal_set_rst_low() ( PORT_RST &= ~( 1 << RST ) ) |
| This macro pulls the RST pin low. More... | |
| #define | hal_get_rst() ( ( PIN_RST & ( 1 << RST ) ) >> RST ) |
| Read current state of the RST pin (High/Low). More... | |
| #define | HAL_SS_PIN SSPIN |
| The slave select pin. More... | |
| #define | HAL_SCK_PIN SCKPIN |
| Data bit for SCK. More... | |
| #define | HAL_MOSI_PIN MOSIPIN |
| #define | HAL_MISO_PIN MISOPIN |
| #define | HAL_PORT_SPI PORT( SPIPORT ) |
| The SPI module is located on PORTB. More... | |
| #define | HAL_PORT_SS PORT( SSPORT ) |
| #define | HAL_PORT_SCK PORT( SCKPORT ) |
| #define | HAL_PORT_MOSI PORT( MOSIPORT ) |
| The SPI module uses GPIO might be split on different ports. More... | |
| #define | HAL_PORT_MISO PORT( MISOPORT ) |
| The SPI module uses GPIO might be split on different ports. More... | |
| #define | HAL_DDR_SPI DDR( SPIPORT ) |
| Data Direction Register for PORTB. More... | |
| #define | HAL_DDR_SS DDR( SSPORT ) |
| Data Direction Register for MISO GPIO pin. More... | |
| #define | HAL_DDR_SCK DDR( SCKPORT ) |
| Data Direction Register for MISO GPIO pin. More... | |
| #define | HAL_DDR_MOSI DDR( MOSIPORT ) |
| Data Direction Register for MISO GPIO pin. More... | |
| #define | HAL_DDR_MISO DDR( MISOPORT ) |
| Data Direction Register for MOSI GPIO pin. More... | |
| #define | HAL_DD_SS SSPIN |
| Data Direction bit for SS. More... | |
| #define | HAL_DD_SCK SCKPIN |
| Data Direction bit for SCK. More... | |
| #define | HAL_DD_MOSI MOSIPIN |
| Data Direction bit for MOSI. More... | |
| #define | HAL_DD_MISO MISOPIN |
| Data Direction bit for MISO. More... | |
Macros for radio operation. | |
| #define | HAL_BAT_LOW_MASK ( 0x80 ) |
| Mask for the BAT_LOW interrupt. More... | |
| #define | HAL_TRX_UR_MASK ( 0x40 ) |
| Mask for the TRX_UR interrupt. More... | |
| #define | HAL_TRX_END_MASK ( 0x08 ) |
| Mask for the TRX_END interrupt. More... | |
| #define | HAL_RX_START_MASK ( 0x04 ) |
| Mask for the RX_START interrupt. More... | |
| #define | HAL_PLL_UNLOCK_MASK ( 0x02 ) |
| Mask for the PLL_UNLOCK interrupt. More... | |
| #define | HAL_PLL_LOCK_MASK ( 0x01 ) |
| Mask for the PLL_LOCK interrupt. More... | |
| #define | HAL_MIN_FRAME_LENGTH ( 0x03 ) |
| A frame should be at least 3 bytes. More... | |
| #define | HAL_MAX_FRAME_LENGTH ( 0x7F ) |
| A frame should no more than 127 bytes. 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 | hal_sram_read (uint8_t address, uint8_t length, uint8_t *data) |
| Read SRAM. More... | |
| void | hal_sram_write (uint8_t address, uint8_t length, uint8_t *data) |
| Write SRAM. More... | |
This file contains low-level radio driver code.
Definition in file hal.h.
1.8.3.1