├── assets ├── Bcu.png ├── Fcu.png ├── ldo.png ├── tof.png ├── HC08.png ├── as5600.png ├── gears.png ├── motor.png ├── mount.PNG ├── IR_mount.png ├── drv8833.png ├── others_1.png ├── Micromouse.PNG ├── motor_mount.png ├── mount_assem.PNG ├── mount_full.PNG ├── pcb_routing.png ├── tof_mount.png ├── 3d_pcb_render.png ├── IR_schematics.png ├── final_routing.png ├── ir_placement.png ├── pcb_notation.png ├── comp_placement.png ├── stm32f405rg_pinout.png └── mount_assem_transparent.PNG ├── pcb_design ├── BoM.xlsx ├── mushak_pcb.pdf ├── renders │ ├── mushak_pcb-B_Cu.pdf │ ├── mushak_pcb-F_Cu.pdf │ ├── mushak_pcb-B_Mask.pdf │ ├── mushak_pcb-B_Paste.pdf │ ├── mushak_pcb-F_Mask.pdf │ ├── mushak_pcb-F_Paste.pdf │ ├── mushak_pcb-Edge_Cuts.pdf │ ├── mushak_pcb-B_Silkscreen.pdf │ ├── mushak_pcb-F_Silkscreen.pdf │ ├── mushak_pcb-NPTH.drl │ └── mushak_pcb-PTH.drl ├── gerbers │ ├── mushak_pcb-gerbers.zip │ ├── mushak_pcb-NPTH.drl │ ├── mushak_pcb-job.gbrjob │ ├── mushak_pcb-top-pos.csv │ └── mushak_pcb-PTH.drl ├── component_libraries │ ├── AMS1117-3.3 │ │ ├── how-to-import.htm │ │ ├── SOT229P700X180-4N.kicad_mod │ │ ├── AMS1117-3.3.kicad_sym │ │ └── License.txt │ ├── AS5048B-HTSP │ │ ├── how-to-import.htm │ │ ├── AS5048B-HTSP.lib │ │ ├── SOP65P640X120-14N.kicad_mod │ │ └── License.txt │ ├── mushak_mount_footprint │ │ ├── STAND_SLAVE_06.kicad_mod │ │ ├── IR_SLAVE_04.kicad_mod │ │ ├── STAND_SLAVE_04.kicad_mod │ │ ├── IR_SLAVE_V_04.kicad_mod │ │ ├── New_Library.kicad_sym │ │ ├── STAND_HOST_06.kicad_mod │ │ ├── STAND_HOST_04.kicad_mod │ │ ├── IR_HOST_04.kicad_mod │ │ ├── IR_HOST_V_04.kicad_mod │ │ └── motor.kicad_mod │ ├── SMT-0440-T-R │ │ ├── SMT-0440-T-R.lib │ │ └── XDCR_SMT-0440-T-R.kicad_mod │ ├── TL1015AF160QG │ │ ├── TL1015AF160QG.lib │ │ └── SW_TL1015AF160QG.kicad_mod │ ├── ABS07-32.768KHZ-T │ │ ├── ABS07-32.768KHZ-T.lib │ │ └── XTAL_ABS07-32.768KHZ-T.kicad_mod │ ├── DRV8833PW │ │ ├── DRV8833PW.lib │ │ └── SOP65P640X120-16N.kicad_mod │ ├── SFH_4045N │ │ ├── SFH_4045N.lib │ │ └── LED_SFH_4045N.kicad_mod │ ├── SFH_3015_FA │ │ ├── SFH_3015_FA.lib │ │ └── XDCR_SFH_3015_FA.kicad_mod │ ├── AS5600-ASOT │ │ ├── AS5600-ASOT.lib │ │ └── SOIC127P600X175-8N.kicad_mod │ ├── DRV8833PWPR │ │ ├── DRV8833PWPR.lib │ │ └── IC_DRV8833PWPR.kicad_mod │ ├── SOT230P700X180-4N │ │ └── SOT230P700X180-4N.kicad_mod │ ├── MPU-6500 │ │ ├── MPU-6500.lib │ │ └── QFN40P300X300X95-25N.kicad_mod │ ├── VL53L0CXV0DH_1 │ │ ├── XDCR_VL53L0CXV0DH_1.kicad_mod │ │ └── VL53L0CXV0DH_1.kicad_sym │ └── STM32F407VGT6 │ │ └── STM32F407VGT6.lib ├── sym-lib-table ├── fp-lib-table ├── mushak_pcb-bottom-pos.csv └── mushak_pcb-top-pos.csv ├── cad_design ├── Extras │ ├── Assem24.SLDASM │ ├── Assem7.SLDASM │ ├── drv8833.SLDPRT │ ├── final.SLDASM │ ├── motor.SLDPRT │ ├── mpu6500.SLDPRT │ ├── wheels.SLDPRT │ ├── New_mount.SLDPRT │ ├── stm32f407.SLDPRT │ ├── Encoder_Base.SLDPRT │ ├── New_mount_2.SLDPRT │ ├── New_mount_R.SLDPRT │ ├── base_motor.SLDPRT │ ├── lipo_battery.SLDPRT │ ├── tof-set v2.SLDASM │ ├── New_mount_R_2.SLDPRT │ ├── New_mount_2_Hole.SLDPRT │ ├── photo-set v4 (1).SLDASM │ ├── sensors_placement.SLDPRT │ └── LICENSE └── Final_Assembly │ ├── Assem2.SLDASM │ ├── Final_New.SLDASM │ ├── PCB_Assem.SLDASM │ ├── mpu6500.SLDPRT │ ├── mushak_ir.SLDPRT │ ├── New_mount_2.SLDPRT │ ├── SpurPinion.SLDPRT │ ├── mushak_rims.SLDPRT │ ├── mushak_stm.SLDPRT │ ├── tof-set v2.SLDPRT │ ├── New_mount_R_2.SLDPRT │ ├── SpurGear (1).SLDPRT │ ├── mushak_Wheel.SLDASM │ ├── mushak_battery.SLDPRT │ ├── mushak_chassis.SLDPRT │ ├── mushak_motor.SLDPRT │ ├── mushak_shaft.SLDPRT │ ├── mushak_wheels.SLDPRT │ ├── photo-set v4 (1).SLDPRT │ ├── Board_Encoder.step.SLDPRT │ ├── mushak_motor_base.SLDPRT │ └── KERISE v5 mouse v128.SLDASM ├── firmware ├── Middlewares │ └── Third_Party │ │ └── FreeRTOS │ │ └── Source │ │ ├── CMSIS_RTOS │ │ ├── cmsis_os.c │ │ └── cmsis_os.h │ │ ├── LICENSE │ │ └── include │ │ └── projdefs.h ├── Drivers │ ├── Pwm │ │ └── pwm.h │ ├── CMSIS │ │ ├── Device │ │ │ └── ST │ │ │ │ └── STM32F4xx │ │ │ │ ├── LICENSE.txt │ │ │ │ └── Include │ │ │ │ └── system_stm32f4xx.h │ │ └── Include │ │ │ ├── cmsis_version.h │ │ │ └── tz_context.h │ ├── STM32F4xx_HAL_Driver │ │ ├── LICENSE.txt │ │ └── Inc │ │ │ ├── stm32f4xx_hal_flash_ramfunc.h │ │ │ ├── stm32f4xx_hal_dma_ex.h │ │ │ └── stm32f4xx_hal_i2c_ex.h │ ├── Adc │ │ ├── adc.h │ │ └── adc.c │ ├── Drv8833 │ │ ├── drv8833.h │ │ └── drv8833.c │ ├── Logger │ │ ├── log.c │ │ └── log.h │ └── Mpu6500 │ │ └── mpu6500.h ├── LICENSE └── Core │ ├── Inc │ ├── gpio.h │ ├── i2c.h │ ├── stm32f4xx_it.h │ └── main.h │ └── Src │ ├── stm32f4xx_hal_msp.c │ ├── gpio.c │ ├── freertos.c │ ├── stm32f4xx_hal_timebase_tim.c │ └── stm32f4xx_it.c ├── LICENSE └── .gitignore /assets/Bcu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/Bcu.png -------------------------------------------------------------------------------- /assets/Fcu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/Fcu.png -------------------------------------------------------------------------------- /assets/ldo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/ldo.png -------------------------------------------------------------------------------- /assets/tof.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/tof.png -------------------------------------------------------------------------------- /assets/HC08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/HC08.png -------------------------------------------------------------------------------- /assets/as5600.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/as5600.png -------------------------------------------------------------------------------- /assets/gears.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/gears.png -------------------------------------------------------------------------------- /assets/motor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/motor.png -------------------------------------------------------------------------------- /assets/mount.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/mount.PNG -------------------------------------------------------------------------------- /assets/IR_mount.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/IR_mount.png -------------------------------------------------------------------------------- /assets/drv8833.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/drv8833.png -------------------------------------------------------------------------------- /assets/others_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/others_1.png -------------------------------------------------------------------------------- /pcb_design/BoM.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/pcb_design/BoM.xlsx -------------------------------------------------------------------------------- /assets/Micromouse.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/Micromouse.PNG -------------------------------------------------------------------------------- /assets/motor_mount.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/motor_mount.png -------------------------------------------------------------------------------- /assets/mount_assem.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/mount_assem.PNG -------------------------------------------------------------------------------- /assets/mount_full.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/mount_full.PNG -------------------------------------------------------------------------------- /assets/pcb_routing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/pcb_routing.png -------------------------------------------------------------------------------- /assets/tof_mount.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/tof_mount.png -------------------------------------------------------------------------------- /assets/3d_pcb_render.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/3d_pcb_render.png -------------------------------------------------------------------------------- /assets/IR_schematics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/IR_schematics.png -------------------------------------------------------------------------------- /assets/final_routing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/final_routing.png -------------------------------------------------------------------------------- /assets/ir_placement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/ir_placement.png -------------------------------------------------------------------------------- /assets/pcb_notation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/pcb_notation.png -------------------------------------------------------------------------------- /assets/comp_placement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/comp_placement.png -------------------------------------------------------------------------------- /pcb_design/mushak_pcb.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/pcb_design/mushak_pcb.pdf -------------------------------------------------------------------------------- /assets/stm32f405rg_pinout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/stm32f405rg_pinout.png -------------------------------------------------------------------------------- /cad_design/Extras/Assem24.SLDASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Extras/Assem24.SLDASM -------------------------------------------------------------------------------- /cad_design/Extras/Assem7.SLDASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Extras/Assem7.SLDASM -------------------------------------------------------------------------------- /cad_design/Extras/drv8833.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Extras/drv8833.SLDPRT -------------------------------------------------------------------------------- /cad_design/Extras/final.SLDASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Extras/final.SLDASM -------------------------------------------------------------------------------- /cad_design/Extras/motor.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Extras/motor.SLDPRT -------------------------------------------------------------------------------- /cad_design/Extras/mpu6500.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Extras/mpu6500.SLDPRT -------------------------------------------------------------------------------- /cad_design/Extras/wheels.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Extras/wheels.SLDPRT -------------------------------------------------------------------------------- /assets/mount_assem_transparent.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/assets/mount_assem_transparent.PNG -------------------------------------------------------------------------------- /cad_design/Extras/New_mount.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Extras/New_mount.SLDPRT -------------------------------------------------------------------------------- /cad_design/Extras/stm32f407.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Extras/stm32f407.SLDPRT -------------------------------------------------------------------------------- /cad_design/Extras/Encoder_Base.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Extras/Encoder_Base.SLDPRT -------------------------------------------------------------------------------- /cad_design/Extras/New_mount_2.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Extras/New_mount_2.SLDPRT -------------------------------------------------------------------------------- /cad_design/Extras/New_mount_R.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Extras/New_mount_R.SLDPRT -------------------------------------------------------------------------------- /cad_design/Extras/base_motor.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Extras/base_motor.SLDPRT -------------------------------------------------------------------------------- /cad_design/Extras/lipo_battery.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Extras/lipo_battery.SLDPRT -------------------------------------------------------------------------------- /cad_design/Extras/tof-set v2.SLDASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Extras/tof-set v2.SLDASM -------------------------------------------------------------------------------- /cad_design/Extras/New_mount_R_2.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Extras/New_mount_R_2.SLDPRT -------------------------------------------------------------------------------- /cad_design/Final_Assembly/Assem2.SLDASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Final_Assembly/Assem2.SLDASM -------------------------------------------------------------------------------- /pcb_design/renders/mushak_pcb-B_Cu.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/pcb_design/renders/mushak_pcb-B_Cu.pdf -------------------------------------------------------------------------------- /pcb_design/renders/mushak_pcb-F_Cu.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/pcb_design/renders/mushak_pcb-F_Cu.pdf -------------------------------------------------------------------------------- /cad_design/Extras/New_mount_2_Hole.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Extras/New_mount_2_Hole.SLDPRT -------------------------------------------------------------------------------- /cad_design/Extras/photo-set v4 (1).SLDASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Extras/photo-set v4 (1).SLDASM -------------------------------------------------------------------------------- /cad_design/Extras/sensors_placement.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Extras/sensors_placement.SLDPRT -------------------------------------------------------------------------------- /cad_design/Final_Assembly/Final_New.SLDASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Final_Assembly/Final_New.SLDASM -------------------------------------------------------------------------------- /cad_design/Final_Assembly/PCB_Assem.SLDASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Final_Assembly/PCB_Assem.SLDASM -------------------------------------------------------------------------------- /cad_design/Final_Assembly/mpu6500.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Final_Assembly/mpu6500.SLDPRT -------------------------------------------------------------------------------- /cad_design/Final_Assembly/mushak_ir.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Final_Assembly/mushak_ir.SLDPRT -------------------------------------------------------------------------------- /pcb_design/gerbers/mushak_pcb-gerbers.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/pcb_design/gerbers/mushak_pcb-gerbers.zip -------------------------------------------------------------------------------- /pcb_design/renders/mushak_pcb-B_Mask.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/pcb_design/renders/mushak_pcb-B_Mask.pdf -------------------------------------------------------------------------------- /pcb_design/renders/mushak_pcb-B_Paste.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/pcb_design/renders/mushak_pcb-B_Paste.pdf -------------------------------------------------------------------------------- /pcb_design/renders/mushak_pcb-F_Mask.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/pcb_design/renders/mushak_pcb-F_Mask.pdf -------------------------------------------------------------------------------- /pcb_design/renders/mushak_pcb-F_Paste.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/pcb_design/renders/mushak_pcb-F_Paste.pdf -------------------------------------------------------------------------------- /cad_design/Final_Assembly/New_mount_2.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Final_Assembly/New_mount_2.SLDPRT -------------------------------------------------------------------------------- /cad_design/Final_Assembly/SpurPinion.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Final_Assembly/SpurPinion.SLDPRT -------------------------------------------------------------------------------- /cad_design/Final_Assembly/mushak_rims.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Final_Assembly/mushak_rims.SLDPRT -------------------------------------------------------------------------------- /cad_design/Final_Assembly/mushak_stm.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Final_Assembly/mushak_stm.SLDPRT -------------------------------------------------------------------------------- /cad_design/Final_Assembly/tof-set v2.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Final_Assembly/tof-set v2.SLDPRT -------------------------------------------------------------------------------- /pcb_design/renders/mushak_pcb-Edge_Cuts.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/pcb_design/renders/mushak_pcb-Edge_Cuts.pdf -------------------------------------------------------------------------------- /cad_design/Final_Assembly/New_mount_R_2.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Final_Assembly/New_mount_R_2.SLDPRT -------------------------------------------------------------------------------- /cad_design/Final_Assembly/SpurGear (1).SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Final_Assembly/SpurGear (1).SLDPRT -------------------------------------------------------------------------------- /cad_design/Final_Assembly/mushak_Wheel.SLDASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Final_Assembly/mushak_Wheel.SLDASM -------------------------------------------------------------------------------- /cad_design/Final_Assembly/mushak_battery.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Final_Assembly/mushak_battery.SLDPRT -------------------------------------------------------------------------------- /cad_design/Final_Assembly/mushak_chassis.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Final_Assembly/mushak_chassis.SLDPRT -------------------------------------------------------------------------------- /cad_design/Final_Assembly/mushak_motor.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Final_Assembly/mushak_motor.SLDPRT -------------------------------------------------------------------------------- /cad_design/Final_Assembly/mushak_shaft.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Final_Assembly/mushak_shaft.SLDPRT -------------------------------------------------------------------------------- /cad_design/Final_Assembly/mushak_wheels.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Final_Assembly/mushak_wheels.SLDPRT -------------------------------------------------------------------------------- /pcb_design/renders/mushak_pcb-B_Silkscreen.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/pcb_design/renders/mushak_pcb-B_Silkscreen.pdf -------------------------------------------------------------------------------- /pcb_design/renders/mushak_pcb-F_Silkscreen.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/pcb_design/renders/mushak_pcb-F_Silkscreen.pdf -------------------------------------------------------------------------------- /cad_design/Final_Assembly/photo-set v4 (1).SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Final_Assembly/photo-set v4 (1).SLDPRT -------------------------------------------------------------------------------- /cad_design/Final_Assembly/Board_Encoder.step.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Final_Assembly/Board_Encoder.step.SLDPRT -------------------------------------------------------------------------------- /cad_design/Final_Assembly/mushak_motor_base.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Final_Assembly/mushak_motor_base.SLDPRT -------------------------------------------------------------------------------- /cad_design/Final_Assembly/KERISE v5 mouse v128.SLDASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/cad_design/Final_Assembly/KERISE v5 mouse v128.SLDASM -------------------------------------------------------------------------------- /firmware/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/firmware/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c -------------------------------------------------------------------------------- /firmware/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gautam-dev-maker/mushak/HEAD/firmware/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.h -------------------------------------------------------------------------------- /firmware/Drivers/Pwm/pwm.h: -------------------------------------------------------------------------------- 1 | #ifndef __PWM_H__ 2 | #define __PWM_H__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include "stm32f4xx.h" 9 | 10 | extern TIM_HandleTypeDef htim10; 11 | 12 | HAL_StatusTypeDef pwm_init(void); 13 | 14 | void pwm_set_duty_cycle(TIM_TypeDef *instance, uint32_t channel, uint8_t duty_cycle); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | #endif 21 | 22 | -------------------------------------------------------------------------------- /pcb_design/renders/mushak_pcb-NPTH.drl: -------------------------------------------------------------------------------- 1 | M48 2 | ; DRILL file {KiCad 6.0.8-f2edbf62ab~116~ubuntu22.04.1} date Tue 18 Oct 2022 02:38:09 AM IST 3 | ; FORMAT={-:-/ absolute / inch / decimal} 4 | ; #@! TF.CreationDate,2022-10-18T02:38:09+05:30 5 | ; #@! TF.GenerationSoftware,Kicad,Pcbnew,6.0.8-f2edbf62ab~116~ubuntu22.04.1 6 | ; #@! TF.FileFunction,NonPlated,1,2,NPTH 7 | FMAT,2 8 | INCH 9 | % 10 | G90 11 | G05 12 | T0 13 | M30 14 | -------------------------------------------------------------------------------- /pcb_design/gerbers/mushak_pcb-NPTH.drl: -------------------------------------------------------------------------------- 1 | M48 2 | ; DRILL file {KiCad 6.0.11-2627ca5db0~126~ubuntu22.04.1} date Sun 12 Mar 2023 03:28:44 PM IST 3 | ; FORMAT={-:-/ absolute / inch / decimal} 4 | ; #@! TF.CreationDate,2023-03-12T15:28:44+05:30 5 | ; #@! TF.GenerationSoftware,Kicad,Pcbnew,6.0.11-2627ca5db0~126~ubuntu22.04.1 6 | ; #@! TF.FileFunction,NonPlated,1,2,NPTH 7 | FMAT,2 8 | INCH 9 | % 10 | G90 11 | G05 12 | T0 13 | M30 14 | -------------------------------------------------------------------------------- /firmware/Drivers/CMSIS/Device/ST/STM32F4xx/LICENSE.txt: -------------------------------------------------------------------------------- 1 | This software component is provided to you as part of a software package and 2 | applicable license terms are in the Package_license file. If you received this 3 | software component outside of a package or without applicable license terms, 4 | the terms of the Apache-2.0 license shall apply. 5 | You may obtain a copy of the Apache-2.0 at: 6 | https://opensource.org/licenses/Apache-2.0 7 | -------------------------------------------------------------------------------- /firmware/Drivers/STM32F4xx_HAL_Driver/LICENSE.txt: -------------------------------------------------------------------------------- 1 | This software component is provided to you as part of a software package and 2 | applicable license terms are in the Package_license file. If you received this 3 | software component outside of a package or without applicable license terms, 4 | the terms of the BSD-3-Clause license shall apply. 5 | You may obtain a copy of the BSD-3-Clause at: 6 | https://opensource.org/licenses/BSD-3-Clause 7 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/AMS1117-3.3/how-to-import.htm: -------------------------------------------------------------------------------- 1 | Page Redirection If you are not redirected automatically, follow this link to the import guide. -------------------------------------------------------------------------------- /pcb_design/component_libraries/AS5048B-HTSP/how-to-import.htm: -------------------------------------------------------------------------------- 1 | Page Redirection If you are not redirected automatically, follow this link to the import guide. -------------------------------------------------------------------------------- /firmware/Drivers/Adc/adc.h: -------------------------------------------------------------------------------- 1 | #ifndef __ADC_H__ 2 | #define __ADC_H__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include "stm32f4xx.h" 9 | 10 | typedef enum { 11 | IR_0 = 0, // Leftmost IR sensor 12 | IR_1, 13 | IR_2, 14 | IR_3, 15 | IR_MAX 16 | } IR_SENSOR; 17 | 18 | HAL_StatusTypeDef adc_init(); 19 | 20 | uint32_t get_ir_readings(IR_SENSOR sensor); 21 | 22 | uint32_t get_battery_reading(); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | 28 | #endif 29 | 30 | -------------------------------------------------------------------------------- /firmware/Drivers/Drv8833/drv8833.h: -------------------------------------------------------------------------------- 1 | #ifndef __DRV8833_H__ 2 | #define __DRV8833_H__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include "stm32f4xx.h" 9 | 10 | typedef enum { 11 | MOTOR_L = 0, 12 | MOTOR_R, 13 | MAX_MOTORS 14 | } MOTOR; 15 | 16 | typedef enum { 17 | BACKWARD = 0, 18 | FORWARD, 19 | STOP, 20 | MAX_MOTION 21 | } MOTION; 22 | 23 | HAL_StatusTypeDef drv8833_init(); 24 | 25 | void set_duty_cycle(MOTOR motor, MOTION motion, uint8_t duty_cycle); 26 | 27 | void stop_motors(); 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/mushak_mount_footprint/STAND_SLAVE_06.kicad_mod: -------------------------------------------------------------------------------- 1 | (module STAND_SLAVE_06 (layer F.Cu) (tedit 5E4BD38A) 2 | (fp_text reference P6 (at 0 -1.5) (layer F.SilkS) hide 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value ENC_Slave (at 0 -1.5) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (pad 3 smd rect (at -0.4 -0.4) (size 0.5 0.8) (layers B.Cu B.Paste B.Mask)) 9 | (pad 4 smd rect (at 0.4 -0.4) (size 0.5 0.8) (layers F.Cu F.Paste F.Mask)) 10 | (pad 1 thru_hole rect (at -2 0) (size 1 1) (drill 0.3) (layers *.Cu *.Mask)) 11 | (pad 6 thru_hole rect (at 2 0) (size 1 1) (drill 0.3) (layers *.Cu *.Mask)) 12 | (pad 2 smd rect (at -0.4 -0.4) (size 0.5 0.8) (layers F.Cu F.Paste F.Mask)) 13 | (pad 5 smd rect (at 0.4 -0.4) (size 0.5 0.8) (layers B.Cu B.Paste B.Mask)) 14 | ) 15 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/SMT-0440-T-R/SMT-0440-T-R.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | #(c) SnapEDA 2016 (snapeda.com) 4 | #This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA) with Design Exception 1.0 5 | # 6 | # SMT-0440-T-R 7 | # 8 | DEF SMT-0440-T-R LS 0 40 Y Y 1 L N 9 | F0 "LS" -200 200 50 H V L BNN 10 | F1 "SMT-0440-T-R" -200 -300 50 H V L BNN 11 | F2 "XDCR_SMT-0440-T-R" 0 0 50 H I L BNN 12 | F3 "" 0 0 50 H I L BNN 13 | F4 "PUI Audio" 0 0 50 H I L BNN "MANUFACTURER" 14 | DRAW 15 | A -200 0 200 2699 4500 0 0 10 N -200 200 -200 -200 16 | P 2 0 0 10 -200 200 -200 -200 N 17 | P 2 0 0 10 0 100 -26 100 N 18 | P 2 0 0 10 -26 100 -26 100 N 19 | P 2 0 0 10 0 -100 -26 -100 N 20 | X 1 1 200 100 200 L 40 40 0 0 P 21 | X 2 2 200 -100 200 L 40 40 0 0 P 22 | ENDDRAW 23 | ENDDEF 24 | # 25 | # End Library -------------------------------------------------------------------------------- /pcb_design/component_libraries/TL1015AF160QG/TL1015AF160QG.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | #(c) SnapEDA 2016 (snapeda.com) 4 | #This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA) with Design Exception 1.0 5 | # 6 | # TL1015AF160QG 7 | # 8 | DEF TL1015AF160QG S 0 40 Y N 1 L N 9 | F0 "S" -200 250 50 H V L BNN 10 | F1 "TL1015AF160QG" -200 -200 50 H V L BNN 11 | F2 "SW_TL1015AF160QG" 0 0 50 H I L BNN 12 | F3 "" 0 0 50 H I L BNN 13 | F4 "F" 0 0 50 H I L BNN "PARTREV" 14 | F5 "E-Switch" 0 0 50 H I L BNN "MANUFACTURER" 15 | F6 "2.1 mm" 0 0 50 H I L BNN "MAXIMUM_PACKAGE_HEIGHT" 16 | F7 "Manufacturer Recommendations" 0 0 50 H I L BNN "STANDARD" 17 | DRAW 18 | C -100 0 10 0 0 20 N 19 | C 100 0 10 0 0 20 N 20 | P 2 0 0 10 -150 50 0 50 N 21 | P 2 0 0 10 0 50 150 50 N 22 | P 2 0 0 10 0 50 0 200 N 23 | X ~ 1 -300 0 200 R 40 40 0 0 P 24 | X ~ 2 300 0 200 L 40 40 0 0 P 25 | ENDDRAW 26 | ENDDEF 27 | # 28 | # End Library -------------------------------------------------------------------------------- /pcb_design/component_libraries/ABS07-32.768KHZ-T/ABS07-32.768KHZ-T.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | #(c) SnapEDA 2016 (snapeda.com) 4 | #This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA) with Design Exception 1.0 5 | # 6 | # ABS07-32.768KHZ-T 7 | # 8 | DEF ABS07-32.768KHZ-T Y 0 40 N N 1 L N 9 | F0 "Y" -200 150 50 H V L BNN 10 | F1 "ABS07-32.768KHZ-T" -201 -201 50 H V L BNN 11 | F2 "XTAL_ABS07-32.768KHZ-T" 0 0 50 H I L BNN 12 | F3 "" 0 0 50 H I L BNN 13 | F4 "08.19.15" 0 0 50 H I L BNN "PARTREV" 14 | F5 "Abracon" 0 0 50 H I L BNN "MANUFACTURER" 15 | F6 "0.9 mm" 0 0 50 H I L BNN "MAXIMUM_PACKAGE_HEIGHT" 16 | F7 "Manufacturer Recommendations" 0 0 50 H I L BNN "STANDARD" 17 | DRAW 18 | P 2 0 0 16 -55 100 55 100 N 19 | P 2 0 0 16 55 100 55 -100 N 20 | P 2 0 0 16 55 -100 -55 -100 N 21 | P 2 0 0 16 -55 100 -55 -100 N 22 | P 2 0 0 16 92 100 92 -100 N 23 | P 2 0 0 16 -92 100 -92 -100 N 24 | X ~ 2 200 0 100 L 40 40 0 0 P 25 | X ~ 1 -200 0 100 R 40 40 0 0 P 26 | ENDDRAW 27 | ENDDEF 28 | # 29 | # End Library -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Gautam Agrawal 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /firmware/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Gautam Agrawal 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /cad_design/Extras/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Gautam Agrawal 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/mushak_mount_footprint/IR_SLAVE_04.kicad_mod: -------------------------------------------------------------------------------- 1 | (footprint "IR_SLAVE_04" (version 20211014) (generator pcbnew) 2 | (layer "F.Cu") 3 | (tedit 5E4BD3CA) 4 | (attr through_hole) 5 | (fp_text reference "J4" (at 0 0.5) (layer "F.Fab") 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | (tstamp d774e809-2a3c-4200-a17e-c613265477d7) 8 | ) 9 | (fp_text value "IR" (at 0 -0.5) (layer "F.Fab") 10 | (effects (font (size 1 1) (thickness 0.15))) 11 | (tstamp 2f764636-7bf3-459c-8cc8-f311a273e989) 12 | ) 13 | (fp_circle (center -1.5 -1) (end -1.25 -1) (layer "F.SilkS") (width 0.15) (fill none) (tstamp 506755e4-206f-4af1-ba92-b977e9002f1e)) 14 | (pad "1" thru_hole rect (at -2 0) (size 1 1) (drill 0.3) (layers *.Cu *.Mask) (tstamp 26aba172-ceaf-4beb-ab82-631f39643eb6)) 15 | (pad "2" smd rect (at 0 -0.4) (size 0.6 0.8) (layers "F.Cu" "F.Paste" "F.Mask") (tstamp 4e07c0c0-d1c7-4885-b00b-77b310b1e87b)) 16 | (pad "3" smd rect (at 0 -0.4) (size 0.6 0.8) (layers "B.Cu" "B.Paste" "B.Mask") (tstamp dfac197f-89c0-4b66-887f-dc2c2af31d2a)) 17 | (pad "4" thru_hole rect (at 2 0) (size 1 1) (drill 0.3) (layers *.Cu *.Mask) (tstamp 32e76a4a-0c6f-4053-97f5-15c8e7d0c718)) 18 | ) 19 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/mushak_mount_footprint/STAND_SLAVE_04.kicad_mod: -------------------------------------------------------------------------------- 1 | (footprint "STAND_SLAVE_04" (version 20211014) (generator pcbnew) 2 | (layer "F.Cu") 3 | (tedit 5E4BF4A8) 4 | (attr through_hole) 5 | (fp_text reference "P2" (at 0 0.5) (layer "F.Fab") hide 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | (tstamp 03de8359-0c93-44b4-865a-2bd2b182b35e) 8 | ) 9 | (fp_text value "I2C" (at 0 -0.5) (layer "F.Fab") 10 | (effects (font (size 1 1) (thickness 0.15))) 11 | (tstamp 83ace920-2b67-4e84-b533-e324aecdba75) 12 | ) 13 | (fp_circle (center -2 -1) (end -1.75 -1) (layer "F.SilkS") (width 0.15) (fill none) (tstamp 9e628aab-bcc4-4b3e-85b0-0cc9289a4a77)) 14 | (pad "1" thru_hole rect (at -2 0) (size 1 1) (drill 0.3) (layers *.Cu *.Mask) (tstamp 1eb43f32-0f88-40bc-b15e-528a41189455)) 15 | (pad "2" smd rect (at -0.4 -0.3) (size 0.5 0.6) (layers "F.Cu" "F.Paste" "F.Mask") (tstamp 0f2f8c73-aed9-4532-95af-eb94ee212cf9)) 16 | (pad "3" smd rect (at 0.4 -0.3) (size 0.5 0.6) (layers "F.Cu" "F.Paste" "F.Mask") (tstamp 2baee03d-17de-4472-8978-93a0718e59e7)) 17 | (pad "4" thru_hole rect (at 2 0) (size 1 1) (drill 0.3) (layers *.Cu *.Mask) (tstamp a5cc4fa9-b793-4fd7-aba0-d33544982cb3)) 18 | ) 19 | -------------------------------------------------------------------------------- /firmware/Middlewares/Third_Party/FreeRTOS/Source/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | Permission is hereby granted, free of charge, to any person obtaining a copy of 3 | this software and associated documentation files (the "Software"), to deal in 4 | the Software without restriction, including without limitation the rights to 5 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 6 | the Software, and to permit persons to whom the Software is furnished to do so, 7 | subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/mushak_mount_footprint/IR_SLAVE_V_04.kicad_mod: -------------------------------------------------------------------------------- 1 | (footprint "IR_SLAVE_V_04" (version 20211014) (generator pcbnew) 2 | (layer "F.Cu") 3 | (tedit 5E4CC27C) 4 | (attr through_hole) 5 | (fp_text reference "J11" (at 0 0.5) (layer "F.Fab") 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | (tstamp 68b863ae-0b9c-419a-bf9c-bffb2f26ddec) 8 | ) 9 | (fp_text value "IR" (at 0 -0.5) (layer "F.Fab") 10 | (effects (font (size 1 1) (thickness 0.15))) 11 | (tstamp a253f682-c570-48d6-abaf-74856e3aca48) 12 | ) 13 | (fp_circle (center -1.3 -1.1) (end -1.5 -1.1) (layer "F.SilkS") (width 0.12) (fill none) (tstamp d0faa66e-f9dd-4bd4-a395-3cb6f054e19e)) 14 | (pad "1" thru_hole rect (at 1.5 -0.25) (size 0.5 1) (drill 0.3) (layers *.Cu *.Mask) (tstamp 2fff61c0-0b26-4690-9090-a006e476ee00)) 15 | (pad "2" smd rect (at 0 -0.65) (size 0.4 0.8) (layers "B.Cu" "B.Paste" "B.Mask") (tstamp e8f99cea-017a-4453-946a-4985877f2fb0)) 16 | (pad "3" smd rect (at 0 -0.65) (size 0.4 0.8) (layers "F.Cu" "F.Paste" "F.Mask") (tstamp d43415ee-e29f-4774-af5a-d143e032a8f7)) 17 | (pad "4" thru_hole rect (at -1.5 -0.25) (size 0.5 1) (drill 0.3) (layers *.Cu *.Mask) (tstamp bdc17cb4-405c-41e7-a983-a5bbab6b4e9a)) 18 | ) 19 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/mushak_mount_footprint/New_Library.kicad_sym: -------------------------------------------------------------------------------- 1 | (kicad_symbol_lib (version 20211014) (generator kicad_symbol_editor) 2 | (symbol "motor" (in_bom yes) (on_board yes) 3 | (property "Reference" "M" (id 0) (at 0 5.08 0) 4 | (effects (font (size 1.27 1.27))) 5 | ) 6 | (property "Value" "motor" (id 1) (at 0 -5.08 0) 7 | (effects (font (size 1.27 1.27))) 8 | ) 9 | (property "Footprint" "" (id 2) (at 0 0 0) 10 | (effects (font (size 1.27 1.27)) hide) 11 | ) 12 | (property "Datasheet" "" (id 3) (at 0 0 0) 13 | (effects (font (size 1.27 1.27)) hide) 14 | ) 15 | (symbol "motor_0_1" 16 | (circle (center 0 0) (radius 7.62) 17 | (stroke (width 0) (type default) (color 0 0 0 0)) 18 | (fill (type none)) 19 | ) 20 | ) 21 | (symbol "motor_1_1" 22 | (pin input line (at 10.16 0 180) (length 2.54) 23 | (name "VMOT+" (effects (font (size 1.27 1.27)))) 24 | (number "1" (effects (font (size 1.27 1.27)))) 25 | ) 26 | (pin input line (at -10.16 0 0) (length 2.54) 27 | (name "VMOT-" (effects (font (size 1.27 1.27)))) 28 | (number "2" (effects (font (size 1.27 1.27)))) 29 | ) 30 | ) 31 | ) 32 | ) 33 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/DRV8833PW/DRV8833PW.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | #(c) SnapEDA 2016 (snapeda.com) 4 | #This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA) with Design Exception 1.0 5 | # 6 | # DRV8833PW 7 | # 8 | DEF DRV8833PW U 0 40 Y Y 1 L N 9 | F0 "U" -500 1039 50 H V L BNN 10 | F1 "DRV8833PW" -500 -1157 50 H V L BNN 11 | F2 "SOP65P640X120-16N" 0 0 50 H I L BNN 12 | F3 "" 0 0 50 H I L BNN 13 | DRAW 14 | S -500 -1000 500 1000 0 0 16 f 15 | X A_IN1 16 -700 900 200 R 40 40 0 0 I 16 | X A_IN2 15 -700 800 200 R 40 40 0 0 I 17 | X B_IN1 9 -700 700 200 R 40 40 0 0 I 18 | X B_IN2 10 -700 600 200 R 40 40 0 0 I 19 | X VINT 14 -700 500 200 R 40 40 0 0 I 20 | X A_ISENSE 3 -700 300 200 R 40 40 0 0 B 21 | X B_ISENSE 6 -700 100 200 R 40 40 0 0 B 22 | X NFAULT 8 -700 -100 200 R 40 40 0 0 B 23 | X NSLEEP 1 -700 -300 200 R 40 40 0 0 B 24 | X VCP 11 -700 -500 200 R 40 40 0 0 B 25 | X VM 12 -700 -700 200 R 40 40 0 0 B 26 | X A_OUT1 2 700 900 200 L 40 40 0 0 O 27 | X A_OUT2 4 700 800 200 L 40 40 0 0 O 28 | X B_OUT1 7 700 700 200 L 40 40 0 0 O 29 | X B_OUT2 5 700 600 200 L 40 40 0 0 O 30 | X GND 13 700 -900 200 L 40 40 0 0 W 31 | ENDDRAW 32 | ENDDEF 33 | # 34 | # End Library -------------------------------------------------------------------------------- /pcb_design/component_libraries/ABS07-32.768KHZ-T/XTAL_ABS07-32.768KHZ-T.kicad_mod: -------------------------------------------------------------------------------- 1 | 2 | (module XTAL_ABS07-32.768KHZ-T (layer F.Cu) (tedit 62F4AEB7) 3 | (descr "") 4 | (fp_text reference REF** (at -0.018 -1.8564 0) (layer F.SilkS) 5 | (effects (font (size 0.64 0.64) (thickness 0.15))) 6 | ) 7 | (fp_text value XTAL_ABS07-32.768KHZ-T (at 6.8908 1.8564 0) (layer F.Fab) 8 | (effects (font (size 0.64 0.64) (thickness 0.15))) 9 | ) 10 | (pad 1 smd rect (at -1.25 0.0) (size 1.1 1.9) (layers F.Cu F.Mask F.Paste)) 11 | (pad 2 smd rect (at 1.25 0.0) (size 1.1 1.9) (layers F.Cu F.Mask F.Paste)) 12 | (fp_line (start -1.6 -0.75) (end -1.6 0.75) (layer F.Fab) (width 0.127)) 13 | (fp_line (start 1.6 -0.75) (end 1.6 0.75) (layer F.Fab) (width 0.127)) 14 | (fp_line (start -1.6 -0.75) (end 1.6 -0.75) (layer F.Fab) (width 0.127)) 15 | (fp_line (start -1.6 0.75) (end 1.6 0.75) (layer F.Fab) (width 0.127)) 16 | (fp_line (start -2.05 -1.2) (end -2.05 1.2) (layer F.CrtYd) (width 0.05)) 17 | (fp_line (start -2.05 1.2) (end 2.05 1.2) (layer F.CrtYd) (width 0.05)) 18 | (fp_line (start 2.05 1.2) (end 2.05 -1.2) (layer F.CrtYd) (width 0.05)) 19 | (fp_line (start 2.05 -1.2) (end -2.05 -1.2) (layer F.CrtYd) (width 0.05)) 20 | (fp_line (start -0.38 -0.75) (end 0.38 -0.75) (layer F.SilkS) (width 0.127)) 21 | (fp_line (start -0.38 0.75) (end 0.38 0.75) (layer F.SilkS) (width 0.127)) 22 | ) -------------------------------------------------------------------------------- /pcb_design/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (lib (name "AS5600-ASOT")(type "Legacy")(uri "${KIPRJMOD}/component_libraries/AS5600-ASOT/AS5600-ASOT.lib")(options "")(descr "")) 3 | (lib (name "DRV8833PW")(type "Legacy")(uri "${KIPRJMOD}/component_libraries/DRV8833PW/DRV8833PW.lib")(options "")(descr "")) 4 | (lib (name "MPU-6500")(type "Legacy")(uri "${KIPRJMOD}/component_libraries/MPU-6500/MPU-6500.lib")(options "")(descr "")) 5 | (lib (name "SFH_3015_FA")(type "Legacy")(uri "${KIPRJMOD}/component_libraries/SFH_3015_FA/SFH_3015_FA.lib")(options "")(descr "")) 6 | (lib (name "SFH_4045N")(type "Legacy")(uri "${KIPRJMOD}/component_libraries/SFH_4045N/SFH_4045N.lib")(options "")(descr "")) 7 | (lib (name "STM32F407VGT6")(type "Legacy")(uri "${KIPRJMOD}/component_libraries/STM32F407VGT6/STM32F407VGT6.lib")(options "")(descr "")) 8 | (lib (name "AS5048B-HTSP")(type "Legacy")(uri "${KIPRJMOD}/component_libraries/AS5048B-HTSP/AS5048B-HTSP.lib")(options "")(descr "")) 9 | (lib (name "DRV8833PWPR")(type "Legacy")(uri "${KIPRJMOD}/component_libraries/DRV8833PWPR/DRV8833PWPR.lib")(options "")(descr "")) 10 | (lib (name "VL53L0CXV0DH_1")(type "KiCad")(uri "${KIPRJMOD}/component_libraries/VL53L0CXV0DH_1/VL53L0CXV0DH_1.kicad_sym")(options "")(descr "")) 11 | (lib (name "AMS1117-3.3")(type "KiCad")(uri "${KIPRJMOD}/component_libraries/AMS1117-3.3/AMS1117-3.3.kicad_sym")(options "")(descr "")) 12 | ) 13 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/mushak_mount_footprint/STAND_HOST_06.kicad_mod: -------------------------------------------------------------------------------- 1 | (module STAND_HOST_06 (layer F.Cu) (tedit 5E4BD4FA) 2 | (fp_text reference J8 (at 0 -1.5 180) (layer F.Fab) hide 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value ENC_Host (at 0 -1.5 180) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_line (start -2.5 -0.3) (end -2.5 0.3) (layer F.Fab) (width 0.15)) 9 | (fp_line (start 2.5 -0.3) (end -2.5 -0.3) (layer F.Fab) (width 0.15)) 10 | (fp_line (start 2.5 0.3) (end 2.5 -0.3) (layer F.Fab) (width 0.15)) 11 | (fp_line (start -2.5 0.3) (end 2.5 0.3) (layer F.Fab) (width 0.15)) 12 | (fp_line (start 2.5 1.3) (end 2.5 0.3) (layer F.Fab) (width 0.15)) 13 | (fp_line (start -2.5 1.3) (end 2.5 1.3) (layer F.Fab) (width 0.15)) 14 | (fp_line (start -2.5 0.3) (end -2.5 1.3) (layer F.Fab) (width 0.15)) 15 | (pad 6 thru_hole oval (at 2 0) (size 1.6 1.2) (drill oval 1.2 0.8) (layers *.Cu *.Mask)) 16 | (pad 1 thru_hole oval (at -2 0) (size 1.6 1.2) (drill oval 1.2 0.8) (layers *.Cu *.Mask)) 17 | (pad 5 smd rect (at 0.5 -0.6) (size 0.54 0.8) (layers F.Cu F.Paste F.Mask)) 18 | (pad 4 smd rect (at 0.5 0.6) (size 0.54 0.8) (layers F.Cu F.Paste F.Mask)) 19 | (pad 3 smd rect (at -0.5 -0.6) (size 0.54 0.8) (layers F.Cu F.Paste F.Mask)) 20 | (pad 2 smd rect (at -0.5 0.6) (size 0.54 0.8) (layers F.Cu F.Paste F.Mask)) 21 | ) 22 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/SFH_4045N/SFH_4045N.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | #(c) SnapEDA 2016 (snapeda.com) 4 | #This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA) with Design Exception 1.0 5 | # 6 | # SFH_4045N 7 | # 8 | DEF SFH_4045N D 0 40 Y N 1 L N 9 | F0 "D" -200 200 50 H V L BNN 10 | F1 "SFH_4045N" -200 -200 50 H V L BNN 11 | F2 "LED_SFH_4045N" 0 0 50 H I L BNN 12 | F3 "" 0 0 50 H I L BNN 13 | F4 "1.3 mm" 0 0 50 H I L BNN "MAXIMUM_PACKAGE_HEIGHT" 14 | F5 "OSRAM Opto" 0 0 50 H I L BNN "MANUFACTURER" 15 | F6 "1.5" 0 0 50 H I L BNN "PARTREV" 16 | F7 "Manufacturer Recommendations" 0 0 50 H I L BNN "STANDARD" 17 | DRAW 18 | P 2 0 0 10 -100 60 -100 -60 N 19 | P 2 0 0 10 -100 -60 0 0 N 20 | P 2 0 0 10 0 0 -100 60 N 21 | P 2 0 0 10 0 60 0 -60 N 22 | T 0 40 80 40 0 0 0 IR Normal 0 L B 23 | P 2 0 0 10 40 160 -30 80 N 24 | P 2 0 0 10 27 122 5 141 N 25 | P 2 0 0 10 5 141 40 160 N 26 | P 2 0 0 10 40 160 27 122 N 27 | P 2 0 0 10 27 122 28 151 N 28 | P 2 0 0 10 28 151 23 151 N 29 | P 2 0 0 10 12 138 21 144 N 30 | P 2 0 0 10 -9 164 -79 84 N 31 | P 2 0 0 10 -22 126 -44 145 N 32 | P 2 0 0 10 -44 145 -9 164 N 33 | P 2 0 0 10 -9 164 -22 126 N 34 | P 2 0 0 10 -22 126 -21 155 N 35 | P 2 0 0 10 -21 155 -26 155 N 36 | P 2 0 0 10 -37 142 -28 148 N 37 | X ~ 1 200 0 200 L 40 40 0 0 P 38 | X ~ 2 -300 0 200 R 40 40 0 0 P 39 | ENDDRAW 40 | ENDDEF 41 | # 42 | # End Library -------------------------------------------------------------------------------- /pcb_design/component_libraries/SFH_3015_FA/SFH_3015_FA.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | #(c) SnapEDA 2016 (snapeda.com) 4 | #This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA) with Design Exception 1.0 5 | # 6 | # SFH_3015_FA 7 | # 8 | DEF SFH_3015_FA A 0 40 N N 1 L N 9 | F0 "A" -400 200 50 H V L BNN 10 | F1 "SFH_3015_FA" -400 -300 50 H V L BNN 11 | F2 "XDCR_SFH_3015_FA" 0 0 50 H I L BNN 12 | F3 "" 0 0 50 H I L BNN 13 | F4 "1.8 mm" 0 0 50 H I L BNN "MAXIMUM_PACKAGE_HEIGHT" 14 | F5 "OSRAM" 0 0 50 H I L BNN "MANUFACTURER" 15 | F6 "1.6" 0 0 50 H I L BNN "PARTREV" 16 | F7 "Manufacturer Recommendations" 0 0 50 H I L BNN "STANDARD" 17 | DRAW 18 | P 2 0 0 6 -195 100 -125 30 N 19 | P 2 0 0 6 -125 30 -170 45 N 20 | P 2 0 0 6 -170 45 -140 75 N 21 | P 2 0 0 6 -140 75 -125 30 N 22 | P 2 0 0 6 90 -90 100 -100 N 23 | P 4 0 0 6 -170 45 -125 30 -140 75 -170 45 f 24 | C 50 0 125 0 0 10 N 25 | P 2 0 0 10 0 75 0 25 N 26 | P 2 0 0 10 0 25 0 -25 N 27 | P 2 0 0 10 0 -25 0 -75 N 28 | P 2 0 0 10 0 -25 100 -100 N 29 | P 2 0 0 10 0 25 100 100 N 30 | P 4 0 0 10 100 -100 90 -60 60 -100 100 -100 f 31 | P 2 0 0 6 -195 25 -125 -45 N 32 | P 2 0 0 6 -125 -45 -170 -30 N 33 | P 2 0 0 6 -170 -30 -140 0 N 34 | P 2 0 0 6 -140 0 -125 -45 N 35 | P 4 0 0 6 -170 -30 -125 -45 -140 0 -170 -30 f 36 | X ~ 1 100 -200 100 U 40 40 0 0 P 37 | X ~ 2 100 200 100 D 40 40 0 0 P 38 | ENDDRAW 39 | ENDDEF 40 | # 41 | # End Library -------------------------------------------------------------------------------- /firmware/Core/Inc/gpio.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file gpio.h 5 | * @brief This file contains all the function prototypes for 6 | * the gpio.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2023 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 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __GPIO_H__ 22 | #define __GPIO_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* USER CODE BEGIN Includes */ 32 | 33 | /* USER CODE END Includes */ 34 | 35 | /* USER CODE BEGIN Private defines */ 36 | 37 | /* USER CODE END Private defines */ 38 | 39 | void MX_GPIO_Init(void); 40 | 41 | /* USER CODE BEGIN Prototypes */ 42 | 43 | /* USER CODE END Prototypes */ 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | #endif /*__ GPIO_H__ */ 49 | 50 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/AS5048B-HTSP/AS5048B-HTSP.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | #(c) SnapEDA 2016 (snapeda.com) 4 | #This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA) with Design Exception 1.0 5 | # 6 | # AS5048B-HTSP 7 | # 8 | DEF AS5048B-HTSP U 0 40 Y Y 1 L N 9 | F0 "U" -503 704 50 H V L BNN 10 | F1 "AS5048B-HTSP" -503 -906 50 H V L BNN 11 | F2 "SOP65P640X120-14N" 0 0 50 H I L BNN 12 | F3 "" 0 0 50 H I L BNN 13 | F4 "None" 0 0 50 H I L BNN "PRICE" 14 | F5 "1-11" 0 0 50 H I L BNN "PARTREV" 15 | F6 "TSSOP-14 ams" 0 0 50 H I L BNN "PACKAGE" 16 | F7 "Ic Encoder Rotary 14-Tssop" 0 0 50 H I L BNN "DESCRIPTION" 17 | F8 "ams" 0 0 50 H I L BNN "MF" 18 | F9 "AS5048B-HTSP" 0 0 50 H I L BNN "MP" 19 | F10 "Unavailable" 0 0 50 H I L BNN "AVAILABILITY" 20 | F11 "IPC-7351B" 0 0 50 H I L BNN "STANDARD" 21 | DRAW 22 | S -500 -800 500 700 0 0 10 f 23 | X SDA 1 -700 -100 200 R 40 40 0 0 B 24 | X SCL 2 -700 0 200 R 40 40 0 0 I C 25 | X A2 3 -700 200 200 R 40 40 0 0 I 26 | X A1 4 -700 300 200 R 40 40 0 0 I 27 | X TEST_5 5 -700 -300 200 R 40 40 0 0 P 28 | X VDD5V 11 700 600 200 L 40 40 0 0 W 29 | X VDD3V 12 700 500 200 L 40 40 0 0 W 30 | X PWM 14 700 100 200 L 40 40 0 0 O 31 | X GND 13 700 -700 200 L 40 40 0 0 W 32 | X TEST_10 10 700 -300 200 L 40 40 0 0 P 33 | X TEST_9 9 700 -400 200 L 40 40 0 0 P 34 | X TEST_8 8 700 -500 200 L 40 40 0 0 P 35 | X TEST_7 7 -700 -500 200 R 40 40 0 0 P 36 | X TEST_6 6 -700 -400 200 R 40 40 0 0 P 37 | ENDDRAW 38 | ENDDEF 39 | # 40 | # End Library -------------------------------------------------------------------------------- /pcb_design/component_libraries/AS5600-ASOT/AS5600-ASOT.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | #(c) SnapEDA 2016 (snapeda.com) 4 | #This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA) with Design Exception 1.0 5 | # 6 | # AS5600-ASOT 7 | # 8 | DEF AS5600-ASOT IC 0 40 Y Y 1 L N 9 | F0 "IC" 250 200 50 H V L BNN 10 | F1 "AS5600-ASOT" 250 -500 50 H V L BNN 11 | F2 "SOIC127P600X175-8N" 0 0 50 H I L BNN 12 | F3 "" 0 0 50 H I L BNN 13 | F4 "AS5600-ASOT" 0 0 50 H I L BNN "MANUFACTURER_PART_NUMBER" 14 | F5 "ams" 0 0 50 H I L BNN "MANUFACTURER_NAME" 15 | F6 "https://www.mouser.co.uk/ProductDetail/ams/AS5600-ASOT?qs=KTMMzrZdriGJpjhsnAEYBA%3D%3D" 0 0 50 H I L BNN "MOUSER_PRICE-STOCK" 16 | F7 "985-AS5600-ASOT" 0 0 50 H I L BNN "MOUSER_PART_NUMBER" 17 | F8 "Board Mount Hall Effect / Magnetic Sensors AS5600 Magnetic Sensor 12-Bit" 0 0 50 H I L BNN "DESCRIPTION" 18 | F9 "AS5600-ASOT" 0 0 50 H I L BNN "ARROW_PART_NUMBER" 19 | F10 "https://www.arrow.com/en/products/as5600-asot/ams-ag?region=nac" 0 0 50 H I L BNN "ARROW_PRICE-STOCK" 20 | F11 "1.75mm" 0 0 50 H I L BNN "HEIGHT" 21 | DRAW 22 | P 2 0 0 10 200 100 1000 100 N 23 | P 2 0 0 10 1000 -400 1000 100 N 24 | P 2 0 0 10 1000 -400 200 -400 N 25 | P 2 0 0 10 200 100 200 -400 N 26 | X VDD5V 1 0 0 200 R 40 40 0 0 B 27 | X VDD3V3 2 0 -100 200 R 40 40 0 0 B 28 | X OUT 3 0 -200 200 R 40 40 0 0 B 29 | X GND 4 0 -300 200 R 40 40 0 0 B 30 | X DIR 8 1200 0 200 L 40 40 0 0 B 31 | X SCL 7 1200 -100 200 L 40 40 0 0 B 32 | X SDA 6 1200 -200 200 L 40 40 0 0 B 33 | X PGO 5 1200 -300 200 L 40 40 0 0 B 34 | ENDDRAW 35 | ENDDEF 36 | # 37 | # End Library -------------------------------------------------------------------------------- /firmware/Core/Inc/i2c.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file i2c.h 5 | * @brief This file contains all the function prototypes for 6 | * the i2c.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2023 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 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __I2C_H__ 22 | #define __I2C_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* USER CODE BEGIN Includes */ 32 | 33 | /* USER CODE END Includes */ 34 | 35 | extern I2C_HandleTypeDef hi2c1; 36 | 37 | extern I2C_HandleTypeDef hi2c2; 38 | 39 | extern I2C_HandleTypeDef hi2c3; 40 | 41 | /* USER CODE BEGIN Private defines */ 42 | 43 | /* USER CODE END Private defines */ 44 | 45 | void MX_I2C1_Init(void); 46 | void MX_I2C2_Init(void); 47 | void MX_I2C3_Init(void); 48 | 49 | /* USER CODE BEGIN Prototypes */ 50 | 51 | /* USER CODE END Prototypes */ 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif /* __I2C_H__ */ 58 | 59 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### C ### 2 | # Build folder 3 | build/ 4 | 5 | # Prerequisites 6 | *.d 7 | 8 | # Object files 9 | *.o 10 | *.ko 11 | *.obj 12 | *.elf 13 | 14 | # Linker output 15 | *.ilk 16 | *.map 17 | *.exp 18 | 19 | # Precompiled Headers 20 | *.gch 21 | *.pch 22 | 23 | # Libraries 24 | *.a 25 | *.la 26 | *.lo 27 | 28 | # Shared objects (inc. Windows DLLs) 29 | *.dll 30 | *.so 31 | *.so.* 32 | *.dylib 33 | 34 | # Executables 35 | *.exe 36 | *.out 37 | *.app 38 | *.i*86 39 | *.x86_64 40 | *.hex 41 | 42 | # Debug files 43 | *.dSYM/ 44 | *.su 45 | *.idb 46 | *.pdb 47 | 48 | # Kernel Module Compile Results 49 | *.mod* 50 | *.cmd 51 | .tmp_versions/ 52 | modules.order 53 | Module.symvers 54 | Mkfile.old 55 | dkms.conf 56 | 57 | ### C++ ### 58 | # Prerequisites 59 | 60 | # Compiled Object files 61 | *.slo 62 | 63 | # Precompiled Headers 64 | 65 | # Compiled Dynamic libraries 66 | 67 | # Fortran module files 68 | *.mod 69 | *.smod 70 | 71 | # Compiled Static libraries 72 | *.lai 73 | 74 | # Executables 75 | 76 | ### vscode ### 77 | .vscode/* 78 | !.vscode/settings.json 79 | !.vscode/tasks.json 80 | !.vscode/launch.json 81 | !.vscode/extensions.json 82 | *.code-workspace 83 | 84 | # For PCBs designed using KiCad: https://www.kicad.org/ 85 | # Format documentation: https://kicad.org/help/file-formats/ 86 | 87 | # Temporary files 88 | *.000 89 | *.bak 90 | *.bck 91 | *.kicad_pcb-bak 92 | *.kicad_sch-bak 93 | *-backups 94 | *.kicad_prl 95 | *.sch-bak 96 | *~ 97 | _autosave-* 98 | *.tmp 99 | *-save.pro 100 | *-save.kicad_pcb 101 | fp-info-cache 102 | 103 | # Netlist files (exported from Eeschema) 104 | *.net 105 | 106 | # Autorouter files (exported from Pcbnew) 107 | *.dsn 108 | *.ses 109 | 110 | *.DS_Store 111 | *.DS_Store? 112 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/TL1015AF160QG/SW_TL1015AF160QG.kicad_mod: -------------------------------------------------------------------------------- 1 | 2 | (module SW_TL1015AF160QG (layer F.Cu) (tedit 62FF9533) 3 | (descr "") 4 | (fp_text reference REF** (at 0.675 -3.135 0) (layer F.SilkS) 5 | (effects (font (size 1.0 1.0) (thickness 0.15))) 6 | ) 7 | (fp_text value SW_TL1015AF160QG (at 7.66 3.135 0) (layer F.Fab) 8 | (effects (font (size 1.0 1.0) (thickness 0.15))) 9 | ) 10 | (pad 1 smd rect (at -2.075 0.0) (size 0.95 1.4) (layers F.Cu F.Mask F.Paste)) 11 | (pad 2 smd rect (at 2.075 0.0) (size 0.95 1.4) (layers F.Cu F.Mask F.Paste)) 12 | (fp_line (start -1.95 -1.45) (end 1.95 -1.45) (layer F.Fab) (width 0.127)) 13 | (fp_line (start 1.95 -1.45) (end 1.95 1.45) (layer F.Fab) (width 0.127)) 14 | (fp_line (start 1.95 1.45) (end -1.95 1.45) (layer F.Fab) (width 0.127)) 15 | (fp_line (start -1.95 1.45) (end -1.95 -1.45) (layer F.Fab) (width 0.127)) 16 | (fp_line (start -1.95 -1.45) (end 1.95 -1.45) (layer F.SilkS) (width 0.127)) 17 | (fp_line (start 1.95 -1.45) (end 1.95 -1.0135) (layer F.SilkS) (width 0.127)) 18 | (fp_line (start 1.95 1.0135) (end 1.95 1.45) (layer F.SilkS) (width 0.127)) 19 | (fp_line (start 1.95 1.45) (end -1.95 1.45) (layer F.SilkS) (width 0.127)) 20 | (fp_line (start -1.95 1.45) (end -1.95 1.0135) (layer F.SilkS) (width 0.127)) 21 | (fp_line (start -1.95 -1.0135) (end -1.95 -1.45) (layer F.SilkS) (width 0.127)) 22 | (fp_line (start -2.8 -1.7) (end 2.8 -1.7) (layer F.CrtYd) (width 0.05)) 23 | (fp_line (start 2.8 -1.7) (end 2.8 1.7) (layer F.CrtYd) (width 0.05)) 24 | (fp_line (start 2.8 1.7) (end -2.8 1.7) (layer F.CrtYd) (width 0.05)) 25 | (fp_line (start -2.8 1.7) (end -2.8 -1.7) (layer F.CrtYd) (width 0.05)) 26 | (fp_circle (center -3.25 0.0) (end -3.15 0.0) (layer F.SilkS) (width 0.2)) 27 | (fp_circle (center -3.25 0.0) (end -3.15 0.0) (layer F.Fab) (width 0.2)) 28 | ) -------------------------------------------------------------------------------- /pcb_design/fp-lib-table: -------------------------------------------------------------------------------- 1 | (fp_lib_table 2 | (lib (name "AS5600-ASOT")(type "KiCad")(uri "${KIPRJMOD}/component_libraries/AS5600-ASOT")(options "")(descr "")) 3 | (lib (name "DRV8833PW")(type "KiCad")(uri "${KIPRJMOD}/component_libraries/DRV8833PW")(options "")(descr "")) 4 | (lib (name "MPU-6500")(type "KiCad")(uri "${KIPRJMOD}/component_libraries/MPU-6500")(options "")(descr "")) 5 | (lib (name "SFH_3015_FA")(type "KiCad")(uri "${KIPRJMOD}/component_libraries/SFH_3015_FA")(options "")(descr "")) 6 | (lib (name "SFH_4045N")(type "KiCad")(uri "${KIPRJMOD}/component_libraries/SFH_4045N")(options "")(descr "")) 7 | (lib (name "STM32F407VGT6")(type "KiCad")(uri "${KIPRJMOD}/component_libraries/STM32F407VGT6")(options "")(descr "")) 8 | (lib (name "SOT230P700X180-4N")(type "KiCad")(uri "${KIPRJMOD}/component_libraries/SOT230P700X180-4N")(options "")(descr "")) 9 | (lib (name "SMT-0440-T-R")(type "KiCad")(uri "${KIPRJMOD}/component_libraries/SMT-0440-T-R")(options "")(descr "")) 10 | (lib (name "mushak_mount_footprint")(type "KiCad")(uri "${KIPRJMOD}/component_libraries/mushak_mount_footprint")(options "")(descr "")) 11 | (lib (name "ABS07-32")(type "KiCad")(uri "${KIPRJMOD}/component_libraries/ABS07-32.768KHZ-T")(options "")(descr "")) 12 | (lib (name "TL1015AF160QG")(type "KiCad")(uri "${KIPRJMOD}/component_libraries/TL1015AF160QG")(options "")(descr "")) 13 | (lib (name "AS5048B-HTSP")(type "KiCad")(uri "${KIPRJMOD}/component_libraries/AS5048B-HTSP")(options "")(descr "")) 14 | (lib (name "DRV8833PWPR")(type "KiCad")(uri "${KIPRJMOD}/component_libraries/DRV8833PWPR")(options "")(descr "")) 15 | (lib (name "VL53L0CXV0DH_1")(type "KiCad")(uri "${KIPRJMOD}/component_libraries/VL53L0CXV0DH_1")(options "")(descr "")) 16 | (lib (name "AMS1117-3")(type "KiCad")(uri "${KIPRJMOD}/component_libraries/AMS1117-3.3")(options "")(descr "")) 17 | ) 18 | -------------------------------------------------------------------------------- /firmware/Drivers/CMSIS/Include/cmsis_version.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file cmsis_version.h 3 | * @brief CMSIS Core(M) Version definitions 4 | * @version V5.0.2 5 | * @date 19. April 2017 6 | ******************************************************************************/ 7 | /* 8 | * Copyright (c) 2009-2017 ARM Limited. All rights reserved. 9 | * 10 | * SPDX-License-Identifier: Apache-2.0 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the License); you may 13 | * not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 20 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | #if defined ( __ICCARM__ ) 26 | #pragma system_include /* treat file as system include file for MISRA check */ 27 | #elif defined (__clang__) 28 | #pragma clang system_header /* treat file as system include file */ 29 | #endif 30 | 31 | #ifndef __CMSIS_VERSION_H 32 | #define __CMSIS_VERSION_H 33 | 34 | /* CMSIS Version definitions */ 35 | #define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */ 36 | #define __CM_CMSIS_VERSION_SUB ( 1U) /*!< [15:0] CMSIS Core(M) sub version */ 37 | #define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \ 38 | __CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */ 39 | #endif 40 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/mushak_mount_footprint/STAND_HOST_04.kicad_mod: -------------------------------------------------------------------------------- 1 | (footprint "STAND_HOST_04" (version 20211014) (generator pcbnew) 2 | (layer "F.Cu") 3 | (tedit 6198AC94) 4 | (attr through_hole) 5 | (fp_text reference "P1" (at 0 4 -180) (layer "F.Fab") hide 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | (tstamp 6277d274-50d5-4fb5-b548-d86f0e6398a5) 8 | ) 9 | (fp_text value "I2C" (at 0 2.5 -180) (layer "F.Fab") 10 | (effects (font (size 1 1) (thickness 0.15))) 11 | (tstamp a23342b5-7ea2-4e0d-988c-6a6bc40f2800) 12 | ) 13 | (fp_line (start -2.6 1) (end -1.6 1) (layer "F.Fab") (width 0.15) (tstamp 6e1c48ba-ad68-4963-9cb6-619bb8bac4d6)) 14 | (fp_line (start -1.6 1) (end -1.6 1.6) (layer "F.Fab") (width 0.15) (tstamp 823d85aa-cd23-49e8-827e-06e93aa12252)) 15 | (fp_line (start -1.6 1.6) (end 1.6 1.6) (layer "F.Fab") (width 0.15) (tstamp bd880517-522e-4cc2-a8f2-129b2d2694d1)) 16 | (fp_line (start 2.6 1) (end 2.6 0.6) (layer "F.Fab") (width 0.15) (tstamp bf39b898-7c2b-4ed2-a055-276ce88af868)) 17 | (fp_line (start 1.6 1) (end 2.6 1) (layer "F.Fab") (width 0.15) (tstamp c3104198-e99c-48a0-9ad4-bd4503d8e662)) 18 | (fp_line (start 2.6 0.6) (end -2.6 0.6) (layer "F.Fab") (width 0.15) (tstamp d9577f7f-e425-4974-93ce-b3370973ee63)) 19 | (fp_line (start 1.6 1.6) (end 1.6 1) (layer "F.Fab") (width 0.15) (tstamp f0725a6c-1d5b-41d2-934e-61d94c830658)) 20 | (fp_line (start -2.6 0.6) (end -2.6 1) (layer "F.Fab") (width 0.15) (tstamp f4142f9b-0a6c-46d6-b721-411a1ad08f90)) 21 | (pad "1" thru_hole oval (at -2 0) (size 1.5 1.1) (drill oval 1.2 0.8) (layers *.Cu *.Mask) (tstamp 2a590742-e736-4fa1-8a2f-15616df2da14)) 22 | (pad "2" smd rect (at -0.6 0.35) (size 0.8 0.7) (layers "F.Cu" "F.Paste" "F.Mask") (tstamp a14c9911-1d07-467a-b415-ecadd012ac3f)) 23 | (pad "3" smd rect (at 0.6 0.35) (size 0.8 0.7) (layers "F.Cu" "F.Paste" "F.Mask") (tstamp 769d0a8e-2a0c-4f9e-b903-0b013346040f)) 24 | (pad "4" thru_hole oval (at 2 0) (size 1.5 1.1) (drill oval 1.2 0.8) (layers *.Cu *.Mask) (tstamp 7529a05b-0d4a-4f51-98ad-171054378955)) 25 | ) 26 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/AMS1117-3.3/SOT229P700X180-4N.kicad_mod: -------------------------------------------------------------------------------- 1 | 2 | (footprint SOT229P700X180-4N (layer F.Cu) (tedit 63F7742E) 3 | (descr "") 4 | (attr smd) 5 | (fp_text reference REF** (at -0.3275 -5.885 0) (layer F.SilkS) 6 | (effects (font (size 1.0 1.0) (thickness 0.15))) 7 | ) 8 | (fp_text value SOT229P700X180-4N (at 7.2925 6.085 0) (layer F.Fab) 9 | (effects (font (size 1.0 1.0) (thickness 0.15))) 10 | ) 11 | (pad 1 smd roundrect (roundrect_rratio 0.07) (at -3.345 -2.29) (size 1.31 0.93) (layers F.Cu F.Mask F.Paste)) 12 | (pad 2 smd roundrect (roundrect_rratio 0.07) (at -3.345 0.0) (size 1.31 0.93) (layers F.Cu F.Mask F.Paste)) 13 | (pad 3 smd roundrect (roundrect_rratio 0.07) (at -3.345 2.29) (size 1.31 0.93) (layers F.Cu F.Mask F.Paste)) 14 | (pad 4 smd roundrect (roundrect_rratio 0.24) (at 3.345 0.0) (size 1.31 3.24) (layers F.Cu F.Mask F.Paste)) 15 | (fp_line (start -1.7525 -3.2525) (end 1.7525 -3.2525) (layer F.Fab) (width 0.127)) 16 | (fp_line (start 1.7525 -3.2525) (end 1.7525 3.2525) (layer F.Fab) (width 0.127)) 17 | (fp_line (start 1.7525 3.2525) (end -1.7525 3.2525) (layer F.Fab) (width 0.127)) 18 | (fp_line (start -1.7525 3.2525) (end -1.7525 -3.2525) (layer F.Fab) (width 0.127)) 19 | (fp_line (start -1.7525 -3.2525) (end 1.7525 -3.2525) (layer F.SilkS) (width 0.127)) 20 | (fp_line (start 1.7525 -3.2525) (end 1.7525 3.2525) (layer F.SilkS) (width 0.127)) 21 | (fp_line (start 1.7525 3.2525) (end -1.7525 3.2525) (layer F.SilkS) (width 0.127)) 22 | (fp_line (start -1.7525 3.2525) (end -1.7525 -3.2525) (layer F.SilkS) (width 0.127)) 23 | (fp_line (start 4.25 -3.5025) (end -4.25 -3.5025) (layer F.CrtYd) (width 0.05)) 24 | (fp_line (start -4.25 -3.5025) (end -4.25 3.5025) (layer F.CrtYd) (width 0.05)) 25 | (fp_line (start -4.25 3.5025) (end 4.25 3.5025) (layer F.CrtYd) (width 0.05)) 26 | (fp_line (start 4.25 3.5025) (end 4.25 -3.5025) (layer F.CrtYd) (width 0.05)) 27 | (fp_circle (center -5.0 -2.29) (end -4.9 -2.29) (layer F.SilkS) (width 0.2)) 28 | (fp_circle (center -5.0 -2.29) (end -4.9 -2.29) (layer F.Fab) (width 0.2)) 29 | ) -------------------------------------------------------------------------------- /pcb_design/mushak_pcb-bottom-pos.csv: -------------------------------------------------------------------------------- 1 | Ref,Val,Package,PosX,PosY,Rot,Side 2 | "A1","SFH_3015_FA","XDCR_SFH_3015_FA",-140.150000,38.050000,0.000000,bottom 3 | "A2","SFH_3015_FA","XDCR_SFH_3015_FA",-140.150000,32.700000,0.000000,bottom 4 | "C22","10uF","C_0603_1608Metric",-142.050000,48.800000,90.000000,bottom 5 | "C23","10uF","C_0603_1608Metric",-142.100000,43.350000,90.000000,bottom 6 | "C29","4.7uF","C_0603_1608Metric",-146.550000,15.850000,90.000000,bottom 7 | "C30","0.1uF","C_0402_1005Metric",-145.350000,16.850000,90.000000,bottom 8 | "C37","1uF","C_0603_1608Metric",-143.250000,23.050000,180.000000,bottom 9 | "C38","1uF","C_0603_1608Metric",-143.250000,28.950000,180.000000,bottom 10 | "C40","0.1uF","C_0402_1005Metric",-143.325000,42.775000,-90.000000,bottom 11 | "C41","0.1uF","C_0402_1005Metric",-143.325000,48.225000,-90.000000,bottom 12 | "D4","SFH_4045N","LED_SFH_4045N",-140.050000,27.250000,180.000000,bottom 13 | "D5","SFH_4045N","LED_SFH_4045N",-140.050000,21.350000,180.000000,bottom 14 | "M2","motor","motor",-113.025000,49.125000,90.000000,bottom 15 | "Q4","DMN3065LW-7","SOT-323_SC-70",-143.400000,26.650000,-90.000000,bottom 16 | "Q5","DMN3065LW-7","SOT-323_SC-70",-143.400000,20.750000,-90.000000,bottom 17 | "R5","4.7k","R_0402_1005Metric",-143.675000,45.600000,0.000000,bottom 18 | "R6","10k","R_0402_1005Metric",-140.150000,39.750000,0.000000,bottom 19 | "R8","4.7k","R_0402_1005Metric",-143.675000,44.575000,0.000000,bottom 20 | "R9","4.7k","R_0402_1005Metric",-143.600000,50.300000,0.000000,bottom 21 | "R10","4.7k","R_0402_1005Metric",-143.600000,51.325000,0.000000,bottom 22 | "R11","10k","R_0402_1005Metric",-140.150000,34.400000,0.000000,bottom 23 | "R14","4.7k","R_0402_1005Metric",-141.850000,16.750000,180.000000,bottom 24 | "R15","4.7k","R_0402_1005Metric",-141.850000,14.850000,180.000000,bottom 25 | "R23","100","R_0603_1608Metric",-139.600000,28.950000,0.000000,bottom 26 | "R24","100","R_0603_1608Metric",-139.450000,23.050000,0.000000,bottom 27 | "R32","4.7k","R_0402_1005Metric",-143.850000,16.750000,180.000000,bottom 28 | "R33","4.7k","R_0402_1005Metric",-143.850000,14.850000,180.000000,bottom 29 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/SMT-0440-T-R/XDCR_SMT-0440-T-R.kicad_mod: -------------------------------------------------------------------------------- 1 | 2 | (module XDCR_SMT-0440-T-R (layer F.Cu) (tedit 62F247BA) 3 | (descr "") 4 | (fp_text reference REF** (at -0.667645 -2.724447 0) (layer F.SilkS) 5 | (effects (font (size 0.480467716535 0.480467716535) (thickness 0.15))) 6 | ) 7 | (fp_text value XDCR_SMT-0440-T-R (at 3.119661 2.641327 0) (layer F.Fab) 8 | (effects (font (size 0.480933858268 0.480933858268) (thickness 0.15))) 9 | ) 10 | (pad 1 smd rect (at -1.925 0.0) (size 1.26 1.41) (layers F.Cu F.Mask F.Paste)) 11 | (pad 2 smd rect (at 1.925 0.0) (size 1.26 1.41) (layers F.Cu F.Mask F.Paste)) 12 | (fp_circle (center -2.38 -1.3) (end -2.28 -1.3) (layer F.SilkS) (width 0.2)) 13 | (fp_line (start -2.754 -2.25) (end 2.754 -2.25) (layer F.CrtYd) (width 0.05)) 14 | (fp_line (start 2.754 -2.25) (end 2.754 2.25) (layer F.CrtYd) (width 0.05)) 15 | (fp_line (start 2.754 2.25) (end -2.754 2.25) (layer F.CrtYd) (width 0.05)) 16 | (fp_line (start -2.754 2.25) (end -2.754 -2.25) (layer F.CrtYd) (width 0.05)) 17 | (fp_line (start -2.0 -0.8) (end -2.0 -2.0) (layer F.SilkS) (width 0.127)) 18 | (fp_line (start -2.0 -2.0) (end 2.0 -2.0) (layer F.SilkS) (width 0.127)) 19 | (fp_line (start 2.0 -2.0) (end 2.0 -0.8) (layer F.SilkS) (width 0.127)) 20 | (fp_line (start 2.0 0.8) (end 2.0 2.0) (layer F.SilkS) (width 0.127)) 21 | (fp_line (start 2.0 2.0) (end -2.0 2.0) (layer F.SilkS) (width 0.127)) 22 | (fp_line (start -2.0 2.0) (end -2.0 0.8) (layer F.SilkS) (width 0.127)) 23 | (fp_line (start -2.0 2.0) (end -2.0 -2.0) (layer F.Fab) (width 0.127)) 24 | (fp_line (start -2.0 -2.0) (end 2.0 -2.0) (layer F.Fab) (width 0.127)) 25 | (fp_line (start 2.0 -2.0) (end 2.0 2.0) (layer F.Fab) (width 0.127)) 26 | (fp_line (start 2.0 2.0) (end -2.0 2.0) (layer F.Fab) (width 0.127)) 27 | (fp_circle (center 0.0 0.0) (end 0.4 0.0) (layer F.Fab) (width 0.127)) 28 | (fp_circle (center 1.3 0.0) (end 1.7 0.0) (layer F.Fab) (width 0.127)) 29 | (fp_line (start 1.3 -0.2) (end 1.3 0.2) (layer F.Fab) (width 0.127)) 30 | (fp_line (start 1.1 0.0) (end 1.5 0.0) (layer F.Fab) (width 0.127)) 31 | ) -------------------------------------------------------------------------------- /pcb_design/component_libraries/DRV8833PWPR/DRV8833PWPR.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | #(c) SnapEDA 2016 (snapeda.com) 4 | #This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA) with Design Exception 1.0 5 | # 6 | # DRV8833PWPR 7 | # 8 | DEF DRV8833PWPR U 0 40 Y Y 1 L N 9 | F0 "U" -600 1139 50 H V L BNN 10 | F1 "DRV8833PWPR" -600 -1157 50 H V L BNN 11 | F2 "IC_DRV8833PWPR" 0 0 50 H I L BNN 12 | F3 "" 0 0 50 H I L BNN 13 | F4 "None" 0 0 50 H I L BNN "PRICE" 14 | F5 "E" 0 0 50 H I L BNN "PARTREV" 15 | F6 "Manufacturer Recommendations" 0 0 50 H I L BNN "STANDARD" 16 | F7 "HTSSOP-16 Texas Instruments" 0 0 50 H I L BNN "PACKAGE" 17 | F8 "https://snapeda.com/shop?store=DigiKey&id=377881" 0 0 50 H I L BNN "DIGIKEY-PURCHASE-URL" 18 | F9 "10.8-V, 2-A dual H-bridge motor driver with current regulation 16-HTSSOP -40 to 85" 0 0 50 H I L BNN "DESCRIPTION" 19 | F10 "https://snapeda.com/shop?store=Mouser&id=377881" 0 0 50 H I L BNN "MOUSER-PURCHASE-URL" 20 | F11 "https://snapeda.com/shop?store=Texas+Instruments&id=377881" 0 0 50 H I L BNN "TEXAS_INSTRUMENTS-PURCHASE-URL" 21 | F12 "DRV8833PWPR" 0 0 50 H I L BNN "MP" 22 | F13 "Texas Instruments" 0 0 50 H I L BNN "MANUFACTURER" 23 | F14 "1.2mm" 0 0 50 H I L BNN "MAXIMUM_PACKAGE_HEIGHT" 24 | F15 "Warning" 0 0 50 H I L BNN "AVAILABILITY" 25 | DRAW 26 | S -600 -1000 600 1100 0 0 16 f 27 | X AISEN 3 800 -400 200 L 40 40 0 0 B 28 | X BISEN 6 800 -500 200 L 40 40 0 0 B 29 | X AOUT1 2 800 200 200 L 40 40 0 0 O 30 | X AOUT2 4 800 100 200 L 40 40 0 0 O 31 | X BOUT1 7 800 -100 200 L 40 40 0 0 O 32 | X BOUT2 5 800 -200 200 L 40 40 0 0 O 33 | X NSLEEP 1 -800 400 200 R 40 40 0 0 I 34 | X VINT 14 -800 1000 200 R 40 40 0 0 W 35 | X VM 12 -800 900 200 R 40 40 0 0 W 36 | X VCP 11 -800 600 200 R 40 40 0 0 B 37 | X AIN1 16 -800 200 200 R 40 40 0 0 I 38 | X AIN2 15 -800 100 200 R 40 40 0 0 I 39 | X BIN1 9 -800 -100 200 R 40 40 0 0 I 40 | X BIN2 10 -800 -200 200 R 40 40 0 0 I 41 | X ~NFAULT 8 800 400 200 L 40 40 0 0 O 42 | X EXP 17 800 -800 200 L 40 40 0 0 P 43 | X GND 13 800 -900 200 L 40 40 0 0 W 44 | ENDDRAW 45 | ENDDEF 46 | # 47 | # End Library -------------------------------------------------------------------------------- /pcb_design/component_libraries/AS5600-ASOT/SOIC127P600X175-8N.kicad_mod: -------------------------------------------------------------------------------- 1 | 2 | (module SOIC127P600X175-8N (layer F.Cu) (tedit 62EF924C) 3 | (descr "SOIC-8
") 4 | (fp_text reference REF** (at 0.0 -3.81 0) (layer F.SilkS) 5 | (effects (font (size 1.0 1.0) (thickness 0.15))) 6 | ) 7 | (fp_text value SOIC127P600X175-8N (at 0.0 3.81 0) (layer F.Fab) 8 | (effects (font (size 1.0 1.0) (thickness 0.15))) 9 | ) 10 | (pad 1 smd rect (at -2.7 -1.905) (size 1.5 0.65) (layers F.Cu F.Mask F.Paste)) 11 | (pad 2 smd rect (at -2.7 -0.635) (size 1.5 0.65) (layers F.Cu F.Mask F.Paste)) 12 | (pad 3 smd rect (at -2.7 0.635) (size 1.5 0.65) (layers F.Cu F.Mask F.Paste)) 13 | (pad 4 smd rect (at -2.7 1.905) (size 1.5 0.65) (layers F.Cu F.Mask F.Paste)) 14 | (pad 5 smd rect (at 2.7 1.905) (size 1.5 0.65) (layers F.Cu F.Mask F.Paste)) 15 | (pad 6 smd rect (at 2.7 0.635) (size 1.5 0.65) (layers F.Cu F.Mask F.Paste)) 16 | (pad 7 smd rect (at 2.7 -0.635) (size 1.5 0.65) (layers F.Cu F.Mask F.Paste)) 17 | (pad 8 smd rect (at 2.7 -1.905) (size 1.5 0.65) (layers F.Cu F.Mask F.Paste)) 18 | (fp_line (start -3.7 -2.7) (end 3.7 -2.7) (layer F.Fab) (width 0.05)) 19 | (fp_line (start 3.7 -2.7) (end 3.7 2.7) (layer F.Fab) (width 0.05)) 20 | (fp_line (start 3.7 2.7) (end -3.7 2.7) (layer F.Fab) (width 0.05)) 21 | (fp_line (start -3.7 2.7) (end -3.7 -2.7) (layer F.Fab) (width 0.05)) 22 | (fp_line (start -1.95 -2.45) (end 1.95 -2.45) (layer F.Fab) (width 0.1)) 23 | (fp_line (start 1.95 -2.45) (end 1.95 2.45) (layer F.Fab) (width 0.1)) 24 | (fp_line (start 1.95 2.45) (end -1.95 2.45) (layer F.Fab) (width 0.1)) 25 | (fp_line (start -1.95 2.45) (end -1.95 -2.45) (layer F.Fab) (width 0.1)) 26 | (fp_line (start -1.95 -1.18) (end -0.68 -2.45) (layer F.Fab) (width 0.1)) 27 | (fp_line (start -1.6 -2.45) (end 1.6 -2.45) (layer F.SilkS) (width 0.2)) 28 | (fp_line (start 1.6 -2.45) (end 1.6 2.45) (layer F.SilkS) (width 0.2)) 29 | (fp_line (start 1.6 2.45) (end -1.6 2.45) (layer F.SilkS) (width 0.2)) 30 | (fp_line (start -1.6 2.45) (end -1.6 -2.45) (layer F.SilkS) (width 0.2)) 31 | (fp_line (start -3.45 -2.58) (end -1.95 -2.58) (layer F.SilkS) (width 0.2)) 32 | ) -------------------------------------------------------------------------------- /firmware/Core/Inc/stm32f4xx_it.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32f4xx_it.h 5 | * @brief This file contains the headers of the interrupt handlers. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | * Copyright (c) 2023 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 __STM32F4xx_IT_H 22 | #define __STM32F4xx_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 MemManage_Handler(void); 52 | void BusFault_Handler(void); 53 | void UsageFault_Handler(void); 54 | void DebugMon_Handler(void); 55 | void TIM1_UP_TIM10_IRQHandler(void); 56 | void DMA2_Stream0_IRQHandler(void); 57 | /* USER CODE BEGIN EFP */ 58 | 59 | /* USER CODE END EFP */ 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif /* __STM32F4xx_IT_H */ 66 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/AMS1117-3.3/AMS1117-3.3.kicad_sym: -------------------------------------------------------------------------------- 1 | 2 | (kicad_symbol_lib (version 20211014) (generator kicad_symbol_editor) 3 | (symbol "AMS1117-3.3" (pin_names (offset 1.016)) (in_bom yes) (on_board yes) 4 | (property "Reference" "U" (id 0) (at -10.16 5.588 0) 5 | (effects (font (size 1.27 1.27)) (justify bottom left)) 6 | ) 7 | (property "Value" "AMS1117-3.3" (id 1) (at -10.16 -8.128 0) 8 | (effects (font (size 1.27 1.27)) (justify bottom left)) 9 | ) 10 | (property "Footprint" "SOT229P700X180-4N" (id 2) (at 0 0 0) 11 | (effects (font (size 1.27 1.27)) (justify bottom) hide) 12 | ) 13 | (property "SNAPEDA_PN" "AMS1117-3.3" (id 4) (at 0 0 0) 14 | (effects (font (size 1.27 1.27)) (justify bottom) hide) 15 | ) 16 | (property "PARTREV" "N/A" (id 5) (at 0 0 0) 17 | (effects (font (size 1.27 1.27)) (justify bottom) hide) 18 | ) 19 | (property "STANDARD" "IPC 7351B" (id 6) (at 0 0 0) 20 | (effects (font (size 1.27 1.27)) (justify bottom) hide) 21 | ) 22 | (property "SNAPEDA_PACKAGE_ID" "71280" (id 7) (at 0 0 0) 23 | (effects (font (size 1.27 1.27)) (justify bottom) hide) 24 | ) 25 | (property "MAXIMUM_PACKAGE_HEIGHT" "1.8 mm" (id 8) (at 0 0 0) 26 | (effects (font (size 1.27 1.27)) (justify bottom) hide) 27 | ) 28 | (property "MANUFACTURER" "Advanced Monolithic Systems" (id 9) (at 0 0 0) 29 | (effects (font (size 1.27 1.27)) (justify bottom) hide) 30 | ) 31 | (symbol "AMS1117-3.3_0_0" 32 | (rectangle (start -10.16 -5.08) (end 10.16 5.08) 33 | (stroke (width 0.254)) (fill (type background)) 34 | ) 35 | (pin input line (at -15.24 2.54 0) (length 5.08) 36 | (name "VIN" 37 | (effects (font (size 1.016 1.016))) 38 | ) 39 | (number "3" 40 | (effects (font (size 1.016 1.016))) 41 | ) 42 | ) 43 | (pin output line (at 15.24 2.54 180.0) (length 5.08) 44 | (name "VOUT" 45 | (effects (font (size 1.016 1.016))) 46 | ) 47 | (number "2" 48 | (effects (font (size 1.016 1.016))) 49 | ) 50 | ) 51 | (pin power_in line (at 15.24 -2.54 180.0) (length 5.08) 52 | (name "GND/ADJ" 53 | (effects (font (size 1.016 1.016))) 54 | ) 55 | (number "1" 56 | (effects (font (size 1.016 1.016))) 57 | ) 58 | ) 59 | ) 60 | ) 61 | ) -------------------------------------------------------------------------------- /pcb_design/component_libraries/SOT230P700X180-4N/SOT230P700X180-4N.kicad_mod: -------------------------------------------------------------------------------- 1 | 2 | (module SOT230P700X180-4N (layer F.Cu) (tedit 62F22F19) 3 | (descr "") 4 | (fp_text reference REF** (at -0.025 -4.754 0) (layer F.SilkS) 5 | (effects (font (size 1.0 1.0) (thickness 0.15))) 6 | ) 7 | (fp_text value SOT230P700X180-4N (at 7.595 4.365 0) (layer F.Fab) 8 | (effects (font (size 1.0 1.0) (thickness 0.15))) 9 | ) 10 | (pad 1 smd rect (at -2.9 -2.3 270.0) (size 0.95 2.15) (layers F.Cu F.Mask F.Paste)) 11 | (pad 2 smd rect (at -2.9 0.0 270.0) (size 0.95 2.15) (layers F.Cu F.Mask F.Paste)) 12 | (pad 3 smd rect (at -2.9 2.3 270.0) (size 0.95 2.15) (layers F.Cu F.Mask F.Paste)) 13 | (pad 4 smd rect (at 2.9 0.0 270.0) (size 3.25 2.15) (layers F.Cu F.Mask F.Paste)) 14 | (fp_circle (center -4.6 -2.3) (end -4.5 -2.3) (layer F.SilkS) (width 0.2)) 15 | (fp_circle (center -4.6 -2.3) (end -4.5 -2.3) (layer F.Fab) (width 0.2)) 16 | (fp_line (start 1.75 -3.25) (end 1.75 3.25) (layer F.Fab) (width 0.127)) 17 | (fp_line (start -1.75 -3.25) (end -1.75 3.25) (layer F.Fab) (width 0.127)) 18 | (fp_line (start 1.75 -3.25) (end 1.75 -2.01) (layer F.SilkS) (width 0.127)) 19 | (fp_line (start 1.75 -3.25) (end -1.75 -3.25) (layer F.Fab) (width 0.127)) 20 | (fp_line (start 1.75 3.25) (end -1.75 3.25) (layer F.Fab) (width 0.127)) 21 | (fp_line (start -1.75 -3.25) (end 1.75 -3.25) (layer F.SilkS) (width 0.127)) 22 | (fp_line (start 1.75 3.25) (end 1.75 2.01) (layer F.SilkS) (width 0.127)) 23 | (fp_line (start -1.75 3.25) (end 1.75 3.25) (layer F.SilkS) (width 0.127)) 24 | (fp_line (start 4.225 -1.875) (end 2.0 -1.875) (layer F.CrtYd) (width 0.05)) 25 | (fp_line (start 2.0 -1.875) (end 2.0 -3.5) (layer F.CrtYd) (width 0.05)) 26 | (fp_line (start 2.0 -3.5) (end -2.0 -3.5) (layer F.CrtYd) (width 0.05)) 27 | (fp_line (start -2.0 -3.5) (end -2.0 -3.025) (layer F.CrtYd) (width 0.05)) 28 | (fp_line (start -2.0 -3.025) (end -4.225 -3.025) (layer F.CrtYd) (width 0.05)) 29 | (fp_line (start -4.225 -3.025) (end -4.225 3.025) (layer F.CrtYd) (width 0.05)) 30 | (fp_line (start -4.225 3.025) (end -2.0 3.025) (layer F.CrtYd) (width 0.05)) 31 | (fp_line (start -2.0 3.025) (end -2.0 3.5) (layer F.CrtYd) (width 0.05)) 32 | (fp_line (start -2.0 3.5) (end 2.0 3.5) (layer F.CrtYd) (width 0.05)) 33 | (fp_line (start 2.0 3.5) (end 2.0 1.875) (layer F.CrtYd) (width 0.05)) 34 | (fp_line (start 2.0 1.875) (end 4.225 1.875) (layer F.CrtYd) (width 0.05)) 35 | (fp_line (start 4.225 1.875) (end 4.225 -1.875) (layer F.CrtYd) (width 0.05)) 36 | ) -------------------------------------------------------------------------------- /firmware/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) 2023 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 "stm32f4xx_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 | #define DEBUG_LED_Pin GPIO_PIN_10 61 | #define DEBUG_LED_GPIO_Port GPIOA 62 | #define MPU6500_CS_Pin GPIO_PIN_11 63 | #define MPU6500_CS_GPIO_Port GPIOA 64 | #define DEBUG_BTN_Pin GPIO_PIN_12 65 | #define DEBUG_BTN_GPIO_Port GPIOA 66 | 67 | /* USER CODE BEGIN Private defines */ 68 | 69 | /* USER CODE END Private defines */ 70 | 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | 75 | #endif /* __MAIN_H */ 76 | -------------------------------------------------------------------------------- /firmware/Drivers/Drv8833/drv8833.c: -------------------------------------------------------------------------------- 1 | #include "drv8833.h" 2 | #include "pwm.h" 3 | 4 | #define DRV8833_EN_Pin GPIO_PIN_2 5 | #define DRV8833_EN_GPIO_Port GPIOB 6 | 7 | HAL_StatusTypeDef drv8833_init() 8 | { 9 | GPIO_InitTypeDef GPIO_InitStruct = {0}; 10 | HAL_GPIO_WritePin(DRV8833_EN_GPIO_Port, DRV8833_EN_Pin, GPIO_PIN_RESET); 11 | GPIO_InitStruct.Pin = DRV8833_EN_Pin; 12 | GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; 13 | GPIO_InitStruct.Pull = GPIO_NOPULL; 14 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; 15 | HAL_GPIO_Init(DRV8833_EN_GPIO_Port, &GPIO_InitStruct); 16 | HAL_GPIO_WritePin(DRV8833_EN_GPIO_Port, DRV8833_EN_Pin, GPIO_PIN_SET); 17 | return pwm_init(); 18 | } 19 | 20 | void set_duty_cycle(MOTOR motor, MOTION motion, uint8_t duty_cycle) 21 | { 22 | switch (motor) { 23 | case MOTOR_L: 24 | switch (motion) { 25 | case BACKWARD: 26 | pwm_set_duty_cycle(TIM10, TIM_CHANNEL_1, duty_cycle); 27 | pwm_set_duty_cycle(TIM3, TIM_CHANNEL_3, 0); 28 | break; 29 | case FORWARD: 30 | pwm_set_duty_cycle(TIM10, TIM_CHANNEL_1, 0); 31 | pwm_set_duty_cycle(TIM3, TIM_CHANNEL_3, duty_cycle); 32 | break; 33 | case STOP: 34 | pwm_set_duty_cycle(TIM10, TIM_CHANNEL_1, 0); 35 | pwm_set_duty_cycle(TIM3, TIM_CHANNEL_3, 0); 36 | break; 37 | default: 38 | break; 39 | } 40 | break; 41 | case MOTOR_R: 42 | switch (motion) { 43 | case BACKWARD: 44 | pwm_set_duty_cycle(TIM3, TIM_CHANNEL_4, duty_cycle); 45 | pwm_set_duty_cycle(TIM13, TIM_CHANNEL_1, 0); 46 | break; 47 | case FORWARD: 48 | pwm_set_duty_cycle(TIM3, TIM_CHANNEL_4, 0); 49 | pwm_set_duty_cycle(TIM13, TIM_CHANNEL_1, duty_cycle); 50 | break; 51 | case STOP: 52 | pwm_set_duty_cycle(TIM3, TIM_CHANNEL_4, 0); 53 | pwm_set_duty_cycle(TIM13, TIM_CHANNEL_1, 0); 54 | break; 55 | default: 56 | break; 57 | } 58 | break; 59 | default: 60 | break; 61 | } 62 | HAL_GPIO_WritePin(DRV8833_EN_GPIO_Port, DRV8833_EN_Pin, GPIO_PIN_SET); 63 | } 64 | 65 | void stop_motors() 66 | { 67 | HAL_GPIO_WritePin(DRV8833_EN_GPIO_Port, DRV8833_EN_Pin, GPIO_PIN_RESET); 68 | } 69 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/AS5048B-HTSP/SOP65P640X120-14N.kicad_mod: -------------------------------------------------------------------------------- 1 | 2 | (module SOP65P640X120-14N (layer F.Cu) (tedit 6323024A) 3 | (descr "") 4 | (fp_text reference REF** (at -2.2449325 -3.2335215 0) (layer F.SilkS) 5 | (effects (font (size 0.512994488189 0.512994488189) (thickness 0.15))) 6 | ) 7 | (fp_text value SOP65P640X120-14N (at 1.7632075 3.2574125 0) (layer F.Fab) 8 | (effects (font (size 0.513208661417 0.513208661417) (thickness 0.15))) 9 | ) 10 | (pad 1 smd rect (at -2.87 -1.95 270.0) (size 0.41 1.47) (layers F.Cu F.Mask F.Paste)) 11 | (pad 2 smd rect (at -2.87 -1.3 270.0) (size 0.41 1.47) (layers F.Cu F.Mask F.Paste)) 12 | (pad 3 smd rect (at -2.87 -0.65 270.0) (size 0.41 1.47) (layers F.Cu F.Mask F.Paste)) 13 | (pad 4 smd rect (at -2.87 0.0 270.0) (size 0.41 1.47) (layers F.Cu F.Mask F.Paste)) 14 | (pad 5 smd rect (at -2.87 0.65 270.0) (size 0.41 1.47) (layers F.Cu F.Mask F.Paste)) 15 | (pad 6 smd rect (at -2.87 1.3 270.0) (size 0.41 1.47) (layers F.Cu F.Mask F.Paste)) 16 | (pad 7 smd rect (at -2.87 1.95 270.0) (size 0.41 1.47) (layers F.Cu F.Mask F.Paste)) 17 | (pad 8 smd rect (at 2.87 1.95 90.0) (size 0.41 1.47) (layers F.Cu F.Mask F.Paste)) 18 | (pad 9 smd rect (at 2.87 1.3 90.0) (size 0.41 1.47) (layers F.Cu F.Mask F.Paste)) 19 | (pad 10 smd rect (at 2.87 0.65 90.0) (size 0.41 1.47) (layers F.Cu F.Mask F.Paste)) 20 | (pad 11 smd rect (at 2.87 0.0 90.0) (size 0.41 1.47) (layers F.Cu F.Mask F.Paste)) 21 | (pad 12 smd rect (at 2.87 -0.65 90.0) (size 0.41 1.47) (layers F.Cu F.Mask F.Paste)) 22 | (pad 13 smd rect (at 2.87 -1.3 90.0) (size 0.41 1.47) (layers F.Cu F.Mask F.Paste)) 23 | (pad 14 smd rect (at 2.87 -1.95 90.0) (size 0.41 1.47) (layers F.Cu F.Mask F.Paste)) 24 | (fp_circle (center -4.27 -1.992) (end -4.17 -1.992) (layer F.SilkS) (width 0.2)) 25 | (fp_line (start -3.86 -2.8) (end 3.86 -2.8) (layer F.CrtYd) (width 0.05)) 26 | (fp_line (start 3.86 -2.8) (end 3.86 2.8) (layer F.CrtYd) (width 0.05)) 27 | (fp_line (start 3.86 2.8) (end -3.86 2.8) (layer F.CrtYd) (width 0.05)) 28 | (fp_line (start -3.86 2.8) (end -3.86 -2.8) (layer F.CrtYd) (width 0.05)) 29 | (fp_line (start -2.2 -2.5) (end -2.2 2.5) (layer F.Fab) (width 0.127)) 30 | (fp_line (start -2.2 2.5) (end 2.2 2.5) (layer F.Fab) (width 0.127)) 31 | (fp_line (start 2.2 2.5) (end 2.2 -2.5) (layer F.Fab) (width 0.127)) 32 | (fp_line (start 2.2 -2.5) (end -2.2 -2.5) (layer F.Fab) (width 0.127)) 33 | (fp_line (start -2.2 -2.5) (end 2.2 -2.5) (layer F.SilkS) (width 0.127)) 34 | (fp_line (start -2.2 2.5) (end 2.2 2.5) (layer F.SilkS) (width 0.127)) 35 | (fp_circle (center -4.27 -1.992) (end -4.17 -1.992) (layer F.Fab) (width 0.2)) 36 | ) -------------------------------------------------------------------------------- /firmware/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_hal_flash_ramfunc.h 4 | * @author MCD Application Team 5 | * @brief Header file of FLASH RAMFUNC driver. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | * Copyright (c) 2017 STMicroelectronics. 10 | * All rights reserved. 11 | * 12 | * This software is licensed under terms that can be found in the LICENSE file in 13 | * 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 | /* Define to prevent recursive inclusion -------------------------------------*/ 19 | #ifndef __STM32F4xx_FLASH_RAMFUNC_H 20 | #define __STM32F4xx_FLASH_RAMFUNC_H 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | #if defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx) || defined(STM32F411xE) || defined(STM32F446xx) || defined(STM32F412Zx) ||\ 26 | defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F412Cx) 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "stm32f4xx_hal_def.h" 30 | 31 | /** @addtogroup STM32F4xx_HAL_Driver 32 | * @{ 33 | */ 34 | 35 | /** @addtogroup FLASH_RAMFUNC 36 | * @{ 37 | */ 38 | 39 | /* Exported types ------------------------------------------------------------*/ 40 | /* Exported macro ------------------------------------------------------------*/ 41 | /* Exported functions --------------------------------------------------------*/ 42 | /** @addtogroup FLASH_RAMFUNC_Exported_Functions 43 | * @{ 44 | */ 45 | 46 | /** @addtogroup FLASH_RAMFUNC_Exported_Functions_Group1 47 | * @{ 48 | */ 49 | __RAM_FUNC HAL_StatusTypeDef HAL_FLASHEx_StopFlashInterfaceClk(void); 50 | __RAM_FUNC HAL_StatusTypeDef HAL_FLASHEx_StartFlashInterfaceClk(void); 51 | __RAM_FUNC HAL_StatusTypeDef HAL_FLASHEx_EnableFlashSleepMode(void); 52 | __RAM_FUNC HAL_StatusTypeDef HAL_FLASHEx_DisableFlashSleepMode(void); 53 | /** 54 | * @} 55 | */ 56 | 57 | /** 58 | * @} 59 | */ 60 | 61 | /** 62 | * @} 63 | */ 64 | 65 | /** 66 | * @} 67 | */ 68 | 69 | #endif /* STM32F410xx || STM32F411xE || STM32F446xx || STM32F412Zx || STM32F412Vx || STM32F412Rx || STM32F412Cx */ 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | 75 | #endif /* __STM32F4xx_FLASH_RAMFUNC_H */ 76 | 77 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/SFH_4045N/LED_SFH_4045N.kicad_mod: -------------------------------------------------------------------------------- 1 | 2 | (module LED_SFH_4045N (layer F.Cu) (tedit 62EF9736) 3 | (descr "") 4 | (fp_text reference REF** (at 0.54 -1.508 0) (layer F.SilkS) 5 | (effects (font (size 0.8 0.8) (thickness 0.15))) 6 | ) 7 | (fp_text value LED_SFH_4045N (at 4.604 2.992 0) (layer F.Fab) 8 | (effects (font (size 0.8 0.8) (thickness 0.15))) 9 | ) 10 | (pad 1 smd rect (at -1.35 0.0) (size 0.9 1.4) (layers F.Cu F.Mask F.Paste)) 11 | (pad 2 smd rect (at 1.35 0.0) (size 0.9 1.4) (layers F.Cu F.Mask F.Paste)) 12 | (fp_line (start 2.05 0.95) (end 1.05 0.95) (layer F.CrtYd) (width 0.05)) 13 | (fp_line (start 1.05 0.95) (end 1.05 2.35) (layer F.CrtYd) (width 0.05)) 14 | (fp_line (start 1.05 2.35) (end -1.05 2.35) (layer F.CrtYd) (width 0.05)) 15 | (fp_line (start -1.05 2.35) (end -1.05 0.95) (layer F.CrtYd) (width 0.05)) 16 | (fp_line (start -1.05 0.95) (end -2.05 0.95) (layer F.CrtYd) (width 0.05)) 17 | (fp_line (start -2.05 -0.95) (end 2.05 -0.95) (layer F.CrtYd) (width 0.05)) 18 | (fp_line (start 2.05 -0.95) (end 2.05 0.95) (layer F.CrtYd) (width 0.05)) 19 | (fp_line (start -2.05 0.95) (end -2.05 -0.95) (layer F.CrtYd) (width 0.05)) 20 | (fp_circle (center -2.38 0.0) (end -2.28 0.0) (layer F.SilkS) (width 0.2)) 21 | (fp_circle (center -2.38 0.0) (end -2.28 0.0) (layer F.Fab) (width 0.2)) 22 | (fp_line (start -1.5 0.55) (end -1.5 -0.55) (layer F.Fab) (width 0.127)) 23 | (fp_line (start -1.5 -0.55) (end 1.5 -0.55) (layer F.Fab) (width 0.127)) 24 | (fp_line (start 1.5 -0.55) (end 1.5 0.55) (layer F.Fab) (width 0.127)) 25 | (fp_line (start 1.5 0.55) (end 0.8 0.55) (layer F.Fab) (width 0.127)) 26 | (fp_line (start 0.8 0.55) (end -0.8 0.55) (layer F.Fab) (width 0.127)) 27 | (fp_line (start -0.8 0.55) (end -1.5 0.55) (layer F.Fab) (width 0.127)) 28 | (fp_line (start 0.58 0.55) (end -0.58 0.55) (layer F.SilkS) (width 0.127)) 29 | (fp_line (start -0.58 -0.55) (end 0.58 -0.55) (layer F.SilkS) (width 0.127)) 30 | (fp_line (start 0.8 0.55) (end 0.7 1.4) (layer F.Fab) (width 0.127)) 31 | (fp_arc (start -1.66533453694e-16 1.4) (end 0.0 2.1) (angle -90.0) (layer F.Fab) (width 0.127)) 32 | (fp_arc (start 1.66533453694e-16 1.4) (end -0.7 1.4) (angle -90.0) (layer F.Fab) (width 0.127)) 33 | (fp_line (start -0.7 1.4) (end -0.8 0.55) (layer F.Fab) (width 0.127)) 34 | (fp_line (start 0.747 1.0) (end 0.7 1.4) (layer F.SilkS) (width 0.127)) 35 | (fp_arc (start -1.66533453694e-16 1.4) (end 0.0 2.1) (angle -90.0) (layer F.SilkS) (width 0.127)) 36 | (fp_arc (start 1.66533453694e-16 1.4) (end -0.7 1.4) (angle -90.0) (layer F.SilkS) (width 0.127)) 37 | (fp_line (start -0.7 1.4) (end -0.747 1.0) (layer F.SilkS) (width 0.127)) 38 | ) -------------------------------------------------------------------------------- /firmware/Core/Src/stm32f4xx_hal_msp.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32f4xx_hal_msp.c 5 | * @brief This file provides code for the MSP Initialization 6 | * and de-Initialization codes. 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2023 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 | /* Includes ------------------------------------------------------------------*/ 22 | #include "main.h" 23 | 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 | /* USER CODE BEGIN MspInit 0 */ 67 | 68 | /* USER CODE END MspInit 0 */ 69 | 70 | __HAL_RCC_SYSCFG_CLK_ENABLE(); 71 | __HAL_RCC_PWR_CLK_ENABLE(); 72 | 73 | /* System interrupt init*/ 74 | /* PendSV_IRQn interrupt configuration */ 75 | HAL_NVIC_SetPriority(PendSV_IRQn, 15, 0); 76 | 77 | /* USER CODE BEGIN MspInit 1 */ 78 | 79 | /* USER CODE END MspInit 1 */ 80 | } 81 | 82 | /* USER CODE BEGIN 1 */ 83 | 84 | /* USER CODE END 1 */ 85 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/MPU-6500/MPU-6500.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | #(c) SnapEDA 2016 (snapeda.com) 4 | #This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA) with Design Exception 1.0 5 | # 6 | # MPU-6500 7 | # 8 | DEF MPU-6500 U 0 40 Y Y 1 L N 9 | F0 "U" -500 750 50 H V L BNN 10 | F1 "MPU-6500" -500 -750 50 H V L BNN 11 | F2 "QFN40P300X300X95-25N" 0 0 50 H I L BNN 12 | F3 "" 0 0 50 H I L BNN 13 | F4 "2.9" 0 0 50 H I L BNN "E_MIN" 14 | F5 "TDK InvenSense" 0 0 50 H I L BNN "MANUFACTURER" 15 | F6 "0.95 mm" 0 0 50 H I L BNN "MAXIMUM_PACKAGE_HEIGHT" 16 | F7 "1.7" 0 0 50 H I L BNN "D2_NOM" 17 | F8 "0.2" 0 0 50 H I L BNN "B_NOM" 18 | F9 "" 0 0 50 H I L BNN "SNAPEDA_PACKAGE_ID" 19 | F10 "" 0 0 50 H I L BNN "BALL_COLUMNS" 20 | F11 "6.0" 0 0 50 H I L BNN "PIN_COUNT_E" 21 | F12 "6.0" 0 0 50 H I L BNN "PIN_COUNT_D" 22 | F13 "" 0 0 50 H I L BNN "PINS" 23 | F14 "" 0 0 50 H I L BNN "PIN_COLUMNS" 24 | F15 "IPC 7351B" 0 0 50 H I L BNN "STANDARD" 25 | F16 "" 0 0 50 H I L BNN "BODY_DIAMETER" 26 | F17 "" 0 0 50 H I L BNN "VACANCIES" 27 | F18 "2.9" 0 0 50 H I L BNN "D_MIN" 28 | F19 "3.1" 0 0 50 H I L BNN "D_MAX" 29 | F20 "3.0" 0 0 50 H I L BNN "D_NOM" 30 | F21 "" 0 0 50 H I L BNN "DMAX" 31 | F22 "0.25" 0 0 50 H I L BNN "B_MAX" 32 | F23 "" 0 0 50 H I L BNN "IPC" 33 | F24 "0.15" 0 0 50 H I L BNN "B_MIN" 34 | F25 "1.54" 0 0 50 H I L BNN "E2_NOM" 35 | F26 "" 0 0 50 H I L BNN "DNOM" 36 | F27 "" 0 0 50 H I L BNN "BALL_ROWS" 37 | F28 "0.3" 0 0 50 H I L BNN "L_NOM" 38 | F29 "3.0" 0 0 50 H I L BNN "E_NOM" 39 | F30 "0.25" 0 0 50 H I L BNN "L_MAX" 40 | F31 "" 0 0 50 H I L BNN "THERMAL_PAD" 41 | F32 "1.3" 0 0 50 H I L BNN "PARTREV" 42 | F33 "0.15" 0 0 50 H I L BNN "L_MIN" 43 | F34 "3.1" 0 0 50 H I L BNN "E_MAX" 44 | F35 "" 0 0 50 H I L BNN "JEDEC" 45 | F36 "" 0 0 50 H I L BNN "EMIN" 46 | F37 "0.4" 0 0 50 H I L BNN "ENOM" 47 | F38 "" 0 0 50 H I L BNN "PACKAGE_TYPE" 48 | F39 "" 0 0 50 H I L BNN "DMIN" 49 | F40 "" 0 0 50 H I L BNN "EMAX" 50 | DRAW 51 | S -500 -700 500 700 0 0 10 f 52 | X AUX_CL 7 -700 -100 200 R 40 40 0 0 I C 53 | X VDDIO 8 700 500 200 L 40 40 0 0 W 54 | X AD0/SDO 9 700 200 200 L 40 40 0 0 O 55 | X REGOUT 10 700 -100 200 L 40 40 0 0 O 56 | X FSYNC 11 -700 -400 200 R 40 40 0 0 I 57 | X INT 12 700 300 200 L 40 40 0 0 O 58 | X VDD 13 700 600 200 L 40 40 0 0 W 59 | X GND 18 700 -600 200 L 40 40 0 0 W 60 | X RESV_1 19 700 -200 200 L 40 40 0 0 P 61 | X AUX_DA 21 -700 -200 200 R 40 40 0 0 B 62 | X NCS 22 -700 300 200 R 40 40 0 0 I 63 | X SCL/SCLK 23 -700 200 200 R 40 40 0 0 I C 64 | X SDA/SDI 24 -700 100 200 R 40 40 0 0 B 65 | X RESV_2 20 700 -300 200 L 40 40 0 0 P 66 | X EXP 25 700 -500 200 L 40 40 0 0 P 67 | ENDDRAW 68 | ENDDEF 69 | # 70 | # End Library -------------------------------------------------------------------------------- /pcb_design/component_libraries/VL53L0CXV0DH_1/XDCR_VL53L0CXV0DH_1.kicad_mod: -------------------------------------------------------------------------------- 1 | 2 | (footprint XDCR_VL53L0CXV0DH/1 (layer F.Cu) (tedit 63F63A4F) 3 | (descr "") 4 | (attr smd) 5 | (fp_text reference REF** (at 0.2744725 -2.8296765 0) (layer F.SilkS) 6 | (effects (font (size 0.480829133858 0.480829133858) (thickness 0.15))) 7 | ) 8 | (fp_text value XDCR_VL53L0CXV0DH/1 (at 4.541247 2.865227 0) (layer F.Fab) 9 | (effects (font (size 0.480004724409 0.480004724409) (thickness 0.15))) 10 | ) 11 | (pad 10 smd rect (at -0.8 -0.8) (size 0.5 0.5) (layers F.Cu F.Mask F.Paste)) 12 | (pad 9 smd rect (at -0.8 0.0) (size 0.5 0.5) (layers F.Cu F.Mask F.Paste)) 13 | (pad 11 smd rect (at -0.8 -1.6) (size 0.5 0.5) (layers F.Cu F.Mask F.Paste)) 14 | (pad 8 smd rect (at -0.8 0.8) (size 0.5 0.5) (layers F.Cu F.Mask F.Paste)) 15 | (pad 2 smd rect (at 0.8 -0.8) (size 0.5 0.5) (layers F.Cu F.Mask F.Paste)) 16 | (pad 3 smd rect (at 0.8 0.0) (size 0.5 0.5) (layers F.Cu F.Mask F.Paste)) 17 | (pad 4 smd rect (at 0.8 0.8) (size 0.5 0.5) (layers F.Cu F.Mask F.Paste)) 18 | (pad 5 smd rect (at 0.8 1.6) (size 0.5 0.5) (layers F.Cu F.Mask F.Paste)) 19 | (pad 12 smd rect (at 0.0 -1.6) (size 0.5 0.5) (layers F.Cu F.Mask F.Paste)) 20 | (pad 1 smd rect (at 0.8 -1.6) (size 0.5 0.5) (layers F.Cu F.Mask F.Paste)) 21 | (pad 6 smd rect (at 0.0 1.6) (size 0.5 0.5) (layers F.Cu F.Mask F.Paste)) 22 | (pad 7 smd rect (at -0.8 1.6) (size 0.5 0.5) (layers F.Cu F.Mask F.Paste)) 23 | (pad 1.1 smd rect (at 0.675 -1.89) (size 0.25 0.08) (layers F.Cu F.Mask F.Paste)) 24 | (fp_line (start -1.2 -2.2) (end 1.2 -2.2) (layer F.SilkS) (width 0.127)) 25 | (fp_line (start 1.2 -2.2) (end 1.2 2.2) (layer F.Fab) (width 0.127)) 26 | (fp_line (start 1.2 2.2) (end -1.2 2.2) (layer F.SilkS) (width 0.127)) 27 | (fp_line (start -1.2 2.2) (end -1.2 -2.2) (layer F.Fab) (width 0.127)) 28 | (fp_line (start -1.477 -2.477) (end 1.477 -2.477) (layer F.CrtYd) (width 0.05)) 29 | (fp_line (start 1.477 -2.477) (end 1.477 2.477) (layer F.CrtYd) (width 0.05)) 30 | (fp_line (start 1.477 2.477) (end -1.477 2.477) (layer F.CrtYd) (width 0.05)) 31 | (fp_line (start -1.477 2.477) (end -1.477 -2.477) (layer F.CrtYd) (width 0.05)) 32 | (fp_circle (center 1.444 -1.689) (end 1.544 -1.689) (layer F.SilkS) (width 0.0)) 33 | (fp_line (start -1.2 -2.2) (end 1.2 -2.2) (layer F.Fab) (width 0.127)) 34 | (fp_line (start 1.2 2.2) (end -1.2 2.2) (layer F.Fab) (width 0.127)) 35 | (fp_line (start -1.2 -2.2) (end -1.2 -2.1) (layer F.SilkS) (width 0.127)) 36 | (fp_line (start 1.2 -2.2) (end 1.2 -2.1) (layer F.SilkS) (width 0.127)) 37 | (fp_line (start -1.2 2.2) (end -1.2 2.1) (layer F.SilkS) (width 0.127)) 38 | (fp_line (start 1.2 2.2) (end 1.2 2.1) (layer F.SilkS) (width 0.127)) 39 | ) -------------------------------------------------------------------------------- /firmware/Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file system_stm32f4xx.h 4 | * @author MCD Application Team 5 | * @brief CMSIS Cortex-M4 Device System Source File for STM32F4xx devices. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | * Copyright (c) 2017 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 | 19 | /** @addtogroup CMSIS 20 | * @{ 21 | */ 22 | 23 | /** @addtogroup stm32f4xx_system 24 | * @{ 25 | */ 26 | 27 | /** 28 | * @brief Define to prevent recursive inclusion 29 | */ 30 | #ifndef __SYSTEM_STM32F4XX_H 31 | #define __SYSTEM_STM32F4XX_H 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | /** @addtogroup STM32F4xx_System_Includes 38 | * @{ 39 | */ 40 | 41 | /** 42 | * @} 43 | */ 44 | 45 | 46 | /** @addtogroup STM32F4xx_System_Exported_types 47 | * @{ 48 | */ 49 | /* This variable is updated in three ways: 50 | 1) by calling CMSIS function SystemCoreClockUpdate() 51 | 2) by calling HAL API function HAL_RCC_GetSysClockFreq() 52 | 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency 53 | Note: If you use this function to configure the system clock; then there 54 | is no need to call the 2 first functions listed above, since SystemCoreClock 55 | variable is updated automatically. 56 | */ 57 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 58 | 59 | extern const uint8_t AHBPrescTable[16]; /*!< AHB prescalers table values */ 60 | extern const uint8_t APBPrescTable[8]; /*!< APB prescalers table values */ 61 | 62 | /** 63 | * @} 64 | */ 65 | 66 | /** @addtogroup STM32F4xx_System_Exported_Constants 67 | * @{ 68 | */ 69 | 70 | /** 71 | * @} 72 | */ 73 | 74 | /** @addtogroup STM32F4xx_System_Exported_Macros 75 | * @{ 76 | */ 77 | 78 | /** 79 | * @} 80 | */ 81 | 82 | /** @addtogroup STM32F4xx_System_Exported_Functions 83 | * @{ 84 | */ 85 | 86 | extern void SystemInit(void); 87 | extern void SystemCoreClockUpdate(void); 88 | /** 89 | * @} 90 | */ 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | #endif /*__SYSTEM_STM32F4XX_H */ 97 | 98 | /** 99 | * @} 100 | */ 101 | 102 | /** 103 | * @} 104 | */ 105 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/AMS1117-3.3/License.txt: -------------------------------------------------------------------------------- 1 | BY ACCESSING OR USING THESE SYMBOLS & FOOTPRINTS ("MODELS"), YOU ARE ACKNOWLEDGING THAT YOU HAVE READ, FULLY UNDERSTAND AND AGREE TO THESE TERMS AND CONDITIONS (the "Agreement"), WHICH CONSTITUTE A BINDING AGREEMENT BETWEEN YOU AND SNAPEDA, INC., ENTERED INTO ON THE DATE OF SUCH OCCURRENCE (the "Effective Date"). IF YOU ARE ACCESSING OR USING THESE FILES ON BEHALF OF AN ENTITY, YOU REPRESENT THAT YOU HAVE THE RIGHT, AUTHORITY, AND CAPACITY TO BIND SUCH ENTITY TO THIS AGREEMENT AND HEREBY DO SO. IF YOU DO NOT AGREE WITH ANY OF THE TERMS OR CONDITIONS OF THIS AGREEMENT, YOU MUST NOT USE ANY PART OF THESE MODELS. 2 | 3 | 1. Design License 4 | 5 | You and your sub-licensees are hereby licensed to design, manufacture, use and distribute, circuit board designs and circuit boards formed by combining Models provided by SnapEDA with other circuit elements of your choosing. You may then convey such combinations under licensing terms of your choice.  6 | 7 | Individual Models remain the intellectual property of SnapEDA, Inc. You shall not (and shall not permit or encourage any third party to) to do any of the following : 8 | 9 | (a) sell, assign, lease, lend, rent, issue, sublicense, make available, or otherwise distribute to any third party, or publicly perform, display or communicate, the Models (for example, by uploading Models to another website or software application);
 10 | (b) remove, alter, or conceal, any copyright, trademark, or other proprietary rights notice or legend displayed or contained in the individual Models. 11 | 12 | For further clarity, once integrated into a schematic design or PCB layout, Models may be modified freely for the purpose of designing a circuit board.  13 | 14 | 15 | 2. Limitation of Liability 16 | 17 | IN NO EVENT WILL SNAPEDA OR OUR SUBSIDIARIES, AGENTS, SUCCESSORS, THIRD PARTY PROVIDERS, AND/OR ANY OF THE FOREGOING ENTITIES' RESPECTIVE DIRECTORS, OFFICERS, EMPLOYEES, AGENTS, REPRESENTATIVES, CUSTOMERS, SUPPLIERS, OR LICENSORS BE RESPONSIBLE OR LIABLE UNDER, OR OTHERWISE IN CONNECTION WITH THIS AGREEMENT, FOR: 18 | 19 | (a) ANY CONSEQUENTIAL, INDIRECT, SPECIAL, INCIDENTAL, OR PUNITIVE DAMAGES; 20 | (b) ANY LOSS OF PROFITS, LOSS OF BUSINESS, LOSS OF REVENUE, OR LOSS OF ANTICIPATED SAVINGS; 21 | (c) ANY LOSS OF, OR DAMAGE TO, DATA, REPUTATION, OR GOODWILL; AND/OR 22 | (d) THE COST OF PROCURING ANY SUBSTITUTE GOODS OR SERVICES. 23 | 24 | THE COMBINED AGGREGATE LIABILITY OF SNAPEDA AND ALL SNAPEDA CONTENT AFFILIATES UNDER, OR OTHERWISE IN CONNECTION WITH, THIS AGREEMENT SHALL NOT EXCEED THE TOTAL AMOUNT OF FEES RECEIVED BY SNAPEDA FROM YOU IN THE PREVIOUS TWELVE (12) MONTHS. THE FOREGOING EXCLUSIONS AND LIMITATIONS SHALL APPLY: (a) EVEN IF SNAPEDA OR ANY SNAPEDA CONTENT AFFILIATE HAS BEEN ADVISED, OR SHOULD HAVE BEEN AWARE, OF THE POSSIBILITY OF LOSSES, DAMAGES, OR COSTS; (b) EVEN IF ANY REMEDY IN THIS AGREEMENT FAILS OF ITS ESSENTIAL PURPOSE; AND (c) REGARDLESS OF THE THEORY OR BASIS OF LIABILITY (INCLUDING WITHOUT LIMITATION BREACH OF CONTRACT, TORT, NEGLIGENCE, AND STRICT LIABILITY). -------------------------------------------------------------------------------- /pcb_design/component_libraries/AS5048B-HTSP/License.txt: -------------------------------------------------------------------------------- 1 | BY ACCESSING OR USING THESE SYMBOLS & FOOTPRINTS ("MODELS"), YOU ARE ACKNOWLEDGING THAT YOU HAVE READ, FULLY UNDERSTAND AND AGREE TO THESE TERMS AND CONDITIONS (the "Agreement"), WHICH CONSTITUTE A BINDING AGREEMENT BETWEEN YOU AND SNAPEDA, INC., ENTERED INTO ON THE DATE OF SUCH OCCURRENCE (the "Effective Date"). IF YOU ARE ACCESSING OR USING THESE FILES ON BEHALF OF AN ENTITY, YOU REPRESENT THAT YOU HAVE THE RIGHT, AUTHORITY, AND CAPACITY TO BIND SUCH ENTITY TO THIS AGREEMENT AND HEREBY DO SO. IF YOU DO NOT AGREE WITH ANY OF THE TERMS OR CONDITIONS OF THIS AGREEMENT, YOU MUST NOT USE ANY PART OF THESE MODELS. 2 | 3 | 1. Design License 4 | 5 | You and your sub-licensees are hereby licensed to design, manufacture, use and distribute, circuit board designs and circuit boards formed by combining Models provided by SnapEDA with other circuit elements of your choosing. You may then convey such combinations under licensing terms of your choice.  6 | 7 | Individual Models remain the intellectual property of SnapEDA, Inc. You shall not (and shall not permit or encourage any third party to) to do any of the following : 8 | 9 | (a) sell, assign, lease, lend, rent, issue, sublicense, make available, or otherwise distribute to any third party, or publicly perform, display or communicate, the Models (for example, by uploading Models to another website or software application);
 10 | (b) remove, alter, or conceal, any copyright, trademark, or other proprietary rights notice or legend displayed or contained in the individual Models. 11 | 12 | For further clarity, once integrated into a schematic design or PCB layout, Models may be modified freely for the purpose of designing a circuit board.  13 | 14 | 15 | 2. Limitation of Liability 16 | 17 | IN NO EVENT WILL SNAPEDA OR OUR SUBSIDIARIES, AGENTS, SUCCESSORS, THIRD PARTY PROVIDERS, AND/OR ANY OF THE FOREGOING ENTITIES' RESPECTIVE DIRECTORS, OFFICERS, EMPLOYEES, AGENTS, REPRESENTATIVES, CUSTOMERS, SUPPLIERS, OR LICENSORS BE RESPONSIBLE OR LIABLE UNDER, OR OTHERWISE IN CONNECTION WITH THIS AGREEMENT, FOR: 18 | 19 | (a) ANY CONSEQUENTIAL, INDIRECT, SPECIAL, INCIDENTAL, OR PUNITIVE DAMAGES; 20 | (b) ANY LOSS OF PROFITS, LOSS OF BUSINESS, LOSS OF REVENUE, OR LOSS OF ANTICIPATED SAVINGS; 21 | (c) ANY LOSS OF, OR DAMAGE TO, DATA, REPUTATION, OR GOODWILL; AND/OR 22 | (d) THE COST OF PROCURING ANY SUBSTITUTE GOODS OR SERVICES. 23 | 24 | THE COMBINED AGGREGATE LIABILITY OF SNAPEDA AND ALL SNAPEDA CONTENT AFFILIATES UNDER, OR OTHERWISE IN CONNECTION WITH, THIS AGREEMENT SHALL NOT EXCEED THE TOTAL AMOUNT OF FEES RECEIVED BY SNAPEDA FROM YOU IN THE PREVIOUS TWELVE (12) MONTHS. THE FOREGOING EXCLUSIONS AND LIMITATIONS SHALL APPLY: (a) EVEN IF SNAPEDA OR ANY SNAPEDA CONTENT AFFILIATE HAS BEEN ADVISED, OR SHOULD HAVE BEEN AWARE, OF THE POSSIBILITY OF LOSSES, DAMAGES, OR COSTS; (b) EVEN IF ANY REMEDY IN THIS AGREEMENT FAILS OF ITS ESSENTIAL PURPOSE; AND (c) REGARDLESS OF THE THEORY OR BASIS OF LIABILITY (INCLUDING WITHOUT LIMITATION BREACH OF CONTRACT, TORT, NEGLIGENCE, AND STRICT LIABILITY). -------------------------------------------------------------------------------- /firmware/Drivers/CMSIS/Include/tz_context.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * @file tz_context.h 3 | * @brief Context Management for Armv8-M TrustZone 4 | * @version V1.0.1 5 | * @date 10. January 2018 6 | ******************************************************************************/ 7 | /* 8 | * Copyright (c) 2017-2018 Arm Limited. All rights reserved. 9 | * 10 | * SPDX-License-Identifier: Apache-2.0 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the License); you may 13 | * not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 20 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | #if defined ( __ICCARM__ ) 26 | #pragma system_include /* treat file as system include file for MISRA check */ 27 | #elif defined (__clang__) 28 | #pragma clang system_header /* treat file as system include file */ 29 | #endif 30 | 31 | #ifndef TZ_CONTEXT_H 32 | #define TZ_CONTEXT_H 33 | 34 | #include 35 | 36 | #ifndef TZ_MODULEID_T 37 | #define TZ_MODULEID_T 38 | /// \details Data type that identifies secure software modules called by a process. 39 | typedef uint32_t TZ_ModuleId_t; 40 | #endif 41 | 42 | /// \details TZ Memory ID identifies an allocated memory slot. 43 | typedef uint32_t TZ_MemoryId_t; 44 | 45 | /// Initialize secure context memory system 46 | /// \return execution status (1: success, 0: error) 47 | uint32_t TZ_InitContextSystem_S (void); 48 | 49 | /// Allocate context memory for calling secure software modules in TrustZone 50 | /// \param[in] module identifies software modules called from non-secure mode 51 | /// \return value != 0 id TrustZone memory slot identifier 52 | /// \return value 0 no memory available or internal error 53 | TZ_MemoryId_t TZ_AllocModuleContext_S (TZ_ModuleId_t module); 54 | 55 | /// Free context memory that was previously allocated with \ref TZ_AllocModuleContext_S 56 | /// \param[in] id TrustZone memory slot identifier 57 | /// \return execution status (1: success, 0: error) 58 | uint32_t TZ_FreeModuleContext_S (TZ_MemoryId_t id); 59 | 60 | /// Load secure context (called on RTOS thread context switch) 61 | /// \param[in] id TrustZone memory slot identifier 62 | /// \return execution status (1: success, 0: error) 63 | uint32_t TZ_LoadContext_S (TZ_MemoryId_t id); 64 | 65 | /// Store secure context (called on RTOS thread context switch) 66 | /// \param[in] id TrustZone memory slot identifier 67 | /// \return execution status (1: success, 0: error) 68 | uint32_t TZ_StoreContext_S (TZ_MemoryId_t id); 69 | 70 | #endif // TZ_CONTEXT_H 71 | -------------------------------------------------------------------------------- /firmware/Drivers/Logger/log.c: -------------------------------------------------------------------------------- 1 | #include "log.h" 2 | 3 | #include 4 | #include 5 | 6 | #ifdef SEMIHOSTING 7 | extern void initialise_monitor_handles(void); 8 | // #else 9 | // int _write(int file, char *ptr, int len) { 10 | // HAL_UART_Transmit(&huart2, (uint8_t *) ptr, len, HAL_MAX_DELAY); 11 | // return len; 12 | // } 13 | #endif 14 | 15 | UART_HandleTypeDef huart2; 16 | static bool logger_initialised = false; 17 | 18 | static void MX_USART2_UART_Init(void) 19 | { 20 | huart2.Instance = USART2; 21 | huart2.Init.BaudRate = 115200; 22 | huart2.Init.WordLength = UART_WORDLENGTH_8B; 23 | huart2.Init.StopBits = UART_STOPBITS_1; 24 | huart2.Init.Parity = UART_PARITY_NONE; 25 | huart2.Init.Mode = UART_MODE_TX_RX; 26 | huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE; 27 | huart2.Init.OverSampling = UART_OVERSAMPLING_16; 28 | // if (HAL_UART_Init(&huart2) != HAL_OK) 29 | // { 30 | // Error_Handler(); 31 | // } 32 | } 33 | 34 | void set_log_level(stm32_log_level_t log_level) { 35 | if (!logger_initialised) { 36 | #ifdef SEMIHOSTING 37 | initialise_monitor_handles(); 38 | #else 39 | MX_USART2_UART_Init(); 40 | #endif 41 | logger_initialised = true; 42 | } 43 | switch(log_level) { 44 | case LOG_ERROR: 45 | printf(LOG_COLOR_E); 46 | break; 47 | case LOG_WARN: 48 | printf(LOG_COLOR_W); 49 | break; 50 | case LOG_INFO: 51 | printf(LOG_COLOR_I); 52 | break; 53 | case LOG_DEBUG: 54 | printf(LOG_COLOR_D); 55 | break; 56 | case LOG_VERBOSE: 57 | printf(LOG_COLOR_V); 58 | break; 59 | default: 60 | break; 61 | } 62 | } 63 | 64 | void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle) 65 | { 66 | 67 | GPIO_InitTypeDef GPIO_InitStruct = {0}; 68 | if(uartHandle->Instance==USART2) 69 | { 70 | __HAL_RCC_USART2_CLK_ENABLE(); 71 | 72 | __HAL_RCC_GPIOA_CLK_ENABLE(); 73 | /**USART2 GPIO Configuration 74 | PA2 ------> USART2_TX 75 | PA3 ------> USART2_RX 76 | */ 77 | GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3; 78 | GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; 79 | GPIO_InitStruct.Pull = GPIO_NOPULL; 80 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; 81 | GPIO_InitStruct.Alternate = GPIO_AF7_USART2; 82 | HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); 83 | } 84 | } 85 | 86 | void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle) 87 | { 88 | 89 | if(uartHandle->Instance==USART2) 90 | { 91 | /* Peripheral clock disable */ 92 | __HAL_RCC_USART2_CLK_DISABLE(); 93 | 94 | /**USART2 GPIO Configuration 95 | PA2 ------> USART2_TX 96 | PA3 ------> USART2_RX 97 | */ 98 | HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2|GPIO_PIN_3); 99 | 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /firmware/Drivers/Logger/log.h: -------------------------------------------------------------------------------- 1 | #ifndef __LOG_H__ 2 | #define __LOG_H__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include "stm32f4xx.h" 9 | 10 | extern UART_HandleTypeDef huart2; 11 | 12 | // int _write(int file, char *ptr, int len) { 13 | // HAL_UART_Transmit(&huart1, (uint8_t *) ptr, len, HAL_MAX_DELAY); 14 | // return len; 15 | // } 16 | 17 | #define LOG_COLOR_BLACK "30" 18 | #define LOG_COLOR_RED "31" 19 | #define LOG_COLOR_GREEN "32" 20 | #define LOG_COLOR_BROWN "33" 21 | #define LOG_COLOR_BLUE "34" 22 | #define LOG_COLOR_PURPLE "35" 23 | #define LOG_COLOR_CYAN "36" 24 | #define LOG_COLOR(COLOR) "\033[0;" COLOR "m" 25 | #define LOG_BOLD(COLOR) "\033[1;" COLOR "m" 26 | #define LOG_RESET_COLOR "\033[0m" 27 | #define LOG_COLOR_E LOG_COLOR(LOG_COLOR_RED) 28 | #define LOG_COLOR_W LOG_COLOR(LOG_COLOR_BROWN) 29 | #define LOG_COLOR_I LOG_COLOR(LOG_COLOR_GREEN) 30 | #define LOG_COLOR_D LOG_COLOR(LOG_COLOR_CYAN) 31 | #define LOG_COLOR_V LOG_COLOR(LOG_COLOR_PURPLE) 32 | 33 | typedef enum 34 | { 35 | LOG_NONE, /*!< No log output */ 36 | LOG_ERROR, /*!< Critical errors, software module can not recover on its own */ 37 | LOG_WARN, /*!< Error conditions from which recovery measures have been taken */ 38 | LOG_INFO, /*!< Information messages which describe normal flow of events */ 39 | LOG_DEBUG, /*!< Extra information which is not necessary for normal use (values, pointers, sizes, etc). */ 40 | LOG_VERBOSE /*!< Bigger chunks of debugging information, or frequent messages which can potentially flood the output. */ 41 | } stm32_log_level_t; 42 | 43 | void set_log_level(stm32_log_level_t log_level); 44 | 45 | #define DEBUG 1 46 | // TODO: Add a macro so that all the printf can be removed if debug is disabled 47 | #define LOGE(TAG, fmt, ...) \ 48 | set_log_level(LOG_ERROR); \ 49 | printf("(%ld) %s: %s(%d):" fmt, HAL_GetTick(), TAG, __FUNCTION__, __LINE__, __VA_ARGS__); \ 50 | printf("\n"); 51 | 52 | #define LOGW(TAG, fmt, ...) \ 53 | set_log_level(LOG_WARN); \ 54 | printf("(%ld) %s: %s(%d):" fmt, HAL_GetTick(), TAG, __FUNCTION__, __LINE__, __VA_ARGS__); \ 55 | printf("\n"); 56 | 57 | #define LOGI(TAG, fmt, ...) \ 58 | set_log_level(LOG_INFO); \ 59 | printf("(%ld) %s: %s(%d):" fmt, HAL_GetTick(), TAG, __FUNCTION__, __LINE__, __VA_ARGS__); \ 60 | printf("\n"); 61 | 62 | #define LOGD(TAG, fmt, ...) \ 63 | set_log_level(LOG_DEBUG); \ 64 | printf("(%ld) %s: %s(%d):" fmt, HAL_GetTick(), TAG, __FUNCTION__, __LINE__, __VA_ARGS__); \ 65 | printf("\n"); 66 | 67 | #define LOGV(TAG, fmt, ...) \ 68 | set_log_level(LOG_VERBOSE); \ 69 | printf("(%ld) %s: %s(%d):" fmt, HAL_GetTick(), TAG, __FUNCTION__, __LINE__, __VA_ARGS__); \ 70 | printf("\n"); 71 | 72 | #define HAL_ERROR_CHECK(a, statement, ret) \ 73 | if (!(a)) { \ 74 | LOGE(TAG, "%s", statement); \ 75 | return ret; \ 76 | } 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/DRV8833PW/SOP65P640X120-16N.kicad_mod: -------------------------------------------------------------------------------- 1 | 2 | (module SOP65P640X120-16N (layer F.Cu) (tedit 62EF9415) 3 | (descr "") 4 | (fp_text reference REF** (at -0.325 -3.635 0) (layer F.SilkS) 5 | (effects (font (size 1.0 1.0) (thickness 0.15))) 6 | ) 7 | (fp_text value SOP65P640X120-16N (at 7.295 3.635 0) (layer F.Fab) 8 | (effects (font (size 1.0 1.0) (thickness 0.15))) 9 | ) 10 | (pad 1 smd roundrect (roundrect_rratio 0.05) (at -2.87 -2.275) (size 1.57 0.41) (layers F.Cu F.Mask F.Paste)) 11 | (pad 2 smd roundrect (roundrect_rratio 0.05) (at -2.87 -1.625) (size 1.57 0.41) (layers F.Cu F.Mask F.Paste)) 12 | (pad 3 smd roundrect (roundrect_rratio 0.05) (at -2.87 -0.975) (size 1.57 0.41) (layers F.Cu F.Mask F.Paste)) 13 | (pad 4 smd roundrect (roundrect_rratio 0.05) (at -2.87 -0.325) (size 1.57 0.41) (layers F.Cu F.Mask F.Paste)) 14 | (pad 5 smd roundrect (roundrect_rratio 0.05) (at -2.87 0.325) (size 1.57 0.41) (layers F.Cu F.Mask F.Paste)) 15 | (pad 6 smd roundrect (roundrect_rratio 0.05) (at -2.87 0.975) (size 1.57 0.41) (layers F.Cu F.Mask F.Paste)) 16 | (pad 7 smd roundrect (roundrect_rratio 0.05) (at -2.87 1.625) (size 1.57 0.41) (layers F.Cu F.Mask F.Paste)) 17 | (pad 8 smd roundrect (roundrect_rratio 0.05) (at -2.87 2.275) (size 1.57 0.41) (layers F.Cu F.Mask F.Paste)) 18 | (pad 9 smd roundrect (roundrect_rratio 0.05) (at 2.87 2.275) (size 1.57 0.41) (layers F.Cu F.Mask F.Paste)) 19 | (pad 10 smd roundrect (roundrect_rratio 0.05) (at 2.87 1.625) (size 1.57 0.41) (layers F.Cu F.Mask F.Paste)) 20 | (pad 11 smd roundrect (roundrect_rratio 0.05) (at 2.87 0.975) (size 1.57 0.41) (layers F.Cu F.Mask F.Paste)) 21 | (pad 12 smd roundrect (roundrect_rratio 0.05) (at 2.87 0.325) (size 1.57 0.41) (layers F.Cu F.Mask F.Paste)) 22 | (pad 13 smd roundrect (roundrect_rratio 0.05) (at 2.87 -0.325) (size 1.57 0.41) (layers F.Cu F.Mask F.Paste)) 23 | (pad 14 smd roundrect (roundrect_rratio 0.05) (at 2.87 -0.975) (size 1.57 0.41) (layers F.Cu F.Mask F.Paste)) 24 | (pad 15 smd roundrect (roundrect_rratio 0.05) (at 2.87 -1.625) (size 1.57 0.41) (layers F.Cu F.Mask F.Paste)) 25 | (pad 16 smd roundrect (roundrect_rratio 0.05) (at 2.87 -2.275) (size 1.57 0.41) (layers F.Cu F.Mask F.Paste)) 26 | (fp_circle (center -4.19 -2.275) (end -4.09 -2.275) (layer F.SilkS) (width 0.2)) 27 | (fp_circle (center -4.19 -2.275) (end -4.09 -2.275) (layer F.Fab) (width 0.2)) 28 | (fp_line (start -2.2 -2.5) (end 2.2 -2.5) (layer F.Fab) (width 0.127)) 29 | (fp_line (start -2.2 2.5) (end 2.2 2.5) (layer F.Fab) (width 0.127)) 30 | (fp_line (start -1.765 -2.5) (end 1.765 -2.5) (layer F.SilkS) (width 0.127)) 31 | (fp_line (start -2.2 -2.5) (end -2.2 2.5) (layer F.Fab) (width 0.127)) 32 | (fp_line (start 2.2 -2.5) (end 2.2 2.5) (layer F.Fab) (width 0.127)) 33 | (fp_line (start -3.905 -2.75) (end 3.905 -2.75) (layer F.CrtYd) (width 0.05)) 34 | (fp_line (start -3.905 2.75) (end 3.905 2.75) (layer F.CrtYd) (width 0.05)) 35 | (fp_line (start -3.905 -2.75) (end -3.905 2.75) (layer F.CrtYd) (width 0.05)) 36 | (fp_line (start 3.905 -2.75) (end 3.905 2.75) (layer F.CrtYd) (width 0.05)) 37 | (fp_line (start 1.765 2.5) (end -1.765 2.5) (layer F.SilkS) (width 0.127)) 38 | ) -------------------------------------------------------------------------------- /pcb_design/component_libraries/mushak_mount_footprint/IR_HOST_04.kicad_mod: -------------------------------------------------------------------------------- 1 | (footprint "IR_HOST_04" (version 20211014) (generator pcbnew) 2 | (layer "F.Cu") 3 | (tedit 5E4A8E91) 4 | (attr through_hole) 5 | (fp_text reference "J12" (at 0 0.5 -180) (layer "F.Fab") 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | (tstamp 2d49096c-bc9c-48af-9bfd-6d80e3d95702) 8 | ) 9 | (fp_text value "IR" (at 0 -0.5 -180) (layer "F.Fab") 10 | (effects (font (size 1 1) (thickness 0.15))) 11 | (tstamp f1156f76-9824-433b-9d05-a8a18c0f6132) 12 | ) 13 | (fp_line (start 0 0) (end 0 90) (layer "B.Fab") (width 0.15) (tstamp 71c01986-d6c3-47e8-9ec9-763b120aa178)) 14 | (fp_line (start 20 90) (end 0 0) (layer "B.Fab") (width 0.15) (tstamp 7df11d22-7d0b-43a5-8acd-5a0231295d49)) 15 | (fp_line (start 0 0) (end -20 90) (layer "B.Fab") (width 0.15) (tstamp d786996d-24dd-49cd-a101-b889c5e51c0d)) 16 | (fp_line (start -0.2 1.8) (end 0.2 1.8) (layer "F.Fab") (width 0.15) (tstamp 17ae5bef-11d5-440b-848c-f77d83b0fcbb)) 17 | (fp_line (start -2.6 0.6) (end -2.6 1.8) (layer "F.Fab") (width 0.15) (tstamp 1c27cd0c-1d4d-4ea2-b971-775079093f76)) 18 | (fp_line (start 0.2 1.8) (end 0.2 2.4) (layer "F.Fab") (width 0.15) (tstamp 53f37e0c-867b-471a-a074-212636abbe41)) 19 | (fp_line (start 2.6 0.6) (end -2.6 0.6) (layer "F.Fab") (width 0.15) (tstamp 57352bb3-205f-478c-9164-34bf989e61e2)) 20 | (fp_line (start 2.2 1.8) (end 2.6 1.8) (layer "F.Fab") (width 0.15) (tstamp 74581cb7-0939-46be-96c4-96df4ec92b68)) 21 | (fp_line (start 2.6 1.8) (end 2.6 0.6) (layer "F.Fab") (width 0.15) (tstamp 9ba64635-29df-46d8-93fa-c8a3ab0de83b)) 22 | (fp_line (start -0.2 2.4) (end -0.2 1.8) (layer "F.Fab") (width 0.15) (tstamp a541d7c7-d650-4e4b-ac78-e4ae99f55fd9)) 23 | (fp_line (start -2.2 1.8) (end -2.2 2.4) (layer "F.Fab") (width 0.15) (tstamp abeb3474-299e-4fa9-a78f-1f0c0a31de3e)) 24 | (fp_line (start -2.6 1.8) (end -2.2 1.8) (layer "F.Fab") (width 0.15) (tstamp c136c940-162c-40bd-a43e-f85a12f04629)) 25 | (fp_line (start 2.2 2.4) (end 2.2 1.8) (layer "F.Fab") (width 0.15) (tstamp f859c410-fdb2-459d-96ef-8a99e8837554)) 26 | (fp_arc (start -1.2 3.4) (mid -1.907107 3.107107) (end -2.2 2.4) (layer "F.Fab") (width 0.15) (tstamp 2889c315-688d-44a2-a46a-32e7d451505d)) 27 | (fp_arc (start -0.2 2.4) (mid -0.492893 3.107107) (end -1.2 3.4) (layer "F.Fab") (width 0.15) (tstamp 28a1aba9-2cab-4f24-a14b-d5b6787899df)) 28 | (fp_arc (start 1.2 3.4) (mid 0.492893 3.107107) (end 0.2 2.4) (layer "F.Fab") (width 0.15) (tstamp 5c8aaade-9db9-4298-aa05-d9973e17ecc6)) 29 | (fp_arc (start 2.2 2.4) (mid 1.907107 3.107107) (end 1.2 3.4) (layer "F.Fab") (width 0.15) (tstamp ea1725f0-4dd6-4d12-b51c-052f93b8223d)) 30 | (pad "1" thru_hole oval (at -2 0) (size 1.5 1.1) (drill oval 1.2 0.8) (layers *.Cu *.Mask) (tstamp bc4141d6-57f0-47cb-a902-f87466f3ff9a)) 31 | (pad "2" smd rect (at 0 0.5) (size 0.8 0.8) (layers "F.Cu" "F.Paste" "F.Mask") (tstamp cfc7b56b-61e1-4c49-ae2a-05461b673b81)) 32 | (pad "3" smd rect (at 0 -0.5) (size 0.8 0.8) (layers "F.Cu" "F.Paste" "F.Mask") (tstamp 32716e59-7908-41eb-ad46-9a2ef3088500)) 33 | (pad "4" thru_hole oval (at 2 0) (size 1.5 1.1) (drill oval 1.2 0.8) (layers *.Cu *.Mask) (tstamp ea3e84a2-c543-4dc3-b113-dbb4a7f50704)) 34 | ) 35 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/mushak_mount_footprint/IR_HOST_V_04.kicad_mod: -------------------------------------------------------------------------------- 1 | (footprint "IR_HOST_V_04" (version 20211014) (generator pcbnew) 2 | (layer "F.Cu") 3 | (tedit 5E4CD823) 4 | (attr through_hole) 5 | (fp_text reference "J12" (at -1.905 -1.905 180) (layer "F.Fab") 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | (tstamp 3384176a-7398-4f71-812f-f756bdb4d51f) 8 | ) 9 | (fp_text value "IR" (at 2.54 -1.905 180) (layer "F.Fab") 10 | (effects (font (size 1 1) (thickness 0.15))) 11 | (tstamp 8447aaa3-2f03-434e-addc-e6ce076fc81f) 12 | ) 13 | (fp_line (start 0 0) (end 0 90) (layer "B.Fab") (width 0.15) (tstamp 236d0356-4530-4623-bda6-b99c8114055c)) 14 | (fp_line (start 20 90) (end 0 0) (layer "B.Fab") (width 0.15) (tstamp 699ba279-f0ae-41ac-8d1d-46df1a419d85)) 15 | (fp_line (start 0 0) (end -20 90) (layer "B.Fab") (width 0.15) (tstamp d025a9f3-1bd9-4595-9d16-6a33fb93d1db)) 16 | (fp_line (start -0.2 1.13) (end -0.2 0.53) (layer "F.Fab") (width 0.15) (tstamp 116f1e4d-1f8e-4fb5-9b5e-e731e819f82e)) 17 | (fp_line (start -2.6 -0.67) (end -2.6 0.53) (layer "F.Fab") (width 0.15) (tstamp 21339a7c-7460-4202-8e74-1cff07787e92)) 18 | (fp_line (start 2.6 -0.67) (end -2.6 -0.67) (layer "F.Fab") (width 0.15) (tstamp 39486e64-4665-47fe-acef-8b7ca56f9002)) 19 | (fp_line (start 2.2 1.13) (end 2.2 0.53) (layer "F.Fab") (width 0.15) (tstamp 8aed6504-00c1-4cff-b895-068d080e8d04)) 20 | (fp_line (start -0.2 0.53) (end 0.2 0.53) (layer "F.Fab") (width 0.15) (tstamp 94b073a3-8411-48ac-a278-930c68d6c90e)) 21 | (fp_line (start -2.6 0.53) (end -2.2 0.53) (layer "F.Fab") (width 0.15) (tstamp d0d37899-9353-418b-90bd-e166f9b58b28)) 22 | (fp_line (start -2.2 0.53) (end -2.2 1.13) (layer "F.Fab") (width 0.15) (tstamp d1d5d4f0-0f3b-401b-bbdf-c81ac883e478)) 23 | (fp_line (start 2.6 0.53) (end 2.6 -0.67) (layer "F.Fab") (width 0.15) (tstamp d54a7c23-3688-4c6a-b393-8b921f58bfe6)) 24 | (fp_line (start 0.2 0.53) (end 0.2 1.13) (layer "F.Fab") (width 0.15) (tstamp d67773bc-caee-4d33-b6f9-e7f05b042960)) 25 | (fp_line (start 2.2 0.53) (end 2.6 0.53) (layer "F.Fab") (width 0.15) (tstamp fbed7fb9-bb5d-40c0-8941-e5fc5b0c44a1)) 26 | (fp_arc (start -1.2 2.13) (mid -1.907107 1.837107) (end -2.2 1.13) (layer "F.Fab") (width 0.15) (tstamp 000dd786-4f2a-48f9-b104-f259b36a53dd)) 27 | (fp_arc (start 2.2 1.13) (mid 1.907107 1.837107) (end 1.2 2.13) (layer "F.Fab") (width 0.15) (tstamp 55aa2e0d-1264-415d-b676-74eb462af603)) 28 | (fp_arc (start 1.2 2.13) (mid 0.492893 1.837107) (end 0.2 1.13) (layer "F.Fab") (width 0.15) (tstamp 9461542a-17e2-42d4-9065-d6c595bf13a0)) 29 | (fp_arc (start -0.2 1.13) (mid -0.492893 1.837107) (end -1.2 2.13) (layer "F.Fab") (width 0.15) (tstamp dfedeb98-8859-4138-b716-b49c22a681cb)) 30 | (pad "1" thru_hole oval (at 0 1.5) (size 1.1 1.5) (drill oval 0.8 1.2) (layers *.Cu *.Mask) (tstamp eb833e7b-c2b3-4220-8ae6-622015ce2cf0)) 31 | (pad "2" smd rect (at 0.5 0) (size 0.8 0.8) (layers "F.Cu" "F.Paste" "F.Mask") (tstamp 8abfdade-0d0b-4624-9d67-0ef43c6944a8)) 32 | (pad "3" smd rect (at -0.5 0) (size 0.8 0.8) (layers "F.Cu" "F.Paste" "F.Mask") (tstamp d143d0f4-9cef-421c-9b46-4a317a971d6b)) 33 | (pad "4" thru_hole oval (at 0 -1.5) (size 1.1 1.5) (drill oval 0.8 1.2) (layers *.Cu *.Mask) (tstamp 70d0c00a-81f2-410a-bca1-4aff2c1ccd7a)) 34 | ) 35 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/mushak_mount_footprint/motor.kicad_mod: -------------------------------------------------------------------------------- 1 | (footprint "motor" (version 20211014) (generator pcbnew) 2 | (layer "F.Cu") 3 | (tedit 0) 4 | (attr through_hole) 5 | (fp_text reference "REF**" (at -6.5 2.5 unlocked) (layer "F.SilkS") 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | (tstamp 722f4fd6-ac00-482a-96f7-2cf43c42e2e1) 8 | ) 9 | (fp_text value "motor" (at -1.3 4 unlocked) (layer "F.Fab") 10 | (effects (font (size 1 1) (thickness 0.15))) 11 | (tstamp 6b55cdc1-9650-49c3-87fc-6d4e6830a17a) 12 | ) 13 | (fp_text user "${REFERENCE}" (at -1.3 1.46 unlocked) (layer "F.Fab") 14 | (effects (font (size 1 1) (thickness 0.15))) 15 | (tstamp fa0e2e0a-fd2a-4632-9a74-db53150aa8d7) 16 | ) 17 | (fp_line (start -2.5 -13.5) (end -9.5 -13.5) (layer "F.SilkS") (width 0.12) (tstamp 5650dfb4-4844-47bc-a6d5-c15168e7e1bc)) 18 | (fp_line (start -8.5 -5.3) (end -9.5 -5.3) (layer "F.SilkS") (width 0.12) (tstamp 5713241c-37e9-40aa-9e3a-1c053f785be9)) 19 | (fp_line (start -8.5 0) (end -8.5 -5.3) (layer "F.SilkS") (width 0.12) (tstamp 63dcb6b3-6161-4d8a-ada4-122849e7349b)) 20 | (fp_line (start -2.5 -7.2) (end -2.5 -13.5) (layer "F.SilkS") (width 0.12) (tstamp 67de4a2c-9125-4553-82f9-ed5a8ca8d915)) 21 | (fp_line (start 0 -7.2) (end -2.5 -7.2) (layer "F.SilkS") (width 0.12) (tstamp 6de130c8-3afb-4171-a7a8-76e6449058e4)) 22 | (fp_line (start 0 0) (end 0 -7.2) (layer "F.SilkS") (width 0.12) (tstamp 77adb504-9bc2-4e58-9f9c-913282daf535)) 23 | (fp_line (start -9.5 -5.3) (end -9.5 -13.5) (layer "F.SilkS") (width 0.12) (tstamp e9d89149-df8e-4f6b-b879-0141792596bb)) 24 | (fp_line (start 0 0) (end -8.5 0) (layer "F.SilkS") (width 0.12) (tstamp fedbe858-8557-4584-afd6-4bf972968442)) 25 | (fp_line (start -9.2 -3.5) (end 6.7 -3.5) (layer "Dwgs.User") (width 0.12) (tstamp 5cb3fbcc-ff59-43af-b66e-7961e1aa750c)) 26 | (fp_line (start -2.5 -9.3) (end -18.95 -9.3) (layer "Dwgs.User") (width 0.12) (tstamp 80728cf7-337a-4756-ad94-5f5bd430b64b)) 27 | (fp_line (start -2.5 -9.3) (end 3.65 -9.3) (layer "Dwgs.User") (width 0.12) (tstamp bacda487-6aec-440c-9fa3-1dde68693e76)) 28 | (fp_line (start -10 -12.05) (end -2.5 -12.05) (layer "Edge.Cuts") (width 0.12) (tstamp 0797aef0-07c1-45d9-ae87-6654bb788e29)) 29 | (fp_line (start -10 -6.55) (end -10 -12.05) (layer "Edge.Cuts") (width 0.12) (tstamp 42712899-a01f-4e4a-8a0c-c05758fdef1d)) 30 | (fp_line (start -2.5 -6.55) (end -10 -6.55) (layer "Edge.Cuts") (width 0.12) (tstamp 57d28677-f798-4cc8-a744-c2943c0c0be9)) 31 | (fp_line (start -2.5 -12.05) (end -2.5 -6.55) (layer "Edge.Cuts") (width 0.12) (tstamp dd6506d2-7a3c-428c-a175-825c0b826bbc)) 32 | (fp_circle (center -1.25 -1.5) (end -0.5 -1.5) (layer "Edge.Cuts") (width 0.12) (fill none) (tstamp 3e97b97a-578a-4b41-b2f8-24dcaba8c577)) 33 | (fp_circle (center -3.75 -1.5) (end -3 -1.5) (layer "Edge.Cuts") (width 0.12) (fill none) (tstamp 4727b698-e491-430f-8f91-b4019c40f00e)) 34 | (fp_circle (center -1.25 -5.5) (end -0.5 -5.5) (layer "Edge.Cuts") (width 0.12) (fill none) (tstamp 8190dd18-7f8a-4dd9-856b-a4320e9dc06f)) 35 | (pad "1" thru_hole circle (at -9.3 -14.45) (size 1 1) (drill 0.5) (layers *.Cu *.Mask) (tstamp 4e655977-e97e-47ba-a6b4-d18df3651285)) 36 | (pad "2" thru_hole circle (at -7.75 -14.5) (size 1 1) (drill 0.5) (layers *.Cu *.Mask) (tstamp 67e22639-b521-49b5-bbdc-e6fb8bf25001)) 37 | ) 38 | -------------------------------------------------------------------------------- /firmware/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_hal_dma_ex.h 4 | * @author MCD Application Team 5 | * @brief Header file of DMA HAL extension module. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | * Copyright (c) 2017 STMicroelectronics. 10 | * All rights reserved. 11 | * 12 | * This software is licensed under terms that can be found in the LICENSE file in 13 | * 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 | 19 | /* Define to prevent recursive inclusion -------------------------------------*/ 20 | #ifndef __STM32F4xx_HAL_DMA_EX_H 21 | #define __STM32F4xx_HAL_DMA_EX_H 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | /* Includes ------------------------------------------------------------------*/ 28 | #include "stm32f4xx_hal_def.h" 29 | 30 | /** @addtogroup STM32F4xx_HAL_Driver 31 | * @{ 32 | */ 33 | 34 | /** @addtogroup DMAEx 35 | * @{ 36 | */ 37 | 38 | /* Exported types ------------------------------------------------------------*/ 39 | /** @defgroup DMAEx_Exported_Types DMAEx Exported Types 40 | * @brief DMAEx Exported types 41 | * @{ 42 | */ 43 | 44 | /** 45 | * @brief HAL DMA Memory definition 46 | */ 47 | typedef enum 48 | { 49 | MEMORY0 = 0x00U, /*!< Memory 0 */ 50 | MEMORY1 = 0x01U /*!< Memory 1 */ 51 | }HAL_DMA_MemoryTypeDef; 52 | 53 | /** 54 | * @} 55 | */ 56 | 57 | /* Exported functions --------------------------------------------------------*/ 58 | /** @defgroup DMAEx_Exported_Functions DMAEx Exported Functions 59 | * @brief DMAEx Exported functions 60 | * @{ 61 | */ 62 | 63 | /** @defgroup DMAEx_Exported_Functions_Group1 Extended features functions 64 | * @brief Extended features functions 65 | * @{ 66 | */ 67 | 68 | /* IO operation functions *******************************************************/ 69 | HAL_StatusTypeDef HAL_DMAEx_MultiBufferStart(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t SecondMemAddress, uint32_t DataLength); 70 | HAL_StatusTypeDef HAL_DMAEx_MultiBufferStart_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t SecondMemAddress, uint32_t DataLength); 71 | HAL_StatusTypeDef HAL_DMAEx_ChangeMemory(DMA_HandleTypeDef *hdma, uint32_t Address, HAL_DMA_MemoryTypeDef memory); 72 | 73 | /** 74 | * @} 75 | */ 76 | /** 77 | * @} 78 | */ 79 | 80 | /* Private functions ---------------------------------------------------------*/ 81 | /** @defgroup DMAEx_Private_Functions DMAEx Private Functions 82 | * @brief DMAEx Private functions 83 | * @{ 84 | */ 85 | /** 86 | * @} 87 | */ 88 | 89 | /** 90 | * @} 91 | */ 92 | 93 | /** 94 | * @} 95 | */ 96 | 97 | #ifdef __cplusplus 98 | } 99 | #endif 100 | 101 | #endif /*__STM32F4xx_HAL_DMA_EX_H*/ 102 | 103 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/SFH_3015_FA/XDCR_SFH_3015_FA.kicad_mod: -------------------------------------------------------------------------------- 1 | 2 | (module XDCR_SFH_3015_FA (layer F.Cu) (tedit 62EF97EB) 3 | (descr "") 4 | (fp_text reference REF** (at 0.675 -3.135 0) (layer F.SilkS) 5 | (effects (font (size 1.0 1.0) (thickness 0.15))) 6 | ) 7 | (fp_text value XDCR_SFH_3015_FA (at 7.66 2.135 0) (layer F.Fab) 8 | (effects (font (size 1.0 1.0) (thickness 0.15))) 9 | ) 10 | (pad 1 smd rect (at -1.75 0.0) (size 0.9 1.7) (layers F.Cu)) 11 | (pad 2 smd rect (at 1.75 0.0) (size 0.9 1.7) (layers F.Cu)) 12 | (fp_line (start -0.8 -1.9775) (end 0.8 -1.9775) (layer F.Fab) (width 0.127)) 13 | (fp_line (start 1.6 -0.5325) (end 1.6 0.5325) (layer F.Fab) (width 0.127)) 14 | (fp_line (start 1.6 0.5325) (end -1.6 0.5325) (layer F.Fab) (width 0.127)) 15 | (fp_line (start -1.6 0.5325) (end -1.6 -0.5325) (layer F.Fab) (width 0.127)) 16 | (fp_circle (center -2.8 0.0) (end -2.7 0.0) (layer F.SilkS) (width 0.2)) 17 | (fp_circle (center -2.8 0.0) (end -2.7 0.0) (layer F.Fab) (width 0.2)) 18 | (fp_line (start -2.45 -1.1) (end -1.05 -1.1) (layer F.CrtYd) (width 0.05)) 19 | (fp_line (start -1.05 -1.1) (end -1.05 -2.2275) (layer F.CrtYd) (width 0.05)) 20 | (fp_line (start -1.05 -2.2275) (end 1.05 -2.2275) (layer F.CrtYd) (width 0.05)) 21 | (fp_line (start 1.05 -2.2275) (end 1.05 -1.1) (layer F.CrtYd) (width 0.05)) 22 | (fp_line (start 1.05 -1.1) (end 2.45 -1.1) (layer F.CrtYd) (width 0.05)) 23 | (fp_line (start 2.45 -1.1) (end 2.45 1.1) (layer F.CrtYd) (width 0.05)) 24 | (fp_line (start 2.45 1.1) (end -2.45 1.1) (layer F.CrtYd) (width 0.05)) 25 | (fp_line (start -2.45 1.1) (end -2.45 -1.1) (layer F.CrtYd) (width 0.05)) 26 | (fp_poly 27 | (pts 28 | (xy -2.05 -0.7) 29 | (xy -1.3 -0.7) 30 | (xy -1.3 -0.5) 31 | (xy -1.5 -0.5) 32 | (xy -1.5 0.5) 33 | (xy -1.3 0.5) 34 | (xy -1.3 0.7) 35 | (xy -2.05 0.7) 36 | ) (layer F.Paste) (width 0.01) 37 | ) 38 | (fp_line (start -0.8 -0.5325) (end -0.8 -1.9775) (layer F.SilkS) (width 0.127)) 39 | (fp_line (start -0.8 -1.9775) (end 0.8 -1.9775) (layer F.SilkS) (width 0.127)) 40 | (fp_line (start 0.8 -1.9775) (end 0.8 -0.5325) (layer F.SilkS) (width 0.127)) 41 | (fp_line (start -0.98 0.5325) (end 0.98 0.5325) (layer F.SilkS) (width 0.127)) 42 | (fp_poly 43 | (pts 44 | (xy -2.1 -0.75) 45 | (xy -1.1 -0.75) 46 | (xy -1.1 0.75) 47 | (xy -2.1 0.75) 48 | ) (layer F.Mask) (width 0.01) 49 | ) 50 | (fp_poly 51 | (pts 52 | (xy 2.1 0.75) 53 | (xy 1.1 0.75) 54 | (xy 1.1 -0.75) 55 | (xy 2.1 -0.75) 56 | ) (layer F.Mask) (width 0.01) 57 | ) 58 | (fp_poly 59 | (pts 60 | (xy 2.05 0.7) 61 | (xy 1.3 0.7) 62 | (xy 1.3 0.5) 63 | (xy 1.5 0.5) 64 | (xy 1.5 -0.5) 65 | (xy 1.3 -0.5) 66 | (xy 1.3 -0.7) 67 | (xy 2.05 -0.7) 68 | ) (layer F.Paste) (width 0.01) 69 | ) 70 | (fp_line (start -1.6 -0.5325) (end -0.8 -0.5325) (layer F.Fab) (width 0.127)) 71 | (fp_line (start 0.8 -0.5325) (end 1.6 -0.5325) (layer F.Fab) (width 0.127)) 72 | (fp_line (start -0.8 -0.5325) (end -0.8 -1.9775) (layer F.Fab) (width 0.127)) 73 | (fp_line (start 0.8 -1.9775) (end 0.8 -0.5325) (layer F.Fab) (width 0.127)) 74 | (fp_line (start -0.8 -0.5325) (end -0.98 -0.5325) (layer F.SilkS) (width 0.127)) 75 | (fp_line (start 0.8 -0.5325) (end 0.98 -0.5325) (layer F.SilkS) (width 0.127)) 76 | ) -------------------------------------------------------------------------------- /pcb_design/gerbers/mushak_pcb-job.gbrjob: -------------------------------------------------------------------------------- 1 | { 2 | "Header": { 3 | "GenerationSoftware": { 4 | "Vendor": "KiCad", 5 | "Application": "Pcbnew", 6 | "Version": "6.0.11-2627ca5db0~126~ubuntu22.04.1" 7 | }, 8 | "CreationDate": "2023-03-12T15:28:39+05:30" 9 | }, 10 | "GeneralSpecs": { 11 | "ProjectId": { 12 | "Name": "mushak_pcb", 13 | "GUID": "6d757368-616b-45f7-9063-622e6b696361", 14 | "Revision": "rev?" 15 | }, 16 | "Size": { 17 | "X": 57.7168, 18 | "Y": 40.1 19 | }, 20 | "LayerNumber": 2, 21 | "BoardThickness": 0.6, 22 | "Finish": "None" 23 | }, 24 | "DesignRules": [ 25 | { 26 | "Layers": "Outer", 27 | "PadToPad": 0.0, 28 | "PadToTrack": 0.0, 29 | "TrackToTrack": 0.1, 30 | "MinLineWidth": 0.2, 31 | "TrackToRegion": 0.1, 32 | "RegionToRegion": 0.1 33 | } 34 | ], 35 | "FilesAttributes": [ 36 | { 37 | "Path": "mushak_pcb-F_Cu.gbr", 38 | "FileFunction": "Copper,L1,Top", 39 | "FilePolarity": "Positive" 40 | }, 41 | { 42 | "Path": "mushak_pcb-B_Cu.gbr", 43 | "FileFunction": "Copper,L2,Bot", 44 | "FilePolarity": "Positive" 45 | }, 46 | { 47 | "Path": "mushak_pcb-F_Paste.gbr", 48 | "FileFunction": "SolderPaste,Top", 49 | "FilePolarity": "Positive" 50 | }, 51 | { 52 | "Path": "mushak_pcb-B_Paste.gbr", 53 | "FileFunction": "SolderPaste,Bot", 54 | "FilePolarity": "Positive" 55 | }, 56 | { 57 | "Path": "mushak_pcb-F_Silkscreen.gbr", 58 | "FileFunction": "Legend,Top", 59 | "FilePolarity": "Positive" 60 | }, 61 | { 62 | "Path": "mushak_pcb-B_Silkscreen.gbr", 63 | "FileFunction": "Legend,Bot", 64 | "FilePolarity": "Positive" 65 | }, 66 | { 67 | "Path": "mushak_pcb-F_Mask.gbr", 68 | "FileFunction": "SolderMask,Top", 69 | "FilePolarity": "Negative" 70 | }, 71 | { 72 | "Path": "mushak_pcb-B_Mask.gbr", 73 | "FileFunction": "SolderMask,Bot", 74 | "FilePolarity": "Negative" 75 | }, 76 | { 77 | "Path": "mushak_pcb-Edge_Cuts.gbr", 78 | "FileFunction": "Profile", 79 | "FilePolarity": "Positive" 80 | } 81 | ], 82 | "MaterialStackup": [ 83 | { 84 | "Type": "Legend", 85 | "Name": "Top Silk Screen" 86 | }, 87 | { 88 | "Type": "SolderPaste", 89 | "Name": "Top Solder Paste" 90 | }, 91 | { 92 | "Type": "SolderMask", 93 | "Thickness": 0.01, 94 | "Name": "Top Solder Mask" 95 | }, 96 | { 97 | "Type": "Copper", 98 | "Thickness": 0.035, 99 | "Name": "F.Cu" 100 | }, 101 | { 102 | "Type": "Dielectric", 103 | "Thickness": 0.51, 104 | "Material": "FR4", 105 | "Name": "F.Cu/B.Cu", 106 | "Notes": "Type: dielectric layer 1 (from F.Cu to B.Cu)" 107 | }, 108 | { 109 | "Type": "Copper", 110 | "Thickness": 0.035, 111 | "Name": "B.Cu" 112 | }, 113 | { 114 | "Type": "SolderMask", 115 | "Thickness": 0.01, 116 | "Name": "Bottom Solder Mask" 117 | }, 118 | { 119 | "Type": "SolderPaste", 120 | "Name": "Bottom Solder Paste" 121 | }, 122 | { 123 | "Type": "Legend", 124 | "Name": "Bottom Silk Screen" 125 | } 126 | ] 127 | } 128 | -------------------------------------------------------------------------------- /firmware/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c_ex.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_hal_i2c_ex.h 4 | * @author MCD Application Team 5 | * @brief Header file of I2C HAL Extension module. 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 | 19 | /* Define to prevent recursive inclusion -------------------------------------*/ 20 | #ifndef __STM32F4xx_HAL_I2C_EX_H 21 | #define __STM32F4xx_HAL_I2C_EX_H 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | #if defined(I2C_FLTR_ANOFF)&&defined(I2C_FLTR_DNF) 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "stm32f4xx_hal_def.h" 30 | 31 | /** @addtogroup STM32F4xx_HAL_Driver 32 | * @{ 33 | */ 34 | 35 | /** @addtogroup I2CEx 36 | * @{ 37 | */ 38 | 39 | /* Exported types ------------------------------------------------------------*/ 40 | /* Exported constants --------------------------------------------------------*/ 41 | /** @defgroup I2CEx_Exported_Constants I2C Exported Constants 42 | * @{ 43 | */ 44 | 45 | /** @defgroup I2CEx_Analog_Filter I2C Analog Filter 46 | * @{ 47 | */ 48 | #define I2C_ANALOGFILTER_ENABLE 0x00000000U 49 | #define I2C_ANALOGFILTER_DISABLE I2C_FLTR_ANOFF 50 | /** 51 | * @} 52 | */ 53 | 54 | /** 55 | * @} 56 | */ 57 | 58 | /* Exported macro ------------------------------------------------------------*/ 59 | /* Exported functions --------------------------------------------------------*/ 60 | /** @addtogroup I2CEx_Exported_Functions 61 | * @{ 62 | */ 63 | 64 | /** @addtogroup I2CEx_Exported_Functions_Group1 65 | * @{ 66 | */ 67 | /* Peripheral Control functions ************************************************/ 68 | HAL_StatusTypeDef HAL_I2CEx_ConfigAnalogFilter(I2C_HandleTypeDef *hi2c, uint32_t AnalogFilter); 69 | HAL_StatusTypeDef HAL_I2CEx_ConfigDigitalFilter(I2C_HandleTypeDef *hi2c, uint32_t DigitalFilter); 70 | /** 71 | * @} 72 | */ 73 | 74 | /** 75 | * @} 76 | */ 77 | /* Private types -------------------------------------------------------------*/ 78 | /* Private variables ---------------------------------------------------------*/ 79 | /* Private constants ---------------------------------------------------------*/ 80 | /** @defgroup I2CEx_Private_Constants I2C Private Constants 81 | * @{ 82 | */ 83 | 84 | /** 85 | * @} 86 | */ 87 | 88 | /* Private macros ------------------------------------------------------------*/ 89 | /** @defgroup I2CEx_Private_Macros I2C Private Macros 90 | * @{ 91 | */ 92 | #define IS_I2C_ANALOG_FILTER(FILTER) (((FILTER) == I2C_ANALOGFILTER_ENABLE) || \ 93 | ((FILTER) == I2C_ANALOGFILTER_DISABLE)) 94 | #define IS_I2C_DIGITAL_FILTER(FILTER) ((FILTER) <= 0x0000000FU) 95 | /** 96 | * @} 97 | */ 98 | 99 | /** 100 | * @} 101 | */ 102 | 103 | /** 104 | * @} 105 | */ 106 | 107 | #endif 108 | 109 | #ifdef __cplusplus 110 | } 111 | #endif 112 | 113 | #endif /* __STM32F4xx_HAL_I2C_EX_H */ 114 | 115 | 116 | -------------------------------------------------------------------------------- /firmware/Core/Src/gpio.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file gpio.c 5 | * @brief This file provides code for the configuration 6 | * of all used GPIO pins. 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2023 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 | /* Includes ------------------------------------------------------------------*/ 22 | #include "gpio.h" 23 | 24 | /* USER CODE BEGIN 0 */ 25 | 26 | /* USER CODE END 0 */ 27 | 28 | /*----------------------------------------------------------------------------*/ 29 | /* Configure GPIO */ 30 | /*----------------------------------------------------------------------------*/ 31 | /* USER CODE BEGIN 1 */ 32 | 33 | /* USER CODE END 1 */ 34 | 35 | /** Configure pins as 36 | * Analog 37 | * Input 38 | * Output 39 | * EVENT_OUT 40 | * EXTI 41 | * Free pins are configured automatically as Analog (this feature is enabled through 42 | * the Code Generation settings) 43 | */ 44 | void MX_GPIO_Init(void) 45 | { 46 | 47 | GPIO_InitTypeDef GPIO_InitStruct = {0}; 48 | 49 | /* GPIO Ports Clock Enable */ 50 | __HAL_RCC_GPIOC_CLK_ENABLE(); 51 | __HAL_RCC_GPIOH_CLK_ENABLE(); 52 | __HAL_RCC_GPIOA_CLK_ENABLE(); 53 | __HAL_RCC_GPIOB_CLK_ENABLE(); 54 | __HAL_RCC_GPIOD_CLK_ENABLE(); 55 | 56 | /*Configure GPIO pin Output Level */ 57 | HAL_GPIO_WritePin(GPIOA, DEBUG_LED_Pin|MPU6500_CS_Pin, GPIO_PIN_RESET); 58 | 59 | /*Configure GPIO pins : PC13 PC0 PC1 PC2 60 | PC3 PC4 PC5 PC8 61 | PC10 PC11 PC12 */ 62 | GPIO_InitStruct.Pin = GPIO_PIN_13|GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2 63 | |GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_8 64 | |GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_12; 65 | GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; 66 | GPIO_InitStruct.Pull = GPIO_NOPULL; 67 | HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); 68 | 69 | /*Configure GPIO pins : PB12 PB13 */ 70 | GPIO_InitStruct.Pin = GPIO_PIN_12|GPIO_PIN_13; 71 | GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; 72 | GPIO_InitStruct.Pull = GPIO_NOPULL; 73 | HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); 74 | 75 | /*Configure GPIO pins : PA9 PA15 */ 76 | GPIO_InitStruct.Pin = GPIO_PIN_9|GPIO_PIN_15; 77 | GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; 78 | GPIO_InitStruct.Pull = GPIO_NOPULL; 79 | HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); 80 | 81 | /*Configure GPIO pins : PAPin PAPin */ 82 | GPIO_InitStruct.Pin = DEBUG_LED_Pin|MPU6500_CS_Pin; 83 | GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; 84 | GPIO_InitStruct.Pull = GPIO_NOPULL; 85 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; 86 | HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); 87 | 88 | /*Configure GPIO pin : PtPin */ 89 | GPIO_InitStruct.Pin = DEBUG_BTN_Pin; 90 | GPIO_InitStruct.Mode = GPIO_MODE_INPUT; 91 | GPIO_InitStruct.Pull = GPIO_NOPULL; 92 | HAL_GPIO_Init(DEBUG_BTN_GPIO_Port, &GPIO_InitStruct); 93 | 94 | /*Configure GPIO pin : PD2 */ 95 | GPIO_InitStruct.Pin = GPIO_PIN_2; 96 | GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; 97 | GPIO_InitStruct.Pull = GPIO_NOPULL; 98 | HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); 99 | 100 | } 101 | 102 | /* USER CODE BEGIN 2 */ 103 | 104 | /* USER CODE END 2 */ 105 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/VL53L0CXV0DH_1/VL53L0CXV0DH_1.kicad_sym: -------------------------------------------------------------------------------- 1 | 2 | (kicad_symbol_lib (version 20211014) (generator kicad_symbol_editor) 3 | (symbol "VL53L0CXV0DH{slash}1" (pin_names (offset 1.016)) (in_bom yes) (on_board yes) 4 | (property "Reference" "U" (id 0) (at -12.7222 13.2311 0) 5 | (effects (font (size 1.27 1.27)) (justify bottom left)) 6 | ) 7 | (property "Value" "VL53L0CXV0DH{slash}1" (id 1) (at -12.7032 -12.7032 0) 8 | (effects (font (size 1.27 1.27)) (justify bottom left)) 9 | ) 10 | (property "Footprint" "XDCR_VL53L0CXV0DH/1" (id 2) (at 0 0 0) 11 | (effects (font (size 1.27 1.27)) (justify bottom) hide) 12 | ) 13 | (property "MANUFACTURER" "STMicroelectronics" (id 4) (at 0 0 0) 14 | (effects (font (size 1.27 1.27)) (justify bottom) hide) 15 | ) 16 | (symbol "VL53L0CXV0DH{slash}1_0_0" 17 | (rectangle (start -12.7 -10.16) (end 12.7 12.7) 18 | (stroke (width 0.254)) (fill (type background)) 19 | ) 20 | (pin power_in line (at 17.78 10.16 180.0) (length 5.08) 21 | (name "AVDDVCSEL" 22 | (effects (font (size 1.016 1.016))) 23 | ) 24 | (number "1" 25 | (effects (font (size 1.016 1.016))) 26 | ) 27 | ) 28 | (pin power_in line (at 17.78 10.16 180.0) (length 5.08) 29 | (name "AVDDVCSEL" 30 | (effects (font (size 1.016 1.016))) 31 | ) 32 | (number "1.1" 33 | (effects (font (size 1.016 1.016))) 34 | ) 35 | ) 36 | (pin passive line (at 17.78 7.62 180.0) (length 5.08) 37 | (name "AVSSVCSEL" 38 | (effects (font (size 1.016 1.016))) 39 | ) 40 | (number "2" 41 | (effects (font (size 1.016 1.016))) 42 | ) 43 | ) 44 | (pin power_in line (at 17.78 -7.62 180.0) (length 5.08) 45 | (name "GND" 46 | (effects (font (size 1.016 1.016))) 47 | ) 48 | (number "3" 49 | (effects (font (size 1.016 1.016))) 50 | ) 51 | ) 52 | (pin power_in line (at 17.78 -7.62 180.0) (length 5.08) 53 | (name "GND" 54 | (effects (font (size 1.016 1.016))) 55 | ) 56 | (number "4" 57 | (effects (font (size 1.016 1.016))) 58 | ) 59 | ) 60 | (pin power_in line (at 17.78 -7.62 180.0) (length 5.08) 61 | (name "GND" 62 | (effects (font (size 1.016 1.016))) 63 | ) 64 | (number "6" 65 | (effects (font (size 1.016 1.016))) 66 | ) 67 | ) 68 | (pin power_in line (at 17.78 -7.62 180.0) (length 5.08) 69 | (name "GND" 70 | (effects (font (size 1.016 1.016))) 71 | ) 72 | (number "12" 73 | (effects (font (size 1.016 1.016))) 74 | ) 75 | ) 76 | (pin input line (at -17.78 10.16 0) (length 5.08) 77 | (name "XSHUT" 78 | (effects (font (size 1.016 1.016))) 79 | ) 80 | (number "5" 81 | (effects (font (size 1.016 1.016))) 82 | ) 83 | ) 84 | (pin output line (at 17.78 0.0 180.0) (length 5.08) 85 | (name "GPIO1" 86 | (effects (font (size 1.016 1.016))) 87 | ) 88 | (number "7" 89 | (effects (font (size 1.016 1.016))) 90 | ) 91 | ) 92 | (pin bidirectional line (at -17.78 -2.54 0) (length 5.08) 93 | (name "SDA" 94 | (effects (font (size 1.016 1.016))) 95 | ) 96 | (number "9" 97 | (effects (font (size 1.016 1.016))) 98 | ) 99 | ) 100 | (pin input clock (at -17.78 -5.08 0) (length 5.08) 101 | (name "SCL" 102 | (effects (font (size 1.016 1.016))) 103 | ) 104 | (number "10" 105 | (effects (font (size 1.016 1.016))) 106 | ) 107 | ) 108 | (pin power_in line (at 17.78 5.08 180.0) (length 5.08) 109 | (name "AVDD" 110 | (effects (font (size 1.016 1.016))) 111 | ) 112 | (number "11" 113 | (effects (font (size 1.016 1.016))) 114 | ) 115 | ) 116 | ) 117 | ) 118 | ) -------------------------------------------------------------------------------- /pcb_design/gerbers/mushak_pcb-top-pos.csv: -------------------------------------------------------------------------------- 1 | Ref,Val,Package,PosX,PosY,Rot,Side 2 | A1,SFH_3015_FA,XDCR_SFH_3015_FA,140.4,26.9,0,top 3 | A2,SFH_3015_FA,XDCR_SFH_3015_FA,140.5,21.328186,0,top 4 | A3,SFH_3015_FA,XDCR_SFH_3015_FA,140.45,32.75,0,top 5 | A4,SFH_3015_FA,XDCR_SFH_3015_FA,140.5,38.35,0,top 6 | BZ1,Buzzer,XDCR_SMT-0440-T-R,132.7,21,90,top 7 | C1,2.2uF,C_0603_1608Metric,96.4,30.9,180,top 8 | C2,2.2uF,C_0603_1608Metric,108.5,24.6,-90,top 9 | C3,0.1uF,C_0402_1005Metric,127.9,50.4,90,top 10 | C4,0.1uF,C_0402_1005Metric,127.7,16.3,90,top 11 | C5,0.1uF,C_0402_1005Metric,146.025,25.75,90,top 12 | C6,0.1uF,C_0402_1005Metric,146.05,20.078186,90,top 13 | C7,0.1uF,C_0402_1005Metric,97.4,36.3,90,top 14 | C8,10uF,C_0603_1608Metric,133.8,36.9,180,top 15 | C9,0.1uF,C_0402_1005Metric,97.4,29,-90,top 16 | C10,0.1uF,C_0402_1005Metric,110.1,26.7,-90,top 17 | C11,20pF,C_0402_1005Metric,105.3,44.7,180,top 18 | C12,1uF,C_0603_1608Metric,111.3,46.8,-90,top 19 | C13,22uF,C_0603_1608Metric,130.2,36.9,0,top 20 | C14,0.1uF,C_0402_1005Metric,113,37,0,top 21 | C15,20pF,C_0402_1005Metric,102.4,42.2,90,top 22 | C16,0.1uF,C_0402_1005Metric,112.2,38.2,0,top 23 | C17,0.01uF,C_0402_1005Metric,99.675,42.425,180,top 24 | C18,10uF,C_0603_1608Metric,111.8,39.7,0,top 25 | C19,1uF,C_0603_1608Metric,99.5,40.4,-90,top 26 | C20,12pF,C_0402_1005Metric,111.69,41.66,0,top 27 | C21,12pF,C_0402_1005Metric,111.68,44.15,0,top 28 | C24,0.1uF,C_0402_1005Metric,134.4,38.5,180,top 29 | C25,0.1uF,C_0402_1005Metric,129.9,38.5,0,top 30 | C26,0.01uF,C_0402_1005Metric,119.3,30.3,180,top 31 | C27,2.2uF,C_0603_1608Metric,128.2,34,-90,top 32 | C28,10uF,C_0603_1608Metric,126.5,28.4,180,top 33 | C31,0.01uF,C_0402_1005Metric,119.4,32.1,-90,top 34 | C32,0.1uF,C_0402_1005Metric,119.9,33.9,180,top 35 | C33,0.1uF,C_0402_1005Metric,116.5,36.1,180,top 36 | C36,0.1uF,C_0402_1005Metric,146.05,31.55,90,top 37 | C37,0.1uF,C_0402_1005Metric,146.075,37.075,90,top 38 | D1,LED,LED_0402_1005Metric,129.9,39.9,180,top 39 | D6,LED,LED_0402_1005Metric,106.3,25.1,90,top 40 | FB1,120R,L_0805_2012Metric,97.6,40.6,90,top 41 | J1,Conn_01x04_Male,JST_SH_BM04B-SRSS-TB_1x04-1MP_P1.00mm_Vertical,105.2,17.9,180,top 42 | J2,Conn_01x02_Female,JST_EH_B2B-EH-A_1x02_P2.50mm_Vertical,130.75,44.9,0,top 43 | J3,BLE_Conn,JST_SH_BM04B-SRSS-TB_1x04-1MP_P1.00mm_Vertical,105.2,48.8,0,top 44 | Q1,DMN3065LW-7,SOT-323_SC-70,128.5,21.8,180,top 45 | Q2,DMN3065LW-7,SOT-323_SC-70,143.9,26.2,-90,top 46 | Q3,DMN3065LW-7,SOT-323_SC-70,144,20.628186,-90,top 47 | Q4,DMN3065LW-7,SOT-323_SC-70,143.95,32.05,-90,top 48 | Q5,DMN3065LW-7,SOT-323_SC-70,144,37.65,-90,top 49 | R1,10,R_0603_1608Metric,128.6,19,0,top 50 | R2,4.7k,R_0402_1005Metric,130.2,48.1,180,top 51 | R3,4.7k,R_0402_1005Metric,132.8,48.1,0,top 52 | R4,220,R_0603_1608Metric,132.3,39.3,90,top 53 | R7,100,R_0603_1608Metric,143.8,28.5,180,top 54 | R12,100,R_0603_1608Metric,143.85,22.928186,180,top 55 | R14,4.7k,R_0402_1005Metric,145.75,16.75,90,top 56 | R15,4.7k,R_0402_1005Metric,145.75,14.95,-90,top 57 | R16,10k,R_0402_1005Metric,113.6,31.1,-90,top 58 | R17,10k,R_0402_1005Metric,112.5,31.1,-90,top 59 | R18,10k,R_0402_1005Metric,119.9,35,0,top 60 | R19,10k,R_0402_1005Metric,112,28.3,0,top 61 | R20,10k,R_0402_1005Metric,120.6,32.1,-90,top 62 | R21,220,R_0603_1608Metric,104.8,24.55,-90,top 63 | R23,100,R_0603_1608Metric,143.85,34.35,180,top 64 | R24,100,R_0603_1608Metric,143.9,39.95,180,top 65 | R25,4.7k,R_0402_1005Metric,128,36.9,90,top 66 | R26,10k,R_0402_1005Metric,113.1,35.05,180,top 67 | R27,150,R_0402_1005Metric,146.075,28.15,90,top 68 | R28,150,R_0402_1005Metric,146.15,22.578186,90,top 69 | R29,150,R_0402_1005Metric,146.05,34.05,90,top 70 | R30,150,R_0402_1005Metric,146.1,39.635,90,top 71 | R31,150,R_0402_1005Metric,128,23.75,180,top 72 | SW1,SW_Push,SW_TL1015AF160QG,131.8,50.5,0,top 73 | SW2,SW_Push,SW_TL1015AF160QG,131.8,16.2,0,top 74 | U1,BA30BC0FP-E2,DPAK228P998X235-3N,132.3,29.9,180,top 75 | U2,AS5048B-HTSP,SOP65P640X120-14N,142.925,44,180,top 76 | U3,DRV8833PWPR,IC_DRV8833PWPR,124.4,33.3,-90,top 77 | U4,VL6180XV0NR/1,LGA12R75P2X6_280X480X110,142.65,15.85,90,top 78 | U5,MPU-6500,QFN40P300X300X95-25N,116.5,33.3,90,top 79 | U6,STM32F405RGTx,LQFP-64_10x10mm_P0.5mm,105.05,33.3,-90,top 80 | U7,AS5048B-HTSP,SOP65P640X120-14N,142.925,49.6,180,top 81 | Y1,25Mhz,Crystal_SMD_3225-4Pin_3.2x2.5mm,105.3,42.3,180,top 82 | Y2,32.769kHz,XTAL_ABS07-32.768KHZ-T,109.2,42.9,90,top 83 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/DRV8833PWPR/IC_DRV8833PWPR.kicad_mod: -------------------------------------------------------------------------------- 1 | 2 | (module IC_DRV8833PWPR (layer F.Cu) (tedit 634D4654) 3 | (descr "") 4 | (fp_text reference REF** (at -1.28 -3.485 0) (layer F.SilkS) 5 | (effects (font (size 0.8 0.8) (thickness 0.15))) 6 | ) 7 | (fp_text value IC_DRV8833PWPR (at 3.292 3.385 0) (layer F.Fab) 8 | (effects (font (size 0.8 0.8) (thickness 0.15))) 9 | ) 10 | (pad 1 smd roundrect (roundrect_rratio 0.06) (at -2.9 -2.275) (size 1.5 0.45) (layers F.Cu F.Mask F.Paste)) 11 | (pad 2 smd roundrect (roundrect_rratio 0.06) (at -2.9 -1.625) (size 1.5 0.45) (layers F.Cu F.Mask F.Paste)) 12 | (pad 3 smd roundrect (roundrect_rratio 0.06) (at -2.9 -0.975) (size 1.5 0.45) (layers F.Cu F.Mask F.Paste)) 13 | (pad 4 smd roundrect (roundrect_rratio 0.06) (at -2.9 -0.325) (size 1.5 0.45) (layers F.Cu F.Mask F.Paste)) 14 | (pad 5 smd roundrect (roundrect_rratio 0.06) (at -2.9 0.325) (size 1.5 0.45) (layers F.Cu F.Mask F.Paste)) 15 | (pad 6 smd roundrect (roundrect_rratio 0.06) (at -2.9 0.975) (size 1.5 0.45) (layers F.Cu F.Mask F.Paste)) 16 | (pad 7 smd roundrect (roundrect_rratio 0.06) (at -2.9 1.625) (size 1.5 0.45) (layers F.Cu F.Mask F.Paste)) 17 | (pad 8 smd roundrect (roundrect_rratio 0.06) (at -2.9 2.275) (size 1.5 0.45) (layers F.Cu F.Mask F.Paste)) 18 | (pad 9 smd roundrect (roundrect_rratio 0.06) (at 2.9 2.275) (size 1.5 0.45) (layers F.Cu F.Mask F.Paste)) 19 | (pad 10 smd roundrect (roundrect_rratio 0.06) (at 2.9 1.625) (size 1.5 0.45) (layers F.Cu F.Mask F.Paste)) 20 | (pad 11 smd roundrect (roundrect_rratio 0.06) (at 2.9 0.975) (size 1.5 0.45) (layers F.Cu F.Mask F.Paste)) 21 | (pad 12 smd roundrect (roundrect_rratio 0.06) (at 2.9 0.325) (size 1.5 0.45) (layers F.Cu F.Mask F.Paste)) 22 | (pad 13 smd roundrect (roundrect_rratio 0.06) (at 2.9 -0.325) (size 1.5 0.45) (layers F.Cu F.Mask F.Paste)) 23 | (pad 14 smd roundrect (roundrect_rratio 0.06) (at 2.9 -0.975) (size 1.5 0.45) (layers F.Cu F.Mask F.Paste)) 24 | (pad 15 smd roundrect (roundrect_rratio 0.06) (at 2.9 -1.625) (size 1.5 0.45) (layers F.Cu F.Mask F.Paste)) 25 | (pad 16 smd roundrect (roundrect_rratio 0.06) (at 2.9 -2.275) (size 1.5 0.45) (layers F.Cu F.Mask F.Paste)) 26 | (pad 17 smd rect (at 0.0 0.0) (size 3.4 5.0) (layers F.Cu)) 27 | (pad 18 thru_hole circle (at -1.0 -1.8) (size 0.3 0.3) (drill 0.2) (layers *.Cu)) 28 | (pad 19 thru_hole circle (at 0.0 -1.8) (size 0.3 0.3) (drill 0.2) (layers *.Cu)) 29 | (pad 20 thru_hole circle (at 1.0 -1.8) (size 0.3 0.3) (drill 0.2) (layers *.Cu)) 30 | (pad 21 thru_hole circle (at -1.0 -0.6) (size 0.3 0.3) (drill 0.2) (layers *.Cu)) 31 | (pad 22 thru_hole circle (at 0.0 -0.6) (size 0.3 0.3) (drill 0.2) (layers *.Cu)) 32 | (pad 23 thru_hole circle (at 1.0 -0.6) (size 0.3 0.3) (drill 0.2) (layers *.Cu)) 33 | (pad 24 thru_hole circle (at -1.0 0.6) (size 0.3 0.3) (drill 0.2) (layers *.Cu)) 34 | (pad 25 thru_hole circle (at 0.0 0.6) (size 0.3 0.3) (drill 0.2) (layers *.Cu)) 35 | (pad 26 thru_hole circle (at 1.0 0.6) (size 0.3 0.3) (drill 0.2) (layers *.Cu)) 36 | (pad 27 thru_hole circle (at -1.0 1.8) (size 0.3 0.3) (drill 0.2) (layers *.Cu)) 37 | (pad 28 thru_hole circle (at 0.0 1.8) (size 0.3 0.3) (drill 0.2) (layers *.Cu)) 38 | (pad 29 thru_hole circle (at 1.0 1.8) (size 0.3 0.3) (drill 0.2) (layers *.Cu)) 39 | (fp_circle (center -4.2 -2.4) (end -4.1 -2.4) (layer F.SilkS) (width 0.2)) 40 | (fp_circle (center -4.2 -2.4) (end -4.1 -2.4) (layer F.Fab) (width 0.2)) 41 | (fp_line (start -2.2 -2.5) (end 2.2 -2.5) (layer F.Fab) (width 0.127)) 42 | (fp_line (start -2.2 2.5) (end 2.2 2.5) (layer F.Fab) (width 0.127)) 43 | (fp_line (start -1.83 -2.5) (end 1.83 -2.5) (layer F.SilkS) (width 0.127)) 44 | (fp_line (start -1.83 2.5) (end 1.83 2.5) (layer F.SilkS) (width 0.127)) 45 | (fp_line (start -2.2 -2.5) (end -2.2 2.5) (layer F.Fab) (width 0.127)) 46 | (fp_line (start 2.2 -2.5) (end 2.2 2.5) (layer F.Fab) (width 0.127)) 47 | (fp_line (start -3.9 -2.75) (end 3.9 -2.75) (layer F.CrtYd) (width 0.05)) 48 | (fp_line (start -3.9 2.75) (end 3.9 2.75) (layer F.CrtYd) (width 0.05)) 49 | (fp_line (start -3.9 -2.75) (end -3.9 2.75) (layer F.CrtYd) (width 0.05)) 50 | (fp_line (start 3.9 -2.75) (end 3.9 2.75) (layer F.CrtYd) (width 0.05)) 51 | (fp_poly 52 | (pts 53 | (xy -1.23 -1.155) 54 | (xy 1.23 -1.155) 55 | (xy 1.23 1.155) 56 | (xy -1.23 1.155) 57 | ) (layer F.Mask) (width 0.01) 58 | ) 59 | (fp_poly 60 | (pts 61 | (xy -1.23 -1.155) 62 | (xy 1.23 -1.155) 63 | (xy 1.23 1.155) 64 | (xy -1.23 1.155) 65 | ) (layer F.Paste) (width 0.01) 66 | ) 67 | ) -------------------------------------------------------------------------------- /firmware/Core/Src/freertos.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * File Name : freertos.c 5 | * Description : Code for freertos applications 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | * Copyright (c) 2023 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 "FreeRTOS.h" 22 | #include "task.h" 23 | #include "main.h" 24 | #include "cmsis_os.h" 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 | 39 | /* USER CODE END PD */ 40 | 41 | /* Private macro -------------------------------------------------------------*/ 42 | /* USER CODE BEGIN PM */ 43 | 44 | /* USER CODE END PM */ 45 | 46 | /* Private variables ---------------------------------------------------------*/ 47 | /* USER CODE BEGIN Variables */ 48 | 49 | /* USER CODE END Variables */ 50 | osThreadId defaultTaskHandle; 51 | 52 | /* Private function prototypes -----------------------------------------------*/ 53 | /* USER CODE BEGIN FunctionPrototypes */ 54 | 55 | /* USER CODE END FunctionPrototypes */ 56 | 57 | void StartDefaultTask(void const * argument); 58 | 59 | void MX_FREERTOS_Init(void); /* (MISRA C 2004 rule 8.1) */ 60 | 61 | /* GetIdleTaskMemory prototype (linked to static allocation support) */ 62 | void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize ); 63 | 64 | /* USER CODE BEGIN GET_IDLE_TASK_MEMORY */ 65 | static StaticTask_t xIdleTaskTCBBuffer; 66 | static StackType_t xIdleStack[configMINIMAL_STACK_SIZE]; 67 | 68 | void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize ) 69 | { 70 | *ppxIdleTaskTCBBuffer = &xIdleTaskTCBBuffer; 71 | *ppxIdleTaskStackBuffer = &xIdleStack[0]; 72 | *pulIdleTaskStackSize = configMINIMAL_STACK_SIZE; 73 | /* place for user code */ 74 | } 75 | /* USER CODE END GET_IDLE_TASK_MEMORY */ 76 | 77 | /** 78 | * @brief FreeRTOS initialization 79 | * @param None 80 | * @retval None 81 | */ 82 | void MX_FREERTOS_Init(void) { 83 | /* USER CODE BEGIN Init */ 84 | 85 | /* USER CODE END Init */ 86 | 87 | /* USER CODE BEGIN RTOS_MUTEX */ 88 | /* add mutexes, ... */ 89 | /* USER CODE END RTOS_MUTEX */ 90 | 91 | /* USER CODE BEGIN RTOS_SEMAPHORES */ 92 | /* add semaphores, ... */ 93 | /* USER CODE END RTOS_SEMAPHORES */ 94 | 95 | /* USER CODE BEGIN RTOS_TIMERS */ 96 | /* start timers, add new ones, ... */ 97 | /* USER CODE END RTOS_TIMERS */ 98 | 99 | /* USER CODE BEGIN RTOS_QUEUES */ 100 | /* add queues, ... */ 101 | /* USER CODE END RTOS_QUEUES */ 102 | 103 | /* Create the thread(s) */ 104 | /* definition and creation of defaultTask */ 105 | osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 128); 106 | defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL); 107 | 108 | /* USER CODE BEGIN RTOS_THREADS */ 109 | /* add threads, ... */ 110 | /* USER CODE END RTOS_THREADS */ 111 | 112 | } 113 | 114 | /* USER CODE BEGIN Header_StartDefaultTask */ 115 | /** 116 | * @brief Function implementing the defaultTask thread. 117 | * @param argument: Not used 118 | * @retval None 119 | */ 120 | /* USER CODE END Header_StartDefaultTask */ 121 | void StartDefaultTask(void const * argument) 122 | { 123 | /* USER CODE BEGIN StartDefaultTask */ 124 | /* Infinite loop */ 125 | for(;;) 126 | { 127 | osDelay(1); 128 | } 129 | /* USER CODE END StartDefaultTask */ 130 | } 131 | 132 | /* Private application code --------------------------------------------------*/ 133 | /* USER CODE BEGIN Application */ 134 | 135 | /* USER CODE END Application */ 136 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/MPU-6500/QFN40P300X300X95-25N.kicad_mod: -------------------------------------------------------------------------------- 1 | 2 | (module QFN40P300X300X95-25N (layer F.Cu) (tedit 62EF9290) 3 | (descr "") 4 | (fp_text reference REF** (at 0.675 -2.885 0) (layer F.SilkS) 5 | (effects (font (size 1.0 1.0) (thickness 0.15))) 6 | ) 7 | (fp_text value QFN40P300X300X95-25N (at 10.2 2.885 0) (layer F.Fab) 8 | (effects (font (size 1.0 1.0) (thickness 0.15))) 9 | ) 10 | (pad 7 smd roundrect (roundrect_rratio 0.03) (at -1.0 1.545 90.0) (size 0.64 0.22) (layers F.Cu F.Mask F.Paste)) 11 | (pad 8 smd roundrect (roundrect_rratio 0.03) (at -0.6 1.545 90.0) (size 0.64 0.22) (layers F.Cu F.Mask F.Paste)) 12 | (pad 9 smd roundrect (roundrect_rratio 0.03) (at -0.2 1.545 90.0) (size 0.64 0.22) (layers F.Cu F.Mask F.Paste)) 13 | (pad 10 smd roundrect (roundrect_rratio 0.03) (at 0.2 1.545 90.0) (size 0.64 0.22) (layers F.Cu F.Mask F.Paste)) 14 | (pad 11 smd roundrect (roundrect_rratio 0.03) (at 0.6 1.545 90.0) (size 0.64 0.22) (layers F.Cu F.Mask F.Paste)) 15 | (pad 12 smd roundrect (roundrect_rratio 0.03) (at 1.0 1.545 90.0) (size 0.64 0.22) (layers F.Cu F.Mask F.Paste)) 16 | (pad 19 smd roundrect (roundrect_rratio 0.03) (at 1.0 -1.545 90.0) (size 0.64 0.22) (layers F.Cu F.Mask F.Paste)) 17 | (pad 20 smd roundrect (roundrect_rratio 0.03) (at 0.6 -1.545 90.0) (size 0.64 0.22) (layers F.Cu F.Mask F.Paste)) 18 | (pad 21 smd roundrect (roundrect_rratio 0.03) (at 0.2 -1.545 90.0) (size 0.64 0.22) (layers F.Cu F.Mask F.Paste)) 19 | (pad 22 smd roundrect (roundrect_rratio 0.03) (at -0.2 -1.545 90.0) (size 0.64 0.22) (layers F.Cu F.Mask F.Paste)) 20 | (pad 23 smd roundrect (roundrect_rratio 0.03) (at -0.6 -1.545 90.0) (size 0.64 0.22) (layers F.Cu F.Mask F.Paste)) 21 | (pad 24 smd roundrect (roundrect_rratio 0.03) (at -1.0 -1.545 90.0) (size 0.64 0.22) (layers F.Cu F.Mask F.Paste)) 22 | (pad 1 smd roundrect (roundrect_rratio 0.03) (at -1.545 -1.0) (size 0.64 0.22) (layers F.Cu F.Mask F.Paste)) 23 | (pad 2 smd roundrect (roundrect_rratio 0.03) (at -1.545 -0.6) (size 0.64 0.22) (layers F.Cu F.Mask F.Paste)) 24 | (pad 3 smd roundrect (roundrect_rratio 0.03) (at -1.545 -0.2) (size 0.64 0.22) (layers F.Cu F.Mask F.Paste)) 25 | (pad 4 smd roundrect (roundrect_rratio 0.03) (at -1.545 0.2) (size 0.64 0.22) (layers F.Cu F.Mask F.Paste)) 26 | (pad 5 smd roundrect (roundrect_rratio 0.03) (at -1.545 0.6) (size 0.64 0.22) (layers F.Cu F.Mask F.Paste)) 27 | (pad 6 smd roundrect (roundrect_rratio 0.03) (at -1.545 1.0) (size 0.64 0.22) (layers F.Cu F.Mask F.Paste)) 28 | (pad 13 smd roundrect (roundrect_rratio 0.03) (at 1.545 1.0) (size 0.64 0.22) (layers F.Cu F.Mask F.Paste)) 29 | (pad 14 smd roundrect (roundrect_rratio 0.03) (at 1.545 0.6) (size 0.64 0.22) (layers F.Cu F.Mask F.Paste)) 30 | (pad 15 smd roundrect (roundrect_rratio 0.03) (at 1.545 0.2) (size 0.64 0.22) (layers F.Cu F.Mask F.Paste)) 31 | (pad 16 smd roundrect (roundrect_rratio 0.03) (at 1.545 -0.2) (size 0.64 0.22) (layers F.Cu F.Mask F.Paste)) 32 | (pad 17 smd roundrect (roundrect_rratio 0.03) (at 1.545 -0.6) (size 0.64 0.22) (layers F.Cu F.Mask F.Paste)) 33 | (pad 18 smd roundrect (roundrect_rratio 0.03) (at 1.545 -1.0) (size 0.64 0.22) (layers F.Cu F.Mask F.Paste)) 34 | (pad 25 smd rect (at 0.0 0.0) (size 1.54 1.7) (layers F.Cu F.Mask)) 35 | (fp_poly 36 | (pts 37 | (xy -0.485 -0.54) 38 | (xy 0.485 -0.54) 39 | (xy 0.485 0.54) 40 | (xy -0.485 0.54) 41 | ) (layer F.Paste) (width 0.01) 42 | ) 43 | (fp_circle (center -2.385 -1.0) (end -2.285 -1.0) (layer F.SilkS) (width 0.2)) 44 | (fp_circle (center -2.385 -1.0) (end -2.285 -1.0) (layer F.Fab) (width 0.2)) 45 | (fp_line (start 1.5 1.5) (end -1.5 1.5) (layer F.Fab) (width 0.127)) 46 | (fp_line (start 1.5 -1.5) (end -1.5 -1.5) (layer F.Fab) (width 0.127)) 47 | (fp_line (start 1.5 1.5) (end 1.5 -1.5) (layer F.Fab) (width 0.127)) 48 | (fp_line (start -1.5 1.5) (end -1.5 -1.5) (layer F.Fab) (width 0.127)) 49 | (fp_line (start 1.5 1.5) (end 1.43 1.5) (layer F.SilkS) (width 0.127)) 50 | (fp_line (start 1.5 -1.5) (end 1.43 -1.5) (layer F.SilkS) (width 0.127)) 51 | (fp_line (start -1.5 1.5) (end -1.43 1.5) (layer F.SilkS) (width 0.127)) 52 | (fp_line (start -1.5 -1.5) (end -1.43 -1.5) (layer F.SilkS) (width 0.127)) 53 | (fp_line (start 1.5 1.5) (end 1.5 1.43) (layer F.SilkS) (width 0.127)) 54 | (fp_line (start 1.5 -1.5) (end 1.5 -1.43) (layer F.SilkS) (width 0.127)) 55 | (fp_line (start -1.5 1.5) (end -1.5 1.43) (layer F.SilkS) (width 0.127)) 56 | (fp_line (start -1.5 -1.5) (end -1.5 -1.43) (layer F.SilkS) (width 0.127)) 57 | (fp_line (start -2.115 2.115) (end 2.115 2.115) (layer F.CrtYd) (width 0.05)) 58 | (fp_line (start -2.115 -2.115) (end 2.115 -2.115) (layer F.CrtYd) (width 0.05)) 59 | (fp_line (start -2.115 2.115) (end -2.115 -2.115) (layer F.CrtYd) (width 0.05)) 60 | (fp_line (start 2.115 2.115) (end 2.115 -2.115) (layer F.CrtYd) (width 0.05)) 61 | ) -------------------------------------------------------------------------------- /firmware/Core/Src/stm32f4xx_hal_timebase_tim.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32f4xx_hal_timebase_tim.c 5 | * @brief HAL time base based on the hardware TIM. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | * Copyright (c) 2023 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 "stm32f4xx_hal.h" 22 | #include "stm32f4xx_hal_tim.h" 23 | 24 | /* Private typedef -----------------------------------------------------------*/ 25 | /* Private define ------------------------------------------------------------*/ 26 | /* Private macro -------------------------------------------------------------*/ 27 | /* Private variables ---------------------------------------------------------*/ 28 | TIM_HandleTypeDef htim1; 29 | /* Private function prototypes -----------------------------------------------*/ 30 | /* Private functions ---------------------------------------------------------*/ 31 | 32 | /** 33 | * @brief This function configures the TIM1 as a time base source. 34 | * The time source is configured to have 1ms time base with a dedicated 35 | * Tick interrupt priority. 36 | * @note This function is called automatically at the beginning of program after 37 | * reset by HAL_Init() or at any time when clock is configured, by HAL_RCC_ClockConfig(). 38 | * @param TickPriority: Tick interrupt priority. 39 | * @retval HAL status 40 | */ 41 | HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) 42 | { 43 | RCC_ClkInitTypeDef clkconfig; 44 | uint32_t uwTimclock = 0U; 45 | 46 | uint32_t uwPrescalerValue = 0U; 47 | uint32_t pFLatency; 48 | HAL_StatusTypeDef status; 49 | 50 | /* Enable TIM1 clock */ 51 | __HAL_RCC_TIM1_CLK_ENABLE(); 52 | 53 | /* Get clock configuration */ 54 | HAL_RCC_GetClockConfig(&clkconfig, &pFLatency); 55 | 56 | /* Compute TIM1 clock */ 57 | uwTimclock = 2*HAL_RCC_GetPCLK2Freq(); 58 | 59 | /* Compute the prescaler value to have TIM1 counter clock equal to 1MHz */ 60 | uwPrescalerValue = (uint32_t) ((uwTimclock / 1000000U) - 1U); 61 | 62 | /* Initialize TIM1 */ 63 | htim1.Instance = TIM1; 64 | 65 | /* Initialize TIMx peripheral as follow: 66 | 67 | + Period = [(TIM1CLK/1000) - 1]. to have a (1/1000) s time base. 68 | + Prescaler = (uwTimclock/1000000 - 1) to have a 1MHz counter clock. 69 | + ClockDivision = 0 70 | + Counter direction = Up 71 | */ 72 | htim1.Init.Period = (1000000U / 1000U) - 1U; 73 | htim1.Init.Prescaler = uwPrescalerValue; 74 | htim1.Init.ClockDivision = 0; 75 | htim1.Init.CounterMode = TIM_COUNTERMODE_UP; 76 | htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; 77 | 78 | status = HAL_TIM_Base_Init(&htim1); 79 | if (status == HAL_OK) 80 | { 81 | /* Start the TIM time Base generation in interrupt mode */ 82 | status = HAL_TIM_Base_Start_IT(&htim1); 83 | if (status == HAL_OK) 84 | { 85 | /* Enable the TIM1 global Interrupt */ 86 | HAL_NVIC_EnableIRQ(TIM1_UP_TIM10_IRQn); 87 | /* Configure the SysTick IRQ priority */ 88 | if (TickPriority < (1UL << __NVIC_PRIO_BITS)) 89 | { 90 | /* Configure the TIM IRQ priority */ 91 | HAL_NVIC_SetPriority(TIM1_UP_TIM10_IRQn, TickPriority, 0U); 92 | uwTickPrio = TickPriority; 93 | } 94 | else 95 | { 96 | status = HAL_ERROR; 97 | } 98 | } 99 | } 100 | 101 | /* Return function status */ 102 | return status; 103 | } 104 | 105 | /** 106 | * @brief Suspend Tick increment. 107 | * @note Disable the tick increment by disabling TIM1 update interrupt. 108 | * @param None 109 | * @retval None 110 | */ 111 | void HAL_SuspendTick(void) 112 | { 113 | /* Disable TIM1 update Interrupt */ 114 | __HAL_TIM_DISABLE_IT(&htim1, TIM_IT_UPDATE); 115 | } 116 | 117 | /** 118 | * @brief Resume Tick increment. 119 | * @note Enable the tick increment by Enabling TIM1 update interrupt. 120 | * @param None 121 | * @retval None 122 | */ 123 | void HAL_ResumeTick(void) 124 | { 125 | /* Enable TIM1 Update interrupt */ 126 | __HAL_TIM_ENABLE_IT(&htim1, TIM_IT_UPDATE); 127 | } 128 | 129 | -------------------------------------------------------------------------------- /pcb_design/component_libraries/STM32F407VGT6/STM32F407VGT6.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | #(c) SnapEDA 2016 (snapeda.com) 4 | #This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA) with Design Exception 1.0 5 | # 6 | # STM32F407VGT6 7 | # 8 | DEF STM32F407VGT6 U 0 40 Y Y 3 L N 9 | F0 "U" -400 901 50 H V L BNN 10 | F1 "STM32F407VGT6" -400 -904 50 H V L BNN 11 | F2 "QFP50P1600X1600X160-100N" 0 0 50 H I L BNN 12 | F3 "" 0 0 50 H I L BNN 13 | F4 "1.6mm" 0 0 50 H I L BNN "MAXIMUM_PACKAGE_HEIGHT" 14 | F5 "ST Microelectronics" 0 0 50 H I L BNN "MANUFACTURER" 15 | F6 "8" 0 0 50 H I L BNN "PARTREV" 16 | F7 "IPC7351B" 0 0 50 H I L BNN "STANDARD" 17 | DRAW 18 | S -400 -800 400 900 1 0 10 f 19 | X PA0 23 -600 800 200 R 40 40 1 0 B 20 | X PA1 24 -600 700 200 R 40 40 1 0 B 21 | X PA2 25 -600 600 200 R 40 40 1 0 B 22 | X PA3 26 -600 500 200 R 40 40 1 0 B 23 | X PA4 29 -600 400 200 R 40 40 1 0 B 24 | X PA5 30 -600 300 200 R 40 40 1 0 B 25 | X PA6 31 -600 200 200 R 40 40 1 0 B 26 | X PA7 32 -600 100 200 R 40 40 1 0 B 27 | X PB0 35 600 -700 200 L 40 40 1 0 B 28 | X PB1 36 600 -600 200 L 40 40 1 0 B 29 | X PB2 37 600 -500 200 L 40 40 1 0 B 30 | X PB10 47 600 300 200 L 40 40 1 0 B 31 | X PB11 48 600 400 200 L 40 40 1 0 B 32 | X PB12 51 600 500 200 L 40 40 1 0 B 33 | X PB13 52 600 600 200 L 40 40 1 0 B 34 | X PB14 53 600 700 200 L 40 40 1 0 B 35 | X PB15 54 600 800 200 L 40 40 1 0 B 36 | X PA8 67 -600 0 200 R 40 40 1 0 B 37 | X PA9 68 -600 -100 200 R 40 40 1 0 B 38 | X PA10 69 -600 -200 200 R 40 40 1 0 B 39 | X PA11 70 -600 -300 200 R 40 40 1 0 B 40 | X PA12 71 -600 -400 200 R 40 40 1 0 B 41 | X PA13 72 -600 -500 200 R 40 40 1 0 B 42 | X PA14 76 -600 -600 200 R 40 40 1 0 B 43 | X PA15 77 -600 -700 200 R 40 40 1 0 B 44 | X PB3 89 600 -400 200 L 40 40 1 0 B 45 | X PB4 90 600 -300 200 L 40 40 1 0 B 46 | X PB5 91 600 -200 200 L 40 40 1 0 B 47 | X PB6 92 600 -100 200 L 40 40 1 0 B 48 | X PB7 93 600 0 200 L 40 40 1 0 B 49 | X PB8 95 600 100 200 L 40 40 1 0 B 50 | X PB9 96 600 200 200 L 40 40 1 0 B 51 | S -400 -800 400 900 2 0 10 f 52 | X PC13 7 -600 -500 200 R 40 40 2 0 B 53 | X PC14 8 -600 -600 200 R 40 40 2 0 B 54 | X PC15 9 -600 -700 200 R 40 40 2 0 B 55 | X PC0 15 -600 800 200 R 40 40 2 0 B 56 | X PC1 16 -600 700 200 R 40 40 2 0 B 57 | X PC2 17 -600 600 200 R 40 40 2 0 B 58 | X PC3 18 -600 500 200 R 40 40 2 0 B 59 | X PC4 33 -600 400 200 R 40 40 2 0 B 60 | X PC5 34 -600 300 200 R 40 40 2 0 B 61 | X PD1 82 600 700 200 L 40 40 2 0 B 62 | X PD2 83 600 600 200 L 40 40 2 0 B 63 | X PD3 84 600 500 200 L 40 40 2 0 B 64 | X PD4 85 600 400 200 L 40 40 2 0 B 65 | X PD5 86 600 300 200 L 40 40 2 0 B 66 | X PD6 87 600 200 200 L 40 40 2 0 B 67 | X PD7 88 600 100 200 L 40 40 2 0 B 68 | X PD8 55 600 0 200 L 40 40 2 0 B 69 | X PD9 56 600 -100 200 L 40 40 2 0 B 70 | X PD10 57 600 -200 200 L 40 40 2 0 B 71 | X PD11 58 600 -300 200 L 40 40 2 0 B 72 | X PD12 59 600 -400 200 L 40 40 2 0 B 73 | X PD13 60 600 -500 200 L 40 40 2 0 B 74 | X PD14 61 600 -600 200 L 40 40 2 0 B 75 | X PD15 62 600 -700 200 L 40 40 2 0 B 76 | X PC6 63 -600 200 200 R 40 40 2 0 B 77 | X PC7 64 -600 100 200 R 40 40 2 0 B 78 | X PC8 65 -600 0 200 R 40 40 2 0 B 79 | X PC9 66 -600 -100 200 R 40 40 2 0 B 80 | X PC10 78 -600 -200 200 R 40 40 2 0 B 81 | X PC11 79 -600 -300 200 R 40 40 2 0 B 82 | X PC12 80 -600 -400 200 R 40 40 2 0 B 83 | X PD0 81 600 800 200 L 40 40 2 0 B 84 | S -400 -1300 400 1300 3 0 10 f 85 | X PE2 1 -600 600 200 R 40 40 3 0 B 86 | X PE3 2 -600 500 200 R 40 40 3 0 B 87 | X PE4 3 -600 400 200 R 40 40 3 0 B 88 | X PE5 4 -600 300 200 R 40 40 3 0 B 89 | X PE6 5 -600 200 200 R 40 40 3 0 B 90 | X VBAT 6 600 1000 200 L 40 40 3 0 W 91 | X NRST 14 600 700 200 L 40 40 3 0 B 92 | X VSSA 20 600 -1100 200 L 40 40 3 0 W 93 | X VREF+ 21 600 0 200 L 40 40 3 0 W 94 | X VDDA 22 600 1200 200 L 40 40 3 0 W 95 | X PE1 98 -600 700 200 R 40 40 3 0 B 96 | X PE7 38 -600 100 200 R 40 40 3 0 B 97 | X PE8 39 -600 0 200 R 40 40 3 0 B 98 | X PE9 40 -600 -100 200 R 40 40 3 0 B 99 | X PE10 41 -600 -200 200 R 40 40 3 0 B 100 | X PE11 42 -600 -300 200 R 40 40 3 0 B 101 | X PE12 43 -600 -400 200 R 40 40 3 0 B 102 | X PE13 44 -600 -500 200 R 40 40 3 0 B 103 | X PE14 45 -600 -600 200 R 40 40 3 0 B 104 | X PE15 46 -600 -700 200 R 40 40 3 0 B 105 | X VCAP_1 49 600 500 200 L 40 40 3 0 P 106 | X VCAP_2 73 600 400 200 L 40 40 3 0 P 107 | X BOOT0 94 600 800 200 L 40 40 3 0 I 108 | X PE0 97 -600 800 200 R 40 40 3 0 B 109 | X PH0 12 -600 -900 200 R 40 40 3 0 B 110 | X PH1 13 -600 -1000 200 R 40 40 3 0 B 111 | X VSS 10 600 -1200 200 L 40 40 3 0 W 112 | X VSS 27 600 -1200 200 L 40 40 3 0 W 113 | X VSS 74 600 -1200 200 L 40 40 3 0 W 114 | X VSS 99 600 -1200 200 L 40 40 3 0 W 115 | X VDD 11 600 1100 200 L 40 40 3 0 W 116 | X VDD 19 600 1100 200 L 40 40 3 0 W 117 | X VDD 28 600 1100 200 L 40 40 3 0 W 118 | X VDD 50 600 1100 200 L 40 40 3 0 W 119 | X VDD 75 600 1100 200 L 40 40 3 0 W 120 | X VDD 100 600 1100 200 L 40 40 3 0 W 121 | ENDDRAW 122 | ENDDEF 123 | # 124 | # End Library -------------------------------------------------------------------------------- /firmware/Drivers/Mpu6500/mpu6500.h: -------------------------------------------------------------------------------- 1 | #ifndef __MPU6500_H__ 2 | #define __MPU6500_H__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | #include 10 | #include "stm32f4xx_hal.h" 11 | 12 | #define MPU6500_SPI hspi1 13 | #define MPU6500_CS_GPIO GPIOA 14 | #define MPU6500_CS_PIN GPIO_PIN_11 15 | 16 | static const uint8_t READWRITE_CMD = 0x80; 17 | static const uint8_t MULTIPLEBYTE_CMD = 0x40; 18 | static const uint8_t DUMMY_BYTE = 0x00; 19 | 20 | static const uint8_t _address = 0b11010000; 21 | // 400 kHz 22 | static const uint32_t _i2cRate = 400000; 23 | 24 | // MPU6500 registers 25 | static const uint8_t ACCEL_OUT = 0x3B; 26 | static const uint8_t GYRO_OUT = 0x43; 27 | static const uint8_t TEMP_OUT = 0x41; 28 | static const uint8_t EXT_SENS_DATA_00 = 0x49; 29 | static const uint8_t ACCEL_CONFIG = 0x1C; 30 | static const uint8_t ACCEL_FS_SEL_2G = 0x00; 31 | static const uint8_t ACCEL_FS_SEL_4G = 0x08; 32 | static const uint8_t ACCEL_FS_SEL_8G = 0x10; 33 | static const uint8_t ACCEL_FS_SEL_16G = 0x18; 34 | static const uint8_t GYRO_CONFIG = 0x1B; 35 | static const uint8_t GYRO_FS_SEL_250DPS = 0x00; 36 | static const uint8_t GYRO_FS_SEL_500DPS = 0x08; 37 | static const uint8_t GYRO_FS_SEL_1000DPS = 0x10; 38 | static const uint8_t GYRO_FS_SEL_2000DPS = 0x18; 39 | static const uint8_t ACCEL_CONFIG2 = 0x1D; 40 | static const uint8_t DLPF_184 = 0x01; 41 | static const uint8_t DLPF_92 = 0x02; 42 | static const uint8_t DLPF_41 = 0x03; 43 | static const uint8_t DLPF_20 = 0x04; 44 | static const uint8_t DLPF_10 = 0x05; 45 | static const uint8_t DLPF_5 = 0x06; 46 | static const uint8_t CONFIG = 0x1A; 47 | static const uint8_t SMPDIV = 0x19; 48 | static const uint8_t INT_PIN_CFG = 0x37; 49 | static const uint8_t INT_ENABLE = 0x38; 50 | static const uint8_t INT_DISABLE = 0x00; 51 | static const uint8_t INT_PULSE_50US = 0x00; 52 | static const uint8_t INT_WOM_EN = 0x40; 53 | static const uint8_t INT_RAW_RDY_EN = 0x01; 54 | static const uint8_t PWR_MGMNT_1 = 0x6B; 55 | static const uint8_t PWR_CYCLE = 0x20; 56 | static const uint8_t PWR_RESET = 0x80; 57 | static const uint8_t CLOCK_SEL_PLL = 0x01; 58 | static const uint8_t PWR_MGMNT_2 = 0x6C; 59 | static const uint8_t SEN_ENABLE = 0x00; 60 | static const uint8_t DIS_GYRO = 0x07; 61 | static const uint8_t USER_CTRL = 0x6A; 62 | static const uint8_t I2C_MST_EN = 0x20; 63 | static const uint8_t I2C_MST_CLK = 0x0D; 64 | static const uint8_t I2C_MST_CTRL = 0x24; 65 | static const uint8_t I2C_SLV0_ADDR = 0x25; 66 | static const uint8_t I2C_SLV0_REG = 0x26; 67 | static const uint8_t I2C_SLV0_DO = 0x63; 68 | static const uint8_t I2C_SLV0_CTRL = 0x27; 69 | static const uint8_t I2C_SLV0_EN = 0x80; 70 | static const uint8_t I2C_READ_FLAG = 0x80; 71 | static const uint8_t MOT_DETECT_CTRL = 0x69; 72 | static const uint8_t ACCEL_INTEL_EN = 0x80; 73 | static const uint8_t ACCEL_INTEL_MODE = 0x40; 74 | static const uint8_t LP_ACCEL_ODR = 0x1E; 75 | static const uint8_t WOM_THR = 0x1F; 76 | static const uint8_t WHO_AM_I = 0x75; 77 | static const uint8_t FIFO_EN = 0x23; 78 | static const uint8_t FIFO_TEMP = 0x80; 79 | static const uint8_t FIFO_GYRO = 0x70; 80 | static const uint8_t FIFO_ACCEL = 0x08; 81 | static const uint8_t FIFO_MAG = 0x01; 82 | static const uint8_t FIFO_COUNT = 0x72; 83 | static const uint8_t FIFO_READ = 0x74; 84 | 85 | typedef enum GyroRange_ 86 | { 87 | GYRO_RANGE_250DPS = 0, 88 | GYRO_RANGE_500DPS, 89 | GYRO_RANGE_1000DPS, 90 | GYRO_RANGE_2000DPS 91 | } GyroRange; 92 | 93 | typedef enum AccelRange_ 94 | { 95 | ACCEL_RANGE_2G = 0, 96 | ACCEL_RANGE_4G, 97 | ACCEL_RANGE_8G, 98 | ACCEL_RANGE_16G 99 | } AccelRange; 100 | 101 | typedef enum DLPFBandwidth_ 102 | { 103 | DLPF_BANDWIDTH_184HZ = 0, 104 | DLPF_BANDWIDTH_92HZ, 105 | DLPF_BANDWIDTH_41HZ, 106 | DLPF_BANDWIDTH_20HZ, 107 | DLPF_BANDWIDTH_10HZ, 108 | DLPF_BANDWIDTH_5HZ 109 | } DLPFBandwidth; 110 | 111 | typedef enum SampleRateDivider_ 112 | { 113 | LP_ACCEL_ODR_0_24HZ = 0, 114 | LP_ACCEL_ODR_0_49HZ, 115 | LP_ACCEL_ODR_0_98HZ, 116 | LP_ACCEL_ODR_1_95HZ, 117 | LP_ACCEL_ODR_3_91HZ, 118 | LP_ACCEL_ODR_7_81HZ, 119 | LP_ACCEL_ODR_15_63HZ, 120 | LP_ACCEL_ODR_31_25HZ, 121 | LP_ACCEL_ODR_62_50HZ, 122 | LP_ACCEL_ODR_125HZ, 123 | LP_ACCEL_ODR_250HZ, 124 | LP_ACCEL_ODR_500HZ 125 | } SampleRateDivider; 126 | 127 | uint8_t mpu6500_init(); 128 | /* read the data, each argiment should point to a array for x, y, and x */ 129 | void mpu6500_get_data(int16_t *AccData, int16_t *GyroData); 130 | 131 | /* sets the sample rate divider to values other than default */ 132 | void MPU6500_SetSampleRateDivider(SampleRateDivider srd); 133 | /* sets the DLPF bandwidth to values other than default */ 134 | void mpu6500_set_dlpf_bandwidth(DLPFBandwidth bandwidth); 135 | /* sets the gyro full scale range to values other than default */ 136 | void mpu6500_get_gyro_range(GyroRange range); 137 | /* sets the accelerometer full scale range to values other than default */ 138 | void mpu6500_set_accel_range(AccelRange range); 139 | #ifdef __cplusplus 140 | } 141 | #endif 142 | 143 | #endif 144 | -------------------------------------------------------------------------------- /firmware/Drivers/Adc/adc.c: -------------------------------------------------------------------------------- 1 | #include "adc.h" 2 | 3 | #include 4 | #include 5 | 6 | static ADC_HandleTypeDef hadc1; 7 | DMA_HandleTypeDef hdma_adc1; 8 | 9 | static void MX_DMA_Init(void); 10 | static void MX_ADC1_Init(void); 11 | 12 | static uint32_t value[5]; 13 | 14 | static bool is_initialised = false; 15 | 16 | HAL_StatusTypeDef adc_init() 17 | { 18 | if (is_initialised) { 19 | return HAL_OK; 20 | } 21 | MX_DMA_Init(); 22 | MX_ADC1_Init(); 23 | is_initialised = true; 24 | return HAL_ADC_Start_DMA(&hadc1, value, 5); 25 | } 26 | 27 | uint32_t get_ir_readings(IR_SENSOR sensor) 28 | { 29 | if (sensor < IR_MAX) 30 | return value[sensor + 1]; 31 | else 32 | return 0; 33 | } 34 | 35 | uint32_t get_battery_reading() 36 | { 37 | 38 | return value[0]; 39 | } 40 | 41 | static void MX_DMA_Init(void) 42 | { 43 | 44 | /* DMA controller clock enable */ 45 | __HAL_RCC_DMA2_CLK_ENABLE(); 46 | 47 | /* DMA interrupt init */ 48 | /* DMA2_Stream0_IRQn interrupt configuration */ 49 | HAL_NVIC_SetPriority(DMA2_Stream0_IRQn, 5, 0); 50 | HAL_NVIC_EnableIRQ(DMA2_Stream0_IRQn); 51 | 52 | } 53 | 54 | /* ADC1 init function */ 55 | static void MX_ADC1_Init(void) 56 | { 57 | ADC_ChannelConfTypeDef sConfig = {0}; 58 | 59 | /** Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion) 60 | */ 61 | hadc1.Instance = ADC1; 62 | hadc1.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV4; 63 | hadc1.Init.Resolution = ADC_RESOLUTION_12B; 64 | hadc1.Init.ScanConvMode = ENABLE; 65 | hadc1.Init.ContinuousConvMode = ENABLE; 66 | hadc1.Init.DiscontinuousConvMode = DISABLE; 67 | hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; 68 | hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START; 69 | hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; 70 | hadc1.Init.NbrOfConversion = 5; 71 | hadc1.Init.DMAContinuousRequests = ENABLE; 72 | hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV; 73 | HAL_ADC_Init(&hadc1); 74 | 75 | /** Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time. 76 | */ 77 | sConfig.Channel = ADC_CHANNEL_0; 78 | sConfig.Rank = 1; 79 | sConfig.SamplingTime = ADC_SAMPLETIME_3CYCLES; 80 | HAL_ADC_ConfigChannel(&hadc1, &sConfig); 81 | 82 | sConfig.Channel = ADC_CHANNEL_1; 83 | sConfig.Rank = 2; 84 | HAL_ADC_ConfigChannel(&hadc1, &sConfig); 85 | 86 | sConfig.Channel = ADC_CHANNEL_4; 87 | sConfig.Rank = 3; 88 | HAL_ADC_ConfigChannel(&hadc1, &sConfig); 89 | 90 | sConfig.Channel = ADC_CHANNEL_5; 91 | sConfig.Rank = 4; 92 | HAL_ADC_ConfigChannel(&hadc1, &sConfig); 93 | 94 | sConfig.Channel = ADC_CHANNEL_7; 95 | sConfig.Rank = 5; 96 | HAL_ADC_ConfigChannel(&hadc1, &sConfig); 97 | } 98 | 99 | void HAL_ADC_MspInit(ADC_HandleTypeDef* adcHandle) 100 | { 101 | 102 | GPIO_InitTypeDef GPIO_InitStruct = {0}; 103 | if(adcHandle->Instance==ADC1) 104 | { 105 | /* ADC1 clock enable */ 106 | __HAL_RCC_ADC1_CLK_ENABLE(); 107 | 108 | __HAL_RCC_GPIOA_CLK_ENABLE(); 109 | /**ADC1 GPIO Configuration 110 | PA0-WKUP ------> ADC1_IN0 111 | PA1 ------> ADC1_IN1 112 | PA4 ------> ADC1_IN4 113 | PA5 ------> ADC1_IN5 114 | PA7 ------> ADC1_IN7 115 | */ 116 | GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_4|GPIO_PIN_5 117 | |GPIO_PIN_7; 118 | GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; 119 | GPIO_InitStruct.Pull = GPIO_NOPULL; 120 | HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); 121 | 122 | /* ADC1 DMA Init */ 123 | /* ADC1 Init */ 124 | hdma_adc1.Instance = DMA2_Stream0; 125 | hdma_adc1.Init.Channel = DMA_CHANNEL_0; 126 | hdma_adc1.Init.Direction = DMA_PERIPH_TO_MEMORY; 127 | hdma_adc1.Init.PeriphInc = DMA_PINC_DISABLE; 128 | hdma_adc1.Init.MemInc = DMA_MINC_ENABLE; 129 | hdma_adc1.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD; 130 | hdma_adc1.Init.MemDataAlignment = DMA_MDATAALIGN_WORD; 131 | hdma_adc1.Init.Mode = DMA_CIRCULAR; 132 | hdma_adc1.Init.Priority = DMA_PRIORITY_LOW; 133 | hdma_adc1.Init.FIFOMode = DMA_FIFOMODE_DISABLE; 134 | HAL_DMA_Init(&hdma_adc1); 135 | 136 | __HAL_LINKDMA(adcHandle,DMA_Handle,hdma_adc1); 137 | } 138 | } 139 | 140 | void HAL_ADC_MspDeInit(ADC_HandleTypeDef* adcHandle) 141 | { 142 | 143 | if(adcHandle->Instance==ADC1) 144 | { 145 | __HAL_RCC_ADC1_CLK_DISABLE(); 146 | 147 | /**ADC1 GPIO Configuration 148 | PA0-WKUP ------> ADC1_IN0 149 | PA1 ------> ADC1_IN1 150 | PA4 ------> ADC1_IN4 151 | PA5 ------> ADC1_IN5 152 | PA7 ------> ADC1_IN7 153 | */ 154 | HAL_GPIO_DeInit(GPIOA, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_4|GPIO_PIN_5 155 | |GPIO_PIN_7); 156 | 157 | HAL_DMA_DeInit(adcHandle->DMA_Handle); 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /pcb_design/gerbers/mushak_pcb-PTH.drl: -------------------------------------------------------------------------------- 1 | M48 2 | ; DRILL file {KiCad 6.0.11-2627ca5db0~126~ubuntu22.04.1} date Sun 12 Mar 2023 03:28:44 PM IST 3 | ; FORMAT={-:-/ absolute / inch / decimal} 4 | ; #@! TF.CreationDate,2023-03-12T15:28:44+05:30 5 | ; #@! TF.GenerationSoftware,Kicad,Pcbnew,6.0.11-2627ca5db0~126~ubuntu22.04.1 6 | ; #@! TF.FileFunction,Plated,1,2,PTH 7 | FMAT,2 8 | INCH 9 | ; #@! TA.AperFunction,Plated,PTH,ViaDrill 10 | T1C0.0079 11 | ; #@! TA.AperFunction,Plated,PTH,ViaDrill 12 | T2C0.0118 13 | ; #@! TA.AperFunction,Plated,PTH,ComponentDrill 14 | T3C0.0118 15 | ; #@! TA.AperFunction,Plated,PTH,ComponentDrill 16 | T4C0.0197 17 | ; #@! TA.AperFunction,Plated,PTH,ComponentDrill 18 | T5C0.0394 19 | % 20 | G90 21 | G05 22 | T1 23 | X7.0354Y-3.9341 24 | X7.0974Y-3.9114 25 | X7.123Y-3.9114 26 | X7.1486Y-3.9114 27 | X7.1742Y-3.6437 28 | X7.1742Y-3.6683 29 | X7.1998Y-3.9114 30 | X7.2254Y-3.6427 31 | X7.2254Y-3.6683 32 | X7.2254Y-3.9537 33 | X7.251Y-3.9114 34 | X7.3061Y-3.8848 35 | X7.3061Y-3.9134 36 | X7.3317Y-3.8819 37 | X7.3317Y-3.9055 38 | X7.7913Y-4.4803 39 | X7.7913Y-4.5059 40 | X7.7913Y-4.5315 41 | X7.8716Y-4.5 42 | X7.8905Y-4.5152 43 | X7.9272Y-4.4419 44 | X7.9508Y-4.4764 45 | X7.9508Y-4.5413 46 | X7.9675Y-4.4419 47 | X7.9744Y-4.5463 48 | X7.998Y-4.5413 49 | T2 50 | X5.9302Y-3.6683 51 | X5.9538Y-3.6361 52 | X6.0453Y-3.7256 53 | X6.0512Y-3.561 54 | X6.0551Y-3.5068 55 | X6.0591Y-3.9547 56 | X6.0728Y-4.0945 57 | X6.0748Y-3.7894 58 | X6.0787Y-3.7559 59 | X6.0984Y-4.0689 60 | X6.1142Y-3.3189 61 | X6.1417Y-3.624 62 | X6.1693Y-4.0394 63 | X6.1693Y-4.0748 64 | X6.1693Y-4.1102 65 | X6.1811Y-3.622 66 | X6.2461Y-3.9449 67 | X6.2499Y-3.9133 68 | X6.2589Y-4.3484 69 | X6.2776Y-3.8524 70 | X6.2815Y-3.7323 71 | X6.2815Y-3.8228 72 | X6.2835Y-3.7697 73 | X6.2871Y-3.9729 74 | X6.2874Y-4.3484 75 | X6.2972Y-3.5236 76 | X6.311Y-3.3839 77 | X6.311Y-3.6772 78 | X6.311Y-3.9449 79 | X6.3189Y-3.7382 80 | X6.3504Y-3.9744 81 | X6.3583Y-3.6772 82 | X6.3898Y-3.9724 83 | X6.3937Y-4.2402 84 | X6.4085Y-3.4626 85 | X6.4094Y-3.9449 86 | X6.4222Y-3.3219 87 | X6.4291Y-3.6673 88 | X6.4311Y-3.9724 89 | X6.4311Y-4.2579 90 | X6.4606Y-4.2008 91 | X6.4606Y-4.2343 92 | X6.4882Y-3.7874 93 | X6.4902Y-3.7323 94 | X6.501Y-4.2913 95 | X6.5059Y-3.9311 96 | X6.5197Y-3.8583 97 | X6.5276Y-3.8091 98 | X6.5335Y-3.9508 99 | X6.5472Y-3.6457 100 | X6.5551Y-3.7205 101 | X6.5748Y-3.9508 102 | X6.5748Y-4.189 103 | X6.5754Y-3.637 104 | X6.5984Y-4.126 105 | X6.6752Y-4.0945 106 | X6.6811Y-3.3543 107 | X6.6811Y-3.4409 108 | X6.7126Y-3.815 109 | X6.7254Y-3.6447 110 | X6.7421Y-3.8071 111 | X6.7421Y-4.1398 112 | X6.7776Y-3.8858 113 | X6.7933Y-4.0965 114 | X6.7953Y-3.502 115 | X6.7972Y-3.9626 116 | X6.8143Y-3.6692 117 | X6.8297Y-4.0984 118 | X6.8337Y-4.2274 119 | X6.8583Y-3.6476 120 | X6.8622Y-4.2008 121 | X6.8701Y-3.4626 122 | X6.9035Y-3.3445 123 | X6.9075Y-4.1388 124 | X6.9547Y-3.6654 125 | X7.0039Y-4.0246 126 | X7.0276Y-3.8209 127 | X7.0315Y-3.7205 128 | X7.0325Y-3.7805 129 | X7.0364Y-3.875 130 | X7.0433Y-3.9843 131 | X7.1024Y-4.0118 132 | X7.1043Y-3.815 133 | X7.1644Y-3.7756 134 | X7.1644Y-3.8543 135 | X7.2254Y-3.812 136 | X7.2264Y-4.2234 137 | X7.2402Y-4.4449 138 | X7.2441Y-3.1083 139 | X7.25Y-4.0463 140 | X7.2579Y-4.1949 141 | X7.3012Y-3.7264 142 | X7.3209Y-3.628 143 | X7.3346Y-3.7185 144 | X7.3534Y-3.8109 145 | X7.3602Y-3.4961 146 | X7.4409Y-3.2362 147 | X7.4469Y-3.7205 148 | X7.4705Y-3.8051 149 | X7.498Y-4.1811 150 | X7.5059Y-3.8051 151 | X7.5177Y-4.1614 152 | X7.5394Y-3.8051 153 | X7.5571Y-3.5217 154 | X7.5748Y-3.5492 155 | X7.8199Y-3.3976 156 | X7.8199Y-3.4488 157 | X7.8219Y-3.2018 158 | X7.8238Y-3.2303 159 | X7.8287Y-3.9902 160 | X7.8287Y-4.2224 161 | X7.8307Y-3.7717 162 | X7.8327Y-3.561 163 | X7.8839Y-4.3209 164 | X7.8858Y-4.0886 165 | X7.9154Y-3.8524 166 | X7.9193Y-3.6437 167 | X7.938Y-3.4134 168 | X7.9469Y-3.2077 169 | X7.9498Y-3.1772 170 | X7.9557Y-3.437 171 | X7.9803Y-4.2717 172 | X7.9803Y-4.315 173 | X7.9843Y-4.0453 174 | X7.9862Y-4.0827 175 | X8.0602Y-3.3524 176 | X8.062Y-3.1329 177 | T3 178 | X8.0591Y-3.5728 179 | X8.0591Y-3.6909 180 | X8.0591Y-3.7854 181 | X8.0591Y-3.9035 182 | X8.0591Y-4.0039 183 | X8.0591Y-4.122 184 | X8.0591Y-4.2362 185 | X8.0591Y-4.3543 186 | X8.0709Y-3.3189 187 | X8.0709Y-3.4764 188 | X8.0736Y-3.0984 189 | X8.0736Y-3.2559 190 | X8.0748Y-4.4272 191 | X8.0748Y-4.5846 192 | T4 193 | X7.2805Y-4.0778 194 | X7.2825Y-3.562 195 | X7.2825Y-4.1388 196 | X7.2844Y-3.501 197 | T5 198 | X7.4114Y-3.3622 199 | X7.5098Y-3.3622 200 | T5 201 | G00X5.935Y-3.7343 202 | M15 203 | G01X5.935Y-3.7461 204 | M16 205 | G05 206 | G00X5.935Y-3.8917 207 | M15 208 | G01X5.935Y-3.9035 209 | M16 210 | G05 211 | G00X5.9746Y-3.5332 212 | M15 213 | G01X5.9703Y-3.5222 214 | M16 215 | G05 216 | G00X5.9746Y-4.1046 217 | M15 218 | G01X5.9703Y-4.1156 219 | M16 220 | G05 221 | G00X6.0179Y-3.6431 222 | M15 223 | G01X6.0136Y-3.6321 224 | M16 225 | G05 226 | G00X6.0179Y-3.9947 227 | M15 228 | G01X6.0136Y-4.0057 229 | M16 230 | G05 231 | G00X6.0599Y-3.3766 232 | M15 233 | G01X6.0482Y-3.3745 234 | M16 235 | G05 236 | G00X6.0618Y-4.2612 237 | M15 238 | G01X6.0502Y-4.2632 239 | M16 240 | G05 241 | G00X6.1762Y-3.3971 242 | M15 243 | G01X6.1645Y-3.3951 244 | M16 245 | G05 246 | G00X6.1781Y-4.2407 247 | M15 248 | G01X6.1665Y-4.2427 249 | M16 250 | G05 251 | G00X6.7776Y-3.622 252 | M15 253 | G01X6.7657Y-3.622 254 | M16 255 | G05 256 | G00X6.7657Y-4.0157 257 | M15 258 | G01X6.7776Y-4.0157 259 | M16 260 | G05 261 | G00X6.935Y-3.622 262 | M15 263 | G01X6.9232Y-3.622 264 | M16 265 | G05 266 | G00X6.9232Y-4.0157 267 | M15 268 | G01X6.935Y-4.0157 269 | M16 270 | G05 271 | T0 272 | M30 273 | -------------------------------------------------------------------------------- /pcb_design/renders/mushak_pcb-PTH.drl: -------------------------------------------------------------------------------- 1 | M48 2 | ; DRILL file {KiCad 6.0.8-f2edbf62ab~116~ubuntu22.04.1} date Tue 18 Oct 2022 02:38:09 AM IST 3 | ; FORMAT={-:-/ absolute / inch / decimal} 4 | ; #@! TF.CreationDate,2022-10-18T02:38:09+05:30 5 | ; #@! TF.GenerationSoftware,Kicad,Pcbnew,6.0.8-f2edbf62ab~116~ubuntu22.04.1 6 | ; #@! TF.FileFunction,Plated,1,2,PTH 7 | FMAT,2 8 | INCH 9 | ; #@! TA.AperFunction,Plated,PTH,ViaDrill 10 | T1C0.0079 11 | ; #@! TA.AperFunction,Plated,PTH,ViaDrill 12 | T2C0.0118 13 | ; #@! TA.AperFunction,Plated,PTH,ComponentDrill 14 | T3C0.0118 15 | ; #@! TA.AperFunction,Plated,PTH,ComponentDrill 16 | T4C0.0197 17 | ; #@! TA.AperFunction,Plated,PTH,ComponentDrill 18 | T5C0.0394 19 | % 20 | G90 21 | G05 22 | T1 23 | X7.0354Y-3.9341 24 | X7.0974Y-3.9114 25 | X7.123Y-3.9114 26 | X7.1486Y-3.9114 27 | X7.1742Y-3.6437 28 | X7.1742Y-3.6683 29 | X7.1998Y-3.9114 30 | X7.2254Y-3.6427 31 | X7.2254Y-3.6683 32 | X7.2254Y-3.9537 33 | X7.251Y-3.9114 34 | X7.3061Y-3.8848 35 | X7.3061Y-3.9134 36 | X7.3317Y-3.8819 37 | X7.3317Y-3.9055 38 | T2 39 | X5.9302Y-3.6683 40 | X5.9538Y-3.6361 41 | X6.0453Y-3.7256 42 | X6.0512Y-3.561 43 | X6.0551Y-3.5068 44 | X6.0591Y-3.9547 45 | X6.0728Y-4.0945 46 | X6.0748Y-3.7894 47 | X6.0787Y-3.7559 48 | X6.0984Y-4.0689 49 | X6.1142Y-3.3189 50 | X6.1417Y-3.624 51 | X6.1693Y-4.0394 52 | X6.1693Y-4.0748 53 | X6.1693Y-4.1102 54 | X6.1811Y-3.622 55 | X6.2461Y-3.9449 56 | X6.2499Y-3.9133 57 | X6.2589Y-4.3484 58 | X6.2776Y-3.8524 59 | X6.2815Y-3.7323 60 | X6.2815Y-3.8228 61 | X6.2835Y-3.7697 62 | X6.2871Y-3.9729 63 | X6.2874Y-4.3484 64 | X6.2972Y-3.5236 65 | X6.311Y-3.3839 66 | X6.311Y-3.6772 67 | X6.311Y-3.9449 68 | X6.3189Y-3.7382 69 | X6.3504Y-3.9744 70 | X6.3583Y-3.6772 71 | X6.3898Y-3.9724 72 | X6.3937Y-4.2402 73 | X6.4085Y-3.4626 74 | X6.4094Y-3.9449 75 | X6.4222Y-3.3219 76 | X6.4291Y-3.6673 77 | X6.4311Y-3.9724 78 | X6.4311Y-4.2579 79 | X6.4606Y-4.2008 80 | X6.4606Y-4.2343 81 | X6.4882Y-3.7874 82 | X6.4902Y-3.7323 83 | X6.501Y-4.2913 84 | X6.5059Y-3.9311 85 | X6.5197Y-3.8583 86 | X6.5276Y-3.8091 87 | X6.5335Y-3.9508 88 | X6.5472Y-3.6457 89 | X6.5551Y-3.7205 90 | X6.5748Y-3.9508 91 | X6.5748Y-4.189 92 | X6.5754Y-3.637 93 | X6.5984Y-4.126 94 | X6.6752Y-4.0945 95 | X6.6811Y-3.3543 96 | X6.6811Y-3.4409 97 | X6.7126Y-3.815 98 | X6.7254Y-3.6447 99 | X6.7421Y-3.8071 100 | X6.7421Y-4.1398 101 | X6.7776Y-3.8858 102 | X6.7933Y-4.0965 103 | X6.7953Y-3.502 104 | X6.7972Y-3.9626 105 | X6.8143Y-3.6692 106 | X6.8297Y-4.0984 107 | X6.8337Y-4.2274 108 | X6.8583Y-3.6476 109 | X6.8622Y-4.2008 110 | X6.8701Y-3.4626 111 | X6.9035Y-3.3445 112 | X6.9075Y-4.1388 113 | X6.9547Y-3.6654 114 | X7.0039Y-4.0246 115 | X7.0276Y-3.8209 116 | X7.0315Y-3.7205 117 | X7.0325Y-3.7805 118 | X7.0364Y-3.875 119 | X7.0433Y-3.9843 120 | X7.1024Y-4.0118 121 | X7.1043Y-3.815 122 | X7.1644Y-3.7756 123 | X7.1644Y-3.8543 124 | X7.2254Y-3.812 125 | X7.2264Y-4.2234 126 | X7.2402Y-4.4449 127 | X7.2441Y-3.1083 128 | X7.25Y-4.0463 129 | X7.2579Y-4.1949 130 | X7.2717Y-4.3071 131 | X7.3012Y-3.7264 132 | X7.3209Y-3.628 133 | X7.3366Y-3.7244 134 | X7.3484Y-3.7923 135 | X7.3602Y-3.4961 136 | X7.3976Y-3.9685 137 | X7.3976Y-4.0512 138 | X7.3976Y-4.1339 139 | X7.4409Y-3.2362 140 | X7.4724Y-3.9685 141 | X7.4724Y-4.0512 142 | X7.4724Y-4.1339 143 | X7.4961Y-3.8701 144 | X7.5472Y-3.9685 145 | X7.5472Y-4.0512 146 | X7.5472Y-4.1339 147 | X7.748Y-4.1252 148 | X7.7531Y-3.8902 149 | X7.7543Y-3.6689 150 | X7.8091Y-4.3611 151 | X7.8199Y-3.3976 152 | X7.8199Y-3.4488 153 | X7.8219Y-3.2018 154 | X7.8238Y-3.2303 155 | X7.8258Y-4.5059 156 | X7.8514Y-4.0059 157 | X7.8533Y-3.7776 158 | X7.8553Y-3.564 159 | X7.8553Y-4.2292 160 | X7.8909Y-4.1456 161 | X7.8911Y-4.4936 162 | X7.8956Y-3.8535 163 | X7.9006Y-4.0866 164 | X7.9011Y-3.6351 165 | X7.9016Y-3.9154 166 | X7.9055Y-3.6949 167 | X7.9075Y-4.305 168 | X7.9075Y-4.365 169 | X7.9168Y-4.5118 170 | X7.938Y-3.4134 171 | X7.9469Y-3.2077 172 | X7.9498Y-3.1772 173 | X7.9528Y-3.6516 174 | X7.9528Y-3.8642 175 | X7.9528Y-4.0886 176 | X7.9557Y-3.437 177 | X7.9567Y-4.3139 178 | X7.9803Y-3.8543 179 | X7.9803Y-4.0472 180 | X7.9813Y-4.0787 181 | X7.9827Y-3.8094 182 | X7.9833Y-4.2961 183 | X7.9835Y-3.5917 184 | X7.9852Y-3.625 185 | X7.9862Y-4.2607 186 | X8.0602Y-3.3524 187 | X8.062Y-3.1329 188 | T3 189 | X8.0709Y-3.3189 190 | X8.0709Y-3.4764 191 | X8.0728Y-3.5728 192 | X8.0728Y-3.6909 193 | X8.0728Y-4.0236 194 | X8.0728Y-4.1417 195 | X8.0728Y-4.243 196 | X8.0728Y-4.3611 197 | X8.0736Y-3.0984 198 | X8.0736Y-3.2559 199 | X8.0748Y-3.7933 200 | X8.0748Y-3.9114 201 | X8.0748Y-4.4272 202 | X8.0748Y-4.5846 203 | T4 204 | X7.2805Y-4.0778 205 | X7.2825Y-3.562 206 | X7.2825Y-4.1388 207 | X7.2844Y-3.501 208 | T5 209 | X7.4114Y-3.3622 210 | X7.5098Y-3.3622 211 | T5 212 | G00X5.935Y-3.7343 213 | M15 214 | G01X5.935Y-3.7461 215 | M16 216 | G05 217 | G00X5.935Y-3.8917 218 | M15 219 | G01X5.935Y-3.9035 220 | M16 221 | G05 222 | G00X5.9746Y-3.5332 223 | M15 224 | G01X5.9703Y-3.5222 225 | M16 226 | G05 227 | G00X5.9746Y-4.1046 228 | M15 229 | G01X5.9703Y-4.1156 230 | M16 231 | G05 232 | G00X6.0179Y-3.6431 233 | M15 234 | G01X6.0136Y-3.6321 235 | M16 236 | G05 237 | G00X6.0179Y-3.9947 238 | M15 239 | G01X6.0136Y-4.0057 240 | M16 241 | G05 242 | G00X6.0599Y-3.3766 243 | M15 244 | G01X6.0482Y-3.3745 245 | M16 246 | G05 247 | G00X6.0618Y-4.2612 248 | M15 249 | G01X6.0502Y-4.2632 250 | M16 251 | G05 252 | G00X6.1762Y-3.3971 253 | M15 254 | G01X6.1645Y-3.3951 255 | M16 256 | G05 257 | G00X6.1781Y-4.2407 258 | M15 259 | G01X6.1665Y-4.2427 260 | M16 261 | G05 262 | G00X6.7776Y-3.622 263 | M15 264 | G01X6.7657Y-3.622 265 | M16 266 | G05 267 | G00X6.7657Y-4.0157 268 | M15 269 | G01X6.7776Y-4.0157 270 | M16 271 | G05 272 | G00X6.935Y-3.622 273 | M15 274 | G01X6.9232Y-3.622 275 | M16 276 | G05 277 | G00X6.9232Y-4.0157 278 | M15 279 | G01X6.935Y-4.0157 280 | M16 281 | G05 282 | T0 283 | M30 284 | -------------------------------------------------------------------------------- /pcb_design/mushak_pcb-top-pos.csv: -------------------------------------------------------------------------------- 1 | Ref,Val,Package,PosX,PosY,Rot,Side 2 | "A3","SFH_3015_FA","XDCR_SFH_3015_FA",140.050000,27.100000,180.000000,top 3 | "A4","SFH_3015_FA","XDCR_SFH_3015_FA",140.050000,21.200000,180.000000,top 4 | "BZ1","Buzzer","XDCR_SMT-0440-T-R",132.700000,21.000000,90.000000,top 5 | "C1","2.2uF","C_0603_1608Metric",96.400000,30.900000,180.000000,top 6 | "C2","2.2uF","C_0603_1608Metric",108.500000,24.600000,-90.000000,top 7 | "C3","0.1uF","C_0402_1005Metric",127.900000,50.400000,90.000000,top 8 | "C4","0.1uF","C_0402_1005Metric",127.700000,16.300000,90.000000,top 9 | "C5","0.1uF","C_0402_1005Metric",131.300000,38.200000,0.000000,top 10 | "C6","1uF","C_0603_1608Metric",143.350000,34.500000,0.000000,top 11 | "C7","0.1uF","C_0402_1005Metric",97.400000,36.300000,90.000000,top 12 | "C8","10uF","C_0603_1608Metric",131.100000,36.850000,0.000000,top 13 | "C9","0.1uF","C_0402_1005Metric",97.400000,29.000000,-90.000000,top 14 | "C10","0.1uF","C_0402_1005Metric",110.100000,26.700000,-90.000000,top 15 | "C11","20pF","C_0402_1005Metric",105.300000,44.700000,180.000000,top 16 | "C12","1uF","C_0603_1608Metric",111.300000,46.800000,-90.000000,top 17 | "C13","22uF","C_0603_1608Metric",134.250000,36.850000,0.000000,top 18 | "C14","0.1uF","C_0402_1005Metric",113.000000,37.000000,0.000000,top 19 | "C15","20pF","C_0402_1005Metric",102.400000,42.200000,90.000000,top 20 | "C16","0.1uF","C_0402_1005Metric",112.200000,38.200000,0.000000,top 21 | "C17","0.01uF","C_0402_1005Metric",99.675000,42.425000,180.000000,top 22 | "C18","10uF","C_0603_1608Metric",111.800000,39.700000,0.000000,top 23 | "C19","1uF","C_0603_1608Metric",99.500000,40.400000,-90.000000,top 24 | "C20","12pF","C_0402_1005Metric",111.690000,41.660000,0.000000,top 25 | "C21","12pF","C_0402_1005Metric",111.680000,44.150000,0.000000,top 26 | "C24","0.1uF","C_0402_1005Metric",134.300000,38.300000,0.000000,top 27 | "C26","0.01uF","C_0402_1005Metric",119.300000,30.300000,180.000000,top 28 | "C27","2.2uF","C_0603_1608Metric",128.200000,34.000000,-90.000000,top 29 | "C28","10uF","C_0603_1608Metric",126.500000,28.400000,180.000000,top 30 | "C31","0.01uF","C_0402_1005Metric",119.400000,32.100000,-90.000000,top 31 | "C32","0.1uF","C_0402_1005Metric",119.900000,33.900000,180.000000,top 32 | "C33","0.1uF","C_0402_1005Metric",116.500000,36.100000,180.000000,top 33 | "C34","1uF","C_0603_1608Metric",143.350000,39.900000,0.000000,top 34 | "D1","LED","LED_0402_1005Metric",129.900000,39.900000,180.000000,top 35 | "D2","SFH_4045N","LED_SFH_4045N",140.150000,38.200000,0.000000,top 36 | "D3","SFH_4045N","LED_SFH_4045N",140.150000,32.850000,0.000000,top 37 | "D6","LED","LED_0402_1005Metric",106.300000,25.100000,90.000000,top 38 | "FB1","120R","L_0805_2012Metric",97.600000,40.600000,90.000000,top 39 | "J1","Conn_01x04_Male","JST_SH_BM04B-SRSS-TB_1x04-1MP_P1.00mm_Vertical",105.200000,17.900000,180.000000,top 40 | "J2","Conn_01x02_Female","JST_EH_B2B-EH-A_1x02_P2.50mm_Vertical",130.750000,44.900000,0.000000,top 41 | "J3","BLE_Conn","JST_SH_BM04B-SRSS-TB_1x04-1MP_P1.00mm_Vertical",105.200000,48.800000,0.000000,top 42 | "J4","AS5600_Left","STAND_SLAVE_04",147.750000,44.000000,90.000000,top 43 | "J5","AS5600_Right","STAND_SLAVE_04",147.870000,49.600000,90.000000,top 44 | "J6","IR_1","IR_SLAVE_V_04",147.450000,38.050000,90.000000,top 45 | "J7","IR_1","IR_SLAVE_V_04",147.450000,32.650000,90.000000,top 46 | "J8","IR_2","IR_SLAVE_V_04",147.450000,27.100000,90.000000,top 47 | "J9","IR_1","IR_SLAVE_V_04",147.450000,21.200000,90.000000,top 48 | "J10","IR_1","IR_HOST_V_04",97.800000,22.300000,-80.000000,top 49 | "J11","AS5600_1","STAND_HOST_04",116.500000,38.300000,180.000000,top 50 | "J12","IR_2","IR_HOST_V_04",94.750000,27.300000,-21.500000,top 51 | "J13","AS5600_2","STAND_HOST_04",116.500000,28.300000,0.000000,top 52 | "J14","IR_3","IR_HOST_V_04",94.750000,39.300000,-158.500000,top 53 | "J15","ToF","STAND_HOST_04",93.250000,33.300000,-90.000000,top 54 | "J16","IR_4","IR_HOST_V_04",97.750000,44.300000,-100.000000,top 55 | "J17","ToF","STAND_SLAVE_04",147.850000,15.850000,90.000000,top 56 | "M1","motor","motor",112.975000,17.425000,-90.000000,top 57 | "Q1","DMN3065LW-7","SOT-323_SC-70",128.500000,21.800000,180.000000,top 58 | "Q2","DMN3065LW-7","SOT-323_SC-70",143.500000,37.600000,-90.000000,top 59 | "Q3","DMN3065LW-7","SOT-323_SC-70",143.500000,32.200000,-90.000000,top 60 | "R1","10","R_0603_1608Metric",128.600000,19.000000,0.000000,top 61 | "R2","4.7k","R_0402_1005Metric",130.200000,48.100000,180.000000,top 62 | "R3","4.7k","R_0402_1005Metric",132.800000,48.100000,0.000000,top 63 | "R4","220","R_0603_1608Metric",132.800000,40.650000,90.000000,top 64 | "R7","100","R_0603_1608Metric",139.600000,39.900000,0.000000,top 65 | "R12","100","R_0603_1608Metric",139.600000,34.550000,0.000000,top 66 | "R13","10k","R_0402_1005Metric",140.000000,28.800000,0.000000,top 67 | "R16","10k","R_0402_1005Metric",113.600000,31.100000,-90.000000,top 68 | "R17","10k","R_0402_1005Metric",112.500000,31.100000,-90.000000,top 69 | "R18","10k","R_0402_1005Metric",119.900000,35.000000,0.000000,top 70 | "R19","10k","R_0402_1005Metric",112.000000,28.300000,0.000000,top 71 | "R20","10k","R_0402_1005Metric",120.600000,32.100000,-90.000000,top 72 | "R21","220","R_0603_1608Metric",104.800000,24.550000,-90.000000,top 73 | "R22","10k","R_0402_1005Metric",139.950000,22.950000,0.000000,top 74 | "R25","4.7k","R_0402_1005Metric",128.000000,36.900000,90.000000,top 75 | "R26","10k","R_0402_1005Metric",113.100000,35.050000,180.000000,top 76 | "R31","150","R_0402_1005Metric",128.000000,23.750000,180.000000,top 77 | "SW1","SW_Push","SW_TL1015AF160QG",131.800000,50.500000,0.000000,top 78 | "SW2","SW_Push","SW_TL1015AF160QG",131.800000,16.200000,0.000000,top 79 | "U1","AMS1117-3.3","SOT229P700X180-4N",132.750000,31.587500,-90.000000,top 80 | "U2","AS5048B-HTSP","SOP65P640X120-14N",142.925000,44.000000,180.000000,top 81 | "U3","DRV8833PWPR","IC_DRV8833PWPR",124.400000,33.300000,-90.000000,top 82 | "U4","VL53L0CXV0DH/1","XDCR_VL53L0CXV0DH_1",142.650000,15.850000,90.000000,top 83 | "U5","MPU-6500","QFN40P300X300X95-25N",116.500000,33.300000,90.000000,top 84 | "U6","STM32F405RGTx","LQFP-64_10x10mm_P0.5mm",105.050000,33.300000,-90.000000,top 85 | "U7","AS5048B-HTSP","SOP65P640X120-14N",142.925000,49.600000,180.000000,top 86 | "Y1","25Mhz","Crystal_SMD_3225-4Pin_3.2x2.5mm",105.300000,42.300000,180.000000,top 87 | "Y2","32.769kHz","XTAL_ABS07-32.768KHZ-T",109.200000,42.900000,90.000000,top 88 | -------------------------------------------------------------------------------- /firmware/Middlewares/Third_Party/FreeRTOS/Source/include/projdefs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V10.3.1 3 | * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | * this software and associated documentation files (the "Software"), to deal in 7 | * the Software without restriction, including without limitation the rights to 8 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | * the Software, and to permit persons to whom the Software is furnished to do so, 10 | * subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | * 22 | * http://www.FreeRTOS.org 23 | * http://aws.amazon.com/freertos 24 | * 25 | * 1 tab == 4 spaces! 26 | */ 27 | 28 | #ifndef PROJDEFS_H 29 | #define PROJDEFS_H 30 | 31 | /* 32 | * Defines the prototype to which task functions must conform. Defined in this 33 | * file to ensure the type is known before portable.h is included. 34 | */ 35 | typedef void (*TaskFunction_t)( void * ); 36 | 37 | /* Converts a time in milliseconds to a time in ticks. This macro can be 38 | overridden by a macro of the same name defined in FreeRTOSConfig.h in case the 39 | definition here is not suitable for your application. */ 40 | #ifndef pdMS_TO_TICKS 41 | #define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000 ) ) 42 | #endif 43 | 44 | #define pdFALSE ( ( BaseType_t ) 0 ) 45 | #define pdTRUE ( ( BaseType_t ) 1 ) 46 | 47 | #define pdPASS ( pdTRUE ) 48 | #define pdFAIL ( pdFALSE ) 49 | #define errQUEUE_EMPTY ( ( BaseType_t ) 0 ) 50 | #define errQUEUE_FULL ( ( BaseType_t ) 0 ) 51 | 52 | /* FreeRTOS error definitions. */ 53 | #define errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY ( -1 ) 54 | #define errQUEUE_BLOCKED ( -4 ) 55 | #define errQUEUE_YIELD ( -5 ) 56 | 57 | /* Macros used for basic data corruption checks. */ 58 | #ifndef configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES 59 | #define configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES 0 60 | #endif 61 | 62 | #if( configUSE_16_BIT_TICKS == 1 ) 63 | #define pdINTEGRITY_CHECK_VALUE 0x5a5a 64 | #else 65 | #define pdINTEGRITY_CHECK_VALUE 0x5a5a5a5aUL 66 | #endif 67 | 68 | /* The following errno values are used by FreeRTOS+ components, not FreeRTOS 69 | itself. */ 70 | #define pdFREERTOS_ERRNO_NONE 0 /* No errors */ 71 | #define pdFREERTOS_ERRNO_ENOENT 2 /* No such file or directory */ 72 | #define pdFREERTOS_ERRNO_EINTR 4 /* Interrupted system call */ 73 | #define pdFREERTOS_ERRNO_EIO 5 /* I/O error */ 74 | #define pdFREERTOS_ERRNO_ENXIO 6 /* No such device or address */ 75 | #define pdFREERTOS_ERRNO_EBADF 9 /* Bad file number */ 76 | #define pdFREERTOS_ERRNO_EAGAIN 11 /* No more processes */ 77 | #define pdFREERTOS_ERRNO_EWOULDBLOCK 11 /* Operation would block */ 78 | #define pdFREERTOS_ERRNO_ENOMEM 12 /* Not enough memory */ 79 | #define pdFREERTOS_ERRNO_EACCES 13 /* Permission denied */ 80 | #define pdFREERTOS_ERRNO_EFAULT 14 /* Bad address */ 81 | #define pdFREERTOS_ERRNO_EBUSY 16 /* Mount device busy */ 82 | #define pdFREERTOS_ERRNO_EEXIST 17 /* File exists */ 83 | #define pdFREERTOS_ERRNO_EXDEV 18 /* Cross-device link */ 84 | #define pdFREERTOS_ERRNO_ENODEV 19 /* No such device */ 85 | #define pdFREERTOS_ERRNO_ENOTDIR 20 /* Not a directory */ 86 | #define pdFREERTOS_ERRNO_EISDIR 21 /* Is a directory */ 87 | #define pdFREERTOS_ERRNO_EINVAL 22 /* Invalid argument */ 88 | #define pdFREERTOS_ERRNO_ENOSPC 28 /* No space left on device */ 89 | #define pdFREERTOS_ERRNO_ESPIPE 29 /* Illegal seek */ 90 | #define pdFREERTOS_ERRNO_EROFS 30 /* Read only file system */ 91 | #define pdFREERTOS_ERRNO_EUNATCH 42 /* Protocol driver not attached */ 92 | #define pdFREERTOS_ERRNO_EBADE 50 /* Invalid exchange */ 93 | #define pdFREERTOS_ERRNO_EFTYPE 79 /* Inappropriate file type or format */ 94 | #define pdFREERTOS_ERRNO_ENMFILE 89 /* No more files */ 95 | #define pdFREERTOS_ERRNO_ENOTEMPTY 90 /* Directory not empty */ 96 | #define pdFREERTOS_ERRNO_ENAMETOOLONG 91 /* File or path name too long */ 97 | #define pdFREERTOS_ERRNO_EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ 98 | #define pdFREERTOS_ERRNO_ENOBUFS 105 /* No buffer space available */ 99 | #define pdFREERTOS_ERRNO_ENOPROTOOPT 109 /* Protocol not available */ 100 | #define pdFREERTOS_ERRNO_EADDRINUSE 112 /* Address already in use */ 101 | #define pdFREERTOS_ERRNO_ETIMEDOUT 116 /* Connection timed out */ 102 | #define pdFREERTOS_ERRNO_EINPROGRESS 119 /* Connection already in progress */ 103 | #define pdFREERTOS_ERRNO_EALREADY 120 /* Socket already connected */ 104 | #define pdFREERTOS_ERRNO_EADDRNOTAVAIL 125 /* Address not available */ 105 | #define pdFREERTOS_ERRNO_EISCONN 127 /* Socket is already connected */ 106 | #define pdFREERTOS_ERRNO_ENOTCONN 128 /* Socket is not connected */ 107 | #define pdFREERTOS_ERRNO_ENOMEDIUM 135 /* No medium inserted */ 108 | #define pdFREERTOS_ERRNO_EILSEQ 138 /* An invalid UTF-16 sequence was encountered. */ 109 | #define pdFREERTOS_ERRNO_ECANCELED 140 /* Operation canceled. */ 110 | 111 | /* The following endian values are used by FreeRTOS+ components, not FreeRTOS 112 | itself. */ 113 | #define pdFREERTOS_LITTLE_ENDIAN 0 114 | #define pdFREERTOS_BIG_ENDIAN 1 115 | 116 | /* Re-defining endian values for generic naming. */ 117 | #define pdLITTLE_ENDIAN pdFREERTOS_LITTLE_ENDIAN 118 | #define pdBIG_ENDIAN pdFREERTOS_BIG_ENDIAN 119 | 120 | 121 | #endif /* PROJDEFS_H */ 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /firmware/Core/Src/stm32f4xx_it.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32f4xx_it.c 5 | * @brief Interrupt Service Routines. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | * Copyright (c) 2023 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 "stm32f4xx_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 DMA_HandleTypeDef hdma_adc1; 59 | extern TIM_HandleTypeDef htim10; 60 | extern TIM_HandleTypeDef htim1; 61 | 62 | /* USER CODE BEGIN EV */ 63 | 64 | /* USER CODE END EV */ 65 | 66 | /******************************************************************************/ 67 | /* Cortex-M4 Processor Interruption and Exception Handlers */ 68 | /******************************************************************************/ 69 | /** 70 | * @brief This function handles Non maskable interrupt. 71 | */ 72 | void NMI_Handler(void) 73 | { 74 | /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ 75 | 76 | /* USER CODE END NonMaskableInt_IRQn 0 */ 77 | /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ 78 | while (1) 79 | { 80 | } 81 | /* USER CODE END NonMaskableInt_IRQn 1 */ 82 | } 83 | 84 | /** 85 | * @brief This function handles Hard fault interrupt. 86 | */ 87 | void HardFault_Handler(void) 88 | { 89 | /* USER CODE BEGIN HardFault_IRQn 0 */ 90 | 91 | /* USER CODE END HardFault_IRQn 0 */ 92 | while (1) 93 | { 94 | /* USER CODE BEGIN W1_HardFault_IRQn 0 */ 95 | /* USER CODE END W1_HardFault_IRQn 0 */ 96 | } 97 | } 98 | 99 | /** 100 | * @brief This function handles Memory management fault. 101 | */ 102 | void MemManage_Handler(void) 103 | { 104 | /* USER CODE BEGIN MemoryManagement_IRQn 0 */ 105 | 106 | /* USER CODE END MemoryManagement_IRQn 0 */ 107 | while (1) 108 | { 109 | /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ 110 | /* USER CODE END W1_MemoryManagement_IRQn 0 */ 111 | } 112 | } 113 | 114 | /** 115 | * @brief This function handles Pre-fetch fault, memory access fault. 116 | */ 117 | void BusFault_Handler(void) 118 | { 119 | /* USER CODE BEGIN BusFault_IRQn 0 */ 120 | 121 | /* USER CODE END BusFault_IRQn 0 */ 122 | while (1) 123 | { 124 | /* USER CODE BEGIN W1_BusFault_IRQn 0 */ 125 | /* USER CODE END W1_BusFault_IRQn 0 */ 126 | } 127 | } 128 | 129 | /** 130 | * @brief This function handles Undefined instruction or illegal state. 131 | */ 132 | void UsageFault_Handler(void) 133 | { 134 | /* USER CODE BEGIN UsageFault_IRQn 0 */ 135 | 136 | /* USER CODE END UsageFault_IRQn 0 */ 137 | while (1) 138 | { 139 | /* USER CODE BEGIN W1_UsageFault_IRQn 0 */ 140 | /* USER CODE END W1_UsageFault_IRQn 0 */ 141 | } 142 | } 143 | 144 | /** 145 | * @brief This function handles Debug monitor. 146 | */ 147 | void DebugMon_Handler(void) 148 | { 149 | /* USER CODE BEGIN DebugMonitor_IRQn 0 */ 150 | 151 | /* USER CODE END DebugMonitor_IRQn 0 */ 152 | /* USER CODE BEGIN DebugMonitor_IRQn 1 */ 153 | 154 | /* USER CODE END DebugMonitor_IRQn 1 */ 155 | } 156 | 157 | /******************************************************************************/ 158 | /* STM32F4xx Peripheral Interrupt Handlers */ 159 | /* Add here the Interrupt Handlers for the used peripherals. */ 160 | /* For the available peripheral interrupt handler names, */ 161 | /* please refer to the startup file (startup_stm32f4xx.s). */ 162 | /******************************************************************************/ 163 | 164 | /** 165 | * @brief This function handles TIM1 update interrupt and TIM10 global interrupt. 166 | */ 167 | void TIM1_UP_TIM10_IRQHandler(void) 168 | { 169 | /* USER CODE BEGIN TIM1_UP_TIM10_IRQn 0 */ 170 | 171 | /* USER CODE END TIM1_UP_TIM10_IRQn 0 */ 172 | HAL_TIM_IRQHandler(&htim1); 173 | HAL_TIM_IRQHandler(&htim10); 174 | /* USER CODE BEGIN TIM1_UP_TIM10_IRQn 1 */ 175 | 176 | /* USER CODE END TIM1_UP_TIM10_IRQn 1 */ 177 | } 178 | 179 | /** 180 | * @brief This function handles DMA2 stream0 global interrupt. 181 | */ 182 | void DMA2_Stream0_IRQHandler(void) 183 | { 184 | /* USER CODE BEGIN DMA2_Stream0_IRQn 0 */ 185 | 186 | /* USER CODE END DMA2_Stream0_IRQn 0 */ 187 | HAL_DMA_IRQHandler(&hdma_adc1); 188 | /* USER CODE BEGIN DMA2_Stream0_IRQn 1 */ 189 | 190 | /* USER CODE END DMA2_Stream0_IRQn 1 */ 191 | } 192 | 193 | /* USER CODE BEGIN 1 */ 194 | 195 | /* USER CODE END 1 */ 196 | --------------------------------------------------------------------------------