bsp
上游未提供说明。
bsp/gpio_driver/gpio_driver.cpp:150.1.0+855c407f828e27 / 62 个公开 API 符号没有说明。
上游未提供说明。
bsp/gpio_driver/gpio_driver.cpp:15上游未提供说明。
bsp/gpio_driver/gpio_driver.cpp:15上游未提供说明。
bsp/gpio_driver/gpio_driver.cpp:18上游未提供说明。
bsp/gpio_driver/gpio_driver.h:42上游未提供说明。
bsp/gpio_driver/pwm.h:40面向对象的 GPIO 引脚句柄。 轻量值类型,可复制,public 成员兼容 brace 初始化。 推荐使用此类型替代 GPIO_t。
bsp/gpio_driver/gpio_driver.hpp:49上游未提供说明。
bsp/gpio_driver/gpio_driver.cpp:21
void GPIO_EXTI_Callback (const uint16_t GPIO_Pin)
统一的 EXTI 中断分发入口。 HAL_GPIO_EXTI_Callback 应在中调用,把 HAL 回调转发到本库。
bsp/gpio_driver/gpio_driver.c:82
void GPIO_EXTI_RegisterCallback (const GPIO_t *gpio, const EXTI_Callback callback, void *data)
注册某个 GPIO 的 EXTI 回调。 这里按 pin 位序号直接索引数组,速度比 map 查找更适合中断上下文。
bsp/gpio_driver/gpio_driver.c:57
void GPIO_EXTI_ResetCounter (const GPIO_t *gpio)
清零某个 EXTI 线的触发计数。
bsp/gpio_driver/gpio_driver.c:46
void GPIO_EXTI_UnregisterCallback (const GPIO_t *gpio)
取消注册 EXTI 回调。
bsp/gpio_driver/gpio_driver.c:69
static void PWM_SetCompare (PWM_t *hpwm, const uint32_t compare)
直接设置比较值。 compare 超过 ARR 时不生效,避免写入非法值。
bsp/gpio_driver/pwm.h:72
static void PWM_SetDutyCircle (PWM_t *hpwm, const float duty_circle)
按占空比设置 PWM 输出。 duty_circle 的有效范围是 [0, 1];越界时会钳位到边界值。
bsp/gpio_driver/pwm.h:84
static void PWM_Start (PWM_t *hpwm)
启动 PWM 输出。
bsp/gpio_driver/pwm.h:54
static void PWM_Stop (PWM_t *hpwm)
停止 PWM 输出。
bsp/gpio_driver/pwm.h:62
__attribute__ ((deprecated("Use bsp::gpio::DispatchExtiInterrupt() instead"))) void GPIO_EXTI_Callback(const uint16_t GPIO_Pin)
上游未提供说明。
bsp/gpio_driver/gpio_driver.h:125
__attribute__ ((deprecated("Use bsp::gpio::GpioPin::read() instead"))) static inline GPIO_PinState GPIO_ReadPin(GPIO_t *hgpio)
读取 GPIO 输入状态。 直接转发到底层 HAL 接口。 Deprecated bsp::gpio::GpioPin::read() 请使用。
bsp/gpio_driver/gpio_driver.h:62
__attribute__ ((deprecated("Use bsp::gpio::GpioPin::reset() instead"))) static inline void GPIO_ResetPin(GPIO_t *hgpio)
输出低电平。 Deprecated bsp::gpio::GpioPin::reset() 请使用。
bsp/gpio_driver/gpio_driver.h:95
__attribute__ ((deprecated("Use bsp::gpio::GpioPin::set() instead"))) static inline void GPIO_SetPin(GPIO_t *hgpio)
输出高电平。 Deprecated bsp::gpio::GpioPin::set() 请使用。
bsp/gpio_driver/gpio_driver.h:84
__attribute__ ((deprecated("Use bsp::gpio::GpioPin::toggle() instead"))) static inline void GPIO_TogglePin(GPIO_t *hgpio)
翻转 GPIO 输出状态。 Deprecated bsp::gpio::GpioPin::toggle() 请使用。
bsp/gpio_driver/gpio_driver.h:106
__attribute__ ((deprecated("Use bsp::gpio::GpioPin::write() instead"))) static inline void GPIO_WritePin(GPIO_t *hgpio
写入 GPIO 输出状态。 Deprecated bsp::gpio::GpioPin::write() 请使用。
bsp/gpio_driver/gpio_driver.h:73
__attribute__ ((deprecated("Use bsp::gpio::RegisterExtiCallback() instead"))) void GPIO_EXTI_RegisterCallback(const GPIO_t *gpio
上游未提供说明。
bsp/gpio_driver/gpio_driver.h:121
__attribute__ ((deprecated("Use bsp::gpio::UnregisterExtiCallback() instead"))) void GPIO_EXTI_UnregisterCallback(const GPIO_t *gpio)
上游未提供说明。
bsp/gpio_driver/gpio_driver.h:123
void bsp::gpio::DispatchExtiInterrupt (uint16_t GPIO_Pin)
统一的 EXTI 中断分发入口,应在 HAL_GPIO_EXTI_Callback 中调用。
bsp/gpio_driver/gpio_driver.cpp:61
GPIO_PinState bsp::gpio::GpioPin::read () const
上游未提供说明。
bsp/gpio_driver/gpio_driver.hpp:55
void bsp::gpio::GpioPin::reset () const
上游未提供说明。
bsp/gpio_driver/gpio_driver.hpp:61
void bsp::gpio::GpioPin::set () const
上游未提供说明。
bsp/gpio_driver/gpio_driver.hpp:59
void bsp::gpio::GpioPin::toggle () const
上游未提供说明。
bsp/gpio_driver/gpio_driver.hpp:63
void bsp::gpio::GpioPin::write (const GPIO_PinState state) const
上游未提供说明。
bsp/gpio_driver/gpio_driver.hpp:57
void bsp::gpio::RegisterExtiCallback (const GpioPin *gpio, ExtiCallback callback)
注册某个 GPIO 的 EXTI 回调。回调上下文从 gpio->user_data 读取。
bsp/gpio_driver/gpio_driver.cpp:45
void bsp::gpio::UnregisterExtiCallback (const GpioPin *gpio)
取消注册 EXTI 回调。
bsp/gpio_driver/gpio_driver.cpp:53
size_t bsp::gpio::anonymous_namespace{gpio_driver.cpp}::pin_to_index (const uint16_t pin)
把 GPIO pin 转成索引。 pin 必须是单 bit 值,例如 GPIO_PIN_0、GPIO_PIN_1。
bsp/gpio_driver/gpio_driver.cpp:35
size_t gpio_pin_to_index (uint16_t pin)
把 GPIO pin 转成索引。 pin 必须是单 bit 值,例如 GPIO_PIN_0、GPIO_PIN_1。
bsp/gpio_driver/gpio_driver.c:32
typedef void(* EXTI_Callback) (const GPIO_t *gpio, uint32_t counter, void *data) )(const GPIO_t *gpio, uint32_t counter, void *data)
EXTI 回调函数签名。 回调里带上触发计数和用户数据,通常用于去抖、边沿累计或者事件分发。 Deprecated 新代码请使用 bsp::gpio::ExtiCallback。
bsp/gpio_driver/gpio_driver.h:120
using bsp::gpio::ExtiCallback = void (*)(const GpioPin* gpio, uint32_t counter)
EXTI 回调签名。上下文通过 gpio->user_data 获取。
bsp/gpio_driver/gpio_driver.hpp:71
struct @207332141164316154333347014116235364164056303010 EXTI_CallbackMap[16] [16]
上游未提供说明。
bsp/gpio_driver/gpio_driver.c:25
uint16_t GPIO_t::pin
上游未提供说明。
bsp/gpio_driver/gpio_driver.h:52
GPIO_TypeDef* GPIO_t::port
GPIO 句柄。 这里把端口和引脚打包成一个轻量结构体,便于在中断回调和普通业务函数之间传递。 Deprecated 新代码请使用 bsp::gpio::GpioPin。
bsp/gpio_driver/gpio_driver.h:51
uint32_t PWM_t::channel
上游未提供说明。
bsp/gpio_driver/pwm.h:48
TIM_HandleTypeDef* PWM_t::htim
PWM 句柄。 PWM_t 一个对应一个定时器通道,上层只需要传这个结构体即可操作输出。
bsp/gpio_driver/pwm.h:47
const GPIO_PinState PinState
上游未提供说明。
bsp/gpio_driver/gpio_driver.h:74
uint16_t bsp::gpio::GpioPin::pin
上游未提供说明。
bsp/gpio_driver/gpio_driver.hpp:52
GPIO_TypeDef* bsp::gpio::GpioPin::port
上游未提供说明。
bsp/gpio_driver/gpio_driver.hpp:51
void* bsp::gpio::GpioPin::user_data
上游未提供说明。
bsp/gpio_driver/gpio_driver.hpp:53
ExtiCallback bsp::gpio::anonymous_namespace{gpio_driver.cpp}::ExtiSlot::callback
回调
bsp/gpio_driver/gpio_driver.cpp:25
uint32_t bsp::gpio::anonymous_namespace{gpio_driver.cpp}::ExtiSlot::counter
触发次数
bsp/gpio_driver/gpio_driver.cpp:24
const GpioPin* bsp::gpio::anonymous_namespace{gpio_driver.cpp}::ExtiSlot::gpio
被注册的 GPIO
bsp/gpio_driver/gpio_driver.cpp:23
ExtiSlot bsp::gpio::anonymous_namespace{gpio_driver.cpp}::g_exti_callback_map[16] [16]
上游未提供说明。
bsp/gpio_driver/gpio_driver.cpp:28
EXTI_Callback callback
上游未提供说明。
bsp/gpio_driver/gpio_driver.h:122
EXTI_Callback callback
回调
bsp/gpio_driver/gpio_driver.c:24
uint32_t counter
触发次数
bsp/gpio_driver/gpio_driver.c:22
EXTI_Callback void* data
上游未提供说明。
bsp/gpio_driver/gpio_driver.h:122
void* data
回调对应的数据
bsp/gpio_driver/gpio_driver.c:23
const GPIO_t* gpio
被注册的 GPIO
bsp/gpio_driver/gpio_driver.c:21上游未提供说明。
bsp/gpio_driver/gpio_driver.hpp:66上游未提供说明。
bsp/gpio_driver/gpio_driver.hpp:38上游未提供说明。
bsp/gpio_driver/gpio_driver.h:40GPIO / EXTI 封装实现 syhanjin 2026-01-24 这里主要负责把 HAL 的 EXTI 回调变成可注册、可计数、可携带用户数据的形式。
bsp/gpio_driver/gpio_driver.cGPIO 面向对象封装 — EXTI 实现 syhanjin 2026-06-30 bsp::gpio gpio_driver.c 独立的 EXTI 回调系统实现,使用新类型, 与中的旧实现互不依赖。
bsp/gpio_driver/gpio_driver.cppGPIO / EXTI / PWM 的基础封装 syhanjin 2025-09-10 GPIO_t PWM_t 这个模块把 HAL 的 GPIO、外部中断和 PWM 接口做了一层很薄的封装,核心目标是统一句柄形式, 让上层代码只需要围绕和这类结构体操作,而不必反复处理底层 HAL 句柄细节。 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. https://www.gnu.org/licenses/ You should have received a copy of the GNU General Public License along with this program. If not, see. https://github.com/HITSZ-WTRobot-Packages/BasicComponents Project repository:
bsp/gpio_driver/gpio_driver.hGPIO 面向对象封装(C++) syhanjin 2026-06-30 gpio_driver.h 此头文件提供面向对象的 GPIO 操作 API,推荐用于所有新代码。 旧 C 风格 API 在中保留但已标记为弃用。 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. https://www.gnu.org/licenses/ You should have received a copy of the GNU General Public License along with this program. If not, see. https://github.com/HITSZ-WTRobot-Packages/BasicComponents Project repository:
bsp/gpio_driver/gpio_driver.hppTIM PWM 的基础封装 syhanjin 2025-09-10 这个头文件只做最常见的 PWM 启停和占空比换算,目的是让上层代码不用反复接触 __HAL_TIM_* 宏。 这样做的好处是调用方式统一,也更容易在代码里看出“这是一个 PWM 句柄,而不是裸 TIM 句柄”。 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. https://www.gnu.org/licenses/ You should have received a copy of the GNU General Public License along with this program. If not, see. https://github.com/HITSZ-WTRobot-Packages/BasicComponents Project repository:
bsp/gpio_driver/pwm.h