HAL  v0.6.1
Hardware Abstraction Layer
Loading...
Searching...
No Matches
hal_timer.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
Include dependency graph for hal_timer.h:

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.