Implements the software Algorithm for Timer Handling in the Stack.
Data Structures | |
struct | timer_info_tag |
Macros | |
#define | ADD_TIME(a, b) ((a) + (b)) |
Adds two time values. More... | |
#define | HW_TIME_MASK (0xFFFF) |
#define | MAX_NO_OF_TIMERS (25) |
#define | MAX_TIMEOUT (0x7FFFFFFF) |
#define | MIN_TIMEOUT (0x80) |
#define | NO_TIMER (0xFF) |
#define | SUB_TIME(a, b) ((a) - (b)) |
Subtracts two time values. More... | |
#define | SYS_TIME_SHIFT_MASK (16) |
#define | TOTAL_TIMERS TOTAL_NUMBER_OF_TIMERS |
Typedefs | |
typedef enum sw_timeout_type_tag | sw_timeout_type_t |
Timeout type. More... | |
typedef void(* | timer_expiry_cb_t )(void *) |
typedef struct timer_info_tag | timer_info_t |
Enumerations | |
enum | sw_timeout_type_tag { SW_TIMEOUT_RELATIVE, SW_TIMEOUT_ABSOLUTE } |
Timeout type. More... | |
Functions | |
status_code_t | sw_timer_get_id (uint8_t *timer_id) |
Returns a timer id to be used before starting a timer. More... | |
uint32_t | sw_timer_get_residual_time (uint8_t timer_id) |
uint32_t | sw_timer_get_time (void) |
Gets current time. More... | |
void | sw_timer_init (void) |
Initializes the Software Timer module. More... | |
bool | sw_timer_is_running (uint8_t timer_id) |
Checks whether a given timer is running or not. More... | |
uint32_t | sw_timer_next_timer_expiry_duration (void) |
void | sw_timer_run_residual_time (uint32_t offset) |
void | sw_timer_service (void) |
Handles Queues and Callbacks for Expired Timers. More... | |
status_code_t | sw_timer_start (uint8_t timer_id, uint32_t timer_count, sw_timeout_type_t timeout_type, FUNC_PTR timer_cb, void *param_cb) |
Starts a timer. More... | |
status_code_t | sw_timer_stop (uint8_t timer_id) |
Stops a running timer. More... | |
Variables | |
uint32_t | timer_info_tag::abs_exp_timer |
bool | timer_info_tag::loaded |
uint8_t | timer_info_tag::next_timer_in_queue |
void * | timer_info_tag::param_cb |
FUNC_PTR | timer_info_tag::timer_cb |
#define ADD_TIME | ( | a, | |
b | |||
) | ((a) + (b)) |
Adds two time values.
#define HW_TIME_MASK (0xFFFF) |
#define MAX_NO_OF_TIMERS (25) |
#define MAX_TIMEOUT (0x7FFFFFFF) |
#define MIN_TIMEOUT (0x80) |
#define NO_TIMER (0xFF) |
Referenced by sw_timer_init(), and sw_timer_service().
#define SUB_TIME | ( | a, | |
b | |||
) | ((a) - (b)) |
Subtracts two time values.
#define SYS_TIME_SHIFT_MASK (16) |
#define TOTAL_TIMERS TOTAL_NUMBER_OF_TIMERS |
typedef enum sw_timeout_type_tag sw_timeout_type_t |
Timeout type.
typedef void(* timer_expiry_cb_t)(void *) |
typedef struct timer_info_tag timer_info_t |
enum sw_timeout_type_tag |
status_code_t sw_timer_get_id | ( | uint8_t * | timer_id | ) |
Returns a timer id to be used before starting a timer.
timer_id | Value of the id returned by the function |
Referenced by app_timers_init(), and pal_timer_get_id().
uint32_t sw_timer_get_residual_time | ( | uint8_t | timer_id | ) |
Referenced by handle_gts_data_req(), and mac_ready_to_sleep().
uint32_t sw_timer_get_time | ( | void | ) |
Gets current time.
This function returns the current time.
[out] | current_time | Returns current system time |
Referenced by pal_get_current_time(), pal_trx_read_timestamp(), per_mode_initiator_tx_done_cb(), and start_test().
void sw_timer_init | ( | void | ) |
Initializes the Software Timer module.
References timer_info_tag::next_timer_in_queue, NO_TIMER, NULL, timer_info_tag::timer_cb, timer_trigger, and TOTAL_NUMBER_OF_SW_TIMERS.
Referenced by configure_timer(), init_state_init(), and main().
bool sw_timer_is_running | ( | uint8_t | timer_id | ) |
Checks whether a given timer is running or not.
[out] | True | if the timer is running else False |
Referenced by pal_is_timer_running(), peer_req_send_task(), per_mode_initiator_rx_cb(), and stop_pkt_streaming().
uint32_t sw_timer_next_timer_expiry_duration | ( | void | ) |
void sw_timer_run_residual_time | ( | uint32_t | offset | ) |
void sw_timer_service | ( | void | ) |
Handles Queues and Callbacks for Expired Timers.
References callback, cpu_irq_restore(), cpu_irq_save(), timer_info_tag::loaded, NO_TIMER, NULL, timer_info_tag::param_cb, and timer_info_tag::timer_cb.
Referenced by pal_task().
status_code_t sw_timer_start | ( | uint8_t | timer_id, |
uint32_t | timer_count, | ||
sw_timeout_type_t | timeout_type, | ||
FUNC_PTR | timer_cb, | ||
void * | param_cb | ||
) |
Starts a timer.
This function starts a regular timer and installs the corresponding callback function handle the timeout event.
timer_id | Timer identifier |
timer_count | Timeout in microseconds |
timeout_type | TIMEOUT_RELATIVE or TIMEOUT_ABSOLUTE |
timer_cb | Callback handler invoked upon timer expiry |
param_cb | Argument for the callback handler |
Referenced by app_led_event(), led_blinker_timer_handler_cb(), main(), marker_rsp_timer_handler_cb(), marker_tx_timer_handler_cb(), pal_timer_start(), peer_req_send_task(), per_mode_initiator_init(), per_mode_initiator_rx_cb(), per_mode_initiator_task(), per_mode_receptor_rx_cb(), per_mode_receptor_task(), pktstream_test(), pxp_monitor_app_timer_event(), range_test_timer_handler_cb(), range_test_tx_on_init(), range_test_tx_timer_handler_cb(), send_range_test_marker_rsp(), send_remote_cmd(), serial_data_handler(), start_range_test(), stop_pkt_streaming(), and wait_for_conf_init().
status_code_t sw_timer_stop | ( | uint8_t | timer_id | ) |
Stops a running timer.
This function stops a running timer with specified timer_id
timer_id | Timer identifier |
Referenced by led_blinker_timer_handler_cb(), main(), marker_rsp_timer_handler_cb(), marker_tx_timer_handler_cb(), pal_timer_stop(), peer_req_send_exit(), per_mode_initiator_rx_cb(), per_mode_initiator_tx_done_cb(), per_mode_receptor_task(), pktstream_test(), range_test_tx_on_exit(), stop_pkt_streaming(), timer_callback_handler(), and wait_for_conf_exit().
uint32_t timer_info_tag::abs_exp_timer |
bool timer_info_tag::loaded |
Referenced by sw_timer_service().
uint8_t timer_info_tag::next_timer_in_queue |
Referenced by sw_timer_init().
void* timer_info_tag::param_cb |
Referenced by sw_timer_service().
FUNC_PTR timer_info_tag::timer_cb |
Referenced by sw_timer_init(), and sw_timer_service().