2 * FreeRTOS+FAT build 191128 - Note: FreeRTOS+FAT is still in the lab!
\r
3 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
\r
4 * Authors include James Walmsley, Hein Tibosch and Richard Barry
\r
6 * Permission is hereby granted, free of charge, to any person obtaining a copy of
\r
7 * this software and associated documentation files (the "Software"), to deal in
\r
8 * the Software without restriction, including without limitation the rights to
\r
9 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
\r
10 * the Software, and to permit persons to whom the Software is furnished to do so,
\r
11 * subject to the following conditions:
\r
13 * The above copyright notice and this permission notice shall be included in all
\r
14 * copies or substantial portions of the Software.
\r
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
\r
18 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
\r
19 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
\r
20 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
23 * https://www.FreeRTOS.org
\r
28 * @file ff_locking.h
\r
32 #ifndef _FF_LOCKING_H_
\r
33 #define _FF_LOCKING_H_
\r
41 /*---------- PROTOTYPES (in order of appearance). */
\r
47 void FF_PendSemaphore ( void *pSemaphore );
\r
48 BaseType_t FF_TrySemaphore ( void *pSemaphore, uint32_t TimeMs );
\r
49 void FF_ReleaseSemaphore ( void *pSemaphore );
\r
50 void FF_Sleep ( uint32_t TimeMs );
\r
52 /* Create an event group and bind it to an I/O manager. */
\r
53 BaseType_t FF_CreateEvents( FF_IOManager_t *pxIOManager );
\r
55 /* Delete an event group. */
\r
56 void FF_DeleteEvents( FF_IOManager_t *pxIOManager );
\r
58 /* Get a lock on all DIR operations for a given I/O manager. */
\r
59 void FF_LockDirectory( FF_IOManager_t *pxIOManager );
\r
61 /* Release the lock on all DIR operations. */
\r
62 void FF_UnlockDirectory( FF_IOManager_t *pxIOManager );
\r
64 /* Get a lock on all FAT operations for a given I/O manager. */
\r
65 void FF_LockFAT( FF_IOManager_t *pxIOManager );
\r
67 /* Release the lock on all FAT operations. */
\r
68 void FF_UnlockFAT( FF_IOManager_t *pxIOManager );
\r
70 /* Called from FF_GetBuffer() as long as no buffer is available. */
\r
71 BaseType_t FF_BufferWait( FF_IOManager_t *pxIOManager, uint32_t xWaitMS );
\r
73 /* Called from FF_ReleaseBuffer(). */
\r
74 void FF_BufferProceed( FF_IOManager_t *pxIOManager );
\r
76 /* Check if the current task already has locked the FAT. */
\r
77 int FF_Has_Lock( FF_IOManager_t *pxIOManager, uint32_t aBits );
\r
80 * Throw a configASSERT() in case the FAT has not been locked
\r
83 /* _HT_ This function is only necessary while testing. */
\r
84 void FF_Assert_Lock( FF_IOManager_t *pxIOManager, uint32_t aBits );
\r
90 #endif /* _FF_LOCKING_H_ */
\r