libxr 1.0
Want to be the best embedded framework
|
LibXR Color Control Library / LibXR终端颜色控制库 More...
Data Structures | |
class | ADC |
模拟数字转换器(ADC)基类 More... | |
class | Application |
应用模块抽象类,需实现 OnMonitor 方法 More... | |
class | ApplicationManager |
应用模块管理器 More... | |
class | Assert |
运行时错误检查的断言工具类。 Provides assertion mechanisms for runtime error checking. More... | |
class | ASync |
异步任务处理类。 Asynchronous task processing class. More... | |
class | Axis |
三维坐标轴类,继承自 Eigen::Matrix<Scalar, 3, 1>。 A 3D axis class, inheriting from Eigen::Matrix<Scalar, 3, 1>. More... | |
class | BaseQueue |
基础队列类,提供固定大小的循环缓冲区 (Base queue class providing a fixed-size circular buffer). More... | |
class | Callback |
提供一个通用的回调包装,支持动态参数传递。 Provides a generic callback wrapper, supporting dynamic argument passing. More... | |
class | CallbackBlock |
提供一个回调函数的封装,实现参数绑定和回调执行。 Provides a wrapper for callback functions, enabling argument binding and invocation. More... | |
class | CAN |
CAN通信接口,定义标准CAN通信结构,支持不同类型的消息 (CAN communication interface that defines a standard CAN structure supporting different message types). More... | |
class | CenterOfMass |
质心信息表示类。Represents the center of mass information. More... | |
class | ChunkQueue |
块队列(ChunkQueue)用于存储和管理数据块 ChunkQueue is used to store and manage chunks of data More... | |
struct | condition_var_handle |
条件变量结构体定义,包含互斥锁和条件变量 Condition variable structure definition including a mutex and a condition variable More... | |
class | ConditionVar |
条件变量封装类 / Condition variable wrapper class More... | |
class | ConstRawData |
常量原始数据封装类。 A class for encapsulating constant raw data. More... | |
class | CRC16 |
16 位循环冗余校验(CRC-16)计算类 / CRC-16 checksum computation class More... | |
class | CRC32 |
32 位循环冗余校验(CRC-32)计算类 / CRC-32 checksum computation class More... | |
class | CRC8 |
8 位循环冗余校验(CRC-8)计算类 / CRC-8 checksum computation class More... | |
class | CycleValue |
角度循环处理类,用于处理周期性角度计算。 A cyclic angle handling class for periodic angle calculations. More... | |
class | Database |
数据库接口,提供键值存储和管理功能 (Database interface providing key-value storage and management). More... | |
class | DatabaseRaw |
适用于最小写入单元受限的 Flash 存储的数据库实现 (Database implementation for Flash storage with minimum write unit restrictions). More... | |
class | DatabaseRawSequential |
适用于不支持逆序写入的 Flash 存储的数据库实现 (Database implementation for Flash storage that does not support reverse writing). More... | |
struct | Entry |
class | EulerAngle |
表示欧拉角的类,用于描述3D旋转。Class representing Euler angles for 3D rotation. More... | |
class | Event |
事件管理系统,允许基于事件 ID 注册和触发回调函数。 Event management system that allows registration and triggering of callbacks based on event IDs. More... | |
class | FDCAN |
FDCAN 通信接口,扩展 CAN 功能,支持灵活数据速率(FD)CAN 消息 (FDCAN communication interface that extends CAN functionality by supporting Flexible Data-Rate (FD) CAN messages). More... | |
class | Flash |
Abstract base class representing a flash memory interface. 抽象基类,表示闪存接口。 More... | |
struct | FlashSector |
STM32Flash 通用类,构造时传入扇区列表,自动判断编程粒度。 More... | |
class | FloatEncoder |
浮点数编码器,将浮点值映射到定长无符号整数。 A generic float encoder mapping a float value to N-bit unsigned integer. More... | |
class | GPIO |
通用输入输出(GPIO)接口类。General Purpose Input/Output (GPIO) interface class. More... | |
class | HardwareContainer |
struct | HasFlashBank |
struct | HasFlashBank< T, std::void_t< decltype(std::declval< T >().Banks)> > |
struct | HasFlashPage |
struct | HasFlashPage< T, std::void_t< decltype(std::declval< T >().Page)> > |
class | I2C |
I2C(Inter-Integrated Circuit)接口类。 I2C (Inter-Integrated Circuit) interface class. More... | |
class | Inertia |
表示刚体的惯性张量和质量信息的类。Provides a class to represent the inertia tensor and mass of a rigid body. More... | |
class | LinuxBinaryFileFlash |
LinuxBinaryFileFlash 类,用于从二进制文件加载闪存数据 LinuxBinaryFileFlash class for loading flash data from a binary file. More... | |
class | LinuxTimebase |
LinuxTimebase 类,用于获取 Linux 系统的时间基准。Provides a timebase for Linux systems. More... | |
class | LinuxUART |
class | List |
链表实现,用于存储和管理数据节点。 A linked list implementation for storing and managing data nodes. More... | |
class | LockFreeQueue |
无锁队列实现 / Lock-free queue implementation More... | |
class | LockQueue |
线程安全的队列实现,基于 FreeRTOS 消息队列 Thread-safe queue implementation based on FreeRTOS message queue More... | |
struct | LogData |
日志数据结构体 / Log data structure More... | |
class | Logger |
LibXR 日志管理器 / LibXR Logger Manager. More... | |
class | Mutex |
互斥锁类,提供线程同步机制 (Mutex class providing thread synchronization mechanisms). More... | |
class | Operation |
Defines an operation with different execution modes. More... | |
class | PID |
通用 PID 控制器类。 Generic PID controller. More... | |
class | Position |
三维空间中的位置向量 / 3D position vector More... | |
class | PowerManager |
电源管理器基类 / Abstract base class for Power Manager More... | |
class | PWM |
Abstract base class for PWM (Pulse Width Modulation) control. PWM(脉冲宽度调制)控制的抽象基类。 More... | |
class | Quaternion |
四元数表示与运算,继承自 Eigen::Quaternion / Quaternion representation and operations, inheriting from Eigen::Quaternion More... | |
class | Queue |
基于 BaseQueue 的泛型队列模板类 (Generic queue template class based on BaseQueue). More... | |
class | RamFS |
轻量级的内存文件系统,实现基本的文件、目录和设备管理 A lightweight in-memory file system implementing basic file, directory, and device management More... | |
class | RawData |
原始数据封装类。 A class for encapsulating raw data. More... | |
class | RBTree |
红黑树实现,支持泛型键和值,并提供线程安全操作 (Red-Black Tree implementation supporting generic keys and values with thread-safe operations). More... | |
class | ReadInfoBlock |
Read information block structure. More... | |
class | ReadPort |
ReadPort class for handling read operations. More... | |
class | RotationMatrix |
旋转矩阵类,继承自 Eigen::Matrix<Scalar, 3, 3>。 Rotation matrix class, inheriting from Eigen::Matrix<Scalar, 3, 3>. More... | |
class | Semaphore |
信号量类,实现线程同步机制 Semaphore class implementing thread synchronization More... | |
class | Signal |
信号处理类,用于线程间的信号传递和同步。 Signal handling class for inter-thread signaling and synchronization. More... | |
class | SPI |
串行外设接口(SPI)抽象类。Abstract class for Serial Peripheral Interface (SPI). More... | |
class | SpinLock |
轻量级自旋锁实现 / Lightweight spinlock implementation More... | |
class | Stack |
线程安全的栈数据结构 / Thread-safe stack data structure More... | |
class | STDIO |
STDIO interface for read/write ports. More... | |
class | STM32ADC |
STM32ADC 类,用于处理 STM32 系统的 ADC 通道。 Provides handling for STM32 ADC channels. More... | |
class | STM32CAN |
STM32CAN 类,用于处理 STM32 系统的 CAN 通道。 Provides handling for STM32 CAN channels. More... | |
class | STM32CANFD |
STM32CANFD 类,用于处理 STM32 系统的 CANFD 通道。 Provides handling for STM32 CANFD. More... | |
class | STM32Flash |
STM32Flash 通用类,构造时传入扇区列表,自动判断编程粒度。 More... | |
class | STM32GPIO |
class | STM32I2C |
class | STM32PowerManager |
class | STM32PWM |
class | STM32SPI |
class | STM32Timebase |
获取基于STM32 SysTick计数器的时间基准(微秒与毫秒) / Provides a timebase using STM32 SysTick timer (microseconds and milliseconds) More... | |
class | STM32TimerTimebase |
基于硬件定时器的时间基准类 / Provides a timebase using hardware timer (TIM) More... | |
class | STM32UART |
class | STM32VirtualUART |
class | String |
A fixed-length string class with safe operations. More... | |
class | Terminal |
终端类,实现一个基于 RamFS 的基本命令行接口 Terminal class implementing a basic command-line interface based on RamFS More... | |
class | Thread |
线程管理类,封装 FreeRTOS 任务创建和调度 Thread management class encapsulating FreeRTOS task creation and scheduling More... | |
class | Timebase |
时间基类,用于提供高精度时间戳。 Timebase class for providing high-precision timestamps. More... | |
class | Timer |
定时器类,实现周期性任务调度 Timer class for scheduling periodic tasks More... | |
class | TimestampMS |
表示毫秒级时间戳的类。Class representing a timestamp in milliseconds. More... | |
class | TimestampUS |
表示微秒级时间戳的类。Class representing a timestamp in microseconds. More... | |
class | Topic |
主题(Topic)管理类 / Topic management class More... | |
class | Transform |
表示三维空间中的刚体变换,包括旋转和位移。Represents rigid body transformations in 3D space, including rotation and translation. More... | |
class | UART |
通用异步收发传输(UART)基类 / Abstract base class for Universal Asynchronous Receiver-Transmitter (UART) More... | |
class | WritePort |
WritePort class for handling write operations. More... | |
Typedefs | |
typedef SemaphoreHandle_t | libxr_mutex_handle |
互斥锁句柄类型定义 Mutex handle type definition | |
typedef SemaphoreHandle_t | libxr_semaphore_handle |
信号量句柄类型定义 Semaphore handle type definition | |
typedef TaskHandle_t | libxr_thread_handle |
线程句柄类型定义 Thread handle type definition | |
typedef SemaphoreHandle_t | condition_var_handle |
typedef Operation< ErrorCode > | ReadOperation |
Read operation type. | |
typedef Operation< ErrorCode > | WriteOperation |
Write operation type. | |
typedef ErrorCode(* | WriteFun) (WritePort &port) |
Function pointer type for write operations. | |
typedef ErrorCode(* | ReadFun) (ReadPort &port) |
Function pointer type for read operations. | |
using | DefaultScalar = LIBXR_DEFAULT_SCALAR |
Enumerations | |
enum class | Format : uint8_t { NONE = 0 , RESET , BOLD , DARK , UNDERLINE , BLINK , REVERSE , CONCEALED , CLEAR_LINE , COUNT } |
Terminal text format (Format) / 终端文本格式 (Format) More... | |
enum class | Font : uint8_t { NONE = 0 , BLACK , RED , GREEN , YELLOW , BLUE , MAGENTA , CYAN , WHITE , COUNT } |
Terminal font color (Font) / 终端字体颜色 (Font) More... | |
enum class | Background : uint8_t { NONE = 0 , BLACK , RED , GREEN , YELLOW , BLUE , MAGENTA , CYAN , WHITE , COUNT } |
Terminal background color (Background) / 终端背景颜色 (Background) More... | |
enum class | Bold : uint8_t { NONE = 0 , YELLOW , RED , ON_RED , COUNT } |
Terminal bold style (Bold) / 终端粗体样式 (Bold) More... | |
enum class | LogLevel : uint8_t { XR_LOG_LEVEL_DEBUG = 0 , XR_LOG_LEVEL_INFO , XR_LOG_LEVEL_PASS , XR_LOG_LEVEL_WARN , XR_LOG_LEVEL_ERROR } |
日志级别枚举 / Log level enumeration More... | |
Functions | |
template<typename T > | |
std::enable_if<!HasFlashPage< T >::value >::type | SetNbPages (T &init, uint32_t addr, uint32_t page) |
template<typename T > | |
std::enable_if< HasFlashPage< T >::value >::type | SetNbPages (T &init, uint32_t addr, uint32_t page) |
template<typename T > | |
std::enable_if<!HasFlashBank< T >::value >::type | SetBanks (T &init) |
template<typename T > | |
std::enable_if< HasFlashBank< T >::value >::type | SetBanks (T &init) |
void | PlatformInit (uint32_t timer_pri=2, uint32_t timer_stack_depth=512) |
平台初始化函数 Platform initialization function | |
void | PlatformInit () |
平台初始化函数 Platform initialization function | |
void | PlatformInit (webots::Robot *robot) |
Webots 平台初始化函数 Webots platform initialization function. | |
template<typename T1 , typename T2 > | |
constexpr auto | max (T1 a, T2 b) -> typename std::common_type< T1, T2 >::type |
计算两个数的最大值 | |
template<typename T1 , typename T2 > | |
constexpr auto | min (T1 a, T2 b) -> typename std::common_type< T1, T2 >::type |
计算两个数的最小值 | |
Variables | |
constexpr const char * | LIBXR_FORMAT_STR [] |
ANSI escape sequences for text format / ANSI转义序列 - 文本格式 | |
constexpr const char * | LIBXR_FONT_STR [] |
ANSI escape sequences for font color / ANSI转义序列 - 字体颜色 | |
constexpr const char * | LIBXR_BACKGROUND_STR [] |
ANSI escape sequences for background color / ANSI转义序列 - 背景颜色 | |
constexpr const char * | LIBXR_BOLD_STR [] |
ANSI escape sequences for bold styles / ANSI转义序列 - 粗体样式 | |
static constexpr uint16_t | LIBXR_DATABASE_VERSION = 1 |
constexpr DefaultScalar | PID_SIGMA = 1e-6f |
LibXR Color Control Library / LibXR终端颜色控制库
Provides ANSI escape sequences for setting terminal text styles and colors. 提供基于ANSI转义序列的终端文本样式和颜色设置。
Definition at line 12 of file libxr_system.hpp.
typedef LIBXR_DEFAULT_SCALAR LibXR::DefaultScalar |
Definition at line 10 of file cycle_value.hpp.
互斥锁句柄类型定义 Mutex handle type definition
Definition at line 9 of file libxr_system.hpp.
信号量句柄类型定义 Semaphore handle type definition
Definition at line 10 of file libxr_system.hpp.
线程句柄类型定义 Thread handle type definition
Definition at line 11 of file libxr_system.hpp.
Function pointer type for read operations.
读取操作的函数指针类型。
Definition at line 279 of file libxr_rw.hpp.
typedef Operation<ErrorCode> LibXR::ReadOperation |
Function pointer type for write operations.
写入操作的函数指针类型。
Definition at line 275 of file libxr_rw.hpp.
typedef Operation<ErrorCode> LibXR::WriteOperation |
|
strong |
Terminal background color (Background) / 终端背景颜色 (Background)
Definition at line 53 of file libxr_color.hpp.
|
strong |
Terminal bold style (Bold) / 终端粗体样式 (Bold)
Optional bold styles like yellow bold, red bold, red background bold. 可选粗体样式,包括黄色粗体、红色粗体、红色背景粗体等。
Definition at line 72 of file libxr_color.hpp.
|
strong |
Terminal font color (Font) / 终端字体颜色 (Font)
Definition at line 36 of file libxr_color.hpp.
|
strong |
Terminal text format (Format) / 终端文本格式 (Format)
Defines text styles like NONE, RESET, BOLD, DARK, UNDERLINE, etc. 定义文本样式,如NONE(无格式)、RESET(重置)、BOLD(加粗)、DARK(暗色)、UNDERLINE(下划线)等。
Definition at line 19 of file libxr_color.hpp.
|
strong |
日志级别枚举 / Log level enumeration
Definition at line 18 of file logger.hpp.
计算两个数的最大值
Computes the maximum of two numbers
T1 | 第一个数的类型 | Type of the first number |
T2 | 第二个数的类型 | Type of the second number |
a | 第一个数 | First number |
b | 第二个数 | Second number |
Definition at line 146 of file libxr_def.hpp.
|
constexpr |
计算两个数的最小值
Computes the minimum of two numbers
T1 | 第一个数的类型 | Type of the first number |
T2 | 第二个数的类型 | Type of the second number |
a | 第一个数 | First number |
b | 第二个数 | Second number |
Definition at line 161 of file libxr_def.hpp.
void LibXR::PlatformInit | ( | ) |
平台初始化函数 Platform initialization function
平台初始化函数,执行必要的系统初始化 Platform initialization function for necessary system setup
该函数用于初始化 POSIX 线程相关的资源,例如互斥锁、信号量和条件变量。 在使用 LibXR
线程库之前,应调用该函数进行必要的系统初始化。
This function initializes POSIX thread-related resources such as mutexes, semaphores, and condition variables. It should be called before using the LibXR
threading library for proper system setup.
此函数用于初始化底层平台的线程管理、同步机制(如互斥锁、信号量)以及其他系统资源, 需要在使用 LibXR
相关功能之前调用,以确保所有系统组件正确初始化。
This function initializes the underlying platform's thread management, synchronization mechanisms (such as mutexes and semaphores), and other system resources. It should be called before using any LibXR
functionalities to ensure proper setup.
Definition at line 23 of file libxr_system.cpp.
平台初始化函数 Platform initialization function
timer_pri | 定时器任务的优先级(默认值 2) Timer task priority (default: 2) |
timer_stack_depth | 定时器任务的栈深度(默认值 512) Timer task stack depth (default: 512) |
该函数用于初始化 FreeRTOS 相关资源,如定时器任务。 它设置定时器任务的优先级 timer_pri
和栈深度 timer_stack_depth
。
This function initializes FreeRTOS-related resources, such as the timer task. It sets the timer task priority (timer_pri
) and stack depth (timer_stack_depth
).
Definition at line 12 of file libxr_system.cpp.
Webots 平台初始化函数 Webots platform initialization function.
robot | Webots 机器人对象指针 Webots robot object pointer |
此函数用于初始化 Webots 仿真环境,设置 _libxr_webots_robot_handle
变量, 并对仿真时间计数变量 _libxr_webots_time_count
进行初始化。
This function initializes the Webots simulation environment by setting the _libxr_webots_robot_handle
variable and initializing the simulation time counter _libxr_webots_time_count
.
Definition at line 27 of file libxr_system.cpp.
Definition at line 65 of file stm32_flash.hpp.
Definition at line 72 of file stm32_flash.hpp.
std::enable_if<!HasFlashPage< T >::value >::type LibXR::SetNbPages | ( | T & | init, |
uint32_t | addr, | ||
uint32_t | page | ||
) |
Definition at line 47 of file stm32_flash.hpp.
std::enable_if< HasFlashPage< T >::value >::type LibXR::SetNbPages | ( | T & | init, |
uint32_t | addr, | ||
uint32_t | page | ||
) |
Definition at line 56 of file stm32_flash.hpp.
ANSI escape sequences for background color / ANSI转义序列 - 背景颜色
Definition at line 98 of file libxr_color.hpp.
ANSI escape sequences for bold styles / ANSI转义序列 - 粗体样式
Definition at line 105 of file libxr_color.hpp.
Definition at line 14 of file database.hpp.
ANSI escape sequences for font color / ANSI转义序列 - 字体颜色
Definition at line 91 of file libxr_color.hpp.
ANSI escape sequences for text format / ANSI转义序列 - 文本格式
Definition at line 84 of file libxr_color.hpp.