/* SPDX-License-Identifier: BSD-2-Clause */ /** * @file * * @ingroup RTEMSAPIClassicTimer * * @brief This header file defines the Timer Manager API. */ /* * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) * Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR CONTRIBUTORS 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. */ /* * This file was automatically generated. Do not edit it manually. * Please have a look at * * https://docs.rtems.org/branches/master/eng/req/howto.html * * for information how to maintain and re-generate this file. */ #ifndef _RTEMS_RTEMS_TIMER_H #define _RTEMS_RTEMS_TIMER_H #include #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /** * @defgroup RTEMSAPIClassicTimer Timer Manager * * @ingroup RTEMSAPIClassic * * @brief The Timer Manager provides support for timer facilities. */ /** * @ingroup RTEMSAPIClassicTimer * * @brief % */ #define TIMER_CLASS_BIT_TIME_OF_DAY 0x1 /** * @ingroup RTEMSAPIClassicTimer * * @brief % */ #define TIMER_CLASS_BIT_ON_TASK 0x2 /** * @ingroup RTEMSAPIClassicTimer * * @brief % */ #define TIMER_CLASS_BIT_NOT_DORMANT 0x4 /** * @ingroup RTEMSAPIClassicTimer * * @brief % */ typedef void rtems_timer_service_routine; /** * @ingroup RTEMSAPIClassicTimer * * @brief % */ typedef enum { /** * @brief % */ TIMER_DORMANT, /** * @brief % */ TIMER_INTERVAL = TIMER_CLASS_BIT_NOT_DORMANT, /** * @brief % */ TIMER_INTERVAL_ON_TASK = TIMER_CLASS_BIT_NOT_DORMANT | TIMER_CLASS_BIT_ON_TASK, /** * @brief % */ TIMER_TIME_OF_DAY = TIMER_CLASS_BIT_NOT_DORMANT | TIMER_CLASS_BIT_TIME_OF_DAY, /** * @brief % */ TIMER_TIME_OF_DAY_ON_TASK = TIMER_CLASS_BIT_NOT_DORMANT | TIMER_CLASS_BIT_TIME_OF_DAY | TIMER_CLASS_BIT_ON_TASK } Timer_Classes; /** * @ingroup RTEMSAPIClassicTimer * * @brief % */ typedef rtems_timer_service_routine ( *rtems_timer_service_routine_entry )( rtems_id, void * ); /** * @ingroup RTEMSAPIClassicTimer * * @brief % */ typedef struct { /** * @brief This member is * * % */ Timer_Classes the_class; /** * @brief This member is * * % */ Watchdog_Interval initial; /** * @brief This member is * * % */ Watchdog_Interval start_time; /** * @brief This member is * * % */ Watchdog_Interval stop_time; } rtems_timer_information; /** * @ingroup RTEMSAPIClassicTimer * * @brief % * * @param id % */ rtems_status_code rtems_timer_cancel( rtems_id id ); /** * @ingroup RTEMSAPIClassicTimer * * @brief % * * @param name % * * @param id % */ rtems_status_code rtems_timer_create( rtems_name name, rtems_id *id ); /** * @ingroup RTEMSAPIClassicTimer * * @brief % * * @param id % */ rtems_status_code rtems_timer_delete( rtems_id id ); /** * @ingroup RTEMSAPIClassicTimer * * @brief % * * @param id % * * @param ticks % * * @param routine % * * @param user_data % */ rtems_status_code rtems_timer_fire_after( rtems_id id, rtems_interval ticks, rtems_timer_service_routine_entry routine, void *user_data ); /** * @ingroup RTEMSAPIClassicTimer * * @brief % * * @param id % * * @param wall_time % * * @param routine % * * @param user_data % */ rtems_status_code rtems_timer_fire_when( rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ); /** * @ingroup RTEMSAPIClassicTimer * * @brief % * * @param id % * * @param the_info % */ rtems_status_code rtems_timer_get_information( rtems_id id, rtems_timer_information *the_info ); /** * @ingroup RTEMSAPIClassicTimer * * @brief Identifies a timer object by the specified object name. * * This directive obtains the timer identifier associated with the timer name * specified in ``name``. * * If the timer name is not unique, then the timer identifier will match the * first timer with that name in the search order. However, this timer * identifier is not guaranteed to correspond to the desired timer. The timer * identifier is used with other timer related directives to access the timer. * * The objects are searched from lowest to the highest index. Only the local * node is searched. * * @param name is the object name to look up. * * @param[out] id is the pointer to an object identifier variable. The object * identifier of an object with the specified name will be stored in this * variable, in case of a successful operation. * * @retval ::RTEMS_SUCCESSFUL The requested operation was successful. * * @retval ::RTEMS_INVALID_ADDRESS The id parameter was NULL. * * @retval ::RTEMS_INVALID_NAME The name parameter was 0. * * @retval ::RTEMS_INVALID_NAME There was no object with the specified name on * the local node. */ rtems_status_code rtems_timer_ident( rtems_name name, rtems_id *id ); /** * @ingroup RTEMSAPIClassicTimer * * @brief % * * @param priority % * * @param stack_size % * * @param attribute_set % */ rtems_status_code rtems_timer_initiate_server( rtems_task_priority priority, size_t stack_size, rtems_attribute attribute_set ); /** * @ingroup RTEMSAPIClassicTimer * * @brief % * * @param id % */ rtems_status_code rtems_timer_reset( rtems_id id ); /** * @ingroup RTEMSAPIClassicTimer * * @brief % */ #define RTEMS_TIMER_SERVER_DEFAULT_PRIORITY ( (rtems_task_priority) -1 ) /** * @ingroup RTEMSAPIClassicTimer * * @brief % * * @param id % * * @param ticks % * * @param routine % * * @param user_data % */ rtems_status_code rtems_timer_server_fire_after( rtems_id id, rtems_interval ticks, rtems_timer_service_routine_entry routine, void *user_data ); /** * @ingroup RTEMSAPIClassicTimer * * @brief % * * @param id % * * @param wall_time % * * @param routine % * * @param user_data % */ rtems_status_code rtems_timer_server_fire_when( rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ); #ifdef __cplusplus } #endif #endif /* _RTEMS_RTEMS_TIMER_H */