SAM4S-EK_FreeRTOS+FAT-SL  1.0
An example project to test the functionality of FreeRTOS+FAT-SL using SD card as data storage medium
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules
timers.h
Go to the documentation of this file.
1 /*
2  FreeRTOS V8.0.1 - Copyright (C) 2014 Real Time Engineers Ltd.
3  All rights reserved
4 
5  VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
6 
7  ***************************************************************************
8  * *
9  * FreeRTOS provides completely free yet professionally developed, *
10  * robust, strictly quality controlled, supported, and cross *
11  * platform software that has become a de facto standard. *
12  * *
13  * Help yourself get started quickly and support the FreeRTOS *
14  * project by purchasing a FreeRTOS tutorial book, reference *
15  * manual, or both from: http://www.FreeRTOS.org/Documentation *
16  * *
17  * Thank you! *
18  * *
19  ***************************************************************************
20 
21  This file is part of the FreeRTOS distribution.
22 
23  FreeRTOS is free software; you can redistribute it and/or modify it under
24  the terms of the GNU General Public License (version 2) as published by the
25  Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
26 
27  >>! NOTE: The modification to the GPL is included to allow you to !<<
28  >>! distribute a combined work that includes FreeRTOS without being !<<
29  >>! obliged to provide the source code for proprietary components !<<
30  >>! outside of the FreeRTOS kernel. !<<
31 
32  FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
33  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
34  FOR A PARTICULAR PURPOSE. Full license text is available from the following
35  link: http://www.freertos.org/a00114.html
36 
37  1 tab == 4 spaces!
38 
39  ***************************************************************************
40  * *
41  * Having a problem? Start by reading the FAQ "My application does *
42  * not run, what could be wrong?" *
43  * *
44  * http://www.FreeRTOS.org/FAQHelp.html *
45  * *
46  ***************************************************************************
47 
48  http://www.FreeRTOS.org - Documentation, books, training, latest versions,
49  license and Real Time Engineers Ltd. contact details.
50 
51  http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
52  including FreeRTOS+Trace - an indispensable productivity tool, a DOS
53  compatible FAT file system, and our tiny thread aware UDP/IP stack.
54 
55  http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
56  Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS
57  licenses offer ticketed support, indemnification and middleware.
58 
59  http://www.SafeRTOS.com - High Integrity Systems also provide a safety
60  engineered and independently SIL3 certified version for use in safety and
61  mission critical applications that require provable dependability.
62 
63  1 tab == 4 spaces!
64 */
65 
66 
67 #ifndef TIMERS_H
68 #define TIMERS_H
69 
70 #ifndef INC_FREERTOS_H
71  #error "include FreeRTOS.h must appear in source files before include timers.h"
72 #endif
73 
74 /*lint -e537 This headers are only multiply included if the application code
75 happens to also be including task.h. */
76 #include "task.h"
77 /*lint +e956 */
78 
79 #ifdef __cplusplus
80 extern "C" {
81 #endif
82 
83 /*-----------------------------------------------------------
84  * MACROS AND DEFINITIONS
85  *----------------------------------------------------------*/
86 
87 /* IDs for commands that can be sent/received on the timer queue. These are to
88 be used solely through the macros that make up the public software timer API,
89 as defined below. The commands that are sent from interrupts must use the
90 highest numbers as tmrFIRST_FROM_ISR_COMMAND is used to determine if the task
91 or interrupt version of the queue send function should be used. */
92 #define tmrCOMMAND_EXECUTE_CALLBACK_FROM_ISR ( ( BaseType_t ) -2 )
93 #define tmrCOMMAND_EXECUTE_CALLBACK ( ( BaseType_t ) -1 )
94 #define tmrCOMMAND_START_DONT_TRACE ( ( BaseType_t ) 0 )
95 #define tmrCOMMAND_START ( ( BaseType_t ) 1 )
96 #define tmrCOMMAND_RESET ( ( BaseType_t ) 2 )
97 #define tmrCOMMAND_STOP ( ( BaseType_t ) 3 )
98 #define tmrCOMMAND_CHANGE_PERIOD ( ( BaseType_t ) 4 )
99 #define tmrCOMMAND_DELETE ( ( BaseType_t ) 5 )
100 
101 #define tmrFIRST_FROM_ISR_COMMAND ( ( BaseType_t ) 6 )
102 #define tmrCOMMAND_START_FROM_ISR ( ( BaseType_t ) 6 )
103 #define tmrCOMMAND_RESET_FROM_ISR ( ( BaseType_t ) 7 )
104 #define tmrCOMMAND_STOP_FROM_ISR ( ( BaseType_t ) 8 )
105 #define tmrCOMMAND_CHANGE_PERIOD_FROM_ISR ( ( BaseType_t ) 9 )
106 
107 
114 typedef void * TimerHandle_t;
115 
116 /*
117  * Defines the prototype to which timer callback functions must conform.
118  */
119 typedef void (*TimerCallbackFunction_t)( TimerHandle_t xTimer );
120 
121 /*
122  * Defines the prototype to which functions used with the
123  * xTimerPendFunctionCallFromISR() function must conform.
124  */
125 typedef void (*PendedFunction_t)( void *, uint32_t );
126 
256 TimerHandle_t xTimerCreate( const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, const UBaseType_t uxAutoReload, void * const pvTimerID, TimerCallbackFunction_t pxCallbackFunction ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
257 
278 void *pvTimerGetTimerID( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
279 
315 BaseType_t xTimerIsTimerActive( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
316 
327 
378 #define xTimerStart( xTimer, xTicksToWait ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_START, ( xTaskGetTickCount() ), NULL, ( xTicksToWait ) )
379 
420 #define xTimerStop( xTimer, xTicksToWait ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_STOP, 0U, NULL, ( xTicksToWait ) )
421 
500  #define xTimerChangePeriod( xTimer, xNewPeriod, xTicksToWait ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_CHANGE_PERIOD, ( xNewPeriod ), NULL, ( xTicksToWait ) )
501 
538 #define xTimerDelete( xTimer, xTicksToWait ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_DELETE, 0U, NULL, ( xTicksToWait ) )
539 
662 #define xTimerReset( xTimer, xTicksToWait ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_RESET, ( xTaskGetTickCount() ), NULL, ( xTicksToWait ) )
663 
748 #define xTimerStartFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_START_FROM_ISR, ( xTaskGetTickCountFromISR() ), ( pxHigherPriorityTaskWoken ), 0U )
749 
811 #define xTimerStopFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_STOP_FROM_ISR, 0, ( pxHigherPriorityTaskWoken ), 0U )
812 
884 #define xTimerChangePeriodFromISR( xTimer, xNewPeriod, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_CHANGE_PERIOD_FROM_ISR, ( xNewPeriod ), ( pxHigherPriorityTaskWoken ), 0U )
885 
970 #define xTimerResetFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_RESET_FROM_ISR, ( xTaskGetTickCountFromISR() ), ( pxHigherPriorityTaskWoken ), 0U )
971 
972 
1061 BaseType_t xTimerPendFunctionCallFromISR( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, BaseType_t *pxHigherPriorityTaskWoken );
1062 
1095 BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, TickType_t xTicksToWait );
1096 
1106 const char * pcTimerGetTimerName( TimerHandle_t xTimer );
1107 
1108 /*
1109  * Functions beyond this part are not part of the public API and are intended
1110  * for use by the kernel only.
1111  */
1112 BaseType_t xTimerCreateTimerTask( void ) PRIVILEGED_FUNCTION;
1113 BaseType_t xTimerGenericCommand( TimerHandle_t xTimer, const BaseType_t xCommandID, const TickType_t xOptionalValue, BaseType_t * const pxHigherPriorityTaskWoken, const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
1114 
1115 #ifdef __cplusplus
1116 }
1117 #endif
1118 #endif /* TIMERS_H */
1119 
1120 
1121 
const char * pcTimerGetTimerName(TimerHandle_t xTimer)
void(* TimerCallbackFunction_t)(TimerHandle_t xTimer)
Definition: timers.h:119
TimerHandle_t xTimerCreate(const char *const pcTimerName, const TickType_t xTimerPeriodInTicks, const UBaseType_t uxAutoReload, void *const pvTimerID, TimerCallbackFunction_t pxCallbackFunction) PRIVILEGED_FUNCTION
BaseType_t xTimerPendFunctionCall(PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, TickType_t xTicksToWait)
BaseType_t xTimerGenericCommand(TimerHandle_t xTimer, const BaseType_t xCommandID, const TickType_t xOptionalValue, BaseType_t *const pxHigherPriorityTaskWoken, const TickType_t xTicksToWait) PRIVILEGED_FUNCTION
unsigned long UBaseType_t
Definition: portmacro.h:95
uint32_t TickType_t
Definition: portmacro.h:101
void(* PendedFunction_t)(void *, uint32_t)
Definition: timers.h:125
long BaseType_t
Definition: portmacro.h:94
void * TaskHandle_t
Definition: task.h:99
void * pvTimerGetTimerID(TimerHandle_t xTimer) PRIVILEGED_FUNCTION
BaseType_t xTimerPendFunctionCallFromISR(PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, BaseType_t *pxHigherPriorityTaskWoken)
TaskHandle_t xTimerGetTimerDaemonTaskHandle(void)
#define PRIVILEGED_FUNCTION
Definition: mpu_wrappers.h:145
BaseType_t xTimerCreateTimerTask(void) PRIVILEGED_FUNCTION
BaseType_t xTimerIsTimerActive(TimerHandle_t xTimer) PRIVILEGED_FUNCTION
void * TimerHandle_t
Definition: timers.h:114