MetaWear C++ API
0.18.0
C++ implementation of the MetaWear protocol
|
On board timer for scheduling MetaWear commands. More...
#include <stdint.h>
#include "metawearboard_fwd.h"
#include "timer_fwd.h"
#include "metawear/platform/dllmarker.h"
Go to the source code of this file.
Functions | |
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. More... | |
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. More... | |
METAWEAR_API uint8_t | mbl_mw_timer_get_id (const MblMwTimer *timer) |
Retrieves the id value identifying the timer. More... | |
METAWEAR_API MblMwTimer * | mbl_mw_timer_lookup_id (const MblMwMetaWearBoard *board, uint8_t id) |
Looks up the MblMwTimer object corresponding to the id. More... | |
METAWEAR_API void | mbl_mw_timer_start (const MblMwTimer *timer) |
Starts a timer. More... | |
METAWEAR_API void | mbl_mw_timer_stop (const MblMwTimer *timer) |
Stops a timer. More... | |
METAWEAR_API void | mbl_mw_timer_remove (MblMwTimer *timer) |
Removes the timer from the board. More... | |
On board timer for scheduling MetaWear commands.
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.
A pointer representing the timer will be passed to the user through a callback function
board | Board the timer belongs to |
period | How often to |
repetitions | Number of events the timer will fire |
delay | Zero if the tiemr should immediately fire, non-zero to delay the first event |
context | Pointer to additional data for the callback function |
received_timer | Callback function to be executed when the timer is created |
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.
A pointer representing the timer will be passed to the user through a callback function
board | Board the timer belongs to |
period | How often to |
delay | Zero if the tiemr should immediately fire, non-zero to delay the first event |
context | Pointer to additional data for the callback function |
received_timer | Callback function to be executed when the timer is created |
METAWEAR_API uint8_t mbl_mw_timer_get_id | ( | const MblMwTimer * | timer | ) |
Retrieves the id value identifying the timer.
timer | Timer to lookup |
METAWEAR_API MblMwTimer* mbl_mw_timer_lookup_id | ( | const MblMwMetaWearBoard * | board, |
uint8_t | id | ||
) |
Looks up the MblMwTimer object corresponding to the id.
board | Board to search on |
id | Numerical id to lookup |
METAWEAR_API void mbl_mw_timer_remove | ( | MblMwTimer * | timer | ) |
Removes the timer from the board.
timer | Timer to remove |
METAWEAR_API void mbl_mw_timer_start | ( | const MblMwTimer * | timer | ) |
Starts a timer.
timer | Timer to start |
METAWEAR_API void mbl_mw_timer_stop | ( | const MblMwTimer * | timer | ) |
Stops a timer.
timer | Timer to stop |