Microcontroller Wireless Solutions


pal.c File Reference

General PAL functions for AVR 8-bit MegaRF single chips. More...

Go to the source code of this file.

Functions

void pal_alert (void)
retval_t pal_init (void)
retval_t pal_ps_get (ps_type_t ps_type, uint16_t start_addr, uint16_t length, void *value)
retval_t pal_ps_set (uint16_t start_addr, uint16_t length, void *value)
void pal_task (void)
static void wdt_init (void)

Detailed Description

General PAL functions for AVR 8-bit MegaRF single chips.

This file implements generic PAL function and performs USB related handling if required for AVR 8-bit MegaRF single chips.

Id:
pal.c 27848 2011-07-26 12:14:45Z uwalter
Author:
Atmel Corporation: http://www.atmel.com
Support email: avr@atmel.com

Definition in file pal.c.


Function Documentation

void pal_alert ( void  )

Alert indication.

This Function can be used by any application to indicate an error condition. The function is blocking and does never return.

Definition at line 191 of file pal.c.

References ALERT_INDICATE, ALERT_INIT, and pal_timer_delay().

retval_t pal_init ( void  )

Initialization of PAL.

This function initializes the PAL. The RC oscillator is calibrated.

Returns:
MAC_SUCCESS if PAL initialization is successful, FAILURE otherwise

Definition at line 50 of file pal.c.

References gpio_init(), MAC_SUCCESS, mcu_init(), timer_init(), and wdt_init().

retval_t pal_ps_get ( ps_type_t  ps_type,
uint16_t  start_addr,
uint16_t  length,
void *  value 
)

Get data from persistence storage.

Parameters:
[in]ps_typePersistence storage type
[in]start_addrStart offset within EEPROM
[in]lengthNumber of bytes to read from EEPROM
[out]valueData from persistence storage
Returns:
MAC_SUCCESS if everything went OK else FAILURE

Definition at line 110 of file pal.c.

References EXTERN_EEPROM, extern_eeprom_get(), FAILURE, INTERN_EEPROM, MAC_INVALID_PARAMETER, and MAC_SUCCESS.

retval_t pal_ps_set ( uint16_t  start_addr,
uint16_t  length,
void *  value 
)

Write data to persistence storage.

Parameters:
[in]start_addrStart address offset within EEPROM
[in]lengthNumber of bytes to be written to EEPROM
[in]valueData to persistence storage
Returns:
MAC_SUCCESS if everything went OK else FAILURE

Definition at line 157 of file pal.c.

References FAILURE, and MAC_SUCCESS.

void pal_task ( void  )

Services timer and sio handler.

This function calls sio & timer handling functions.

Definition at line 79 of file pal.c.

References timer_service().