MetaWear C++ API  0.18.0
C++ implementation of the MetaWear protocol
timer.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <stdint.h>
9 
10 #include "metawearboard_fwd.h"
11 #include "timer_fwd.h"
12 
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
29 METAWEAR_API void mbl_mw_timer_create(MblMwMetaWearBoard *board, uint32_t period, uint16_t repetitions, uint8_t delay, void *context, MblMwFnTimerPtr received_timer);
39 METAWEAR_API void mbl_mw_timer_create_indefinite(MblMwMetaWearBoard *board, uint32_t period, uint8_t delay, void *context, MblMwFnTimerPtr received_timer);
45 METAWEAR_API uint8_t mbl_mw_timer_get_id(const MblMwTimer* timer);
53 
58 METAWEAR_API void mbl_mw_timer_start(const MblMwTimer* timer);
63 METAWEAR_API void mbl_mw_timer_stop(const MblMwTimer* timer);
69 
70 #ifdef __cplusplus
71 }
72 #endif
METAWEAR_API void mbl_mw_timer_remove(MblMwTimer *timer)
Removes the timer from the board.
struct MblMwMetaWearBoard MblMwMetaWearBoard
Software representation of a physical MetaWear board.
Definition: metawearboard_fwd.h:17
METAWEAR_API void mbl_mw_timer_stop(const MblMwTimer *timer)
Stops a timer.
METAWEAR_API MblMwTimer * mbl_mw_timer_lookup_id(const MblMwMetaWearBoard *board, uint8_t id)
Looks up the MblMwTimer object corresponding to the id.
Macros for identifying exported functions.
Forward declarations for the MblMwMetaWearBoard type.
METAWEAR_API uint8_t mbl_mw_timer_get_id(const MblMwTimer *timer)
Retrieves the id value identifying the timer.
struct MblMwTimer MblMwTimer
On board timer that periodically fires events.
Definition: timer_fwd.h:15
Forward declaration of the MblMwTimer type.
METAWEAR_API void mbl_mw_timer_start(const MblMwTimer *timer)
Starts a timer.
void(* MblMwFnTimerPtr)(void *context, MblMwTimer *timer)
Definition for callback functions that accept an MblMwTimer pointer.
Definition: timer_fwd.h:23
METAWEAR_API void mbl_mw_timer_create(MblMwMetaWearBoard *board, uint32_t period, uint16_t repetitions, uint8_t delay, void *context, MblMwFnTimerPtr received_timer)
Creates a timer that will run for a set number of repetitions.
#define METAWEAR_API
Indicates the function should be exported to the symbol table.
Definition: dllmarker.h:27
METAWEAR_API void mbl_mw_timer_create_indefinite(MblMwMetaWearBoard *board, uint32_t period, uint8_t delay, void *context, MblMwFnTimerPtr received_timer)
Creates a timer that will run indefinitely.