An interrupt-safe byte-sized ring buffer interface.
More...
An interrupt-safe byte-sized ring buffer interface.
◆ qBSBuffer_Count()
Query the number of elements in the Byte-sized buffer.
- Parameters
-
[in] | b | a pointer to the qBSBuffer(Byte-sized Buffer) object |
- Returns
- Number of elements in the BSBuffer(Byte-sized Buffer)
◆ qBSBuffer_Empty()
Query the empty status of the Byte-sized buffer.
- Parameters
-
[in] | b | a pointer to the qBSBuffer(Byte-sized Buffer) object |
- Returns
- qTrue if the BSBuffer(Byte-sized Buffer) is empty, qFalse if it is not.
◆ qBSBuffer_Get()
Gets one data-byte from the front of the Byte-sized buffer, and removes it.
- Parameters
-
[in] | b | a pointer to the qBSBuffer(Byte-sized Buffer) object |
[out] | dst | the location where the data-byte will be written |
- Returns
- qTrue on success, otherwise returns qFalse
◆ qBSBuffer_IsFull()
Query the full status of the Byte-sized buffer.
- Parameters
-
[in] | b | a pointer to the qBSBuffer(Byte-sized Buffer) object |
- Returns
- qTrue if the BSBuffer(Byte-sized Buffer) is full, qFalse if it is not.
◆ qBSBuffer_Peek()
Looks for one byte from the head of the Byte-sized buffer without removing it.
- Parameters
-
[in] | b | a pointer to the Byte-sized buffer object |
- Returns
- byte of data, or zero if nothing in the list
◆ qBSBuffer_Put()
Adds an element of data to the Byte-sized buffer.
- Parameters
-
[in] | b | a pointer to the qBSBuffer(Byte-sized Buffer) object |
[in] | bData | The data to be added |
- Returns
- qTrue on success, otherwise returns qFalse.
◆ qBSBuffer_Read()
Gets n data from the Byte-sized buffer and removes them.
- Parameters
-
[in] | b | a pointer to the qBSBuffer(Byte-sized Buffer) object |
[out] | dst | the location where the data-byte will be written |
[in] | n | The number of bytes to read |
- Returns
- qTrue on success, otherwise returns qFalse
◆ qBSBuffer_Setup()
Initialize the Byte-sized buffer.
- Parameters
-
[in] | b | a pointer to the qBSBuffer(Byte-sized Buffer) object |
[in] | pBuffer | Block of memory or array of data |
[in] | length | The size of the buffer(Must be a power of two) |
- Returns
- qTrue on success, otherwise returns qFalse.