├── .gitignore ├── .travis.yml ├── CONTRIBUTING.md ├── LICENSE ├── Marlin ├── include │ └── README ├── src │ ├── HAL │ │ ├── hal_RGB.cpp │ │ ├── hal_RGB.h │ │ ├── hal_adc.cpp │ │ ├── hal_adc.h │ │ ├── hal_can.cpp │ │ ├── hal_can.h │ │ ├── hal_exti.cpp │ │ ├── hal_exti.h │ │ ├── hal_flash.cpp │ │ ├── hal_flash.h │ │ ├── hal_gpio.cpp │ │ ├── hal_gpio.h │ │ ├── hal_pwm.cpp │ │ ├── hal_pwm.h │ │ ├── hal_reset.cpp │ │ ├── hal_reset.h │ │ ├── hal_tim.cpp │ │ ├── hal_tim.h │ │ ├── hal_tim_ic.cpp │ │ ├── hal_tim_ic.h │ │ └── std_library │ │ │ ├── inc │ │ │ ├── CMSIS │ │ │ │ ├── arm_common_tables.h │ │ │ │ ├── arm_const_structs.h │ │ │ │ ├── arm_math.h │ │ │ │ ├── cmsis_armcc.h │ │ │ │ ├── cmsis_armcc_V6.h │ │ │ │ ├── cmsis_gcc.h │ │ │ │ ├── core_cm0.h │ │ │ │ ├── core_cm0plus.h │ │ │ │ ├── core_cm3.h │ │ │ │ ├── core_cm4.h │ │ │ │ ├── core_cm7.h │ │ │ │ ├── core_cmFunc.h │ │ │ │ ├── core_cmInstr.h │ │ │ │ ├── core_cmSimd.h │ │ │ │ ├── core_sc000.h │ │ │ │ └── core_sc300.h │ │ │ ├── core_cm3.h │ │ │ ├── misc.h │ │ │ ├── stm32f10x.h │ │ │ ├── stm32f10x_adc.h │ │ │ ├── stm32f10x_bkp.h │ │ │ ├── stm32f10x_can.h │ │ │ ├── stm32f10x_cec.h │ │ │ ├── stm32f10x_conf.h │ │ │ ├── stm32f10x_crc.h │ │ │ ├── stm32f10x_dac.h │ │ │ ├── stm32f10x_dbgmcu.h │ │ │ ├── stm32f10x_dma.h │ │ │ ├── stm32f10x_exti.h │ │ │ ├── stm32f10x_flash.h │ │ │ ├── stm32f10x_fsmc.h │ │ │ ├── stm32f10x_gpio.h │ │ │ ├── stm32f10x_i2c.h │ │ │ ├── stm32f10x_iwdg.h │ │ │ ├── stm32f10x_pwr.h │ │ │ ├── stm32f10x_rcc.h │ │ │ ├── stm32f10x_rtc.h │ │ │ ├── stm32f10x_sdio.h │ │ │ ├── stm32f10x_spi.h │ │ │ ├── stm32f10x_tim.h │ │ │ ├── stm32f10x_usart.h │ │ │ ├── stm32f10x_wwdg.h │ │ │ └── system_stm32f10x.h │ │ │ └── src │ │ │ ├── misc.cpp │ │ │ ├── stm32f10x_adc.c │ │ │ ├── stm32f10x_can.cpp │ │ │ ├── stm32f10x_dac.c │ │ │ ├── stm32f10x_dma.c │ │ │ ├── stm32f10x_exti.c │ │ │ ├── stm32f10x_gpio.cpp │ │ │ ├── stm32f10x_iwdg.c │ │ │ ├── stm32f10x_rcc.cpp │ │ │ ├── stm32f10x_spi.c │ │ │ ├── stm32f10x_tim.cpp │ │ │ └── system_stm32f10x.c │ ├── bootstrap │ │ ├── engine.cpp │ │ ├── engine.h │ │ ├── startup.cpp │ │ └── startup.h │ ├── configuration.h │ ├── core │ │ ├── can_bus.cpp │ │ ├── can_bus.h │ │ ├── common_type.h │ │ ├── millis_t.h │ │ ├── minmax.h │ │ ├── moving_average_filter.h │ │ ├── pid.cpp │ │ ├── pid.h │ │ ├── protocal │ │ │ ├── Longpack.cpp │ │ │ └── Longpack.h │ │ ├── thermistor_table.cpp │ │ ├── thermistor_table.h │ │ ├── utils.cpp │ │ └── utils.h │ ├── device │ │ ├── analog_io_ctrl.cpp │ │ ├── analog_io_ctrl.h │ │ ├── bldc_motor.cpp │ │ ├── bldc_motor.h │ │ ├── breathing light.cpp │ │ ├── breathing light.h │ │ ├── device_base.h │ │ ├── fan.cpp │ │ ├── fan.h │ │ ├── fan_fb.cpp │ │ ├── fan_fb.h │ │ ├── hw_version.cpp │ │ ├── hw_version.h │ │ ├── icm4xxxx │ │ │ ├── icm42670 │ │ │ │ ├── InvError.h │ │ │ │ ├── InvExport.h │ │ │ │ ├── inv_imu_apex.cpp │ │ │ │ ├── inv_imu_apex.h │ │ │ │ ├── inv_imu_defs.h │ │ │ │ ├── inv_imu_driver.cpp │ │ │ │ ├── inv_imu_driver.h │ │ │ │ ├── inv_imu_extfunc.h │ │ │ │ ├── inv_imu_regmap.h │ │ │ │ ├── inv_imu_selftest.cpp │ │ │ │ ├── inv_imu_selftest.h │ │ │ │ ├── inv_imu_transport.cpp │ │ │ │ ├── inv_imu_transport.h │ │ │ │ ├── inv_imu_version.h │ │ │ │ ├── system_interface.cpp │ │ │ │ └── system_interface.h │ │ │ ├── icm4xxxx_delay.cpp │ │ │ ├── icm4xxxx_delay.h │ │ │ ├── icm4xxxx_driver.cpp │ │ │ └── icm4xxxx_driver.h │ │ ├── module_index.cpp │ │ ├── module_index.h │ │ ├── nozzle_identify.cpp │ │ ├── nozzle_identify.h │ │ ├── rgb_light.cpp │ │ ├── rgb_light.h │ │ ├── soft_i2c.cpp │ │ ├── soft_i2c.h │ │ ├── soft_pwm.cpp │ │ ├── soft_pwm.h │ │ ├── speed.cpp │ │ ├── speed.h │ │ ├── switch.cpp │ │ ├── switch.h │ │ ├── temperature.cpp │ │ └── temperature.h │ ├── entry.cpp │ ├── flag_script.py │ ├── module │ │ ├── calibrator.cpp │ │ ├── calibrator.h │ │ ├── cnc_head.cpp │ │ ├── cnc_head.h │ │ ├── cnc_head_200w.cpp │ │ ├── cnc_head_200w.h │ │ ├── cnc_tool_setting.cpp │ │ ├── cnc_tool_setting.h │ │ ├── drybox.cpp │ │ ├── drybox.h │ │ ├── dual_extruder.cpp │ │ ├── dual_extruder.h │ │ ├── enclosure.cpp │ │ ├── enclosure.h │ │ ├── enclosure_a400.cpp │ │ ├── enclosure_a400.h │ │ ├── fan_module.cpp │ │ ├── fan_module.h │ │ ├── laser_head.cpp │ │ ├── laser_head.h │ │ ├── laser_head_10w.cpp │ │ ├── laser_head_10w.h │ │ ├── laser_head_20W_40W.cpp │ │ ├── laser_head_20W_40W.h │ │ ├── laser_hw_version.h │ │ ├── light_module.cpp │ │ ├── light_module.h │ │ ├── linear_module.cpp │ │ ├── linear_module.h │ │ ├── module_base.h │ │ ├── print_head.cpp │ │ ├── print_head.h │ │ ├── purifier_module.cpp │ │ ├── purifier_module.h │ │ ├── rotate_module.cpp │ │ ├── rotate_module.h │ │ ├── stop_module.cpp │ │ └── stop_module.h │ ├── registry │ │ ├── context.cpp │ │ ├── context.h │ │ ├── registry.cpp │ │ ├── registry.h │ │ ├── route.cpp │ │ └── route.h │ └── utils │ │ ├── RingBuffer.cpp │ │ ├── RingBuffer.h │ │ ├── str.cpp │ │ └── str.h └── test │ └── README ├── README.md ├── buildroot └── share │ └── PlatformIO │ └── boards │ ├── snapmaker1_v1.json │ └── snapmaker_module_app.json ├── platformio.ini └── snapmaker ├── docs ├── LICENSE.tmpl └── figures │ └── fig-vscode-bar-platformio.png ├── lib └── STM32F1 │ ├── boards.txt │ ├── cores │ └── maple │ │ ├── Arduino.h │ │ ├── Client.h │ │ ├── HardwareSerial.cpp │ │ ├── HardwareSerial.h │ │ ├── HardwareTimer.cpp │ │ ├── HardwareTimer.h │ │ ├── IPAddress.cpp │ │ ├── IPAddress.h │ │ ├── Print.cpp │ │ ├── Print.h │ │ ├── Printable.h │ │ ├── Server.h │ │ ├── Stream.cpp │ │ ├── Stream.h │ │ ├── Udp.h │ │ ├── WCharacter.h │ │ ├── WProgram.h │ │ ├── WString.cpp │ │ ├── WString.h │ │ ├── avr │ │ ├── dtostrf.c │ │ ├── dtostrf.h │ │ ├── interrupt.h │ │ └── pgmspace.h │ │ ├── bit_constants.h │ │ ├── bits.h │ │ ├── boards.h │ │ ├── boards_private.h │ │ ├── cxxabi-compat.cpp │ │ ├── ext_interrupts.cpp │ │ ├── ext_interrupts.h │ │ ├── hooks.c │ │ ├── io.h │ │ ├── itoa.c │ │ ├── itoa.h │ │ ├── libmaple │ │ ├── adc.c │ │ ├── adc_f1.c │ │ ├── bkp_f1.c │ │ ├── dac.c │ │ ├── dma.c │ │ ├── dma_f1.c │ │ ├── exc.S │ │ ├── exti.c │ │ ├── exti_f1.c │ │ ├── flash.c │ │ ├── fsmc_f1.c │ │ ├── gpio.c │ │ ├── gpio_f1.c │ │ ├── i2c.c │ │ ├── i2c_f1.c │ │ ├── iwdg.c │ │ ├── nvic.c │ │ ├── pwr.c │ │ ├── rcc.c │ │ ├── rcc_f1.c │ │ ├── spi.c │ │ ├── spi_f1.c │ │ ├── stm32f1 │ │ │ └── performance │ │ │ │ ├── isrs.S │ │ │ │ └── vector_table.S │ │ ├── systick.c │ │ ├── timer.c │ │ ├── timer_f1.c │ │ ├── usart.c │ │ ├── usart_f1.c │ │ ├── usart_private.c │ │ ├── usb │ │ │ ├── README │ │ │ ├── rules.mk │ │ │ ├── stm32f1 │ │ │ │ ├── usb.c │ │ │ │ ├── usb_cdcacm.c │ │ │ │ └── usb_reg_map.c │ │ │ └── usb_lib │ │ │ │ ├── usb_core.c │ │ │ │ ├── usb_init.c │ │ │ │ ├── usb_mem.c │ │ │ │ └── usb_regs.c │ │ └── util.c │ │ ├── main.cpp │ │ ├── new.cpp │ │ ├── pwm.cpp │ │ ├── pwm.h │ │ ├── rules.mk │ │ ├── sdio.cpp │ │ ├── stm32f1 │ │ ├── util_hooks.c │ │ ├── wiring_pulse_f1.cpp │ │ ├── wirish_debug.cpp │ │ └── wirish_digital_f1.cpp │ │ ├── tone.cpp │ │ ├── tone.h │ │ ├── usb_serial.cpp │ │ ├── usb_serial.h │ │ ├── wiring_private.h │ │ ├── wiring_pulse.h │ │ ├── wirish.h │ │ ├── wirish_analog.cpp │ │ ├── wirish_constants.h │ │ ├── wirish_debug.h │ │ ├── wirish_digital.cpp │ │ ├── wirish_math.cpp │ │ ├── wirish_math.h │ │ ├── wirish_shift.cpp │ │ ├── wirish_time.cpp │ │ ├── wirish_time.h │ │ └── wirish_types.h │ ├── libraries │ ├── A_STM32_Examples │ │ ├── A_STM32_Examples.h │ │ ├── examples │ │ │ ├── Analog │ │ │ │ ├── AnalogInOutSerial │ │ │ │ │ └── AnalogInOutSerial.ino │ │ │ │ ├── AnalogInSerial │ │ │ │ │ └── AnalogInSerial.ino │ │ │ │ ├── AnalogInput │ │ │ │ │ └── AnalogInput.ino │ │ │ │ ├── Calibration │ │ │ │ │ └── Calibration.ino │ │ │ │ ├── Fading │ │ │ │ │ └── Fading.ino │ │ │ │ └── Smoothing │ │ │ │ │ └── Smoothing.ino │ │ │ ├── Communication │ │ │ │ ├── ASCIITable │ │ │ │ │ └── ASCIITable.ino │ │ │ │ ├── Dimmer │ │ │ │ │ └── Dimmer.ino │ │ │ │ ├── Graph │ │ │ │ │ └── Graph.ino │ │ │ │ ├── MIDI │ │ │ │ │ └── Midi.ino │ │ │ │ ├── PhysicalPixel │ │ │ │ │ └── PhysicalPixel.ino │ │ │ │ ├── SerialCallResponse │ │ │ │ │ └── SerialCallResponse.ino │ │ │ │ ├── SerialCallResponseASCII │ │ │ │ │ └── SerialCallResponseASCII.ino │ │ │ │ ├── SerialPassthrough │ │ │ │ │ └── SerialPassthrough.ino │ │ │ │ └── VirtualColorMixer │ │ │ │ │ └── VirtualColorMixer.ino │ │ │ ├── Control │ │ │ │ ├── Arrays │ │ │ │ │ └── Arrays.ino │ │ │ │ ├── ForLoopIteration │ │ │ │ │ └── ForLoopIteration.ino │ │ │ │ ├── IfStatementConditional │ │ │ │ │ └── IfStatementConditional.ino │ │ │ │ ├── WhileStatementConditional │ │ │ │ │ └── WhileStatementConditional.ino │ │ │ │ ├── switchCase │ │ │ │ │ └── switchCase.ino │ │ │ │ └── switchCase2 │ │ │ │ │ └── switchCase2.ino │ │ │ ├── Digital │ │ │ │ ├── Blink │ │ │ │ │ └── Blink.ino │ │ │ │ ├── BlinkWithoutDelay │ │ │ │ │ └── BlinkWithoutDelay.ino │ │ │ │ ├── Button │ │ │ │ │ └── Button.ino │ │ │ │ ├── Debounce │ │ │ │ │ └── Debounce.ino │ │ │ │ ├── MapleMorse │ │ │ │ │ └── MapleMorse.ino │ │ │ │ └── StateChangeDetection │ │ │ │ │ └── StateChangeDetection.ino │ │ │ ├── Display │ │ │ │ ├── RowColumnScanning │ │ │ │ │ └── RowColumnScanning.ino │ │ │ │ └── barGraph │ │ │ │ │ └── barGraph.ino │ │ │ ├── General │ │ │ │ ├── Blink │ │ │ │ │ └── Blink.ino │ │ │ │ ├── BlinkNcount │ │ │ │ │ └── BlinkNcount.ino │ │ │ │ ├── FadingOnboard │ │ │ │ │ └── FadingOnboard.ino │ │ │ │ ├── IntegerInput │ │ │ │ │ └── IntegerInput.ino │ │ │ │ ├── IntegerInput_FloatOutput │ │ │ │ │ └── IntegerInput_FloatOutput.ino │ │ │ │ ├── InternalTempSensor │ │ │ │ │ └── InternalTempSensor.ino │ │ │ │ ├── PrimeNos │ │ │ │ │ └── PrimeNos.ino │ │ │ │ ├── PrimeNos2 │ │ │ │ │ └── PrimeNos2.ino │ │ │ │ ├── PrimeNos3 │ │ │ │ │ └── PrimeNos3.ino │ │ │ │ ├── Print_Binary │ │ │ │ │ └── Print_Binary.ino │ │ │ │ ├── Print_Float │ │ │ │ │ └── Print_Float.ino │ │ │ │ ├── Print_HEX │ │ │ │ │ └── Print_HEX.ino │ │ │ │ ├── SerialReadUntil │ │ │ │ │ └── SerialReadUntil.ino │ │ │ │ ├── StringEx_Parsing │ │ │ │ │ └── StringEx_Parsing.ino │ │ │ │ ├── USB_ASCII │ │ │ │ │ └── USB_ASCII.ino │ │ │ │ └── strtol_DecEquivalents │ │ │ │ │ └── strtol_DecEquivalents.ino │ │ │ ├── Maple │ │ │ │ ├── CrudeVGA │ │ │ │ │ └── CrudeVGA.ino │ │ │ │ ├── InteractiveTest │ │ │ │ │ └── InteractiveTest.ino │ │ │ │ ├── QASlave │ │ │ │ │ └── QASlave.ino │ │ │ │ ├── StressSerialUSB │ │ │ │ │ └── StressSerialUSB.ino │ │ │ │ └── TimerInterrupts │ │ │ │ │ └── TimerInterrupts.ino │ │ │ ├── Sensors │ │ │ │ ├── HardTimerAsEncoder │ │ │ │ │ └── HardTimerAsEncoder.ino │ │ │ │ ├── HardwareTimerOnePulseMode │ │ │ │ │ └── HardwareTimerOnePulseMode.ino │ │ │ │ ├── HardwareTimerPWMInput │ │ │ │ │ └── HardwareTimerPWMInput.ino │ │ │ │ └── Knock │ │ │ │ │ └── Knock.ino │ │ │ └── Stubs │ │ │ │ ├── AnalogReadPWMWrite │ │ │ │ └── AnalogReadPWMWrite.ino │ │ │ │ ├── AnalogReadSerial │ │ │ │ └── AnalogReadSerial.ino │ │ │ │ ├── BareMinumum │ │ │ │ └── BareMinumum.ino │ │ │ │ ├── DigitalReadSerial │ │ │ │ └── DigitalReadSerial.ino │ │ │ │ ├── DigitalReadWrite │ │ │ │ └── DigitalReadWrite.ino │ │ │ │ └── HelloWorld │ │ │ │ └── HelloWorld.ino │ │ ├── keywords.txt │ │ └── library.properties │ ├── Adafruit_GFX_AS │ │ ├── Adafruit_GFX_AS.cpp │ │ ├── Adafruit_GFX_AS.h │ │ ├── Font16.c │ │ ├── Font16.h │ │ ├── Font32.c │ │ ├── Font32.h │ │ ├── Font64.c │ │ ├── Font64.h │ │ ├── Font7s.c │ │ ├── Font7s.h │ │ ├── Load_fonts.h │ │ ├── README.txt │ │ ├── glcdfont.c │ │ └── license.txt │ ├── Adafruit_ILI9341 │ │ ├── Adafruit_ILI9341.cpp │ │ ├── Adafruit_ILI9341.h │ │ ├── README.txt │ │ └── examples │ │ │ ├── breakouttouchpaint │ │ │ └── breakouttouchpaint.ino │ │ │ ├── graphicstest │ │ │ └── graphicstest.ino │ │ │ ├── onoffbutton │ │ │ └── onoffbutton.ino │ │ │ ├── onoffbutton_breakout │ │ │ └── onoffbutton_breakout.ino │ │ │ ├── spitftbitmap │ │ │ └── spitftbitmap.ino │ │ │ ├── stm32_graphicstest │ │ │ └── stm32_graphicstest.ino │ │ │ └── touchpaint │ │ │ └── touchpaint.ino │ ├── Adafruit_ILI9341_STM │ │ ├── Adafruit_ILI9341_STM.cpp │ │ ├── Adafruit_ILI9341_STM.h │ │ ├── License.h │ │ ├── README.txt │ │ └── examples │ │ │ ├── TFT_Clock_Digital_ILI9341 │ │ │ └── TFT_Clock_Digital_ILI9341.ino │ │ │ ├── TFT_Clock_ILI9341 │ │ │ └── TFT_Clock_ILI9341.ino │ │ │ ├── TFT_Rainbow_ILI9341 │ │ │ └── TFT_Rainbow_ILI9341.ino │ │ │ ├── TFT_Show_Font_ILI9341 │ │ │ └── TFT_Show_Font_ILI9341.ino │ │ │ ├── breakouttouchpaint │ │ │ └── breakouttouchpaint.ino │ │ │ ├── graphicstest │ │ │ └── graphicstest.ino │ │ │ ├── onoffbutton │ │ │ └── onoffbutton.ino │ │ │ ├── onoffbutton_breakout │ │ │ └── onoffbutton_breakout.ino │ │ │ ├── spitftbitmap │ │ │ └── spitftbitmap.ino │ │ │ ├── stm32_graphicstest │ │ │ └── stm32_graphicstest.ino │ │ │ └── touchpaint │ │ │ └── touchpaint.ino │ ├── Adafruit_SSD1306 │ │ ├── Adafruit_SSD1306_STM32.cpp │ │ ├── Adafruit_SSD1306_STM32.h │ │ ├── README.txt │ │ ├── STM32 README.txt │ │ ├── examples │ │ │ ├── ssd1306_128x32_i2c │ │ │ │ └── ssd1306_128x32_i2c.ino │ │ │ ├── ssd1306_128x32_spi │ │ │ │ └── ssd1306_128x32_spi.ino │ │ │ ├── ssd1306_128x64_i2c_STM32 │ │ │ │ └── ssd1306_128x64_i2c_STM32.ino │ │ │ └── ssd1306_128x64_spi │ │ │ │ └── ssd1306_128x64_spi.ino │ │ └── license.txt │ ├── EEPROM │ │ ├── EEPROM.cpp │ │ ├── EEPROM.h │ │ ├── examples │ │ │ └── EEPROM_example │ │ │ │ └── EEPROM_example.ino │ │ ├── flash_stm32.c │ │ ├── flash_stm32.h │ │ └── keywords.txt │ ├── Ethernet_STM │ │ ├── README.md │ │ ├── examples │ │ │ ├── AdvancedChatServer │ │ │ │ └── AdvancedChatServer.ino │ │ │ ├── BarometricPressureWebServer │ │ │ │ └── BarometricPressureWebServer.ino │ │ │ ├── ChatServer │ │ │ │ └── ChatServer.ino │ │ │ ├── DhcpAddressPrinter │ │ │ │ └── DhcpAddressPrinter.ino │ │ │ ├── DhcpChatServer │ │ │ │ └── DhcpChatServer.ino │ │ │ ├── TelnetClient │ │ │ │ └── TelnetClient.ino │ │ │ ├── Twitter_Serial_GW │ │ │ │ └── Twitter_Serial_GW.ino │ │ │ ├── Twitter_SimplePost │ │ │ │ └── Twitter_SimplePost.ino │ │ │ ├── UDPSendReceiveString │ │ │ │ └── UDPSendReceiveString.ino │ │ │ ├── UdpNtpClient │ │ │ │ └── UdpNtpClient.ino │ │ │ ├── WebClient │ │ │ │ └── WebClient.ino │ │ │ ├── WebClientRepeating │ │ │ │ └── WebClientRepeating.ino │ │ │ ├── WebServer │ │ │ │ └── WebServer.ino │ │ │ ├── XivelyClient │ │ │ │ └── XivelyClient.ino │ │ │ └── XivelyClientString │ │ │ │ └── XivelyClientString.ino │ │ ├── keywords.txt │ │ ├── library.properties │ │ ├── pictures │ │ │ ├── w5100_module1.jpg │ │ │ ├── w5100_module2.jpg │ │ │ └── w5100_shield.jpg │ │ └── src │ │ │ ├── Dhcp.cpp │ │ │ ├── Dhcp.h │ │ │ ├── Dns.cpp │ │ │ ├── Dns.h │ │ │ ├── EthernetClient.cpp │ │ │ ├── EthernetClient.h │ │ │ ├── EthernetServer.cpp │ │ │ ├── EthernetServer.h │ │ │ ├── EthernetUdp.cpp │ │ │ ├── EthernetUdp.h │ │ │ ├── Ethernet_STM.cpp │ │ │ ├── Ethernet_STM.h │ │ │ ├── Twitter.cpp │ │ │ ├── Twitter.h │ │ │ ├── util.h │ │ │ └── utility │ │ │ ├── socket.cpp │ │ │ ├── socket.h │ │ │ ├── util.h │ │ │ ├── w5100.cpp │ │ │ ├── w5100.h │ │ │ ├── w5200.cpp │ │ │ ├── w5200.h │ │ │ ├── w5500.cpp │ │ │ └── w5500.h │ ├── FreeRTOS701 │ │ ├── MapleFreeRTOS.cpp │ │ ├── MapleFreeRTOS.h │ │ ├── keywords.txt │ │ ├── rules.mk │ │ └── utility │ │ │ ├── FreeRTOS.h │ │ │ ├── FreeRTOSConfig.h │ │ │ ├── StackMacros.h │ │ │ ├── croutine.c │ │ │ ├── croutine.h │ │ │ ├── heap_2.c │ │ │ ├── list.c │ │ │ ├── list.h │ │ │ ├── mpu_wrappers.h │ │ │ ├── port.c │ │ │ ├── portable.h │ │ │ ├── portmacro.h │ │ │ ├── projdefs.h │ │ │ ├── queue.c │ │ │ ├── queue.h │ │ │ ├── semphr.h │ │ │ ├── task.h │ │ │ ├── tasks.c │ │ │ ├── timers.c │ │ │ └── timers.h │ ├── FreeRTOS821 │ │ ├── MapleFreeRTOS821.cpp │ │ ├── MapleFreeRTOS821.h │ │ ├── examples │ │ │ ├── rtos_blink │ │ │ │ └── rtos_blink.ino │ │ │ └── rtos_display_blink │ │ │ │ └── rtos_display_blink.ino │ │ ├── keywords.txt │ │ ├── rules.mk │ │ └── utility │ │ │ ├── FreeRTOS.h │ │ │ ├── FreeRTOSConfig.h │ │ │ ├── MemMang │ │ │ ├── heap_1.c │ │ │ ├── heap_2.c │ │ │ ├── heap_3.c │ │ │ ├── heap_4.c │ │ │ └── heap_5.c │ │ │ ├── StackMacros.h │ │ │ ├── croutine.c │ │ │ ├── croutine.h │ │ │ ├── deprecated_definitions.h │ │ │ ├── event_groups.c │ │ │ ├── event_groups.h │ │ │ ├── heap_1.c │ │ │ ├── list.c │ │ │ ├── list.h │ │ │ ├── mpu_wrappers.h │ │ │ ├── port.c │ │ │ ├── portable.h │ │ │ ├── portmacro.h │ │ │ ├── projdefs.h │ │ │ ├── queue.c │ │ │ ├── queue.h │ │ │ ├── readme.txt │ │ │ ├── semphr.h │ │ │ ├── stdint.readme │ │ │ ├── task.h │ │ │ ├── tasks.c │ │ │ ├── timers.c │ │ │ └── timers.h │ ├── FreeRTOS900 │ │ ├── MapleFreeRTOS900.cpp │ │ ├── MapleFreeRTOS900.h │ │ ├── examples │ │ │ ├── rtos_blink │ │ │ │ └── rtos_blink.ino │ │ │ └── rtos_display_blink │ │ │ │ └── rtos_display_blink.ino │ │ └── utility │ │ │ ├── FreeRTOS.h │ │ │ ├── FreeRTOSConfig.h │ │ │ ├── MemMang │ │ │ ├── heap_1.c │ │ │ ├── heap_2.c │ │ │ ├── heap_3.c │ │ │ ├── heap_4.c │ │ │ └── heap_5.c │ │ │ ├── StackMacros.h │ │ │ ├── croutine.c │ │ │ ├── croutine.h │ │ │ ├── deprecated_definitions.h │ │ │ ├── event_groups.c │ │ │ ├── event_groups.h │ │ │ ├── heap_1.c │ │ │ ├── list.c │ │ │ ├── list.h │ │ │ ├── mpu_prototypes.h │ │ │ ├── mpu_wrappers.h │ │ │ ├── port.c │ │ │ ├── portable.h │ │ │ ├── portmacro.h │ │ │ ├── projdefs.h │ │ │ ├── queue.c │ │ │ ├── queue.h │ │ │ ├── readme.txt │ │ │ ├── semphr.h │ │ │ ├── stdint.readme │ │ │ ├── task.h │ │ │ ├── tasks.c │ │ │ ├── timers.c │ │ │ └── timers.h │ ├── Lcd7920_STM │ │ ├── examples │ │ │ └── Lcd7920_STM │ │ │ │ └── Lcd7920_STM.ino │ │ ├── glcd10x10_STM.cpp │ │ ├── glcd16x16_STM.cpp │ │ ├── glcd5x5_STM.cpp │ │ ├── glcd5x7_STM.cpp │ │ ├── lcd7920_STM.cpp │ │ ├── lcd7920_STM.h │ │ └── readme.md │ ├── LiquidCrystal │ │ ├── LiquidCrystal.cpp │ │ ├── LiquidCrystal.h │ │ └── rules.mk │ ├── MapleCoOS │ │ ├── MapleCoOS.h │ │ ├── examples │ │ │ └── coos_display_blink │ │ │ │ └── coos_display_blink.ino │ │ ├── keywords.txt │ │ └── utility │ │ │ ├── CoOS.h │ │ │ ├── OsArch.c │ │ │ ├── OsArch.h │ │ │ ├── OsConfig.h │ │ │ ├── OsCore.c │ │ │ ├── OsCore.h │ │ │ ├── OsError.h │ │ │ ├── OsEvent.c │ │ │ ├── OsEvent.h │ │ │ ├── OsFlag.c │ │ │ ├── OsFlag.h │ │ │ ├── OsHook.c │ │ │ ├── OsKernelHeap.c │ │ │ ├── OsKernelHeap.h │ │ │ ├── OsMM.h │ │ │ ├── OsMbox.c │ │ │ ├── OsMm.c │ │ │ ├── OsMutex.c │ │ │ ├── OsMutex.h │ │ │ ├── OsPort.c │ │ │ ├── OsQueue.c │ │ │ ├── OsQueue.h │ │ │ ├── OsSem.c │ │ │ ├── OsServiceReq.c │ │ │ ├── OsServiceReq.h │ │ │ ├── OsTask.c │ │ │ ├── OsTask.h │ │ │ ├── OsTime.c │ │ │ ├── OsTime.h │ │ │ ├── OsTimer.c │ │ │ ├── OsTimer.h │ │ │ ├── OsUtility.c │ │ │ ├── OsUtility.h │ │ │ └── coocox.h │ ├── MapleCoOS116 │ │ ├── MapleCoOS116.h │ │ ├── examples │ │ │ └── coos_display_blink │ │ │ │ ├── SPICoOS.cpp │ │ │ │ ├── SPICoOS.h │ │ │ │ ├── TFT_ILI9163C.cpp │ │ │ │ ├── TFT_ILI9163C.h │ │ │ │ └── coos_display_blink.ino │ │ ├── keywords.txt │ │ └── utility │ │ │ ├── CoOS.h │ │ │ ├── OsArch.h │ │ │ ├── OsConfig.h │ │ │ ├── OsCore.h │ │ │ ├── OsError.h │ │ │ ├── OsEvent.h │ │ │ ├── OsFlag.h │ │ │ ├── OsKernelHeap.h │ │ │ ├── OsMM.h │ │ │ ├── OsMutex.h │ │ │ ├── OsQueue.h │ │ │ ├── OsServiceReq.h │ │ │ ├── OsTask.h │ │ │ ├── OsTime.h │ │ │ ├── OsTimer.h │ │ │ ├── arch.c │ │ │ ├── coocox.h │ │ │ ├── core.c │ │ │ ├── event.c │ │ │ ├── flag.c │ │ │ ├── hook.c │ │ │ ├── kernelHeap.c │ │ │ ├── mbox.c │ │ │ ├── mm.c │ │ │ ├── mutex.c │ │ │ ├── port.c │ │ │ ├── queue.c │ │ │ ├── sem.c │ │ │ ├── serviceReq.c │ │ │ ├── task.c │ │ │ ├── task.c.original │ │ │ ├── time.c │ │ │ ├── timer.c │ │ │ ├── utility.c │ │ │ └── utility.h │ ├── OLED_I2C │ │ ├── DefaultFonts.c │ │ ├── Documentation │ │ │ ├── OLED_I2C.pdf │ │ │ └── version.txt │ │ ├── License │ │ │ ├── License - CC BY-NC-SA 3.0 - Legal.pdf │ │ │ └── License - CC BY-NC-SA 3.0 - Summary.pdf │ │ ├── OLED_I2C.cpp │ │ ├── OLED_I2C.h │ │ ├── examples │ │ │ ├── Arduino │ │ │ │ ├── OLED_I2C_3D_Cube │ │ │ │ │ └── OLED_I2C_3D_Cube.ino │ │ │ │ ├── OLED_I2C_Bitmap │ │ │ │ │ ├── OLED_I2C_Bitmap.ino │ │ │ │ │ └── graphics.c │ │ │ │ ├── OLED_I2C_Brightness │ │ │ │ │ └── OLED_I2C_Brightness.ino │ │ │ │ ├── OLED_I2C_Graph_Demo │ │ │ │ │ ├── OLED_I2C_Graph_Demo.ino │ │ │ │ │ └── graphics.c │ │ │ │ ├── OLED_I2C_NumberFonts │ │ │ │ │ └── OLED_I2C_NumberFonts.ino │ │ │ │ ├── OLED_I2C_Scrolling_Text │ │ │ │ │ └── OLED_I2C_Scrolling_Text.ino │ │ │ │ ├── OLED_I2C_TinyFont_View │ │ │ │ │ └── OLED_I2C_TinyFont_View.ino │ │ │ │ └── OLED_I2C_ViewFont │ │ │ │ │ └── OLED_I2C_ViewFont.ino │ │ │ └── chipKit │ │ │ │ ├── OLED_I2C_3D_Cube │ │ │ │ └── OLED_I2C_3D_Cube.pde │ │ │ │ ├── OLED_I2C_Bitmap │ │ │ │ ├── OLED_I2C_Bitmap.ino │ │ │ │ └── graphics.c │ │ │ │ ├── OLED_I2C_Brightness │ │ │ │ └── OLED_I2C_Brightness.ino │ │ │ │ ├── OLED_I2C_Graph_Demo │ │ │ │ ├── OLED_I2C_Graph_Demo.ino │ │ │ │ └── graphics.c │ │ │ │ ├── OLED_I2C_NumberFonts │ │ │ │ └── OLED_I2C_NumberFonts.ino │ │ │ │ ├── OLED_I2C_Scrolling_Text │ │ │ │ └── OLED_I2C_Scrolling_Text.ino │ │ │ │ ├── OLED_I2C_TinyFont_View │ │ │ │ └── OLED_I2C_TinyFont_View.ino │ │ │ │ └── OLED_I2C_ViewFont │ │ │ │ └── OLED_I2C_ViewFont.ino │ │ ├── hardware │ │ │ ├── arm │ │ │ │ ├── HW_ARM.h │ │ │ │ ├── HW_ARM_defines.h │ │ │ │ ├── HW_STM32.h │ │ │ │ └── HW_STM32_defines.h │ │ │ ├── avr │ │ │ │ ├── HW_AVR.h │ │ │ │ └── HW_AVR_defines.h │ │ │ └── pic32 │ │ │ │ ├── HW_PIC32.h │ │ │ │ └── HW_PIC32_defines.h │ │ └── keywords.txt │ ├── OneWireSTM │ │ ├── examples │ │ │ ├── DS18x20_Temperature │ │ │ │ └── DS18x20_Temperature.ino │ │ │ ├── DS2408_Switch │ │ │ │ └── DS2408_Switch.ino │ │ │ └── DS250x_PROM │ │ │ │ └── DS250x_PROM.ino │ │ ├── keywords.txt │ │ ├── library.properties │ │ └── src │ │ │ ├── OneWireSTM.cpp │ │ │ └── OneWireSTM.h │ ├── RTClock │ │ ├── examples │ │ │ ├── BluePill-RTClock-test │ │ │ │ └── BluePill-RTClock-test.ino │ │ │ ├── Gilchrist_RTC │ │ │ │ └── Gilchrist_RTC.ino │ │ │ └── Test_RTClock │ │ │ │ └── Test_RTClock.ino │ │ ├── keywords.txt │ │ ├── library.properties │ │ └── src │ │ │ ├── RTClock.cpp │ │ │ ├── RTClock.h │ │ │ └── utility │ │ │ ├── rtc_util.c │ │ │ └── rtc_util.h │ ├── SDIO │ │ ├── SdioF1.cpp │ │ └── SdioF1.h │ ├── SPI │ │ ├── examples │ │ │ ├── spi_slave │ │ │ │ └── spi_slave.ino │ │ │ └── using_SPI_ports │ │ │ │ └── using_SPI_ports.ino │ │ ├── keywords.txt │ │ ├── library.properties │ │ └── src │ │ │ ├── README.txt │ │ │ ├── SPI.cpp │ │ │ └── SPI.h │ ├── STM32ADC │ │ ├── examples │ │ │ ├── MultiChannelContinuousConversion │ │ │ │ └── MultiChannelContinuousConversion.ino │ │ │ ├── MultiChannelSingleConversion │ │ │ │ └── MultiChannelSingleConversion.ino │ │ │ ├── SingleChannelAtSampleRateCircularBuffer │ │ │ │ └── SingleChannelAtSampleRateCircularBuffer.ino │ │ │ ├── SingleChannelContinuousConversion │ │ │ │ └── SingleChannelContinuousConversion.ino │ │ │ ├── SingleChannelSingleConversion │ │ │ │ └── SingleChannelSingleConversion.ino │ │ │ └── SingleConversionInterrupt │ │ │ │ └── SingleConversionInterrupt.ino │ │ ├── keywords.txt │ │ ├── library.properties │ │ └── src │ │ │ ├── STM32ADC.cpp │ │ │ ├── STM32ADC.h │ │ │ └── utility │ │ │ ├── util_adc.c │ │ │ └── util_adc.h │ ├── Serasidis_EtherCard_STM │ │ ├── README.md │ │ ├── examples │ │ │ ├── JeeUdp │ │ │ │ └── JeeUdp.ino │ │ │ ├── SSDP │ │ │ │ └── SSDP.ino │ │ │ ├── backSoon │ │ │ │ └── backSoon.ino │ │ │ ├── etherNode │ │ │ │ └── etherNode.ino │ │ │ ├── getDHCPandDNS │ │ │ │ └── getDHCPandDNS.ino │ │ │ ├── getStaticIP │ │ │ │ └── getStaticIP.ino │ │ │ ├── getViaDNS │ │ │ │ └── getViaDNS.ino │ │ │ ├── multipacket │ │ │ │ └── multipacket.ino │ │ │ ├── multipacketSD │ │ │ │ └── multipacketSD.ino │ │ │ ├── nanether │ │ │ │ └── nanether.ino │ │ │ ├── noipClient │ │ │ │ └── noipClient.ino │ │ │ ├── pings │ │ │ │ └── pings.ino │ │ │ ├── rbbb_server │ │ │ │ └── rbbb_server.ino │ │ │ ├── stashTest │ │ │ │ └── stashTest.ino │ │ │ ├── testDHCP │ │ │ │ └── testDHCP.ino │ │ │ ├── twitter │ │ │ │ └── twitter.ino │ │ │ ├── udpClientSendOnly │ │ │ │ ├── Java_ClientAndServer │ │ │ │ │ ├── UDPClient.java │ │ │ │ │ └── UDPserver.java │ │ │ │ └── udpClientSendOnly.ino │ │ │ ├── udpListener │ │ │ │ └── udpListener.ino │ │ │ ├── webClient │ │ │ │ └── webClient.ino │ │ │ └── xively │ │ │ │ └── xively.ino │ │ ├── keywords.txt │ │ ├── library.properties │ │ └── src │ │ │ ├── Doxymods.css │ │ │ ├── EtherCard_STM.cpp │ │ │ ├── EtherCard_STM.h │ │ │ ├── dhcp.cpp │ │ │ ├── dns.cpp │ │ │ ├── enc28j60.cpp │ │ │ ├── enc28j60.h │ │ │ ├── net.h │ │ │ ├── tcpip.cpp │ │ │ ├── udpserver.cpp │ │ │ └── webutil.cpp │ ├── Serasidis_VS1003B_STM │ │ ├── README.md │ │ ├── examples │ │ │ ├── MIDI_Classic_Mode │ │ │ │ └── MIDI_Classic_Mode.ino │ │ │ └── hello_STM │ │ │ │ └── hello_STM.ino │ │ ├── keywords.txt │ │ ├── library.properties │ │ └── src │ │ │ ├── VS1003_STM.cpp │ │ │ ├── VS1003_STM.h │ │ │ └── flac.h │ ├── Serasidis_XPT2046_touch │ │ ├── README.md │ │ ├── examples │ │ │ ├── TouchButtons │ │ │ │ └── TouchButtons.ino │ │ │ └── TouchTest │ │ │ │ └── TouchTest.ino │ │ ├── keywords.txt │ │ ├── library.properties │ │ └── src │ │ │ ├── XPT2046_touch.cpp │ │ │ └── XPT2046_touch.h │ ├── Servo │ │ ├── examples │ │ │ ├── Knob │ │ │ │ └── Knob.ino │ │ │ └── Sweep │ │ │ │ └── Sweep.ino │ │ ├── keywords.txt │ │ ├── library.properties │ │ └── src │ │ │ ├── Servo.cpp │ │ │ └── Servo.h │ ├── Touch-Screen-Library_STM │ │ ├── README.txt │ │ ├── TouchScreen_STM.cpp │ │ ├── TouchScreen_STM.h │ │ └── examples │ │ │ ├── touchscreendemo │ │ │ └── touchscreendemo.pde │ │ │ └── touchscreendemoshield │ │ │ └── touchscreendemoshield.ino │ ├── USBComposite │ │ ├── AbsMouse.cpp │ │ ├── Consumer.cpp │ │ ├── HIDReports.cpp │ │ ├── Joystick.cpp │ │ ├── Keyboard.cpp │ │ ├── LICENSE │ │ ├── MidiSpecs.h │ │ ├── MinSysex.c │ │ ├── MinSysex.h │ │ ├── Mouse.cpp │ │ ├── README.md │ │ ├── UPGRADING-TO-0.90.txt │ │ ├── USBComposite.cpp │ │ ├── USBComposite.h │ │ ├── USBCompositeSerial.cpp │ │ ├── USBCompositeSerial.h │ │ ├── USBHID.cpp │ │ ├── USBHID.h │ │ ├── USBMIDI.cpp │ │ ├── USBMIDI.h │ │ ├── USBMassStorage.cpp │ │ ├── USBMassStorage.h │ │ ├── USBXBox360.cpp │ │ ├── USBXBox360.h │ │ ├── examples │ │ │ ├── BootKeyboard │ │ │ │ └── BootKeyboard.ino │ │ │ ├── absmouse │ │ │ │ └── absmouse.ino │ │ │ ├── consumer │ │ │ │ └── consumer.ino │ │ │ ├── jigglemouse │ │ │ │ └── jigglemouse.ino │ │ │ ├── keyboardMouse │ │ │ │ └── keyboardMouse.ino │ │ │ ├── keyboardwithleds │ │ │ │ └── keyboardwithleds.ino │ │ │ ├── mass │ │ │ │ ├── image.h │ │ │ │ └── mass.ino │ │ │ ├── midiin │ │ │ │ └── midiin.ino │ │ │ ├── midiout │ │ │ │ └── midiout.ino │ │ │ ├── rawhid │ │ │ │ ├── rawhid.ino │ │ │ │ └── send.py │ │ │ ├── sdreader │ │ │ │ └── sdreader.ino │ │ │ ├── simplejoystick │ │ │ │ └── simplejoystick.ino │ │ │ ├── simplekeyboard │ │ │ │ └── simplekeyboard.ino │ │ │ ├── softjoystick │ │ │ │ ├── send.py │ │ │ │ └── softjoystick.ino │ │ │ ├── twojoysticks │ │ │ │ └── twojoysticks.ino │ │ │ └── x360 │ │ │ │ └── x360.ino │ │ ├── keywords.txt │ │ ├── library.properties │ │ ├── scripts │ │ │ ├── midi_table.py │ │ │ ├── send.py │ │ │ └── showhids.py │ │ ├── usb_composite_serial.c │ │ ├── usb_composite_serial.h │ │ ├── usb_generic.c │ │ ├── usb_generic.h │ │ ├── usb_hid.c │ │ ├── usb_hid.h │ │ ├── usb_mass.c │ │ ├── usb_mass.h │ │ ├── usb_mass_internal.h │ │ ├── usb_mass_mal.c │ │ ├── usb_mass_mal.h │ │ ├── usb_midi_device.c │ │ ├── usb_midi_device.h │ │ ├── usb_scsi.c │ │ ├── usb_scsi.h │ │ ├── usb_scsi_data.c │ │ ├── usb_setup.cpp │ │ ├── usb_x360.c │ │ └── usb_x360.h │ ├── WS2812B │ │ ├── README.md │ │ ├── examples │ │ │ └── WS2812B_test │ │ │ │ └── WS2812B_test.ino │ │ ├── keywords.txt │ │ ├── library.properties │ │ └── src │ │ │ ├── WS2812B.cpp │ │ │ └── WS2812B.h │ ├── Wire │ │ ├── SoftWire.cpp │ │ ├── SoftWire.h │ │ ├── Wire.cpp │ │ ├── Wire.h │ │ ├── Wire_slave.h │ │ ├── examples │ │ │ ├── i2c_scanner_softwire │ │ │ │ └── i2c_scanner_softwire.ino │ │ │ └── i2c_scanner_wire │ │ │ │ └── i2c_scanner_wire.ino │ │ ├── keywords.txt │ │ ├── library.properties │ │ ├── rules.mk │ │ └── utility │ │ │ ├── WireBase.cpp │ │ │ └── WireBase.h │ ├── WireSlave │ │ ├── examples │ │ │ ├── SFRRanger_reader │ │ │ │ └── SFRRanger_reader.ino │ │ │ ├── digital_potentiometer │ │ │ │ └── digital_potentiometer.ino │ │ │ ├── i2c_libmaple_slave_reader │ │ │ │ └── i2c_libmaple_slave_reader.ino │ │ │ ├── i2c_scanner_wire │ │ │ │ └── i2c_scanner_wire.ino │ │ │ ├── master_reader │ │ │ │ └── master_reader.ino │ │ │ ├── master_writer │ │ │ │ └── master_writer.ino │ │ │ ├── selftest1 │ │ │ │ ├── code.cpp │ │ │ │ └── selftest1.ino │ │ │ ├── slave_receiver │ │ │ │ └── slave_receiver.ino │ │ │ └── slave_sender │ │ │ │ └── slave_sender.ino │ │ ├── keywords.txt │ │ ├── library.properties │ │ └── src │ │ │ ├── Wire.h │ │ │ ├── Wire_slave.cpp │ │ │ ├── Wire_slave.h │ │ │ ├── i2c_slave.c │ │ │ └── libmaple │ │ │ ├── i2c_common_slave.h │ │ │ └── i2c_slave.h │ └── stm_fft │ │ ├── cr4_fft_1024_stm32.asm │ │ ├── cr4_fft_16_stm33.asm │ │ ├── cr4_fft_256_stm32.asm │ │ ├── cr4_fft_64_stm32.asm │ │ ├── cr4_fft_stm32.h │ │ ├── stm32f10x_DSP_lib.chm │ │ └── table_fft.h │ ├── platform.txt │ ├── system │ ├── Makefile │ ├── build-targets.mk │ ├── libmaple │ │ ├── dma_private.h │ │ ├── exti_private.h │ │ ├── i2c_private.h │ │ ├── include │ │ │ ├── libmaple │ │ │ │ ├── adc.h │ │ │ │ ├── bitband.h │ │ │ │ ├── bkp.h │ │ │ │ ├── dac.h │ │ │ │ ├── delay.h │ │ │ │ ├── dma.h │ │ │ │ ├── dma_common.h │ │ │ │ ├── exti.h │ │ │ │ ├── flash.h │ │ │ │ ├── fsmc.h │ │ │ │ ├── gpio.h │ │ │ │ ├── i2c.h │ │ │ │ ├── i2c_common.h │ │ │ │ ├── iwdg.h │ │ │ │ ├── libmaple.h │ │ │ │ ├── libmaple_types.h │ │ │ │ ├── nvic.h │ │ │ │ ├── pwr.h │ │ │ │ ├── rcc.h │ │ │ │ ├── ring_buffer.h │ │ │ │ ├── scb.h │ │ │ │ ├── sdio.h │ │ │ │ ├── spi.h │ │ │ │ ├── stm32.h │ │ │ │ ├── syscfg.h │ │ │ │ ├── systick.h │ │ │ │ ├── timer.h │ │ │ │ ├── usart.h │ │ │ │ ├── usb.h │ │ │ │ ├── usb_cdcacm.h │ │ │ │ └── util.h │ │ │ └── util │ │ │ │ └── atomic.h │ │ ├── rcc_private.h │ │ ├── rules.mk │ │ ├── spi_private.h │ │ ├── stm32_private.h │ │ ├── stm32f1 │ │ │ ├── include │ │ │ │ └── series │ │ │ │ │ ├── adc.h │ │ │ │ │ ├── dac.h │ │ │ │ │ ├── dma.h │ │ │ │ │ ├── exti.h │ │ │ │ │ ├── flash.h │ │ │ │ │ ├── gpio.h │ │ │ │ │ ├── i2c.h │ │ │ │ │ ├── nvic.h │ │ │ │ │ ├── pwr.h │ │ │ │ │ ├── rcc.h │ │ │ │ │ ├── spi.h │ │ │ │ │ ├── stm32.h │ │ │ │ │ ├── timer.h │ │ │ │ │ └── usart.h │ │ │ └── rules.mk │ │ ├── stm32f2 │ │ │ ├── include │ │ │ │ └── series │ │ │ │ │ ├── adc.h │ │ │ │ │ ├── dac.h │ │ │ │ │ ├── dma.h │ │ │ │ │ ├── exti.h │ │ │ │ │ ├── flash.h │ │ │ │ │ ├── gpio.h │ │ │ │ │ ├── nvic.h │ │ │ │ │ ├── pwr.h │ │ │ │ │ ├── rcc.h │ │ │ │ │ ├── spi.h │ │ │ │ │ ├── stm32.h │ │ │ │ │ ├── timer.h │ │ │ │ │ └── usart.h │ │ │ └── rules.mk │ │ ├── timer_private.h │ │ ├── usart_private.h │ │ └── usb │ │ │ ├── README │ │ │ ├── rules.mk │ │ │ ├── stm32f1 │ │ │ ├── usb_lib_globals.h │ │ │ └── usb_reg_map.h │ │ │ └── usb_lib │ │ │ ├── usb_core.h │ │ │ ├── usb_def.h │ │ │ ├── usb_init.h │ │ │ ├── usb_lib.h │ │ │ ├── usb_mem.h │ │ │ ├── usb_regs.h │ │ │ └── usb_type.h │ └── support │ │ ├── doxygen │ │ ├── Doxyfile │ │ └── evil_mangler.awk │ │ ├── gdb │ │ ├── gpio │ │ │ └── gpio.gdb │ │ └── i2c │ │ │ └── test.gdb │ │ ├── ld │ │ ├── common.inc │ │ ├── flash.ld │ │ ├── jtag.ld │ │ ├── ram.ld │ │ ├── stm32 │ │ │ ├── mem │ │ │ │ ├── maple_native │ │ │ │ │ ├── maple_native_heap.inc │ │ │ │ │ ├── mem-flash.inc │ │ │ │ │ ├── mem-jtag.inc │ │ │ │ │ └── mem-ram.inc │ │ │ │ ├── sram_112k_flash_1024k │ │ │ │ │ ├── mem-jtag.inc │ │ │ │ │ └── mem-ram.inc │ │ │ │ ├── sram_20k_flash_128k │ │ │ │ │ ├── mem-flash.inc │ │ │ │ │ ├── mem-jtag.inc │ │ │ │ │ └── mem-ram.inc │ │ │ │ ├── sram_20k_flash_128k_robotis │ │ │ │ │ ├── mem-flash.inc │ │ │ │ │ ├── mem-jtag.inc │ │ │ │ │ └── mem-ram.inc │ │ │ │ ├── sram_64k_flash_512k │ │ │ │ │ ├── mem-flash.inc │ │ │ │ │ ├── mem-jtag.inc │ │ │ │ │ └── mem-ram.inc │ │ │ │ └── sram_8k_flash_128k │ │ │ │ │ ├── mem-flash.inc │ │ │ │ │ ├── mem-jtag.inc │ │ │ │ │ └── mem-ram.inc │ │ │ └── series │ │ │ │ ├── stm32f1 │ │ │ │ ├── performance │ │ │ │ │ └── vector_symbols.inc │ │ │ │ └── value │ │ │ │ │ └── vector_symbols.inc │ │ │ │ └── stm32f2 │ │ │ │ └── vector_symbols.inc │ │ └── toolchains │ │ │ ├── gcc-arm-embedded │ │ │ └── extra_libs.inc │ │ │ └── generic │ │ │ └── extra_libs.inc │ │ ├── make │ │ ├── board-includes │ │ │ ├── VLDiscovery.mk │ │ │ ├── cm900.mk │ │ │ ├── maple.mk │ │ │ ├── maple_RET6.mk │ │ │ ├── maple_mini.mk │ │ │ ├── maple_native.mk │ │ │ ├── olimex_stm32_h103.mk │ │ │ ├── opencm904.mk │ │ │ └── st_stm3220g_eval.mk │ │ ├── build-rules.mk │ │ ├── build-templates.mk │ │ ├── footer.mk │ │ ├── header.mk │ │ └── target-config.mk │ │ ├── scripts │ │ ├── 45-maple.rules │ │ ├── copy-to-ide │ │ ├── reset.py │ │ ├── robotis-loader.py │ │ └── win-list-com-ports.py │ │ └── stm32loader.py │ └── variants │ └── generic_stm32f103t │ ├── board.cpp │ ├── board │ └── board.h │ ├── ld │ ├── bootloader_20.ld │ ├── common.inc │ ├── extra_libs.inc │ ├── flash-5C00.ld │ ├── flash-6000.ld │ ├── flash.ld │ ├── flash_t8.ld │ ├── jtag.ld │ ├── jtag_t8.ld │ ├── mem-flash-5C00.inc │ ├── mem-flash-6000.inc │ ├── mem-flash.inc │ ├── mem-jtag.inc │ ├── mem-ram.inc │ ├── ram.ld │ ├── ram_t8.ld │ └── vector_symbols.inc │ ├── pins_arduino.h │ ├── variant.h │ └── wirish │ ├── boards.cpp │ ├── boards_setup.cpp │ ├── start.S │ ├── start_c.c │ └── syscalls.c ├── scripts ├── cat_env.py ├── pack.py ├── pack_factory.py ├── pack_minor_sm3.py ├── platformio-build-stm32f1.py ├── platformio-targets.py ├── prepare-build.py └── prepare-upload.py └── sm2_modules_bootloader.bin /Marlin/src/HAL/hal_RGB.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Snapmaker2-Modules Firmware 3 | * Copyright (C) 2019-2020 Snapmaker [https://github.com/Snapmaker] 4 | * 5 | * This file is part of Snapmaker2-Modules 6 | * (see https://github.com/Snapmaker/Snapmaker2-Modules) 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | #ifndef MODULES_WHIMSYCWD_MARLIN_SRC_HAL_RGB_H_ 22 | #define MODULES_WHIMSYCWD_MARLIN_SRC_HAL_RGB_H_ 23 | 24 | #include 25 | #include "hal_exti.h" 26 | typedef struct{ 27 | uint8_t r; 28 | uint8_t g; 29 | uint8_t b; 30 | } RGB_T; 31 | 32 | void HAL_RGBInit(uint8_t pin, SOFT_EXTI_LINE_E exti); // pin: eg. PA1 33 | void HAL_SetAllRGB(uint8_t pin, RGB_T *rgb, uint8_t light_count); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Marlin/src/HAL/hal_flash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Snapmaker2-Modules Firmware 3 | * Copyright (C) 2019-2020 Snapmaker [https://github.com/Snapmaker] 4 | * 5 | * This file is part of Snapmaker2-Modules 6 | * (see https://github.com/Snapmaker/Snapmaker2-Modules) 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #ifndef MODULES_WHIMSYCWD_MARLIN_SRC_HAL_HAL_FLASH_H_ 23 | #define MODULES_WHIMSYCWD_MARLIN_SRC_HAL_HAL_FLASH_H_ 24 | 25 | #include 26 | 27 | void HAL_flash_write(uint32_t updateAddr, uint8_t * data, uint8_t len); 28 | void HAL_flash_read(uint32_t addr, uint8_t * out, uint16_t read_len); 29 | void HAL_flash_erase_page(uint32_t start_addr, uint8_t page_count); 30 | 31 | 32 | #endif //MODULES_WHIMSYCWD_MARLIN_SRC_HAL_HAL_FLASH_H_ 33 | -------------------------------------------------------------------------------- /Marlin/src/HAL/hal_gpio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Snapmaker2-Modules Firmware 3 | * Copyright (C) 2019-2020 Snapmaker [https://github.com/Snapmaker] 4 | * 5 | * This file is part of Snapmaker2-Modules 6 | * (see https://github.com/Snapmaker/Snapmaker2-Modules) 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | #ifndef GPIO_H 22 | #define GPIO_H 23 | #include "std_library/inc/stm32f10x.h" 24 | 25 | void GpioRemap(void); 26 | void GpioInit(uint8_t Port, GPIOMode_TypeDef Mode); 27 | void GpioWrite(uint8_t Port, uint8_t IOLevel); 28 | uint8_t GpioRead(uint8_t Port); 29 | GPIO_TypeDef * GpioGetPort(uint8_t pin); 30 | #endif 31 | -------------------------------------------------------------------------------- /Marlin/src/HAL/hal_reset.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Snapmaker2-Modules Firmware 3 | * Copyright (C) 2019-2020 Snapmaker [https://github.com/Snapmaker] 4 | * 5 | * This file is part of Snapmaker2-Modules 6 | * (see https://github.com/Snapmaker/Snapmaker2-Modules) 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | #include "std_library/inc/stm32f10x.h" 22 | #include "std_library/inc/stm32f10x_iwdg.h" 23 | void HAL_reset() { 24 | IWDG_WriteAccessCmd(IWDG_WriteAccess_Enable); 25 | IWDG_SetPrescaler(IWDG_Prescaler_64); 26 | IWDG_SetReload(30); 27 | IWDG_ReloadCounter(); 28 | IWDG_Enable(); 29 | } 30 | 31 | void HAL_JTAGDisable() { 32 | GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable , ENABLE); 33 | } -------------------------------------------------------------------------------- /Marlin/src/HAL/hal_reset.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Snapmaker2-Modules Firmware 3 | * Copyright (C) 2019-2020 Snapmaker [https://github.com/Snapmaker] 4 | * 5 | * This file is part of Snapmaker2-Modules 6 | * (see https://github.com/Snapmaker/Snapmaker2-Modules) 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | #ifndef MODULES_WHIMSYCWD_MARLIN_SRC_HAL_HAL_GD32F1_HAL_RESET_H_ 22 | #define MODULES_WHIMSYCWD_MARLIN_SRC_HAL_HAL_GD32F1_HAL_RESET_H_ 23 | 24 | extern void HAL_reset(); 25 | extern void HAL_JTAGDisable(); 26 | #endif //MODULES_WHIMSYCWD_MARLIN_SRC_HAL_HAL_GD32F1_HAL_TEMPERATURE_H_ 27 | -------------------------------------------------------------------------------- /Marlin/src/bootstrap/engine.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Snapmaker2-Modules Firmware 3 | * Copyright (C) 2019-2020 Snapmaker [https://github.com/Snapmaker] 4 | * 5 | * This file is part of Snapmaker2-Modules 6 | * (see https://github.com/Snapmaker/Snapmaker2-Modules) 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include "engine.h" 27 | 28 | void Engine::Run() { 29 | bool loop_flag = true; 30 | 31 | while (loop_flag) { 32 | canbus_g.Handler(); 33 | registryInstance.ConfigHandler(); 34 | registryInstance.ServerHandler(); 35 | registryInstance.SystemHandler(); 36 | routeInstance.ModuleLoop(); 37 | } 38 | } 39 | 40 | Engine engineInstance; -------------------------------------------------------------------------------- /Marlin/src/bootstrap/engine.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Snapmaker2-Modules Firmware 3 | * Copyright (C) 2019-2020 Snapmaker [https://github.com/Snapmaker] 4 | * 5 | * This file is part of Snapmaker2-Modules 6 | * (see https://github.com/Snapmaker/Snapmaker2-Modules) 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #ifndef MODULES_WHIMSYCWD_MARLIN_SRC_BOOTSTRAP_ENGINE_H_ 23 | #define MODULES_WHIMSYCWD_MARLIN_SRC_BOOTSTRAP_ENGINE_H_ 24 | 25 | class Engine { 26 | public: 27 | void Run(); 28 | }; 29 | 30 | extern Engine engineInstance; 31 | #endif //MODULES_WHIMSYCWD_MARLIN_SRC_BOOTSTRAP_ENGINE_H_ 32 | -------------------------------------------------------------------------------- /Marlin/src/bootstrap/startup.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Snapmaker2-Modules Firmware 3 | * Copyright (C) 2019-2020 Snapmaker [https://github.com/Snapmaker] 4 | * 5 | * This file is part of Snapmaker2-Modules 6 | * (see https://github.com/Snapmaker/Snapmaker2-Modules) 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #ifndef MODULES_WHIMSYCWD_MARLIN_SRC_BOOTSTRAP_STARTUP_H_ 23 | #define MODULES_WHIMSYCWD_MARLIN_SRC_BOOTSTRAP_STARTUP_H_ 24 | 25 | class Startup { 26 | public: 27 | uint32_t SelfDetct(); 28 | void PeriphInit(); 29 | void BasePeriphInit(); 30 | void FuncIdListInit(); 31 | }; 32 | 33 | extern Startup startupInstance; 34 | 35 | #endif //MODULES_WHIMSYCWD_MARLIN_SRC_BOOTSTRAP_STARTUP_H_ 36 | -------------------------------------------------------------------------------- /Marlin/src/core/millis_t.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Marlin 3D Printer Firmware 3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] 4 | * 5 | * Based on Sprinter and grbl. 6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | */ 22 | #pragma once 23 | 24 | #include 25 | 26 | typedef uint32_t millis_t; 27 | 28 | #define SEC_TO_MS(N) millis_t((N)*1000UL) 29 | #define MIN_TO_MS(N) SEC_TO_MS((N)*60UL) 30 | #define MS_TO_SEC(N) millis_t((N)/1000UL) 31 | 32 | #define PENDING(NOW,SOON) ((int32_t)(NOW-(SOON))<0) 33 | #define ELAPSED(NOW,SOON) (!PENDING(NOW,SOON)) 34 | -------------------------------------------------------------------------------- /Marlin/src/core/utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Snapmaker2-Modules Firmware 3 | * Copyright (C) 2019-2020 Snapmaker [https://github.com/Snapmaker] 4 | * 5 | * This file is part of Snapmaker2-Modules 6 | * (see https://github.com/Snapmaker/Snapmaker2-Modules) 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #ifndef MODULES_WHIMSYCWD_MARLIN_SRC_CORE_UTILS_H_ 23 | #define MODULES_WHIMSYCWD_MARLIN_SRC_CORE_UTILS_H_ 24 | 25 | #include 26 | #include "../core/millis_t.h" 27 | 28 | int Number36To10(uint8_t *data, uint8_t len); 29 | int Number10To36str(uint32_t num, uint8_t *OutBuf, uint8_t BufLen); 30 | uint16_t CalcChecksum(uint8_t *data, uint16_t len); 31 | 32 | #endif //MODULES_WHIMSYCWD_MARLIN_SRC_CORE_UTILS_H_ 33 | -------------------------------------------------------------------------------- /Marlin/src/device/analog_io_ctrl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Snapmaker2-Modules Firmware 3 | * Copyright (C) 2019-2020 Snapmaker [https://github.com/Snapmaker] 4 | * 5 | * This file is part of Snapmaker2-Modules 6 | * (see https://github.com/Snapmaker/Snapmaker2-Modules) 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #ifndef ANALOG_IO_CTRL_H_ 23 | #define ANALOG_IO_CTRL_H_ 24 | 25 | #include 26 | 27 | #define REFERENCE_VOLTAGE 3.0 28 | 29 | class Dac { 30 | public: 31 | void Init(); 32 | void Output(uint16_t dac_val); 33 | 34 | private: 35 | uint8_t pin_; 36 | uint16_t dac_val_; 37 | }; 38 | 39 | class Adc { 40 | public: 41 | void Init(uint8_t pin); 42 | uint16_t ReadVoltage(); 43 | uint16_t ReadAdcVal(); 44 | 45 | private: 46 | uint8_t pin_; 47 | }; 48 | #endif //ANALOG_IO_CTRL_H_ 49 | -------------------------------------------------------------------------------- /Marlin/src/device/device_base.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Snapmaker2-Modules Firmware 3 | * Copyright (C) 2019-2020 Snapmaker [https://github.com/Snapmaker] 4 | * 5 | * This file is part of Snapmaker2-Modules 6 | * (see https://github.com/Snapmaker/Snapmaker2-Modules) 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #ifndef MODULES_WHIMSYCWD_MARLIN_SRC_FEATURE_FEATURE_BASE_H_ 23 | #define MODULES_WHIMSYCWD_MARLIN_SRC_FEATURE_FEATURE_BASE_H_ 24 | 25 | class DeviceBase { 26 | public: 27 | DeviceBase() { 28 | 29 | } 30 | ~DeviceBase() { 31 | 32 | } 33 | 34 | virtual void Init() = 0; 35 | virtual void Test() = 0; 36 | }; 37 | 38 | #endif //MODULES_WHIMSYCWD_MARLIN_SRC_FEATURE_FEATURE_BASE_H_ 39 | -------------------------------------------------------------------------------- /Marlin/src/device/icm4xxxx/icm4xxxx_delay.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "icm4xxxx_delay.h" 3 | #include "../../../../snapmaker/lib/STM32F1/cores/maple/wirish_time.h" 4 | 5 | void icm4xxxx_delay_ms(uint32_t ms) { 6 | delay(ms); 7 | } 8 | 9 | void icm4xxxx_delay_us(uint32_t us) { 10 | delayMicroseconds(us); 11 | } 12 | 13 | void inv_imu_sleep_us(uint32_t us) { 14 | delayMicroseconds(us); 15 | } 16 | 17 | uint64_t inv_imu_get_time_us(void) 18 | { 19 | return micros(); 20 | } 21 | -------------------------------------------------------------------------------- /Marlin/src/device/icm4xxxx/icm4xxxx_delay.h: -------------------------------------------------------------------------------- 1 | #ifndef ICM4XXXX_DELAY_H_ 2 | #define ICM4XXXX_DELAY_H_ 3 | 4 | #include 5 | 6 | 7 | 8 | void icm4xxxx_delay_ms(uint32_t ms); 9 | void icm4xxxx_delay_us(uint32_t us); 10 | void inv_imu_sleep_us(uint32_t us); 11 | uint64_t inv_imu_get_time_us(void); 12 | 13 | 14 | 15 | #endif -------------------------------------------------------------------------------- /Marlin/src/device/module_index.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Snapmaker2-Modules Firmware 3 | * Copyright (C) 2019-2020 Snapmaker [https://github.com/Snapmaker] 4 | * 5 | * This file is part of Snapmaker2-Modules 6 | * (see https://github.com/Snapmaker/Snapmaker2-Modules) 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | #include 22 | #include "src/device/module_index.h" 23 | void ModuleIndex::Init() { 24 | pinMode(PIN_MODULE_INDEX, INPUT_FLOATING); 25 | } 26 | uint8_t ModuleIndex::SetModuleIndex(uint8_t axis_index) { 27 | module_index_ = MODULE_INDEX_NONE; 28 | if (digitalRead(PIN_MODULE_INDEX) != 0) { 29 | module_index_ = axis_index; 30 | } 31 | return module_index_ != MODULE_INDEX_NONE; 32 | } 33 | ModuleIndex moduleIndex; -------------------------------------------------------------------------------- /Marlin/src/device/soft_i2c.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Snapmaker2-Modules Firmware 3 | * Copyright (C) 2019-2020 Snapmaker [https://github.com/Snapmaker] 4 | * 5 | * This file is part of Snapmaker2-Modules 6 | * (see https://github.com/Snapmaker/Snapmaker2-Modules) 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #ifndef MODULES_SOFT_I2C_H_ 23 | #define MODULES_SOFT_I2C_H_ 24 | 25 | #include 26 | #include "device_base.h" 27 | 28 | class SoftI2C { 29 | public: 30 | void Init(uint8_t sda, uint8_t scl); 31 | void IICStart(); 32 | void IICStop(); 33 | bool IICWaitAck(); 34 | void IICAck(); 35 | void IICNAck(); 36 | void IICSendByte(uint8_t data); 37 | uint8_t IICReadByte(bool send_ack); 38 | 39 | private: 40 | uint8_t i2c_sda_; 41 | uint8_t i2c_scl_; 42 | 43 | }; 44 | 45 | #endif //MODULES_SOFT_I2C_H_ 46 | -------------------------------------------------------------------------------- /Marlin/src/module/laser_hw_version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Snapmaker2-Modules Firmware 3 | * Copyright (C) 2019-2020 Snapmaker [https://github.com/Snapmaker] 4 | * 5 | * This file is part of Snapmaker2-Modules 6 | * (see https://github.com/Snapmaker/Snapmaker2-Modules) 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #ifndef __LASER_HW_VERSION_H_ 23 | #define __LASER_HW_VERSION_H_ 24 | 25 | #include 26 | 27 | typedef struct { 28 | uint8_t number; 29 | uint8_t index; 30 | uint16_t adc_value; 31 | } hw_version_t; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /Marlin/src/module/module_base.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Snapmaker2-Modules Firmware 3 | * Copyright (C) 2019-2020 Snapmaker [https://github.com/Snapmaker] 4 | * 5 | * This file is part of Snapmaker2-Modules 6 | * (see https://github.com/Snapmaker/Snapmaker2-Modules) 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #ifndef SNAPMAKERMODULES_MARLIN_SRC_MODULE_MODULE_BASE_H_ 23 | #define SNAPMAKERMODULES_MARLIN_SRC_MODULE_MODULE_BASE_H_ 24 | 25 | class ModuleBase { 26 | public: 27 | virtual void Init() {}; 28 | virtual void Loop() {}; 29 | virtual void HandModule(uint16_t func_id, uint8_t * data, uint8_t data_len) {}; 30 | virtual void EmergencyStop() {}; 31 | }; 32 | 33 | #endif //SNAPMAKERMODULES_MARLIN_SRC_MODULE_MODULE_BASE_H_ 34 | -------------------------------------------------------------------------------- /Marlin/src/module/rotate_module.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Snapmaker2-Modules Firmware 3 | * Copyright (C) 2019-2020 Snapmaker [https://github.com/Snapmaker] 4 | * 5 | * This file is part of Snapmaker2-Modules 6 | * (see https://github.com/Snapmaker/Snapmaker2-Modules) 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | #include "board/board.h" 22 | #include "rotate_module.h" 23 | #include "src/configuration.h" 24 | 25 | void RotateModule::Init() { 26 | } 27 | 28 | void RotateModule::HandModule(uint16_t func_id, uint8_t * data, uint8_t data_len) { 29 | } 30 | 31 | void RotateModule::Loop() { 32 | } 33 | -------------------------------------------------------------------------------- /Marlin/src/module/rotate_module.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Snapmaker2-Modules Firmware 3 | * Copyright (C) 2019-2020 Snapmaker [https://github.com/Snapmaker] 4 | * 5 | * This file is part of Snapmaker2-Modules 6 | * (see https://github.com/Snapmaker/Snapmaker2-Modules) 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | #ifndef SNAPMAKERMODULES_MARLIN_SRC_MODULE_ROTATE_MODULE_H_ 22 | #define SNAPMAKERMODULES_MARLIN_SRC_MODULE_ROTATE_MODULE_H_ 23 | 24 | #include "src/device/switch.h" 25 | #include "src/configuration.h" 26 | #include "module_base.h" 27 | 28 | class RotateModule : public ModuleBase { 29 | 30 | public: 31 | void Init(); 32 | void HandModule(uint16_t func_id, uint8_t * data, uint8_t data_len); 33 | void Loop(); 34 | }; 35 | 36 | #endif //SNAPMAKERMODULES_MARLIN_SRC_MODULE_ROTATE_MODULE_H_ 37 | -------------------------------------------------------------------------------- /Marlin/src/registry/context.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Snapmaker2-Modules Firmware 3 | * Copyright (C) 2019-2020 Snapmaker [https://github.com/Snapmaker] 4 | * 5 | * This file is part of Snapmaker2-Modules 6 | * (see https://github.com/Snapmaker/Snapmaker2-Modules) 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #include "context.h" 23 | 24 | Context contextInstance; -------------------------------------------------------------------------------- /Marlin/src/utils/RingBuffer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Snapmaker2-Modules Firmware 3 | * Copyright (C) 2019-2020 Snapmaker [https://github.com/Snapmaker] 4 | * 5 | * This file is part of Snapmaker2-Modules 6 | * (see https://github.com/Snapmaker/Snapmaker2-Modules) 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #include "RingBuffer.h" 23 | 24 | -------------------------------------------------------------------------------- /Marlin/test/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for PIO Unit Testing and project tests. 3 | 4 | Unit Testing is a software testing method by which individual units of 5 | source code, sets of one or more MCU program modules together with associated 6 | control data, usage procedures, and operating procedures, are tested to 7 | determine whether they are fit for use. Unit testing finds problems early 8 | in the development cycle. 9 | 10 | More information about PIO Unit Testing: 11 | - https://docs.platformio.org/page/plus/unit-testing.html 12 | -------------------------------------------------------------------------------- /buildroot/share/PlatformIO/boards/snapmaker1_v1.json: -------------------------------------------------------------------------------- 1 | { 2 | "build": { 3 | "core": "maple", 4 | "cpu": "cortex-m3", 5 | "extra_flags": "-DSTM32F105xC", 6 | "f_cpu": "72000000L", 7 | "hwids": [ 8 | [ 9 | "0x1EAF", 10 | "0x0003" 11 | ], 12 | [ 13 | "0x1EAF", 14 | "0x0004" 15 | ] 16 | ], 17 | "ldscript": "gd32f105rc.ld", 18 | "mcu": "gd32f105rct6", 19 | "variant": "gd32f1" 20 | }, 21 | "debug": { 22 | "jlink_device": "STM32F105RC", 23 | "openocd_target": "stm32f1x", 24 | "svd_path": "STM32F105xx.svd" 25 | }, 26 | "frameworks": [ 27 | "arduino", 28 | "libopencm3", 29 | "stm32cube" 30 | ], 31 | "name": "Snapmaker1 v1 (96k RAM. 256k Flash)", 32 | "upload": { 33 | "disable_flushing": false, 34 | "maximum_ram_size": 98304, 35 | "maximum_size": 200704, 36 | "protocol": "jlink", 37 | "protocols": [ 38 | "jlink", 39 | "stlink", 40 | "blackmagic", 41 | "serial", 42 | "dfu" 43 | ], 44 | "require_upload_port": true, 45 | "use_1200bps_touch": false, 46 | "wait_for_upload_port": false 47 | }, 48 | "url": "http://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit-arm-cortex-mcus/stm32f1-series/stm32f103/stm32f103rc.html", 49 | "vendor": "Generic" 50 | } 51 | -------------------------------------------------------------------------------- /buildroot/share/PlatformIO/boards/snapmaker_module_app.json: -------------------------------------------------------------------------------- 1 | { 2 | "build": { 3 | "core": "maple", 4 | "cpu": "cortex-m3", 5 | "extra_flags": "-DSTM32F103xB", 6 | "f_cpu": "72000000L", 7 | "module": "app", 8 | "vect_table_addr": "0x8005C00", 9 | "hwids": [ 10 | [ 11 | "0x1EAF", 12 | "0x0003" 13 | ], 14 | [ 15 | "0x1EAF", 16 | "0x0004" 17 | ] 18 | ], 19 | "ldscript": "stm32f103xb.ld", 20 | "mcu": "stm32f103tbt6", 21 | "variant": "stm32f1" 22 | }, 23 | "debug": { 24 | "jlink_device": "STM32F103TB", 25 | "openocd_target": "stm32f1x", 26 | "svd_path": "STM32F103xx.svd" 27 | }, 28 | "frameworks": [ 29 | "arduino", 30 | "libopencm3", 31 | "stm32cube" 32 | ], 33 | "name": "STM32F103TB (20k RAM. 128k Flash)", 34 | "upload": { 35 | "disable_flushing": false, 36 | "maximum_ram_size": 20480, 37 | "maximum_size": 131072, 38 | "protocol": "jlink", 39 | "protocols": [ 40 | "jlink", 41 | "stlink", 42 | "blackmagic", 43 | "serial", 44 | "dfu" 45 | ], 46 | "require_upload_port": true, 47 | "use_1200bps_touch": false, 48 | "wait_for_upload_port": false 49 | }, 50 | "url": "http://www.st.com/en/microcontrollers/stm32f103tb.html", 51 | "vendor": "Generic" 52 | } 53 | -------------------------------------------------------------------------------- /platformio.ini: -------------------------------------------------------------------------------- 1 | # 2 | # Marlin Firmware 3 | # PlatformIO Configuration File 4 | # 5 | # For detailed documentation with EXAMPLES: 6 | # 7 | # http://docs.platformio.org/en/latest/projectconf.html 8 | # 9 | 10 | # Automatic targets - enable auto-uploading 11 | # targets = upload 12 | 13 | # 14 | # By default platformio build will abort after 5 errors. 15 | # Remove '-fmax-errors=5' from build_flags below to see all. 16 | # 17 | 18 | [platformio] 19 | src_dir = Marlin 20 | build_dir = .pioenvs 21 | lib_dir = .piolib 22 | libdeps_dir = .piolibdeps 23 | boards_dir = buildroot/share/PlatformIO/boards 24 | ;env_default = GD32F105 25 | env_default = genericSTM32F103TB 26 | 27 | [common] 28 | default_src_filter = + 29 | build_flags = -fmax-errors=5 30 | -g 31 | -ggdb3 32 | lib_deps = 33 | 34 | 35 | 36 | 37 | [env:genericSTM32F103TB] 38 | platform = ststm32 39 | board = snapmaker_module_app 40 | ;board = genericSTM32F103TB 41 | framework = arduino 42 | extra_scripts = 43 | snapmaker/scripts/platformio-targets.py 44 | pre:snapmaker/scripts/prepare-build.py 45 | post:snapmaker/scripts/prepare-upload.py 46 | post:snapmaker/scripts/cat_env.py 47 | build_flags = !python Marlin/src/flag_script.py 48 | ${common.build_flags} -std=gnu++14 49 | -DXTAL8M 50 | monitor_speed = 115200 51 | debug_tool = jlink 52 | build_type = debug 53 | -------------------------------------------------------------------------------- /snapmaker/docs/LICENSE.tmpl: -------------------------------------------------------------------------------- 1 | Snapmaker2-Modules Firmware 2 | Copyright (C) 2019-2020 Snapmaker [https://github.com/Snapmaker] 3 | 4 | This file is part of Snapmaker2-Modules 5 | (see https://github.com/Snapmaker/Snapmaker2-Modules) 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | -------------------------------------------------------------------------------- /snapmaker/docs/figures/fig-vscode-bar-platformio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snapmaker/Snapmaker2-Modules/a2fefd5c127ecf9e4158c594ab6ff1e874c32a07/snapmaker/docs/figures/fig-vscode-bar-platformio.png -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/cores/maple/Server.h: -------------------------------------------------------------------------------- 1 | /* 2 | Server.h - Base class that provides Server 3 | Copyright (c) 2011 Adrian McEwen. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef server_h 21 | #define server_h 22 | 23 | #include "Print.h" 24 | 25 | class Server : public Print { 26 | public: 27 | virtual void begin() =0; 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/cores/maple/avr/dtostrf.c: -------------------------------------------------------------------------------- 1 | /* 2 | dtostrf - Emulation for dtostrf function from avr-libc 3 | Copyright (c) 2013 Arduino. All rights reserved. 4 | Written by Cristian Maglie 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include 22 | 23 | char *dtostrf (double val, signed char width, unsigned char prec, char *sout) { 24 | char fmt[20]; 25 | sprintf(fmt, "%%%d.%df", width, prec); 26 | sprintf(sout, fmt, val); 27 | return sout; 28 | } 29 | 30 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/cores/maple/avr/dtostrf.h: -------------------------------------------------------------------------------- 1 | /* 2 | dtostrf - Emulation for dtostrf function from avr-libc 3 | Copyright (c) 2013 Arduino. All rights reserved. 4 | Written by Cristian Maglie 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | char *dtostrf (double val, signed char width, unsigned char prec, char *sout); 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/cores/maple/avr/interrupt.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snapmaker/Snapmaker2-Modules/a2fefd5c127ecf9e4158c594ab6ff1e874c32a07/snapmaker/lib/STM32F1/cores/maple/avr/interrupt.h -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/cores/maple/cxxabi-compat.cpp: -------------------------------------------------------------------------------- 1 | /* We compile with nodefaultlibs, so we need to provide an error 2 | * handler for an empty pure virtual function */ 3 | extern "C" void __cxa_pure_virtual(void) { 4 | while(1) 5 | ; 6 | } 7 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/cores/maple/hooks.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2012 Arduino. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | /** 20 | * Empty yield() hook. 21 | * 22 | * This function is intended to be used by library writers to build 23 | * libraries or sketches that supports cooperative threads. 24 | * 25 | * Its defined as a weak symbol and it can be redefined to implement a 26 | * real cooperative scheduler. 27 | */ 28 | static void __empty() { 29 | // Empty 30 | } 31 | void yield(void) __attribute__ ((weak, alias("__empty"))); 32 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/cores/maple/libmaple/usb/rules.mk: -------------------------------------------------------------------------------- 1 | # Standard things 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | BUILDDIRS += $(BUILD_PATH)/$(d) 6 | 7 | # Local flags 8 | CFLAGS_$(d) = -I$(d) -I$(d)/$(MCU_SERIES) -I$(d)/usb_lib $(LIBMAPLE_INCLUDES) $(LIBMAPLE_PRIVATE_INCLUDES) -Wall 9 | 10 | # Add usblib and series subdirectory to BUILDDIRS. 11 | BUILDDIRS += $(BUILD_PATH)/$(d)/$(MCU_SERIES) 12 | BUILDDIRS += $(BUILD_PATH)/$(d)/usb_lib 13 | 14 | # Local rules and targets 15 | sSRCS_$(d) := 16 | cSRCS_$(d) := 17 | # We currently only have F1 performance line support. Sigh. 18 | ifeq ($(MCU_SERIES), stm32f1) 19 | ifeq ($(MCU_F1_LINE), performance) 20 | cSRCS_$(d) += $(MCU_SERIES)/usb.c 21 | cSRCS_$(d) += $(MCU_SERIES)/usb_reg_map.c 22 | cSRCS_$(d) += $(MCU_SERIES)/usb_cdcacm.c 23 | cSRCS_$(d) += usb_lib/usb_core.c 24 | cSRCS_$(d) += usb_lib/usb_init.c 25 | cSRCS_$(d) += usb_lib/usb_mem.c 26 | cSRCS_$(d) += usb_lib/usb_regs.c 27 | endif 28 | endif 29 | 30 | sFILES_$(d) := $(sSRCS_$(d):%=$(d)/%) 31 | cFILES_$(d) := $(cSRCS_$(d):%=$(d)/%) 32 | 33 | OBJS_$(d) := $(sFILES_$(d):%.S=$(BUILD_PATH)/%.o) \ 34 | $(cFILES_$(d):%.c=$(BUILD_PATH)/%.o) 35 | DEPS_$(d) := $(OBJS_$(d):%.o=%.d) 36 | 37 | $(OBJS_$(d)): TGT_CFLAGS := $(CFLAGS_$(d)) 38 | $(OBJS_$(d)): TGT_ASFLAGS := 39 | 40 | TGT_BIN += $(OBJS_$(d)) 41 | 42 | # Standard things 43 | -include $(DEPS_$(d)) 44 | d := $(dirstack_$(sp)) 45 | sp := $(basename $(sp)) 46 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/cores/maple/new.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #include 20 | 21 | void *operator new(size_t size) { 22 | return malloc(size); 23 | } 24 | 25 | void *operator new[](size_t size) { 26 | return malloc(size); 27 | } 28 | 29 | void operator delete(void * ptr) { 30 | free(ptr); 31 | } 32 | 33 | void operator delete[](void * ptr) { 34 | free(ptr); 35 | } 36 | 37 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/cores/maple/tone.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #pragma once 20 | 21 | #ifdef __cplusplus 22 | 23 | #include "Arduino.h" 24 | 25 | void tone(uint32_t _pin, uint32_t frequency, uint32_t duration = 0); 26 | void noTone(uint32_t _pin); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/cores/maple/wiring_private.h: -------------------------------------------------------------------------------- 1 | #ifndef WiringPrivate_h 2 | #define WiringPrivate_h 3 | 4 | #endif -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/cores/maple/wirish_constants.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIRING_CONSTANTS_ 2 | #define _WIRING_CONSTANTS_ 3 | 4 | #ifdef __cplusplus 5 | extern "C"{ 6 | #endif 7 | 8 | enum BitOrder { 9 | LSBFIRST = 0, 10 | MSBFIRST = 1 11 | }; 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/A_STM32_Examples/A_STM32_Examples.h: -------------------------------------------------------------------------------- 1 | #error *********** This is a dummy library, purely to make the STM32 examples easy to access. Do not include it ********* -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/A_STM32_Examples/examples/Analog/AnalogInSerial/AnalogInSerial.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Analog input, serial output 3 | 4 | Reads an analog input pin, prints the results to the serial monitor. 5 | 6 | The circuit: 7 | 8 | * Potentiometer connected to analog pin 15. 9 | * Center pin of the potentiometer goes to the analog pin. 10 | * Side pins of the potentiometer go to +3.3V (VCC) and ground 11 | 12 | created over and over again 13 | by Tom Igoe and everyone who's ever used Arduino 14 | 15 | Ported to Maple 27 May, 2010 by Bryan Newbold 16 | */ 17 | 18 | // Analog input pin. You may need to change this number if your board 19 | // can't do analog input on pin 15. 20 | const int analogInputPin = 15; 21 | 22 | void setup() { 23 | // Declare analogInputPin as INPUT_ANALOG: 24 | pinMode(analogInputPin, INPUT_ANALOG); 25 | Serial.begin(115200); // Ignored by Maple. But needed by boards using Hardware serial via a USB to Serial Adaptor 26 | } 27 | 28 | void loop() { 29 | // Read the analog input into a variable: 30 | int analogValue = analogRead(analogInputPin); 31 | 32 | // print the result: 33 | Serial.println(analogValue); 34 | } 35 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/A_STM32_Examples/examples/Analog/AnalogInput/AnalogInput.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Analog Input 3 | 4 | Demonstrates analog input by reading an analog sensor on analog pin 5 | 0 and turning on and off the Maple's built-in light emitting diode 6 | (LED). The amount of time the LED will be on and off depends on the 7 | value obtained by analogRead(). 8 | 9 | Created by David Cuartielles 10 | Modified 16 Jun 2009 11 | By Tom Igoe 12 | 13 | http://leaflabs.com/docs/adc.html 14 | 15 | Ported to Maple 27 May 2010 16 | by Bryan Newbold 17 | */ 18 | 19 | int sensorPin = 0; // Select the input pin for the potentiometer 20 | int sensorValue = 0; // Variable to store the value coming from the sensor 21 | 22 | void setup() { 23 | // Declare the sensorPin as INPUT_ANALOG: 24 | pinMode(sensorPin, INPUT_ANALOG); 25 | // Declare the LED's pin as an OUTPUT. (33 is a built-in 26 | // constant which is the pin number of the built-in LED. On the 27 | // Maple, it is 13.) 28 | pinMode(33, OUTPUT); 29 | } 30 | 31 | void loop() { 32 | // Read the value from the sensor: 33 | sensorValue = analogRead(sensorPin); 34 | // Turn the LED pin on: 35 | digitalWrite(33, HIGH); 36 | // Stop the program for milliseconds: 37 | delay(sensorValue); 38 | // Turn the LED pin off: 39 | digitalWrite(33, LOW); 40 | // Stop the program for for milliseconds: 41 | delay(sensorValue); 42 | } 43 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/A_STM32_Examples/examples/Analog/Fading/Fading.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Fading 3 | 4 | This example shows how to fade an LED using the pwmWrite() function. 5 | 6 | Created 1 Nov 2008 7 | By David A. Mellis 8 | Modified 17 June 2009 9 | By Tom Igoe 10 | 11 | Modified by LeafLabs for Maple 12 | 13 | http://arduino.cc/en/Tutorial/Fading 14 | 15 | For differences between Maple's pwmWrite() and Arduino's analogWrite(): 16 | http://leaflabs.com/docs/lang/api/analogwrite.html#arduino-compatibility 17 | */ 18 | 19 | int ledPin = 9; // Connect an LED to digital pin 9, or any other 20 | // PWM-capable pin 21 | 22 | void setup() { 23 | pinMode(ledPin, PWM); // setup the pin as PWM 24 | } 25 | 26 | void loop() { 27 | // Fade in from min to max in increments of 1280 points: 28 | for (int fadeValue = 0; fadeValue <= 65535; fadeValue += 1280) { 29 | // Sets the value (range from 0 to 65535): 30 | pwmWrite(ledPin, fadeValue); 31 | // Wait for 30 milliseconds to see the dimming effect: 32 | delay(30); 33 | } 34 | 35 | // Fade out from max to min in increments of 1280 points: 36 | for (int fadeValue = 65535 ; fadeValue >= 0; fadeValue -= 1280) { 37 | // Sets the value (range from 0 to 1280): 38 | pwmWrite(ledPin, fadeValue); 39 | // Wait for 30 milliseconds to see the dimming effect: 40 | delay(30); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/A_STM32_Examples/examples/Communication/SerialPassthrough/SerialPassthrough.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Multiple serial test 3 | 4 | Receives from Serial1, sends to Serial. 5 | 6 | The circuit: 7 | * Maple connected over Serial 8 | * Serial device (e.g. an Xbee radio, another Maple) 9 | 10 | created 30 Dec. 2008 11 | by Tom Igoe 12 | 13 | Ported to the Maple 27 May 2010 14 | by Bryan Newbold 15 | */ 16 | 17 | int inByte; // Byte read from Serial1 18 | 19 | void setup() { 20 | // Initialize Serial1 21 | Serial.begin(115200); // Ignored by Maple. But needed by boards using hardware serial via a USB to Serial adaptor 22 | Serial1.begin(115200); 23 | } 24 | 25 | void loop() { 26 | // Read from Serial1, send over USB on Maple (or uses hardware serial 1 and hardware serial 2 on non-maple boards: 27 | if (Serial1.available()) { 28 | inByte = Serial1.read(); 29 | Serial.write(inByte); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/A_STM32_Examples/examples/Control/ForLoopIteration/ForLoopIteration.ino: -------------------------------------------------------------------------------- 1 | /* 2 | for loop iteration 3 | 4 | Demonstrates the use of a for() loop. 5 | Lights multiple LEDs in sequence, then in reverse. 6 | 7 | The circuit: 8 | * LEDs from pins 2 through 7 to ground, through resistors 9 | 10 | created 2006 11 | by David A. Mellis 12 | modified 5 Jul 2009 13 | by Tom Igoe 14 | 15 | http://leaflabs.com/docs/lang/cpp/for.html 16 | 17 | Modified for Maple 18 | by LeafLabs 19 | */ 20 | 21 | int delayTime = 100; // The higher the number, the slower the timing. 22 | 23 | void setup() { 24 | // Use a for loop to initialize each pin as an output: 25 | for (int thisPin = 2; thisPin <= 7; thisPin++) { 26 | pinMode(thisPin, OUTPUT); 27 | } 28 | } 29 | 30 | void loop() { 31 | // Loop from the lowest pin to the highest: 32 | for (int thisPin = 2; thisPin <= 7; thisPin++) { 33 | // Turn the pin on: 34 | digitalWrite(thisPin, HIGH); 35 | delay(delayTime); 36 | // Turn the pin off: 37 | digitalWrite(thisPin, LOW); 38 | } 39 | 40 | // Loop from the highest pin to the lowest: 41 | for (int thisPin = 7; thisPin >= 2; thisPin--) { 42 | // Turn the pin on: 43 | digitalWrite(thisPin, HIGH); 44 | delay(delayTime); 45 | // Turn the pin off: 46 | digitalWrite(thisPin, LOW); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/A_STM32_Examples/examples/Digital/Blink/Blink.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Blink 3 | Turns on an LED on for one second, then off for one second, repeatedly. 4 | 5 | Most Arduinos have an on-board LED you can control. On the Uno and 6 | Leonardo, it is attached to digital pin 13. If you're unsure what 7 | pin the on-board LED is connected to on your Arduino model, check 8 | the documentation at http://arduino.cc 9 | 10 | This example code is in the public domain. 11 | 12 | modified 8 May 2014 13 | by Scott Fitzgerald 14 | 15 | Modified by Roger Clark. www.rogerclark.net for Maple mini 25th April 2015 , where the LED is on PB1 16 | 17 | */ 18 | 19 | 20 | // the setup function runs once when you press reset or power the board 21 | void setup() { 22 | // initialize digital pin PB1 as an output. 23 | pinMode(PB1, OUTPUT); 24 | } 25 | 26 | // the loop function runs over and over again forever 27 | void loop() { 28 | digitalWrite(PB1, HIGH); // turn the LED on (HIGH is the voltage level) 29 | delay(1000); // wait for a second 30 | digitalWrite(PB1, LOW); // turn the LED off by making the voltage LOW 31 | delay(1000); // wait for a second 32 | } 33 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/A_STM32_Examples/examples/Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Blink without delay 3 | 4 | Turns on and off the built-in light emitting diode (LED), without 5 | using the delay() function. This means that other code can run at 6 | the same time without being interrupted by the LED code. 7 | 8 | created 2005 9 | by David A. Mellis 10 | modified 17 Jun 2009 11 | by Tom Igoe 12 | modified for Maple 27 May 2011 13 | by Marti Bolivar 14 | */ 15 | 16 | // Variables: 17 | int previousMillis = 0; // will store the last time the LED was updated 18 | int interval = 1000; // interval at which to blink (in milliseconds) 19 | 20 | void setup() { 21 | // Set up the built-in LED pin as output: 22 | pinMode(33, OUTPUT); 23 | } 24 | 25 | void loop() { 26 | // Check to see if it's time to blink the LED; that is, if the 27 | // difference between the current time and last time we blinked 28 | // the LED is bigger than the interval at which we want to blink 29 | // the LED. 30 | if (millis() - previousMillis > interval) { 31 | // Save the last time you blinked the LED 32 | previousMillis = millis(); 33 | 34 | // If the LED is off, turn it on, and vice-versa: 35 | digitalWrite(33,!digitalRead(33));// Turn the LED from off to on, or on to off 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/A_STM32_Examples/examples/Digital/Button/Button.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Button 3 | 4 | Turns on and off the built-in LED when the built-in button is 5 | pressed. 6 | 7 | Ported to Maple from the Arduino example 27 May 2011 8 | by Marti Bolivar 9 | */ 10 | 11 | void setup() { 12 | // Initialize the built-in LED pin as an output: 13 | pinMode(33, OUTPUT); 14 | // Initialize the built-in button (labeled BUT) as an input: 15 | pinMode(BOARD_BUTTON_PIN, INPUT); 16 | } 17 | 18 | #define BUTTON_DEBOUNCE_DELAY 1 19 | uint8 isButtonPressed(uint8 pin=BOARD_BUTTON_PIN, 20 | uint32 pressedLevel=BOARD_BUTTON_PRESSED_LEVEL) { 21 | if (digitalRead(pin) == pressedLevel) { 22 | delay(BUTTON_DEBOUNCE_DELAY); 23 | while (digitalRead(pin) == pressedLevel) 24 | ; 25 | return true; 26 | } 27 | return false; 28 | } 29 | 30 | void loop() { 31 | // Check if the button is pressed. 32 | if (isButtonPressed()) { 33 | // If so, turn the LED from on to off, or from off to on: 34 | digitalWrite(33,!digitalRead(33));// Turn the LED from off to on, or on to off 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/A_STM32_Examples/examples/General/Blink/Blink.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Blink: Turns on the built-in LED on for one second, then off for one second, repeatedly. 3 | Arduino 1.6.0rc1 4 | Sketch uses 11,900 bytes (11%) of program storage space. Maximum is 108,000 bytes. 5 | Global variables use 2,592 bytes of dynamic memory. 6 | Ported to Maple from the Arduino example 27 May 2011 By Marti Bolivar 7 | */ 8 | 9 | void setup() { 10 | // Set up the built-in LED pin as an output: 11 | pinMode(33, OUTPUT); 12 | } 13 | 14 | void loop() { 15 | digitalWrite(33,!digitalRead(33));// Turn the LED from off to on, or on to off 16 | delay(1000); // Wait for 1 second (1000 milliseconds) 17 | } 18 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/A_STM32_Examples/examples/General/BlinkNcount/BlinkNcount.ino: -------------------------------------------------------------------------------- 1 | /* 2 | BlinkNcount for Maple Mini by m. ray burnette 3 | Sketch uses 13,808 bytes (12%) of program storage space. Maximum is 108,000 bytes. 4 | Global variables use 2,592 bytes of dynamic memory. 5 | Turns on an LED on for one second, then off for one second, repeatedly. 6 | Counts and displays the count on the attached serial monitor 7 | This example code is in the public domain. 8 | */ 9 | int n = 0; 10 | 11 | 12 | void setup() { 13 | // initialize the digital pin as an output. 14 | pinMode(LED_BUILTIN, OUTPUT); 15 | // Initialize virtual COM over USB on Maple Mini 16 | Serial.begin(9600); // BAUD has no effect on USB serial: placeholder for physical UART 17 | // wait for serial monitor to be connected. 18 | while (!Serial) 19 | { 20 | digitalWrite(LED_BUILTIN,!digitalRead(LED_BUILTIN)); // Turn the LED from off to on, or on to off 21 | delay(100); // fast blink 22 | } 23 | Serial.println("Blink LED & count Demo"); 24 | } 25 | 26 | void loop() { 27 | digitalWrite(LED_BUILTIN, HIGH); // set the LED on 28 | delay(500); // wait for a second 29 | digitalWrite(LED_BUILTIN, LOW); // set the LED off 30 | Serial.print("Loop #: "); 31 | n++; 32 | Serial.println(n); 33 | 34 | delay(500); // wait 35 | } 36 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/A_STM32_Examples/examples/General/FadingOnboard/FadingOnboard.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Fading: This example shows how to fade an LED using the pwmWrite() function. 3 | 4 | Created 1 Nov 2008 5 | By David A. Mellis 6 | Modified 17 June 2009 7 | By Tom Igoe 8 | 9 | Modified by LeafLabs for Maple http://arduino.cc/en/Tutorial/Fading 10 | 11 | For differences between Maple's pwmWrite() and Arduino's analogWrite(): 12 | http://leaflabs.com/docs/lang/api/analogwrite.html 13 | */ 14 | 15 | // int ledPin = 9; // Connect an LED to digital pin 9, or any other 16 | // PWM-capable pin 17 | int ledPin = 33; 18 | void setup() { 19 | pinMode(ledPin, PWM); // setup the pin as PWM 20 | } 21 | 22 | void loop() { 23 | // Fade in from min to max in increments of 1280 points: 24 | for (int fadeValue = 0; fadeValue <= 65535; fadeValue += 1280) { 25 | // Sets the value (range from 0 to 65535): 26 | pwmWrite(ledPin, fadeValue); 27 | // Wait for 30 milliseconds to see the dimming effect: 28 | delay(30); 29 | } 30 | 31 | // Fade out from max to min in increments of 1280 points: 32 | for (int fadeValue = 65535 ; fadeValue >= 0; fadeValue -= 1280) { 33 | // Sets the value (range from 0 to 1280): 34 | pwmWrite(ledPin, fadeValue); 35 | // Wait for 30 milliseconds to see the dimming effect: 36 | delay(30); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/A_STM32_Examples/examples/General/IntegerInput/IntegerInput.ino: -------------------------------------------------------------------------------- 1 | /* 2 | IntegerInput by m. Ray Burnette - PUBLIC DOMAIN EXAMPLE 3 | Maple Mini: Compiled under Arduino 1.6.0rc1 4 | Sketch uses 15,624 bytes (14%) of program storage space. Maximum is 108,000 bytes. 5 | Global variables use 3,704 bytes of dynamic memory. 6 | */ 7 | 8 | #define BAUD 9600 9 | #define timeoutPeriod 2147483647 // Long time... about 25 days 10 | 11 | int a; 12 | int b; 13 | 14 | void setup() 15 | { 16 | // initialize the digital pin as an output. 17 | pinMode(33, OUTPUT); 18 | Serial.begin(BAUD); // BAUD has no effect on USB serial: placeholder for physical UART 19 | Serial.setTimeout(timeoutPeriod); // default is 1 second 20 | // wait for serial monitor to be connected. 21 | while (!Serial) 22 | { 23 | digitalWrite(33,!digitalRead(33));// Turn the LED from off to on, or on to off 24 | delay(100); // fast blink 25 | } 26 | } 27 | 28 | void loop() 29 | { 30 | Serial.println("Enter first integer: "); 31 | a = Serial.parseInt(); 32 | Serial.print("a = "); 33 | Serial.println(a); 34 | 35 | 36 | Serial.println("Enter second integer: "); 37 | b = Serial.parseInt(); 38 | Serial.print("b = "); 39 | Serial.println(b); 40 | 41 | Serial.print("Sum a + b ="); 42 | Serial.println( a + b); 43 | Serial.print("Dif a - b ="); 44 | Serial.println(a - b); 45 | } 46 | 47 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/A_STM32_Examples/examples/General/SerialReadUntil/SerialReadUntil.ino: -------------------------------------------------------------------------------- 1 | 2 | // http://arduino.cc/forum/index.php?topic=114035.0 ` 3 | /* Sketch uses 13,836 bytes (12%) of program storage space. Maximum is 108,000 bytes. 4 | Global variables use 3,696 bytes of dynamic memory. 5 | Read an unknown length string of ASCII characters terminated 6 | with a line feed from the UART 7 | */ 8 | 9 | #define BAUD 9600 10 | 11 | void setup() { 12 | // initialize the digital pin as an output. 13 | pinMode(33, OUTPUT); 14 | Serial.begin(BAUD); // BAUD has no effect on USB serial: placeholder for physical UAR 15 | // wait for serial monitor to be connected. 16 | while (!Serial) 17 | { 18 | digitalWrite(33,!digitalRead(33));// Turn the LED from off to on, or on to off 19 | delay(100); // fast blink 20 | } 21 | Serial.println("Serial Read Until Example:"); 22 | Serial.print("Type a few characters & press ENTER\r\n(make certain serial monitor sends CR+LF)"); 23 | } 24 | 25 | void loop() { 26 | char serialdata[80]; 27 | int lf = 10; 28 | 29 | Serial.readBytesUntil(lf, serialdata, 80); 30 | 31 | Serial.println(serialdata); 32 | 33 | } 34 | 35 | 36 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/A_STM32_Examples/examples/Stubs/AnalogReadPWMWrite/AnalogReadPWMWrite.ino: -------------------------------------------------------------------------------- 1 | void setup() { 2 | pinMode(2, INPUT_ANALOG); 3 | pinMode(6, PWM); 4 | } 5 | 6 | void loop() { 7 | int sensorValue = analogRead(2); 8 | int ledFadeValue = map(sensorValue, 0, 4095, 0, 65535); 9 | pwmWrite(6, ledFadeValue); 10 | } 11 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/A_STM32_Examples/examples/Stubs/AnalogReadSerial/AnalogReadSerial.ino: -------------------------------------------------------------------------------- 1 | void setup() { 2 | Serial.begin(115200); // Ignored by Maple. But needed by boards using hardware serial via a USB to Serial adaptor 3 | pinMode(0, INPUT_ANALOG); 4 | } 5 | 6 | void loop() { 7 | int sensorValue = analogRead(0); 8 | Serial.println(sensorValue, DEC); 9 | } 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/A_STM32_Examples/examples/Stubs/BareMinumum/BareMinumum.ino: -------------------------------------------------------------------------------- 1 | void setup() { 2 | 3 | } 4 | 5 | void loop() { 6 | 7 | } 8 | 9 | 10 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/A_STM32_Examples/examples/Stubs/DigitalReadSerial/DigitalReadSerial.ino: -------------------------------------------------------------------------------- 1 | void setup() { 2 | Serial.begin(115200); // Ignored by Maple. But needed by boards using hardware serial via a USB to Serial adaptor 3 | pinMode(2, INPUT); 4 | } 5 | 6 | void loop() { 7 | int sensorValue = digitalRead(2); 8 | Serial.println(sensorValue, DEC); 9 | } 10 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/A_STM32_Examples/examples/Stubs/DigitalReadWrite/DigitalReadWrite.ino: -------------------------------------------------------------------------------- 1 | 2 | void setup() { 3 | pinMode(33, OUTPUT); 4 | } 5 | 6 | void loop() { 7 | int switchValue = digitalRead(2); 8 | digitalWrite(33, switchValue); 9 | } 10 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/A_STM32_Examples/examples/Stubs/HelloWorld/HelloWorld.ino: -------------------------------------------------------------------------------- 1 | void setup() { 2 | Serial.begin(115200); // Ignored by Maple. But needed by boards using hardware serial via a USB to Serial adaptor 3 | } 4 | 5 | void loop() { 6 | Serial.println("Hello World!"); 7 | delay(1000); 8 | } 9 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/A_STM32_Examples/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | ####################################### 10 | # Constants (LITERAL1) 11 | ####################################### 12 | 13 | OUTPUT_OPEN_DRAIN LITERAL1 14 | INPUT_ANALOG LITERAL1 15 | INPUT_PULLDOWN LITERAL1 16 | PWM LITERAL1 -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/A_STM32_Examples/library.properties: -------------------------------------------------------------------------------- 1 | name=A_STM32_Examples 2 | version=1.0 3 | author=Various 4 | email= 5 | sentence=STM32 examples 6 | paragraph=STM32 examples 7 | url=www.stm32duino.com 8 | architectures=STM32F1 9 | maintainer= 10 | category=Uncategorized 11 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Adafruit_GFX_AS/Adafruit_GFX_AS.h: -------------------------------------------------------------------------------- 1 | #ifndef _ADAFRUIT_GFX_AS_H 2 | #define _ADAFRUIT_GFX_AS_H 3 | 4 | #include "Load_fonts.h" 5 | 6 | #include 7 | 8 | #define swap(a, b) { int16_t t = a; a = b; b = t; } 9 | 10 | /** This class provides a few extensions to Adafruit_GFX, mostly for compatibility with 11 | * existing code. Note that the fonts ("size" parameter) are not the same ones use as the 12 | * ones provided by Adafruit_GFX. Using any of the functions defined in this class will 13 | * therefore pull additional font tables into flash. If that is an issue, try to stick 14 | * to the base class, or trim down the fonts loaded in Load_fonts.h . */ 15 | class Adafruit_GFX_AS : public Adafruit_GFX { 16 | public: 17 | Adafruit_GFX_AS(int16_t w, int16_t h); // Constructor 18 | int16_t drawUnicode(uint16_t uniCode, int16_t x, int16_t y, int16_t size); 19 | int16_t drawNumber(long long_num,int16_t poX, int16_t poY, int16_t size); 20 | int16_t drawChar(char c, int16_t x, int16_t y, int16_t size); 21 | int16_t drawString(char *string, int16_t poX, int16_t poY, int16_t size); 22 | int16_t drawCentreString(char *string, int16_t dX, int16_t poY, int16_t size); 23 | int16_t drawRightString(char *string, int16_t dX, int16_t poY, int16_t size); 24 | int16_t drawFloat(float floatNumber,int16_t decimal,int16_t poX, int16_t poY, int16_t size); 25 | }; 26 | 27 | #endif // _ADAFRUIT_GFX_AS_H 28 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Adafruit_GFX_AS/Font16.h: -------------------------------------------------------------------------------- 1 | #define nr_chrs_f16 96 2 | #define chr_hgt_f16 16 3 | #define data_size_f16 8 4 | #define firstchr_f16 32 5 | 6 | extern const unsigned char widtbl_f16[96]; 7 | extern const unsigned char* const chrtbl_f16[96]; 8 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Adafruit_GFX_AS/Font32.h: -------------------------------------------------------------------------------- 1 | #define nr_chrs_f32 96 2 | #define chr_hgt_f32 26 3 | #define data_size_f32 8 4 | #define firstchr_f32 32 5 | 6 | extern const unsigned char widtbl_f32[96]; 7 | extern const unsigned char* const chrtbl_f32[96]; 8 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Adafruit_GFX_AS/Font64.h: -------------------------------------------------------------------------------- 1 | #define nr_chrs_f64 96 2 | #define chr_hgt_f64 48 3 | #define data_size_f64 8 4 | #define firstchr_f64 32 5 | 6 | extern const unsigned char widtbl_f64[96]; 7 | extern const unsigned char* const chrtbl_f64[96]; 8 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Adafruit_GFX_AS/Font7s.h: -------------------------------------------------------------------------------- 1 | #define nr_chrs_f7s 96 2 | #define chr_hgt_f7s 48 3 | #define data_size_f7s 8 4 | #define firstchr_f7s 32 5 | 6 | extern const unsigned char widtbl_f7s[96]; 7 | extern const unsigned char* const chrtbl_f7s[96]; 8 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Adafruit_GFX_AS/Load_fonts.h: -------------------------------------------------------------------------------- 1 | // Comment out the #defines below with // to stop that font being loaded 2 | // If all fonts are loaded the total space required is ablout 17890 bytes 3 | 4 | #define LOAD_GLCD // Standard Adafruit font needs ~1792 bytes in FLASH 5 | 6 | #define LOAD_FONT2 // Small font, needs ~3092 bytes in FLASH 7 | #define LOAD_FONT4 // Medium font, needs ~8126 bytes in FLASH 8 | #define LOAD_FONT6 // Large font, needs ~4404 bytes in FLASH 9 | #define LOAD_FONT7 // 7 segment font, needs ~3652 bytes in FLASH 10 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Adafruit_GFX_AS/license.txt: -------------------------------------------------------------------------------- 1 | Software License Agreement (BSD License) 2 | 3 | Copyright (c) 2012 Adafruit Industries. All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | - Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | - Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Adafruit_ILI9341_STM/README.txt: -------------------------------------------------------------------------------- 1 | It has minor modifications to support STM32. It has been tested with the Maple Mini. 2 | Further modifications to support DMA transfers in the STM32F1xx by Victor Perez 3/17/2015 3 | 4 | This is a library for the Adafruit ILI9341 display products 5 | 6 | This library works with the Adafruit 2.8" Touch Shield V2 (SPI) 7 | ----> http://www.adafruit.com/products/1651 8 | 9 | Check out the links above for our tutorials and wiring diagrams. 10 | These displays use SPI to communicate, 4 or 5 pins are required 11 | to interface (RST is optional). 12 | 13 | Adafruit invests time and resources providing this open source code, 14 | please support Adafruit and open-source hardware by purchasing 15 | products from Adafruit! 16 | 17 | Written by Limor Fried/Ladyada for Adafruit Industries. 18 | MIT license, all text above must be included in any redistribution 19 | 20 | To download. click the DOWNLOADS button in the top right corner, rename the uncompressed folder Adafruit_ILI9341. Check that the Adafruit_ILI9341 folder contains Adafruit_ILI9341.cpp and Adafruit_ILI9341. 21 | 22 | Place the Adafruit_ILI9341 library folder your arduinosketchfolder/libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE 23 | 24 | Also requires the Adafruit_GFX library for Arduino. 25 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Adafruit_SSD1306/README.txt: -------------------------------------------------------------------------------- 1 | This is a library for our Monochrome OLEDs based on SSD1306 drivers 2 | 3 | Pick one up today in the adafruit shop! 4 | ------> http://www.adafruit.com/category/63_98 5 | 6 | These displays use SPI to communicate, 4 or 5 pins are required to 7 | interface 8 | 9 | Adafruit invests time and resources providing this open source code, 10 | please support Adafruit and open-source hardware by purchasing 11 | products from Adafruit! 12 | 13 | Written by Limor Fried/Ladyada for Adafruit Industries. 14 | Scrolling code contributed by Michael Gregg 15 | BSD license, check license.txt for more information 16 | All text above must be included in any redistribution 17 | 18 | To download. click the DOWNLOADS button in the top right corner, rename the uncompressed folder Adafruit_SSD1306. Check that the Adafruit_SSD1306 folder contains Adafruit_SSD1306.cpp and Adafruit_SSD1306.h 19 | 20 | Place the Adafruit_SSD1306 library folder your /libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE. 21 | 22 | You will also have to download the Adafruit GFX Graphics core which does all the circles, text, rectangles, etc. You can get it from 23 | https://github.com/adafruit/Adafruit-GFX-Library 24 | and download/install that library as well -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Adafruit_SSD1306/STM32 README.txt: -------------------------------------------------------------------------------- 1 | STM32 adaption by Matthias Diro, 25.03.2015 2 | Things to know: 3 | This adaption uses hardware I2C (now Wire.h), Port: I2c2. SDA=0, SCL=1 on maple mini 4 | To change it to Port I2C1: 5 | //TwoWire WIRE(1,I2C_FAST_MODE); // I2c1 6 | TwoWire WIRE(2,I2C_FAST_MODE); // I2c2 -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/EEPROM/flash_stm32.h: -------------------------------------------------------------------------------- 1 | #ifndef __FLASH_STM32_H 2 | #define __FLASH_STM32_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | typedef enum 9 | { 10 | FLASH_BUSY = 1, 11 | FLASH_ERROR_PG, 12 | FLASH_ERROR_WRP, 13 | FLASH_ERROR_OPT, 14 | FLASH_COMPLETE, 15 | FLASH_TIMEOUT, 16 | FLASH_BAD_ADDRESS 17 | } FLASH_Status; 18 | 19 | #define IS_FLASH_ADDRESS(ADDRESS) (((ADDRESS) >= 0x08000000) && ((ADDRESS) < 0x0807FFFF)) 20 | 21 | FLASH_Status FLASH_WaitForLastOperation(uint32_t Timeout); 22 | FLASH_Status FLASH_ErasePage(uint32_t Page_Address); 23 | FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint32_t Data); 24 | 25 | void FLASH_Unlock(void); 26 | void FLASH_Lock(void); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif /* __FLASH_STM32_H */ 33 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/EEPROM/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For EEPROM 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | EEPROM KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | 15 | init KEYWORD2 16 | format KEYWORD2 17 | erases KEYWORD2 18 | read KEYWORD2 19 | write KEYWORD2 20 | 21 | ####################################### 22 | # Constants (LITERAL1) 23 | ####################################### 24 | PageBase0 25 | PageBase1 26 | PageSize 27 | Status 28 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Ethernet_STM/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For Ethernet 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | Ethernet KEYWORD1 Ethernet 10 | EthernetClient KEYWORD1 EthernetClient 11 | EthernetServer KEYWORD1 EthernetServer 12 | IPAddress KEYWORD1 EthernetIPAddress 13 | 14 | ####################################### 15 | # Methods and Functions (KEYWORD2) 16 | ####################################### 17 | 18 | status KEYWORD2 19 | connect KEYWORD2 20 | write KEYWORD2 21 | available KEYWORD2 22 | read KEYWORD2 23 | peek KEYWORD2 24 | flush KEYWORD2 25 | stop KEYWORD2 26 | connected KEYWORD2 27 | begin KEYWORD2 28 | beginPacket KEYWORD2 29 | endPacket KEYWORD2 30 | parsePacket KEYWORD2 31 | remoteIP KEYWORD2 32 | remotePort KEYWORD2 33 | 34 | ####################################### 35 | # Constants (LITERAL1) 36 | ####################################### 37 | 38 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Ethernet_STM/library.properties: -------------------------------------------------------------------------------- 1 | name=Ethernet_STM 2 | version=1.0.3 3 | author=WIZnet :: Ported to STM32 by Vassilis Serasidis. 4 | maintainer=WIZnet and Vassilis Serasidis (for porting to STM32) 5 | sentence=Enables network connection (local and Internet) using the Arduino Ethernet board or shield. For all Arduino boards. 6 | paragraph=With this library you can use the Arduino Ethernet (shield or board) to connect to Internet. The library provides both Client and server functionalities. The library permits you to connect to a local network also with DHCP and to resolve DNS. 7 | category=Communication 8 | url=http://arduino.cc/en/Reference/Ethernet 9 | architectures=* -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Ethernet_STM/pictures/w5100_module1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snapmaker/Snapmaker2-Modules/a2fefd5c127ecf9e4158c594ab6ff1e874c32a07/snapmaker/lib/STM32F1/libraries/Ethernet_STM/pictures/w5100_module1.jpg -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Ethernet_STM/pictures/w5100_module2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snapmaker/Snapmaker2-Modules/a2fefd5c127ecf9e4158c594ab6ff1e874c32a07/snapmaker/lib/STM32F1/libraries/Ethernet_STM/pictures/w5100_module2.jpg -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Ethernet_STM/pictures/w5100_shield.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snapmaker/Snapmaker2-Modules/a2fefd5c127ecf9e4158c594ab6ff1e874c32a07/snapmaker/lib/STM32F1/libraries/Ethernet_STM/pictures/w5100_shield.jpg -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Ethernet_STM/src/Dns.h: -------------------------------------------------------------------------------- 1 | // Arduino DNS client for WizNet5100-based Ethernet shield 2 | // (c) Copyright 2009-2010 MCQN Ltd. 3 | // Released under Apache License, version 2.0 4 | 5 | #ifndef DNSClient_h 6 | #define DNSClient_h 7 | 8 | #include 9 | 10 | class DNSClient 11 | { 12 | public: 13 | // ctor 14 | void begin(const IPAddress& aDNSServer); 15 | 16 | /** Convert a numeric IP address string into a four-byte IP address. 17 | @param aIPAddrString IP address to convert 18 | @param aResult IPAddress structure to store the returned IP address 19 | @result 1 if aIPAddrString was successfully converted to an IP address, 20 | else error code 21 | */ 22 | int inet_aton(const char *aIPAddrString, IPAddress& aResult); 23 | 24 | /** Resolve the given hostname to an IP address. 25 | @param aHostname Name to be resolved 26 | @param aResult IPAddress structure to store the returned IP address 27 | @result 1 if aIPAddrString was successfully converted to an IP address, 28 | else error code 29 | */ 30 | int getHostByName(const char* aHostname, IPAddress& aResult); 31 | 32 | protected: 33 | uint16_t BuildRequest(const char* aName); 34 | uint16_t ProcessResponse(uint16_t aTimeout, IPAddress& aAddress); 35 | 36 | IPAddress iDNSServer; 37 | uint16_t iRequestId; 38 | EthernetUDP iUdp; 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Ethernet_STM/src/EthernetClient.h: -------------------------------------------------------------------------------- 1 | #ifndef ethernetclient_h 2 | #define ethernetclient_h 3 | #include "Arduino.h" 4 | #include "Print.h" 5 | #include "Client.h" 6 | #include "IPAddress.h" 7 | 8 | class EthernetClient : public Client { 9 | 10 | public: 11 | EthernetClient(); 12 | EthernetClient(uint8_t sock); 13 | 14 | uint8_t status(); 15 | virtual int connect(IPAddress ip, uint16_t port); 16 | virtual int connect(const char *host, uint16_t port); 17 | virtual size_t write(uint8_t); 18 | virtual size_t write(const uint8_t *buf, size_t size); 19 | virtual int available(); 20 | virtual int read(); 21 | virtual int read(uint8_t *buf, size_t size); 22 | virtual int peek(); 23 | virtual void flush(); 24 | virtual void stop(); 25 | virtual uint8_t connected(); 26 | virtual operator bool(); 27 | virtual bool operator==(const EthernetClient&); 28 | virtual bool operator!=(const EthernetClient& rhs) { return !this->operator==(rhs); }; 29 | 30 | friend class EthernetServer; 31 | 32 | using Print::write; 33 | 34 | private: 35 | static uint16_t _srcport; 36 | uint8_t _sock; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Ethernet_STM/src/EthernetServer.h: -------------------------------------------------------------------------------- 1 | #ifndef ethernetserver_h 2 | #define ethernetserver_h 3 | 4 | #include "Server.h" 5 | 6 | class EthernetClient; 7 | 8 | class EthernetServer : 9 | public Server { 10 | private: 11 | uint16_t _port; 12 | void accept(); 13 | public: 14 | EthernetServer(uint16_t); 15 | EthernetClient available(); 16 | virtual void begin(); 17 | virtual size_t write(uint8_t); 18 | virtual size_t write(const uint8_t *buf, size_t size); 19 | using Print::write; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Ethernet_STM/src/Twitter.h: -------------------------------------------------------------------------------- 1 | /* 2 | Twitter.cpp - Arduino library to Post messages to Twitter using OAuth. 3 | Copyright (c) NeoCat 2010-2011. All right reserved. 4 | 5 | This library is distributed in the hope that it will be useful, 6 | but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | */ 9 | 10 | // ver1.2 - Use to support IDE 0019 or later 11 | // ver1.3 - Support IDE 1.0 12 | 13 | #ifndef TWITTER_H 14 | #define TWITTER_H 15 | 16 | #include 17 | #include 18 | #if defined(ARDUINO) && ARDUINO > 18 // Arduino 0019 or later 19 | #include 20 | #endif 21 | #include 22 | #if defined(ARDUINO) && ARDUINO < 100 // earlier than Arduino 1.0 23 | #include 24 | #endif 25 | 26 | class Twitter 27 | { 28 | private: 29 | uint8_t parseStatus; 30 | int statusCode; 31 | const char *token; 32 | #if defined(ARDUINO) && ARDUINO < 100 33 | Client client; 34 | #else 35 | EthernetClient client; 36 | #endif 37 | public: 38 | Twitter(const char *user_and_passwd); 39 | 40 | bool post(const char *msg); 41 | bool checkStatus(Print *debug = NULL); 42 | int wait(Print *debug = NULL); 43 | int status(void) { return statusCode; } 44 | }; 45 | 46 | #endif //TWITTER_H 47 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Ethernet_STM/src/util.h: -------------------------------------------------------------------------------- 1 | #ifndef UTIL_H 2 | #define UTIL_H 3 | 4 | #define htons(x) ( ((x)<<8) | (((x)>>8)&0xFF) ) 5 | #define ntohs(x) htons(x) 6 | 7 | #define htonl(x) ( ((x)<<24 & 0xFF000000UL) | \ 8 | ((x)<< 8 & 0x00FF0000UL) | \ 9 | ((x)>> 8 & 0x0000FF00UL) | \ 10 | ((x)>>24 & 0x000000FFUL) ) 11 | #define ntohl(x) htonl(x) 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Ethernet_STM/src/utility/util.h: -------------------------------------------------------------------------------- 1 | #ifndef UTIL_H 2 | #define UTIL_H 3 | 4 | #define htons(x) ( ((x)<< 8 & 0xFF00) | \ 5 | ((x)>> 8 & 0x00FF) ) 6 | #define ntohs(x) htons(x) 7 | 8 | #define htonl(x) ( ((x)<<24 & 0xFF000000UL) | \ 9 | ((x)<< 8 & 0x00FF0000UL) | \ 10 | ((x)>> 8 & 0x0000FF00UL) | \ 11 | ((x)>>24 & 0x000000FFUL) ) 12 | #define ntohl(x) htonl(x) 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/FreeRTOS701/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For CoOS 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | ####################################### 10 | # Methods and Functions (KEYWORD2) 11 | ####################################### 12 | vTaskDelay KEYWORD2 13 | vTaskDelayUntil KEYWORD2 14 | xTaskCreate KEYWORD2 15 | vTaskSuspend KEYWORD2 16 | vTaskDelete KEYWORD2 17 | vTaskPrioritySet KEYWORD2 18 | uxTaskPriorityGet KEYWORD2 19 | vTaskStartScheduler KEYWORD2 20 | vApplicationIdleHook KEYWORD2 21 | 22 | ####################################### 23 | # Constants (LITERAL1) 24 | ####################################### 25 | configUSE_IDLE_HOOK LITERAL1 26 | configMINIMAL_STACK_SIZE LITERAL1 27 | tskIDLE_PRIORITY LITERAL1 -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/FreeRTOS701/rules.mk: -------------------------------------------------------------------------------- 1 | # Standard things 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | BUILDDIRS += $(BUILD_PATH)/$(d) 6 | BUILDDIRS += $(BUILD_PATH)/$(d)/utility 7 | 8 | # Local flags 9 | CXXFLAGS_$(d) := $(WIRISH_INCLUDES) $(LIBMAPLE_INCLUDES) 10 | CFLAGS_$(d) := $(WIRISH_INCLUDES) $(LIBMAPLE_INCLUDES) 11 | 12 | # Local rules and targets 13 | cSRCS_$(d) := utility/croutine.c \ 14 | utility/heap_2.c \ 15 | utility/list.c \ 16 | utility/port.c \ 17 | utility/queue.c \ 18 | utility/timers.c \ 19 | utility/tasks.c \ 20 | 21 | cppSRCS_$(d) := MapleFreeRTOS.cpp 22 | 23 | cFILES_$(d) := $(cSRCS_$(d):%=$(d)/%) 24 | cppFILES_$(d) := $(cppSRCS_$(d):%=$(d)/%) 25 | 26 | OBJS_$(d) := $(cFILES_$(d):%.c=$(BUILD_PATH)/%.o) \ 27 | $(cppFILES_$(d):%.cpp=$(BUILD_PATH)/%.o) 28 | DEPS_$(d) := $(OBJS_$(d):%.o=%.d) 29 | 30 | $(OBJS_$(d)): TGT_CXXFLAGS := $(CXXFLAGS_$(d)) 31 | $(OBJS_$(d)): TGT_CFLAGS := $(CFLAGS_$(d)) 32 | 33 | TGT_BIN += $(OBJS_$(d)) 34 | 35 | # Standard things 36 | -include $(DEPS_$(d)) 37 | d := $(dirstack_$(sp)) 38 | sp := $(basename $(sp)) -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/FreeRTOS821/examples/rtos_blink/rtos_blink.ino: -------------------------------------------------------------------------------- 1 | //#include 2 | //#include "libraries/FreeRTOS/MapleFreeRTOS.h" 3 | #include 4 | 5 | static void vLEDFlashTask(void *pvParameters) { 6 | for (;;) { 7 | vTaskDelay(1000); 8 | digitalWrite(BOARD_LED_PIN, HIGH); 9 | vTaskDelay(50); 10 | digitalWrite(BOARD_LED_PIN, LOW); 11 | } 12 | } 13 | 14 | void setup() { 15 | // initialize the digital pin as an output: 16 | pinMode(BOARD_LED_PIN, OUTPUT); 17 | 18 | xTaskCreate(vLEDFlashTask, 19 | "Task1", 20 | configMINIMAL_STACK_SIZE, 21 | NULL, 22 | tskIDLE_PRIORITY + 2, 23 | NULL); 24 | vTaskStartScheduler(); 25 | } 26 | 27 | void loop() { 28 | // Insert background code here 29 | } 30 | 31 | 32 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/FreeRTOS821/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For CoOS 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | ####################################### 10 | # Methods and Functions (KEYWORD2) 11 | ####################################### 12 | vTaskDelay KEYWORD2 13 | vTaskDelayUntil KEYWORD2 14 | xTaskCreate KEYWORD2 15 | vTaskSuspend KEYWORD2 16 | vTaskDelete KEYWORD2 17 | vTaskPrioritySet KEYWORD2 18 | uxTaskPriorityGet KEYWORD2 19 | vTaskStartScheduler KEYWORD2 20 | vApplicationIdleHook KEYWORD2 21 | 22 | ####################################### 23 | # Constants (LITERAL1) 24 | ####################################### 25 | configUSE_IDLE_HOOK LITERAL1 26 | configMINIMAL_STACK_SIZE LITERAL1 27 | tskIDLE_PRIORITY LITERAL1 -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/FreeRTOS821/rules.mk: -------------------------------------------------------------------------------- 1 | # Standard things 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | BUILDDIRS += $(BUILD_PATH)/$(d) 6 | BUILDDIRS += $(BUILD_PATH)/$(d)/utility 7 | 8 | # Local flags 9 | CXXFLAGS_$(d) := $(WIRISH_INCLUDES) $(LIBMAPLE_INCLUDES) 10 | CFLAGS_$(d) := $(WIRISH_INCLUDES) $(LIBMAPLE_INCLUDES) 11 | 12 | # Local rules and targets 13 | cSRCS_$(d) := utility/croutine.c \ 14 | utility/heap_2.c \ 15 | utility/list.c \ 16 | utility/port.c \ 17 | utility/queue.c \ 18 | utility/timers.c \ 19 | utility/tasks.c \ 20 | 21 | cppSRCS_$(d) := MapleFreeRTOS.cpp 22 | 23 | cFILES_$(d) := $(cSRCS_$(d):%=$(d)/%) 24 | cppFILES_$(d) := $(cppSRCS_$(d):%=$(d)/%) 25 | 26 | OBJS_$(d) := $(cFILES_$(d):%.c=$(BUILD_PATH)/%.o) \ 27 | $(cppFILES_$(d):%.cpp=$(BUILD_PATH)/%.o) 28 | DEPS_$(d) := $(OBJS_$(d):%.o=%.d) 29 | 30 | $(OBJS_$(d)): TGT_CXXFLAGS := $(CXXFLAGS_$(d)) 31 | $(OBJS_$(d)): TGT_CFLAGS := $(CFLAGS_$(d)) 32 | 33 | TGT_BIN += $(OBJS_$(d)) 34 | 35 | # Standard things 36 | -include $(DEPS_$(d)) 37 | d := $(dirstack_$(sp)) 38 | sp := $(basename $(sp)) -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/FreeRTOS821/utility/readme.txt: -------------------------------------------------------------------------------- 1 | Each real time kernel port consists of three files that contain the core kernel 2 | components and are common to every port, and one or more files that are 3 | specific to a particular microcontroller and or compiler. 4 | 5 | + The FreeRTOS/Source directory contains the three files that are common to 6 | every port - list.c, queue.c and tasks.c. The kernel is contained within these 7 | three files. croutine.c implements the optional co-routine functionality - which 8 | is normally only used on very memory limited systems. 9 | 10 | + The FreeRTOS/Source/Portable directory contains the files that are specific to 11 | a particular microcontroller and or compiler. 12 | 13 | + The FreeRTOS/Source/include directory contains the real time kernel header 14 | files. 15 | 16 | See the readme file in the FreeRTOS/Source/Portable directory for more 17 | information. -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/FreeRTOS821/utility/stdint.readme: -------------------------------------------------------------------------------- 1 | 2 | #ifndef FREERTOS_STDINT 3 | #define FREERTOS_STDINT 4 | 5 | /******************************************************************************* 6 | * THIS IS NOT A FULL stdint.h IMPLEMENTATION - It only contains the definitions 7 | * necessary to build the FreeRTOS code. It is provided to allow FreeRTOS to be 8 | * built using compilers that do not provide their own stdint.h definition. 9 | * 10 | * To use this file: 11 | * 12 | * 1) Copy this file into the directory that contains your FreeRTOSConfig.h 13 | * header file, as that directory will already be in the compilers include 14 | * path. 15 | * 16 | * 2) Rename the copied file stdint.h. 17 | * 18 | */ 19 | 20 | typedef signed char int8_t; 21 | typedef unsigned char uint8_t; 22 | typedef short int16_t; 23 | typedef unsigned short uint16_t; 24 | typedef long int32_t; 25 | typedef unsigned long uint32_t; 26 | 27 | #endif /* FREERTOS_STDINT */ 28 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/FreeRTOS900/examples/rtos_blink/rtos_blink.ino: -------------------------------------------------------------------------------- 1 | //#include 2 | //#include "libraries/FreeRTOS/MapleFreeRTOS.h" 3 | #include 4 | 5 | static void vLEDFlashTask(void *pvParameters) { 6 | for (;;) { 7 | vTaskDelay(1000); 8 | digitalWrite(BOARD_LED_PIN, HIGH); 9 | vTaskDelay(50); 10 | digitalWrite(BOARD_LED_PIN, LOW); 11 | } 12 | } 13 | 14 | void setup() { 15 | // initialize the digital pin as an output: 16 | pinMode(BOARD_LED_PIN, OUTPUT); 17 | 18 | xTaskCreate(vLEDFlashTask, 19 | "Task1", 20 | configMINIMAL_STACK_SIZE, 21 | NULL, 22 | tskIDLE_PRIORITY + 2, 23 | NULL); 24 | vTaskStartScheduler(); 25 | } 26 | 27 | void loop() { 28 | // Insert background code here 29 | } 30 | 31 | 32 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/FreeRTOS900/utility/readme.txt: -------------------------------------------------------------------------------- 1 | Each real time kernel port consists of three files that contain the core kernel 2 | components and are common to every port, and one or more files that are 3 | specific to a particular microcontroller and or compiler. 4 | 5 | + The FreeRTOS/Source directory contains the three files that are common to 6 | every port - list.c, queue.c and tasks.c. The kernel is contained within these 7 | three files. croutine.c implements the optional co-routine functionality - which 8 | is normally only used on very memory limited systems. 9 | 10 | + The FreeRTOS/Source/Portable directory contains the files that are specific to 11 | a particular microcontroller and or compiler. 12 | 13 | + The FreeRTOS/Source/include directory contains the real time kernel header 14 | files. 15 | 16 | See the readme file in the FreeRTOS/Source/Portable directory for more 17 | information. -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/FreeRTOS900/utility/stdint.readme: -------------------------------------------------------------------------------- 1 | 2 | #ifndef FREERTOS_STDINT 3 | #define FREERTOS_STDINT 4 | 5 | /******************************************************************************* 6 | * THIS IS NOT A FULL stdint.h IMPLEMENTATION - It only contains the definitions 7 | * necessary to build the FreeRTOS code. It is provided to allow FreeRTOS to be 8 | * built using compilers that do not provide their own stdint.h definition. 9 | * 10 | * To use this file: 11 | * 12 | * 1) Copy this file into the directory that contains your FreeRTOSConfig.h 13 | * header file, as that directory will already be in the compilers include 14 | * path. 15 | * 16 | * 2) Rename the copied file stdint.h. 17 | * 18 | */ 19 | 20 | typedef signed char int8_t; 21 | typedef unsigned char uint8_t; 22 | typedef short int16_t; 23 | typedef unsigned short uint16_t; 24 | typedef long int32_t; 25 | typedef unsigned long uint32_t; 26 | 27 | #endif /* FREERTOS_STDINT */ 28 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Lcd7920_STM/readme.md: -------------------------------------------------------------------------------- 1 | This library has been provided by Matthias (@madias from the Arduino forum) -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/LiquidCrystal/rules.mk: -------------------------------------------------------------------------------- 1 | # Standard things 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | BUILDDIRS += $(BUILD_PATH)/$(d) 6 | 7 | # Local flags 8 | CFLAGS_$(d) := $(WIRISH_INCLUDES) $(LIBMAPLE_INCLUDES) 9 | 10 | # Local rules and targets 11 | cSRCS_$(d) := 12 | 13 | cppSRCS_$(d) := LiquidCrystal.cpp 14 | 15 | cFILES_$(d) := $(cSRCS_$(d):%=$(d)/%) 16 | cppFILES_$(d) := $(cppSRCS_$(d):%=$(d)/%) 17 | 18 | OBJS_$(d) := $(cFILES_$(d):%.c=$(BUILD_PATH)/%.o) \ 19 | $(cppFILES_$(d):%.cpp=$(BUILD_PATH)/%.o) 20 | DEPS_$(d) := $(OBJS_$(d):%.o=%.d) 21 | 22 | $(OBJS_$(d)): TGT_CFLAGS := $(CFLAGS_$(d)) 23 | 24 | TGT_BIN += $(OBJS_$(d)) 25 | 26 | # Standard things 27 | -include $(DEPS_$(d)) 28 | d := $(dirstack_$(sp)) 29 | sp := $(basename $(sp)) -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/MapleCoOS/MapleCoOS.h: -------------------------------------------------------------------------------- 1 | #ifndef _COOS_H_ 2 | #define _COOS_H_ 3 | 4 | #include "WProgram.h" 5 | extern "C" { 6 | #include "utility/CoOS.h" 7 | } 8 | 9 | #define TASK_STK_SIZE 128 /*!< Define stack size. */ 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/MapleCoOS/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For CoOS 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | OS_STK KEYWORD1 9 | OS_MutexID KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | 15 | CoInitOS KEYWORD2 16 | CoCreateTask KEYWORD2 17 | CoStartOS KEYWORD2 18 | CoTickDelay KEYWORD2 19 | CoLeaveMutexSection KEYWORD2 20 | CoEnterMutexSection KEYWORD2 21 | 22 | ####################################### 23 | # Constants (LITERAL1) 24 | ####################################### 25 | TASK_STK_SIZE LITERAL1 26 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/MapleCoOS/utility/OsCore.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************* 3 | * @file core.h 4 | * @version V1.12 5 | * @date 2010.03.01 6 | * @brief Header file related to kernel 7 | ******************************************************************************* 8 | * @copy 9 | * 10 | * INTERNAL FILE,DON'T PUBLIC. 11 | * 12 | *

© COPYRIGHT 2009 CooCox

13 | ******************************************************************************* 14 | */ 15 | 16 | 17 | #ifndef _CORE_H 18 | #define _CORE_H 19 | 20 | #include 21 | 22 | 23 | #define OsSchedLock() OSSchedLock++; /*!< Lock schedule */ 24 | extern void OsSchedUnlock(void); 25 | 26 | extern void CoSysTick_Handler(void); 27 | 28 | #endif 29 | 30 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/MapleCoOS/utility/OsKernelHeap.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************* 3 | * @file kernelHeap.h 4 | * @version V1.12 5 | * @date 2010.03.01 6 | * @brief Header file related to memory management 7 | * @details This file including some defines and function declare related to 8 | * kernel heap management. 9 | ******************************************************************************* 10 | * @copy 11 | * 12 | * INTERNAL FILE,DON'T PUBLIC. 13 | * 14 | *

© COPYRIGHT 2009 CooCox

15 | ******************************************************************************* 16 | */ 17 | 18 | 19 | #ifndef _KERNELHEAP_H 20 | #define _KERNELHEAP_H 21 | 22 | 23 | typedef struct KennelHeap 24 | { 25 | U32 startAddr; 26 | U32 endAddr; 27 | }KHeap,*P_KHeap; 28 | 29 | 30 | typedef struct UsedMemBlk 31 | { 32 | void* nextMB; 33 | void* preMB; 34 | }UMB,*P_UMB; 35 | 36 | 37 | typedef struct FreeMemBlk 38 | { 39 | struct FreeMemBlk* nextFMB; 40 | struct UsedMemBlk* nextUMB; 41 | struct UsedMemBlk* preUMB; 42 | }FMB,*P_FMB; 43 | 44 | /*---------------------------- Function Declare ------------------------------*/ 45 | extern void CoCreateKheap(void); 46 | 47 | #endif /* _KERNELHEAP_H */ 48 | 49 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/MapleCoOS/utility/OsMM.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************* 3 | * @file mm.h 4 | * @version V1.12 5 | * @date 2010.03.01 6 | * @brief Header file related to memory management 7 | * @details This file including some defines and function declare related to 8 | * memory management. 9 | ******************************************************************************* 10 | * @copy 11 | * 12 | * INTERNAL FILE,DON'T PUBLIC. 13 | * 14 | *

© COPYRIGHT 2009 CooCox

15 | ******************************************************************************* 16 | */ 17 | 18 | 19 | #ifndef _MM_H 20 | #define _MM_H 21 | 22 | 23 | typedef struct Memory 24 | { 25 | U8* memAddr; 26 | U8* freeBlock; 27 | U32 blockSize; 28 | U32 blockNum; 29 | }MM,*P_MM; 30 | 31 | 32 | typedef struct MemoryBlock 33 | { 34 | struct MemoryBlock* nextBlock; 35 | }MemBlk,*P_MemBlk; 36 | 37 | 38 | extern U32 MemoryIDVessel; 39 | 40 | #endif /* _MM_H */ 41 | 42 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/MapleCoOS/utility/OsQueue.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************* 3 | * @file queue.h 4 | * @version V1.12 5 | * @date 2010.03.01 6 | * @brief Queue management header file 7 | * @details This file including some defines and declares about queue management. 8 | ******************************************************************************* 9 | * @copy 10 | * 11 | * INTERNAL FILE,DON'T PUBLIC. 12 | * 13 | *

© COPYRIGHT 2009 CooCox

14 | ******************************************************************************* 15 | */ 16 | 17 | 18 | #ifndef _QUEUE_H 19 | #define _QUEUE_H 20 | 21 | 22 | /** 23 | * @struct Queue queue.h 24 | * @brief Queue struct 25 | * @details This struct use to manage queue. 26 | * 27 | */ 28 | typedef struct Queue 29 | { 30 | void **qStart; /*!< */ 31 | U8 id; /*!< */ 32 | U16 head; /*!< The header of queue */ 33 | U16 tail; /*!< The end of queue */ 34 | U16 qMaxSize; /*!< The max size of queue */ 35 | U16 qSize; /*!< Current size of queue */ 36 | }QCB,*P_QCB; 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/MapleCoOS/utility/OsServiceReq.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | ******************************************************************************* 4 | * @file serviceReq.h 5 | * @version V1.12 6 | * @date 2010.03.01 7 | * @brief Header file related to service request 8 | * @details This file including some defines and function declare related to 9 | * service request. 10 | ******************************************************************************* 11 | * @copy 12 | * 13 | * INTERNAL FILE,DON'T PUBLIC. 14 | * 15 | *

© COPYRIGHT 2009 CooCox

16 | ******************************************************************************* 17 | */ 18 | 19 | 20 | #ifndef _SERVICEREQ_H 21 | #define _SERVICEREQ_H 22 | 23 | #if CFG_MAX_SERVICE_REQUEST > 0 24 | #define SEM_REQ (U8)0x1 25 | #define MBOX_REQ (U8)0x2 26 | #define FLAG_REQ (U8)0x3 27 | #define QUEUE_REQ (U8)0x4 28 | 29 | typedef struct ServiceReqCell 30 | { 31 | U8 type; 32 | U8 id; 33 | void* arg; 34 | }SQC,*P_SQC; 35 | 36 | typedef struct ServiceReqQueue 37 | { 38 | U8 cnt; 39 | SQC cell[CFG_MAX_SERVICE_REQUEST]; 40 | }SRQ,*P_SRQ; 41 | 42 | 43 | extern SRQ ServiceReq; 44 | extern BOOL InsertInSRQ(U8 type,U8 id,void* arg); 45 | #endif 46 | 47 | extern void RespondSRQ(void); 48 | extern BOOL TimeReq; 49 | extern BOOL TimerReq; 50 | extern BOOL IsrReq; 51 | #endif 52 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/MapleCoOS/utility/OsTime.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************* 3 | * @file task.c 4 | * @version V1.12 5 | * @date 2010.03.01 6 | * @brief Header file related to time management 7 | * @details Thie file including some data declare related to time managment. 8 | ******************************************************************************* 9 | * @copy 10 | * 11 | * INTERNAL FILE,DON'T PUBLIC. 12 | * 13 | *

© COPYRIGHT 2009 CooCox

14 | ******************************************************************************* 15 | */ 16 | 17 | #ifndef _TIME_H 18 | #define _TIME_H 19 | 20 | /*---------------------------- Variable declare ------------------------------*/ 21 | extern P_OSTCB DlyList; /*!< A pointer to ther delay list. */ 22 | 23 | /*---------------------------- Function declare ------------------------------*/ 24 | extern void TimeDispose(void); /*!< Time dispose function. */ 25 | extern void isr_TimeDispose(void); 26 | extern void RemoveDelayList(P_OSTCB ptcb); 27 | extern void InsertDelayList(P_OSTCB ptcb,U32 ticks); 28 | #endif 29 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/MapleCoOS/utility/OsUtility.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************* 3 | * @file utility.h 4 | * @version V1.00 Initial version 5 | * @date 2009.06.26 6 | * @brief Utility function header file 7 | * @details This file including some defines and declares related to utility 8 | * function. 9 | ******************************************************************************* 10 | * @copy 11 | * 12 | * INTERNAL FILE,DON'T PUBLIC. 13 | * 14 | *

© COPYRIGHT 2009 CooCox

15 | ******************************************************************************* 16 | */ 17 | 18 | 19 | #ifndef _UTILITY_H 20 | #define _UTILITY_H 21 | 22 | 23 | /** 24 | * @struct Time struct utility.h 25 | * @brief Time struct 26 | * @details This struct use to manage time 27 | */ 28 | typedef struct SysTime 29 | { 30 | U8 sec; /*!< Second */ 31 | U8 min; /*!< Minute */ 32 | U8 hour; /*!< Hour */ 33 | U8 date; /*!< Date */ 34 | U8 month; /*!< Month */ 35 | U16 year; /*!< Year */ 36 | }TIME; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/MapleCoOS116/MapleCoOS116.h: -------------------------------------------------------------------------------- 1 | #ifndef _COOS_H_ 2 | #define _COOS_H_ 3 | 4 | #include "WProgram.h" 5 | extern "C" { 6 | #include "utility/CoOS.h" 7 | } 8 | 9 | #define TASK_STK_SIZE 128 /*!< Define stack size. */ 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/MapleCoOS116/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For CoOS 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | OS_STK KEYWORD1 9 | OS_MutexID KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | 15 | CoInitOS KEYWORD2 16 | CoCreateTask KEYWORD2 17 | CoStartOS KEYWORD2 18 | CoTickDelay KEYWORD2 19 | CoLeaveMutexSection KEYWORD2 20 | CoEnterMutexSection KEYWORD2 21 | 22 | ####################################### 23 | # Constants (LITERAL1) 24 | ####################################### 25 | TASK_STK_SIZE LITERAL1 26 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/OLED_I2C/Documentation/OLED_I2C.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snapmaker/Snapmaker2-Modules/a2fefd5c127ecf9e4158c594ab6ff1e874c32a07/snapmaker/lib/STM32F1/libraries/OLED_I2C/Documentation/OLED_I2C.pdf -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/OLED_I2C/Documentation/version.txt: -------------------------------------------------------------------------------- 1 | Version: 2 | 1.0 01 Mar 2015 - initial release 3 | 1.01 07 Mar 2015 - fixed a bug in the OLED_I2C_3D_Cube example 4 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/OLED_I2C/License/License - CC BY-NC-SA 3.0 - Legal.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snapmaker/Snapmaker2-Modules/a2fefd5c127ecf9e4158c594ab6ff1e874c32a07/snapmaker/lib/STM32F1/libraries/OLED_I2C/License/License - CC BY-NC-SA 3.0 - Legal.pdf -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/OLED_I2C/License/License - CC BY-NC-SA 3.0 - Summary.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snapmaker/Snapmaker2-Modules/a2fefd5c127ecf9e4158c594ab6ff1e874c32a07/snapmaker/lib/STM32F1/libraries/OLED_I2C/License/License - CC BY-NC-SA 3.0 - Summary.pdf -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/OLED_I2C/hardware/arm/HW_ARM_defines.h: -------------------------------------------------------------------------------- 1 | // *** Hardwarespecific defines *** 2 | #define cbi(reg, bitmask) *reg &= ~bitmask 3 | #define sbi(reg, bitmask) *reg |= bitmask 4 | #define pulseClock cbi(P_SCK, B_SCK); asm ("nop"); sbi(P_SCK, B_SCK) 5 | 6 | #define fontbyte(x) cfont.font[x] 7 | #define bitmapbyte(x) bitmap[x] 8 | 9 | #define bitmapdatatype unsigned char* 10 | 11 | #define SDA 20 12 | #define SCL 21 13 | #define SDA1 70 14 | #define SCL1 71 15 | 16 | #define TWI_SPEED TWI_SPEED_400k // Set default TWI Speed 17 | #define TWI_SPEED_100k 208 18 | #define TWI_SPEED_400k 101 19 | 20 | #define TWI_DIV TWI_DIV_400k // Set divider for TWI Speed (must match TWI_SPEED setting) 21 | #define TWI_DIV_100k 1 22 | #define TWI_DIV_400k 0 23 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/OLED_I2C/hardware/arm/HW_STM32_defines.h: -------------------------------------------------------------------------------- 1 | // *** Hardwarespecific defines *** 2 | #define cbi(reg, bitmask) *reg &= ~bitmask 3 | #define sbi(reg, bitmask) *reg |= bitmask 4 | #define pulseClock cbi(P_SCK, B_SCK); asm ("nop"); sbi(P_SCK, B_SCK) 5 | 6 | #define fontbyte(x) cfont.font[x] 7 | #define bitmapbyte(x) bitmap[x] 8 | 9 | #define bitmapdatatype unsigned char* 10 | 11 | #define SDA1 0 12 | #define SCL1 1 13 | #define SDA 15 14 | #define SCL 16 15 | 16 | #define TWI_SPEED TWI_SPEED_400k // Set default TWI Speed 17 | #define TWI_SPEED_100k 208 18 | #define TWI_SPEED_400k 101 19 | 20 | #define TWI_DIV TWI_DIV_400k // Set divider for TWI Speed (must match TWI_SPEED setting) 21 | #define TWI_DIV_100k 1 22 | #define TWI_DIV_400k 0 23 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/OLED_I2C/hardware/avr/HW_AVR_defines.h: -------------------------------------------------------------------------------- 1 | // *** Hardwarespecific defines *** 2 | #define __cbi(reg, bitmask) *reg &= ~bitmask 3 | #define __cbi2(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) 4 | #define __sbi(reg, bitmask) *reg |= bitmask 5 | #define pulseClock __cbi(P_SCK, B_SCK); asm ("nop"); __sbi(P_SCK, B_SCK) 6 | 7 | #define fontbyte(x) pgm_read_byte(&cfont.font[x]) 8 | #define bitmapbyte(x) pgm_read_byte(&bitmap[x]) 9 | 10 | #define bitmapdatatype uint8_t* 11 | 12 | #ifndef TWI_FREQ 13 | #define TWI_FREQ 400000L 14 | #endif 15 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/OLED_I2C/hardware/pic32/HW_PIC32_defines.h: -------------------------------------------------------------------------------- 1 | // *** Hardwarespecific defines *** 2 | #define __cbi(reg, bitmask) (*(reg + 1)) = bitmask 3 | #define __sbi(reg, bitmask) (*(reg + 2)) = bitmask 4 | #define pulseClock digitalWrite(SCK_Pin, LOW); digitalWrite(SCK_Pin, HIGH) 5 | 6 | #define fontbyte(x) cfont.font[x] 7 | #define bitmapbyte(x) bitmap[x] 8 | 9 | #define PROGMEM 10 | #define bitmapdatatype unsigned char* 11 | 12 | #if !defined(_UP_MCU_) 13 | #if defined(__32MX320F128H__) 14 | #define SDA 18 // A4 (Remeber to set the jumper correctly) 15 | #define SCL 19 // A5 (Remeber to set the jumper correctly) 16 | #elif defined(__32MX340F512H__) 17 | #define SDA 18 // A4 (Remeber to set the jumper correctly) 18 | #define SCL 19 // A5 (Remeber to set the jumper correctly) 19 | #elif defined(__32MX795F512L__) 20 | #define SDA 20 // Digital 20 21 | #define SCL 21 // Digital 21 22 | #else 23 | #error "Unsupported PIC32 MCU!" 24 | #endif 25 | #endif 26 | 27 | #ifndef TWI_FREQ 28 | #define TWI_FREQ 400000L 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/OLED_I2C/keywords.txt: -------------------------------------------------------------------------------- 1 | OLED KEYWORD1 2 | 3 | begin KEYWORD2 4 | setBrightness KEYWORD2 5 | update KEYWORD2 6 | clrScr KEYWORD2 7 | fillScr KEYWORD2 8 | invert KEYWORD2 9 | setPixel KEYWORD2 10 | clrPixel KEYWORD2 11 | invPixel KEYWORD2 12 | invertText KEYWORD2 13 | print KEYWORD2 14 | printNumI KEYWORD2 15 | printNumF KEYWORD2 16 | setFont KEYWORD2 17 | drawBitmap KEYWORD2 18 | drawLine KEYWORD2 19 | clrLine KEYWORD2 20 | drawRect KEYWORD2 21 | clrRect KEYWORD2 22 | drawRoundRect KEYWORD2 23 | clrRoundRect KEYWORD2 24 | drawCircle KEYWORD2 25 | clrCircle KEYWORD2 26 | 27 | LEFT LITERAL1 28 | RIGHT LITERAL1 29 | CENTER LITERAL1 30 | 31 | RST_NOT_IN_USE LITERAL1 32 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/OneWireSTM/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For OneWire 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | OneWireSTM KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | 15 | reset KEYWORD2 16 | write_bit KEYWORD2 17 | read_bit KEYWORD2 18 | write KEYWORD2 19 | write_bytes KEYWORD2 20 | read KEYWORD2 21 | read_bytes KEYWORD2 22 | select KEYWORD2 23 | skip KEYWORD2 24 | depower KEYWORD2 25 | reset_search KEYWORD2 26 | search KEYWORD2 27 | crc8 KEYWORD2 28 | crc16 KEYWORD2 29 | check_crc16 KEYWORD2 30 | 31 | ####################################### 32 | # Instances (KEYWORD2) 33 | ####################################### 34 | 35 | 36 | ####################################### 37 | # Constants (LITERAL1) 38 | ####################################### 39 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/OneWireSTM/library.properties: -------------------------------------------------------------------------------- 1 | name=OneWireSTM 2 | version=1.0 3 | author=Various - updated for STM by Roger Clark 4 | email= 5 | sentence=Dallas One Wire for STM 6 | paragraph=OneWire for STM32F1 7 | url= 8 | architectures=STM32F1 9 | maintainer= 10 | category=Uncategorized -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/RTClock/examples/Test_RTClock/Test_RTClock.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | RTClock rt (RTCSEL_LSE); // initialise 4 | uint32 tt; 5 | 6 | #define LED_PIN PB1 7 | 8 | // This function is called in the attachSecondsInterrpt 9 | void blink () 10 | { 11 | digitalWrite(LED_PIN,!digitalRead(LED_PIN)); 12 | } 13 | 14 | void setup() 15 | { 16 | pinMode(LED_PIN, OUTPUT); 17 | 18 | rt.attachSecondsInterrupt(blink);// Call blink 19 | } 20 | 21 | 22 | 23 | void loop() 24 | { 25 | 26 | if (rt.getTime()!=tt) 27 | { 28 | tt = rt.getTime(); 29 | 30 | Serial.print("time is: "); 31 | Serial.println(tt); 32 | } 33 | } -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/RTClock/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map RTClock 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | RTClock KEYWORD1 10 | 11 | 12 | setTime KEYWORD2 13 | getTime KEYWORD2 14 | 15 | createAlarm KEYWORD2 16 | removeAlarm KEYWORD2 17 | setAlarmTime KEYWORD2 18 | 19 | attachSecondsInterrupt KEYWORD2 20 | detachSecondsInterrupt KEYWORD2 21 | 22 | attachAlarmInterrupt KEYWORD2 23 | detachAlarmInterrupt KEYWORD2 24 | 25 | breakTime KEYWORD2 26 | makeTime KEYWORD2 27 | 28 | TimeZone KEYWORD2 29 | now KEYWORD2 30 | year KEYWORD2 31 | month KEYWORD2 32 | day KEYWORD2 33 | weekday KEYWORD2 34 | hour KEYWORD2 35 | minute KEYWORD2 36 | second KEYWORD2 37 | isPM KEYWORD2 38 | 39 | 40 | ####################################### 41 | # Constants (LITERAL1) 42 | ####################################### 43 | 44 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/RTClock/library.properties: -------------------------------------------------------------------------------- 1 | name=RTClock 2 | version=1.0 3 | author=Various 4 | email= 5 | sentence=Real Time Clock 6 | paragraph=Real Time Clock for STM32F1 7 | url= 8 | architectures=STM32F1 9 | maintainer= 10 | category=Timing 11 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/SDIO/SdioF1.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SDIOF1_H_ 3 | #define _SDIOF1_H_ 4 | 5 | #include 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/SPI/examples/spi_slave/spi_slave.ino: -------------------------------------------------------------------------------- 1 | // SPI full-duplex slave example 2 | // STM32 acts as a SPI slave and reads 8 bit data frames over SPI. 3 | // Master also gets a reply from the slave, which is a a simple count (0, 1, 2, 3) 4 | // that is incremented each time a data frame is received. 5 | // Serial output is here for debug 6 | 7 | #include 8 | #include 9 | 10 | void setupSPI(void) 11 | { 12 | // The clock value is not used 13 | // SPI1 is selected by default 14 | // MOSI, MISO, SCK and NSS PINs are set by the library 15 | SPI.beginTransactionSlave(SPISettings(18000000, MSBFIRST, SPI_MODE0, DATA_SIZE_8BIT)); 16 | } 17 | 18 | void setup() 19 | { 20 | Serial.begin(115200); 21 | delay(100); 22 | setupSPI(); 23 | } 24 | 25 | uint8_t count = 0; 26 | void loop() 27 | { 28 | // Blocking call to read SPI message 29 | uint8_t msg = SPI.transfer(++count); 30 | Serial.print("Received = 0b"); 31 | Serial.print(msg, BIN); 32 | Serial.print(", 0x"); 33 | Serial.print(msg, HEX); 34 | Serial.print(", "); 35 | Serial.println(msg); 36 | } 37 | 38 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/SPI/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map SPI 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | SPI KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | begin KEYWORD2 15 | end KEYWORD2 16 | transfer KEYWORD2 17 | #setBitOrder KEYWORD2 18 | setDataMode KEYWORD2 19 | setClockDivider KEYWORD2 20 | 21 | 22 | ####################################### 23 | # Constants (LITERAL1) 24 | ####################################### 25 | SPI_MODE0 LITERAL1 26 | SPI_MODE1 LITERAL1 27 | SPI_MODE2 LITERAL1 28 | SPI_MODE3 LITERAL1 29 | 30 | SPI_CONTINUE LITERAL1 31 | SPI_LAST LITERAL1 32 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/SPI/library.properties: -------------------------------------------------------------------------------- 1 | name=SPI 2 | version=1.0 3 | author=Roger Clark 4 | email= 5 | sentence=Serial Peripheral Interface 6 | paragraph=SPI for STM32F1 7 | url= 8 | architectures=STM32F1 9 | maintainer= 10 | category=Communication -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/SPI/src/README.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snapmaker/Snapmaker2-Modules/a2fefd5c127ecf9e4158c594ab6ff1e874c32a07/snapmaker/lib/STM32F1/libraries/SPI/src/README.txt -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/STM32ADC/examples/SingleChannelContinuousConversion/SingleChannelContinuousConversion.ino: -------------------------------------------------------------------------------- 1 | /* 2 | This example shows how to use the ADC library to continuously sample 3 | one channel/pin. 4 | 5 | */ 6 | #include 7 | 8 | ADC myAdc(ADC1); 9 | 10 | void setup() { 11 | Serial.begin(19200); 12 | 13 | } 14 | 15 | void loop(){ 16 | 17 | }; //end loop 18 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/STM32ADC/examples/SingleChannelSingleConversion/SingleChannelSingleConversion.ino: -------------------------------------------------------------------------------- 1 | /* 2 | This example shows how to use the ADC library sample 3 | one channels/pin at a time. 4 | A bit like analogRead, but with the possibility of having an interrupt. 5 | */ 6 | #include 7 | 8 | ADC myAdc(ADC1); 9 | uint8 pin[] = {D11}; 10 | 11 | 12 | void int_func() { 13 | Serial.println(adc_result); 14 | }; 15 | 16 | void setup() { 17 | Serial.begin(19200); 18 | myADC.setTrigger(ADC_EXT_EV_SWSTART);//start on SWStart bit 19 | myADC.setChannels(pin, 1); //this is actually the pin you want to measure 20 | myADC.attachADCInterrupt(int_func); 21 | }; //end setup 22 | 23 | void loop(){ 24 | 25 | }; //end loop 26 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/STM32ADC/examples/SingleConversionInterrupt/SingleConversionInterrupt.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | STM32ADC myADC(ADC1); 4 | 5 | uint8 pin = D7; 6 | 7 | #define BOARD_LED D33 //this is for Maple Mini 8 | volatile static bool triggered = 0; 9 | uint32 dado_adc = 0; 10 | 11 | 12 | void int_func() { 13 | 14 | triggered = 1; 15 | dado_adc = myADC.getData(); 16 | } 17 | 18 | 19 | 20 | void setup() { 21 | Serial.begin(19200); 22 | pinMode(BOARD_LED, OUTPUT); 23 | pinMode(D32, INPUT); 24 | pinMode(D11, INPUT_ANALOG);//AD pin. 25 | //startup blink... good idea from Pig-O-Scope 26 | digitalWrite(BOARD_LED, HIGH); 27 | delay(1000); 28 | digitalWrite(BOARD_LED, LOW); 29 | delay(1000); 30 | myADC.calibrate(); 31 | myADC.setSampleRate(ADC_SMPR_1_5); 32 | myADC.attachInterrupt(int_func, ADC_EOC); 33 | myADC.setPins(&pin, 1); 34 | 35 | } 36 | 37 | 38 | 39 | void loop() { 40 | if(digitalRead(D32) == 1 ) { 41 | Serial.println("begin"); 42 | // Take our samples 43 | myADC.startConversion(); 44 | while (triggered == 0); //wait here... 45 | 46 | Serial.print("Readin: "); 47 | Serial.println(dado_adc); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/STM32ADC/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map RTClock 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | Encoder KEYWORD1 9 | 10 | 11 | start KEYWORD2 12 | stop KEYWORD2 13 | 14 | resetCounts KEYWORD2 15 | value KEYWORD2 16 | getTurns KEYWORD2 17 | reset KEYWORD2 18 | getAngle KEYWORD2 19 | getDirection KEYWORD2 20 | Polarity KEYWORD2 21 | setPrescaler KEYWORD2 22 | getPrescaler KEYWORD2 23 | setPPR KEYWORD2 24 | getPPR KEYWORD2 25 | attachInterrupt KEYWORD2 26 | detachInterrupt KEYWORD2 27 | setFilter KEYWORD2 28 | 29 | ####################################### 30 | # Constants (LITERAL1) 31 | ####################################### 32 | 33 | COUNT_CH2 LITERAL1 34 | COUNT_CH1 LITERAL1 35 | COUNT_BOTH_CHANNELS LITERAL1 36 | RADIANS LITERAL1 37 | GRADES LITERAL1 38 | DEGREES LITERAL1 39 | NORMAL LITERAL1 40 | INVERTED LITERAL1 41 | POSITIVE LITERAL1 42 | NEGATIVE LITERAL1 -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/STM32ADC/library.properties: -------------------------------------------------------------------------------- 1 | name=STM32ADC 2 | version=1.0 3 | author=Cardoso 4 | email= 5 | sentence=Analog to Digital Converter Driver 6 | paragraph=ADC for STM32F1 7 | url= 8 | architectures=STM32F1 9 | maintainer= 10 | category=Timing 11 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/STM32ADC/src/utility/util_adc.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | void start_single_convert(adc_dev* dev, uint8 channel); 5 | 6 | void start_continuous_convert(adc_dev* dev, uint8 channel); 7 | 8 | void enable_adc_irq(adc_dev* dev); 9 | 10 | void enable_internal_reading(adc_dev *dev); 11 | 12 | void internalRead(adc_dev *dev, uint8 channel); 13 | 14 | void enable_awd_irq( adc_dev * dev); 15 | 16 | void set_awd_low_limit( adc_dev * dev, uint32 limit); 17 | 18 | void set_awd_high_limit( adc_dev * dev, uint32 limit); 19 | 20 | void enable_awd( adc_dev * dev); 21 | 22 | void set_awd_channel( adc_dev * dev, uint8 awd_channel); 23 | 24 | void adc_set_reg_seq_channel( adc_dev * dev, unsigned char *channels, unsigned char len); 25 | 26 | void set_continuous( adc_dev * dev); 27 | 28 | uint8 poll_adc_convert(adc_dev *dev); 29 | 30 | void adc_dma_enable(adc_dev * dev); -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Serasidis_EtherCard_STM/examples/udpClientSendOnly/Java_ClientAndServer/UDPClient.java: -------------------------------------------------------------------------------- 1 | import java.io.IOException; 2 | import java.net.DatagramPacket; 3 | import java.net.DatagramSocket; 4 | import java.net.InetAddress; 5 | import java.net.UnknownHostException; 6 | 7 | public class UDPClient { 8 | 9 | public static void main(String[] args) throws UnknownHostException { 10 | DatagramSocket s; 11 | byte[] sendBuffer = new byte[1024]; 12 | DatagramPacket sendPacket; 13 | final InetAddress ADDRESS = InetAddress.getByName("localhost"); 14 | final int PORT = 1234; 15 | try { 16 | s = new DatagramSocket(); 17 | System.out.println("Odesilam data na server..."); 18 | 19 | sendBuffer = "abc123".getBytes(); 20 | sendPacket = new DatagramPacket(sendBuffer, sendBuffer.length, 21 | ADDRESS, PORT); 22 | s.send(sendPacket); 23 | 24 | } catch (IOException e) { 25 | e.printStackTrace(); 26 | } 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Serasidis_EtherCard_STM/examples/udpClientSendOnly/Java_ClientAndServer/UDPserver.java: -------------------------------------------------------------------------------- 1 | import java.io.IOException; 2 | import java.net.DatagramPacket; 3 | import java.net.DatagramSocket; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Date; 6 | 7 | public class UDPserver { 8 | public static void main(String[] args) { 9 | UDPserver server = new UDPserver(1234); 10 | server.start(); 11 | } 12 | private int port; 13 | private DatagramSocket s; 14 | 15 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 16 | 17 | public UDPserver(int port) { 18 | this.port = port; 19 | } 20 | 21 | public void start() { 22 | System.out.println("SERVER: Waiting for incomming connections..."); 23 | System.out.println("DATE TIME IP:PORT received_data"); 24 | try { 25 | s = new DatagramSocket(this.port); 26 | while (true) { 27 | byte[] data = new byte[1412]; 28 | DatagramPacket p = new DatagramPacket(data, 29 | data.length); 30 | s.receive(p); 31 | System.out.print(sdf.format(new Date()).toString() + " "); 32 | System.out.print(p.getSocketAddress() + " "); 33 | System.out.println(new String(p.getData())); 34 | } 35 | } catch (IOException e) { 36 | e.printStackTrace(); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Serasidis_EtherCard_STM/examples/udpClientSendOnly/udpClientSendOnly.ino: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | static byte mymac[] = { 0x1A,0x2B,0x3C,0x4D,0x5E,0x6F }; 6 | byte Ethernet::buffer[700]; 7 | static uint32_t timer; 8 | 9 | char website[] PROGMEM = "server.example.net"; 10 | const int dstPort PROGMEM = 1234; 11 | 12 | const int srcPort PROGMEM = 4321; 13 | 14 | void setup () { 15 | Serial.begin(9600); 16 | 17 | if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) 18 | Serial.println( "Failed to access Ethernet controller"); 19 | if (!ether.dhcpSetup()) 20 | Serial.println("DHCP failed"); 21 | 22 | ether.printIp("IP: ", ether.myip); 23 | ether.printIp("GW: ", ether.gwip); 24 | ether.printIp("DNS: ", ether.dnsip); 25 | 26 | if (!ether.dnsLookup(website)) 27 | Serial.println("DNS failed"); 28 | 29 | ether.printIp("SRV: ", ether.hisip); 30 | } 31 | 32 | char textToSend[] = "test 123"; 33 | 34 | void loop () { 35 | if (millis() > timer) { 36 | timer = millis() + 5000; 37 | //static void sendUdp (char *data,uint8_t len,uint16_t sport, uint8_t *dip, uint16_t dport); 38 | ether.sendUdp(textToSend, sizeof(textToSend), srcPort, ether.hisip, dstPort ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Serasidis_EtherCard_STM/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map EtherCard_STM 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | EtherCard_STM KEYWORD1 10 | ether KEYWORD1 11 | BufferFiller KEYWORD1 12 | Stash KEYWORD1 13 | 14 | ####################################### 15 | # Methods and Functions (KEYWORD2) 16 | ####################################### 17 | emit_p KEYWORD2 18 | emit_raw KEYWORD2 19 | emit_raw_p KEYWORD2 20 | buffer KEYWORD2 21 | Ethernet KEYWORD2 22 | printIp KEYWORD2 23 | staticSetup KEYWORD2 24 | dhcpSetup KEYWORD2 25 | packetLoop KEYWORD2 26 | packetReceive KEYWORD2 27 | httpServerReply KEYWORD2 28 | browseUrl KEYWORD2 29 | memcpy_P KEYWORD2 30 | tcpOffset KEYWORD2 31 | tcpSend KEYWORD2 32 | tcpReply KEYWORD2 33 | dnsLookup KEYWORD2 34 | httpServerReply KEYWORD2 35 | sizeof KEYWORD2 36 | SerialPrint_P KEYWORD2 37 | copyIp KEYWORD2 38 | getIP_address KEYWORD2 39 | hisip KEYWORD2 40 | myip KEYWORD2 41 | gwip KEYWORD2 42 | mymask KEYWORD2 43 | dnsip KEYWORD2 44 | cleanup KEYWORD2 45 | freeCount KEYWORD2 46 | extract KEYWORD2 47 | save KEYWORD2 48 | size KEYWORD2 49 | 50 | ####################################### 51 | # Constants (LITERAL1) 52 | ####################################### 53 | STATUS_ERROR LITERAL1 54 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Serasidis_EtherCard_STM/library.properties: -------------------------------------------------------------------------------- 1 | name=Serasidis_EtherCard_STM 2 | version=1.0 3 | author=(Original) Jean-Claude Wippler :: Ported to STM32 by Vassilis Serasidis. 4 | email= 5 | sentence=ENC28J60 Ethernet module library 6 | paragraph=Ethernet module library for STM32F1 7 | url=https://github.com/Serasidis/STM32duino/tree/master/libraries/Serasidis_EtherCard_STM 8 | architectures=STM32F1 9 | maintainer= 10 | category=Communication 11 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Serasidis_VS1003B_STM/README.md: -------------------------------------------------------------------------------- 1 | Description 2 | --- 3 | 4 | That library is for VS1003B / VS10053B WAV/MP3/AAC audio decoder. 5 | The library has been ported to work with STM32 micro-controllers. 6 | 7 | A short Youtube video demonstration of the library can be found [here][A]. 8 | In that video I used an **STM32F103C8T** development board and a **VS1053B** mp3 decoder module. 9 | 10 | [A]:https://www.youtube.com/watch?v=oTPFkK0scAI 11 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Serasidis_VS1003B_STM/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For VS1003 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | VS1003 KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | 15 | begin KEYWORD2 16 | startSong KEYWORD2 17 | playChunk KEYWORD2 18 | stopSong KEYWORD2 19 | printDetails KEYWORD2 20 | modeSwitch KEYWORD2 21 | setVolume KEYWORD2 22 | 23 | ####################################### 24 | # Instances (KEYWORD2) 25 | ####################################### 26 | 27 | 28 | ####################################### 29 | # Constants (LITERAL1) 30 | ####################################### 31 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Serasidis_VS1003B_STM/library.properties: -------------------------------------------------------------------------------- 1 | name=Serasidis_VS1003B_STM 2 | version=1.0 3 | author=Andy Karpov - ported to STM by Vasillis Serasidis. Updated by Roger Clark 4 | email= 5 | sentence=VS1003 and VS1053 MP3, MP3 player and recorder 6 | paragraph=VS1003 and VS1053 MP3, MP3 player and recorder 7 | url= 8 | architectures=STM32F1 9 | maintainer= 10 | category=Device Control 11 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Serasidis_XPT2046_touch/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For XPT2046_touch 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | XPT2046_touch KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | 15 | begin KEYWORD2 16 | setButtonsNumber KEYWORD2 17 | getButtonNumber KEYWORD2 18 | read_XY KEYWORD2 19 | 20 | ####################################### 21 | # Instances (KEYWORD2) 22 | ####################################### 23 | 24 | 25 | ####################################### 26 | # Constants (LITERAL1) 27 | ####################################### 28 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Serasidis_XPT2046_touch/library.properties: -------------------------------------------------------------------------------- 1 | name=Serasidis_XPT2046_touch 2 | version=1.0 3 | author=Vasillis Serasidis. 4 | email=avrsite@yahoo.gr 5 | sentence=A simple XPT2046 Touch screen driver 6 | paragraph=A simple XPT2046 Touch screen driver 7 | url=http://wwww.serasidis.gr 8 | architectures=STM32F1 9 | maintainer= 10 | category=Other 11 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Servo/examples/Knob/Knob.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Controlling a servo position using a potentiometer (variable resistor) 3 | by Michal Rinott 4 | 5 | modified on 8 Nov 2013 6 | by Scott Fitzgerald 7 | http://www.arduino.cc/en/Tutorial/Knob 8 | */ 9 | 10 | #include 11 | 12 | Servo myservo; // create servo object to control a servo 13 | 14 | int potpin = 0; // analog pin used to connect the potentiometer 15 | int val; // variable to read the value from the analog pin 16 | 17 | void setup() { 18 | myservo.attach(9); // attaches the servo on pin 9 to the servo object 19 | } 20 | 21 | void loop() { 22 | val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023) 23 | val = map(val, 0, 1023, 0, 180); // scale it to use it with the servo (value between 0 and 180) 24 | myservo.write(val); // sets the servo position according to the scaled value 25 | delay(15); // waits for the servo to get there 26 | } 27 | 28 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Servo/examples/Sweep/Sweep.ino: -------------------------------------------------------------------------------- 1 | /* Sweep 2 | by BARRAGAN 3 | This example code is in the public domain. 4 | 5 | modified 8 Nov 2013 6 | by Scott Fitzgerald 7 | http://www.arduino.cc/en/Tutorial/Sweep 8 | */ 9 | 10 | #include 11 | 12 | Servo myservo; // create servo object to control a servo 13 | // twelve servo objects can be created on most boards 14 | 15 | int pos = 0; // variable to store the servo position 16 | 17 | void setup() { 18 | myservo.attach(9); // attaches the servo on pin 9 to the servo object 19 | } 20 | 21 | void loop() { 22 | for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees 23 | // in steps of 1 degree 24 | myservo.write(pos); // tell servo to go to position in variable 'pos' 25 | delay(15); // waits 15ms for the servo to reach the position 26 | } 27 | for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees 28 | myservo.write(pos); // tell servo to go to position in variable 'pos' 29 | delay(15); // waits 15ms for the servo to reach the position 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Servo/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map Servo 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | Servo KEYWORD1 Servo 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | attach KEYWORD2 15 | detach KEYWORD2 16 | write KEYWORD2 17 | read KEYWORD2 18 | attached KEYWORD2 19 | writeMicroseconds KEYWORD2 20 | readMicroseconds KEYWORD2 21 | 22 | ####################################### 23 | # Constants (LITERAL1) 24 | ####################################### 25 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Servo/library.properties: -------------------------------------------------------------------------------- 1 | name=Servo(STM32F1) 2 | version=1.1.2 3 | author=Unknown (possibly LeafLabs) 4 | maintainer=Roger Clark (roger@rogerclark.net) 5 | sentence=Allows STM32 boards to control a variety of servo motors. 6 | paragraph= 7 | category=Device Control 8 | url=http://www.arduino.cc/en/Reference/Servo 9 | architectures=STM32F1 -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Touch-Screen-Library_STM/README.txt: -------------------------------------------------------------------------------- 1 | This is the 4-wire resistive touch screen firmware for Arduino. Works with all Arduinos and the Mega 2 | 3 | 4 | To install, click DOWNLOAD SOURCE in the top right corner, and rename the uncompressed folder "TouchScreen". See our tutorial at http://www.ladyada.net/library/arduino/libraries.html on Arduino Library installation 5 | 6 | Ported to the STM32 by Jaret Burkett https://github.com/jaretburkett -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Touch-Screen-Library_STM/TouchScreen_STM.h: -------------------------------------------------------------------------------- 1 | // Touch screen library with X Y and Z (pressure) readings as well 2 | // as oversampling to avoid 'bouncing' 3 | // (c) ladyada / adafruit 4 | // Code under MIT License 5 | 6 | // Ported to STM32 by Jaret Burkett https://github.com/jaretburkett 7 | 8 | #ifndef _ADAFRUIT_TOUCHSCREEN_STM_H_ 9 | #define _ADAFRUIT_TOUCHSCREEN_STM_H_ 10 | #include 11 | 12 | class TSPoint { 13 | public: 14 | TSPoint(void); 15 | TSPoint(int16_t x, int16_t y, int16_t z); 16 | 17 | bool operator==(TSPoint); 18 | bool operator!=(TSPoint); 19 | 20 | int16_t x, y, z; 21 | }; 22 | 23 | class TouchScreen { 24 | public: 25 | TouchScreen(uint8_t xp, uint8_t yp, uint8_t xm, uint8_t ym); 26 | TouchScreen(uint8_t xp, uint8_t yp, uint8_t xm, uint8_t ym, uint16_t rx); 27 | 28 | bool isTouching(void); 29 | uint16_t pressure(void); 30 | int readTouchY(); 31 | int readTouchX(); 32 | TSPoint getPoint(); 33 | int16_t pressureThreshhold; 34 | 35 | private: 36 | uint8_t _yp, _ym, _xm, _xp; 37 | uint16_t _rxplate; 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Touch-Screen-Library_STM/examples/touchscreendemo/touchscreendemo.pde: -------------------------------------------------------------------------------- 1 | // Touch screen library with X Y and Z (pressure) readings as well 2 | // as oversampling to avoid 'bouncing' 3 | // This demo code returns raw readings, public domain 4 | 5 | #include 6 | #include 7 | 8 | #define YP 8 // must be an analog pin 9 | #define XM 9 // must be an analog pin 10 | #define YM 10 // can be a digital pin 11 | #define XP 11 // can be a digital pin 12 | 13 | // For better pressure precision, we need to know the resistance 14 | // between X+ and X- Use any multimeter to read it 15 | // For the one we're using, its 300 ohms across the X plate 16 | TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300); 17 | 18 | void setup(void) { 19 | Serial.begin(9600); 20 | } 21 | 22 | void loop(void) { 23 | // a point object holds x y and z coordinates 24 | TSPoint p = ts.getPoint(); 25 | 26 | // we have some minimum pressure we consider 'valid' 27 | // pressure of 0 means no pressing! 28 | if (p.z > ts.pressureThreshhold) { 29 | Serial.print("X = "); Serial.print(p.x); 30 | Serial.print("\tY = "); Serial.print(p.y); 31 | Serial.print("\tPressure = "); Serial.println(p.z); 32 | } 33 | 34 | delay(100); 35 | } 36 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Touch-Screen-Library_STM/examples/touchscreendemoshield/touchscreendemoshield.ino: -------------------------------------------------------------------------------- 1 | // Touch screen library with X Y and Z (pressure) readings as well 2 | // as oversampling to avoid 'bouncing' 3 | // This demo code returns raw readings, public domain 4 | 5 | #include 6 | #include 7 | 8 | // These are the pins for the shield! 9 | #define YP 8 // must be an analog pin 10 | #define XM 9 // must be an analog pin 11 | #define YM 10 // can be a digital pin 12 | #define XP 11 // can be a digital pin 13 | 14 | #define MINPRESSURE 10 15 | #define MAXPRESSURE 1000 16 | 17 | // For better pressure precision, we need to know the resistance 18 | // between X+ and X- Use any multimeter to read it 19 | // For the one we're using, its 300 ohms across the X plate 20 | TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300); 21 | 22 | void setup(void) { 23 | Serial.begin(9600); 24 | } 25 | 26 | void loop(void) { 27 | // a point object holds x y and z coordinates 28 | TSPoint p = ts.getPoint(); 29 | 30 | // we have some minimum pressure we consider 'valid' 31 | // pressure of 0 means no pressing! 32 | if (p.z > MINPRESSURE && p.z < MAXPRESSURE) { 33 | Serial.print("X = "); Serial.print(p.x); 34 | Serial.print("\tY = "); Serial.print(p.y); 35 | Serial.print("\tPressure = "); Serial.println(p.z); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/AbsMouse.cpp: -------------------------------------------------------------------------------- 1 | #include "USBComposite.h" 2 | 3 | //================================================================================ 4 | //================================================================================ 5 | // Mouse 6 | 7 | void HIDAbsMouse::begin(void){ 8 | } 9 | 10 | void HIDAbsMouse::end(void){ 11 | } 12 | 13 | void HIDAbsMouse::click(uint8_t b) 14 | { 15 | report.wheel = 0; 16 | report.buttons = b; 17 | sendReport(); 18 | report.buttons = 0; 19 | sendReport(); 20 | } 21 | 22 | void HIDAbsMouse::move(int16 x, int16 y, int8 wheel) 23 | { 24 | report.x = x; 25 | report.y = y; 26 | report.wheel = wheel; 27 | 28 | sendReport(); 29 | } 30 | 31 | void HIDAbsMouse::buttons(uint8_t b) 32 | { 33 | if (b != report.buttons) 34 | { 35 | report.wheel = 0; 36 | report.buttons = b; 37 | sendReport(); 38 | } 39 | } 40 | 41 | void HIDAbsMouse::press(uint8_t b) 42 | { 43 | buttons(report.buttons | b); 44 | } 45 | 46 | void HIDAbsMouse::release(uint8_t b) 47 | { 48 | buttons(report.buttons & ~b); 49 | } 50 | 51 | bool HIDAbsMouse::isPressed(uint8_t b) 52 | { 53 | if ((b & report.buttons) != 0) 54 | return true; 55 | return false; 56 | } 57 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/Consumer.cpp: -------------------------------------------------------------------------------- 1 | #include "USBComposite.h" 2 | 3 | void HIDConsumer::begin(void) {} 4 | void HIDConsumer::end(void) {} 5 | void HIDConsumer::press(uint16_t button) { 6 | report.button = button; 7 | sendReport(); 8 | } 9 | 10 | void HIDConsumer::release() { 11 | report.button = 0; 12 | sendReport(); 13 | } 14 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/HIDReports.cpp: -------------------------------------------------------------------------------- 1 | #include "USBComposite.h" 2 | 3 | #define REPORT(name, ...) \ 4 | static uint8_t raw_ ## name[] = { __VA_ARGS__ }; \ 5 | static const HIDReportDescriptor desc_ ## name = { raw_ ##name, sizeof(raw_ ##name) }; \ 6 | const HIDReportDescriptor* hidReport ## name = & desc_ ## name; 7 | 8 | REPORT(KeyboardMouseJoystick, HID_MOUSE_REPORT_DESCRIPTOR(), HID_KEYBOARD_REPORT_DESCRIPTOR(), HID_JOYSTICK_REPORT_DESCRIPTOR()); 9 | REPORT(KeyboardMouse, HID_MOUSE_REPORT_DESCRIPTOR(), HID_KEYBOARD_REPORT_DESCRIPTOR()); 10 | REPORT(Keyboard, HID_KEYBOARD_REPORT_DESCRIPTOR()); 11 | REPORT(Mouse, HID_MOUSE_REPORT_DESCRIPTOR()); 12 | REPORT(KeyboardJoystick, HID_KEYBOARD_REPORT_DESCRIPTOR(), HID_JOYSTICK_REPORT_DESCRIPTOR()); 13 | REPORT(Joystick, HID_JOYSTICK_REPORT_DESCRIPTOR()); 14 | REPORT(BootKeyboard, HID_BOOT_KEYBOARD_REPORT_DESCRIPTOR()); 15 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/MinSysex.h: -------------------------------------------------------------------------------- 1 | // 2 | // lgl_min_sysex.h 3 | // LibMaple4Midi 4 | // 5 | // Created by Donald D Davis on 4/11/13. 6 | // Copyright (c) 2013 Suspect Devices. All rights reserved. 7 | // 8 | 9 | #ifndef __LGL_MIN_SYSEX_H__ 10 | #define __LGL_MIN_SYSEX_H__ 1 11 | 12 | 13 | #include "MidiSpecs.h" 14 | //#include "LGL.h" 15 | 16 | #define LEAFLABS_MMA_VENDOR_1 0x7D 17 | #define LEAFLABS_MMA_VENDOR_2 0x1E 18 | #define LEAFLABS_MMA_VENDOR_3 0x4F 19 | 20 | // move to LGL.h 21 | #define LGL_RESET_CMD 0x1e 22 | 23 | #define DEFAULT_MIDI_CHANNEL 0x0A 24 | #define DEFAULT_MIDI_DEVICE 0x0A 25 | #define DEFAULT_MIDI_CABLE 0x00 26 | 27 | // eventually all of this should be in a place for settings which can be written to flash. 28 | extern volatile uint8 myMidiChannel; 29 | extern volatile uint8 myMidiDevice; 30 | extern volatile uint8 myMidiCable; 31 | extern volatile uint8 myMidiID[]; 32 | 33 | 34 | void LglSysexHandler(uint32 *midiBufferRx,uint32 *rx_offset,uint32 *n_unread_bytes); 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/Mouse.cpp: -------------------------------------------------------------------------------- 1 | #include "USBComposite.h" 2 | 3 | //================================================================================ 4 | //================================================================================ 5 | // Mouse 6 | 7 | void HIDMouse::begin(void){ 8 | } 9 | 10 | void HIDMouse::end(void){ 11 | } 12 | 13 | void HIDMouse::click(uint8_t b) 14 | { 15 | _buttons = b; 16 | move(0,0,0); 17 | _buttons = 0; 18 | move(0,0,0); 19 | } 20 | 21 | void HIDMouse::move(signed char x, signed char y, signed char wheel) 22 | { 23 | reportBuffer[1] = _buttons; 24 | reportBuffer[2] = x; 25 | reportBuffer[3] = y; 26 | reportBuffer[4] = wheel; 27 | 28 | sendReport(); 29 | } 30 | 31 | void HIDMouse::buttons(uint8_t b) 32 | { 33 | if (b != _buttons) 34 | { 35 | _buttons = b; 36 | move(0,0,0); 37 | } 38 | } 39 | 40 | void HIDMouse::press(uint8_t b) 41 | { 42 | buttons(_buttons | b); 43 | } 44 | 45 | void HIDMouse::release(uint8_t b) 46 | { 47 | buttons(_buttons & ~b); 48 | } 49 | 50 | bool HIDMouse::isPressed(uint8_t b) 51 | { 52 | if ((b & _buttons) > 0) 53 | return true; 54 | return false; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/UPGRADING-TO-0.90.txt: -------------------------------------------------------------------------------- 1 | Version 0.90 of the library has changed the API significantly in order to save flash and RAM. 2 | The main change is that other than USBComposite, all pre-declared object instances have been 3 | removed. 4 | 5 | When upgrading to 0.90 or higher, you will have to make a number of changes to your code. 6 | 7 | 1. Use a single include file instead of USBHID.h, USBMIDI.h, etc.: 8 | #include 9 | 10 | 2. Declare all instances other than USBComposite. This includes instances of plugin classes 11 | like USBHID as well as of HID profiles like HIDKeyboard (which need an instance of USBHID). 12 | 13 | 3. Note that USBHID is now a class (for consistency with other class names) and there is no 14 | USBHID instance. You need to declare an instance, e.g.: 15 | USBHID HID; 16 | and replace calls to USBHID.* with calls to HID.*. 17 | 18 | 4. Replace USBHID_begin_with_serial(...) with HID.begin(CompositeSerial,...) where HID is your 19 | instance of USBHID. -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/USBMassStorage.cpp: -------------------------------------------------------------------------------- 1 | #include "USBComposite.h" 2 | #include "usb_mass.h" 3 | #include "usb_mass_mal.h" 4 | #include "usb_composite_serial.h" 5 | #include 6 | 7 | void USBMassStorage::begin() { 8 | if(!enabled) { 9 | USBComposite.clear(); 10 | registerComponent(); 11 | USBComposite.begin(); 12 | 13 | enabled = true; 14 | } 15 | } 16 | 17 | void USBMassStorage::end() { 18 | USBComposite.end(); 19 | } 20 | 21 | void USBMassStorage::loop() { 22 | usb_mass_loop(); 23 | } 24 | 25 | bool USBMassStorage::registerComponent() { 26 | return USBComposite.add(&usbMassPart, this); 27 | } 28 | 29 | void USBMassStorage::setDriveData(uint32 driveNumber, uint32 numSectors, MassStorageReader reader, 30 | MassStorageWriter writer, MassStorageStatuser statuser, MassStorageInitializer initializer) { 31 | if (driveNumber >= USB_MASS_MAX_DRIVES) 32 | return; 33 | usb_mass_drives[driveNumber].blockCount = numSectors; 34 | usb_mass_drives[driveNumber].read = reader; 35 | usb_mass_drives[driveNumber].write = writer; 36 | usb_mass_drives[driveNumber].status = statuser; 37 | usb_mass_drives[driveNumber].init = initializer; 38 | usb_mass_drives[driveNumber].format = initializer; 39 | } 40 | 41 | void USBMassStorage::clearDrives() { 42 | memset(usb_mass_drives, 0, sizeof(usb_mass_drives)); 43 | } 44 | 45 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/USBMassStorage.h: -------------------------------------------------------------------------------- 1 | #ifndef USBMASSSTORAGE_H 2 | #define USBMASSSTORAGE_H 3 | 4 | #include 5 | #include "USBComposite.h" 6 | #include "usb_generic.h" 7 | #include "usb_mass_mal.h" 8 | 9 | class USBMassStorage { 10 | private: 11 | bool enabled = false; 12 | public: 13 | void begin(); 14 | void end(); 15 | void loop(); 16 | void clearDrives(void); 17 | bool registerComponent(); 18 | void setDriveData(uint32 driveNumber, uint32 numSectors, MassStorageReader reader, 19 | MassStorageWriter writer = NULL, MassStorageStatuser = NULL, MassStorageInitializer = NULL); 20 | }; 21 | 22 | #endif /* USBMASSSTORAGE_H */ 23 | 24 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/examples/BootKeyboard/BootKeyboard.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | USBHID HID; 4 | HIDKeyboard BootKeyboard(HID, 0); 5 | 6 | void setup() 7 | { 8 | HID.begin(HID_BOOT_KEYBOARD); 9 | BootKeyboard.begin(); // needed just in case you need LED support 10 | } 11 | 12 | void loop() 13 | { 14 | BootKeyboard.press(KEY_F12); 15 | delay(100); 16 | BootKeyboard.release(KEY_F12); 17 | delay(1000); 18 | } 19 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/examples/absmouse/absmouse.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | const uint8_t reportDescription[] = { 4 | HID_ABS_MOUSE_REPORT_DESCRIPTOR(HID_MOUSE_REPORT_ID) 5 | }; 6 | 7 | USBHID HID; 8 | HIDAbsMouse mouse(HID); 9 | 10 | void setup(){ 11 | HID.begin(reportDescription, sizeof(reportDescription)); 12 | delay(1000); 13 | mouse.move(0,0); 14 | delay(1000); 15 | mouse.press(MOUSE_LEFT); 16 | mouse.move(500,500); 17 | mouse.release(MOUSE_ALL); 18 | mouse.click(MOUSE_RIGHT); 19 | } 20 | 21 | void loop(){ 22 | mouse.move(0,0); 23 | delay(1000); 24 | mouse.move(16384,16384); 25 | delay(1000); 26 | } 27 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/examples/consumer/consumer.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | USBHID HID; 4 | 5 | const uint8_t reportDescription[] = { 6 | HID_CONSUMER_REPORT_DESCRIPTOR() 7 | }; 8 | 9 | HIDConsumer Consumer(HID); 10 | 11 | void setup(){ 12 | HID.begin(reportDescription, sizeof(reportDescription)); 13 | } 14 | 15 | void loop() { 16 | Consumer.press(HIDConsumer::BRIGHTNESS_DOWN); 17 | Consumer.release(); 18 | delay(500); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/examples/jigglemouse/jigglemouse.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define LED PB12 4 | 5 | USBHID HID; 6 | HIDMouse Mouse(HID); 7 | 8 | void setup(){ 9 | pinMode(LED,OUTPUT); 10 | digitalWrite(LED,1); 11 | HID.begin(HID_MOUSE); 12 | delay(1000); 13 | } 14 | 15 | void loop(){ 16 | digitalWrite(LED,0); 17 | Mouse.move(4,0); 18 | delay(500); 19 | digitalWrite(LED,1); 20 | delay(30000); 21 | digitalWrite(LED,0); 22 | Mouse.move(-4,0); 23 | delay(500); 24 | digitalWrite(LED,1); 25 | delay(30000); 26 | } 27 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/examples/keyboardMouse/keyboardMouse.ino: -------------------------------------------------------------------------------- 1 | #include 2 | /* 3 | * This example types which cardinal direction the mouse will be moved 4 | * and then moves the mouse in that direction. If the mouse doesn't recenter 5 | * at the end, it is probably due to mouse acceleration 6 | */ 7 | 8 | USBHID HID; 9 | HIDKeyboard Keyboard(HID); 10 | HIDMouse Mouse(HID); 11 | 12 | void setup() { 13 | HID.begin(HID_KEYBOARD_MOUSE); 14 | delay(2000); 15 | } 16 | 17 | void loop() { 18 | Keyboard.println("UP"); 19 | Mouse.move(0,-127); 20 | delay(1500); 21 | 22 | Keyboard.println("DOWN"); 23 | Mouse.move(0,127); 24 | Mouse.move(0,127); //Movement cannot be greater than a byte 25 | delay(1500); 26 | 27 | Keyboard.println("LEFT"); 28 | Mouse.move(-127,-127); 29 | delay(1500); 30 | 31 | Keyboard.println("RIGHT"); 32 | Mouse.move(127,0); 33 | Mouse.move(127,0); //Movement cannot be greater than a byte 34 | delay(1500); 35 | 36 | Keyboard.println("CENTER"); 37 | Mouse.move(-127,0); 38 | delay(500); 39 | 40 | delay(5000); 41 | } 42 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/examples/keyboardwithleds/keyboardwithleds.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | USBHID HID; 4 | HIDKeyboard Keyboard(HID); 5 | USBCompositeSerial CompositeSerial; 6 | 7 | void setup() { 8 | HID.begin(CompositeSerial, HID_KEYBOARD); 9 | Keyboard.begin(); // needed for LED support 10 | delay(1000); 11 | } 12 | 13 | void loop() { 14 | CompositeSerial.println(Keyboard.getLEDs()); 15 | } 16 | 17 | 18 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/examples/midiin/midiin.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define SPEAKER_PIN PA0 4 | 5 | class myMidi : public USBMIDI { 6 | virtual void handleNoteOff(unsigned int channel, unsigned int note, unsigned int velocity) { 7 | noTone(SPEAKER_PIN); 8 | } 9 | virtual void handleNoteOn(unsigned int channel, unsigned int note, unsigned int velocity) { 10 | tone(SPEAKER_PIN, (midiNoteFrequency_10ths[note]+5)/10); 11 | } 12 | 13 | }; 14 | 15 | myMidi midi; 16 | USBCompositeSerial CompositeSerial; 17 | 18 | void setup() { 19 | USBComposite.setProductId(0x0030); 20 | pinMode(SPEAKER_PIN, OUTPUT); 21 | midi.registerComponent(); 22 | CompositeSerial.registerComponent(); 23 | USBComposite.begin(); 24 | } 25 | 26 | void loop() { 27 | midi.poll(); 28 | } 29 | 30 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/examples/midiout/midiout.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | const uint8_t notes[] = {60, 62, 64, 65, 67, 69, 71, 72, 61, 63, 66, 68, 70}; 4 | const int numNotes = sizeof(notes)/sizeof(*notes); 5 | 6 | USBMIDI midi; 7 | 8 | void setup() { 9 | USBComposite.setProductId(0x0031); 10 | midi.begin(); 11 | delay(1000); 12 | } 13 | 14 | void loop() { 15 | for (int i=0;i 2 | 3 | #define TXSIZE 256 4 | #define RXSIZE 300 5 | 6 | USBHID HID; 7 | HIDRaw raw(HID); 8 | uint8 buf[RXSIZE]; 9 | 10 | const uint8_t reportDescription[] = { 11 | HID_RAW_REPORT_DESCRIPTOR(TXSIZE,RXSIZE) 12 | }; 13 | 14 | void setup(){ 15 | HID.begin(reportDescription, sizeof(reportDescription)); 16 | raw.begin(); 17 | } 18 | 19 | void loop() { 20 | if (raw.getOutput(buf)) { 21 | for (int i=0;i 2 | 3 | USBHID HID; 4 | HIDJoystick Joystick(HID); 5 | 6 | void setup() { 7 | HID.begin(HID_JOYSTICK); 8 | } 9 | 10 | void loop() { 11 | Joystick.X(0); 12 | delay(500); 13 | Joystick.X(1023); 14 | delay(500); 15 | } 16 | 17 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/examples/simplekeyboard/simplekeyboard.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | USBHID HID; 4 | HIDKeyboard Keyboard(HID); 5 | 6 | void setup() { 7 | HID.begin(HID_KEYBOARD); 8 | Keyboard.begin(); // useful to detect host capslock state and LEDs 9 | delay(1000); 10 | } 11 | 12 | void loop() { 13 | Keyboard.println("Hello world"); 14 | delay(10000); 15 | } 16 | 17 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/examples/twojoysticks/twojoysticks.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | const uint8_t reportDescription[] = { 4 | HID_MOUSE_REPORT_DESCRIPTOR(), 5 | HID_KEYBOARD_REPORT_DESCRIPTOR(), 6 | HID_JOYSTICK_REPORT_DESCRIPTOR(), 7 | HID_JOYSTICK_REPORT_DESCRIPTOR(HID_JOYSTICK_REPORT_ID+1), 8 | }; 9 | 10 | USBCompositeSerial CompositeSerial; 11 | USBHID HID; 12 | HIDJoystick Joystick(HID); 13 | HIDJoystick Joystick2(HID, HID_JOYSTICK_REPORT_ID+1); 14 | 15 | void setup(){ 16 | HID.begin(CompositeSerial, reportDescription, sizeof(reportDescription)); 17 | Joystick.setManualReportMode(true); 18 | Joystick2.setManualReportMode(true); 19 | } 20 | 21 | void loop(){ 22 | Joystick.X(0); 23 | Joystick.Y(0); 24 | Joystick.sliderRight(1023); 25 | Joystick.send(); 26 | CompositeSerial.println("J1:0,0,1023"); 27 | delay(400); 28 | Joystick.X(1023); 29 | Joystick.Y(1023); 30 | Joystick.sliderRight(0); 31 | Joystick.send(); 32 | CompositeSerial.println("J1:1023,1023,0"); 33 | delay(400); 34 | Joystick2.X(0); 35 | Joystick2.Y(0); 36 | Joystick2.sliderRight(1023); 37 | Joystick2.send(); 38 | CompositeSerial.println("J2:0,0,1023"); 39 | delay(400); 40 | Joystick2.X(1023); 41 | Joystick2.Y(1023); 42 | Joystick2.sliderRight(0); 43 | Joystick2.send(); 44 | CompositeSerial.println("J2:1023,1023,0"); 45 | delay(400); 46 | } 47 | 48 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/examples/x360/x360.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | USBXBox360 XBox360; 4 | 5 | void setup() { 6 | XBox360.begin(); 7 | delay(1000); 8 | } 9 | 10 | void loop() { 11 | XBox360.X(-32767); 12 | XBox360.Y(-32767); 13 | delay(1000); 14 | XBox360.X(32767); 15 | XBox360.Y(32767); 16 | delay(1000); 17 | } 18 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/library.properties: -------------------------------------------------------------------------------- 1 | name=USBComposite for STM32F1 2 | version=0.91 3 | author=Various 4 | email=arpruss@gmail.com 5 | sentence=USB HID / MIDI / mass storage library for STM32F1 6 | paragraph=USB HID / MIDI / mass storage library for STM32F1 7 | url=https://github.com/arpruss/USBHID_stm32f1 8 | architectures=STM32F1 9 | maintainer=arpruss@gmail.com 10 | category=Communication -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/scripts/midi_table.py: -------------------------------------------------------------------------------- 1 | from math import * 2 | 3 | def freq(m): 4 | return 27.5 * 2**((m-21)/12.) 5 | 6 | print("static constexpr uint32 midiNoteFrequency_10ths[128] = {", end='') 7 | for i in range(128): 8 | if not i % 16: 9 | print("\n ",end='') 10 | print("%d, " % int(floor(freq(i)*10 + 0.5)), end='') 11 | print("};") -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/scripts/send.py: -------------------------------------------------------------------------------- 1 | from pywinusb import hid 2 | from time import sleep 3 | 4 | SIZE=1 5 | REPORT_ID=20 6 | 7 | def sample_handler(data): 8 | print("Raw data: {0}".format(data)) 9 | 10 | device = hid.HidDeviceFilter(vendor_id = 0x1EAF, product_id = 0x0004).get_devices()[0] 11 | print(device) 12 | device.open() 13 | device.set_raw_data_handler(sample_handler) 14 | 15 | n = 0 16 | while True: 17 | """ 18 | print("sending") 19 | out_report=device.find_output_reports()[0] 20 | buffer=[i for i in range(SIZE+1)] 21 | buffer[0]=REPORT_ID # report id 22 | buffer[-1] = n 23 | out_report.set_raw_data(buffer) 24 | if out_report.send(): 25 | n = (n+1)&0xFF 26 | """ 27 | sleep(0.5) 28 | #sleep(0.005) 29 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/scripts/showhids.py: -------------------------------------------------------------------------------- 1 | from pywinusb import hid 2 | 3 | hid.core.show_hids() 4 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/usb_mass_internal.h: -------------------------------------------------------------------------------- 1 | #ifndef _USB_MASS_INTERNAL_H_ 2 | #define _USB_MASS_INTERNAL_H_ 3 | 4 | extern USBEndpointInfo usbMassEndpoints[]; 5 | 6 | #define MASS_ENDPOINT_TX 0 7 | #define MASS_ENDPOINT_RX 1 8 | #define USB_MASS_RX_ENDP (usbMassEndpoints[MASS_ENDPOINT_RX].address) 9 | #define USB_MASS_TX_ENDP (usbMassEndpoints[MASS_ENDPOINT_TX].address) 10 | #define USB_MASS_RX_ADDR (usbMassEndpoints[MASS_ENDPOINT_RX].pmaAddress) 11 | #define USB_MASS_TX_ADDR (usbMassEndpoints[MASS_ENDPOINT_TX].pmaAddress) 12 | #endif -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/USBComposite/usb_mass_mal.h: -------------------------------------------------------------------------------- 1 | #ifndef __USB_MASS_MAL_H 2 | #define __USB_MASS_MAL_H 3 | 4 | #include 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define SCSI_BLOCK_SIZE 512 12 | 13 | #define USB_MASS_MAX_DRIVES 2 14 | 15 | typedef bool (*MassStorageWriter)(const uint8_t *writebuff, uint32_t startSector, uint16_t numSectors); 16 | typedef bool (*MassStorageReader)(uint8_t *readbuff, uint32_t startSector, uint16_t numSectors); 17 | typedef bool (*MassStorageStatuser)(void); 18 | typedef bool (*MassStorageInitializer)(void); 19 | typedef bool (*MassStorageFormatter)(void); 20 | 21 | typedef struct { 22 | uint32_t blockCount; 23 | MassStorageReader read; 24 | MassStorageWriter write; 25 | MassStorageStatuser status; 26 | MassStorageInitializer init; 27 | MassStorageFormatter format; 28 | } MassStorageDriveInfo; 29 | 30 | extern MassStorageDriveInfo usb_mass_drives[USB_MASS_MAX_DRIVES]; 31 | uint16_t usb_mass_mal_init(uint8_t lun); 32 | uint16_t usb_mass_mal_get_status(uint8_t lun); 33 | uint16_t usb_mass_mal_read_memory(uint8_t lun, uint8_t *readbuff, uint32_t startSector, uint16_t numSectors); 34 | uint16_t usb_mass_mal_write_memory(uint8_t lun, uint8_t *writebuff, uint32_t startSector, uint16_t numSectors); 35 | void usb_mass_mal_format(uint8_t lun); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/WS2812B/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For WS2812B 3 | # Class 4 | ####################################### 5 | 6 | WS2812B KEYWORD1 7 | 8 | ####################################### 9 | # Methods and Functions 10 | ####################################### 11 | 12 | setPixelColor KEYWORD2 13 | numPixels KEYWORD2 14 | Color KEYWORD2 15 | show KEYWORD2 16 | 17 | clear KEYWORD2 18 | updateLength KEYWORD2 19 | 20 | canShow KEYWORD2 21 | 22 | 23 | ####################################### 24 | # Constants 25 | ####################################### 26 | 27 | 28 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/WS2812B/library.properties: -------------------------------------------------------------------------------- 1 | name=WS2812B 2 | version=1.0 3 | author=Roger Clark, based on the Adafruit Neopixel library API 4 | email= 5 | sentence=WS2812B (Neopixel) library 6 | paragraph=WS2812B (Neopixel) library for STM32F1 LibMaple 7 | url= 8 | architectures=STM32F1 9 | maintainer=Roger Clark 10 | category=Uncategorized -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Wire/Wire_slave.h: -------------------------------------------------------------------------------- 1 | #error "Something is trying to include Wire_slave.h when Wire.h is already included, they are mutually exclusive" 2 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Wire/examples/i2c_scanner_softwire/i2c_scanner_softwire.ino: -------------------------------------------------------------------------------- 1 | // -------------------------------------- 2 | // i2c_scanner 3 | // 4 | // 5 | 6 | #include 7 | 8 | SoftWire SWire(PB6, PB7, SOFT_FAST); 9 | 10 | 11 | void setup() { 12 | Serial.begin(115200); 13 | SWire.begin(); 14 | Serial.println("\nSoftware I2C.. Scanner"); 15 | } 16 | 17 | 18 | void loop() { 19 | byte error, address; 20 | int nDevices; 21 | 22 | Serial.println("Scanning..."); 23 | 24 | nDevices = 0; 25 | for(address = 1; address < 127; address++) { 26 | // The i2c_scanner uses the return value of 27 | // the Write.endTransmisstion to see if 28 | // a device did acknowledge to the address. 29 | 30 | SWire.beginTransmission(address); 31 | error = SWire.endTransmission(); 32 | 33 | if (error == 0) { 34 | Serial.print("I2C device found at address 0x"); 35 | if (address < 16) 36 | Serial.print("0"); 37 | Serial.println(address, HEX); 38 | 39 | nDevices++; 40 | } 41 | else if (error == 4) { 42 | Serial.print("Unknown error at address 0x"); 43 | if (address < 16) 44 | Serial.print("0"); 45 | Serial.println(address, HEX); 46 | } 47 | } 48 | if (nDevices == 0) 49 | Serial.println("No I2C devices found"); 50 | else 51 | Serial.println("done"); 52 | 53 | delay(5000); // wait 5 seconds for next scan 54 | } -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Wire/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Datatypes (KEYWORD1) 3 | ####################################### 4 | TwoWire KEYWORD1 5 | SoftWire KEYWORD1 6 | 7 | ####################################### 8 | # Methods and Functions (KEYWORD2) 9 | ####################################### 10 | 11 | 12 | 13 | ####################################### 14 | # Constants (LITERAL1) 15 | ####################################### 16 | SOFT_STANDARD LITERAL1 17 | SOFT_FAST LITERAL1 18 | I2C_FAST_MODE LITERAL1 -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Wire/library.properties: -------------------------------------------------------------------------------- 1 | name=Wire 2 | version=1.0 3 | author=Roger Clark 4 | maintainer= 5 | sentence=Allows the communication between devices or sensors connected via Two Wire Interface Bus. 6 | paragraph= 7 | category=Communication 8 | url=http://www.arduino.cc/en/Reference/Wire 9 | architectures=STM32F1 10 | include=Wire.h,SoftWire.h 11 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/Wire/rules.mk: -------------------------------------------------------------------------------- 1 | #this makefile may not work since HardWire has been changed to the default Wire (TwoWire) 2 | #anyway this file should be useless 3 | 4 | 5 | # Standard things 6 | sp := $(sp).x 7 | dirstack_$(sp) := $(d) 8 | d := $(dir) 9 | BUILDDIRS += $(BUILD_PATH)/$(d) 10 | 11 | # Local flags 12 | CFLAGS_$(d) := $(WIRISH_INCLUDES) $(LIBMAPLE_INCLUDES) 13 | 14 | # Local rules and targets 15 | cSRCS_$(d) := 16 | 17 | cppSRCS_$(d) := WireBase.cpp HardWire.cpp Wire.cpp 18 | 19 | cFILES_$(d) := $(cSRCS_$(d):%=$(d)/%) 20 | cppFILES_$(d) := $(cppSRCS_$(d):%=$(d)/%) 21 | 22 | OBJS_$(d) := $(cFILES_$(d):%.c=$(BUILD_PATH)/%.o) \ 23 | $(cppFILES_$(d):%.cpp=$(BUILD_PATH)/%.o) 24 | DEPS_$(d) := $(OBJS_$(d):%.o=%.d) 25 | 26 | $(OBJS_$(d)): TGT_CFLAGS := $(CFLAGS_$(d)) 27 | 28 | TGT_BIN += $(OBJS_$(d)) 29 | 30 | # Standard things 31 | -include $(DEPS_$(d)) 32 | d := $(dirstack_$(sp)) 33 | sp := $(basename $(sp)) -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/WireSlave/examples/digital_potentiometer/digital_potentiometer.ino: -------------------------------------------------------------------------------- 1 | // I2C Digital Potentiometer 2 | // by Nicholas Zambetti 3 | // and Shawn Bonkowski 4 | 5 | // Demonstrates use of the Wire library 6 | // Controls AD5171 digital potentiometer via I2C/TWI 7 | 8 | // Created 31 March 2006 9 | 10 | // This example code is in the public domain. 11 | 12 | // This example code is in the public domain. 13 | 14 | 15 | #include 16 | 17 | void setup() 18 | { 19 | Wire.begin(); // join i2c bus (address optional for master) 20 | } 21 | 22 | byte val = 0; 23 | 24 | void loop() 25 | { 26 | Wire.beginTransmission(44); // transmit to device #44 (0x2c) 27 | // device address is specified in datasheet 28 | Wire.write(byte(0x00)); // sends instruction byte 29 | Wire.write(val); // sends potentiometer value byte 30 | Wire.endTransmission(); // stop transmitting 31 | 32 | val++; // increment value 33 | if(val == 64) // if reached 64th position (max) 34 | { 35 | val = 0; // start over from lowest value 36 | } 37 | delay(500); 38 | } 39 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/WireSlave/examples/master_reader/master_reader.ino: -------------------------------------------------------------------------------- 1 | // Wire Master Reader 2 | // by Nicholas Zambetti 3 | 4 | // Demonstrates use of the Wire library 5 | // Reads data from an I2C/TWI slave device 6 | // Refer to the "Wire Slave Sender" example for use with this 7 | 8 | // Created 29 March 2006 9 | 10 | // This example code is in the public domain. 11 | 12 | 13 | #include 14 | 15 | void setup() 16 | { 17 | Wire.begin(); // join i2c bus (address optional for master) 18 | Serial.begin(115200); // start serial for output 19 | } 20 | 21 | void loop() 22 | { 23 | Wire.requestFrom(8, 6); // request 6 bytes from slave device #8 24 | 25 | while(Wire.available()) // slave may send less than requested 26 | { 27 | char c = Wire.read(); // receive a byte as character 28 | Serial.print(c); // print the character 29 | } 30 | 31 | delay(500); 32 | } 33 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/WireSlave/examples/master_writer/master_writer.ino: -------------------------------------------------------------------------------- 1 | // Wire Master Writer 2 | // by Nicholas Zambetti 3 | 4 | // Demonstrates use of the Wire library 5 | // Writes data to an I2C/TWI slave device 6 | // Refer to the "Wire Slave Receiver" example for use with this 7 | 8 | // Created 29 March 2006 9 | 10 | // This example code is in the public domain. 11 | 12 | 13 | #include 14 | 15 | void setup() 16 | { 17 | Wire.begin(); // join i2c bus (address optional for master) 18 | } 19 | 20 | byte x = 0; 21 | 22 | void loop() 23 | { 24 | Wire.beginTransmission(4); // transmit to device #4 25 | Wire.write("x is "); // sends five bytes 26 | Wire.write(x); // sends one byte 27 | Wire.endTransmission(); // stop transmitting 28 | 29 | x++; 30 | delay(500); 31 | } 32 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/WireSlave/examples/selftest1/selftest1.ino: -------------------------------------------------------------------------------- 1 | // Wire Slave Receiver 2 | // by Nicholas Zambetti 3 | 4 | // Demonstrates use of the Wire library 5 | // Receives data as an I2C/TWI slave device 6 | // Refer to the "Wire Master Writer" example for use with this 7 | 8 | // Created 29 March 2006 9 | 10 | // This example code is in the public domain. 11 | 12 | // The code is temporarily moved to the code.cpp. 13 | // This makes it possible to set breakpoints in eclipse IDE. 14 | // I'm sure that there is an Eclipse configuration that makes it 15 | // possible for it to detect .ino files as .cpp, but I'm lazy 16 | 17 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/WireSlave/examples/slave_receiver/slave_receiver.ino: -------------------------------------------------------------------------------- 1 | // Wire Slave Receiver 2 | // by Nicholas Zambetti 3 | 4 | // Demonstrates use of the Wire library 5 | // Receives data as an I2C/TWI slave device 6 | // Refer to the "Wire Master Writer" example for use with this 7 | 8 | // Created 29 March 2006 9 | 10 | // This example code is in the public domain. 11 | 12 | 13 | #include 14 | 15 | void setup(){ 16 | Serial.begin(115200); // start serial for output 17 | 18 | Wire.begin(4); // join i2c bus with address #4 19 | Wire.onReceive(receiveEvent); // register event 20 | } 21 | 22 | void loop(){ 23 | delay(100); 24 | } 25 | 26 | // function that executes whenever data is received from master 27 | // this function is registered as an event, see setup() 28 | // Note that it is not advicable to call Serial.print() from within an ISR 29 | void receiveEvent(int howMany){ 30 | while(1 < Wire.available()){ // loop through all but the last 31 | char c = Wire.read(); // receive byte as a character 32 | Serial.print(c); // print the character 33 | } 34 | int x = Wire.read(); // receive byte as an integer 35 | Serial.println(x); // print the integer 36 | } 37 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/WireSlave/examples/slave_sender/slave_sender.ino: -------------------------------------------------------------------------------- 1 | // Wire Slave Sender 2 | // by Nicholas Zambetti 3 | 4 | // Demonstrates use of the Wire library 5 | // Sends data as an I2C/TWI slave device 6 | // Refer to the "Wire Master Reader" example for use with this 7 | 8 | // Created 29 March 2006 9 | 10 | // This example code is in the public domain. 11 | 12 | 13 | #include 14 | 15 | void setup() 16 | { 17 | Wire.begin(8); // join i2c bus with address #8 18 | Wire.onRequest(requestEvent); // register event 19 | } 20 | 21 | void loop() 22 | { 23 | delay(100); 24 | } 25 | 26 | // function that executes whenever data is requested by master 27 | // this function is registered as an event, see setup() 28 | void requestEvent() 29 | { 30 | Wire.write("hello "); // respond with message of 6 bytes 31 | // as expected by master 32 | } 33 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/WireSlave/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For Wire 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | ####################################### 10 | # Methods and Functions (KEYWORD2) 11 | ####################################### 12 | 13 | begin KEYWORD2 14 | setClock KEYWORD2 15 | beginTransmission KEYWORD2 16 | endTransmission KEYWORD2 17 | requestFrom KEYWORD2 18 | onReceive KEYWORD2 19 | onRequest KEYWORD2 20 | 21 | ####################################### 22 | # Instances (KEYWORD2) 23 | ####################################### 24 | 25 | Wire KEYWORD2 26 | Wire1 KEYWORD2 27 | 28 | ####################################### 29 | # Constants (LITERAL1) 30 | ####################################### 31 | 32 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/WireSlave/library.properties: -------------------------------------------------------------------------------- 1 | name=Wire_Slave 2 | version=1.0 3 | author= 4 | email= 5 | sentence=Wire with slave support 6 | paragraph=Experimental Wire with slave support 7 | url= 8 | architectures=STM32F1 9 | maintainer= 10 | category=Communication 11 | include=src/Wire_slave.h 12 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/WireSlave/src/Wire.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Wire_slave.h" 3 | 4 | //#error "Something is trying to include Wire.h when Wire_slave.h is already included, they are mutually exclusive" 5 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/stm_fft/cr4_fft_stm32.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | x[N] be the time signal samples. To use the FFT functions of the DSP library, the 4 | following conditions must be satisfied: 5 | ? All the signal samples must be 32-bit data containing the 16-bit real part followed by the 6 | 16-bit imaginary part (in the little Endian order: imaginary_real). 7 | 8 | 9 | */ 10 | 11 | #ifndef __STM32F10x_DSP_H 12 | #define __STM32F10x_DSP_H 13 | /* 14 | * The assembly files can be modified to use a table in RAM rather than ROM. 15 | * Check the assembly files comments. 16 | * 17 | * #include "table_fft.h" 18 | */ 19 | 20 | 21 | extern "C" { 22 | 23 | /* Radix-4 complex FFT for STM32, in assembly */ 24 | /* 16 points*/ 25 | void cr4_fft_16_stm32(void *pssOUT, void *pssIN, uint16_t Nbin); 26 | 27 | /* 64 points*/ 28 | void cr4_fft_64_stm32(void *pssOUT, void *pssIN, uint16_t Nbin); 29 | 30 | /* 256 points */ 31 | void cr4_fft_256_stm32(void *pssOUT, void *pssIN, uint16_t Nbin); 32 | 33 | /* 1024 points */ 34 | void cr4_fft_1024_stm32(void *pssOUT, void *pssIN, uint16_t Nbin); 35 | 36 | 37 | } 38 | 39 | #endif /* __STM32F10x_DSP_H */ 40 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/libraries/stm_fft/stm32f10x_DSP_lib.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snapmaker/Snapmaker2-Modules/a2fefd5c127ecf9e4158c594ab6ff1e874c32a07/snapmaker/lib/STM32F1/libraries/stm_fft/stm32f10x_DSP_lib.chm -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/libmaple/stm32f1/rules.mk: -------------------------------------------------------------------------------- 1 | # Standard things 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | BUILDDIRS += $(BUILD_PATH)/$(d) 6 | 7 | # Local flags 8 | CFLAGS_$(d) = -I$(d) $(LIBMAPLE_PRIVATE_INCLUDES) $(LIBMAPLE_INCLUDES) -Wall -Werror 9 | ASFLAGS_$(d) = -I$(d) $(LIBMAPLE_PRIVATE_INCLUDES) $(LIBMAPLE_INCLUDES) -Wall -Werror 10 | 11 | # Extra BUILDDIRS 12 | BUILDDIRS += $(BUILD_PATH)/$(d)/$(MCU_F1_LINE) 13 | 14 | # Local rules and targets 15 | sSRCS_$(d) := $(MCU_F1_LINE)/isrs.S 16 | sSRCS_$(d) += $(MCU_F1_LINE)/vector_table.S 17 | 18 | cSRCS_$(d) := adc.c 19 | cSRCS_$(d) += bkp.c 20 | cSRCS_$(d) += dma.c 21 | cSRCS_$(d) += exti.c 22 | cSRCS_$(d) += fsmc.c 23 | cSRCS_$(d) += gpio.c 24 | cSRCS_$(d) += i2c.c 25 | cSRCS_$(d) += rcc.c 26 | cSRCS_$(d) += spi.c 27 | cSRCS_$(d) += timer.c 28 | cSRCS_$(d) += usart.c 29 | 30 | sFILES_$(d) := $(sSRCS_$(d):%=$(d)/%) 31 | cFILES_$(d) := $(cSRCS_$(d):%=$(d)/%) 32 | 33 | OBJS_$(d) := $(sFILES_$(d):%.S=$(BUILD_PATH)/%.o) \ 34 | $(cFILES_$(d):%.c=$(BUILD_PATH)/%.o) 35 | DEPS_$(d) := $(OBJS_$(d):%.o=%.d) 36 | 37 | $(OBJS_$(d)): TGT_ASFLAGS := $(ASFLAGS_$(d)) 38 | $(OBJS_$(d)): TGT_CFLAGS := $(CFLAGS_$(d)) 39 | 40 | TGT_BIN += $(OBJS_$(d)) 41 | 42 | # Standard things 43 | -include $(DEPS_$(d)) 44 | d := $(dirstack_$(sp)) 45 | sp := $(basename $(sp)) 46 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/libmaple/stm32f2/rules.mk: -------------------------------------------------------------------------------- 1 | # Standard things 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | BUILDDIRS += $(BUILD_PATH)/$(d) 6 | 7 | # Local flags 8 | CFLAGS_$(d) = -I$(d) $(LIBMAPLE_INCLUDES) $(LIBMAPLE_PRIVATE_INCLUDES) -Wall -Werror 9 | 10 | # Local rules and targets 11 | sSRCS_$(d) := isrs.S 12 | sSRCS_$(d) += vector_table.S 13 | 14 | cSRCS_$(d) := adc.c 15 | cSRCS_$(d) += dma.c 16 | cSRCS_$(d) += exti.c 17 | cSRCS_$(d) += fsmc.c 18 | cSRCS_$(d) += gpio.c 19 | cSRCS_$(d) += rcc.c 20 | cSRCS_$(d) += spi.c 21 | cSRCS_$(d) += syscfg.c 22 | cSRCS_$(d) += timer.c 23 | cSRCS_$(d) += usart.c 24 | 25 | sFILES_$(d) := $(sSRCS_$(d):%=$(d)/%) 26 | cFILES_$(d) := $(cSRCS_$(d):%=$(d)/%) 27 | 28 | OBJS_$(d) := $(sFILES_$(d):%.S=$(BUILD_PATH)/%.o) \ 29 | $(cFILES_$(d):%.c=$(BUILD_PATH)/%.o) 30 | DEPS_$(d) := $(OBJS_$(d):%.o=%.d) 31 | 32 | $(OBJS_$(d)): TGT_ASFLAGS := 33 | $(OBJS_$(d)): TGT_CFLAGS := $(CFLAGS_$(d)) 34 | 35 | TGT_BIN += $(OBJS_$(d)) 36 | 37 | # Standard things 38 | -include $(DEPS_$(d)) 39 | d := $(dirstack_$(sp)) 40 | sp := $(basename $(sp)) 41 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/libmaple/usb/rules.mk: -------------------------------------------------------------------------------- 1 | # Standard things 2 | sp := $(sp).x 3 | dirstack_$(sp) := $(d) 4 | d := $(dir) 5 | BUILDDIRS += $(BUILD_PATH)/$(d) 6 | 7 | # Local flags 8 | CFLAGS_$(d) = -I$(d) -I$(d)/$(MCU_SERIES) -I$(d)/usb_lib $(LIBMAPLE_INCLUDES) $(LIBMAPLE_PRIVATE_INCLUDES) -Wall 9 | 10 | # Add usblib and series subdirectory to BUILDDIRS. 11 | BUILDDIRS += $(BUILD_PATH)/$(d)/$(MCU_SERIES) 12 | BUILDDIRS += $(BUILD_PATH)/$(d)/usb_lib 13 | 14 | # Local rules and targets 15 | sSRCS_$(d) := 16 | cSRCS_$(d) := 17 | # We currently only have F1 performance line support. Sigh. 18 | ifeq ($(MCU_SERIES), stm32f1) 19 | ifeq ($(MCU_F1_LINE), performance) 20 | cSRCS_$(d) += $(MCU_SERIES)/usb.c 21 | cSRCS_$(d) += $(MCU_SERIES)/usb_reg_map.c 22 | cSRCS_$(d) += $(MCU_SERIES)/usb_cdcacm.c 23 | cSRCS_$(d) += usb_lib/usb_core.c 24 | cSRCS_$(d) += usb_lib/usb_init.c 25 | cSRCS_$(d) += usb_lib/usb_mem.c 26 | cSRCS_$(d) += usb_lib/usb_regs.c 27 | endif 28 | endif 29 | 30 | sFILES_$(d) := $(sSRCS_$(d):%=$(d)/%) 31 | cFILES_$(d) := $(cSRCS_$(d):%=$(d)/%) 32 | 33 | OBJS_$(d) := $(sFILES_$(d):%.S=$(BUILD_PATH)/%.o) \ 34 | $(cFILES_$(d):%.c=$(BUILD_PATH)/%.o) 35 | DEPS_$(d) := $(OBJS_$(d):%.o=%.d) 36 | 37 | $(OBJS_$(d)): TGT_CFLAGS := $(CFLAGS_$(d)) 38 | $(OBJS_$(d)): TGT_ASFLAGS := 39 | 40 | TGT_BIN += $(OBJS_$(d)) 41 | 42 | # Standard things 43 | -include $(DEPS_$(d)) 44 | d := $(dirstack_$(sp)) 45 | sp := $(basename $(sp)) 46 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/doxygen/evil_mangler.awk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/awk -f 2 | 3 | # libmaple's own Evil Mangler 4 | # 5 | # Input filter hack to trick Doxygen into thinking that a series 6 | # header is in a separate namespace. This is necessary because Doxygen 7 | # doesn't know how to cope with two data structures with the same name 8 | # in different places in the project. (We do that all the time, 9 | # e.g. for foo_reg_map structs.) 10 | # 11 | # E.g., an STM32F1 header gets transformed into: 12 | # 13 | # namespace stm32f1 { 14 | # 15 | # } 16 | 17 | BEGIN { 18 | # For extracting series component from header FILENAME. 19 | series_regex = "/stm32[flw][0-9]*/"; 20 | # Holds header FILENAME. Cargo-culted; not sure why it's necessary. 21 | f = ""; 22 | # Holds series component. 23 | series = ""; 24 | } 25 | { 26 | if (f != FILENAME) { 27 | f = FILENAME; 28 | match(f, series_regex); 29 | series = substr(f, RSTART + 1, RLENGTH - 2); 30 | printf("namespace %s {\n", series); 31 | } 32 | print; 33 | } 34 | END { 35 | if (series != "") { 36 | print "}" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/gdb/gpio/gpio.gdb: -------------------------------------------------------------------------------- 1 | set print pretty on 2 | 3 | print "GPIOA registers:" 4 | p/x *GPIOA->regs 5 | print "GPIOB registers:" 6 | p/x *GPIOB->regs 7 | print "GPIOC registers:" 8 | p/x *GPIOC->regs 9 | print "GPIOD registers:" 10 | p/x *GPIOD->regs 11 | print "AFIO registers:" 12 | p/x *(struct afio_reg_map*)0x40010000 13 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/ld/flash.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * libmaple linker script for "Flash" builds. 3 | * 4 | * A Flash build puts .text (and .rodata) in Flash, and 5 | * .data/.bss/heap (of course) in SRAM, but offsets the sections by 6 | * enough space to store the Maple bootloader, which lives in low 7 | * Flash and uses low memory. 8 | */ 9 | 10 | /* 11 | * This pulls in the appropriate MEMORY declaration from the right 12 | * subdirectory of stm32/mem/ (the environment must call ld with the 13 | * right include directory flags to make this happen). Boards can also 14 | * use this file to use any of libmaple's memory-related hooks (like 15 | * where the heap should live). 16 | */ 17 | INCLUDE mem-flash.inc 18 | 19 | /* Provide memory region aliases for common.inc */ 20 | REGION_ALIAS("REGION_TEXT", rom); 21 | REGION_ALIAS("REGION_DATA", ram); 22 | REGION_ALIAS("REGION_BSS", ram); 23 | REGION_ALIAS("REGION_RODATA", rom); 24 | 25 | /* Let common.inc handle the real work. */ 26 | INCLUDE common.inc 27 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/ld/jtag.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * libmaple linker script for "JTAG" builds. 3 | * 4 | * A "JTAG" build puts .text (and .rodata) in Flash, and 5 | * .data/.bss/heap (of course) in SRAM, but links starting at the 6 | * Flash and SRAM starting addresses (0x08000000 and 0x20000000 7 | * respectively). This will wipe out a Maple bootloader if there's one 8 | * on the board, so only use this if you know what you're doing. 9 | * 10 | * Of course, a "JTAG" build is perfectly usable for upload over SWD, 11 | * the system memory bootloader, etc. The name is just a historical 12 | * artifact. 13 | */ 14 | 15 | /* 16 | * This pulls in the appropriate MEMORY declaration from the right 17 | * subdirectory of stm32/mem/ (the environment must call ld with the 18 | * right include directory flags to make this happen). Boards can also 19 | * use this file to use any of libmaple's memory-related hooks (like 20 | * where the heap should live). 21 | */ 22 | INCLUDE mem-jtag.inc 23 | 24 | /* Provide memory region aliases for common.inc */ 25 | REGION_ALIAS("REGION_TEXT", rom); 26 | REGION_ALIAS("REGION_DATA", ram); 27 | REGION_ALIAS("REGION_BSS", ram); 28 | REGION_ALIAS("REGION_RODATA", rom); 29 | 30 | /* Let common.inc handle the real work. */ 31 | INCLUDE common.inc 32 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/ld/ram.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * libmaple linker script for RAM builds. 3 | * 4 | * A Flash build puts .text, .rodata, and .data/.bss/heap (of course) 5 | * in SRAM, but offsets the sections by enough space to store the 6 | * Maple bootloader, which uses low memory. 7 | */ 8 | 9 | /* 10 | * This pulls in the appropriate MEMORY declaration from the right 11 | * subdirectory of stm32/mem/ (the environment must call ld with the 12 | * right include directory flags to make this happen). Boards can also 13 | * use this file to use any of libmaple's memory-related hooks (like 14 | * where the heap should live). 15 | */ 16 | INCLUDE mem-ram.inc 17 | 18 | /* Provide memory region aliases for common.inc */ 19 | REGION_ALIAS("REGION_TEXT", ram); 20 | REGION_ALIAS("REGION_DATA", ram); 21 | REGION_ALIAS("REGION_BSS", ram); 22 | REGION_ALIAS("REGION_RODATA", ram); 23 | 24 | /* Let common.inc handle the real work. */ 25 | INCLUDE common.inc 26 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/ld/stm32/mem/maple_native/maple_native_heap.inc: -------------------------------------------------------------------------------- 1 | /* Specify heap boundary addresses on the external SRAM chip */ 2 | _lm_heap_start = 0x60000000; 3 | _lm_heap_end = 0x60100000; 4 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/ld/stm32/mem/maple_native/mem-flash.inc: -------------------------------------------------------------------------------- 1 | MEMORY 2 | { 3 | ram (rwx) : ORIGIN = 0x20000C00, LENGTH = 61K 4 | rom (rx) : ORIGIN = 0x08005000, LENGTH = 492K 5 | } 6 | 7 | INCLUDE maple_native_heap.inc 8 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/ld/stm32/mem/maple_native/mem-jtag.inc: -------------------------------------------------------------------------------- 1 | MEMORY 2 | { 3 | ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K 4 | rom (rx) : ORIGIN = 0x08000000, LENGTH = 512K 5 | } 6 | 7 | INCLUDE maple_native_heap.inc 8 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/ld/stm32/mem/maple_native/mem-ram.inc: -------------------------------------------------------------------------------- 1 | MEMORY 2 | { 3 | ram (rwx) : ORIGIN = 0x20000C00, LENGTH = 61K 4 | rom (rx) : ORIGIN = 0x08005000, LENGTH = 0K 5 | } 6 | 7 | INCLUDE maple_native_heap.inc 8 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/ld/stm32/mem/sram_112k_flash_1024k/mem-jtag.inc: -------------------------------------------------------------------------------- 1 | MEMORY 2 | { 3 | ram (rwx) : ORIGIN = 0x20000000, LENGTH = 112K 4 | rom (rx) : ORIGIN = 0x08000000, LENGTH = 1024K 5 | } 6 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/ld/stm32/mem/sram_112k_flash_1024k/mem-ram.inc: -------------------------------------------------------------------------------- 1 | MEMORY 2 | { 3 | ram (rwx) : ORIGIN = 0x20000000, LENGTH = 112K 4 | rom (rx) : ORIGIN = 0x08000000, LENGTH = 0K 5 | } 6 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/ld/stm32/mem/sram_20k_flash_128k/mem-flash.inc: -------------------------------------------------------------------------------- 1 | MEMORY 2 | { 3 | ram (rwx) : ORIGIN = 0x20000C00, LENGTH = 17K 4 | rom (rx) : ORIGIN = 0x08005000, LENGTH = 108K 5 | } 6 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/ld/stm32/mem/sram_20k_flash_128k/mem-jtag.inc: -------------------------------------------------------------------------------- 1 | MEMORY 2 | { 3 | ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K 4 | rom (rx) : ORIGIN = 0x08000000, LENGTH = 128K 5 | } 6 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/ld/stm32/mem/sram_20k_flash_128k/mem-ram.inc: -------------------------------------------------------------------------------- 1 | MEMORY 2 | { 3 | ram (rwx) : ORIGIN = 0x20000C00, LENGTH = 17K 4 | rom (rx) : ORIGIN = 0x08005000, LENGTH = 0K 5 | } 6 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/ld/stm32/mem/sram_20k_flash_128k_robotis/mem-flash.inc: -------------------------------------------------------------------------------- 1 | MEMORY 2 | { 3 | ram (rwx) : ORIGIN = 0x20000C00, LENGTH = 17K 4 | rom (rx) : ORIGIN = 0x08003000, LENGTH = 108K 5 | } 6 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/ld/stm32/mem/sram_20k_flash_128k_robotis/mem-jtag.inc: -------------------------------------------------------------------------------- 1 | MEMORY 2 | { 3 | ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K 4 | rom (rx) : ORIGIN = 0x08000000, LENGTH = 128K 5 | } 6 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/ld/stm32/mem/sram_20k_flash_128k_robotis/mem-ram.inc: -------------------------------------------------------------------------------- 1 | MEMORY 2 | { 3 | ram (rwx) : ORIGIN = 0x20000C00, LENGTH = 17K 4 | rom (rx) : ORIGIN = 0x08005000, LENGTH = 0K 5 | } 6 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/ld/stm32/mem/sram_64k_flash_512k/mem-flash.inc: -------------------------------------------------------------------------------- 1 | MEMORY 2 | { 3 | ram (rwx) : ORIGIN = 0x20000C00, LENGTH = 61K 4 | rom (rx) : ORIGIN = 0x08005000, LENGTH = 492K 5 | } 6 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/ld/stm32/mem/sram_64k_flash_512k/mem-jtag.inc: -------------------------------------------------------------------------------- 1 | MEMORY 2 | { 3 | ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K 4 | rom (rx) : ORIGIN = 0x08000000, LENGTH = 512K 5 | } 6 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/ld/stm32/mem/sram_64k_flash_512k/mem-ram.inc: -------------------------------------------------------------------------------- 1 | MEMORY 2 | { 3 | ram (rwx) : ORIGIN = 0x20000C00, LENGTH = 61K 4 | rom (rx) : ORIGIN = 0x08005000, LENGTH = 0K 5 | } 6 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/ld/stm32/mem/sram_8k_flash_128k/mem-flash.inc: -------------------------------------------------------------------------------- 1 | MEMORY 2 | { 3 | ram (rwx) : ORIGIN = 0x20000000, LENGTH = 8K 4 | rom (rx) : ORIGIN = 0x08000000, LENGTH = 128K 5 | } 6 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/ld/stm32/mem/sram_8k_flash_128k/mem-jtag.inc: -------------------------------------------------------------------------------- 1 | MEMORY 2 | { 3 | ram (rwx) : ORIGIN = 0x20000000, LENGTH = 8K 4 | rom (rx) : ORIGIN = 0x08000000, LENGTH = 128K 5 | } 6 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/ld/stm32/mem/sram_8k_flash_128k/mem-ram.inc: -------------------------------------------------------------------------------- 1 | MEMORY 2 | { 3 | ram (rwx) : ORIGIN = 0x20000000, LENGTH = 8K 4 | rom (rx) : ORIGIN = 0x08000000, LENGTH = 0K 5 | } 6 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/ld/toolchains/gcc-arm-embedded/extra_libs.inc: -------------------------------------------------------------------------------- 1 | /* 2 | * Extra archives needed by ARM's GCC ARM Embedded arm-none-eabi- 3 | * releases (https://launchpad.net/gcc-arm-embedded/). 4 | */ 5 | 6 | /* This is for the provided newlib. */ 7 | GROUP(libnosys.a) 8 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/ld/toolchains/generic/extra_libs.inc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snapmaker/Snapmaker2-Modules/a2fefd5c127ecf9e4158c594ab6ff1e874c32a07/snapmaker/lib/STM32F1/system/support/ld/toolchains/generic/extra_libs.inc -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/make/board-includes/VLDiscovery.mk: -------------------------------------------------------------------------------- 1 | MCU := STM32F100RB 2 | PRODUCT_ID := 0003 3 | ERROR_LED_PORT := GPIOC 4 | ERROR_LED_PIN := 9 5 | MCU_SERIES := stm32f1 6 | MCU_F1_LINE := value 7 | LD_MEM_DIR := sram_8k_flash_128k 8 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/make/board-includes/cm900.mk: -------------------------------------------------------------------------------- 1 | MCU := STM32F103C8 2 | PRODUCT_ID := 0003 3 | ERROR_LED_PORT := GPIOB 4 | ERROR_LED_PIN := 2 5 | MCU_SERIES := stm32f1 6 | MCU_F1_LINE := performance 7 | # This crap is due to ld-script limitations. If you know of a better 8 | # way to go about this (like some magic ld switches to specify MEMORY 9 | # at the command line), please tell us! 10 | ifeq ($(BOOTLOADER),maple) 11 | LD_MEM_DIR := sram_20k_flash_128k 12 | endif 13 | ifeq ($(BOOTLOADER),robotis) 14 | LD_MEM_DIR := sram_20k_flash_128k_robotis 15 | endif 16 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/make/board-includes/maple.mk: -------------------------------------------------------------------------------- 1 | MCU := STM32F103RB 2 | PRODUCT_ID := 0003 3 | ERROR_LED_PORT := GPIOA 4 | ERROR_LED_PIN := 5 5 | MCU_SERIES := stm32f1 6 | MCU_F1_LINE := performance 7 | # This crap is due to ld-script limitations. If you know of a better 8 | # way to go about this (like some magic ld switches to specify MEMORY 9 | # at the command line), please tell us! 10 | LD_MEM_DIR := sram_20k_flash_128k 11 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/make/board-includes/maple_RET6.mk: -------------------------------------------------------------------------------- 1 | MCU := STM32F103RE 2 | PRODUCT_ID := 0003 3 | ERROR_LED_PORT := GPIOA 4 | ERROR_LED_PIN := 5 5 | MCU_SERIES := stm32f1 6 | MCU_F1_LINE := performance 7 | LD_MEM_DIR := sram_64k_flash_512k 8 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/make/board-includes/maple_mini.mk: -------------------------------------------------------------------------------- 1 | MCU := STM32F103CB 2 | PRODUCT_ID := 0003 3 | ERROR_LED_PORT := GPIOB 4 | ERROR_LED_PIN := 1 5 | MCU_SERIES := stm32f1 6 | MCU_F1_LINE := performance 7 | LD_MEM_DIR := sram_20k_flash_128k 8 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/make/board-includes/maple_native.mk: -------------------------------------------------------------------------------- 1 | MCU := STM32F103ZE 2 | PRODUCT_ID := 0003 3 | ERROR_LED_PORT := GPIOC 4 | ERROR_LED_PIN := 15 5 | MCU_SERIES := stm32f1 6 | MCU_F1_LINE := performance 7 | LD_MEM_DIR := maple_native # The SRAM chip makes this board special 8 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/make/board-includes/olimex_stm32_h103.mk: -------------------------------------------------------------------------------- 1 | MCU := STM32F103RB 2 | PRODUCT_ID := 0003 3 | ERROR_LED_PORT := GPIOC 4 | ERROR_LED_PIN := 12 5 | MCU_SERIES := stm32f1 6 | MCU_F1_LINE := performance 7 | LD_MEM_DIR := sram_20k_flash_128k 8 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/make/board-includes/opencm904.mk: -------------------------------------------------------------------------------- 1 | MCU := STM32F103CB 2 | PRODUCT_ID := 0003 3 | ERROR_LED_PORT := GPIOB 4 | ERROR_LED_PIN := 9 5 | MCU_SERIES := stm32f1 6 | MCU_F1_LINE := performance 7 | # This crap is due to ld-script limitations. If you know of a better 8 | # way to go about this (like some magic ld switches to specify MEMORY 9 | # at the command line), please tell us! 10 | ifeq ($(BOOTLOADER),maple) 11 | LD_MEM_DIR := sram_20k_flash_128k 12 | endif 13 | ifeq ($(BOOTLOADER),robotis) 14 | LD_MEM_DIR := sram_20k_flash_128k_robotis 15 | endif 16 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/make/board-includes/st_stm3220g_eval.mk: -------------------------------------------------------------------------------- 1 | MCU := STM32F207IG 2 | ERROR_LED_PORT := GPIOG 3 | ERROR_LED_PIN := 6 4 | MCU_SERIES := stm32f2 5 | LD_MEM_DIR := sram_112k_flash_1024k 6 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/make/build-templates.mk: -------------------------------------------------------------------------------- 1 | define LIBMAPLE_MODULE_template 2 | dir := $(1) 3 | include $$(dir)/rules.mk 4 | endef 5 | 6 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/make/footer.mk: -------------------------------------------------------------------------------- 1 | sFILES_$(d) := $(sSRCS_$(d):%=$(d)/%) 2 | cFILES_$(d) := $(cSRCS_$(d):%=$(d)/%) 3 | cppFILES_$(d) := $(cppSRCS_$(d):%=$(d)/%) 4 | 5 | OBJS_$(d) := $(sFILES_$(d):%.S=$(BUILD_PATH)/%.o) \ 6 | $(cFILES_$(d):%.c=$(BUILD_PATH)/%.o) \ 7 | $(cppFILES_$(d):%.cpp=$(BUILD_PATH)/%.o) 8 | DEPS_$(d) := $(OBJS_$(d):%.o=%.d) 9 | 10 | $(OBJS_$(d)): TGT_CFLAGS := $(CFLAGS_$(d)) 11 | $(OBJS_$(d)): TGT_CXXFLAGS := $(CXXFLAGS_$(d)) 12 | $(OBJS_$(d)): TGT_ASFLAGS := $(ASFLAGS_$(d)) 13 | 14 | TGT_BIN += $(OBJS_$(d)) 15 | 16 | -include $(DEPS_$(d)) 17 | d := $(dirstack_$(sp)) 18 | sp := $(basename $(sp)) 19 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/make/header.mk: -------------------------------------------------------------------------------- 1 | sp := $(sp).x 2 | dirstack_$(sp) := $(d) 3 | d := $(dir) 4 | BUILDDIRS += $(BUILD_PATH)/$(d) 5 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/scripts/45-maple.rules: -------------------------------------------------------------------------------- 1 | ATTRS{idProduct}=="1001", ATTRS{idVendor}=="0110", MODE="664", GROUP="plugdev" 2 | ATTRS{idProduct}=="1002", ATTRS{idVendor}=="0110", MODE="664", GROUP="plugdev" 3 | ATTRS{idProduct}=="0003", ATTRS{idVendor}=="1eaf", MODE="664", GROUP="plugdev" SYMLINK+="maple" 4 | ATTRS{idProduct}=="0004", ATTRS{idVendor}=="1eaf", MODE="664", GROUP="plugdev" SYMLINK+="maple" 5 | 6 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/system/support/scripts/win-list-com-ports.py: -------------------------------------------------------------------------------- 1 | # Windows program for listing COM (serial) ports. 2 | # 3 | # enumerate_serial_ports() is by Eli Bendersky: 4 | # 5 | # http://eli.thegreenplace.net/2009/07/31/listing-all-serial-ports-on-windows-with-python/ 6 | 7 | import _winreg as winreg 8 | import itertools 9 | 10 | def enumerate_serial_ports(): 11 | """ Uses the Win32 registry to return an 12 | iterator of serial (COM) ports 13 | existing on this computer. 14 | """ 15 | path = 'HARDWARE\\DEVICEMAP\\SERIALCOMM' 16 | try: 17 | key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, path) 18 | except WindowsError: 19 | raise IterationError 20 | 21 | for i in itertools.count(): 22 | try: 23 | val = winreg.EnumValue(key, i) 24 | yield str(val[1]) 25 | except EnvironmentError: 26 | break 27 | 28 | for com in enumerate_serial_ports(): 29 | print com 30 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/variants/generic_stm32f103t/ld/bootloader_20.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * libmaple linker script for "Flash" builds. 3 | * 4 | * A Flash build puts .text (and .rodata) in Flash, and 5 | * .data/.bss/heap (of course) in SRAM, but offsets the sections by 6 | * enough space to store the Maple bootloader, which lives in low 7 | * Flash and uses low memory. 8 | */ 9 | 10 | /* 11 | * This pulls in the appropriate MEMORY declaration from the right 12 | * subdirectory of stm32/mem/ (the environment must call ld with the 13 | * right include directory flags to make this happen). Boards can also 14 | * use this file to use any of libmaple's memory-related hooks (like 15 | * where the heap should live). 16 | */ 17 | MEMORY 18 | { 19 | ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K 20 | rom (rx) : ORIGIN = 0x08002000, LENGTH = 120K 21 | } 22 | 23 | /* Provide memory region aliases for common.inc */ 24 | REGION_ALIAS("REGION_TEXT", rom); 25 | REGION_ALIAS("REGION_DATA", ram); 26 | REGION_ALIAS("REGION_BSS", ram); 27 | REGION_ALIAS("REGION_RODATA", rom); 28 | 29 | /* Let common.inc handle the real work. */ 30 | INCLUDE common.inc 31 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/variants/generic_stm32f103t/ld/extra_libs.inc: -------------------------------------------------------------------------------- 1 | /* 2 | * Extra archives needed by ARM's GCC ARM Embedded arm-none-eabi- 3 | * releases (https://launchpad.net/gcc-arm-embedded/). 4 | */ 5 | 6 | /* This is for the provided newlib. */ 7 | GROUP(libnosys.a) 8 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/variants/generic_stm32f103t/ld/flash-5C00.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * libmaple linker script for "Flash" builds. 3 | * 4 | * A Flash build puts .text (and .rodata) in Flash, and 5 | * .data/.bss/heap (of course) in SRAM, but offsets the sections by 6 | * enough space to store the Maple bootloader, which lives in low 7 | * Flash and uses low memory. 8 | */ 9 | 10 | /* 11 | * This pulls in the appropriate MEMORY declaration from the right 12 | * subdirectory of stm32/mem/ (the environment must call ld with the 13 | * right include directory flags to make this happen). Boards can also 14 | * use this file to use any of libmaple's memory-related hooks (like 15 | * where the heap should live). 16 | */ 17 | INCLUDE mem-flash-5C00.inc 18 | 19 | /* Provide memory region aliases for common.inc */ 20 | REGION_ALIAS("REGION_TEXT", rom); 21 | REGION_ALIAS("REGION_DATA", ram); 22 | REGION_ALIAS("REGION_BSS", ram); 23 | REGION_ALIAS("REGION_RODATA", rom); 24 | 25 | /* Let common.inc handle the real work. */ 26 | INCLUDE common.inc 27 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/variants/generic_stm32f103t/ld/flash-6000.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * libmaple linker script for "Flash" builds. 3 | * 4 | * A Flash build puts .text (and .rodata) in Flash, and 5 | * .data/.bss/heap (of course) in SRAM, but offsets the sections by 6 | * enough space to store the Maple bootloader, which lives in low 7 | * Flash and uses low memory. 8 | */ 9 | 10 | /* 11 | * This pulls in the appropriate MEMORY declaration from the right 12 | * subdirectory of stm32/mem/ (the environment must call ld with the 13 | * right include directory flags to make this happen). Boards can also 14 | * use this file to use any of libmaple's memory-related hooks (like 15 | * where the heap should live). 16 | */ 17 | INCLUDE mem-flash-6000.inc 18 | 19 | /* Provide memory region aliases for common.inc */ 20 | REGION_ALIAS("REGION_TEXT", rom); 21 | REGION_ALIAS("REGION_DATA", ram); 22 | REGION_ALIAS("REGION_BSS", ram); 23 | REGION_ALIAS("REGION_RODATA", rom); 24 | 25 | /* Let common.inc handle the real work. */ 26 | INCLUDE common.inc 27 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/variants/generic_stm32f103t/ld/flash.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * libmaple linker script for "Flash" builds. 3 | * 4 | * A Flash build puts .text (and .rodata) in Flash, and 5 | * .data/.bss/heap (of course) in SRAM, but offsets the sections by 6 | * enough space to store the Maple bootloader, which lives in low 7 | * Flash and uses low memory. 8 | */ 9 | 10 | /* 11 | * This pulls in the appropriate MEMORY declaration from the right 12 | * subdirectory of stm32/mem/ (the environment must call ld with the 13 | * right include directory flags to make this happen). Boards can also 14 | * use this file to use any of libmaple's memory-related hooks (like 15 | * where the heap should live). 16 | */ 17 | INCLUDE mem-flash.inc 18 | 19 | /* Provide memory region aliases for common.inc */ 20 | REGION_ALIAS("REGION_TEXT", rom); 21 | REGION_ALIAS("REGION_DATA", ram); 22 | REGION_ALIAS("REGION_BSS", ram); 23 | REGION_ALIAS("REGION_RODATA", rom); 24 | 25 | /* Let common.inc handle the real work. */ 26 | INCLUDE common.inc 27 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/variants/generic_stm32f103t/ld/flash_t8.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * libmaple linker script for "Flash" builds. 3 | * 4 | * A Flash build puts .text (and .rodata) in Flash, and 5 | * .data/.bss/heap (of course) in SRAM, but offsets the sections by 6 | * enough space to store the Maple bootloader, which lives in low 7 | * Flash and uses low memory. 8 | */ 9 | 10 | /* 11 | * This pulls in the appropriate MEMORY declaration from the right 12 | * subdirectory of stm32/mem/ (the environment must call ld with the 13 | * right include directory flags to make this happen). Boards can also 14 | * use this file to use any of libmaple's memory-related hooks (like 15 | * where the heap should live). 16 | */ 17 | /*INCLUDE mem-flash.inc*/ 18 | 19 | MEMORY 20 | { 21 | ram (rwx) : ORIGIN = 0x20000C00, LENGTH = 17K 22 | rom (rx) : ORIGIN = 0x08000000, LENGTH = 44K 23 | } 24 | 25 | 26 | /* Provide memory region aliases for common.inc */ 27 | REGION_ALIAS("REGION_TEXT", rom); 28 | REGION_ALIAS("REGION_DATA", ram); 29 | REGION_ALIAS("REGION_BSS", ram); 30 | REGION_ALIAS("REGION_RODATA", rom); 31 | 32 | /* Let common.inc handle the real work. */ 33 | INCLUDE common.inc 34 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/variants/generic_stm32f103t/ld/jtag.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * libmaple linker script for "JTAG" builds. 3 | * 4 | * A "JTAG" build puts .text (and .rodata) in Flash, and 5 | * .data/.bss/heap (of course) in SRAM, but links starting at the 6 | * Flash and SRAM starting addresses (0x08000000 and 0x20000000 7 | * respectively). This will wipe out a Maple bootloader if there's one 8 | * on the board, so only use this if you know what you're doing. 9 | * 10 | * Of course, a "JTAG" build is perfectly usable for upload over SWD, 11 | * the system memory bootloader, etc. The name is just a historical 12 | * artifact. 13 | */ 14 | 15 | /* 16 | * This pulls in the appropriate MEMORY declaration from the right 17 | * subdirectory of stm32/mem/ (the environment must call ld with the 18 | * right include directory flags to make this happen). Boards can also 19 | * use this file to use any of libmaple's memory-related hooks (like 20 | * where the heap should live). 21 | */ 22 | INCLUDE mem-jtag.inc 23 | 24 | /* Provide memory region aliases for common.inc */ 25 | REGION_ALIAS("REGION_TEXT", rom); 26 | REGION_ALIAS("REGION_DATA", ram); 27 | REGION_ALIAS("REGION_BSS", ram); 28 | REGION_ALIAS("REGION_RODATA", rom); 29 | 30 | /* Let common.inc handle the real work. */ 31 | INCLUDE common.inc 32 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/variants/generic_stm32f103t/ld/jtag_t8.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * libmaple linker script for "JTAG" builds. 3 | * 4 | * A "JTAG" build puts .text (and .rodata) in Flash, and 5 | * .data/.bss/heap (of course) in SRAM, but links starting at the 6 | * Flash and SRAM starting addresses (0x08000000 and 0x20000000 7 | * respectively). This will wipe out a Maple bootloader if there's one 8 | * on the board, so only use this if you know what you're doing. 9 | * 10 | * Of course, a "JTAG" build is perfectly usable for upload over SWD, 11 | * the system memory bootloader, etc. The name is just a historical 12 | * artifact. 13 | */ 14 | 15 | /* 16 | * This pulls in the appropriate MEMORY declaration from the right 17 | * subdirectory of stm32/mem/ (the environment must call ld with the 18 | * right include directory flags to make this happen). Boards can also 19 | * use this file to use any of libmaple's memory-related hooks (like 20 | * where the heap should live). 21 | */ 22 | 23 | MEMORY 24 | { 25 | ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K 26 | rom (rx) : ORIGIN = 0x08000000, LENGTH = 64K 27 | } 28 | 29 | /* Provide memory region aliases for common.inc */ 30 | REGION_ALIAS("REGION_TEXT", rom); 31 | REGION_ALIAS("REGION_DATA", ram); 32 | REGION_ALIAS("REGION_BSS", ram); 33 | REGION_ALIAS("REGION_RODATA", rom); 34 | 35 | /* Let common.inc handle the real work. */ 36 | INCLUDE common.inc 37 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/variants/generic_stm32f103t/ld/mem-flash-5C00.inc: -------------------------------------------------------------------------------- 1 | MEMORY 2 | { 3 | ram (rwx) : ORIGIN = 0x20000C00, LENGTH = 17K 4 | rom (rx) : ORIGIN = 0x08005C00, LENGTH = 109K 5 | } 6 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/variants/generic_stm32f103t/ld/mem-flash-6000.inc: -------------------------------------------------------------------------------- 1 | MEMORY 2 | { 3 | ram (rwx) : ORIGIN = 0x20000C00, LENGTH = 17K 4 | rom (rx) : ORIGIN = 0x08006000, LENGTH = 108K 5 | } 6 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/variants/generic_stm32f103t/ld/mem-flash.inc: -------------------------------------------------------------------------------- 1 | MEMORY 2 | { 3 | ram (rwx) : ORIGIN = 0x20000C00, LENGTH = 17K 4 | rom (rx) : ORIGIN = 0x08000000, LENGTH = 108K 5 | } 6 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/variants/generic_stm32f103t/ld/mem-jtag.inc: -------------------------------------------------------------------------------- 1 | MEMORY 2 | { 3 | ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K 4 | rom (rx) : ORIGIN = 0x08000000, LENGTH = 128K 5 | } 6 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/variants/generic_stm32f103t/ld/mem-ram.inc: -------------------------------------------------------------------------------- 1 | MEMORY 2 | { 3 | ram (rwx) : ORIGIN = 0x20000C00, LENGTH = 17K 4 | rom (rx) : ORIGIN = 0x08005000, LENGTH = 0K 5 | } 6 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/variants/generic_stm32f103t/ld/ram.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * libmaple linker script for RAM builds. 3 | * 4 | * A Flash build puts .text, .rodata, and .data/.bss/heap (of course) 5 | * in SRAM, but offsets the sections by enough space to store the 6 | * Maple bootloader, which uses low memory. 7 | */ 8 | 9 | /* 10 | * This pulls in the appropriate MEMORY declaration from the right 11 | * subdirectory of stm32/mem/ (the environment must call ld with the 12 | * right include directory flags to make this happen). Boards can also 13 | * use this file to use any of libmaple's memory-related hooks (like 14 | * where the heap should live). 15 | */ 16 | INCLUDE mem-ram.inc 17 | 18 | /* Provide memory region aliases for common.inc */ 19 | REGION_ALIAS("REGION_TEXT", ram); 20 | REGION_ALIAS("REGION_DATA", ram); 21 | REGION_ALIAS("REGION_BSS", ram); 22 | REGION_ALIAS("REGION_RODATA", ram); 23 | 24 | /* Let common.inc handle the real work. */ 25 | INCLUDE common.inc 26 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/variants/generic_stm32f103t/ld/ram_t8.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * libmaple linker script for RAM builds. 3 | * 4 | * A Flash build puts .text, .rodata, and .data/.bss/heap (of course) 5 | * in SRAM, but offsets the sections by enough space to store the 6 | * Maple bootloader, which uses low memory. 7 | */ 8 | 9 | /* 10 | * This pulls in the appropriate MEMORY declaration from the right 11 | * subdirectory of stm32/mem/ (the environment must call ld with the 12 | * right include directory flags to make this happen). Boards can also 13 | * use this file to use any of libmaple's memory-related hooks (like 14 | * where the heap should live). 15 | */ 16 | /*INCLUDE mem-ram.inc*/ 17 | MEMORY 18 | { 19 | ram (rwx) : ORIGIN = 0x20000C00, LENGTH = 17K 20 | rom (rx) : ORIGIN = 0x08005000, LENGTH = 0 21 | } 22 | 23 | 24 | /* Provide memory region aliases for common.inc */ 25 | REGION_ALIAS("REGION_TEXT", ram); 26 | REGION_ALIAS("REGION_DATA", ram); 27 | REGION_ALIAS("REGION_BSS", ram); 28 | REGION_ALIAS("REGION_RODATA", ram); 29 | 30 | /* Let common.inc handle the real work. */ 31 | INCLUDE common.inc 32 | -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/variants/generic_stm32f103t/pins_arduino.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | // API compatibility 6 | #include "variant.h" -------------------------------------------------------------------------------- /snapmaker/lib/STM32F1/variants/generic_stm32f103t/variant.h: -------------------------------------------------------------------------------- 1 | #ifndef _VARIANT_ARDUINO_STM32_ 2 | #define _VARIANT_ARDUINO_STM32_ 3 | 4 | #define digitalPinToPort(P) ( PIN_MAP[P].gpio_device ) 5 | #define digitalPinToBitMask(P) ( BIT(PIN_MAP[P].gpio_bit) ) 6 | #define portOutputRegister(port) ( &(port->regs->ODR) ) 7 | #define portInputRegister(port) ( &(port->regs->IDR) ) 8 | 9 | #define portSetRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->BSRR) ) 10 | #define portClearRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->BRR) ) 11 | 12 | #define portConfigRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->CRL) ) 13 | 14 | static const uint8_t SS = BOARD_SPI1_NSS_PIN; 15 | 16 | static const uint8_t MOSI = BOARD_SPI1_MOSI_PIN; 17 | static const uint8_t MISO = BOARD_SPI1_MISO_PIN; 18 | static const uint8_t SCK = BOARD_SPI1_SCK_PIN; 19 | 20 | #endif /* _VARIANT_ARDUINO_STM32_ */ -------------------------------------------------------------------------------- /snapmaker/sm2_modules_bootloader.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snapmaker/Snapmaker2-Modules/a2fefd5c127ecf9e4158c594ab6ff1e874c32a07/snapmaker/sm2_modules_bootloader.bin --------------------------------------------------------------------------------