添加了AES128加密算法实现和电机OTA中继相关文件,包括: - ./sys/aes128.h 和 ./sys/aes128.cpp - AES128加密算法头文件和实现 - ./sys/motor_ota_relay.h 和 ./sys/motor_ota_relay.cpp - 电机OTA中继功能 - 更新了项目配置文件包含这些新模块
37 lines
1.2 KiB
C++
37 lines
1.2 KiB
C++
/**
|
|
* @file esc_exmc_bus.h
|
|
* @brief LAN9252 ESC 的 EXMC 16-bit 并行总线抽象接口。
|
|
* @note 通过 EXMC NOR/SRAM Region1(NE1,基址 0x64000000)以内存映射方式访问 LAN9252。
|
|
* 16-bit 数据总线 + A16 地址线 + NOE/NWE/NE1 控制线。
|
|
*/
|
|
#ifndef COMM_ESC_EXMC_BUS_H
|
|
#define COMM_ESC_EXMC_BUS_H
|
|
|
|
#include <cstdint>
|
|
#include <cstddef>
|
|
|
|
/**
|
|
* @brief LAN9252 ESC 的 EXMC 并行总线驱动。
|
|
* @note 提供 16-bit 读写与块读写接口,内部通过内存映射地址直接访问 ESC 寄存器空间。
|
|
*/
|
|
class EscExmcBus {
|
|
public:
|
|
/** @brief 初始化 EXMC NOR/SRAM Region1 与全部 GPIO(AF 复用)。
|
|
* @return bool true 表示 EXMC Region1 已成功使能且首次回读探活通过。 */
|
|
static bool init();
|
|
|
|
/** @brief ISR-only:仅供 preempt=0 调用,无锁。 */
|
|
static uint16_t read16(uint32_t offset);
|
|
|
|
/** @brief ISR-only:仅供 preempt=0 调用,无锁。 */
|
|
static void write16(uint32_t offset, uint16_t data);
|
|
|
|
/** @brief init 后查询:EXMC Region1 是否使能且探活通过(供上层诊断汇总)。 */
|
|
static bool isOk() { return s_ok; }
|
|
|
|
private:
|
|
static bool s_ok; /**< EXMC Region1 使能 + 探活结果(init 后置位)。 */
|
|
};
|
|
|
|
#endif /* COMM_ESC_EXMC_BUS_H */
|