stream_buffer.h
Go to the documentation of this file.
1 /*
2  * FreeRTOS Kernel V10.0.0
3  * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy of
6  * this software and associated documentation files (the "Software"), to deal in
7  * the Software without restriction, including without limitation the rights to
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9  * the Software, and to permit persons to whom the Software is furnished to do so,
10  * subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in all
13  * copies or substantial portions of the Software. If you wish to use our Amazon
14  * FreeRTOS name, please do so in a fair use way that does not cause confusion.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22  *
23  * http://www.FreeRTOS.org
24  * http://aws.amazon.com/freertos
25  *
26  * 1 tab == 4 spaces!
27  */
28 
29 /*
30  * Stream buffers are used to send a continuous stream of data from one task or
31  * interrupt to another. Their implementation is light weight, making them
32  * particularly suited for interrupt to task and core to core communication
33  * scenarios.
34  *
35  * ***NOTE***: Uniquely among FreeRTOS objects, the stream buffer
36  * implementation (so also the message buffer implementation, as message buffers
37  * are built on top of stream buffers) assumes there is only one task or
38  * interrupt that will write to the buffer (the writer), and only one task or
39  * interrupt that will read from the buffer (the reader). It is safe for the
40  * writer and reader to be different tasks or interrupts, but, unlike other
41  * FreeRTOS objects, it is not safe to have multiple different writers or
42  * multiple different readers. If there are to be multiple different writers
43  * then the application writer must place each call to a writing API function
44  * (such as xStreamBufferSend()) inside a critical section and set the send
45  * block time to 0. Likewise, if there are to be multiple different readers
46  * then the application writer must place each call to a reading API function
47  * (such as xStreamBufferRead()) inside a critical section section and set the
48  * receive block time to 0.
49  *
50  */
51 
52 #ifndef STREAM_BUFFER_H
53 #define STREAM_BUFFER_H
54 
55 #if defined( __cplusplus )
56 extern "C" {
57 #endif
58 
65 typedef void * StreamBufferHandle_t;
66 
67 
133 #define xStreamBufferCreate( xBufferSizeBytes, xTriggerLevelBytes ) xStreamBufferGenericCreate( xBufferSizeBytes, xTriggerLevelBytes, pdFALSE )
134 
214 #define xStreamBufferCreateStatic( xBufferSizeBytes, xTriggerLevelBytes, pucStreamBufferStorageArea, pxStaticStreamBuffer ) xStreamBufferGenericCreateStatic( xBufferSizeBytes, xTriggerLevelBytes, pdFALSE, pucStreamBufferStorageArea, pxStaticStreamBuffer )
215 
308 size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
309  const void *pvTxData,
310  size_t xDataLengthBytes,
311  TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
312 
409 size_t xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer,
410  const void *pvTxData,
411  size_t xDataLengthBytes,
412  BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
413 
498 size_t xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
499  void *pvRxData,
500  size_t xBufferLengthBytes,
501  TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
502 
584 size_t xStreamBufferReceiveFromISR( StreamBufferHandle_t xStreamBuffer,
585  void *pvRxData,
586  size_t xBufferLengthBytes,
587  BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
588 
609 void vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
610 
629 BaseType_t xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
630 
649 BaseType_t xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
650 
672 BaseType_t xStreamBufferReset( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
673 
693 size_t xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
694 
714 size_t xStreamBufferBytesAvailable( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
715 
751 BaseType_t xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer, size_t xTriggerLevel ) PRIVILEGED_FUNCTION;
752 
790 BaseType_t xStreamBufferSendCompletedFromISR( StreamBufferHandle_t xStreamBuffer, BaseType_t *pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
791 
830 BaseType_t xStreamBufferReceiveCompletedFromISR( StreamBufferHandle_t xStreamBuffer, BaseType_t *pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
831 
832 /* Functions below here are not part of the public API. */
833 StreamBufferHandle_t xStreamBufferGenericCreate( size_t xBufferSizeBytes,
834  size_t xTriggerLevelBytes,
835  BaseType_t xIsMessageBuffer ) PRIVILEGED_FUNCTION;
836 
837 StreamBufferHandle_t xStreamBufferGenericCreateStatic( size_t xBufferSizeBytes,
838  size_t xTriggerLevelBytes,
839  BaseType_t xIsMessageBuffer,
840  uint8_t * const pucStreamBufferStorageArea,
841  StaticStreamBuffer_t * const pxStaticStreamBuffer ) PRIVILEGED_FUNCTION;
842 
843 #if( configUSE_TRACE_FACILITY == 1 )
844  void vStreamBufferSetStreamBufferNumber( StreamBufferHandle_t xStreamBuffer, UBaseType_t uxStreamBufferNumber ) PRIVILEGED_FUNCTION;
845  UBaseType_t uxStreamBufferGetStreamBufferNumber( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
846  uint8_t ucStreamBufferGetStreamBufferType( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
847 #endif
848 
849 #if defined( __cplusplus )
850 }
851 #endif
852 
853 #endif /* !defined( STREAM_BUFFER_H ) */
size_t xStreamBufferReceive(StreamBufferHandle_t xStreamBuffer, void *pvRxData, size_t xBufferLengthBytes, TickType_t xTicksToWait) PRIVILEGED_FUNCTION
BaseType_t xStreamBufferSendCompletedFromISR(StreamBufferHandle_t xStreamBuffer, BaseType_t *pxHigherPriorityTaskWoken) PRIVILEGED_FUNCTION
BaseType_t xStreamBufferReceiveCompletedFromISR(StreamBufferHandle_t xStreamBuffer, BaseType_t *pxHigherPriorityTaskWoken) PRIVILEGED_FUNCTION
BaseType_t xStreamBufferReset(StreamBufferHandle_t xStreamBuffer) PRIVILEGED_FUNCTION
unsigned long UBaseType_t
Definition: portmacro.h:58
uint32_t TickType_t
Definition: portmacro.h:64
void vStreamBufferDelete(StreamBufferHandle_t xStreamBuffer) PRIVILEGED_FUNCTION
size_t xStreamBufferSendFromISR(StreamBufferHandle_t xStreamBuffer, const void *pvTxData, size_t xDataLengthBytes, BaseType_t *const pxHigherPriorityTaskWoken) PRIVILEGED_FUNCTION
long BaseType_t
Definition: portmacro.h:57
BaseType_t xStreamBufferSetTriggerLevel(StreamBufferHandle_t xStreamBuffer, size_t xTriggerLevel) PRIVILEGED_FUNCTION
size_t xStreamBufferBytesAvailable(StreamBufferHandle_t xStreamBuffer) PRIVILEGED_FUNCTION
BaseType_t xStreamBufferIsFull(StreamBufferHandle_t xStreamBuffer) PRIVILEGED_FUNCTION
size_t xStreamBufferSpacesAvailable(StreamBufferHandle_t xStreamBuffer) PRIVILEGED_FUNCTION
size_t xStreamBufferReceiveFromISR(StreamBufferHandle_t xStreamBuffer, void *pvRxData, size_t xBufferLengthBytes, BaseType_t *const pxHigherPriorityTaskWoken) PRIVILEGED_FUNCTION
size_t xStreamBufferSend(StreamBufferHandle_t xStreamBuffer, const void *pvTxData, size_t xDataLengthBytes, TickType_t xTicksToWait) PRIVILEGED_FUNCTION
void * StreamBufferHandle_t
Definition: stream_buffer.h:65
#define PRIVILEGED_FUNCTION
Definition: mpu_wrappers.h:174
StreamBufferHandle_t xStreamBufferGenericCreateStatic(size_t xBufferSizeBytes, size_t xTriggerLevelBytes, BaseType_t xIsMessageBuffer, uint8_t *const pucStreamBufferStorageArea, StaticStreamBuffer_t *const pxStaticStreamBuffer) PRIVILEGED_FUNCTION
StreamBufferHandle_t xStreamBufferGenericCreate(size_t xBufferSizeBytes, size_t xTriggerLevelBytes, BaseType_t xIsMessageBuffer) PRIVILEGED_FUNCTION
BaseType_t xStreamBufferIsEmpty(StreamBufferHandle_t xStreamBuffer) PRIVILEGED_FUNCTION


inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:17:58