Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Group_pal

Modules

 Common SW Timer
 Implements the software Algorithm for Timer Handling in the Stack.
 

Typedefs

typedef enum ps_type_tag ps_type_t
 IDs for persistence storage type. More...
 
typedef enum timeout_type_tag timeout_type_t
 Timeout type. More...
 

Enumerations

enum  ps_type_tag {
  INTERN_EEPROM,
  EXTERN_EEPROM
}
 IDs for persistence storage type. More...
 
enum  timeout_type_tag {
  TIMEOUT_RELATIVE,
  TIMEOUT_ABSOLUTE
}
 Timeout type. More...
 

Functions

uint16_t pal_generate_rand_seed (void)
 Generation of random seed for function srand() in case this is not supported by the transceiver (e.g. More...
 
void pal_get_current_time (uint32_t *current_time)
 Gets current time. More...
 
bool pal_is_timer_running (uint8_t timer_id)
 Checks if the timer of requested timer identifier is running. More...
 
retval_t pal_ps_get (ps_type_t ps_type, uint16_t start_addr, uint16_t length, void *value)
 Get data from persistence storage. More...
 
retval_t pal_ps_set (uint16_t start_addr, uint16_t length, void *value)
 Write data to persistence storage. More...
 
retval_t pal_start_high_priority_timer (uint8_t timer_id, uint16_t timer_count, FUNC_PTR timer_cb, void *param_cb)
 Starts high priority timer. More...
 
retval_t pal_stop_high_priority_timer (uint8_t timer_id)
 Stops a high priority timer. More...
 
void pal_task (void)
 Services timer and sio handler. More...
 
retval_t pal_timer_get_id (uint8_t *timer_id)
 
retval_t pal_timer_start (uint8_t timer_id, uint32_t timer_count, timeout_type_t timeout_type, FUNC_PTR timer_cb, void *param_cb)
 Start regular timer. More...
 
retval_t pal_timer_stop (uint8_t timer_id)
 Stops a running timer. More...
 

typedef enum ps_type_tag ps_type_t

IDs for persistence storage type.

Timeout type.

IDs for persistence storage type.

Enumerator
INTERN_EEPROM 

MCU Internal EEPROM.

EXTERN_EEPROM 

External EEPROM.

Timeout type.

Enumerator
TIMEOUT_RELATIVE 

The timeout is relative to the current time.

TIMEOUT_ABSOLUTE 

The timeout is an absolute value.

uint16_t pal_generate_rand_seed ( void  )

Generation of random seed for function srand() in case this is not supported by the transceiver (e.g.

AT86RF230)

Returns
uint16_t Random number to be used as seed for function srand()
void pal_get_current_time ( uint32_t *  current_time)

Gets current time.

This function returns the current time.

Parameters
[out]current_timeReturns current system time
bool pal_is_timer_running ( uint8_t  timer_id)

Checks if the timer of requested timer identifier is running.

This function checks if the timer of requested timer identifier is running.

Parameters
timer_idTimer identifier
Returns
  • true if timer with requested timer id is running,
  • false otherwise.
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
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
retval_t pal_start_high_priority_timer ( uint8_t  timer_id,
uint16_t  timer_count,
FUNC_PTR  timer_cb,
void *  param_cb 
)

Starts high priority timer.

This function starts a high priority timer for the specified timeout.

Parameters
timer_idTimer identifier
timer_countTimeout in microseconds
timer_cbCallback handler invoked upon timer expiry
param_cbArgument for the callback handler
Returns
retval_t pal_stop_high_priority_timer ( uint8_t  timer_id)

Stops a high priority timer.

This function stops a high priority timer.

Parameters
timer_idTimer identifier
Returns
void pal_task ( void  )

Services timer and sio handler.

This function calls sio & timer handling functions.

retval_t pal_timer_get_id ( uint8_t *  timer_id)
retval_t pal_timer_start ( uint8_t  timer_id,
uint32_t  timer_count,
timeout_type_t  timeout_type,
FUNC_PTR  timer_cb,
void *  param_cb 
)

Start regular timer.

This function starts a regular timer and installs the corresponding callback function handle the timeout event.

Parameters
timer_idTimer identifier
timer_countTimeout in microseconds
timeout_typeTIMEOUT_RELATIVE or TIMEOUT_ABSOLUTE
timer_cbCallback handler invoked upon timer expiry
param_cbArgument for the callback handler
Returns
retval_t pal_timer_stop ( uint8_t  timer_id)

Stops a running timer.

This function stops a running timer with specified timer_id

Parameters
timer_idTimer identifier
Returns