# STM32F103RCT6小键盘 **Repository Path**: HSSEU/stm32-f103-rct6-mini-keyboard ## Basic Information - **Project Name**: STM32F103RCT6小键盘 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2024-05-08 - **Last Updated**: 2024-05-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # STM32F103RCT6小键盘 #### 介绍 自制小键盘的固件。 #### 软件架构 使用FreeRTOS创建2个任务,分别用于检测按键和驱动EC11编码器模拟鼠标滚轮。 #### 使用说明 在freertos.c文件中修改自定义键盘映射关系,见下方代码示例。 /** * @brief 每一行对应一个按键的报告,在这一行中, * [0]:键盘的报告ID, * [1]:Bit7-右Windows,Bit6-右Alt,Bit5-右Shift,Bit4-右Ctrl,Bit3-左Windows,Bit2-左Alt,Bit1-左Shift,Bit0-左Ctrl,位取1表示相关的键被按下 * [2]:冗余分隔符,取0x00 * [3]-[8]:6个键盘按键的UsageID,例如0x04对应键盘的a键,以此类推,0x1D对应键盘的z键, * 其他键盘按键的UsageID可通过网络搜索《HID用途表》找到 * 实体键盘按键位置和 数组行标号的对应关系: * EC11按键对应数组0行,其他按键如下,【】代表按键,数字代表数组的行标号 * 【无】【无】【1】【2】 * 【无】【无】【3】【4】 * 【无】【无】【5】【6】 * 【10】【9 】【7】【8】 */ uint8_t KeyReport[11][9] = { 0x01, LeftCtrlPress, 0x00, UsageID_KeyBoard_S, 0x00, 0x00, 0x00, 0x00, 0x00, // KEY_EC11 的按键报告数据,Ctrl+S 0x01, LeftCtrlPress, 0x00, UsageID_KeyBoard_Z, 0x00, 0x00, 0x00, 0x00, 0x00, // KEY_1 的按键报告数据,Ctrl+Z 0x01, LeftCtrlPress, 0x00, UsageID_KeyBoard_X, 0x00, 0x00, 0x00, 0x00, 0x00, // KEY_2 的按键报告数据,Ctrl+X 0x01, LeftCtrlPress, 0x00, UsageID_KeyBoard_C, 0x00, 0x00, 0x00, 0x00, 0x00, // KEY_3 的按键报告数据,Ctrl+C 0x01, LeftCtrlPress, 0x00, UsageID_KeyBoard_V, 0x00, 0x00, 0x00, 0x00, 0x00, // KEY_4 的按键报告数据,Ctrl+V 0x01, LeftCtrlPress|LeftShiftPress, 0x00, UsageID_KeyBoard_C, 0x00, 0x00, 0x00, 0x00, 0x00, // KEY_5 的按键报告数据,Ctrl+Shift+C 0x01, LeftCtrlPress|LeftShiftPress, 0x00, UsageID_KeyBoard_V, 0x00, 0x00, 0x00, 0x00, 0x00, // KEY_6 的按键报告数据,Ctrl+Shift+V 0x01, LeftAltPress, 0x00, UsageID_KeyBoard_A, 0x00, 0x00, 0x00, 0x00, 0x00, // KEY_7 的按键报告数据,Alt+A 0x01, LeftCtrlPress, 0x00, UsageID_KeyBoard_F, 0x00, 0x00, 0x00, 0x00, 0x00, // KEY_8 的按键报告数据,Ctrl+F 0x01, LeftGUIPress, 0x00, UsageID_KeyBoard_D, 0x00, 0x00, 0x00, 0x00, 0x00, // KEY_9 的按键报告数据,Win+D 0x01, LeftCtrlPress|LeftShiftPress, 0x00, UsageID_KeyBoard_P, 0x00, 0x00, 0x00, 0x00, 0x00, // KEY_10 的按键报告数据,Ctrl+Shift+P };