System timer. More...
Data Structures | |
struct | timer_attr_t |
struct | timer_handle_t |
Typedefs | |
typedef void(* | hal_timer_callback) (const uint8_t channel) |
Timer callback function prototype. | |
Enumerations | |
enum | timer_result_t { TIMER_RESULT_OK , TIMER_RESULT_INVALID , TIMER_RESULT_UNSUPPORTED , TIMER_RESULT_ERR , TOTAL_TIMER_RESULT } |
enum | timer_status_t { TIMER_STATUS_UNKNOWN , TIMER_STATUS_OK , TIMER_STATUS_BUSY , TIMER_STATUS_STOP , TIMER_STATUS_ERR , TOTAL_TIMER_STATUS } |
Functions | |
timer_result_t | hal_timer_init (timer_handle_t *handle, const timer_attr_t attr, const hal_timer_callback callback) |
Initialize timer. | |
timer_result_t | hal_timer_start (timer_handle_t *handle) |
Start timer counter with initial configured period. | |
timer_result_t | hal_timer_stop (timer_handle_t *handle) |
Stop timer counter. | |
System timer.
typedef void(* hal_timer_callback) (const uint8_t channel) |
#include <timer/public_inc/hal_timer.h>
Timer callback function prototype.
[in] | channel | Timer channel |
enum timer_result_t |
#include <timer/public_inc/hal_timer.h>
Enumerator | |
---|---|
TIMER_RESULT_OK | No error. |
TIMER_RESULT_INVALID | Operation invalid. |
TIMER_RESULT_UNSUPPORTED | Operation not supported. |
TIMER_RESULT_ERR | Error occurred. |
TOTAL_TIMER_RESULT |
enum timer_status_t |
#include <timer/public_inc/hal_timer.h>
Enumerator | |
---|---|
TIMER_STATUS_UNKNOWN | Timer status unknown. |
TIMER_STATUS_OK | No error. |
TIMER_STATUS_BUSY | Channel busy. |
TIMER_STATUS_STOP | Channel stopped. |
TIMER_STATUS_ERR | Error occurred. |
TOTAL_TIMER_STATUS |
timer_result_t hal_timer_init | ( | timer_handle_t * | handle, |
const timer_attr_t | attr, | ||
const hal_timer_callback | callback ) |
#include <timer/public_inc/hal_timer.h>
Initialize timer.
[in,out] | handle | Timer handler |
[in] | attr | Timer attribute |
[in] | callback | Callback timer interrupt |
TIMER_RESULT_OK | Timer configured succcessfully |
TIMER_RESULT_INVALID | Configuration attributes invalid |
TIMER_RESULT_UNSUPPORTED | Timer attribute unsupported |
TIMER_RESULT_ERR | Failed to configure timer |
timer_result_t hal_timer_start | ( | timer_handle_t * | handle | ) |
#include <timer/public_inc/hal_timer.h>
Start timer counter with initial configured period.
[in,out] | handle | Timer handler |
TIMER_RESULT_OK | Successfully start the timer |
TIMER_RESULT_ERR | Failed to start the timer |
timer_result_t hal_timer_stop | ( | timer_handle_t * | handle | ) |
#include <timer/public_inc/hal_timer.h>
Stop timer counter.
[in,out] | handle | Timer handler |
TIMER_RESULT_OK | Successfully stop the timer |
TIMER_RESULT_ERR | Failed to stop the timer |