|
|
|
@ -9,7 +9,7 @@
|
|
|
|
|
*
|
|
|
|
|
********************************************************************************
|
|
|
|
|
* \copyright
|
|
|
|
|
* Copyright 2018-2019 Cypress Semiconductor Corporation
|
|
|
|
|
* Copyright 2018-2020 Cypress Semiconductor Corporation
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
*
|
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
@ -32,15 +32,23 @@
|
|
|
|
|
#include "cy_result.h"
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \defgroup group_abstraction_rtos_common Common
|
|
|
|
|
* General types and defines for working with the RTOS abstraction layer.
|
|
|
|
|
* \defgroup group_abstraction_rtos_mutex Mutex
|
|
|
|
|
* APIs for acquiring and working with Mutexes.
|
|
|
|
|
* \defgroup group_abstraction_rtos_queue Queue
|
|
|
|
|
* APIs for creating and working with Queues.
|
|
|
|
|
* \defgroup group_abstraction_rtos_semaphore Semaphore
|
|
|
|
|
* \defgroup group_abstraction_rtos_threads Threading
|
|
|
|
|
* APIs for acquiring and working with Semaphores.
|
|
|
|
|
* \defgroup group_abstraction_rtos_threads Threads
|
|
|
|
|
* APIs for creating and working with Threads.
|
|
|
|
|
* \defgroup group_abstraction_rtos_time Time
|
|
|
|
|
* APIs for getting the current time and waiting.
|
|
|
|
|
* \defgroup group_abstraction_rtos_timer Timer
|
|
|
|
|
* APIs for creating and working with Timers.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
@ -51,9 +59,16 @@ extern "C"
|
|
|
|
|
/*********************************************** CONSTANTS **********************************************/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \ingroup group_abstraction_rtos_common
|
|
|
|
|
* \{
|
|
|
|
|
*/
|
|
|
|
|
* \ingroup group_abstraction_rtos_common
|
|
|
|
|
* \{
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#if defined(DOXYGEN)
|
|
|
|
|
//#include "Template/cyabs_rtos_impl.h"
|
|
|
|
|
|
|
|
|
|
/** Return value indicating success */
|
|
|
|
|
#define CY_RSLT_SUCCESS ((cy_rslt_t)0x00000000U)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/** Used with RTOS calls that require a timeout. This implies the call will never timeout. */
|
|
|
|
|
#define CY_RTOS_NEVER_TIMEOUT ( (uint32_t)0xffffffffUL )
|
|
|
|
@ -61,8 +76,8 @@ extern "C"
|
|
|
|
|
//
|
|
|
|
|
// Note on error strategy. If the error is a normal part of operation (timeouts, full queues, empty
|
|
|
|
|
// queues), the these errors are listed here and the abstraction layer implementation must map from the
|
|
|
|
|
// underlying errors to these. If the errors are special cases, the the error CY_RTOS_GENERAL_ERROR can be
|
|
|
|
|
// returns and cy_rtos_last_error() used to retrieve the RTOS specific error message.
|
|
|
|
|
// underlying errors to these. If the errors are special cases, the the error \ref CY_RTOS_GENERAL_ERROR
|
|
|
|
|
// will be returned and \ref cy_rtos_last_error() can be used to retrieve the RTOS specific error message.
|
|
|
|
|
//
|
|
|
|
|
/** Requested operation did not complete in the specified time */
|
|
|
|
|
#define CY_RTOS_TIMEOUT CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_ABSTRACTION_OS, 0)
|
|
|
|
@ -72,15 +87,15 @@ extern "C"
|
|
|
|
|
#define CY_RTOS_GENERAL_ERROR CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_ABSTRACTION_OS, 2)
|
|
|
|
|
/** A bad argument was passed into the APIs */
|
|
|
|
|
#define CY_RTOS_BAD_PARAM CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_ABSTRACTION_OS, 5)
|
|
|
|
|
/** A memory alignment issue was detected. Ensure memory provided is aligned per CY_RTOS_ALIGNMENT */
|
|
|
|
|
/** A memory alignment issue was detected. Ensure memory provided is aligned per \ref CY_RTOS_ALIGNMENT_MASK */
|
|
|
|
|
#define CY_RTOS_ALIGNMENT_ERROR CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_ABSTRACTION_OS, 6)
|
|
|
|
|
|
|
|
|
|
/** \} group_abstraction_rtos_common */
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \ingroup group_abstraction_rtos_queue
|
|
|
|
|
* \{
|
|
|
|
|
*/
|
|
|
|
|
* \ingroup group_abstraction_rtos_queue
|
|
|
|
|
* \{
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/** The Queue is already full and can't accept any more items at this time */
|
|
|
|
|
#define CY_RTOS_QUEUE_FULL CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_ABSTRACTION_OS, 3)
|
|
|
|
@ -115,9 +130,9 @@ typedef enum cy_timer_trigger_type
|
|
|
|
|
{
|
|
|
|
|
CY_TIMER_TYPE_PERIODIC, /**< called periodically until stopped */
|
|
|
|
|
CY_TIMER_TYPE_ONCE, /**< called once only */
|
|
|
|
|
cy_timer_type_periodic = CY_TIMER_TYPE_PERIODIC, /**< \deprecated replaced by CY_TIMER_TYPE_PERIODIC */
|
|
|
|
|
cy_timer_type_once = CY_TIMER_TYPE_ONCE, /**< \deprecated replaced by CY_TIMER_TYPE_ONCE */
|
|
|
|
|
} cy_timer_trigger_type_t ;
|
|
|
|
|
cy_timer_type_periodic = CY_TIMER_TYPE_PERIODIC, /**< \deprecated replaced by \ref CY_TIMER_TYPE_PERIODIC */
|
|
|
|
|
cy_timer_type_once = CY_TIMER_TYPE_ONCE, /**< \deprecated replaced by \ref CY_TIMER_TYPE_ONCE */
|
|
|
|
|
} cy_timer_trigger_type_t;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The type of a function that is the entry point for a thread
|
|
|
|
@ -126,7 +141,7 @@ typedef enum cy_timer_trigger_type
|
|
|
|
|
*
|
|
|
|
|
* \ingroup group_abstraction_rtos_threads
|
|
|
|
|
*/
|
|
|
|
|
typedef void (*cy_thread_entry_fn_t)(cy_thread_arg_t arg) ;
|
|
|
|
|
typedef void (*cy_thread_entry_fn_t)(cy_thread_arg_t arg);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The callback function to be called by a timer
|
|
|
|
@ -142,7 +157,7 @@ typedef void (*cy_timer_callback_t)(cy_timer_callback_arg_t arg);
|
|
|
|
|
* results calling convention. The underlying RTOS implementations will not but rather
|
|
|
|
|
* will have their own error code conventions. This function is provided as a service
|
|
|
|
|
* to the developer, mostly for debugging, and returns the underlying RTOS error code
|
|
|
|
|
* from the last RTOS abstraction layer that returned CY_RTOS_GENERAL_ERROR.
|
|
|
|
|
* from the last RTOS abstraction layer that returned \ref CY_RTOS_GENERAL_ERROR.
|
|
|
|
|
*
|
|
|
|
|
* @return RTOS specific error code.
|
|
|
|
|
*
|
|
|
|
@ -152,8 +167,7 @@ cy_rtos_error_t cy_rtos_last_error();
|
|
|
|
|
|
|
|
|
|
/*********************************************** Threads **********************************************/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
/**
|
|
|
|
|
* \ingroup group_abstraction_rtos_threads
|
|
|
|
|
* \{
|
|
|
|
|
*/
|
|
|
|
@ -161,7 +175,7 @@ cy_rtos_error_t cy_rtos_last_error();
|
|
|
|
|
/** Create a thread with specific thread argument.
|
|
|
|
|
*
|
|
|
|
|
* This function is called to startup a new thread. If the thread can exit, it must call
|
|
|
|
|
* cy_rtos_finish_thread() just before doing so. All created threds that can terminate, either
|
|
|
|
|
* \ref cy_rtos_exit_thread() just before doing so. All created threads that can terminate, either
|
|
|
|
|
* by themselves or forcefully by another thread MUST be joined in order to cleanup any resources
|
|
|
|
|
* that might have been allocated for them.
|
|
|
|
|
*
|
|
|
|
@ -169,7 +183,7 @@ cy_rtos_error_t cy_rtos_last_error();
|
|
|
|
|
* @param[in] entry_function Function pointer which points to the main function for the new thread
|
|
|
|
|
* @param[in] name String thread name used for a debugger
|
|
|
|
|
* @param[in] stack The buffer to use for the thread stack. This must be aligned to
|
|
|
|
|
* CY_RTOS_ALIGNMENT with a size of at least CY_RTOS_MIN_STACK_SIZE.
|
|
|
|
|
* \ref CY_RTOS_ALIGNMENT_MASK with a size of at least \ref CY_RTOS_MIN_STACK_SIZE.
|
|
|
|
|
* If stack is null, cy_rtos_create_thread will allocate a stack from the heap.
|
|
|
|
|
* @param[in] stack_size The size of the thread stack in bytes
|
|
|
|
|
* @param[in] priority The priority of the thread. Values are operating system specific, but some
|
|
|
|
@ -179,12 +193,11 @@ cy_rtos_error_t cy_rtos_last_error();
|
|
|
|
|
* CY_THREAD_PRIORITY_HIGH
|
|
|
|
|
* @param[in] arg The argument to pass to the new thread
|
|
|
|
|
*
|
|
|
|
|
* @return The status of thread create request. [CY_RSLT_SUCCESS, CY_RTOS_NO_MEMORY, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @return The status of thread create request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_NO_MEMORY, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_create_thread(cy_thread_t *thread, cy_thread_entry_fn_t entry_function,
|
|
|
|
|
const char *name, void *stack, uint32_t stack_size, cy_thread_priority_t priority, cy_thread_arg_t arg);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Exit the current thread.
|
|
|
|
|
*
|
|
|
|
|
* This function is called just before a thread exits. In some cases it is sufficient
|
|
|
|
@ -193,26 +206,26 @@ cy_rslt_t cy_rtos_create_thread(cy_thread_t *thread, cy_thread_entry_fn_t entry_
|
|
|
|
|
* where the RTOS must be signaled, this function should perform that In cases operation.
|
|
|
|
|
* In code using RTOS services, this function should be placed at any at any location
|
|
|
|
|
* where the main thread function will return, exiting the thread. Threads that can
|
|
|
|
|
* exit must still be joined (cy_rtos_join_thread) to ensure their resources are fully
|
|
|
|
|
* cleaned up.
|
|
|
|
|
* exit must still be joined (\ref cy_rtos_join_thread) to ensure their resources are
|
|
|
|
|
* fully cleaned up.
|
|
|
|
|
*
|
|
|
|
|
* @return The status of thread exit request. [CY_RSLT_SUCCESS, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @return The status of thread exit request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_exit_thread();
|
|
|
|
|
|
|
|
|
|
/** Terminates another thread.
|
|
|
|
|
*
|
|
|
|
|
* This function is called to terminate another thread and reap the resoruces claimed
|
|
|
|
|
* by it thread. This should be called both when forcibly terminating another thread
|
|
|
|
|
* This function is called to terminate another thread and reap the resources claimed
|
|
|
|
|
* by the thread. This should be called both when forcibly terminating another thread
|
|
|
|
|
* as well as any time a thread can exit on its own. For some RTOS implementations
|
|
|
|
|
* this is not required as the thread resoruces are claimed as soon as it exits. In
|
|
|
|
|
* this is not required as the thread resources are claimed as soon as it exits. In
|
|
|
|
|
* other cases, this must be called to reclaim resources. Threads that are terminated
|
|
|
|
|
* must still be joined (cy_rtos_join_thread) to ensure their resources are fully
|
|
|
|
|
* must still be joined (\ref cy_rtos_join_thread) to ensure their resources are fully
|
|
|
|
|
* cleaned up.
|
|
|
|
|
*
|
|
|
|
|
* @param[in] thread Handle of the thread to terminate
|
|
|
|
|
*
|
|
|
|
|
* @returns The status of the thread terminate. [CY_RSLT_SUCCESS, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @returns The status of the thread terminate. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_terminate_thread(cy_thread_t *thread);
|
|
|
|
|
|
|
|
|
@ -223,19 +236,19 @@ cy_rslt_t cy_rtos_terminate_thread(cy_thread_t *thread);
|
|
|
|
|
*
|
|
|
|
|
* @param[in] thread Handle of the thread to wait for
|
|
|
|
|
*
|
|
|
|
|
* @returns The status of thread join request. [CY_RSLT_SUCCESS, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @returns The status of thread join request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_join_thread(cy_thread_t *thread);
|
|
|
|
|
|
|
|
|
|
/** Checks if the thread is running
|
|
|
|
|
*
|
|
|
|
|
* This function is called to determine if a thread is running or not. For information on
|
|
|
|
|
* the thread state, use the cy_rtos_get_thread_state() function.
|
|
|
|
|
* This function is called to determine if a thread is actively running or not. For information on
|
|
|
|
|
* the thread state, use the \ref cy_rtos_get_thread_state() function.
|
|
|
|
|
*
|
|
|
|
|
* @param[in] thread Handle of the terminated thread to delete
|
|
|
|
|
* @param[out] running Returns true if the thread is running, otherwise false
|
|
|
|
|
*
|
|
|
|
|
* @returns The status of the thread running check. [CY_RSLT_SUCCESS, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @returns The status of the thread running check. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_is_thread_running(cy_thread_t *thread, bool *running);
|
|
|
|
|
|
|
|
|
@ -246,7 +259,7 @@ cy_rslt_t cy_rtos_is_thread_running(cy_thread_t *thread, bool *running);
|
|
|
|
|
* @param[in] thread Handle of the terminated thread to delete
|
|
|
|
|
* @param[out] state Returns the state the thread is currently in
|
|
|
|
|
*
|
|
|
|
|
* @returns The status of the thread state check. [CY_RSLT_SUCCESS, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @returns The status of the thread state check. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_get_thread_state(cy_thread_t *thread, cy_thread_state_t *state);
|
|
|
|
|
|
|
|
|
@ -256,7 +269,7 @@ cy_rslt_t cy_rtos_get_thread_state(cy_thread_t *thread, cy_thread_state_t *state
|
|
|
|
|
*
|
|
|
|
|
* @param[out] thread Handle of the current running thread
|
|
|
|
|
*
|
|
|
|
|
* @returns The status of thread join request. [CY_RSLT_SUCCESS, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @returns The status of thread join request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_get_thread_handle(cy_thread_t *thread);
|
|
|
|
|
|
|
|
|
@ -265,20 +278,38 @@ cy_rslt_t cy_rtos_get_thread_handle(cy_thread_t *thread);
|
|
|
|
|
/*********************************************** Mutexes **********************************************/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \ingroup group_abstraction_rtos_mutex
|
|
|
|
|
* \{
|
|
|
|
|
*/
|
|
|
|
|
* \ingroup group_abstraction_rtos_mutex
|
|
|
|
|
* \{
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/** Create a mutex.
|
|
|
|
|
/** Create a recursive mutex.
|
|
|
|
|
*
|
|
|
|
|
* This is basically a binary mutex which can be used to synchronize between threads
|
|
|
|
|
* and between threads and ISRs.
|
|
|
|
|
* Creates a binary mutex which can be used to synchronize between threads
|
|
|
|
|
* and between threads and ISRs. Created mutexes are recursive and support priority inheritance.
|
|
|
|
|
*
|
|
|
|
|
* This function has been replaced by \ref cy_rtos_init_mutex2 which allow for specifying
|
|
|
|
|
* whether or not the mutex supports recursion or not.
|
|
|
|
|
*
|
|
|
|
|
* @param[out] mutex Pointer to the mutex handle to be initialized
|
|
|
|
|
*
|
|
|
|
|
* @return The status of mutex creation request. [CY_RSLT_SUCCESS, CY_RTOS_NO_MEMORY, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @return The status of mutex creation request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_NO_MEMORY, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_init_mutex(cy_mutex_t *mutex);
|
|
|
|
|
#define cy_rtos_init_mutex(mutex) cy_rtos_init_mutex2(mutex, true)
|
|
|
|
|
|
|
|
|
|
/** Create a mutex which can support recursion or not.
|
|
|
|
|
*
|
|
|
|
|
* Creates a binary mutex which can be used to synchronize between threads and between threads and
|
|
|
|
|
* ISRs. Created mutexes can support priority inheritance if recursive.
|
|
|
|
|
*
|
|
|
|
|
* \note Not all RTOS implementations support non-recursive mutexes. In this case a recursive
|
|
|
|
|
* mutex will be created.
|
|
|
|
|
*
|
|
|
|
|
* @param[out] mutex Pointer to the mutex handle to be initialized
|
|
|
|
|
* @param[in] recursive Should the created mutex support recursion or not
|
|
|
|
|
*
|
|
|
|
|
* @return The status of mutex creation request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_NO_MEMORY, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_init_mutex2(cy_mutex_t *mutex, bool recursive);
|
|
|
|
|
|
|
|
|
|
/** Get a mutex.
|
|
|
|
|
*
|
|
|
|
@ -290,22 +321,22 @@ cy_rslt_t cy_rtos_init_mutex(cy_mutex_t *mutex);
|
|
|
|
|
*
|
|
|
|
|
* @param[in] mutex Pointer to the mutex handle
|
|
|
|
|
* @param[in] timeout_ms Maximum number of milliseconds to wait while attempting to get
|
|
|
|
|
* the mutex. Use the NEVER_TIMEOUT constant to wait forever. Must
|
|
|
|
|
* be zero is in_isr is true
|
|
|
|
|
* the mutex. Use the \ref CY_RTOS_NEVER_TIMEOUT constant to wait forever.
|
|
|
|
|
* Must be zero if in_isr is true.
|
|
|
|
|
*
|
|
|
|
|
* @return The status of the get mutex. Returns timeout if mutex was not acquired
|
|
|
|
|
* before timeout_ms period. [CY_RSLT_SUCCESS, CY_RTOS_TIMEOUT]
|
|
|
|
|
* before timeout_ms period. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_TIMEOUT, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_get_mutex(cy_mutex_t *mutex, cy_time_t timeout_ms);
|
|
|
|
|
|
|
|
|
|
/** Set a mutex.
|
|
|
|
|
*
|
|
|
|
|
* The mutex is released allowing any other threads waiting on the mutex to
|
|
|
|
|
* obtain the sempahore.
|
|
|
|
|
* obtain the semaphore.
|
|
|
|
|
*
|
|
|
|
|
* @param[in] mutex Pointer to the mutex handle
|
|
|
|
|
*
|
|
|
|
|
* @return The status of the set mutex request. [CY_RSLT_SUCCESS, CY_RTOS_TIMEOUT]
|
|
|
|
|
* @return The status of the set mutex request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_set_mutex(cy_mutex_t *mutex);
|
|
|
|
@ -316,7 +347,7 @@ cy_rslt_t cy_rtos_set_mutex(cy_mutex_t *mutex);
|
|
|
|
|
*
|
|
|
|
|
* @param[in] mutex Pointer to the mutex handle
|
|
|
|
|
*
|
|
|
|
|
* @return The status to the delete request. [CY_RSLT_SUCCESS, CY_RTOS_TIMEOUT]
|
|
|
|
|
* @return The status to the delete request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_deinit_mutex(cy_mutex_t *mutex);
|
|
|
|
|
|
|
|
|
@ -325,9 +356,9 @@ cy_rslt_t cy_rtos_deinit_mutex(cy_mutex_t *mutex);
|
|
|
|
|
/*********************************************** Semaphores **********************************************/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \ingroup group_abstraction_rtos_semaphore
|
|
|
|
|
* \{
|
|
|
|
|
*/
|
|
|
|
|
* \ingroup group_abstraction_rtos_semaphore
|
|
|
|
|
* \{
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create a semaphore
|
|
|
|
@ -336,9 +367,9 @@ cy_rslt_t cy_rtos_deinit_mutex(cy_mutex_t *mutex);
|
|
|
|
|
*
|
|
|
|
|
* @param[in,out] semaphore Pointer to the semaphore handle to be initialized
|
|
|
|
|
* @param[in] maxcount The maximum count for this semaphore
|
|
|
|
|
* @param[in] initcount The initial count for this sempahore
|
|
|
|
|
* @param[in] initcount The initial count for this semaphore
|
|
|
|
|
*
|
|
|
|
|
* @return The status of the sempahore creation. [CY_RSLT_SUCCESS, CY_RTOS_NO_MEMORY, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @return The status of the semaphore creation. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_NO_MEMORY, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_init_semaphore(cy_semaphore_t *semaphore, uint32_t maxcount, uint32_t initcount);
|
|
|
|
|
|
|
|
|
@ -351,10 +382,10 @@ cy_rslt_t cy_rtos_init_semaphore(cy_semaphore_t *semaphore, uint32_t maxcount, u
|
|
|
|
|
*
|
|
|
|
|
* @param[in] semaphore Pointer to the semaphore handle
|
|
|
|
|
* @param[in] timeout_ms Maximum number of milliseconds to wait while attempting to get
|
|
|
|
|
* the semaphore. Use the NEVER_TIMEOUT constant to wait forever. Must
|
|
|
|
|
* the semaphore. Use the \ref CY_RTOS_NEVER_TIMEOUT constant to wait forever. Must
|
|
|
|
|
* be zero is in_isr is true
|
|
|
|
|
* @param[in] in_isr true if we are trying to get the semaphore from with an ISR
|
|
|
|
|
* @return The status of get semaphore operation [CY_RSLT_SUCCESS, CY_RTOS_NO_MEMORY, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @return The status of get semaphore operation [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_TIMEOUT, \ref CY_RTOS_NO_MEMORY, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_get_semaphore(cy_semaphore_t *semaphore, cy_time_t timeout_ms, bool in_isr);
|
|
|
|
|
|
|
|
|
@ -366,18 +397,29 @@ cy_rslt_t cy_rtos_get_semaphore(cy_semaphore_t *semaphore, cy_time_t timeout_ms,
|
|
|
|
|
* @param[in] semaphore Pointer to the semaphore handle
|
|
|
|
|
* @param[in] in_isr Value of true indicates calling from interrupt context
|
|
|
|
|
* Value of false indicates calling from normal thread context
|
|
|
|
|
* @return The status of set semaphore operation [CY_RSLT_SUCCESS, CY_RTOS_NO_MEMORY, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @return The status of set semaphore operation [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_NO_MEMORY, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_set_semaphore(cy_semaphore_t *semaphore, bool in_isr);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Deletes a sempahore
|
|
|
|
|
* Get the count of a semaphore.
|
|
|
|
|
*
|
|
|
|
|
* This function frees the resources associated with a sempahore.
|
|
|
|
|
* Gets the number of available tokens on the semaphore.
|
|
|
|
|
*
|
|
|
|
|
* @param[in] semaphore Pointer to the sempahore handle
|
|
|
|
|
* @param[in] semaphore Pointer to the semaphore handle
|
|
|
|
|
* @param[out] count Pointer to the return count
|
|
|
|
|
* @return The status of get semaphore count operation [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_get_count_semaphore(cy_semaphore_t *semaphore, size_t *count);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Deletes a semaphore
|
|
|
|
|
*
|
|
|
|
|
* @return The status of semaphore deletion [CY_RSLT_SUCCESS, CY_RTOS_NO_MEMORY, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* This function frees the resources associated with a semaphore.
|
|
|
|
|
*
|
|
|
|
|
* @param[in] semaphore Pointer to the semaphore handle
|
|
|
|
|
*
|
|
|
|
|
* @return The status of semaphore deletion [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_NO_MEMORY, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_deinit_semaphore(cy_semaphore_t *semaphore);
|
|
|
|
|
|
|
|
|
@ -386,9 +428,9 @@ cy_rslt_t cy_rtos_deinit_semaphore(cy_semaphore_t *semaphore);
|
|
|
|
|
/*********************************************** Events **********************************************/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \ingroup group_abstraction_rtos_event
|
|
|
|
|
* \{
|
|
|
|
|
*/
|
|
|
|
|
* \ingroup group_abstraction_rtos_event
|
|
|
|
|
* \{
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/** Create an event.
|
|
|
|
|
*
|
|
|
|
@ -398,7 +440,7 @@ cy_rslt_t cy_rtos_deinit_semaphore(cy_semaphore_t *semaphore);
|
|
|
|
|
* @param[in,out] event Pointer to the event handle to be initialized
|
|
|
|
|
*
|
|
|
|
|
* @return The status of the event initialization request.
|
|
|
|
|
* [CY_RSLT_SUCCESS, CY_RTOS_NO_MEMORY, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_NO_MEMORY, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_init_event(cy_event_t *event);
|
|
|
|
|
|
|
|
|
@ -411,7 +453,7 @@ cy_rslt_t cy_rtos_init_event(cy_event_t *event);
|
|
|
|
|
* @param[in] bits The value of the 32 bit flags
|
|
|
|
|
* @param[in] in_isr If true, this is called from an ISR, otherwise from a thread
|
|
|
|
|
*
|
|
|
|
|
* @return The status of the set request. [CY_RSLT_SUCCESS, CY_RTOS_NO_MEMORY, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @return The status of the set request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_NO_MEMORY, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_setbits_event(cy_event_t *event, uint32_t bits, bool in_isr) ;
|
|
|
|
|
|
|
|
|
@ -424,7 +466,7 @@ cy_rslt_t cy_rtos_setbits_event(cy_event_t *event, uint32_t bits, bool in_isr) ;
|
|
|
|
|
* @param[in] bits Any bits set in this value, will be cleared in the event.
|
|
|
|
|
* @param[in] in_isr if true, this is called from an ISR, otherwise from a thread
|
|
|
|
|
*
|
|
|
|
|
* @return The status of the clear flags request. [CY_RSLT_SUCCESS, CY_RTOS_NO_MEMORY, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @return The status of the clear flags request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_NO_MEMORY, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_clearbits_event(cy_event_t *event, uint32_t bits, bool in_isr) ;
|
|
|
|
|
|
|
|
|
@ -435,13 +477,13 @@ cy_rslt_t cy_rtos_clearbits_event(cy_event_t *event, uint32_t bits, bool in_isr)
|
|
|
|
|
* @param[in] event Pointer to the event handle
|
|
|
|
|
* @param[out] bits pointer to receive the value of the event flags
|
|
|
|
|
*
|
|
|
|
|
* @return The status of the get request. [CY_RSLT_SUCCESS, CY_RTOS_NO_MEMORY, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @return The status of the get request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_NO_MEMORY, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_getbits_event(cy_event_t *event, uint32_t *bits);
|
|
|
|
|
|
|
|
|
|
/** Wait for the event and return bits.
|
|
|
|
|
*
|
|
|
|
|
* Waits for the event to be set and then returns the bits assocaited
|
|
|
|
|
* Waits for the event to be set and then returns the bits associated
|
|
|
|
|
* with the event, or waits for the given timeout period.
|
|
|
|
|
* @note This function returns if any bit in the set is set.
|
|
|
|
|
*
|
|
|
|
@ -453,7 +495,7 @@ cy_rslt_t cy_rtos_getbits_event(cy_event_t *event, uint32_t *bits);
|
|
|
|
|
* if false, any one bit in the initial bits value must be set to return
|
|
|
|
|
* @param[in] timeout The amount of time to wait in milliseconds
|
|
|
|
|
*
|
|
|
|
|
* @return The status of the wait for event request. [CY_RSLT_SUCCESS, CY_RTOS_NO_MEMORY, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @return The status of the wait for event request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_NO_MEMORY, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_waitbits_event(cy_event_t *event, uint32_t *bits, bool clear, bool all, cy_time_t timeout);
|
|
|
|
|
|
|
|
|
@ -463,7 +505,7 @@ cy_rslt_t cy_rtos_waitbits_event(cy_event_t *event, uint32_t *bits, bool clear,
|
|
|
|
|
*
|
|
|
|
|
* @param[in] event Pointer to the event handle
|
|
|
|
|
*
|
|
|
|
|
* @return The status of the deletion request. [CY_RSLT_SUCCESS, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @return The status of the deletion request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_deinit_event(cy_event_t *event);
|
|
|
|
|
|
|
|
|
@ -472,9 +514,9 @@ cy_rslt_t cy_rtos_deinit_event(cy_event_t *event);
|
|
|
|
|
/*********************************************** Queues **********************************************/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \ingroup group_abstraction_rtos_queue
|
|
|
|
|
* \{
|
|
|
|
|
*/
|
|
|
|
|
* \ingroup group_abstraction_rtos_queue
|
|
|
|
|
* \{
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/** Create a queue.
|
|
|
|
|
*
|
|
|
|
@ -485,7 +527,7 @@ cy_rslt_t cy_rtos_deinit_event(cy_event_t *event);
|
|
|
|
|
* @param[in] length The maximum length of the queue in items
|
|
|
|
|
* @param[in] itemsize The size of each item in the queue.
|
|
|
|
|
*
|
|
|
|
|
* @return The status of the creation request. [CY_RSLT_SUCCESS, CY_RTOS_NO_MEMORY, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @return The status of the creation request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_NO_MEMORY, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_init_queue(cy_queue_t *queue, size_t length, size_t itemsize);
|
|
|
|
|
|
|
|
|
@ -502,24 +544,24 @@ cy_rslt_t cy_rtos_init_queue(cy_queue_t *queue, size_t length, size_t itemsize);
|
|
|
|
|
* @param[in] timeout_ms The time to wait to place the item in the queue
|
|
|
|
|
* @param[in] in_isr If true this is being called from within and ISR
|
|
|
|
|
*
|
|
|
|
|
* @return The status of the creation request. [CY_RSLT_SUCCESS, CY_RTOS_NO_MEMORY, CY_RTOS_GENERAL_ERROR, CY_RTOS_QUEUE_FULL]
|
|
|
|
|
* @return The status of the creation request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_NO_MEMORY, \ref CY_RTOS_GENERAL_ERROR, \ref CY_RTOS_QUEUE_FULL]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_put_queue(cy_queue_t *queue, const void *item_ptr, cy_time_t timeout_ms, bool in_isr);
|
|
|
|
|
|
|
|
|
|
/** Gets an item in a queue.
|
|
|
|
|
*
|
|
|
|
|
* This function gets an item fropm the queue. The item is copied
|
|
|
|
|
* This function gets an item from the queue. The item is copied
|
|
|
|
|
* out of the queue into the memory provide by item_ptr. This space must be
|
|
|
|
|
* large enough to hold a queue entry as defined when the queue was initialized.
|
|
|
|
|
*
|
|
|
|
|
* @note If in_isr is true, timeout_ms must be zero.
|
|
|
|
|
*
|
|
|
|
|
* @param[in] queue Pointer to the queue handle
|
|
|
|
|
* @param[in] item_ptr Pointer to the memory for the item from the queue
|
|
|
|
|
* @param[in] timeout_ms The time to wait to place the item in the queue
|
|
|
|
|
* @param[in] in_isr If true this is being called from within and ISR
|
|
|
|
|
* @param[in] queue Pointer to the queue handle
|
|
|
|
|
* @param[in] item_ptr Pointer to the memory for the item from the queue
|
|
|
|
|
* @param[in] timeout_ms The time to wait to get an item from the queue
|
|
|
|
|
* @param[in] in_isr If true this is being called from within an ISR
|
|
|
|
|
*
|
|
|
|
|
* @return The status of the creation request. [CY_RSLT_SUCCESS, CY_RTOS_NO_MEMORY, CY_RTOS_GENERAL_ERROR, CY_RTOS_QUEUE_EMPTY]
|
|
|
|
|
* @return The status of the creation request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_NO_MEMORY, \ref CY_RTOS_GENERAL_ERROR, \ref CY_RTOS_QUEUE_EMPTY]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_get_queue(cy_queue_t *queue, void *item_ptr, cy_time_t timeout_ms, bool in_isr);
|
|
|
|
|
|
|
|
|
@ -530,7 +572,7 @@ cy_rslt_t cy_rtos_get_queue(cy_queue_t *queue, void *item_ptr, cy_time_t timeout
|
|
|
|
|
* @param[in] queue Pointer to the queue handle
|
|
|
|
|
* @param[out] num_waiting Pointer to the return count
|
|
|
|
|
*
|
|
|
|
|
* @return The status of the creation request. [CY_RSLT_SUCCESS, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @return The status of the creation request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_count_queue(cy_queue_t *queue, size_t *num_waiting);
|
|
|
|
|
|
|
|
|
@ -543,7 +585,7 @@ cy_rslt_t cy_rtos_count_queue(cy_queue_t *queue, size_t *num_waiting);
|
|
|
|
|
* @param[in] queue Pointer to the queue handle
|
|
|
|
|
* @param[out] num_spaces Pointer to the return count.
|
|
|
|
|
*
|
|
|
|
|
* @return The status of the creation request. [CY_RSLT_SUCCESS, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @return The status of the creation request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_space_queue(cy_queue_t *queue, size_t *num_spaces);
|
|
|
|
|
|
|
|
|
@ -553,18 +595,18 @@ cy_rslt_t cy_rtos_space_queue(cy_queue_t *queue, size_t *num_spaces);
|
|
|
|
|
*
|
|
|
|
|
* @param[in] queue pointer to the queue handle
|
|
|
|
|
*
|
|
|
|
|
* @return The status of the creation request. [CY_RSLT_SUCCESS, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @return The status of the creation request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_reset_queue(cy_queue_t *queue);
|
|
|
|
|
|
|
|
|
|
/** Deinitialize the queue handle.
|
|
|
|
|
*
|
|
|
|
|
* This function deinitializes the queue and returns all
|
|
|
|
|
* This function de-initializes the queue and returns all
|
|
|
|
|
* resources used by the queue.
|
|
|
|
|
*
|
|
|
|
|
* @param[in] queue Pointer to the queue handle
|
|
|
|
|
*
|
|
|
|
|
* @return The status of the creation request. [CY_RSLT_SUCCESS, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @return The status of the creation request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_deinit_queue(cy_queue_t *queue);
|
|
|
|
|
|
|
|
|
@ -573,33 +615,32 @@ cy_rslt_t cy_rtos_deinit_queue(cy_queue_t *queue);
|
|
|
|
|
/*********************************************** Timers **********************************************/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \ingroup group_abstraction_rtos_timer
|
|
|
|
|
* \{
|
|
|
|
|
*/
|
|
|
|
|
* \ingroup group_abstraction_rtos_timer
|
|
|
|
|
* \{
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/** Create a new timer.
|
|
|
|
|
*
|
|
|
|
|
* This function intializes a timer object. @note The timer is
|
|
|
|
|
* not active until start is called.
|
|
|
|
|
* This function initializes a timer object.
|
|
|
|
|
* @note The timer is not active until start is called.
|
|
|
|
|
* @note The callback may be (likely will be) called from a different thread.
|
|
|
|
|
*
|
|
|
|
|
* @param[out] timer Pointer to the timer handle to initalize
|
|
|
|
|
* @param[out] timer Pointer to the timer handle to initialize
|
|
|
|
|
* @param[in] type Type of timer (periodic or once)
|
|
|
|
|
* @param[in] fun The functiuon
|
|
|
|
|
* @param[in] fun The function
|
|
|
|
|
* @param[in] arg Argument to pass along to the callback function
|
|
|
|
|
*
|
|
|
|
|
* @return The status of the creation request. [CY_RSLT_SUCCESS, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @return The status of the creation request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_init_timer(cy_timer_t *timer, cy_timer_trigger_type_t type,
|
|
|
|
|
cy_timer_callback_t fun, cy_timer_callback_arg_t arg);
|
|
|
|
|
|
|
|
|
|
/** Start a timer.
|
|
|
|
|
*
|
|
|
|
|
* @note The callback may be (likely will be) called from a different thread.
|
|
|
|
|
*
|
|
|
|
|
* @param[in] timer Pointer to the timer handle
|
|
|
|
|
* @param[in] num_ms The number of miliseconds to wait before the timer fires
|
|
|
|
|
* @param[in] num_ms The number of milliseconds to wait before the timer fires
|
|
|
|
|
*
|
|
|
|
|
* @return The status of the creation request. [CY_RSLT_SUCCESS, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @return The status of the creation request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_start_timer(cy_timer_t *timer, cy_time_t num_ms);
|
|
|
|
|
|
|
|
|
@ -607,7 +648,7 @@ cy_rslt_t cy_rtos_start_timer(cy_timer_t *timer, cy_time_t num_ms);
|
|
|
|
|
*
|
|
|
|
|
* @param[in] timer Pointer to the timer handle
|
|
|
|
|
*
|
|
|
|
|
* @return The status of the creation request. [CY_RSLT_SUCCESS, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @return The status of the creation request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_stop_timer(cy_timer_t *timer);
|
|
|
|
|
|
|
|
|
@ -616,18 +657,17 @@ cy_rslt_t cy_rtos_stop_timer(cy_timer_t *timer);
|
|
|
|
|
* @param[in] timer Pointer to the timer handle
|
|
|
|
|
* @param[out] state Return value for state, true if running, false otherwise
|
|
|
|
|
*
|
|
|
|
|
* @return The status of the creation request. [CY_RSLT_SUCCESS, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @return The status of the creation request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_is_running_timer(cy_timer_t *timer, bool *state);
|
|
|
|
|
|
|
|
|
|
/** Deinit the timer.
|
|
|
|
|
*
|
|
|
|
|
* This function de initializes the timer and frees all consumed
|
|
|
|
|
* resources.
|
|
|
|
|
* This function deinitializes the timer and frees all consumed resources.
|
|
|
|
|
*
|
|
|
|
|
* @param[in] timer Pointer to the timer handle
|
|
|
|
|
*
|
|
|
|
|
* @return The status of the creation request. [CY_RSLT_SUCCESS, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @return The status of the creation request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_deinit_timer(cy_timer_t *timer);
|
|
|
|
|
|
|
|
|
@ -636,9 +676,9 @@ cy_rslt_t cy_rtos_deinit_timer(cy_timer_t *timer);
|
|
|
|
|
/*********************************************** Time **********************************************/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \ingroup group_abstraction_rtos_time
|
|
|
|
|
* \{
|
|
|
|
|
*/
|
|
|
|
|
* \ingroup group_abstraction_rtos_time
|
|
|
|
|
* \{
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/** Gets time in milliseconds since RTOS start.
|
|
|
|
|
*
|
|
|
|
@ -657,16 +697,15 @@ cy_rslt_t cy_rtos_get_time(cy_time_t *tval);
|
|
|
|
|
* the longest period possible which is less than the delay required,
|
|
|
|
|
* then makes up the difference with a tight loop.
|
|
|
|
|
*
|
|
|
|
|
* @param[in] num_ms The number of miliseconds to delay for
|
|
|
|
|
* @param[in] num_ms The number of milliseconds to delay for
|
|
|
|
|
*
|
|
|
|
|
* @return The status of the creation request. [CY_RSLT_SUCCESS, CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
* @return The status of the creation request. [\ref CY_RSLT_SUCCESS, \ref CY_RTOS_GENERAL_ERROR]
|
|
|
|
|
*/
|
|
|
|
|
cy_rslt_t cy_rtos_delay_milliseconds(cy_time_t num_ms);
|
|
|
|
|
|
|
|
|
|
/** \} group_abstraction_rtos_timer */
|
|
|
|
|
/** \} group_abstraction_rtos_time */
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
} /* extern "C" */
|
|
|
|
|
#endif
|
|
|
|
|
#endif /* ifndef INCLUDED_CY_RTOS_INTERFACE_H_ */
|
|
|
|
|
|
|
|
|
|