准备驱动移植适配Rust

This commit is contained in:
冯佳
2026-01-29 15:08:30 +08:00
parent e879b18602
commit 1bdeca55ea
68 changed files with 4371 additions and 4392 deletions

View File

@ -2,7 +2,7 @@
/**
******************************************************************************
* @file : bsp_module.c
* @brief : Board support package module management source file
* @brief : 板级支持包模块管理源文件
******************************************************************************
*/
/* USER CODE END Header */
@ -11,13 +11,13 @@
#include <string.h>
/**
* @brief Module manager instance
* @brief 模块管理器实例
*/
static bsp_module_manager_t bsp_module_manager;
/**
* @brief Initialize BSP module manager
* @retval HAL status code
* @brief 初始化 BSP 模块管理器
* @retval HAL 状态码
*/
hal_ret_t bsp_module_manager_init(void) {
/* Clear module manager */
@ -35,9 +35,9 @@ hal_ret_t bsp_module_manager_init(void) {
}
/**
* @brief Register a BSP module
* @param module: Pointer to module structure
* @retval HAL status code
* @brief 注册一个 BSP 模块
* @param module: 指向模块结构体的指针
* @retval HAL 状态码
*/
hal_ret_t bsp_module_register(bsp_module_t* module) {
if (module == NULL) {
@ -102,9 +102,9 @@ hal_ret_t bsp_module_register(bsp_module_t* module) {
}
/**
* @brief Unregister a BSP module
* @param module: Pointer to module structure
* @retval HAL status code
* @brief 注销一个 BSP 模块
* @param module: 指向模块结构体的指针
* @retval HAL 状态码
*/
hal_ret_t bsp_module_unregister(bsp_module_t* module) {
if (module == NULL) {
@ -146,10 +146,10 @@ hal_ret_t bsp_module_unregister(bsp_module_t* module) {
}
/**
* @brief Get a specific BSP module
* @param type: Module type
* @param instance: Module instance
* @retval Pointer to module structure, or NULL if not found
* @brief 获取指定的 BSP 模块
* @param type: 模块类型
* @param instance: 模块实例
* @retval 指向模块结构体的指针,未找到返回 NULL
*/
bsp_module_t* bsp_module_get(bsp_module_type_t type, uint8_t instance) {
if (type >= BSP_MODULE_TYPE_MAX) {
@ -168,9 +168,9 @@ bsp_module_t* bsp_module_get(bsp_module_type_t type, uint8_t instance) {
}
/**
* @brief Get all modules of a specific type
* @param type: Module type
* @retval Pointer to module list, or NULL if no modules found
* @brief 获取指定类型的所有模块
* @param type: 模块类型
* @retval 指向模块列表的指针,未找到模块返回 NULL
*/
bsp_module_t* bsp_module_get_by_type(bsp_module_type_t type) {
if (type >= BSP_MODULE_TYPE_MAX) {
@ -181,9 +181,9 @@ bsp_module_t* bsp_module_get_by_type(bsp_module_type_t type) {
}
/**
* @brief Get module by name
* @param name: Module name
* @retval Pointer to module structure, or NULL if not found
* @brief 通过名称获取模块
* @param name: 模块名称
* @retval 指向模块结构体的指针,未找到返回 NULL
*/
bsp_module_t* bsp_module_get_by_name(const char* name) {
if (name == NULL) {
@ -202,9 +202,9 @@ bsp_module_t* bsp_module_get_by_name(const char* name) {
}
/**
* @brief Check if all dependencies of a module are satisfied
* @param module: Pointer to module structure
* @retval HAL status code
* @brief 检查模块的所有依赖是否满足
* @param module: 指向模块结构体的指针
* @retval HAL 状态码
*/
hal_ret_t bsp_module_check_dependencies(const bsp_module_t* module) {
if (module == NULL) {