![]() |
no-OS
|
Implementation of stm32 timer driver. More...
#include <stdlib.h>#include <errno.h>#include "no_os_util.h"#include "no_os_timer.h"#include "no_os_alloc.h"#include "stm32_timer.h"Functions | |
| int32_t | stm32_timer_init (struct no_os_timer_desc **desc, const struct no_os_timer_init_param *param) |
| Initialize the timer peripheral. | |
| int32_t | stm32_timer_remove (struct no_os_timer_desc *desc) |
| Free the resources allocated by no_os_timer_init(). | |
| int32_t | stm32_timer_start (struct no_os_timer_desc *desc) |
| Start a timer. | |
| int32_t | stm32_timer_stop (struct no_os_timer_desc *desc) |
| Stop a timer from counting. | |
| int32_t | stm32_timer_counter_get (struct no_os_timer_desc *desc, uint32_t *counter) |
| Get the value of the counter register for the timer. | |
| int32_t | stm32_timer_counter_set (struct no_os_timer_desc *desc, uint32_t new_val) |
| Set the timer counter register value. | |
| int32_t | stm32_timer_count_clk_get (struct no_os_timer_desc *desc, uint32_t *freq_hz) |
| Get the timer clock frequency. | |
| int32_t | stm32_timer_count_clk_set (struct no_os_timer_desc *desc, uint32_t freq_hz) |
| Set the timer clock frequency. | |
| int32_t | stm32_timer_get_elapsed_time_nsec (struct no_os_timer_desc *desc, uint64_t *elapsed_time) |
| Get the elapsed time in nsec for the timer. | |
Variables | |
| const struct no_os_timer_platform_ops | stm32_timer_ops |
| stm32 platform specific timer platform ops structure | |
Implementation of stm32 timer driver.
Copyright 2022(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
| int32_t stm32_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 stm32_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 stm32_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 stm32_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 stm32_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 stm32_timer_init | ( | struct no_os_timer_desc ** | desc, |
| const struct no_os_timer_init_param * | param ) |
Initialize the timer peripheral.
| desc | - The timer descriptor. |
| param | - The structure that contains the timer parameters. |
| int32_t stm32_timer_remove | ( | struct no_os_timer_desc * | desc | ) |
Free the resources allocated by no_os_timer_init().
| desc | - The timer descriptor. |
| int32_t stm32_timer_start | ( | struct no_os_timer_desc * | desc | ) |
Start a timer.
| desc | - Pointer to the device handler. |
| int32_t stm32_timer_stop | ( | struct no_os_timer_desc * | desc | ) |
Stop a timer from counting.
| desc | - Pointer to the device handler. |
| const struct no_os_timer_platform_ops stm32_timer_ops |
stm32 platform specific timer platform ops structure
stm32 specific timer platform ops structure