MeshX 0.3
This repository provides an implementation for Bluetooth Low Energy (BLE) Mesh network nodes. The project allows you to create BLE mesh nodes that can communicate with each other, enabling the development of smart home solutions or other IoT-based applications.
|
Implementation of RTOS timer abstraction for MeshX using FreeRTOS. This file provides functions to create, start, stop, delete, reset, and modify RTOS timers in the MeshX framework. More...
#include "interface/rtos/meshx_rtos_timer.h"
#include "interface/logging/meshx_log.h"
#include "freertos/FreeRTOS.h"
#include "freertos/timers.h"
Go to the source code of this file.
Functions | |
static void | timer_callback (TimerHandle_t xTimer) |
Callback function for FreeRTOS timer events. | |
meshx_err_t | meshx_rtos_timer_create (meshx_rtos_timer_t *timer, const char *name, meshx_rtos_timer_callback_t cb, void *arg, uint32_t period_ms, bool reload) |
Creates a new RTOS timer. | |
meshx_err_t | meshx_rtos_timer_start (meshx_rtos_timer_t *timer) |
Starts the RTOS timer. | |
meshx_err_t | meshx_rtos_timer_stop (meshx_rtos_timer_t *timer) |
Stops the RTOS timer. | |
meshx_err_t | meshx_rtos_timer_delete (meshx_rtos_timer_t *timer) |
Deletes the RTOS timer. | |
meshx_err_t | meshx_rtos_timer_change_period (meshx_rtos_timer_t *timer, uint32_t new_period_ms) |
Changes the period of the RTOS timer. | |
meshx_err_t | meshx_rtos_timer_reset (meshx_rtos_timer_t *timer) |
Resets the RTOS timer. | |
Implementation of RTOS timer abstraction for MeshX using FreeRTOS. This file provides functions to create, start, stop, delete, reset, and modify RTOS timers in the MeshX framework.
Copyright (c) 2024 - 2025 MeshX
Definition in file meshx_timer.c.
meshx_err_t meshx_rtos_timer_change_period | ( | meshx_rtos_timer_t * | timer, |
uint32_t | new_period_ms ) |
Changes the period of the RTOS timer.
This function changes the period of an active or dormant RTOS timer.
[in] | timer | Pointer to the meshx_rtos_timer_t structure. |
[in] | new_period_ms | New timer period in milliseconds. |
Definition at line 154 of file meshx_timer.c.
meshx_err_t meshx_rtos_timer_create | ( | meshx_rtos_timer_t * | timer, |
const char * | name, | ||
meshx_rtos_timer_callback_t | cb, | ||
void * | arg, | ||
uint32_t | period_ms, | ||
bool | reload ) |
Creates a new RTOS timer.
This function initializes and creates a new RTOS timer with the specified parameters.
[out] | timer | Pointer to the meshx_rtos_timer_t structure to be initialized. |
[in] | name | Timer Name String |
[in] | cb | Callback function to be invoked when the timer expires. |
[in] | arg | Argument to be passed to the callback function. |
[in] | period_ms | Timer period in milliseconds. |
[in] | reload | Flag set if timer is a auto reload type. |
Definition at line 46 of file meshx_timer.c.
meshx_err_t meshx_rtos_timer_delete | ( | meshx_rtos_timer_t * | timer | ) |
Deletes the RTOS timer.
This function deletes the RTOS timer and frees associated resources.
[in] | timer | Pointer to the meshx_rtos_timer_t structure. |
Definition at line 129 of file meshx_timer.c.
meshx_err_t meshx_rtos_timer_reset | ( | meshx_rtos_timer_t * | timer | ) |
Resets the RTOS timer.
This function resets the RTOS timer, causing it to restart from its beginning.
[in] | timer | Pointer to the meshx_rtos_timer_t structure. |
Definition at line 178 of file meshx_timer.c.
meshx_err_t meshx_rtos_timer_start | ( | meshx_rtos_timer_t * | timer | ) |
Starts the RTOS timer.
This function starts the RTOS timer.
[in] | timer | Pointer to the meshx_rtos_timer_t structure. |
Definition at line 83 of file meshx_timer.c.
meshx_err_t meshx_rtos_timer_stop | ( | meshx_rtos_timer_t * | timer | ) |
Stops the RTOS timer.
This function stops the RTOS timer.
[in] | timer | Pointer to the meshx_rtos_timer_t structure. |
Definition at line 106 of file meshx_timer.c.
|
static |
Callback function for FreeRTOS timer events.
This function is triggered when the associated FreeRTOS timer expires. It invokes the meshx_os_timer_fire_cb
function to handle the timer event.
xTimer | Handle to the FreeRTOS timer that triggered the callback. |
Definition at line 26 of file meshx_timer.c.