mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-21 06:22:21 +02:00
feat(examples): Add support for lwip build under linux
This commit is contained in:
36
common_components/linux_compat/esp_timer/include/esp_timer.h
Normal file
36
common_components/linux_compat/esp_timer/include/esp_timer.h
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "bsd/string.h"
|
||||
|
||||
typedef struct esp_timer *esp_timer_handle_t;
|
||||
|
||||
typedef void (*esp_timer_cb_t)(void *arg);
|
||||
|
||||
typedef enum {
|
||||
ESP_TIMER_TASK,
|
||||
} esp_timer_dispatch_t;
|
||||
|
||||
typedef struct {
|
||||
esp_timer_cb_t callback; //!< Function to call when timer expires
|
||||
void *arg; //!< Argument to pass to the callback
|
||||
esp_timer_dispatch_t dispatch_method; //!< Call the callback from task or from ISR
|
||||
const char *name; //!< Timer name, used in esp_timer_dump function
|
||||
bool skip_unhandled_events; //!< Skip unhandled events for periodic timers
|
||||
} esp_timer_create_args_t;
|
||||
|
||||
esp_err_t esp_timer_create(const esp_timer_create_args_t *create_args,
|
||||
esp_timer_handle_t *out_handle);
|
||||
esp_err_t esp_timer_start_periodic(esp_timer_handle_t timer, uint64_t period);
|
||||
|
||||
esp_err_t esp_timer_stop(esp_timer_handle_t timer);
|
||||
|
||||
esp_err_t esp_timer_delete(esp_timer_handle_t timer);
|
||||
|
||||
int64_t esp_timer_get_time(void);
|
Reference in New Issue
Block a user