|
libxr
1.0
Want to be the best embedded framework
|
ESP 发送路径双缓冲辅助器。 More...
#include <esp_tx_double_buffer.hpp>
Public Member Functions | |
| ESPTxDoubleBuffer ()=default | |
| 默认构造辅助器。 | |
| void | Init (RawData storage) |
| 绑定外部双缓冲 backing storage 并重置状态。 | |
| void | Reset () |
| 重置当前 active/pending 发送状态。 | |
| uint8_t * | ActiveBuffer () const |
| 获取当前 active payload 缓冲区指针。 | |
| uint8_t * | PendingBuffer () const |
| 获取当前 pending payload 缓冲区指针。 | |
| size_t | BufferSize () const |
| 获取单个半缓冲区大小。 | |
| bool | HasActive () const |
| 判断是否存在有效 active 请求。 | |
| bool | HasPending () const |
| 判断是否存在有效 pending 请求。 | |
| size_t | ActiveLength () const |
| 获取当前 active payload 长度。 | |
| size_t | ActiveOffset () const |
| 获取当前 active payload 已推进的偏移量。 | |
| void | SetActiveOffset (size_t offset) |
| 更新当前 active payload 已推进的偏移量。 | |
| WriteInfoBlock & | ActiveInfo () |
| 获取 active 请求元数据引用。 | |
| const WriteInfoBlock & | ActiveInfo () const |
| 获取 active 请求元数据常量引用。 | |
| WriteInfoBlock & | PendingInfo () |
| 获取 pending 请求元数据引用。 | |
| const WriteInfoBlock & | PendingInfo () const |
| 获取 pending 请求元数据常量引用。 | |
| void | LoadActive (size_t size, const WriteInfoBlock &info) |
| 装载一个 active 请求的长度与元数据。 | |
| void | LoadPending (size_t size, const WriteInfoBlock &info) |
| 装载一个 pending 请求的长度与元数据。 | |
| bool | PromotePending () |
| 将 pending 请求提升为 active 请求。 | |
| void | ClearActive () |
| 清除当前 active 请求状态。 | |
| void | ClearPending () |
| 清除当前 pending 请求状态。 | |
Private Attributes | |
| DoubleBuffer | bytes_ {} |
| payload 双缓冲对象。 Payload double-buffer object. | |
| size_t | active_length_ = 0U |
| active payload 长度。 Active payload length. | |
| size_t | pending_length_ = 0U |
| pending payload 长度。 Pending payload length. | |
| size_t | active_offset_ = 0U |
| active payload 已推进偏移。 Active progressed offset. | |
| WriteInfoBlock | active_info_ = {} |
| active 请求元数据。 Active request metadata. | |
| WriteInfoBlock | pending_info_ = {} |
| pending 请求元数据。 Pending request metadata. | |
| bool | active_valid_ |
| active 请求是否有效。 Whether an active request is valid. | |
| Flag::Atomic | pending_valid_ {} |
| pending 请求是否有效。 Whether a pending request is valid. | |
ESP 发送路径双缓冲辅助器。
Double-buffer helper for ESP transmit paths.
该辅助器复用 DoubleBuffer 管理 payload 缓冲区,并额外维护 active/pending 两个发送请求的长度、偏移和 WriteInfoBlock 元数据。 It reuses DoubleBuffer for payload storage and additionally tracks active/pending request length, offset, and WriteInfoBlock metadata.
Definition at line 23 of file esp_tx_double_buffer.hpp.
|
default |
默认构造辅助器。
Construct one helper in the uninitialized state.
|
inline |
获取当前 active payload 缓冲区指针。
Return the current active payload buffer pointer.
Definition at line 63 of file esp_tx_double_buffer.hpp.
|
inline |
获取 active 请求元数据引用。
Return the active request metadata reference.
Definition at line 114 of file esp_tx_double_buffer.hpp.
|
inline |
获取 active 请求元数据常量引用。
Return the const active request metadata reference.
Definition at line 120 of file esp_tx_double_buffer.hpp.
|
inline |
获取当前 active payload 长度。
Return the current active payload length.
Definition at line 93 of file esp_tx_double_buffer.hpp.
|
inline |
获取当前 active payload 已推进的偏移量。
Return the current progressed offset of the active payload.
Definition at line 99 of file esp_tx_double_buffer.hpp.
|
inline |
获取单个半缓冲区大小。
Return the size of one half-buffer.
Definition at line 75 of file esp_tx_double_buffer.hpp.
|
inline |
清除当前 active 请求状态。
Clear the current active request state.
Definition at line 198 of file esp_tx_double_buffer.hpp.
|
inline |
清除当前 pending 请求状态。
Clear the current pending request state.
Definition at line 210 of file esp_tx_double_buffer.hpp.
|
inline |
判断是否存在有效 active 请求。
Check whether a valid active request exists.
Definition at line 81 of file esp_tx_double_buffer.hpp.
|
inline |
判断是否存在有效 pending 请求。
Check whether a valid pending request exists.
Definition at line 87 of file esp_tx_double_buffer.hpp.
|
inline |
绑定外部双缓冲 backing storage 并重置状态。
Bind external double-buffer backing storage and reset state.
backing storage 的合法性约束由 DoubleBuffer::Init() 统一负责。 The backing-storage contract is enforced solely by DoubleBuffer::Init().
| storage | 外部双缓冲 backing storage。 |
| storage | External double-buffer backing storage. |
Definition at line 42 of file esp_tx_double_buffer.hpp.
|
inline |
装载一个 active 请求的长度与元数据。
Load the length and metadata of one active request.
| size | active payload 长度。 |
| size | Active payload length. |
| info | active 请求元数据。 |
| info | Active request metadata. |
Definition at line 143 of file esp_tx_double_buffer.hpp.
|
inline |
装载一个 pending 请求的长度与元数据。
Load the length and metadata of one pending request.
| size | pending payload 长度。 |
| size | Pending payload length. |
| info | pending 请求元数据。 |
| info | Pending request metadata. |
Definition at line 160 of file esp_tx_double_buffer.hpp.
|
inline |
获取当前 pending payload 缓冲区指针。
Return the current pending payload buffer pointer.
Definition at line 69 of file esp_tx_double_buffer.hpp.
|
inline |
获取 pending 请求元数据引用。
Return the pending request metadata reference.
Definition at line 126 of file esp_tx_double_buffer.hpp.
|
inline |
获取 pending 请求元数据常量引用。
Return the const pending request metadata reference.
Definition at line 132 of file esp_tx_double_buffer.hpp.
|
inline |
将 pending 请求提升为 active 请求。
Promote the pending request into the active slot.
若当前没有有效 pending 请求,则返回 false。 Returns false when no valid pending request is present.
Definition at line 177 of file esp_tx_double_buffer.hpp.
|
inline |
重置当前 active/pending 发送状态。
Reset the current active/pending transmit state.
Definition at line 52 of file esp_tx_double_buffer.hpp.
|
inline |
更新当前 active payload 已推进的偏移量。
Update the progressed offset of the active payload.
| offset | 新的 active 偏移量。 |
| offset | New active offset. |
Definition at line 108 of file esp_tx_double_buffer.hpp.
|
private |
active 请求元数据。 Active request metadata.
Definition at line 222 of file esp_tx_double_buffer.hpp.
|
private |
active payload 长度。 Active payload length.
Definition at line 219 of file esp_tx_double_buffer.hpp.
|
private |
active payload 已推进偏移。 Active progressed offset.
Definition at line 221 of file esp_tx_double_buffer.hpp.
|
private |
active 请求是否有效。 Whether an active request is valid.
Definition at line 224 of file esp_tx_double_buffer.hpp.
|
private |
payload 双缓冲对象。 Payload double-buffer object.
Definition at line 218 of file esp_tx_double_buffer.hpp.
|
private |
pending 请求元数据。 Pending request metadata.
Definition at line 223 of file esp_tx_double_buffer.hpp.
|
private |
pending payload 长度。 Pending payload length.
Definition at line 220 of file esp_tx_double_buffer.hpp.
|
private |
pending 请求是否有效。 Whether a pending request is valid.
Definition at line 227 of file esp_tx_double_buffer.hpp.