feat(ethercat): 添加EtherCAT从站功能支持并优化同步机制
- 添加CAN反馈和ID快照SPI命令文件 - 移除EXMC组件依赖,精简项目配置 - 添加RAM函数段链接脚本,优化Flash等待周期抖动 - 实现EscExmcBus类,提供16位并行总线访问LAN9252 - 实现EscLan9252驱动,支持寄存器和PDI内存访问 - 实现EthercatSlave类,采用三缓冲机制进行PDO数据交换 - 实现EthercatSync同步管理,支持SYNC0/SYNC1中断和定时器模式 - 添加ISR执行时间统计和诊断功能 - 分离周期路径和事件路径通知机制,避免RMW竞态
This commit is contained in:
@@ -19,35 +19,11 @@ public:
|
||||
/** @brief 初始化 EXMC NOR/SRAM Region1 与全部 GPIO(AF 复用)。 */
|
||||
static void init();
|
||||
|
||||
/**
|
||||
* @brief 从指定偏移读取 16-bit 数据。
|
||||
* @param[in] offset 地址偏移(字节)。
|
||||
* @return uint16_t 读取的 16-bit 数据。
|
||||
*/
|
||||
/** @brief ISR-only:仅供 preempt=0 调用,无锁。 */
|
||||
static uint16_t read16(uint32_t offset);
|
||||
|
||||
/**
|
||||
* @brief 向指定偏移写入 16-bit 数据。
|
||||
* @param[in] offset 地址偏移(字节)。
|
||||
* @param[in] data 待写入的 16-bit 数据。
|
||||
*/
|
||||
/** @brief ISR-only:仅供 preempt=0 调用,无锁。 */
|
||||
static void write16(uint32_t offset, uint16_t data);
|
||||
|
||||
/**
|
||||
* @brief 从指定偏移连续读取一块 16-bit 数据。
|
||||
* @param[in] offset 地址偏移(字节)。
|
||||
* @param[out] buf 输出缓冲(以 uint16_t 为单位)。
|
||||
* @param[in] count 读取的 16-bit 半字数量。
|
||||
*/
|
||||
static void readBlock(uint32_t offset, uint16_t *buf, size_t count);
|
||||
|
||||
/**
|
||||
* @brief 向指定偏移连续写入一块 16-bit 数据。
|
||||
* @param[in] offset 地址偏移(字节)。
|
||||
* @param[in] buf 数据缓冲(以 uint16_t 为单位)。
|
||||
* @param[in] count 写入的 16-bit 半字数量。
|
||||
*/
|
||||
static void writeBlock(uint32_t offset, const uint16_t *buf, size_t count);
|
||||
};
|
||||
|
||||
#endif /* COMM_ESC_EXMC_BUS_H */
|
||||
|
||||
Reference in New Issue
Block a user