├── Fabrication ├── BOM_HHID-v2.xlsx ├── HHID-v2-all-pos.csv ├── gerber.zip └── gerber │ ├── HHID-v2-B_Cu.gbr │ ├── HHID-v2-B_Fab.gbr │ ├── HHID-v2-B_Mask.gbr │ ├── HHID-v2-B_Paste.gbr │ ├── HHID-v2-Edge_Cuts.gbr │ ├── HHID-v2-F_Cu.gbr │ ├── HHID-v2-F_Fab.gbr │ ├── HHID-v2-F_Mask.gbr │ ├── HHID-v2-F_Paste.gbr │ ├── HHID-v2-NPTH.drl │ └── HHID-v2-PTH.drl ├── KiCad ├── HHID-v2.kicad_pcb ├── HHID-v2.kicad_prl ├── HHID-v2.kicad_pro ├── HHID-v2.kicad_sch └── fp-info-cache ├── README.md ├── STM32 ├── Core │ ├── Inc │ │ ├── main.h │ │ ├── stm32f0xx_hal_conf.h │ │ └── stm32f0xx_it.h │ └── Src │ │ ├── main.c │ │ ├── stm32f0xx_hal_msp.c │ │ ├── stm32f0xx_it.c │ │ └── system_stm32f0xx.c ├── Debug │ ├── RubberDuckyHelloWorld.elf │ └── RubberDuckyHelloWorld.hex ├── Middlewares │ └── ST │ │ └── STM32_USB_Device_Library │ │ ├── Class │ │ └── HID │ │ │ ├── Inc │ │ │ └── usbd_hid.h │ │ │ └── Src │ │ │ └── usbd_hid.c │ │ └── Core │ │ ├── Inc │ │ ├── usbd_core.h │ │ ├── usbd_ctlreq.h │ │ ├── usbd_def.h │ │ └── usbd_ioreq.h │ │ └── Src │ │ ├── usbd_core.c │ │ ├── usbd_ctlreq.c │ │ └── usbd_ioreq.c ├── RubberDuckyHelloWorld.ioc ├── STM32CubeIDE │ └── Middlewares │ │ └── USB_Device_Library │ │ └── usbd_hid_ext.h └── USB_DEVICE │ ├── App │ ├── usb_device.c │ ├── usb_device.h │ ├── usbd_desc.c │ └── usbd_desc.h │ └── Target │ ├── usbd_conf.c │ └── usbd_conf.h └── photos ├── IMG_20250104_114501_754.jpg ├── IMG_20250118_131920_344.jpg ├── IMG_20250118_132318_155.jpg ├── IMG_20250118_132709_884.jpg ├── IMG_20250118_132744_293.jpg ├── IMG_20250118_132744_294.jpg ├── Screenshot 2025-01-18 160303.png ├── bot-hr.jpg ├── cover-cropped.jpg └── top-hr.jpg /Fabrication/BOM_HHID-v2.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enblack0/Hidden-HID-v2/4f44eee1a87c04dfad725e9ba3b24868d8b28b1a/Fabrication/BOM_HHID-v2.xlsx -------------------------------------------------------------------------------- /Fabrication/HHID-v2-all-pos.csv: -------------------------------------------------------------------------------- 1 | Ref,Val,Package,PosX,PosY,Rot,Side 2 | "C1","4.7µ","C_0402_1005Metric_noSS",9.375000,5.075000,-90.000000,bottom 3 | "C2","1µ","C_0402_1005Metric_noSS",3.175000,6.805000,90.000000,bottom 4 | "C3","1µ","C_0402_1005Metric_noSS",3.175000,3.220000,90.000000,bottom 5 | "Q1","Würth 1541201NC3060","LED_1206_3216Metric_IPC_C",10.950000,2.150000,-90.000000,bottom 6 | "Q2","Würth 1541201NC3060","LED_1206_3216Metric_IPC_C",1.150000,2.150000,-90.000000,bottom 7 | "Q3","Würth 1541201NC3060","LED_1206_3216Metric_IPC_C",1.150000,6.050000,90.000000,bottom 8 | "Q4","Würth 1541201NC3060","LED_1206_3216Metric_IPC_C",10.950000,6.050000,90.000000,bottom 9 | "R2","2k2","R_0402_1005Metric_noSS",9.375000,3.220000,-90.000000,bottom 10 | "U2","NCP115AMX330TCG","OnSemi_XDFN4-1EP_1.0x1.0mm_EP0.52x0.52mm",2.900000,5.025000,90.000000,bottom 11 | "U3","STM32F042G6Ux","QFN-28_4x4mm_P0.5mm",6.269400,4.839734,0.000000,bottom 12 | -------------------------------------------------------------------------------- /Fabrication/gerber.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enblack0/Hidden-HID-v2/4f44eee1a87c04dfad725e9ba3b24868d8b28b1a/Fabrication/gerber.zip -------------------------------------------------------------------------------- /Fabrication/gerber/HHID-v2-B_Fab.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,8.0.0*% 2 | %TF.CreationDate,2024-11-24T15:26:49+01:00*% 3 | %TF.ProjectId,HHID-v2,48484944-2d76-4322-9e6b-696361645f70,rev?*% 4 | %TF.SameCoordinates,PX89013e0PY67486e0*% 5 | %TF.FileFunction,AssemblyDrawing,Bot*% 6 | %FSLAX46Y46*% 7 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 8 | G04 Created by KiCad (PCBNEW 8.0.0) date 2024-11-24 15:26:49* 9 | %MOMM*% 10 | %LPD*% 11 | G01* 12 | G04 APERTURE LIST* 13 | %ADD10C,0.150000*% 14 | %ADD11C,0.120000*% 15 | %ADD12C,0.075000*% 16 | %ADD13C,0.040000*% 17 | %ADD14C,0.100000*% 18 | G04 APERTURE END LIST* 19 | D10* 20 | X1145514Y7291542D02* 21 | X1145514Y7491542D01* 22 | X831228Y7577256D02* 23 | X831228Y7291542D01* 24 | X831228Y7291542D02* 25 | X1431228Y7291542D01* 26 | X1431228Y7291542D02* 27 | X1431228Y7577256D01* 28 | X888371Y4934399D02* 29 | X859800Y4905827D01* 30 | X859800Y4905827D02* 31 | X831228Y4820113D01* 32 | X831228Y4820113D02* 33 | X831228Y4762970D01* 34 | X831228Y4762970D02* 35 | X859800Y4677256D01* 36 | X859800Y4677256D02* 37 | X916942Y4620113D01* 38 | X916942Y4620113D02* 39 | X974085Y4591542D01* 40 | X974085Y4591542D02* 41 | X1088371Y4562970D01* 42 | X1088371Y4562970D02* 43 | X1174085Y4562970D01* 44 | X1174085Y4562970D02* 45 | X1288371Y4591542D01* 46 | X1288371Y4591542D02* 47 | X1345514Y4620113D01* 48 | X1345514Y4620113D02* 49 | X1402657Y4677256D01* 50 | X1402657Y4677256D02* 51 | X1431228Y4762970D01* 52 | X1431228Y4762970D02* 53 | X1431228Y4820113D01* 54 | X1431228Y4820113D02* 55 | X1402657Y4905827D01* 56 | X1402657Y4905827D02* 57 | X1374085Y4934399D01* 58 | D11* 59 | X1226190Y5609955D02* 60 | X1302380Y5648050D01* 61 | X1302380Y5648050D02* 62 | X1378571Y5724240D01* 63 | X1378571Y5724240D02* 64 | X1492857Y5838526D01* 65 | X1492857Y5838526D02* 66 | X1569047Y5876621D01* 67 | X1569047Y5876621D02* 68 | X1645238Y5876621D01* 69 | X1607142Y5686145D02* 70 | X1683333Y5724240D01* 71 | X1683333Y5724240D02* 72 | X1759523Y5800431D01* 73 | X1759523Y5800431D02* 74 | X1797619Y5952812D01* 75 | X1797619Y5952812D02* 76 | X1797619Y6219479D01* 77 | X1797619Y6219479D02* 78 | X1759523Y6371860D01* 79 | X1759523Y6371860D02* 80 | X1683333Y6448050D01* 81 | X1683333Y6448050D02* 82 | X1607142Y6486145D01* 83 | X1607142Y6486145D02* 84 | X1454761Y6486145D01* 85 | X1454761Y6486145D02* 86 | X1378571Y6448050D01* 87 | X1378571Y6448050D02* 88 | X1302380Y6371860D01* 89 | X1302380Y6371860D02* 90 | X1264285Y6219479D01* 91 | X1264285Y6219479D02* 92 | X1264285Y5952812D01* 93 | X1264285Y5952812D02* 94 | X1302380Y5800431D01* 95 | X1302380Y5800431D02* 96 | X1378571Y5724240D01* 97 | X1378571Y5724240D02* 98 | X1454761Y5686145D01* 99 | X1454761Y5686145D02* 100 | X1607142Y5686145D01* 101 | X997619Y6486145D02* 102 | X502381Y6486145D01* 103 | X502381Y6486145D02* 104 | X769047Y6181383D01* 105 | X769047Y6181383D02* 106 | X654762Y6181383D01* 107 | X654762Y6181383D02* 108 | X578571Y6143288D01* 109 | X578571Y6143288D02* 110 | X540476Y6105193D01* 111 | X540476Y6105193D02* 112 | X502381Y6029002D01* 113 | X502381Y6029002D02* 114 | X502381Y5838526D01* 115 | X502381Y5838526D02* 116 | X540476Y5762336D01* 117 | X540476Y5762336D02* 118 | X578571Y5724240D01* 119 | X578571Y5724240D02* 120 | X654762Y5686145D01* 121 | X654762Y5686145D02* 122 | X883333Y5686145D01* 123 | X883333Y5686145D02* 124 | X959524Y5724240D01* 125 | X959524Y5724240D02* 126 | X997619Y5762336D01* 127 | D10* 128 | X1154485Y908459D02* 129 | X1154485Y708459D01* 130 | X1468771Y622745D02* 131 | X1468771Y908459D01* 132 | X1468771Y908459D02* 133 | X868771Y908459D01* 134 | X868771Y908459D02* 135 | X868771Y622745D01* 136 | X1411628Y3265602D02* 137 | X1440200Y3294174D01* 138 | X1440200Y3294174D02* 139 | X1468771Y3379888D01* 140 | X1468771Y3379888D02* 141 | X1468771Y3437031D01* 142 | X1468771Y3437031D02* 143 | X1440200Y3522745D01* 144 | X1440200Y3522745D02* 145 | X1383057Y3579888D01* 146 | X1383057Y3579888D02* 147 | X1325914Y3608459D01* 148 | X1325914Y3608459D02* 149 | X1211628Y3637031D01* 150 | X1211628Y3637031D02* 151 | X1125914Y3637031D01* 152 | X1125914Y3637031D02* 153 | X1011628Y3608459D01* 154 | X1011628Y3608459D02* 155 | X954485Y3579888D01* 156 | X954485Y3579888D02* 157 | X897342Y3522745D01* 158 | X897342Y3522745D02* 159 | X868771Y3437031D01* 160 | X868771Y3437031D02* 161 | X868771Y3379888D01* 162 | X868771Y3379888D02* 163 | X897342Y3294174D01* 164 | X897342Y3294174D02* 165 | X925914Y3265602D01* 166 | D11* 167 | X1251190Y1709955D02* 168 | X1327380Y1748050D01* 169 | X1327380Y1748050D02* 170 | X1403571Y1824240D01* 171 | X1403571Y1824240D02* 172 | X1517857Y1938526D01* 173 | X1517857Y1938526D02* 174 | X1594047Y1976621D01* 175 | X1594047Y1976621D02* 176 | X1670238Y1976621D01* 177 | X1632142Y1786145D02* 178 | X1708333Y1824240D01* 179 | X1708333Y1824240D02* 180 | X1784523Y1900431D01* 181 | X1784523Y1900431D02* 182 | X1822619Y2052812D01* 183 | X1822619Y2052812D02* 184 | X1822619Y2319479D01* 185 | X1822619Y2319479D02* 186 | X1784523Y2471860D01* 187 | X1784523Y2471860D02* 188 | X1708333Y2548050D01* 189 | X1708333Y2548050D02* 190 | X1632142Y2586145D01* 191 | X1632142Y2586145D02* 192 | X1479761Y2586145D01* 193 | X1479761Y2586145D02* 194 | X1403571Y2548050D01* 195 | X1403571Y2548050D02* 196 | X1327380Y2471860D01* 197 | X1327380Y2471860D02* 198 | X1289285Y2319479D01* 199 | X1289285Y2319479D02* 200 | X1289285Y2052812D01* 201 | X1289285Y2052812D02* 202 | X1327380Y1900431D01* 203 | X1327380Y1900431D02* 204 | X1403571Y1824240D01* 205 | X1403571Y1824240D02* 206 | X1479761Y1786145D01* 207 | X1479761Y1786145D02* 208 | X1632142Y1786145D01* 209 | X984524Y2509955D02* 210 | X946428Y2548050D01* 211 | X946428Y2548050D02* 212 | X870238Y2586145D01* 213 | X870238Y2586145D02* 214 | X679762Y2586145D01* 215 | X679762Y2586145D02* 216 | X603571Y2548050D01* 217 | X603571Y2548050D02* 218 | X565476Y2509955D01* 219 | X565476Y2509955D02* 220 | X527381Y2433764D01* 221 | X527381Y2433764D02* 222 | X527381Y2357574D01* 223 | X527381Y2357574D02* 224 | X565476Y2243288D01* 225 | X565476Y2243288D02* 226 | X1022619Y1786145D01* 227 | X1022619Y1786145D02* 228 | X527381Y1786145D01* 229 | D10* 230 | X10954485Y908459D02* 231 | X10954485Y708459D01* 232 | X11268771Y622745D02* 233 | X11268771Y908459D01* 234 | X11268771Y908459D02* 235 | X10668771Y908459D01* 236 | X10668771Y908459D02* 237 | X10668771Y622745D01* 238 | X11211628Y3265602D02* 239 | X11240200Y3294174D01* 240 | X11240200Y3294174D02* 241 | X11268771Y3379888D01* 242 | X11268771Y3379888D02* 243 | X11268771Y3437031D01* 244 | X11268771Y3437031D02* 245 | X11240200Y3522745D01* 246 | X11240200Y3522745D02* 247 | X11183057Y3579888D01* 248 | X11183057Y3579888D02* 249 | X11125914Y3608459D01* 250 | X11125914Y3608459D02* 251 | X11011628Y3637031D01* 252 | X11011628Y3637031D02* 253 | X10925914Y3637031D01* 254 | X10925914Y3637031D02* 255 | X10811628Y3608459D01* 256 | X10811628Y3608459D02* 257 | X10754485Y3579888D01* 258 | X10754485Y3579888D02* 259 | X10697342Y3522745D01* 260 | X10697342Y3522745D02* 261 | X10668771Y3437031D01* 262 | X10668771Y3437031D02* 263 | X10668771Y3379888D01* 264 | X10668771Y3379888D02* 265 | X10697342Y3294174D01* 266 | X10697342Y3294174D02* 267 | X10725914Y3265602D01* 268 | D11* 269 | X11001190Y1684955D02* 270 | X11077380Y1723050D01* 271 | X11077380Y1723050D02* 272 | X11153571Y1799240D01* 273 | X11153571Y1799240D02* 274 | X11267857Y1913526D01* 275 | X11267857Y1913526D02* 276 | X11344047Y1951621D01* 277 | X11344047Y1951621D02* 278 | X11420238Y1951621D01* 279 | X11382142Y1761145D02* 280 | X11458333Y1799240D01* 281 | X11458333Y1799240D02* 282 | X11534523Y1875431D01* 283 | X11534523Y1875431D02* 284 | X11572619Y2027812D01* 285 | X11572619Y2027812D02* 286 | X11572619Y2294479D01* 287 | X11572619Y2294479D02* 288 | X11534523Y2446860D01* 289 | X11534523Y2446860D02* 290 | X11458333Y2523050D01* 291 | X11458333Y2523050D02* 292 | X11382142Y2561145D01* 293 | X11382142Y2561145D02* 294 | X11229761Y2561145D01* 295 | X11229761Y2561145D02* 296 | X11153571Y2523050D01* 297 | X11153571Y2523050D02* 298 | X11077380Y2446860D01* 299 | X11077380Y2446860D02* 300 | X11039285Y2294479D01* 301 | X11039285Y2294479D02* 302 | X11039285Y2027812D01* 303 | X11039285Y2027812D02* 304 | X11077380Y1875431D01* 305 | X11077380Y1875431D02* 306 | X11153571Y1799240D01* 307 | X11153571Y1799240D02* 308 | X11229761Y1761145D01* 309 | X11229761Y1761145D02* 310 | X11382142Y1761145D01* 311 | X10277381Y1761145D02* 312 | X10734524Y1761145D01* 313 | X10505952Y1761145D02* 314 | X10505952Y2561145D01* 315 | X10505952Y2561145D02* 316 | X10582143Y2446860D01* 317 | X10582143Y2446860D02* 318 | X10658333Y2370669D01* 319 | X10658333Y2370669D02* 320 | X10734524Y2332574D01* 321 | D10* 322 | X10945514Y7291542D02* 323 | X10945514Y7491542D01* 324 | X10631228Y7577256D02* 325 | X10631228Y7291542D01* 326 | X10631228Y7291542D02* 327 | X11231228Y7291542D01* 328 | X11231228Y7291542D02* 329 | X11231228Y7577256D01* 330 | X10688371Y4934399D02* 331 | X10659800Y4905827D01* 332 | X10659800Y4905827D02* 333 | X10631228Y4820113D01* 334 | X10631228Y4820113D02* 335 | X10631228Y4762970D01* 336 | X10631228Y4762970D02* 337 | X10659800Y4677256D01* 338 | X10659800Y4677256D02* 339 | X10716942Y4620113D01* 340 | X10716942Y4620113D02* 341 | X10774085Y4591542D01* 342 | X10774085Y4591542D02* 343 | X10888371Y4562970D01* 344 | X10888371Y4562970D02* 345 | X10974085Y4562970D01* 346 | X10974085Y4562970D02* 347 | X11088371Y4591542D01* 348 | X11088371Y4591542D02* 349 | X11145514Y4620113D01* 350 | X11145514Y4620113D02* 351 | X11202657Y4677256D01* 352 | X11202657Y4677256D02* 353 | X11231228Y4762970D01* 354 | X11231228Y4762970D02* 355 | X11231228Y4820113D01* 356 | X11231228Y4820113D02* 357 | X11202657Y4905827D01* 358 | X11202657Y4905827D02* 359 | X11174085Y4934399D01* 360 | D11* 361 | X11051190Y5509955D02* 362 | X11127380Y5548050D01* 363 | X11127380Y5548050D02* 364 | X11203571Y5624240D01* 365 | X11203571Y5624240D02* 366 | X11317857Y5738526D01* 367 | X11317857Y5738526D02* 368 | X11394047Y5776621D01* 369 | X11394047Y5776621D02* 370 | X11470238Y5776621D01* 371 | X11432142Y5586145D02* 372 | X11508333Y5624240D01* 373 | X11508333Y5624240D02* 374 | X11584523Y5700431D01* 375 | X11584523Y5700431D02* 376 | X11622619Y5852812D01* 377 | X11622619Y5852812D02* 378 | X11622619Y6119479D01* 379 | X11622619Y6119479D02* 380 | X11584523Y6271860D01* 381 | X11584523Y6271860D02* 382 | X11508333Y6348050D01* 383 | X11508333Y6348050D02* 384 | X11432142Y6386145D01* 385 | X11432142Y6386145D02* 386 | X11279761Y6386145D01* 387 | X11279761Y6386145D02* 388 | X11203571Y6348050D01* 389 | X11203571Y6348050D02* 390 | X11127380Y6271860D01* 391 | X11127380Y6271860D02* 392 | X11089285Y6119479D01* 393 | X11089285Y6119479D02* 394 | X11089285Y5852812D01* 395 | X11089285Y5852812D02* 396 | X11127380Y5700431D01* 397 | X11127380Y5700431D02* 398 | X11203571Y5624240D01* 399 | X11203571Y5624240D02* 400 | X11279761Y5586145D01* 401 | X11279761Y5586145D02* 402 | X11432142Y5586145D01* 403 | X10403571Y6119479D02* 404 | X10403571Y5586145D01* 405 | X10594047Y6424240D02* 406 | X10784524Y5852812D01* 407 | X10784524Y5852812D02* 408 | X10289285Y5852812D01* 409 | D12* 410 | X2602409Y5390953D02* 411 | X3007171Y5390953D01* 412 | X3007171Y5390953D02* 413 | X3054790Y5367143D01* 414 | X3054790Y5367143D02* 415 | X3078600Y5343334D01* 416 | X3078600Y5343334D02* 417 | X3102409Y5295715D01* 418 | X3102409Y5295715D02* 419 | X3102409Y5200477D01* 420 | X3102409Y5200477D02* 421 | X3078600Y5152858D01* 422 | X3078600Y5152858D02* 423 | X3054790Y5129048D01* 424 | X3054790Y5129048D02* 425 | X3007171Y5105239D01* 426 | X3007171Y5105239D02* 427 | X2602409Y5105239D01* 428 | X2650028Y4890952D02* 429 | X2626219Y4867143D01* 430 | X2626219Y4867143D02* 431 | X2602409Y4819524D01* 432 | X2602409Y4819524D02* 433 | X2602409Y4700476D01* 434 | X2602409Y4700476D02* 435 | X2626219Y4652857D01* 436 | X2626219Y4652857D02* 437 | X2650028Y4629048D01* 438 | X2650028Y4629048D02* 439 | X2697647Y4605238D01* 440 | X2697647Y4605238D02* 441 | X2745266Y4605238D01* 442 | X2745266Y4605238D02* 443 | X2816695Y4629048D01* 444 | X2816695Y4629048D02* 445 | X3102409Y4914762D01* 446 | X3102409Y4914762D02* 447 | X3102409Y4605238D01* 448 | D13* 449 | X3264765Y3261667D02* 450 | X3276670Y3273571D01* 451 | X3276670Y3273571D02* 452 | X3288574Y3309286D01* 453 | X3288574Y3309286D02* 454 | X3288574Y3333095D01* 455 | X3288574Y3333095D02* 456 | X3276670Y3368809D01* 457 | X3276670Y3368809D02* 458 | X3252860Y3392619D01* 459 | X3252860Y3392619D02* 460 | X3229050Y3404524D01* 461 | X3229050Y3404524D02* 462 | X3181431Y3416428D01* 463 | X3181431Y3416428D02* 464 | X3145717Y3416428D01* 465 | X3145717Y3416428D02* 466 | X3098098Y3404524D01* 467 | X3098098Y3404524D02* 468 | X3074289Y3392619D01* 469 | X3074289Y3392619D02* 470 | X3050479Y3368809D01* 471 | X3050479Y3368809D02* 472 | X3038574Y3333095D01* 473 | X3038574Y3333095D02* 474 | X3038574Y3309286D01* 475 | X3038574Y3309286D02* 476 | X3050479Y3273571D01* 477 | X3050479Y3273571D02* 478 | X3062384Y3261667D01* 479 | X3038574Y3178333D02* 480 | X3038574Y3023571D01* 481 | X3038574Y3023571D02* 482 | X3133812Y3106905D01* 483 | X3133812Y3106905D02* 484 | X3133812Y3071190D01* 485 | X3133812Y3071190D02* 486 | X3145717Y3047381D01* 487 | X3145717Y3047381D02* 488 | X3157622Y3035476D01* 489 | X3157622Y3035476D02* 490 | X3181431Y3023571D01* 491 | X3181431Y3023571D02* 492 | X3240955Y3023571D01* 493 | X3240955Y3023571D02* 494 | X3264765Y3035476D01* 495 | X3264765Y3035476D02* 496 | X3276670Y3047381D01* 497 | X3276670Y3047381D02* 498 | X3288574Y3071190D01* 499 | X3288574Y3071190D02* 500 | X3288574Y3142619D01* 501 | X3288574Y3142619D02* 502 | X3276670Y3166428D01* 503 | X3276670Y3166428D02* 504 | X3264765Y3178333D01* 505 | D10* 506 | X7031304Y5384915D02* 507 | X7031304Y4575392D01* 508 | X7031304Y4575392D02* 509 | X6983685Y4480154D01* 510 | X6983685Y4480154D02* 511 | X6936066Y4432534D01* 512 | X6936066Y4432534D02* 513 | X6840828Y4384915D01* 514 | X6840828Y4384915D02* 515 | X6650352Y4384915D01* 516 | X6650352Y4384915D02* 517 | X6555114Y4432534D01* 518 | X6555114Y4432534D02* 519 | X6507495Y4480154D01* 520 | X6507495Y4480154D02* 521 | X6459876Y4575392D01* 522 | X6459876Y4575392D02* 523 | X6459876Y5384915D01* 524 | X6078923Y5384915D02* 525 | X5459876Y5384915D01* 526 | X5459876Y5384915D02* 527 | X5793209Y5003963D01* 528 | X5793209Y5003963D02* 529 | X5650352Y5003963D01* 530 | X5650352Y5003963D02* 531 | X5555114Y4956344D01* 532 | X5555114Y4956344D02* 533 | X5507495Y4908725D01* 534 | X5507495Y4908725D02* 535 | X5459876Y4813487D01* 536 | X5459876Y4813487D02* 537 | X5459876Y4575392D01* 538 | X5459876Y4575392D02* 539 | X5507495Y4480154D01* 540 | X5507495Y4480154D02* 541 | X5555114Y4432534D01* 542 | X5555114Y4432534D02* 543 | X5650352Y4384915D01* 544 | X5650352Y4384915D02* 545 | X5936066Y4384915D01* 546 | X5936066Y4384915D02* 547 | X6031304Y4432534D01* 548 | X6031304Y4432534D02* 549 | X6078923Y4480154D01* 550 | D13* 551 | X3264765Y6846667D02* 552 | X3276670Y6858571D01* 553 | X3276670Y6858571D02* 554 | X3288574Y6894286D01* 555 | X3288574Y6894286D02* 556 | X3288574Y6918095D01* 557 | X3288574Y6918095D02* 558 | X3276670Y6953809D01* 559 | X3276670Y6953809D02* 560 | X3252860Y6977619D01* 561 | X3252860Y6977619D02* 562 | X3229050Y6989524D01* 563 | X3229050Y6989524D02* 564 | X3181431Y7001428D01* 565 | X3181431Y7001428D02* 566 | X3145717Y7001428D01* 567 | X3145717Y7001428D02* 568 | X3098098Y6989524D01* 569 | X3098098Y6989524D02* 570 | X3074289Y6977619D01* 571 | X3074289Y6977619D02* 572 | X3050479Y6953809D01* 573 | X3050479Y6953809D02* 574 | X3038574Y6918095D01* 575 | X3038574Y6918095D02* 576 | X3038574Y6894286D01* 577 | X3038574Y6894286D02* 578 | X3050479Y6858571D01* 579 | X3050479Y6858571D02* 580 | X3062384Y6846667D01* 581 | X3062384Y6751428D02* 582 | X3050479Y6739524D01* 583 | X3050479Y6739524D02* 584 | X3038574Y6715714D01* 585 | X3038574Y6715714D02* 586 | X3038574Y6656190D01* 587 | X3038574Y6656190D02* 588 | X3050479Y6632381D01* 589 | X3050479Y6632381D02* 590 | X3062384Y6620476D01* 591 | X3062384Y6620476D02* 592 | X3086193Y6608571D01* 593 | X3086193Y6608571D02* 594 | X3110003Y6608571D01* 595 | X3110003Y6608571D02* 596 | X3145717Y6620476D01* 597 | X3145717Y6620476D02* 598 | X3288574Y6763333D01* 599 | X3288574Y6763333D02* 600 | X3288574Y6608571D01* 601 | X9493200Y3263333D02* 602 | X9369391Y3350000D01* 603 | X9493200Y3411905D02* 604 | X9233200Y3411905D01* 605 | X9233200Y3411905D02* 606 | X9233200Y3312857D01* 607 | X9233200Y3312857D02* 608 | X9245581Y3288095D01* 609 | X9245581Y3288095D02* 610 | X9257962Y3275714D01* 611 | X9257962Y3275714D02* 612 | X9282724Y3263333D01* 613 | X9282724Y3263333D02* 614 | X9319867Y3263333D01* 615 | X9319867Y3263333D02* 616 | X9344629Y3275714D01* 617 | X9344629Y3275714D02* 618 | X9357010Y3288095D01* 619 | X9357010Y3288095D02* 620 | X9369391Y3312857D01* 621 | X9369391Y3312857D02* 622 | X9369391Y3411905D01* 623 | X9257962Y3164286D02* 624 | X9245581Y3151905D01* 625 | X9245581Y3151905D02* 626 | X9233200Y3127143D01* 627 | X9233200Y3127143D02* 628 | X9233200Y3065238D01* 629 | X9233200Y3065238D02* 630 | X9245581Y3040476D01* 631 | X9245581Y3040476D02* 632 | X9257962Y3028095D01* 633 | X9257962Y3028095D02* 634 | X9282724Y3015714D01* 635 | X9282724Y3015714D02* 636 | X9307486Y3015714D01* 637 | X9307486Y3015714D02* 638 | X9344629Y3028095D01* 639 | X9344629Y3028095D02* 640 | X9493200Y3176667D01* 641 | X9493200Y3176667D02* 642 | X9493200Y3015714D01* 643 | X9464765Y5116667D02* 644 | X9476670Y5128571D01* 645 | X9476670Y5128571D02* 646 | X9488574Y5164286D01* 647 | X9488574Y5164286D02* 648 | X9488574Y5188095D01* 649 | X9488574Y5188095D02* 650 | X9476670Y5223809D01* 651 | X9476670Y5223809D02* 652 | X9452860Y5247619D01* 653 | X9452860Y5247619D02* 654 | X9429050Y5259524D01* 655 | X9429050Y5259524D02* 656 | X9381431Y5271428D01* 657 | X9381431Y5271428D02* 658 | X9345717Y5271428D01* 659 | X9345717Y5271428D02* 660 | X9298098Y5259524D01* 661 | X9298098Y5259524D02* 662 | X9274289Y5247619D01* 663 | X9274289Y5247619D02* 664 | X9250479Y5223809D01* 665 | X9250479Y5223809D02* 666 | X9238574Y5188095D01* 667 | X9238574Y5188095D02* 668 | X9238574Y5164286D01* 669 | X9238574Y5164286D02* 670 | X9250479Y5128571D01* 671 | X9250479Y5128571D02* 672 | X9262384Y5116667D01* 673 | X9488574Y4878571D02* 674 | X9488574Y5021428D01* 675 | X9488574Y4950000D02* 676 | X9238574Y4950000D01* 677 | X9238574Y4950000D02* 678 | X9274289Y4973809D01* 679 | X9274289Y4973809D02* 680 | X9298098Y4997619D01* 681 | X9298098Y4997619D02* 682 | X9310003Y5021428D01* 683 | D14* 684 | %TO.C,Q3*% 685 | X350000Y4250000D02* 686 | X1950000Y4250000D01* 687 | X350000Y7850000D02* 688 | X350000Y4250000D01* 689 | X1950000Y4250000D02* 690 | X1950000Y7450000D01* 691 | X1550000Y7850000D02* 692 | X1950000Y7450000D01* 693 | X1550000Y7850000D02* 694 | X350000Y7850000D01* 695 | %TO.C,Q2*% 696 | X1950000Y3950000D02* 697 | X350000Y3950000D01* 698 | X1950000Y350000D02* 699 | X1950000Y3950000D01* 700 | X350000Y3950000D02* 701 | X350000Y750000D01* 702 | X750000Y350000D02* 703 | X350000Y750000D01* 704 | X750000Y350000D02* 705 | X1950000Y350000D01* 706 | %TO.C,Q1*% 707 | X11750000Y3950000D02* 708 | X10150000Y3950000D01* 709 | X11750000Y350000D02* 710 | X11750000Y3950000D01* 711 | X10150000Y3950000D02* 712 | X10150000Y750000D01* 713 | X10550000Y350000D02* 714 | X10150000Y750000D01* 715 | X10550000Y350000D02* 716 | X11750000Y350000D01* 717 | %TO.C,Q4*% 718 | X10150000Y4250000D02* 719 | X11750000Y4250000D01* 720 | X10150000Y7850000D02* 721 | X10150000Y4250000D01* 722 | X11750000Y4250000D02* 723 | X11750000Y7450000D01* 724 | X11350000Y7850000D02* 725 | X11750000Y7450000D01* 726 | X11350000Y7850000D02* 727 | X10150000Y7850000D01* 728 | %TO.C,U2*% 729 | X2400000Y5525000D02* 730 | X3400000Y5525000D01* 731 | X2400000Y4525000D02* 732 | X2400000Y5525000D01* 733 | X3150000Y4525000D02* 734 | X2400000Y4525000D01* 735 | X3400000Y5525000D02* 736 | X3400000Y4775000D01* 737 | X3400000Y4775000D02* 738 | X3150000Y4525000D01* 739 | %TO.C,C3*% 740 | X2925000Y3720000D02* 741 | X3425000Y3720000D01* 742 | X2925000Y2720000D02* 743 | X2925000Y3720000D01* 744 | X3425000Y3720000D02* 745 | X3425000Y2720000D01* 746 | X3425000Y2720000D02* 747 | X2925000Y2720000D01* 748 | %TO.C,U3*% 749 | X4269400Y6839734D02* 750 | X8269400Y6839734D01* 751 | X4269400Y3839734D02* 752 | X4269400Y6839734D01* 753 | X5269400Y2839734D02* 754 | X4269400Y3839734D01* 755 | X8269400Y6839734D02* 756 | X8269400Y2839734D01* 757 | X8269400Y2839734D02* 758 | X5269400Y2839734D01* 759 | %TO.C,C2*% 760 | X2925000Y7305000D02* 761 | X3425000Y7305000D01* 762 | X2925000Y6305000D02* 763 | X2925000Y7305000D01* 764 | X3425000Y7305000D02* 765 | X3425000Y6305000D01* 766 | X3425000Y6305000D02* 767 | X2925000Y6305000D01* 768 | %TO.C,R2*% 769 | X9105000Y3745000D02* 770 | X9645000Y3745000D01* 771 | X9105000Y2695000D02* 772 | X9105000Y3745000D01* 773 | X9645000Y3745000D02* 774 | X9645000Y2695000D01* 775 | X9645000Y2695000D02* 776 | X9105000Y2695000D01* 777 | %TO.C,C1*% 778 | X9125000Y5575000D02* 779 | X9625000Y5575000D01* 780 | X9125000Y4575000D02* 781 | X9125000Y5575000D01* 782 | X9625000Y5575000D02* 783 | X9625000Y4575000D01* 784 | X9625000Y4575000D02* 785 | X9125000Y4575000D01* 786 | %TD*% 787 | M02* 788 | -------------------------------------------------------------------------------- /Fabrication/gerber/HHID-v2-B_Mask.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,8.0.0*% 2 | %TF.CreationDate,2024-11-24T15:26:49+01:00*% 3 | %TF.ProjectId,HHID-v2,48484944-2d76-4322-9e6b-696361645f70,rev?*% 4 | %TF.SameCoordinates,PX89013e0PY67486e0*% 5 | %TF.FileFunction,Soldermask,Bot*% 6 | %TF.FilePolarity,Negative*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 8.0.0) date 2024-11-24 15:26:49* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | G04 Aperture macros list* 15 | %AMRoundRect* 16 | 0 Rectangle with rounded corners* 17 | 0 $1 Rounding radius* 18 | 0 $2 $3 $4 $5 $6 $7 $8 $9 X,Y pos of 4 corners* 19 | 0 Add a 4 corners polygon primitive as box body* 20 | 4,1,4,$2,$3,$4,$5,$6,$7,$8,$9,$2,$3,0* 21 | 0 Add four circle primitives for the rounded corners* 22 | 1,1,$1+$1,$2,$3* 23 | 1,1,$1+$1,$4,$5* 24 | 1,1,$1+$1,$6,$7* 25 | 1,1,$1+$1,$8,$9* 26 | 0 Add four rect primitives between the rounded corners* 27 | 20,1,$1+$1,$2,$3,$4,$5,0* 28 | 20,1,$1+$1,$4,$5,$6,$7,0* 29 | 20,1,$1+$1,$6,$7,$8,$9,0* 30 | 20,1,$1+$1,$8,$9,$2,$3,0*% 31 | %AMRotRect* 32 | 0 Rectangle, with rotation* 33 | 0 The origin of the aperture is its center* 34 | 0 $1 length* 35 | 0 $2 width* 36 | 0 $3 Rotation angle, in degrees counterclockwise* 37 | 0 Add horizontal line* 38 | 21,1,$1,$2,0,0,$3*% 39 | %AMFreePoly0* 40 | 4,1,6,0.130000,-0.115000,-0.020000,-0.275000,-0.130000,-0.275000,-0.130000,0.115000,0.130000,0.115000,0.130000,-0.115000,0.130000,-0.115000,$1*% 41 | %AMFreePoly1* 42 | 4,1,6,0.130000,-0.275000,0.020000,-0.275000,-0.130000,-0.115000,-0.130000,0.115000,0.130000,0.115000,0.130000,-0.275000,0.130000,-0.275000,$1*% 43 | %AMFreePoly2* 44 | 4,1,14,0.364320,0.111820,0.377500,0.080000,0.377500,0.053640,0.364320,0.021820,0.230680,-0.111820,0.198860,-0.125000,-0.332500,-0.125000,-0.364320,-0.111820,-0.377500,-0.080000,-0.377500,0.080000,-0.364320,0.111820,-0.332500,0.125000,0.332500,0.125000,0.364320,0.111820,0.364320,0.111820,$1*% 45 | %AMFreePoly3* 46 | 4,1,14,0.230680,0.111820,0.364320,-0.021820,0.377500,-0.053640,0.377500,-0.080000,0.364320,-0.111820,0.332500,-0.125000,-0.332500,-0.125000,-0.364320,-0.111820,-0.377500,-0.080000,-0.377500,0.080000,-0.364320,0.111820,-0.332500,0.125000,0.198860,0.125000,0.230680,0.111820,0.230680,0.111820,$1*% 47 | %AMFreePoly4* 48 | 4,1,14,0.111820,0.364320,0.125000,0.332500,0.125000,-0.332500,0.111820,-0.364320,0.080000,-0.377500,0.053640,-0.377500,0.021820,-0.364320,-0.111820,-0.230680,-0.125000,-0.198860,-0.125000,0.332500,-0.111820,0.364320,-0.080000,0.377500,0.080000,0.377500,0.111820,0.364320,0.111820,0.364320,$1*% 49 | %AMFreePoly5* 50 | 4,1,14,0.111820,0.364320,0.125000,0.332500,0.125000,-0.198860,0.111820,-0.230680,-0.021820,-0.364320,-0.053640,-0.377500,-0.080000,-0.377500,-0.111820,-0.364320,-0.125000,-0.332500,-0.125000,0.332500,-0.111820,0.364320,-0.080000,0.377500,0.080000,0.377500,0.111820,0.364320,0.111820,0.364320,$1*% 51 | %AMFreePoly6* 52 | 4,1,14,0.364320,0.111820,0.377500,0.080000,0.377500,-0.080000,0.364320,-0.111820,0.332500,-0.125000,-0.332500,-0.125000,-0.364320,-0.111820,-0.377500,-0.080000,-0.377500,-0.053640,-0.364320,-0.021820,-0.230680,0.111820,-0.198860,0.125000,0.332500,0.125000,0.364320,0.111820,0.364320,0.111820,$1*% 53 | %AMFreePoly7* 54 | 4,1,14,0.364320,0.111820,0.377500,0.080000,0.377500,-0.080000,0.364320,-0.111820,0.332500,-0.125000,-0.198860,-0.125000,-0.230680,-0.111820,-0.364320,0.021820,-0.377500,0.053640,-0.377500,0.080000,-0.364320,0.111820,-0.332500,0.125000,0.332500,0.125000,0.364320,0.111820,0.364320,0.111820,$1*% 55 | %AMFreePoly8* 56 | 4,1,14,-0.021820,0.364320,0.111820,0.230680,0.125000,0.198860,0.125000,-0.332500,0.111820,-0.364320,0.080000,-0.377500,-0.080000,-0.377500,-0.111820,-0.364320,-0.125000,-0.332500,-0.125000,0.332500,-0.111820,0.364320,-0.080000,0.377500,-0.053640,0.377500,-0.021820,0.364320,-0.021820,0.364320,$1*% 57 | %AMFreePoly9* 58 | 4,1,14,0.111820,0.364320,0.125000,0.332500,0.125000,-0.332500,0.111820,-0.364320,0.080000,-0.377500,-0.080000,-0.377500,-0.111820,-0.364320,-0.125000,-0.332500,-0.125000,0.198860,-0.111820,0.230680,0.021820,0.364320,0.053640,0.377500,0.080000,0.377500,0.111820,0.364320,0.111820,0.364320,$1*% 59 | G04 Aperture macros list end* 60 | %ADD10RoundRect,0.200000X0.675000X-0.300000X0.675000X0.300000X-0.675000X0.300000X-0.675000X-0.300000X0*% 61 | %ADD11RoundRect,0.200000X-0.675000X0.300000X-0.675000X-0.300000X0.675000X-0.300000X0.675000X0.300000X0*% 62 | %ADD12C,1.000000*% 63 | %ADD13FreePoly0,180.000000*% 64 | %ADD14FreePoly1,180.000000*% 65 | %ADD15FreePoly0,0.000000*% 66 | %ADD16FreePoly1,0.000000*% 67 | %ADD17RotRect,0.520000X0.520000X315.000000*% 68 | %ADD18RoundRect,0.140000X0.170000X-0.140000X0.170000X0.140000X-0.170000X0.140000X-0.170000X-0.140000X0*% 69 | %ADD19FreePoly2,0.000000*% 70 | %ADD20RoundRect,0.062500X-0.375000X-0.062500X0.375000X-0.062500X0.375000X0.062500X-0.375000X0.062500X0*% 71 | %ADD21FreePoly3,0.000000*% 72 | %ADD22FreePoly4,0.000000*% 73 | %ADD23RoundRect,0.062500X-0.062500X-0.375000X0.062500X-0.375000X0.062500X0.375000X-0.062500X0.375000X0*% 74 | %ADD24FreePoly5,0.000000*% 75 | %ADD25FreePoly6,0.000000*% 76 | %ADD26FreePoly7,0.000000*% 77 | %ADD27FreePoly8,0.000000*% 78 | %ADD28FreePoly9,0.000000*% 79 | %ADD29RoundRect,0.135000X-0.185000X0.135000X-0.185000X-0.135000X0.185000X-0.135000X0.185000X0.135000X0*% 80 | %ADD30RoundRect,0.140000X-0.170000X0.140000X-0.170000X-0.140000X0.170000X-0.140000X0.170000X0.140000X0*% 81 | G04 APERTURE END LIST* 82 | D10* 83 | %TO.C,Q3*% 84 | X1150000Y4700000D03* 85 | X1150000Y7400000D03* 86 | %TD*% 87 | D11* 88 | %TO.C,Q2*% 89 | X1150000Y3500000D03* 90 | X1150000Y800000D03* 91 | %TD*% 92 | %TO.C,Q1*% 93 | X10950000Y3500000D03* 94 | X10950000Y800000D03* 95 | %TD*% 96 | D10* 97 | %TO.C,Q4*% 98 | X10950000Y4700000D03* 99 | X10950000Y7400000D03* 100 | %TD*% 101 | D12* 102 | %TO.C,TP1*% 103 | X6050000Y1200000D03* 104 | %TD*% 105 | D13* 106 | %TO.C,U2*% 107 | X3225000Y4540000D03* 108 | D14* 109 | X2575000Y4540000D03* 110 | D15* 111 | X2575000Y5510000D03* 112 | D16* 113 | X3225000Y5510000D03* 114 | D17* 115 | X2900000Y5025000D03* 116 | %TD*% 117 | D18* 118 | %TO.C,C3*% 119 | X3175000Y2740000D03* 120 | X3175000Y3700000D03* 121 | %TD*% 122 | D19* 123 | %TO.C,U3*% 124 | X4271900Y3339734D03* 125 | D20* 126 | X4331900Y3839734D03* 127 | X4331900Y4339734D03* 128 | X4331900Y4839734D03* 129 | X4331900Y5339734D03* 130 | X4331900Y5839734D03* 131 | D21* 132 | X4271900Y6339734D03* 133 | D22* 134 | X4769400Y6837234D03* 135 | D23* 136 | X5269400Y6777234D03* 137 | X5769400Y6777234D03* 138 | X6269400Y6777234D03* 139 | X6769400Y6777234D03* 140 | X7269400Y6777234D03* 141 | D24* 142 | X7769400Y6837234D03* 143 | D25* 144 | X8266900Y6339734D03* 145 | D20* 146 | X8206900Y5839734D03* 147 | X8206900Y5339734D03* 148 | X8206900Y4839734D03* 149 | X8206900Y4339734D03* 150 | X8206900Y3839734D03* 151 | D26* 152 | X8266900Y3339734D03* 153 | D27* 154 | X7769400Y2842234D03* 155 | D23* 156 | X7269400Y2902234D03* 157 | X6769400Y2902234D03* 158 | X6269400Y2902234D03* 159 | X5769400Y2902234D03* 160 | X5269400Y2902234D03* 161 | D28* 162 | X4769400Y2842234D03* 163 | %TD*% 164 | D18* 165 | %TO.C,C2*% 166 | X3175000Y6325000D03* 167 | X3175000Y7285000D03* 168 | %TD*% 169 | D29* 170 | %TO.C,R2*% 171 | X9375000Y3730000D03* 172 | X9375000Y2710000D03* 173 | %TD*% 174 | D12* 175 | %TO.C,TP2*% 176 | X3310000Y1200000D03* 177 | %TD*% 178 | D30* 179 | %TO.C,C1*% 180 | X9375000Y5555000D03* 181 | X9375000Y4595000D03* 182 | %TD*% 183 | D12* 184 | %TO.C,TP3*% 185 | X8790000Y1200000D03* 186 | %TD*% 187 | M02* 188 | -------------------------------------------------------------------------------- /Fabrication/gerber/HHID-v2-B_Paste.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,8.0.0*% 2 | %TF.CreationDate,2024-11-24T15:26:49+01:00*% 3 | %TF.ProjectId,HHID-v2,48484944-2d76-4322-9e6b-696361645f70,rev?*% 4 | %TF.SameCoordinates,PX89013e0PY67486e0*% 5 | %TF.FileFunction,Paste,Bot*% 6 | %TF.FilePolarity,Positive*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 8.0.0) date 2024-11-24 15:26:49* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | G04 Aperture macros list* 15 | %AMRoundRect* 16 | 0 Rectangle with rounded corners* 17 | 0 $1 Rounding radius* 18 | 0 $2 $3 $4 $5 $6 $7 $8 $9 X,Y pos of 4 corners* 19 | 0 Add a 4 corners polygon primitive as box body* 20 | 4,1,4,$2,$3,$4,$5,$6,$7,$8,$9,$2,$3,0* 21 | 0 Add four circle primitives for the rounded corners* 22 | 1,1,$1+$1,$2,$3* 23 | 1,1,$1+$1,$4,$5* 24 | 1,1,$1+$1,$6,$7* 25 | 1,1,$1+$1,$8,$9* 26 | 0 Add four rect primitives between the rounded corners* 27 | 20,1,$1+$1,$2,$3,$4,$5,0* 28 | 20,1,$1+$1,$4,$5,$6,$7,0* 29 | 20,1,$1+$1,$6,$7,$8,$9,0* 30 | 20,1,$1+$1,$8,$9,$2,$3,0*% 31 | %AMRotRect* 32 | 0 Rectangle, with rotation* 33 | 0 The origin of the aperture is its center* 34 | 0 $1 length* 35 | 0 $2 width* 36 | 0 $3 Rotation angle, in degrees counterclockwise* 37 | 0 Add horizontal line* 38 | 21,1,$1,$2,0,0,$3*% 39 | %AMFreePoly0* 40 | 4,1,6,0.130000,-0.115000,-0.020000,-0.275000,-0.130000,-0.275000,-0.130000,0.115000,0.130000,0.115000,0.130000,-0.115000,0.130000,-0.115000,$1*% 41 | %AMFreePoly1* 42 | 4,1,6,0.130000,-0.275000,0.020000,-0.275000,-0.130000,-0.115000,-0.130000,0.115000,0.130000,0.115000,0.130000,-0.275000,0.130000,-0.275000,$1*% 43 | %AMFreePoly2* 44 | 4,1,14,0.364320,0.111820,0.377500,0.080000,0.377500,0.053640,0.364320,0.021820,0.230680,-0.111820,0.198860,-0.125000,-0.332500,-0.125000,-0.364320,-0.111820,-0.377500,-0.080000,-0.377500,0.080000,-0.364320,0.111820,-0.332500,0.125000,0.332500,0.125000,0.364320,0.111820,0.364320,0.111820,$1*% 45 | %AMFreePoly3* 46 | 4,1,14,0.230680,0.111820,0.364320,-0.021820,0.377500,-0.053640,0.377500,-0.080000,0.364320,-0.111820,0.332500,-0.125000,-0.332500,-0.125000,-0.364320,-0.111820,-0.377500,-0.080000,-0.377500,0.080000,-0.364320,0.111820,-0.332500,0.125000,0.198860,0.125000,0.230680,0.111820,0.230680,0.111820,$1*% 47 | %AMFreePoly4* 48 | 4,1,14,0.111820,0.364320,0.125000,0.332500,0.125000,-0.332500,0.111820,-0.364320,0.080000,-0.377500,0.053640,-0.377500,0.021820,-0.364320,-0.111820,-0.230680,-0.125000,-0.198860,-0.125000,0.332500,-0.111820,0.364320,-0.080000,0.377500,0.080000,0.377500,0.111820,0.364320,0.111820,0.364320,$1*% 49 | %AMFreePoly5* 50 | 4,1,14,0.111820,0.364320,0.125000,0.332500,0.125000,-0.198860,0.111820,-0.230680,-0.021820,-0.364320,-0.053640,-0.377500,-0.080000,-0.377500,-0.111820,-0.364320,-0.125000,-0.332500,-0.125000,0.332500,-0.111820,0.364320,-0.080000,0.377500,0.080000,0.377500,0.111820,0.364320,0.111820,0.364320,$1*% 51 | %AMFreePoly6* 52 | 4,1,14,0.364320,0.111820,0.377500,0.080000,0.377500,-0.080000,0.364320,-0.111820,0.332500,-0.125000,-0.332500,-0.125000,-0.364320,-0.111820,-0.377500,-0.080000,-0.377500,-0.053640,-0.364320,-0.021820,-0.230680,0.111820,-0.198860,0.125000,0.332500,0.125000,0.364320,0.111820,0.364320,0.111820,$1*% 53 | %AMFreePoly7* 54 | 4,1,14,0.364320,0.111820,0.377500,0.080000,0.377500,-0.080000,0.364320,-0.111820,0.332500,-0.125000,-0.198860,-0.125000,-0.230680,-0.111820,-0.364320,0.021820,-0.377500,0.053640,-0.377500,0.080000,-0.364320,0.111820,-0.332500,0.125000,0.332500,0.125000,0.364320,0.111820,0.364320,0.111820,$1*% 55 | %AMFreePoly8* 56 | 4,1,14,-0.021820,0.364320,0.111820,0.230680,0.125000,0.198860,0.125000,-0.332500,0.111820,-0.364320,0.080000,-0.377500,-0.080000,-0.377500,-0.111820,-0.364320,-0.125000,-0.332500,-0.125000,0.332500,-0.111820,0.364320,-0.080000,0.377500,-0.053640,0.377500,-0.021820,0.364320,-0.021820,0.364320,$1*% 57 | %AMFreePoly9* 58 | 4,1,14,0.111820,0.364320,0.125000,0.332500,0.125000,-0.332500,0.111820,-0.364320,0.080000,-0.377500,-0.080000,-0.377500,-0.111820,-0.364320,-0.125000,-0.332500,-0.125000,0.198860,-0.111820,0.230680,0.021820,0.364320,0.053640,0.377500,0.080000,0.377500,0.111820,0.364320,0.111820,0.364320,$1*% 59 | G04 Aperture macros list end* 60 | %ADD10RoundRect,0.200000X0.675000X-0.300000X0.675000X0.300000X-0.675000X0.300000X-0.675000X-0.300000X0*% 61 | %ADD11RoundRect,0.200000X-0.675000X0.300000X-0.675000X-0.300000X0.675000X-0.300000X0.675000X0.300000X0*% 62 | %ADD12FreePoly0,180.000000*% 63 | %ADD13FreePoly1,180.000000*% 64 | %ADD14FreePoly0,0.000000*% 65 | %ADD15FreePoly1,0.000000*% 66 | %ADD16RotRect,0.520000X0.520000X315.000000*% 67 | %ADD17RoundRect,0.140000X0.170000X-0.140000X0.170000X0.140000X-0.170000X0.140000X-0.170000X-0.140000X0*% 68 | %ADD18FreePoly2,0.000000*% 69 | %ADD19RoundRect,0.062500X-0.375000X-0.062500X0.375000X-0.062500X0.375000X0.062500X-0.375000X0.062500X0*% 70 | %ADD20FreePoly3,0.000000*% 71 | %ADD21FreePoly4,0.000000*% 72 | %ADD22RoundRect,0.062500X-0.062500X-0.375000X0.062500X-0.375000X0.062500X0.375000X-0.062500X0.375000X0*% 73 | %ADD23FreePoly5,0.000000*% 74 | %ADD24FreePoly6,0.000000*% 75 | %ADD25FreePoly7,0.000000*% 76 | %ADD26FreePoly8,0.000000*% 77 | %ADD27FreePoly9,0.000000*% 78 | %ADD28RoundRect,0.135000X-0.185000X0.135000X-0.185000X-0.135000X0.185000X-0.135000X0.185000X0.135000X0*% 79 | %ADD29RoundRect,0.140000X-0.170000X0.140000X-0.170000X-0.140000X0.170000X-0.140000X0.170000X0.140000X0*% 80 | G04 APERTURE END LIST* 81 | D10* 82 | %TO.C,Q3*% 83 | X1150000Y4700000D03* 84 | X1150000Y7400000D03* 85 | %TD*% 86 | D11* 87 | %TO.C,Q2*% 88 | X1150000Y3500000D03* 89 | X1150000Y800000D03* 90 | %TD*% 91 | %TO.C,Q1*% 92 | X10950000Y3500000D03* 93 | X10950000Y800000D03* 94 | %TD*% 95 | D10* 96 | %TO.C,Q4*% 97 | X10950000Y4700000D03* 98 | X10950000Y7400000D03* 99 | %TD*% 100 | D12* 101 | %TO.C,U2*% 102 | X3225000Y4540000D03* 103 | D13* 104 | X2575000Y4540000D03* 105 | D14* 106 | X2575000Y5510000D03* 107 | D15* 108 | X3225000Y5510000D03* 109 | D16* 110 | X2900000Y5025000D03* 111 | %TD*% 112 | D17* 113 | %TO.C,C3*% 114 | X3175000Y2740000D03* 115 | X3175000Y3700000D03* 116 | %TD*% 117 | D18* 118 | %TO.C,U3*% 119 | X4271900Y3339734D03* 120 | D19* 121 | X4331900Y3839734D03* 122 | X4331900Y4339734D03* 123 | X4331900Y4839734D03* 124 | X4331900Y5339734D03* 125 | X4331900Y5839734D03* 126 | D20* 127 | X4271900Y6339734D03* 128 | D21* 129 | X4769400Y6837234D03* 130 | D22* 131 | X5269400Y6777234D03* 132 | X5769400Y6777234D03* 133 | X6269400Y6777234D03* 134 | X6769400Y6777234D03* 135 | X7269400Y6777234D03* 136 | D23* 137 | X7769400Y6837234D03* 138 | D24* 139 | X8266900Y6339734D03* 140 | D19* 141 | X8206900Y5839734D03* 142 | X8206900Y5339734D03* 143 | X8206900Y4839734D03* 144 | X8206900Y4339734D03* 145 | X8206900Y3839734D03* 146 | D25* 147 | X8266900Y3339734D03* 148 | D26* 149 | X7769400Y2842234D03* 150 | D22* 151 | X7269400Y2902234D03* 152 | X6769400Y2902234D03* 153 | X6269400Y2902234D03* 154 | X5769400Y2902234D03* 155 | X5269400Y2902234D03* 156 | D27* 157 | X4769400Y2842234D03* 158 | %TD*% 159 | D17* 160 | %TO.C,C2*% 161 | X3175000Y6325000D03* 162 | X3175000Y7285000D03* 163 | %TD*% 164 | D28* 165 | %TO.C,R2*% 166 | X9375000Y3730000D03* 167 | X9375000Y2710000D03* 168 | %TD*% 169 | D29* 170 | %TO.C,C1*% 171 | X9375000Y5555000D03* 172 | X9375000Y4595000D03* 173 | %TD*% 174 | M02* 175 | -------------------------------------------------------------------------------- /Fabrication/gerber/HHID-v2-Edge_Cuts.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,8.0.0*% 2 | %TF.CreationDate,2024-11-24T15:26:49+01:00*% 3 | %TF.ProjectId,HHID-v2,48484944-2d76-4322-9e6b-696361645f70,rev?*% 4 | %TF.SameCoordinates,PX89013e0PY67486e0*% 5 | %TF.FileFunction,Profile,NP*% 6 | %FSLAX46Y46*% 7 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 8 | G04 Created by KiCad (PCBNEW 8.0.0) date 2024-11-24 15:26:49* 9 | %MOMM*% 10 | %LPD*% 11 | G01* 12 | G04 APERTURE LIST* 13 | %TA.AperFunction,Profile*% 14 | %ADD10C,0.050000*% 15 | %TD*% 16 | G04 APERTURE END LIST* 17 | D10* 18 | X12100000Y0D02* 19 | X12100000Y8200000D01* 20 | X0Y0D02* 21 | X12100000Y0D01* 22 | X12100000Y8200000D02* 23 | X0Y8200000D01* 24 | X0Y8200000D02* 25 | X0Y0D01* 26 | M02* 27 | -------------------------------------------------------------------------------- /Fabrication/gerber/HHID-v2-F_Cu.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,8.0.0*% 2 | %TF.CreationDate,2024-11-24T15:26:49+01:00*% 3 | %TF.ProjectId,HHID-v2,48484944-2d76-4322-9e6b-696361645f70,rev?*% 4 | %TF.SameCoordinates,PX89013e0PY67486e0*% 5 | %TF.FileFunction,Copper,L1,Top*% 6 | %TF.FilePolarity,Positive*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 8.0.0) date 2024-11-24 15:26:49* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | %TA.AperFunction,ConnectorPad*% 15 | %ADD10R,1.900000X6.800000*% 16 | %TD*% 17 | %TA.AperFunction,ConnectorPad*% 18 | %ADD11R,2.000000X6.300000*% 19 | %TD*% 20 | %TA.AperFunction,ViaPad*% 21 | %ADD12C,0.600000*% 22 | %TD*% 23 | %TA.AperFunction,Conductor*% 24 | %ADD13C,0.150000*% 25 | %TD*% 26 | %TA.AperFunction,Conductor*% 27 | %ADD14C,0.250000*% 28 | %TD*% 29 | G04 APERTURE END LIST* 30 | D10* 31 | %TO.P,J1,1,VBUS*% 32 | %TO.N,+5V*% 33 | X2240000Y3900000D03* 34 | D11* 35 | %TO.P,J1,2,D-*% 36 | %TO.N,/DM*% 37 | X4750000Y3650000D03* 38 | %TO.P,J1,3,D+*% 39 | %TO.N,/DP*% 40 | X7350000Y3650000D03* 41 | D10* 42 | %TO.P,J1,4,GND*% 43 | %TO.N,GND*% 44 | X9860000Y3900000D03* 45 | %TD*% 46 | D12* 47 | %TO.N,GND*% 48 | X9425000Y1925000D03* 49 | X9275000Y6300000D03* 50 | %TO.N,+5V*% 51 | X2537500Y6400636D03* 52 | %TO.N,/DP*% 53 | X6735997Y4010449D03* 54 | %TO.N,/DM*% 55 | X5433497Y4558452D03* 56 | %TD*% 57 | D13* 58 | %TO.N,GND*% 59 | X9703106Y3858977D02* 60 | X9703687Y3858396D01* 61 | X9703106Y5698977D02* 62 | X9703106Y3858977D01* 63 | D14* 64 | %TO.N,+5V*% 65 | X2390399Y5391684D02* 66 | X2083106Y5698977D01* 67 | D13* 68 | %TO.N,/DP*% 69 | X7193106Y4968977D02* 70 | X6623106Y4398977D01* 71 | X7193106Y5948977D02* 72 | X7193106Y4968977D01* 73 | %TD*% 74 | M02* 75 | -------------------------------------------------------------------------------- /Fabrication/gerber/HHID-v2-F_Fab.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,8.0.0*% 2 | %TF.CreationDate,2024-11-24T15:26:49+01:00*% 3 | %TF.ProjectId,HHID-v2,48484944-2d76-4322-9e6b-696361645f70,rev?*% 4 | %TF.SameCoordinates,PX89013e0PY67486e0*% 5 | %TF.FileFunction,AssemblyDrawing,Top*% 6 | %FSLAX46Y46*% 7 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 8 | G04 Created by KiCad (PCBNEW 8.0.0) date 2024-11-24 15:26:49* 9 | %MOMM*% 10 | %LPD*% 11 | G01* 12 | G04 APERTURE LIST* 13 | G04 APERTURE END LIST* 14 | M02* 15 | -------------------------------------------------------------------------------- /Fabrication/gerber/HHID-v2-F_Mask.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,8.0.0*% 2 | %TF.CreationDate,2024-11-24T15:26:49+01:00*% 3 | %TF.ProjectId,HHID-v2,48484944-2d76-4322-9e6b-696361645f70,rev?*% 4 | %TF.SameCoordinates,PX89013e0PY67486e0*% 5 | %TF.FileFunction,Soldermask,Top*% 6 | %TF.FilePolarity,Negative*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 8.0.0) date 2024-11-24 15:26:49* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | %ADD10R,1.900000X6.800000*% 15 | %ADD11R,2.000000X6.300000*% 16 | G04 APERTURE END LIST* 17 | D10* 18 | %TO.C,J1*% 19 | X2240000Y3900000D03* 20 | D11* 21 | X4750000Y3650000D03* 22 | X7350000Y3650000D03* 23 | D10* 24 | X9860000Y3900000D03* 25 | %TD*% 26 | M02* 27 | -------------------------------------------------------------------------------- /Fabrication/gerber/HHID-v2-F_Paste.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,8.0.0*% 2 | %TF.CreationDate,2024-11-24T15:26:49+01:00*% 3 | %TF.ProjectId,HHID-v2,48484944-2d76-4322-9e6b-696361645f70,rev?*% 4 | %TF.SameCoordinates,PX89013e0PY67486e0*% 5 | %TF.FileFunction,Paste,Top*% 6 | %TF.FilePolarity,Positive*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 8.0.0) date 2024-11-24 15:26:49* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | G04 APERTURE END LIST* 15 | M02* 16 | -------------------------------------------------------------------------------- /Fabrication/gerber/HHID-v2-NPTH.drl: -------------------------------------------------------------------------------- 1 | M48 2 | ; DRILL file {KiCad 8.0.0} date 2024-11-24T15:00:43+0100 3 | ; FORMAT={-:-/ absolute / metric / decimal} 4 | ; #@! TF.CreationDate,2024-11-24T15:00:43+01:00 5 | ; #@! TF.GenerationSoftware,Kicad,Pcbnew,8.0.0 6 | ; #@! TF.FileFunction,NonPlated,1,2,NPTH 7 | FMAT,2 8 | METRIC 9 | % 10 | G90 11 | G05 12 | M30 13 | -------------------------------------------------------------------------------- /Fabrication/gerber/HHID-v2-PTH.drl: -------------------------------------------------------------------------------- 1 | M48 2 | ; DRILL file {KiCad 8.0.0} date 2024-11-24T15:00:43+0100 3 | ; FORMAT={-:-/ absolute / metric / decimal} 4 | ; #@! TF.CreationDate,2024-11-24T15:00:43+01:00 5 | ; #@! TF.GenerationSoftware,Kicad,Pcbnew,8.0.0 6 | ; #@! TF.FileFunction,Plated,1,2,PTH 7 | FMAT,2 8 | METRIC 9 | ; #@! TA.AperFunction,Plated,PTH,ViaDrill 10 | T1C0.300 11 | % 12 | G90 13 | G05 14 | T1 15 | X2.538Y6.401 16 | X5.433Y4.558 17 | X6.736Y4.01 18 | X9.275Y6.3 19 | X9.425Y1.925 20 | M30 21 | -------------------------------------------------------------------------------- /KiCad/HHID-v2.kicad_prl: -------------------------------------------------------------------------------- 1 | { 2 | "board": { 3 | "active_layer": 48, 4 | "active_layer_preset": "", 5 | "auto_track_width": false, 6 | "hidden_netclasses": [], 7 | "hidden_nets": [], 8 | "high_contrast_mode": 0, 9 | "net_color_mode": 1, 10 | "opacity": { 11 | "images": 0.6, 12 | "pads": 1.0, 13 | "tracks": 1.0, 14 | "vias": 1.0, 15 | "zones": 0.6 16 | }, 17 | "selection_filter": { 18 | "dimensions": true, 19 | "footprints": true, 20 | "graphics": true, 21 | "keepouts": true, 22 | "lockedItems": false, 23 | "otherItems": true, 24 | "pads": true, 25 | "text": true, 26 | "tracks": true, 27 | "vias": true, 28 | "zones": true 29 | }, 30 | "visible_items": [ 31 | 0, 32 | 1, 33 | 2, 34 | 3, 35 | 4, 36 | 5, 37 | 8, 38 | 9, 39 | 10, 40 | 11, 41 | 12, 42 | 13, 43 | 15, 44 | 16, 45 | 17, 46 | 18, 47 | 19, 48 | 20, 49 | 21, 50 | 22, 51 | 23, 52 | 24, 53 | 25, 54 | 26, 55 | 27, 56 | 28, 57 | 29, 58 | 30, 59 | 32, 60 | 33, 61 | 34, 62 | 35, 63 | 36, 64 | 39, 65 | 40 66 | ], 67 | "visible_layers": "ffffeff_ffffffff", 68 | "zone_display_mode": 0 69 | }, 70 | "git": { 71 | "repo_password": "", 72 | "repo_type": "", 73 | "repo_username": "", 74 | "ssh_key": "" 75 | }, 76 | "meta": { 77 | "filename": "HHID-v2.kicad_prl", 78 | "version": 3 79 | }, 80 | "project": { 81 | "files": [] 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /KiCad/HHID-v2.kicad_pro: -------------------------------------------------------------------------------- 1 | { 2 | "board": { 3 | "3dviewports": [], 4 | "design_settings": { 5 | "defaults": { 6 | "apply_defaults_to_fp_fields": false, 7 | "apply_defaults_to_fp_shapes": false, 8 | "apply_defaults_to_fp_text": false, 9 | "board_outline_line_width": 0.049999999999999996, 10 | "copper_line_width": 0.19999999999999998, 11 | "copper_text_italic": false, 12 | "copper_text_size_h": 1.5, 13 | "copper_text_size_v": 1.5, 14 | "copper_text_thickness": 0.3, 15 | "copper_text_upright": false, 16 | "courtyard_line_width": 0.049999999999999996, 17 | "dimension_precision": 4, 18 | "dimension_units": 3, 19 | "dimensions": { 20 | "arrow_length": 1270000, 21 | "extension_offset": 500000, 22 | "keep_text_aligned": true, 23 | "suppress_zeroes": false, 24 | "text_position": 0, 25 | "units_format": 1 26 | }, 27 | "fab_line_width": 0.09999999999999999, 28 | "fab_text_italic": false, 29 | "fab_text_size_h": 1.0, 30 | "fab_text_size_v": 1.0, 31 | "fab_text_thickness": 0.15, 32 | "fab_text_upright": false, 33 | "other_line_width": 0.09999999999999999, 34 | "other_text_italic": false, 35 | "other_text_size_h": 1.0, 36 | "other_text_size_v": 1.0, 37 | "other_text_thickness": 0.15, 38 | "other_text_upright": false, 39 | "pads": { 40 | "drill": 0.0, 41 | "height": 1.7, 42 | "width": 7.2 43 | }, 44 | "silk_line_width": 0.09999999999999999, 45 | "silk_text_italic": false, 46 | "silk_text_size_h": 1.0, 47 | "silk_text_size_v": 1.0, 48 | "silk_text_thickness": 0.09999999999999999, 49 | "silk_text_upright": false, 50 | "zones": { 51 | "min_clearance": 0.125 52 | } 53 | }, 54 | "diff_pair_dimensions": [ 55 | { 56 | "gap": 0.0, 57 | "via_gap": 0.0, 58 | "width": 0.0 59 | } 60 | ], 61 | "drc_exclusions": [], 62 | "meta": { 63 | "version": 2 64 | }, 65 | "rule_severities": { 66 | "annular_width": "error", 67 | "clearance": "error", 68 | "connection_width": "warning", 69 | "copper_edge_clearance": "error", 70 | "copper_sliver": "warning", 71 | "courtyards_overlap": "error", 72 | "diff_pair_gap_out_of_range": "error", 73 | "diff_pair_uncoupled_length_too_long": "error", 74 | "drill_out_of_range": "error", 75 | "duplicate_footprints": "warning", 76 | "extra_footprint": "warning", 77 | "footprint": "error", 78 | "footprint_symbol_mismatch": "warning", 79 | "footprint_type_mismatch": "ignore", 80 | "hole_clearance": "error", 81 | "hole_near_hole": "error", 82 | "invalid_outline": "error", 83 | "isolated_copper": "warning", 84 | "item_on_disabled_layer": "error", 85 | "items_not_allowed": "error", 86 | "length_out_of_range": "error", 87 | "lib_footprint_issues": "warning", 88 | "lib_footprint_mismatch": "warning", 89 | "malformed_courtyard": "error", 90 | "microvia_drill_out_of_range": "error", 91 | "missing_courtyard": "ignore", 92 | "missing_footprint": "warning", 93 | "net_conflict": "warning", 94 | "npth_inside_courtyard": "ignore", 95 | "padstack": "warning", 96 | "pth_inside_courtyard": "ignore", 97 | "shorting_items": "error", 98 | "silk_edge_clearance": "warning", 99 | "silk_over_copper": "warning", 100 | "silk_overlap": "warning", 101 | "skew_out_of_range": "error", 102 | "solder_mask_bridge": "error", 103 | "starved_thermal": "error", 104 | "text_height": "warning", 105 | "text_thickness": "warning", 106 | "through_hole_pad_without_hole": "error", 107 | "too_many_vias": "error", 108 | "track_dangling": "warning", 109 | "track_width": "error", 110 | "tracks_crossing": "error", 111 | "unconnected_items": "error", 112 | "unresolved_variable": "error", 113 | "via_dangling": "warning", 114 | "zones_intersect": "error" 115 | }, 116 | "rules": { 117 | "max_error": 0.005, 118 | "min_clearance": 0.0, 119 | "min_connection": 0.0, 120 | "min_copper_edge_clearance": 0.26, 121 | "min_hole_clearance": 0.25, 122 | "min_hole_to_hole": 0.25, 123 | "min_microvia_diameter": 0.19999999999999998, 124 | "min_microvia_drill": 0.09999999999999999, 125 | "min_resolved_spokes": 2, 126 | "min_silk_clearance": 0.0, 127 | "min_text_height": 0.7999999999999999, 128 | "min_text_thickness": 0.08, 129 | "min_through_hole_diameter": 0.3, 130 | "min_track_width": 0.0, 131 | "min_via_annular_width": 0.09999999999999999, 132 | "min_via_diameter": 0.5, 133 | "solder_mask_to_copper_clearance": 0.0, 134 | "use_height_for_length_calcs": true 135 | }, 136 | "teardrop_options": [ 137 | { 138 | "td_onpadsmd": true, 139 | "td_onroundshapesonly": false, 140 | "td_ontrackend": false, 141 | "td_onviapad": true 142 | } 143 | ], 144 | "teardrop_parameters": [ 145 | { 146 | "td_allow_use_two_tracks": true, 147 | "td_curve_segcount": 0, 148 | "td_height_ratio": 1.0, 149 | "td_length_ratio": 0.5, 150 | "td_maxheight": 2.0, 151 | "td_maxlen": 1.0, 152 | "td_on_pad_in_zone": false, 153 | "td_target_name": "td_round_shape", 154 | "td_width_to_size_filter_ratio": 0.9 155 | }, 156 | { 157 | "td_allow_use_two_tracks": true, 158 | "td_curve_segcount": 0, 159 | "td_height_ratio": 1.0, 160 | "td_length_ratio": 0.5, 161 | "td_maxheight": 2.0, 162 | "td_maxlen": 1.0, 163 | "td_on_pad_in_zone": false, 164 | "td_target_name": "td_rect_shape", 165 | "td_width_to_size_filter_ratio": 0.9 166 | }, 167 | { 168 | "td_allow_use_two_tracks": true, 169 | "td_curve_segcount": 0, 170 | "td_height_ratio": 1.0, 171 | "td_length_ratio": 0.5, 172 | "td_maxheight": 2.0, 173 | "td_maxlen": 1.0, 174 | "td_on_pad_in_zone": false, 175 | "td_target_name": "td_track_end", 176 | "td_width_to_size_filter_ratio": 0.9 177 | } 178 | ], 179 | "track_widths": [ 180 | 0.0, 181 | 0.25 182 | ], 183 | "tuning_pattern_settings": { 184 | "diff_pair_defaults": { 185 | "corner_radius_percentage": 80, 186 | "corner_style": 1, 187 | "max_amplitude": 1.0, 188 | "min_amplitude": 0.2, 189 | "single_sided": false, 190 | "spacing": 1.0 191 | }, 192 | "diff_pair_skew_defaults": { 193 | "corner_radius_percentage": 80, 194 | "corner_style": 1, 195 | "max_amplitude": 1.0, 196 | "min_amplitude": 0.2, 197 | "single_sided": false, 198 | "spacing": 0.6 199 | }, 200 | "single_track_defaults": { 201 | "corner_radius_percentage": 80, 202 | "corner_style": 1, 203 | "max_amplitude": 1.0, 204 | "min_amplitude": 0.2, 205 | "single_sided": false, 206 | "spacing": 0.6 207 | } 208 | }, 209 | "via_dimensions": [ 210 | { 211 | "diameter": 0.0, 212 | "drill": 0.0 213 | } 214 | ], 215 | "zones_allow_external_fillets": false 216 | }, 217 | "ipc2581": { 218 | "dist": "", 219 | "distpn": "", 220 | "internal_id": "", 221 | "mfg": "", 222 | "mpn": "" 223 | }, 224 | "layer_presets": [], 225 | "viewports": [] 226 | }, 227 | "boards": [], 228 | "cvpcb": { 229 | "equivalence_files": [] 230 | }, 231 | "erc": { 232 | "erc_exclusions": [], 233 | "meta": { 234 | "version": 0 235 | }, 236 | "pin_map": [ 237 | [ 238 | 0, 239 | 0, 240 | 0, 241 | 0, 242 | 0, 243 | 0, 244 | 1, 245 | 0, 246 | 0, 247 | 0, 248 | 0, 249 | 2 250 | ], 251 | [ 252 | 0, 253 | 2, 254 | 0, 255 | 1, 256 | 0, 257 | 0, 258 | 1, 259 | 0, 260 | 2, 261 | 2, 262 | 2, 263 | 2 264 | ], 265 | [ 266 | 0, 267 | 0, 268 | 0, 269 | 0, 270 | 0, 271 | 0, 272 | 1, 273 | 0, 274 | 1, 275 | 0, 276 | 1, 277 | 2 278 | ], 279 | [ 280 | 0, 281 | 1, 282 | 0, 283 | 0, 284 | 0, 285 | 0, 286 | 1, 287 | 1, 288 | 2, 289 | 1, 290 | 1, 291 | 2 292 | ], 293 | [ 294 | 0, 295 | 0, 296 | 0, 297 | 0, 298 | 0, 299 | 0, 300 | 1, 301 | 0, 302 | 0, 303 | 0, 304 | 0, 305 | 2 306 | ], 307 | [ 308 | 0, 309 | 0, 310 | 0, 311 | 0, 312 | 0, 313 | 0, 314 | 0, 315 | 0, 316 | 0, 317 | 0, 318 | 0, 319 | 2 320 | ], 321 | [ 322 | 1, 323 | 1, 324 | 1, 325 | 1, 326 | 1, 327 | 0, 328 | 1, 329 | 1, 330 | 1, 331 | 1, 332 | 1, 333 | 2 334 | ], 335 | [ 336 | 0, 337 | 0, 338 | 0, 339 | 1, 340 | 0, 341 | 0, 342 | 1, 343 | 0, 344 | 0, 345 | 0, 346 | 0, 347 | 2 348 | ], 349 | [ 350 | 0, 351 | 2, 352 | 1, 353 | 2, 354 | 0, 355 | 0, 356 | 1, 357 | 0, 358 | 2, 359 | 2, 360 | 2, 361 | 2 362 | ], 363 | [ 364 | 0, 365 | 2, 366 | 0, 367 | 1, 368 | 0, 369 | 0, 370 | 1, 371 | 0, 372 | 2, 373 | 0, 374 | 0, 375 | 2 376 | ], 377 | [ 378 | 0, 379 | 2, 380 | 1, 381 | 1, 382 | 0, 383 | 0, 384 | 1, 385 | 0, 386 | 2, 387 | 0, 388 | 0, 389 | 2 390 | ], 391 | [ 392 | 2, 393 | 2, 394 | 2, 395 | 2, 396 | 2, 397 | 2, 398 | 2, 399 | 2, 400 | 2, 401 | 2, 402 | 2, 403 | 2 404 | ] 405 | ], 406 | "rule_severities": { 407 | "bus_definition_conflict": "error", 408 | "bus_entry_needed": "error", 409 | "bus_to_bus_conflict": "error", 410 | "bus_to_net_conflict": "error", 411 | "conflicting_netclasses": "error", 412 | "different_unit_footprint": "error", 413 | "different_unit_net": "error", 414 | "duplicate_reference": "error", 415 | "duplicate_sheet_names": "error", 416 | "endpoint_off_grid": "warning", 417 | "extra_units": "error", 418 | "global_label_dangling": "warning", 419 | "hier_label_mismatch": "error", 420 | "label_dangling": "error", 421 | "lib_symbol_issues": "warning", 422 | "missing_bidi_pin": "warning", 423 | "missing_input_pin": "warning", 424 | "missing_power_pin": "error", 425 | "missing_unit": "warning", 426 | "multiple_net_names": "warning", 427 | "net_not_bus_member": "warning", 428 | "no_connect_connected": "warning", 429 | "no_connect_dangling": "warning", 430 | "pin_not_connected": "error", 431 | "pin_not_driven": "error", 432 | "pin_to_pin": "warning", 433 | "power_pin_not_driven": "error", 434 | "similar_labels": "warning", 435 | "simulation_model_issue": "ignore", 436 | "unannotated": "error", 437 | "unit_value_mismatch": "error", 438 | "unresolved_variable": "error", 439 | "wire_dangling": "error" 440 | } 441 | }, 442 | "libraries": { 443 | "pinned_footprint_libs": [], 444 | "pinned_symbol_libs": [] 445 | }, 446 | "meta": { 447 | "filename": "HHID-v2.kicad_pro", 448 | "version": 1 449 | }, 450 | "net_settings": { 451 | "classes": [ 452 | { 453 | "bus_width": 12, 454 | "clearance": 0.125, 455 | "diff_pair_gap": 0.25, 456 | "diff_pair_via_gap": 0.25, 457 | "diff_pair_width": 0.2, 458 | "line_style": 0, 459 | "microvia_diameter": 0.3, 460 | "microvia_drill": 0.1, 461 | "name": "Default", 462 | "pcb_color": "rgba(0, 0, 0, 0.000)", 463 | "schematic_color": "rgba(0, 0, 0, 0.000)", 464 | "track_width": 0.125, 465 | "via_diameter": 0.6, 466 | "via_drill": 0.3, 467 | "wire_width": 6 468 | } 469 | ], 470 | "meta": { 471 | "version": 3 472 | }, 473 | "net_colors": null, 474 | "netclass_assignments": null, 475 | "netclass_patterns": [] 476 | }, 477 | "pcbnew": { 478 | "last_paths": { 479 | "gencad": "", 480 | "idf": "", 481 | "netlist": "", 482 | "plot": "gerber/", 483 | "pos_files": "./", 484 | "specctra_dsn": "", 485 | "step": "", 486 | "svg": "", 487 | "vrml": "" 488 | }, 489 | "page_layout_descr_file": "" 490 | }, 491 | "schematic": { 492 | "annotate_start_num": 0, 493 | "bom_fmt_presets": [], 494 | "bom_fmt_settings": { 495 | "field_delimiter": ",", 496 | "keep_line_breaks": false, 497 | "keep_tabs": false, 498 | "name": "CSV", 499 | "ref_delimiter": ",", 500 | "ref_range_delimiter": "", 501 | "string_delimiter": "\"" 502 | }, 503 | "bom_presets": [], 504 | "bom_settings": { 505 | "exclude_dnp": false, 506 | "fields_ordered": [ 507 | { 508 | "group_by": false, 509 | "label": "Reference", 510 | "name": "Reference", 511 | "show": true 512 | }, 513 | { 514 | "group_by": true, 515 | "label": "Value", 516 | "name": "Value", 517 | "show": true 518 | }, 519 | { 520 | "group_by": false, 521 | "label": "Datasheet", 522 | "name": "Datasheet", 523 | "show": true 524 | }, 525 | { 526 | "group_by": false, 527 | "label": "Footprint", 528 | "name": "Footprint", 529 | "show": true 530 | }, 531 | { 532 | "group_by": false, 533 | "label": "Qty", 534 | "name": "${QUANTITY}", 535 | "show": true 536 | }, 537 | { 538 | "group_by": true, 539 | "label": "DNP", 540 | "name": "${DNP}", 541 | "show": true 542 | } 543 | ], 544 | "filter_string": "", 545 | "group_symbols": true, 546 | "name": "Grouped By Value", 547 | "sort_asc": true, 548 | "sort_field": "Reference" 549 | }, 550 | "connection_grid_size": 50.0, 551 | "drawing": { 552 | "dashed_lines_dash_length_ratio": 12.0, 553 | "dashed_lines_gap_length_ratio": 3.0, 554 | "default_line_thickness": 6.0, 555 | "default_text_size": 50.0, 556 | "field_names": [], 557 | "intersheets_ref_own_page": false, 558 | "intersheets_ref_prefix": "", 559 | "intersheets_ref_short": false, 560 | "intersheets_ref_show": false, 561 | "intersheets_ref_suffix": "", 562 | "junction_size_choice": 3, 563 | "label_size_ratio": 0.375, 564 | "operating_point_overlay_i_precision": 3, 565 | "operating_point_overlay_i_range": "~A", 566 | "operating_point_overlay_v_precision": 3, 567 | "operating_point_overlay_v_range": "~V", 568 | "overbar_offset_ratio": 1.23, 569 | "pin_symbol_size": 25.0, 570 | "text_offset_ratio": 0.15 571 | }, 572 | "legacy_lib_dir": "", 573 | "legacy_lib_list": [], 574 | "meta": { 575 | "version": 1 576 | }, 577 | "net_format_name": "", 578 | "page_layout_descr_file": "", 579 | "plot_directory": "", 580 | "spice_current_sheet_as_root": false, 581 | "spice_external_command": "spice \"%I\"", 582 | "spice_model_current_sheet_as_root": true, 583 | "spice_save_all_currents": false, 584 | "spice_save_all_dissipations": false, 585 | "spice_save_all_voltages": false, 586 | "subpart_first_id": 65, 587 | "subpart_id_separator": 0 588 | }, 589 | "sheets": [ 590 | [ 591 | "f235dd1b-57a4-4459-86b4-0864643a9595", 592 | "Root" 593 | ] 594 | ], 595 | "text_variables": {} 596 | } 597 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Hidden-HID-v2 2 | Hidden HID v2 is a tiny USB rubber ducky that can be concealed entirely inside the USB port. I have implemented various hardware improvements compared to v1. 3 | 4 | These include: 5 | 1. Removal of SWD programming pins to rely only on STs internal USB bootloader, which avoids the need to painstakingly solder the PCB to the STLink debugger every time I want to change the program. Now it is only necessary to bridge the BOOT0 test pad (middle) with 3V3 to select bootloader, or with GND to select application (see image below). After connecting BOOT0 to 3V3, the STM32 can then be programmed by inserting into the USB port and using the STCubeProgrammer tool to download the hex file. 6 | 2. Layout changes to enable easier assembly of the spacer elements 7 | 3. Switching the spacer elements from LEDs with no electrical function to IR phototransistors which also provide a simple on-off remote control. This allows the device to be remotely armed and disarmed once inserted. 8 | 9 | 10 |  11 | 12 | connect BOOT0 to GND to run application or with 3V3 to reprogram 13 | 14 | 15 | KiCad files can be found under /KiCad, gerber and BOM separately under /Fabrication. 16 | Under /STM32 I have uploaded a basic test firmware. This firmware waits for an IR signal, then opens a terminal and echoes hello world. You may need to tweak the paths a little to get it running on your system. 17 | 18 | If you are interested in purchasing this PCB, I have uploaded it to the PCBWay community. Here you can order either the bare PCB or the assembled PCB directly: https://www.pcbway.com/project/shareproject/Hidden_HID_an_invisible_USB_Rubber_Ducky_3a8cd27f.html 19 | 20 | Also check out the project write-up on hackaday: https://hackaday.io/project/202218-hidden-hid-v2-worlds-smallest-rubber-ducky 21 | 22 |  23 | 24 | 25 |  26 | -------------------------------------------------------------------------------- /STM32/Core/Inc/main.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file : main.h 5 | * @brief : Header for main.c file. 6 | * This file contains the common defines of the application. 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2025 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | 21 | /* Define to prevent recursive inclusion -------------------------------------*/ 22 | #ifndef __MAIN_H 23 | #define __MAIN_H 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /* Includes ------------------------------------------------------------------*/ 30 | #include "stm32f0xx_hal.h" 31 | 32 | /* Private includes ----------------------------------------------------------*/ 33 | /* USER CODE BEGIN Includes */ 34 | 35 | /* USER CODE END Includes */ 36 | 37 | /* Exported types ------------------------------------------------------------*/ 38 | /* USER CODE BEGIN ET */ 39 | 40 | /* USER CODE END ET */ 41 | 42 | /* Exported constants --------------------------------------------------------*/ 43 | /* USER CODE BEGIN EC */ 44 | 45 | /* USER CODE END EC */ 46 | 47 | /* Exported macro ------------------------------------------------------------*/ 48 | /* USER CODE BEGIN EM */ 49 | 50 | /* USER CODE END EM */ 51 | 52 | /* Exported functions prototypes ---------------------------------------------*/ 53 | void Error_Handler(void); 54 | 55 | /* USER CODE BEGIN EFP */ 56 | 57 | /* USER CODE END EFP */ 58 | 59 | /* Private defines -----------------------------------------------------------*/ 60 | 61 | /* USER CODE BEGIN Private defines */ 62 | 63 | /* USER CODE END Private defines */ 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif /* __MAIN_H */ 70 | -------------------------------------------------------------------------------- /STM32/Core/Inc/stm32f0xx_hal_conf.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32f0xx_hal_conf.h 5 | * @brief HAL configuration file. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | * Copyright (c) 2016 STMicroelectronics. 10 | * All rights reserved. 11 | * 12 | * This software is licensed under terms that can be found in the LICENSE file 13 | * in the root directory of this software component. 14 | * If no LICENSE file comes with this software, it is provided AS-IS. 15 | * 16 | ****************************************************************************** 17 | */ 18 | /* USER CODE END Header */ 19 | 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __STM32F0xx_HAL_CONF_H 22 | #define __STM32F0xx_HAL_CONF_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Exported types ------------------------------------------------------------*/ 29 | /* Exported constants --------------------------------------------------------*/ 30 | 31 | /* ########################## Module Selection ############################## */ 32 | /** 33 | * @brief This is the list of modules to be used in the HAL driver 34 | */ 35 | #define HAL_MODULE_ENABLED 36 | #define HAL_ADC_MODULE_ENABLED 37 | /*#define HAL_CRYP_MODULE_ENABLED */ 38 | /*#define HAL_CAN_MODULE_ENABLED */ 39 | /*#define HAL_CEC_MODULE_ENABLED */ 40 | /*#define HAL_COMP_MODULE_ENABLED */ 41 | /*#define HAL_CRC_MODULE_ENABLED */ 42 | /*#define HAL_CRYP_MODULE_ENABLED */ 43 | /*#define HAL_TSC_MODULE_ENABLED */ 44 | /*#define HAL_DAC_MODULE_ENABLED */ 45 | /*#define HAL_I2S_MODULE_ENABLED */ 46 | /*#define HAL_IWDG_MODULE_ENABLED */ 47 | /*#define HAL_LCD_MODULE_ENABLED */ 48 | /*#define HAL_LPTIM_MODULE_ENABLED */ 49 | /*#define HAL_RNG_MODULE_ENABLED */ 50 | /*#define HAL_RTC_MODULE_ENABLED */ 51 | /*#define HAL_SPI_MODULE_ENABLED */ 52 | /*#define HAL_TIM_MODULE_ENABLED */ 53 | /*#define HAL_UART_MODULE_ENABLED */ 54 | /*#define HAL_USART_MODULE_ENABLED */ 55 | /*#define HAL_IRDA_MODULE_ENABLED */ 56 | /*#define HAL_SMARTCARD_MODULE_ENABLED */ 57 | /*#define HAL_SMBUS_MODULE_ENABLED */ 58 | /*#define HAL_WWDG_MODULE_ENABLED */ 59 | #define HAL_PCD_MODULE_ENABLED 60 | #define HAL_CORTEX_MODULE_ENABLED 61 | #define HAL_DMA_MODULE_ENABLED 62 | #define HAL_FLASH_MODULE_ENABLED 63 | #define HAL_GPIO_MODULE_ENABLED 64 | #define HAL_EXTI_MODULE_ENABLED 65 | #define HAL_PWR_MODULE_ENABLED 66 | #define HAL_RCC_MODULE_ENABLED 67 | #define HAL_I2C_MODULE_ENABLED 68 | 69 | /* ########################## HSE/HSI Values adaptation ##################### */ 70 | /** 71 | * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. 72 | * This value is used by the RCC HAL module to compute the system frequency 73 | * (when HSE is used as system clock source, directly or through the PLL). 74 | */ 75 | #if !defined (HSE_VALUE) 76 | #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ 77 | #endif /* HSE_VALUE */ 78 | 79 | /** 80 | * @brief In the following line adjust the External High Speed oscillator (HSE) Startup 81 | * Timeout value 82 | */ 83 | #if !defined (HSE_STARTUP_TIMEOUT) 84 | #define HSE_STARTUP_TIMEOUT ((uint32_t)100) /*!< Time out for HSE start up, in ms */ 85 | #endif /* HSE_STARTUP_TIMEOUT */ 86 | 87 | /** 88 | * @brief Internal High Speed oscillator (HSI) value. 89 | * This value is used by the RCC HAL module to compute the system frequency 90 | * (when HSI is used as system clock source, directly or through the PLL). 91 | */ 92 | #if !defined (HSI_VALUE) 93 | #define HSI_VALUE ((uint32_t)8000000) /*!< Value of the Internal oscillator in Hz*/ 94 | #endif /* HSI_VALUE */ 95 | 96 | /** 97 | * @brief In the following line adjust the Internal High Speed oscillator (HSI) Startup 98 | * Timeout value 99 | */ 100 | #if !defined (HSI_STARTUP_TIMEOUT) 101 | #define HSI_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSI start up */ 102 | #endif /* HSI_STARTUP_TIMEOUT */ 103 | 104 | /** 105 | * @brief Internal High Speed oscillator for ADC (HSI14) value. 106 | */ 107 | #if !defined (HSI14_VALUE) 108 | #define HSI14_VALUE ((uint32_t)14000000) /*!< Value of the Internal High Speed oscillator for ADC in Hz. 109 | The real value may vary depending on the variations 110 | in voltage and temperature. */ 111 | #endif /* HSI14_VALUE */ 112 | 113 | /** 114 | * @brief Internal High Speed oscillator for USB (HSI48) value. 115 | */ 116 | #if !defined (HSI48_VALUE) 117 | #define HSI48_VALUE ((uint32_t)48000000) /*!< Value of the Internal High Speed oscillator for USB in Hz. 118 | The real value may vary depending on the variations 119 | in voltage and temperature. */ 120 | #endif /* HSI48_VALUE */ 121 | 122 | /** 123 | * @brief Internal Low Speed oscillator (LSI) value. 124 | */ 125 | #if !defined (LSI_VALUE) 126 | #define LSI_VALUE ((uint32_t)40000) 127 | #endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz 128 | The real value may vary depending on the variations 129 | in voltage and temperature. */ 130 | /** 131 | * @brief External Low Speed oscillator (LSI) value. 132 | */ 133 | #if !defined (LSE_VALUE) 134 | #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ 135 | #endif /* LSE_VALUE */ 136 | 137 | /** 138 | * @brief Time out for LSE start up value in ms. 139 | */ 140 | #if !defined (LSE_STARTUP_TIMEOUT) 141 | #define LSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for LSE start up, in ms */ 142 | #endif /* LSE_STARTUP_TIMEOUT */ 143 | 144 | /* Tip: To avoid modifying this file each time you need to use different HSE, 145 | === you can define the HSE value in your toolchain compiler preprocessor. */ 146 | 147 | /* ########################### System Configuration ######################### */ 148 | /** 149 | * @brief This is the HAL system configuration section 150 | */ 151 | #define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ 152 | #define TICK_INT_PRIORITY ((uint32_t)3) /*!< tick interrupt priority (lowest by default) */ 153 | /* Warning: Must be set to higher priority for HAL_Delay() */ 154 | /* and HAL_GetTick() usage under interrupt context */ 155 | #define USE_RTOS 0 156 | #define PREFETCH_ENABLE 1 157 | #define INSTRUCTION_CACHE_ENABLE 0 158 | #define DATA_CACHE_ENABLE 0 159 | #define USE_SPI_CRC 0U 160 | 161 | #define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ 162 | #define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ 163 | #define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */ 164 | #define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ 165 | #define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ 166 | #define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ 167 | #define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ 168 | #define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ 169 | #define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ 170 | #define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ 171 | #define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ 172 | #define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ 173 | #define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ 174 | #define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ 175 | #define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ 176 | #define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ 177 | #define USE_HAL_TSC_REGISTER_CALLBACKS 0U /* TSC register callback disabled */ 178 | #define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ 179 | 180 | /* ########################## Assert Selection ############################## */ 181 | /** 182 | * @brief Uncomment the line below to expanse the "assert_param" macro in the 183 | * HAL drivers code 184 | */ 185 | /* #define USE_FULL_ASSERT 1U */ 186 | 187 | /* Includes ------------------------------------------------------------------*/ 188 | /** 189 | * @brief Include module's header file 190 | */ 191 | 192 | #ifdef HAL_RCC_MODULE_ENABLED 193 | #include "stm32f0xx_hal_rcc.h" 194 | #endif /* HAL_RCC_MODULE_ENABLED */ 195 | 196 | #ifdef HAL_GPIO_MODULE_ENABLED 197 | #include "stm32f0xx_hal_gpio.h" 198 | #endif /* HAL_GPIO_MODULE_ENABLED */ 199 | 200 | #ifdef HAL_EXTI_MODULE_ENABLED 201 | #include "stm32f0xx_hal_exti.h" 202 | #endif /* HAL_EXTI_MODULE_ENABLED */ 203 | 204 | #ifdef HAL_DMA_MODULE_ENABLED 205 | #include "stm32f0xx_hal_dma.h" 206 | #endif /* HAL_DMA_MODULE_ENABLED */ 207 | 208 | #ifdef HAL_CORTEX_MODULE_ENABLED 209 | #include "stm32f0xx_hal_cortex.h" 210 | #endif /* HAL_CORTEX_MODULE_ENABLED */ 211 | 212 | #ifdef HAL_ADC_MODULE_ENABLED 213 | #include "stm32f0xx_hal_adc.h" 214 | #endif /* HAL_ADC_MODULE_ENABLED */ 215 | 216 | #ifdef HAL_CAN_MODULE_ENABLED 217 | #include "stm32f0xx_hal_can.h" 218 | #endif /* HAL_CAN_MODULE_ENABLED */ 219 | 220 | #ifdef HAL_CEC_MODULE_ENABLED 221 | #include "stm32f0xx_hal_cec.h" 222 | #endif /* HAL_CEC_MODULE_ENABLED */ 223 | 224 | #ifdef HAL_COMP_MODULE_ENABLED 225 | #include "stm32f0xx_hal_comp.h" 226 | #endif /* HAL_COMP_MODULE_ENABLED */ 227 | 228 | #ifdef HAL_CRC_MODULE_ENABLED 229 | #include "stm32f0xx_hal_crc.h" 230 | #endif /* HAL_CRC_MODULE_ENABLED */ 231 | 232 | #ifdef HAL_DAC_MODULE_ENABLED 233 | #include "stm32f0xx_hal_dac.h" 234 | #endif /* HAL_DAC_MODULE_ENABLED */ 235 | 236 | #ifdef HAL_FLASH_MODULE_ENABLED 237 | #include "stm32f0xx_hal_flash.h" 238 | #endif /* HAL_FLASH_MODULE_ENABLED */ 239 | 240 | #ifdef HAL_I2C_MODULE_ENABLED 241 | #include "stm32f0xx_hal_i2c.h" 242 | #endif /* HAL_I2C_MODULE_ENABLED */ 243 | 244 | #ifdef HAL_I2S_MODULE_ENABLED 245 | #include "stm32f0xx_hal_i2s.h" 246 | #endif /* HAL_I2S_MODULE_ENABLED */ 247 | 248 | #ifdef HAL_IRDA_MODULE_ENABLED 249 | #include "stm32f0xx_hal_irda.h" 250 | #endif /* HAL_IRDA_MODULE_ENABLED */ 251 | 252 | #ifdef HAL_IWDG_MODULE_ENABLED 253 | #include "stm32f0xx_hal_iwdg.h" 254 | #endif /* HAL_IWDG_MODULE_ENABLED */ 255 | 256 | #ifdef HAL_PCD_MODULE_ENABLED 257 | #include "stm32f0xx_hal_pcd.h" 258 | #endif /* HAL_PCD_MODULE_ENABLED */ 259 | 260 | #ifdef HAL_PWR_MODULE_ENABLED 261 | #include "stm32f0xx_hal_pwr.h" 262 | #endif /* HAL_PWR_MODULE_ENABLED */ 263 | 264 | #ifdef HAL_RTC_MODULE_ENABLED 265 | #include "stm32f0xx_hal_rtc.h" 266 | #endif /* HAL_RTC_MODULE_ENABLED */ 267 | 268 | #ifdef HAL_SMARTCARD_MODULE_ENABLED 269 | #include "stm32f0xx_hal_smartcard.h" 270 | #endif /* HAL_SMARTCARD_MODULE_ENABLED */ 271 | 272 | #ifdef HAL_SMBUS_MODULE_ENABLED 273 | #include "stm32f0xx_hal_smbus.h" 274 | #endif /* HAL_SMBUS_MODULE_ENABLED */ 275 | 276 | #ifdef HAL_SPI_MODULE_ENABLED 277 | #include "stm32f0xx_hal_spi.h" 278 | #endif /* HAL_SPI_MODULE_ENABLED */ 279 | 280 | #ifdef HAL_TIM_MODULE_ENABLED 281 | #include "stm32f0xx_hal_tim.h" 282 | #endif /* HAL_TIM_MODULE_ENABLED */ 283 | 284 | #ifdef HAL_TSC_MODULE_ENABLED 285 | #include "stm32f0xx_hal_tsc.h" 286 | #endif /* HAL_TSC_MODULE_ENABLED */ 287 | 288 | #ifdef HAL_UART_MODULE_ENABLED 289 | #include "stm32f0xx_hal_uart.h" 290 | #endif /* HAL_UART_MODULE_ENABLED */ 291 | 292 | #ifdef HAL_USART_MODULE_ENABLED 293 | #include "stm32f0xx_hal_usart.h" 294 | #endif /* HAL_USART_MODULE_ENABLED */ 295 | 296 | #ifdef HAL_WWDG_MODULE_ENABLED 297 | #include "stm32f0xx_hal_wwdg.h" 298 | #endif /* HAL_WWDG_MODULE_ENABLED */ 299 | 300 | /* Exported macro ------------------------------------------------------------*/ 301 | #ifdef USE_FULL_ASSERT 302 | /** 303 | * @brief The assert_param macro is used for function's parameters check. 304 | * @param expr If expr is false, it calls assert_failed function 305 | * which reports the name of the source file and the source 306 | * line number of the call that failed. 307 | * If expr is true, it returns no value. 308 | * @retval None 309 | */ 310 | #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) 311 | /* Exported functions ------------------------------------------------------- */ 312 | void assert_failed(uint8_t* file, uint32_t line); 313 | #else 314 | #define assert_param(expr) ((void)0U) 315 | #endif /* USE_FULL_ASSERT */ 316 | 317 | #ifdef __cplusplus 318 | } 319 | #endif 320 | 321 | #endif /* __STM32F0xx_HAL_CONF_H */ 322 | 323 | -------------------------------------------------------------------------------- /STM32/Core/Inc/stm32f0xx_it.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32f0xx_it.h 5 | * @brief This file contains the headers of the interrupt handlers. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | * Copyright (c) 2025 STMicroelectronics. 10 | * All rights reserved. 11 | * 12 | * This software is licensed under terms that can be found in the LICENSE file 13 | * in the root directory of this software component. 14 | * If no LICENSE file comes with this software, it is provided AS-IS. 15 | * 16 | ****************************************************************************** 17 | */ 18 | /* USER CODE END Header */ 19 | 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __STM32F0xx_IT_H 22 | #define __STM32F0xx_IT_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Private includes ----------------------------------------------------------*/ 29 | /* USER CODE BEGIN Includes */ 30 | 31 | /* USER CODE END Includes */ 32 | 33 | /* Exported types ------------------------------------------------------------*/ 34 | /* USER CODE BEGIN ET */ 35 | 36 | /* USER CODE END ET */ 37 | 38 | /* Exported constants --------------------------------------------------------*/ 39 | /* USER CODE BEGIN EC */ 40 | 41 | /* USER CODE END EC */ 42 | 43 | /* Exported macro ------------------------------------------------------------*/ 44 | /* USER CODE BEGIN EM */ 45 | 46 | /* USER CODE END EM */ 47 | 48 | /* Exported functions prototypes ---------------------------------------------*/ 49 | void NMI_Handler(void); 50 | void HardFault_Handler(void); 51 | void SVC_Handler(void); 52 | void PendSV_Handler(void); 53 | void SysTick_Handler(void); 54 | void ADC1_IRQHandler(void); 55 | void USB_IRQHandler(void); 56 | /* USER CODE BEGIN EFP */ 57 | 58 | /* USER CODE END EFP */ 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | 64 | #endif /* __STM32F0xx_IT_H */ 65 | -------------------------------------------------------------------------------- /STM32/Core/Src/main.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file : main.c 5 | * @brief : Main program body 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | * Copyright (c) 2025 STMicroelectronics. 10 | * All rights reserved. 11 | * 12 | * This software is licensed under terms that can be found in the LICENSE file 13 | * in the root directory of this software component. 14 | * If no LICENSE file comes with this software, it is provided AS-IS. 15 | * 16 | ****************************************************************************** 17 | */ 18 | /* USER CODE END Header */ 19 | /* Includes ------------------------------------------------------------------*/ 20 | #include "main.h" 21 | #include "usb_device.h" 22 | #include "stdio.h" 23 | #include "../../STM32CubeIDE/Middlewares/USB_Device_Library/usbd_hid_ext.h" 24 | 25 | 26 | /* Private includes ----------------------------------------------------------*/ 27 | /* USER CODE BEGIN Includes */ 28 | 29 | /* USER CODE END Includes */ 30 | 31 | /* Private typedef -----------------------------------------------------------*/ 32 | /* USER CODE BEGIN PTD */ 33 | 34 | /* USER CODE END PTD */ 35 | 36 | /* Private define ------------------------------------------------------------*/ 37 | /* USER CODE BEGIN PD */ 38 | #define KEYBOARD //also need to define in usbd_hid.c! 39 | 40 | #define MOD_ALT_LEFT 0x04 41 | #define WINKEY_LEFT 0xE3 42 | #define ENTER 0x28 43 | #define SPACE 0x2C 44 | #define COMMA 0x36 45 | #define DOT 0x37 46 | #define K_A 0x04 47 | #define K_B 0x05 48 | #define K_C 0x06 49 | #define K_D 0x07 50 | #define K_E 0x08 51 | #define K_G 0x0A 52 | #define K_H 0x0B 53 | #define K_I 0x0C 54 | #define K_L 0x0F 55 | #define K_M 0x10 56 | #define K_N 0x11 57 | #define K_O 0x12 58 | #define K_P 0x13 59 | #define K_R 0x15 60 | #define K_S 0x16 61 | #define K_T 0x17 62 | #define K_U 0x18 63 | #define K_V 0x19 64 | #define K_W 0x1A 65 | 66 | #define K_F8 0x41 67 | #define CAPSLOCK 0x39 68 | /* USER CODE END PD */ 69 | 70 | /* Private macro -------------------------------------------------------------*/ 71 | /* USER CODE BEGIN PM */ 72 | 73 | /* USER CODE END PM */ 74 | 75 | /* Private variables ---------------------------------------------------------*/ 76 | ADC_HandleTypeDef hadc; 77 | 78 | /* USER CODE BEGIN PV */ 79 | volatile uint8_t capslock_; 80 | /* USER CODE END PV */ 81 | 82 | /* Private function prototypes -----------------------------------------------*/ 83 | void SystemClock_Config(void); 84 | static void MX_GPIO_Init(void); 85 | static void MX_ADC_Init(void); 86 | /* USER CODE BEGIN PFP */ 87 | extern USBD_HandleTypeDef hUsbDeviceFS; 88 | void Keyboard_SendChars(uint8_t mod, uint8_t *buf); 89 | void Keyboard_SendSingleChar(uint8_t mod, uint8_t val); 90 | void Keyboard_SendHelloWorld(); 91 | void Keyboard_WaitCapsLock(); 92 | void Keyboard_ShowPassword(); 93 | void Keyboard_TestADC(); 94 | 95 | typedef struct 96 | { 97 | uint8_t MODIFIER; 98 | uint8_t RESERVED; 99 | uint8_t KEYCODE1; 100 | uint8_t KEYCODE2; 101 | uint8_t KEYCODE3; 102 | uint8_t KEYCODE4; 103 | uint8_t KEYCODE5; 104 | uint8_t KEYCODE6; 105 | } kbdHID; 106 | 107 | kbdHID keyboardHID = {0,0,0,0,0,0,0,0}; 108 | /* USER CODE END PFP */ 109 | 110 | /* Private user code ---------------------------------------------------------*/ 111 | /* USER CODE BEGIN 0 */ 112 | void Keyboard_SendChars(uint8_t mod, uint8_t *buf) 113 | { 114 | keyboardHID.MODIFIER = mod; 115 | keyboardHID.KEYCODE1 = buf[0]; 116 | keyboardHID.KEYCODE2 = buf[1]; 117 | keyboardHID.KEYCODE3 = buf[2]; 118 | keyboardHID.KEYCODE4 = buf[3]; 119 | keyboardHID.KEYCODE5 = buf[4]; 120 | keyboardHID.KEYCODE6 = buf[5]; 121 | USBD_HID_SendReport(&hUsbDeviceFS, &keyboardHID, sizeof (keyboardHID)); 122 | HAL_Delay (50); 123 | 124 | //release 125 | keyboardHID.MODIFIER = 0x00; 126 | keyboardHID.KEYCODE1 = 0x00; 127 | keyboardHID.KEYCODE2 = 0x00; 128 | keyboardHID.KEYCODE3 = 0x00; 129 | keyboardHID.KEYCODE4 = 0x00; 130 | keyboardHID.KEYCODE5 = 0x00; 131 | keyboardHID.KEYCODE6 = 0x00; 132 | USBD_HID_SendReport(&hUsbDeviceFS, &keyboardHID, sizeof (keyboardHID)); 133 | HAL_Delay (50); 134 | } 135 | 136 | void Keyboard_SendSingleChar(uint8_t mod, uint8_t val) 137 | { 138 | keyboardHID.MODIFIER = mod; 139 | keyboardHID.KEYCODE1 = val; 140 | USBD_HID_SendReport(&hUsbDeviceFS, &keyboardHID, sizeof (keyboardHID)); 141 | HAL_Delay (50); 142 | 143 | keyboardHID.MODIFIER = 0; 144 | keyboardHID.KEYCODE1 = 0; 145 | USBD_HID_SendReport(&hUsbDeviceFS, &keyboardHID, sizeof (keyboardHID)); 146 | HAL_Delay(50); 147 | } 148 | 149 | //open terminal and send hello world 150 | void Keyboard_SendHelloWorld() 151 | { 152 | uint8_t buf[6] = {0,0,0,0,0,0}; 153 | //winkey+r to open run utility 154 | buf[0] = WINKEY_LEFT; buf[1] = K_R; 155 | Keyboard_SendChars(0,buf); 156 | HAL_Delay(100); 157 | //open command prompt 158 | buf[0] = K_C; buf[1] = K_M; buf[2] = K_D; buf[3] = ENTER; 159 | Keyboard_SendChars(0,buf); 160 | HAL_Delay(600); 161 | buf[0] = K_E; buf[1] = K_C; buf[2] = K_H; buf[3] = K_O; buf[4] = SPACE; 162 | Keyboard_SendChars(0,buf); 163 | buf[0] = K_H; buf[1] = K_E; buf[2] = K_L; buf[3] = 0x00; buf[4] = 0x00; 164 | Keyboard_SendChars(0,buf); 165 | buf[0] = K_L; buf[1] = K_O; buf[2] = SPACE; 166 | Keyboard_SendChars(0,buf); 167 | buf[0] = K_W; buf[1] = K_O; buf[2] = K_R; buf[3] = K_L; buf[4] = K_D; buf[5] = ENTER; 168 | Keyboard_SendChars(0,buf); 169 | } 170 | 171 | //check that PC is unlocked before executing by setting capslock and waiting for user to turn it off 172 | void Keyboard_WaitCapsLock() 173 | { 174 | //try to set capslock until it succeeds 175 | while(capslock_==0) { 176 | Keyboard_SendSingleChar(0x00, CAPSLOCK); 177 | HAL_Delay(1000); 178 | } 179 | while(capslock_==1); //wait here for user to turn off capslock 180 | HAL_Delay(2000); 181 | } 182 | 183 | //send ALT+F8 shortcut to display passwords being typed in 184 | void Keyboard_ShowPassword() 185 | { 186 | keyboardHID.MODIFIER = MOD_ALT_LEFT; 187 | keyboardHID.KEYCODE1 = K_F8; 188 | USBD_HID_SendReport(&hUsbDeviceFS, &keyboardHID, sizeof (keyboardHID)); 189 | HAL_Delay (250); 190 | 191 | keyboardHID.MODIFIER = 0; 192 | keyboardHID.KEYCODE1 = 0; 193 | USBD_HID_SendReport(&hUsbDeviceFS, &keyboardHID, sizeof (keyboardHID)); 194 | HAL_Delay(50); 195 | } 196 | 197 | //send current ADC value over USB 198 | void Keyboard_TestADC() 199 | { 200 | uint8_t buf[6] = {0,0,0,0,0,0}; 201 | uint16_t adc_val = 0; 202 | char adc_str[6]; 203 | HAL_ADC_Start(&hadc); 204 | HAL_ADC_PollForConversion(&hadc,100); 205 | adc_val = HAL_ADC_GetValue(&hadc); 206 | HAL_ADC_Stop(&hadc); 207 | sprintf(adc_str, "%04d", adc_val); 208 | for(uint8_t i=0;i<4;i++){ 209 | if(adc_str[i]==0x30) buf[i]=0x27; //zero case 210 | else buf[i] = adc_str[i] - 0x13; //translate other digits from ASCII to HID 211 | Keyboard_SendSingleChar(0,buf[i]); 212 | } 213 | Keyboard_SendSingleChar(0,ENTER); 214 | HAL_Delay(1000); 215 | } 216 | /* USER CODE END 0 */ 217 | 218 | /** 219 | * @brief The application entry point. 220 | * @retval int 221 | */ 222 | int main(void) 223 | { 224 | 225 | /* USER CODE BEGIN 1 */ 226 | 227 | /* USER CODE END 1 */ 228 | 229 | /* MCU Configuration--------------------------------------------------------*/ 230 | 231 | /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ 232 | HAL_Init(); 233 | 234 | /* USER CODE BEGIN Init */ 235 | 236 | /* USER CODE END Init */ 237 | 238 | /* Configure the system clock */ 239 | SystemClock_Config(); 240 | 241 | /* USER CODE BEGIN SysInit */ 242 | capslock_ = 0; 243 | /* USER CODE END SysInit */ 244 | 245 | /* Initialize all configured peripherals */ 246 | MX_GPIO_Init(); 247 | MX_USB_DEVICE_Init(); 248 | MX_ADC_Init(); 249 | /* USER CODE BEGIN 2 */ 250 | HAL_Delay(3000); 251 | Keyboard_WaitCapsLock(); 252 | //HAL_Delay(10000); 253 | 254 | //get reference ADC value without IR by averaging 16 ADC readings over first 8 seconds 255 | uint16_t adc_val_ini = 0; 256 | for(uint8_t i = 0; i<16; i++) { 257 | HAL_Delay(500); 258 | HAL_ADC_Start(&hadc); 259 | HAL_ADC_PollForConversion(&hadc,100); 260 | adc_val_ini += HAL_ADC_GetValue(&hadc) >> 4; 261 | HAL_ADC_Stop(&hadc); 262 | } 263 | /* USER CODE END 2 */ 264 | 265 | /* Infinite loop */ 266 | /* USER CODE BEGIN WHILE */ 267 | while (1) 268 | { 269 | HAL_ADC_Start(&hadc); 270 | HAL_ADC_PollForConversion(&hadc,100); 271 | //default ADC value seems to sink quite a bit from initial during use, presumably 272 | //due to temperature dependence of the photodiodes - so subtract 200 from initial value 273 | //to use as reference 274 | if(HAL_ADC_GetValue(&hadc) < (adc_val_ini - 200)) { 275 | Keyboard_SendHelloWorld(); 276 | //Keyboard_ShowPassword(); 277 | } 278 | HAL_Delay(500); 279 | /* USER CODE END WHILE */ 280 | 281 | /* USER CODE BEGIN 3 */ 282 | } 283 | /* USER CODE END 3 */ 284 | } 285 | 286 | /** 287 | * @brief System Clock Configuration 288 | * @retval None 289 | */ 290 | void SystemClock_Config(void) 291 | { 292 | RCC_OscInitTypeDef RCC_OscInitStruct = {0}; 293 | RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; 294 | RCC_PeriphCLKInitTypeDef PeriphClkInit = {0}; 295 | 296 | /** Initializes the RCC Oscillators according to the specified parameters 297 | * in the RCC_OscInitTypeDef structure. 298 | */ 299 | RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI14|RCC_OSCILLATORTYPE_HSI48; 300 | RCC_OscInitStruct.HSI48State = RCC_HSI48_ON; 301 | RCC_OscInitStruct.HSI14State = RCC_HSI14_ON; 302 | RCC_OscInitStruct.HSI14CalibrationValue = 16; 303 | RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; 304 | if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) 305 | { 306 | Error_Handler(); 307 | } 308 | 309 | /** Initializes the CPU, AHB and APB buses clocks 310 | */ 311 | RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK 312 | |RCC_CLOCKTYPE_PCLK1; 313 | RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI48; 314 | RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; 315 | RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; 316 | 317 | if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) 318 | { 319 | Error_Handler(); 320 | } 321 | PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USB; 322 | PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_HSI48; 323 | 324 | if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) 325 | { 326 | Error_Handler(); 327 | } 328 | } 329 | 330 | /** 331 | * @brief ADC Initialization Function 332 | * @param None 333 | * @retval None 334 | */ 335 | static void MX_ADC_Init(void) 336 | { 337 | 338 | /* USER CODE BEGIN ADC_Init 0 */ 339 | 340 | /* USER CODE END ADC_Init 0 */ 341 | 342 | ADC_ChannelConfTypeDef sConfig = {0}; 343 | 344 | /* USER CODE BEGIN ADC_Init 1 */ 345 | 346 | /* USER CODE END ADC_Init 1 */ 347 | 348 | /** Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion) 349 | */ 350 | hadc.Instance = ADC1; 351 | hadc.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV1; 352 | hadc.Init.Resolution = ADC_RESOLUTION_12B; 353 | hadc.Init.DataAlign = ADC_DATAALIGN_RIGHT; 354 | hadc.Init.ScanConvMode = ADC_SCAN_DIRECTION_FORWARD; 355 | hadc.Init.EOCSelection = ADC_EOC_SINGLE_CONV; 356 | hadc.Init.LowPowerAutoWait = DISABLE; 357 | hadc.Init.LowPowerAutoPowerOff = DISABLE; 358 | hadc.Init.ContinuousConvMode = DISABLE; 359 | hadc.Init.DiscontinuousConvMode = DISABLE; 360 | hadc.Init.ExternalTrigConv = ADC_SOFTWARE_START; 361 | hadc.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; 362 | hadc.Init.DMAContinuousRequests = DISABLE; 363 | hadc.Init.Overrun = ADC_OVR_DATA_PRESERVED; 364 | if (HAL_ADC_Init(&hadc) != HAL_OK) 365 | { 366 | Error_Handler(); 367 | } 368 | 369 | /** Configure for the selected ADC regular channel to be converted. 370 | */ 371 | sConfig.Channel = ADC_CHANNEL_8; 372 | sConfig.Rank = ADC_RANK_CHANNEL_NUMBER; 373 | sConfig.SamplingTime = ADC_SAMPLETIME_1CYCLE_5; 374 | if (HAL_ADC_ConfigChannel(&hadc, &sConfig) != HAL_OK) 375 | { 376 | Error_Handler(); 377 | } 378 | /* USER CODE BEGIN ADC_Init 2 */ 379 | 380 | /* USER CODE END ADC_Init 2 */ 381 | 382 | } 383 | 384 | /** 385 | * @brief GPIO Initialization Function 386 | * @param None 387 | * @retval None 388 | */ 389 | static void MX_GPIO_Init(void) 390 | { 391 | /* USER CODE BEGIN MX_GPIO_Init_1 */ 392 | /* USER CODE END MX_GPIO_Init_1 */ 393 | 394 | /* GPIO Ports Clock Enable */ 395 | __HAL_RCC_GPIOB_CLK_ENABLE(); 396 | __HAL_RCC_GPIOA_CLK_ENABLE(); 397 | 398 | /* USER CODE BEGIN MX_GPIO_Init_2 */ 399 | /* USER CODE END MX_GPIO_Init_2 */ 400 | } 401 | 402 | /* USER CODE BEGIN 4 */ 403 | 404 | /* USER CODE END 4 */ 405 | 406 | /** 407 | * @brief This function is executed in case of error occurrence. 408 | * @retval None 409 | */ 410 | void Error_Handler(void) 411 | { 412 | /* USER CODE BEGIN Error_Handler_Debug */ 413 | /* User can add his own implementation to report the HAL error return state */ 414 | __disable_irq(); 415 | while (1) 416 | { 417 | } 418 | /* USER CODE END Error_Handler_Debug */ 419 | } 420 | 421 | #ifdef USE_FULL_ASSERT 422 | /** 423 | * @brief Reports the name of the source file and the source line number 424 | * where the assert_param error has occurred. 425 | * @param file: pointer to the source file name 426 | * @param line: assert_param error line source number 427 | * @retval None 428 | */ 429 | void assert_failed(uint8_t *file, uint32_t line) 430 | { 431 | /* USER CODE BEGIN 6 */ 432 | /* User can add his own implementation to report the file name and line number, 433 | ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ 434 | /* USER CODE END 6 */ 435 | } 436 | #endif /* USE_FULL_ASSERT */ 437 | -------------------------------------------------------------------------------- /STM32/Core/Src/stm32f0xx_hal_msp.c: -------------------------------------------------------------------------------- 1 | 2 | /* USER CODE BEGIN Header */ 3 | /** 4 | ****************************************************************************** 5 | * @file stm32f0xx_hal_msp.c 6 | * @brief This file provides code for the MSP Initialization 7 | * and de-Initialization codes. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | * Copyright (c) 2025 STMicroelectronics. 12 | * All rights reserved. 13 | * 14 | * This software is licensed under terms that can be found in the LICENSE file 15 | * in the root directory of this software component. 16 | * If no LICENSE file comes with this software, it is provided AS-IS. 17 | * 18 | ****************************************************************************** 19 | */ 20 | /* USER CODE END Header */ 21 | 22 | /* Includes ------------------------------------------------------------------*/ 23 | #include "main.h" 24 | /* USER CODE BEGIN Includes */ 25 | 26 | /* USER CODE END Includes */ 27 | 28 | /* Private typedef -----------------------------------------------------------*/ 29 | /* USER CODE BEGIN TD */ 30 | 31 | /* USER CODE END TD */ 32 | 33 | /* Private define ------------------------------------------------------------*/ 34 | /* USER CODE BEGIN Define */ 35 | 36 | /* USER CODE END Define */ 37 | 38 | /* Private macro -------------------------------------------------------------*/ 39 | /* USER CODE BEGIN Macro */ 40 | 41 | /* USER CODE END Macro */ 42 | 43 | /* Private variables ---------------------------------------------------------*/ 44 | /* USER CODE BEGIN PV */ 45 | 46 | /* USER CODE END PV */ 47 | 48 | /* Private function prototypes -----------------------------------------------*/ 49 | /* USER CODE BEGIN PFP */ 50 | 51 | /* USER CODE END PFP */ 52 | 53 | /* External functions --------------------------------------------------------*/ 54 | /* USER CODE BEGIN ExternalFunctions */ 55 | 56 | /* USER CODE END ExternalFunctions */ 57 | 58 | /* USER CODE BEGIN 0 */ 59 | 60 | /* USER CODE END 0 */ 61 | /** 62 | * Initializes the Global MSP. 63 | */ 64 | void HAL_MspInit(void) 65 | { 66 | 67 | /* USER CODE BEGIN MspInit 0 */ 68 | 69 | /* USER CODE END MspInit 0 */ 70 | 71 | __HAL_RCC_SYSCFG_CLK_ENABLE(); 72 | __HAL_RCC_PWR_CLK_ENABLE(); 73 | 74 | /* System interrupt init*/ 75 | 76 | __HAL_REMAP_PIN_ENABLE(HAL_REMAP_PA11_PA12); 77 | 78 | /* USER CODE BEGIN MspInit 1 */ 79 | 80 | /* USER CODE END MspInit 1 */ 81 | } 82 | 83 | /** 84 | * @brief ADC MSP Initialization 85 | * This function configures the hardware resources used in this example 86 | * @param hadc: ADC handle pointer 87 | * @retval None 88 | */ 89 | void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc) 90 | { 91 | GPIO_InitTypeDef GPIO_InitStruct = {0}; 92 | if(hadc->Instance==ADC1) 93 | { 94 | /* USER CODE BEGIN ADC1_MspInit 0 */ 95 | 96 | /* USER CODE END ADC1_MspInit 0 */ 97 | /* Peripheral clock enable */ 98 | __HAL_RCC_ADC1_CLK_ENABLE(); 99 | 100 | __HAL_RCC_GPIOB_CLK_ENABLE(); 101 | /**ADC GPIO Configuration 102 | PB0 ------> ADC_IN8 103 | */ 104 | GPIO_InitStruct.Pin = GPIO_PIN_0; 105 | GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; 106 | GPIO_InitStruct.Pull = GPIO_NOPULL; 107 | HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); 108 | 109 | /* ADC1 interrupt Init */ 110 | HAL_NVIC_SetPriority(ADC1_IRQn, 0, 0); 111 | HAL_NVIC_EnableIRQ(ADC1_IRQn); 112 | /* USER CODE BEGIN ADC1_MspInit 1 */ 113 | 114 | /* USER CODE END ADC1_MspInit 1 */ 115 | 116 | } 117 | 118 | } 119 | 120 | /** 121 | * @brief ADC MSP De-Initialization 122 | * This function freeze the hardware resources used in this example 123 | * @param hadc: ADC handle pointer 124 | * @retval None 125 | */ 126 | void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc) 127 | { 128 | if(hadc->Instance==ADC1) 129 | { 130 | /* USER CODE BEGIN ADC1_MspDeInit 0 */ 131 | 132 | /* USER CODE END ADC1_MspDeInit 0 */ 133 | /* Peripheral clock disable */ 134 | __HAL_RCC_ADC1_CLK_DISABLE(); 135 | 136 | /**ADC GPIO Configuration 137 | PB0 ------> ADC_IN8 138 | */ 139 | HAL_GPIO_DeInit(GPIOB, GPIO_PIN_0); 140 | 141 | /* ADC1 interrupt DeInit */ 142 | HAL_NVIC_DisableIRQ(ADC1_IRQn); 143 | /* USER CODE BEGIN ADC1_MspDeInit 1 */ 144 | 145 | /* USER CODE END ADC1_MspDeInit 1 */ 146 | } 147 | 148 | } 149 | 150 | /* USER CODE BEGIN 1 */ 151 | 152 | /* USER CODE END 1 */ 153 | -------------------------------------------------------------------------------- /STM32/Core/Src/stm32f0xx_it.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32f0xx_it.c 5 | * @brief Interrupt Service Routines. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | * Copyright (c) 2025 STMicroelectronics. 10 | * All rights reserved. 11 | * 12 | * This software is licensed under terms that can be found in the LICENSE file 13 | * in the root directory of this software component. 14 | * If no LICENSE file comes with this software, it is provided AS-IS. 15 | * 16 | ****************************************************************************** 17 | */ 18 | /* USER CODE END Header */ 19 | 20 | /* Includes ------------------------------------------------------------------*/ 21 | #include "main.h" 22 | #include "stm32f0xx_it.h" 23 | /* Private includes ----------------------------------------------------------*/ 24 | /* USER CODE BEGIN Includes */ 25 | /* USER CODE END Includes */ 26 | 27 | /* Private typedef -----------------------------------------------------------*/ 28 | /* USER CODE BEGIN TD */ 29 | 30 | /* USER CODE END TD */ 31 | 32 | /* Private define ------------------------------------------------------------*/ 33 | /* USER CODE BEGIN PD */ 34 | 35 | /* USER CODE END PD */ 36 | 37 | /* Private macro -------------------------------------------------------------*/ 38 | /* USER CODE BEGIN PM */ 39 | 40 | /* USER CODE END PM */ 41 | 42 | /* Private variables ---------------------------------------------------------*/ 43 | /* USER CODE BEGIN PV */ 44 | 45 | /* USER CODE END PV */ 46 | 47 | /* Private function prototypes -----------------------------------------------*/ 48 | /* USER CODE BEGIN PFP */ 49 | 50 | /* USER CODE END PFP */ 51 | 52 | /* Private user code ---------------------------------------------------------*/ 53 | /* USER CODE BEGIN 0 */ 54 | 55 | /* USER CODE END 0 */ 56 | 57 | /* External variables --------------------------------------------------------*/ 58 | extern PCD_HandleTypeDef hpcd_USB_FS; 59 | extern ADC_HandleTypeDef hadc; 60 | /* USER CODE BEGIN EV */ 61 | 62 | /* USER CODE END EV */ 63 | 64 | /******************************************************************************/ 65 | /* Cortex-M0 Processor Interruption and Exception Handlers */ 66 | /******************************************************************************/ 67 | /** 68 | * @brief This function handles Non maskable interrupt. 69 | */ 70 | void NMI_Handler(void) 71 | { 72 | /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ 73 | 74 | /* USER CODE END NonMaskableInt_IRQn 0 */ 75 | /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ 76 | while (1) 77 | { 78 | } 79 | /* USER CODE END NonMaskableInt_IRQn 1 */ 80 | } 81 | 82 | /** 83 | * @brief This function handles Hard fault interrupt. 84 | */ 85 | void HardFault_Handler(void) 86 | { 87 | /* USER CODE BEGIN HardFault_IRQn 0 */ 88 | 89 | /* USER CODE END HardFault_IRQn 0 */ 90 | while (1) 91 | { 92 | /* USER CODE BEGIN W1_HardFault_IRQn 0 */ 93 | /* USER CODE END W1_HardFault_IRQn 0 */ 94 | } 95 | } 96 | 97 | /** 98 | * @brief This function handles System service call via SWI instruction. 99 | */ 100 | void SVC_Handler(void) 101 | { 102 | /* USER CODE BEGIN SVC_IRQn 0 */ 103 | 104 | /* USER CODE END SVC_IRQn 0 */ 105 | /* USER CODE BEGIN SVC_IRQn 1 */ 106 | 107 | /* USER CODE END SVC_IRQn 1 */ 108 | } 109 | 110 | /** 111 | * @brief This function handles Pendable request for system service. 112 | */ 113 | void PendSV_Handler(void) 114 | { 115 | /* USER CODE BEGIN PendSV_IRQn 0 */ 116 | 117 | /* USER CODE END PendSV_IRQn 0 */ 118 | /* USER CODE BEGIN PendSV_IRQn 1 */ 119 | 120 | /* USER CODE END PendSV_IRQn 1 */ 121 | } 122 | 123 | /** 124 | * @brief This function handles System tick timer. 125 | */ 126 | void SysTick_Handler(void) 127 | { 128 | /* USER CODE BEGIN SysTick_IRQn 0 */ 129 | 130 | /* USER CODE END SysTick_IRQn 0 */ 131 | HAL_IncTick(); 132 | /* USER CODE BEGIN SysTick_IRQn 1 */ 133 | 134 | /* USER CODE END SysTick_IRQn 1 */ 135 | } 136 | 137 | /******************************************************************************/ 138 | /* STM32F0xx Peripheral Interrupt Handlers */ 139 | /* Add here the Interrupt Handlers for the used peripherals. */ 140 | /* For the available peripheral interrupt handler names, */ 141 | /* please refer to the startup file (startup_stm32f0xx.s). */ 142 | /******************************************************************************/ 143 | 144 | /** 145 | * @brief This function handles ADC interrupt. 146 | */ 147 | void ADC1_IRQHandler(void) 148 | { 149 | /* USER CODE BEGIN ADC1_IRQn 0 */ 150 | 151 | /* USER CODE END ADC1_IRQn 0 */ 152 | HAL_ADC_IRQHandler(&hadc); 153 | /* USER CODE BEGIN ADC1_IRQn 1 */ 154 | 155 | /* USER CODE END ADC1_IRQn 1 */ 156 | } 157 | 158 | /** 159 | * @brief This function handles USB global Interrupt / USB wake-up interrupt through EXTI line 18. 160 | */ 161 | void USB_IRQHandler(void) 162 | { 163 | /* USER CODE BEGIN USB_IRQn 0 */ 164 | 165 | /* USER CODE END USB_IRQn 0 */ 166 | HAL_PCD_IRQHandler(&hpcd_USB_FS); 167 | /* USER CODE BEGIN USB_IRQn 1 */ 168 | 169 | /* USER CODE END USB_IRQn 1 */ 170 | } 171 | 172 | /* USER CODE BEGIN 1 */ 173 | 174 | /* USER CODE END 1 */ 175 | -------------------------------------------------------------------------------- /STM32/Core/Src/system_stm32f0xx.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file system_stm32f0xx.c 4 | * @author MCD Application Team 5 | * @brief CMSIS Cortex-M0 Device Peripheral Access Layer System Source File. 6 | * 7 | * 1. This file provides two functions and one global variable to be called from 8 | * user application: 9 | * - SystemInit(): This function is called at startup just after reset and 10 | * before branch to main program. This call is made inside 11 | * the "startup_stm32f0xx.s" file. 12 | * 13 | * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used 14 | * by the user application to setup the SysTick 15 | * timer or configure other parameters. 16 | * 17 | * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must 18 | * be called whenever the core clock is changed 19 | * during program execution. 20 | * 21 | * 22 | ****************************************************************************** 23 | * @attention 24 | * 25 | * Copyright (c) 2016 STMicroelectronics. 26 | * All rights reserved. 27 | * 28 | * This software is licensed under terms that can be found in the LICENSE file 29 | * in the root directory of this software component. 30 | * If no LICENSE file comes with this software, it is provided AS-IS. 31 | * 32 | ****************************************************************************** 33 | */ 34 | /** @addtogroup CMSIS 35 | * @{ 36 | */ 37 | 38 | /** @addtogroup stm32f0xx_system 39 | * @{ 40 | */ 41 | 42 | /** @addtogroup STM32F0xx_System_Private_Includes 43 | * @{ 44 | */ 45 | 46 | #include "stm32f0xx.h" 47 | 48 | /** 49 | * @} 50 | */ 51 | 52 | /** @addtogroup STM32F0xx_System_Private_TypesDefinitions 53 | * @{ 54 | */ 55 | 56 | /** 57 | * @} 58 | */ 59 | 60 | /** @addtogroup STM32F0xx_System_Private_Defines 61 | * @{ 62 | */ 63 | #if !defined (HSE_VALUE) 64 | #define HSE_VALUE ((uint32_t)8000000) /*!< Default value of the External oscillator in Hz. 65 | This value can be provided and adapted by the user application. */ 66 | #endif /* HSE_VALUE */ 67 | 68 | #if !defined (HSI_VALUE) 69 | #define HSI_VALUE ((uint32_t)8000000) /*!< Default value of the Internal oscillator in Hz. 70 | This value can be provided and adapted by the user application. */ 71 | #endif /* HSI_VALUE */ 72 | 73 | #if !defined (HSI48_VALUE) 74 | #define HSI48_VALUE ((uint32_t)48000000) /*!< Default value of the HSI48 Internal oscillator in Hz. 75 | This value can be provided and adapted by the user application. */ 76 | #endif /* HSI48_VALUE */ 77 | /** 78 | * @} 79 | */ 80 | 81 | /** @addtogroup STM32F0xx_System_Private_Macros 82 | * @{ 83 | */ 84 | 85 | /** 86 | * @} 87 | */ 88 | 89 | /** @addtogroup STM32F0xx_System_Private_Variables 90 | * @{ 91 | */ 92 | /* This variable is updated in three ways: 93 | 1) by calling CMSIS function SystemCoreClockUpdate() 94 | 2) by calling HAL API function HAL_RCC_GetHCLKFreq() 95 | 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency 96 | Note: If you use this function to configure the system clock; then there 97 | is no need to call the 2 first functions listed above, since SystemCoreClock 98 | variable is updated automatically. 99 | */ 100 | uint32_t SystemCoreClock = 8000000; 101 | 102 | const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; 103 | const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; 104 | 105 | /** 106 | * @} 107 | */ 108 | 109 | /** @addtogroup STM32F0xx_System_Private_FunctionPrototypes 110 | * @{ 111 | */ 112 | 113 | /** 114 | * @} 115 | */ 116 | 117 | /** @addtogroup STM32F0xx_System_Private_Functions 118 | * @{ 119 | */ 120 | 121 | /** 122 | * @brief Setup the microcontroller system 123 | * @param None 124 | * @retval None 125 | */ 126 | void SystemInit(void) 127 | { 128 | /* NOTE :SystemInit(): This function is called at startup just after reset and 129 | before branch to main program. This call is made inside 130 | the "startup_stm32f0xx.s" file. 131 | User can setups the default system clock (System clock source, PLL Multiplier 132 | and Divider factors, AHB/APBx prescalers and Flash settings). 133 | */ 134 | } 135 | 136 | /** 137 | * @brief Update SystemCoreClock variable according to Clock Register Values. 138 | * The SystemCoreClock variable contains the core clock (HCLK), it can 139 | * be used by the user application to setup the SysTick timer or configure 140 | * other parameters. 141 | * 142 | * @note Each time the core clock (HCLK) changes, this function must be called 143 | * to update SystemCoreClock variable value. Otherwise, any configuration 144 | * based on this variable will be incorrect. 145 | * 146 | * @note - The system frequency computed by this function is not the real 147 | * frequency in the chip. It is calculated based on the predefined 148 | * constant and the selected clock source: 149 | * 150 | * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*) 151 | * 152 | * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**) 153 | * 154 | * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) 155 | * or HSI_VALUE(*) multiplied/divided by the PLL factors. 156 | * 157 | * - If SYSCLK source is HSI48, SystemCoreClock will contain the HSI48_VALUE(***) 158 | * 159 | * (*) HSI_VALUE is a constant defined in stm32f0xx_hal_conf.h file (default value 160 | * 8 MHz) but the real value may vary depending on the variations 161 | * in voltage and temperature. 162 | * 163 | * (**) HSE_VALUE is a constant defined in stm32f0xx_hal_conf.h file (its value 164 | * depends on the application requirements), user has to ensure that HSE_VALUE 165 | * is same as the real frequency of the crystal used. Otherwise, this function 166 | * may have wrong result. 167 | * 168 | * (***) HSI48_VALUE is a constant defined in stm32f0xx_hal_conf.h file (default value 169 | * 48 MHz) but the real value may vary depending on the variations 170 | * in voltage and temperature. 171 | * 172 | * - The result of this function could be not correct when using fractional 173 | * value for HSE crystal. 174 | * 175 | * @param None 176 | * @retval None 177 | */ 178 | void SystemCoreClockUpdate (void) 179 | { 180 | uint32_t tmp = 0, pllmull = 0, pllsource = 0, predivfactor = 0; 181 | 182 | /* Get SYSCLK source -------------------------------------------------------*/ 183 | tmp = RCC->CFGR & RCC_CFGR_SWS; 184 | 185 | switch (tmp) 186 | { 187 | case RCC_CFGR_SWS_HSI: /* HSI used as system clock */ 188 | SystemCoreClock = HSI_VALUE; 189 | break; 190 | case RCC_CFGR_SWS_HSE: /* HSE used as system clock */ 191 | SystemCoreClock = HSE_VALUE; 192 | break; 193 | case RCC_CFGR_SWS_PLL: /* PLL used as system clock */ 194 | /* Get PLL clock source and multiplication factor ----------------------*/ 195 | pllmull = RCC->CFGR & RCC_CFGR_PLLMUL; 196 | pllsource = RCC->CFGR & RCC_CFGR_PLLSRC; 197 | pllmull = ( pllmull >> 18) + 2; 198 | predivfactor = (RCC->CFGR2 & RCC_CFGR2_PREDIV) + 1; 199 | 200 | if (pllsource == RCC_CFGR_PLLSRC_HSE_PREDIV) 201 | { 202 | /* HSE used as PLL clock source : SystemCoreClock = HSE/PREDIV * PLLMUL */ 203 | SystemCoreClock = (HSE_VALUE/predivfactor) * pllmull; 204 | } 205 | #if defined(STM32F042x6) || defined(STM32F048xx) || defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx) 206 | else if (pllsource == RCC_CFGR_PLLSRC_HSI48_PREDIV) 207 | { 208 | /* HSI48 used as PLL clock source : SystemCoreClock = HSI48/PREDIV * PLLMUL */ 209 | SystemCoreClock = (HSI48_VALUE/predivfactor) * pllmull; 210 | } 211 | #endif /* STM32F042x6 || STM32F048xx || STM32F071xB || STM32F072xB || STM32F078xx || STM32F091xC || STM32F098xx */ 212 | else 213 | { 214 | #if defined(STM32F042x6) || defined(STM32F048xx) || defined(STM32F070x6) \ 215 | || defined(STM32F078xx) || defined(STM32F071xB) || defined(STM32F072xB) \ 216 | || defined(STM32F070xB) || defined(STM32F091xC) || defined(STM32F098xx) || defined(STM32F030xC) 217 | /* HSI used as PLL clock source : SystemCoreClock = HSI/PREDIV * PLLMUL */ 218 | SystemCoreClock = (HSI_VALUE/predivfactor) * pllmull; 219 | #else 220 | /* HSI used as PLL clock source : SystemCoreClock = HSI/2 * PLLMUL */ 221 | SystemCoreClock = (HSI_VALUE >> 1) * pllmull; 222 | #endif /* STM32F042x6 || STM32F048xx || STM32F070x6 || 223 | STM32F071xB || STM32F072xB || STM32F078xx || STM32F070xB || 224 | STM32F091xC || STM32F098xx || STM32F030xC */ 225 | } 226 | break; 227 | default: /* HSI used as system clock */ 228 | SystemCoreClock = HSI_VALUE; 229 | break; 230 | } 231 | /* Compute HCLK clock frequency ----------------*/ 232 | /* Get HCLK prescaler */ 233 | tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)]; 234 | /* HCLK clock frequency */ 235 | SystemCoreClock >>= tmp; 236 | } 237 | 238 | /** 239 | * @} 240 | */ 241 | 242 | /** 243 | * @} 244 | */ 245 | 246 | /** 247 | * @} 248 | */ 249 | 250 | -------------------------------------------------------------------------------- /STM32/Debug/RubberDuckyHelloWorld.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enblack0/Hidden-HID-v2/4f44eee1a87c04dfad725e9ba3b24868d8b28b1a/STM32/Debug/RubberDuckyHelloWorld.elf -------------------------------------------------------------------------------- /STM32/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc/usbd_hid.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbd_hid.h 4 | * @author MCD Application Team 5 | * @brief Header file for the usbd_hid_core.c file. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *