no-OS
|
Timer control module header. More...
#include <stdint.h>
Go to the source code of this file.
Classes | |
struct | no_os_timer_desc |
Structure holding timer descriptor. More... | |
struct | no_os_timer_init_param |
Structure holding the parameters for timer initialization. More... | |
struct | no_os_timer_platform_ops |
Structure holding timer function pointers that point to the platform specific function. More... | |
Macros | |
#define | TIMER_MAX_TABLE 4 |
Functions | |
int32_t | no_os_timer_init (struct no_os_timer_desc **desc, const struct no_os_timer_init_param *param) |
Initialize hardware timer and the handler structure associated with it. More... | |
int32_t | no_os_timer_remove (struct no_os_timer_desc *desc) |
Free the memory allocated by timer_init(). More... | |
int32_t | no_os_timer_start (struct no_os_timer_desc *desc) |
Start a timer. More... | |
int32_t | no_os_timer_stop (struct no_os_timer_desc *desc) |
Stop a timer from counting. More... | |
int32_t | no_os_timer_counter_get (struct no_os_timer_desc *desc, uint32_t *counter) |
Get the value of the counter register for the timer. More... | |
int32_t | no_os_timer_counter_set (struct no_os_timer_desc *desc, uint32_t new_val) |
Set the timer counter register value. More... | |
int32_t | no_os_timer_count_clk_get (struct no_os_timer_desc *desc, uint32_t *freq_hz) |
Get the timer clock frequency. More... | |
int32_t | no_os_timer_count_clk_set (struct no_os_timer_desc *desc, uint32_t freq_hz) |
Set the timer clock frequency. More... | |
int32_t | no_os_timer_get_elapsed_time_nsec (struct no_os_timer_desc *desc, uint64_t *elapsed_time) |
Get the elapsed time in nsec for the timer. More... | |
Timer control module header.
Copyright 2019(c) Analog Devices, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define TIMER_MAX_TABLE 4 |
int32_t no_os_timer_count_clk_get | ( | struct no_os_timer_desc * | desc, |
uint32_t * | freq_hz | ||
) |
Get the timer clock frequency.
[in] | desc | - Pointer to the device handler. |
[out] | freq_hz | - The value in Hz of the timer clock. |
int32_t no_os_timer_count_clk_set | ( | struct no_os_timer_desc * | desc, |
uint32_t | freq_hz | ||
) |
Set the timer clock frequency.
[in] | desc | - Pointer to the device handler. |
[in] | freq_hz | - The value in Hz of the new timer clock. |
int32_t no_os_timer_counter_get | ( | struct no_os_timer_desc * | desc, |
uint32_t * | counter | ||
) |
Get the value of the counter register for the timer.
[in] | desc | - Pointer to the device handler. |
[out] | counter | - Pointer to the counter value. |
int32_t no_os_timer_counter_set | ( | struct no_os_timer_desc * | desc, |
uint32_t | new_val | ||
) |
Set the timer counter register value.
[in] | desc | - Pointer to the device handler. |
[in] | new_val | - The new value of the counter register. |
int32_t no_os_timer_get_elapsed_time_nsec | ( | struct no_os_timer_desc * | desc, |
uint64_t * | elapsed_time | ||
) |
Get the elapsed time in nsec for the timer.
[in] | desc | - Pointer to the device handler. |
[in] | elapsed_time | - The elapsed time in nsec. |
int32_t no_os_timer_init | ( | struct no_os_timer_desc ** | desc, |
const struct no_os_timer_init_param * | param | ||
) |
Initialize hardware timer and the handler structure associated with it.
[out] | desc | - Pointer to the reference of the device handler. |
[in] | param | - Initialization structure. |
int32_t no_os_timer_remove | ( | struct no_os_timer_desc * | desc | ) |
Free the memory allocated by timer_init().
[in] | desc | - Pointer to the device handler. |
int32_t no_os_timer_start | ( | struct no_os_timer_desc * | desc | ) |
Start a timer.
[in] | desc | - Pointer to the device handler. |
int32_t no_os_timer_stop | ( | struct no_os_timer_desc * | desc | ) |
Stop a timer from counting.
[in] | desc | - Pointer to the device handler. |