├── .gitignore ├── 1.Hardware ├── Gerber_PCB_EasyGPS_V1.4_2024-06-16.zip └── README.md ├── 2.Firmware ├── .gitignore ├── README.md ├── include │ └── README ├── lib │ ├── ESP32-BLE-Combo │ │ ├── BleCombo.cpp │ │ ├── BleCombo.h │ │ ├── BleGamepad.h │ │ ├── BleKeyboard.h │ │ ├── BleMouse.h │ │ ├── Gamepad.cpp │ │ ├── Keyboard.cpp │ │ ├── Mouse.cpp │ │ ├── README.md │ │ ├── examples │ │ │ ├── MouseButtons │ │ │ │ └── MouseButtons.ino │ │ │ ├── SendButtons │ │ │ │ └── SendButtons.ino │ │ │ └── SendKeyStrokes │ │ │ │ └── SendKeyStrokes.ino │ │ ├── keywords.txt │ │ └── library.properties │ ├── FastLED │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── PORTING.md │ │ ├── README.md │ │ ├── ci │ │ │ ├── ci-compile │ │ │ └── ci-flags.py │ │ ├── code_of_conduct.md │ │ ├── component.mk │ │ ├── docs │ │ │ ├── Doxyfile │ │ │ ├── DoxygenLayout.xml │ │ │ └── include │ │ │ │ ├── fastled-docs.css │ │ │ │ ├── fastled_logo.png │ │ │ │ ├── footer.html │ │ │ │ └── header.html │ │ ├── examples │ │ │ ├── AnalogOutput │ │ │ │ └── AnalogOutput.ino │ │ │ ├── Blink │ │ │ │ └── Blink.ino │ │ │ ├── ColorPalette │ │ │ │ └── ColorPalette.ino │ │ │ ├── ColorTemperature │ │ │ │ └── ColorTemperature.ino │ │ │ ├── Cylon │ │ │ │ └── Cylon.ino │ │ │ ├── DemoReel100 │ │ │ │ └── DemoReel100.ino │ │ │ ├── Fire2012 │ │ │ │ └── Fire2012.ino │ │ │ ├── Fire2012WithPalette │ │ │ │ └── Fire2012WithPalette.ino │ │ │ ├── FirstLight │ │ │ │ └── FirstLight.ino │ │ │ ├── Multiple │ │ │ │ ├── ArrayOfLedArrays │ │ │ │ │ └── ArrayOfLedArrays.ino │ │ │ │ ├── MirroringSample │ │ │ │ │ └── MirroringSample.ino │ │ │ │ ├── MultiArrays │ │ │ │ │ └── MultiArrays.ino │ │ │ │ ├── MultipleStripsInOneArray │ │ │ │ │ └── MultipleStripsInOneArray.ino │ │ │ │ ├── OctoWS2811Demo │ │ │ │ │ └── OctoWS2811Demo.ino │ │ │ │ └── ParallelOutputDemo │ │ │ │ │ └── ParallelOutputDemo.ino │ │ │ ├── Noise │ │ │ │ └── Noise.ino │ │ │ ├── NoisePlayground │ │ │ │ └── NoisePlayground.ino │ │ │ ├── NoisePlusPalette │ │ │ │ └── NoisePlusPalette.ino │ │ │ ├── Pacifica │ │ │ │ └── Pacifica.ino │ │ │ ├── Pintest │ │ │ │ └── Pintest.ino │ │ │ ├── Ports │ │ │ │ └── PJRCSpectrumAnalyzer │ │ │ │ │ └── PJRCSpectrumAnalyzer.ino │ │ │ ├── Pride2015 │ │ │ │ └── Pride2015.ino │ │ │ ├── RGBCalibrate │ │ │ │ └── RGBCalibrate.ino │ │ │ ├── RGBSetDemo │ │ │ │ └── RGBSetDemo.ino │ │ │ ├── SmartMatrix │ │ │ │ └── SmartMatrix.ino │ │ │ ├── TwinkleFox │ │ │ │ └── TwinkleFox.ino │ │ │ └── XYMatrix │ │ │ │ └── XYMatrix.ino │ │ ├── extras │ │ │ ├── AppleII.s65 │ │ │ ├── FastLED6502.s65 │ │ │ ├── RainbowDemo.bin.zip │ │ │ └── RainbowDemo.s65 │ │ ├── keywords.txt │ │ ├── library.json │ │ ├── release_notes.md │ │ ├── src │ │ │ ├── FastLED.cpp │ │ │ ├── FastLED.h │ │ │ ├── bitswap.cpp │ │ │ ├── bitswap.h │ │ │ ├── chipsets.h │ │ │ ├── color.h │ │ │ ├── colorpalettes.cpp │ │ │ ├── colorpalettes.h │ │ │ ├── colorutils.cpp │ │ │ ├── colorutils.h │ │ │ ├── controller.h │ │ │ ├── cpp_compat.h │ │ │ ├── dmx.h │ │ │ ├── fastled_config.h │ │ │ ├── fastled_delay.h │ │ │ ├── fastled_progmem.h │ │ │ ├── fastpin.h │ │ │ ├── fastspi.h │ │ │ ├── fastspi_bitbang.h │ │ │ ├── fastspi_dma.h │ │ │ ├── fastspi_nop.h │ │ │ ├── fastspi_ref.h │ │ │ ├── fastspi_types.h │ │ │ ├── hsv2rgb.cpp │ │ │ ├── hsv2rgb.h │ │ │ ├── led_sysdefs.h │ │ │ ├── lib8tion.cpp │ │ │ ├── lib8tion.h │ │ │ ├── lib8tion │ │ │ │ ├── math8.h │ │ │ │ ├── random8.h │ │ │ │ ├── scale8.h │ │ │ │ └── trig8.h │ │ │ ├── noise.cpp │ │ │ ├── noise.h │ │ │ ├── pixelset.h │ │ │ ├── pixeltypes.h │ │ │ ├── platforms.cpp │ │ │ ├── platforms.h │ │ │ ├── platforms │ │ │ │ ├── apollo3 │ │ │ │ │ ├── clockless_apollo3.h │ │ │ │ │ ├── fastled_apollo3.h │ │ │ │ │ ├── fastpin_apollo3.h │ │ │ │ │ ├── fastspi_apollo3.h │ │ │ │ │ └── led_sysdefs_apollo3.h │ │ │ │ ├── arm │ │ │ │ │ ├── common │ │ │ │ │ │ └── m0clockless.h │ │ │ │ │ ├── d21 │ │ │ │ │ │ ├── clockless_arm_d21.h │ │ │ │ │ │ ├── fastled_arm_d21.h │ │ │ │ │ │ ├── fastpin_arm_d21.h │ │ │ │ │ │ └── led_sysdefs_arm_d21.h │ │ │ │ │ ├── d51 │ │ │ │ │ │ ├── README.txt │ │ │ │ │ │ ├── clockless_arm_d51.h │ │ │ │ │ │ ├── fastled_arm_d51.h │ │ │ │ │ │ ├── fastpin_arm_d51.h │ │ │ │ │ │ └── led_sysdefs_arm_d51.h │ │ │ │ │ ├── k20 │ │ │ │ │ │ ├── clockless_arm_k20.h │ │ │ │ │ │ ├── clockless_block_arm_k20.h │ │ │ │ │ │ ├── fastled_arm_k20.h │ │ │ │ │ │ ├── fastpin_arm_k20.h │ │ │ │ │ │ ├── fastspi_arm_k20.h │ │ │ │ │ │ ├── led_sysdefs_arm_k20.h │ │ │ │ │ │ ├── octows2811_controller.h │ │ │ │ │ │ ├── smartmatrix_t3.h │ │ │ │ │ │ └── ws2812serial_controller.h │ │ │ │ │ ├── k66 │ │ │ │ │ │ ├── clockless_arm_k66.h │ │ │ │ │ │ ├── clockless_block_arm_k66.h │ │ │ │ │ │ ├── fastled_arm_k66.h │ │ │ │ │ │ ├── fastpin_arm_k66.h │ │ │ │ │ │ ├── fastspi_arm_k66.h │ │ │ │ │ │ └── led_sysdefs_arm_k66.h │ │ │ │ │ ├── kl26 │ │ │ │ │ │ ├── clockless_arm_kl26.h │ │ │ │ │ │ ├── fastled_arm_kl26.h │ │ │ │ │ │ ├── fastpin_arm_kl26.h │ │ │ │ │ │ ├── fastspi_arm_kl26.h │ │ │ │ │ │ └── led_sysdefs_arm_kl26.h │ │ │ │ │ ├── mxrt1062 │ │ │ │ │ │ ├── block_clockless_arm_mxrt1062.h │ │ │ │ │ │ ├── clockless_arm_mxrt1062.h │ │ │ │ │ │ ├── fastled_arm_mxrt1062.h │ │ │ │ │ │ ├── fastpin_arm_mxrt1062.h │ │ │ │ │ │ ├── fastspi_arm_mxrt1062.h │ │ │ │ │ │ ├── led_sysdefs_arm_mxrt1062.h │ │ │ │ │ │ └── octows2811_controller.h │ │ │ │ │ ├── nrf51 │ │ │ │ │ │ ├── clockless_arm_nrf51.h │ │ │ │ │ │ ├── fastled_arm_nrf51.h │ │ │ │ │ │ ├── fastpin_arm_nrf51.h │ │ │ │ │ │ ├── fastspi_arm_nrf51.h │ │ │ │ │ │ └── led_sysdefs_arm_nrf51.h │ │ │ │ │ ├── nrf52 │ │ │ │ │ │ ├── arbiter_nrf52.h │ │ │ │ │ │ ├── clockless_arm_nrf52.h │ │ │ │ │ │ ├── fastled_arm_nrf52.h │ │ │ │ │ │ ├── fastpin_arm_nrf52.h │ │ │ │ │ │ ├── fastpin_arm_nrf52_variants.h │ │ │ │ │ │ ├── fastspi_arm_nrf52.h │ │ │ │ │ │ └── led_sysdefs_arm_nrf52.h │ │ │ │ │ ├── rp2040 │ │ │ │ │ │ ├── clockless_arm_rp2040.h │ │ │ │ │ │ ├── fastled_arm_rp2040.h │ │ │ │ │ │ ├── fastpin_arm_rp2040.h │ │ │ │ │ │ ├── led_sysdefs_arm_rp2040.h │ │ │ │ │ │ ├── pio_asm.h │ │ │ │ │ │ └── pio_gen.h │ │ │ │ │ ├── sam │ │ │ │ │ │ ├── clockless_arm_sam.h │ │ │ │ │ │ ├── clockless_block_arm_sam.h │ │ │ │ │ │ ├── fastled_arm_sam.h │ │ │ │ │ │ ├── fastpin_arm_sam.h │ │ │ │ │ │ ├── fastspi_arm_sam.h │ │ │ │ │ │ └── led_sysdefs_arm_sam.h │ │ │ │ │ └── stm32 │ │ │ │ │ │ ├── clockless_arm_stm32.h │ │ │ │ │ │ ├── cm3_regs.h │ │ │ │ │ │ ├── fastled_arm_stm32.h │ │ │ │ │ │ ├── fastpin_arm_stm32.h │ │ │ │ │ │ └── led_sysdefs_arm_stm32.h │ │ │ │ ├── avr │ │ │ │ │ ├── clockless_trinket.h │ │ │ │ │ ├── fastled_avr.h │ │ │ │ │ ├── fastpin_avr.h │ │ │ │ │ ├── fastspi_avr.h │ │ │ │ │ └── led_sysdefs_avr.h │ │ │ │ ├── esp │ │ │ │ │ ├── 32 │ │ │ │ │ │ ├── clockless_block_esp32.h │ │ │ │ │ │ ├── clockless_i2s_esp32.h │ │ │ │ │ │ ├── clockless_rmt_esp32.cpp │ │ │ │ │ │ ├── clockless_rmt_esp32.h │ │ │ │ │ │ ├── fastled_esp32.h │ │ │ │ │ │ ├── fastpin_esp32.h │ │ │ │ │ │ ├── fastspi_esp32.h │ │ │ │ │ │ └── led_sysdefs_esp32.h │ │ │ │ │ └── 8266 │ │ │ │ │ │ ├── clockless_block_esp8266.h │ │ │ │ │ │ ├── clockless_esp8266.h │ │ │ │ │ │ ├── fastled_esp8266.h │ │ │ │ │ │ ├── fastpin_esp8266.h │ │ │ │ │ │ ├── fastspi_esp8266.h │ │ │ │ │ │ └── led_sysdefs_esp8266.h │ │ │ │ └── fastspi_ardunio_core.h │ │ │ ├── power_mgt.cpp │ │ │ ├── power_mgt.h │ │ │ └── wiring.cpp │ │ └── workspace.code-workspace │ ├── NimBLE-Arduino │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── docs │ │ │ ├── Bluetooth 5 features.md │ │ │ ├── Command_line_config.md │ │ │ ├── Doxyfile │ │ │ ├── Improvements_and_updates.md │ │ │ ├── Migration_guide.md │ │ │ ├── New_user_guide.md │ │ │ ├── Usage_tips.md │ │ │ └── index.md │ │ ├── examples │ │ │ ├── BLE_Beacon_Scanner │ │ │ │ ├── BLE_Beacon_Scanner.ino │ │ │ │ └── BLE_Beacon_Scanner.md │ │ │ ├── BLE_EddystoneTLM_Beacon │ │ │ │ ├── BLE_EddystoneTLM_Beacon.ino │ │ │ │ └── BLE_EddystoneTLM_Beacon.md │ │ │ ├── BLE_EddystoneURL_Beacon │ │ │ │ ├── BLE_EddystoneURL_Beacon.ino │ │ │ │ └── BLE_EddystoneURL_Beacon.md │ │ │ ├── Bluetooth_5 │ │ │ │ ├── NimBLE_extended_client │ │ │ │ │ └── NimBLE_extended_client.ino │ │ │ │ ├── NimBLE_extended_server │ │ │ │ │ └── NimBLE_extended_server.ino │ │ │ │ └── NimBLE_multi_advertiser │ │ │ │ │ └── NimBLE_multi_advertiser.ino │ │ │ ├── NimBLE_Client │ │ │ │ └── NimBLE_Client.ino │ │ │ ├── NimBLE_Scan_Continuous │ │ │ │ └── NimBLE_Scan_Continuous.ino │ │ │ ├── NimBLE_Scan_Whitelist │ │ │ │ └── NimBLE_Scan_whitelist.ino │ │ │ ├── NimBLE_Secure_Client │ │ │ │ └── NimBLE_Secure_Client.ino │ │ │ ├── NimBLE_Secure_Server │ │ │ │ └── NimBLE_Secure_Server.ino │ │ │ ├── NimBLE_Server │ │ │ │ └── NimBLE_Server.ino │ │ │ ├── NimBLE_Server_Whitelist │ │ │ │ └── NimBLE_Server_Whitelist.ino │ │ │ ├── NimBLE_Service_Data_Advertiser │ │ │ │ └── NimBLE_Service_Data_Advertiser.ino │ │ │ └── Refactored_original_examples │ │ │ │ ├── BLE_client │ │ │ │ └── BLE_client.ino │ │ │ │ ├── BLE_iBeacon │ │ │ │ └── BLE_iBeacon.ino │ │ │ │ ├── BLE_notify │ │ │ │ └── BLE_notify.ino │ │ │ │ ├── BLE_scan │ │ │ │ └── BLE_scan.ino │ │ │ │ ├── BLE_server │ │ │ │ └── BLE_server.ino │ │ │ │ ├── BLE_server_multiconnect │ │ │ │ └── BLE_server_multiconnect.ino │ │ │ │ ├── BLE_uart │ │ │ │ └── BLE_uart.ino │ │ │ │ └── BLE_write │ │ │ │ └── BLE_write.ino │ │ ├── library.properties │ │ └── src │ │ │ ├── HIDKeyboardTypes.h │ │ │ ├── HIDTypes.h │ │ │ ├── NimBLE2904.cpp │ │ │ ├── NimBLE2904.h │ │ │ ├── NimBLEAddress.cpp │ │ │ ├── NimBLEAddress.h │ │ │ ├── NimBLEAdvertisedDevice.cpp │ │ │ ├── NimBLEAdvertisedDevice.h │ │ │ ├── NimBLEAdvertising.cpp │ │ │ ├── NimBLEAdvertising.h │ │ │ ├── NimBLEAttValue.h │ │ │ ├── NimBLEBeacon.cpp │ │ │ ├── NimBLEBeacon.h │ │ │ ├── NimBLECharacteristic.cpp │ │ │ ├── NimBLECharacteristic.h │ │ │ ├── NimBLEClient.cpp │ │ │ ├── NimBLEClient.h │ │ │ ├── NimBLEConnInfo.h │ │ │ ├── NimBLEDescriptor.cpp │ │ │ ├── NimBLEDescriptor.h │ │ │ ├── NimBLEDevice.cpp │ │ │ ├── NimBLEDevice.h │ │ │ ├── NimBLEEddystoneTLM.cpp │ │ │ ├── NimBLEEddystoneTLM.h │ │ │ ├── NimBLEEddystoneURL.cpp │ │ │ ├── NimBLEEddystoneURL.h │ │ │ ├── NimBLEExtAdvertising.cpp │ │ │ ├── NimBLEExtAdvertising.h │ │ │ ├── NimBLEHIDDevice.cpp │ │ │ ├── NimBLEHIDDevice.h │ │ │ ├── NimBLELog.h │ │ │ ├── NimBLERemoteCharacteristic.cpp │ │ │ ├── NimBLERemoteCharacteristic.h │ │ │ ├── NimBLERemoteDescriptor.cpp │ │ │ ├── NimBLERemoteDescriptor.h │ │ │ ├── NimBLERemoteService.cpp │ │ │ ├── NimBLERemoteService.h │ │ │ ├── NimBLEScan.cpp │ │ │ ├── NimBLEScan.h │ │ │ ├── NimBLESecurity.cpp │ │ │ ├── NimBLESecurity.h │ │ │ ├── NimBLEServer.cpp │ │ │ ├── NimBLEServer.h │ │ │ ├── NimBLEService.cpp │ │ │ ├── NimBLEService.h │ │ │ ├── NimBLEUUID.cpp │ │ │ ├── NimBLEUUID.h │ │ │ ├── NimBLEUtils.cpp │ │ │ ├── NimBLEUtils.h │ │ │ ├── nimble │ │ │ ├── CODING_STANDARDS.md │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ ├── README.md │ │ │ ├── RELEASE_NOTES.md │ │ │ ├── console │ │ │ │ └── console.h │ │ │ ├── esp_port │ │ │ │ ├── esp-hci │ │ │ │ │ ├── include │ │ │ │ │ │ ├── esp_compiler.h │ │ │ │ │ │ └── esp_nimble_hci.h │ │ │ │ │ └── src │ │ │ │ │ │ └── esp_nimble_hci.c │ │ │ │ └── port │ │ │ │ │ ├── include │ │ │ │ │ ├── esp_nimble_cfg.h │ │ │ │ │ └── esp_nimble_mem.h │ │ │ │ │ └── src │ │ │ │ │ └── esp_nimble_mem.c │ │ │ ├── ext │ │ │ │ └── tinycrypt │ │ │ │ │ ├── AUTHORS │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README │ │ │ │ │ ├── VERSION │ │ │ │ │ ├── documentation │ │ │ │ │ └── tinycrypt.rst │ │ │ │ │ ├── include │ │ │ │ │ └── tinycrypt │ │ │ │ │ │ ├── aes.h │ │ │ │ │ │ ├── cbc_mode.h │ │ │ │ │ │ ├── ccm_mode.h │ │ │ │ │ │ ├── cmac_mode.h │ │ │ │ │ │ ├── constants.h │ │ │ │ │ │ ├── ctr_mode.h │ │ │ │ │ │ ├── ctr_prng.h │ │ │ │ │ │ ├── ecc.h │ │ │ │ │ │ ├── ecc_dh.h │ │ │ │ │ │ ├── ecc_dsa.h │ │ │ │ │ │ ├── ecc_platform_specific.h │ │ │ │ │ │ ├── hmac.h │ │ │ │ │ │ ├── hmac_prng.h │ │ │ │ │ │ ├── sha256.h │ │ │ │ │ │ └── utils.h │ │ │ │ │ └── src │ │ │ │ │ ├── aes_decrypt.c │ │ │ │ │ ├── aes_encrypt.c │ │ │ │ │ ├── cbc_mode.c │ │ │ │ │ ├── ccm_mode.c │ │ │ │ │ ├── cmac_mode.c │ │ │ │ │ ├── ctr_mode.c │ │ │ │ │ ├── ctr_prng.c │ │ │ │ │ ├── ecc.c │ │ │ │ │ ├── ecc_dh.c │ │ │ │ │ ├── ecc_dsa.c │ │ │ │ │ ├── ecc_platform_specific.c │ │ │ │ │ ├── hmac.c │ │ │ │ │ ├── hmac_prng.c │ │ │ │ │ ├── sha256.c │ │ │ │ │ └── utils.c │ │ │ ├── nimble │ │ │ │ ├── controller │ │ │ │ │ ├── include │ │ │ │ │ │ └── controller │ │ │ │ │ │ │ ├── ble_hw.h │ │ │ │ │ │ │ ├── ble_ll.h │ │ │ │ │ │ │ ├── ble_ll_adv.h │ │ │ │ │ │ │ ├── ble_ll_conn.h │ │ │ │ │ │ │ ├── ble_ll_ctrl.h │ │ │ │ │ │ │ ├── ble_ll_hci.h │ │ │ │ │ │ │ ├── ble_ll_iso.h │ │ │ │ │ │ │ ├── ble_ll_resolv.h │ │ │ │ │ │ │ ├── ble_ll_rfmgmt.h │ │ │ │ │ │ │ ├── ble_ll_scan.h │ │ │ │ │ │ │ ├── ble_ll_sched.h │ │ │ │ │ │ │ ├── ble_ll_sync.h │ │ │ │ │ │ │ ├── ble_ll_test.h │ │ │ │ │ │ │ ├── ble_ll_trace.h │ │ │ │ │ │ │ ├── ble_ll_utils.h │ │ │ │ │ │ │ ├── ble_ll_whitelist.h │ │ │ │ │ │ │ ├── ble_phy.h │ │ │ │ │ │ │ └── ble_phy_trace.h │ │ │ │ │ └── src │ │ │ │ │ │ ├── ble_ll.c │ │ │ │ │ │ ├── ble_ll_adv.c │ │ │ │ │ │ ├── ble_ll_conn.c │ │ │ │ │ │ ├── ble_ll_conn_hci.c │ │ │ │ │ │ ├── ble_ll_conn_priv.h │ │ │ │ │ │ ├── ble_ll_ctrl.c │ │ │ │ │ │ ├── ble_ll_dtm.c │ │ │ │ │ │ ├── ble_ll_dtm_priv.h │ │ │ │ │ │ ├── ble_ll_hci.c │ │ │ │ │ │ ├── ble_ll_hci_ev.c │ │ │ │ │ │ ├── ble_ll_iso.c │ │ │ │ │ │ ├── ble_ll_priv.h │ │ │ │ │ │ ├── ble_ll_rand.c │ │ │ │ │ │ ├── ble_ll_resolv.c │ │ │ │ │ │ ├── ble_ll_rfmgmt.c │ │ │ │ │ │ ├── ble_ll_scan.c │ │ │ │ │ │ ├── ble_ll_sched.c │ │ │ │ │ │ ├── ble_ll_supp_cmd.c │ │ │ │ │ │ ├── ble_ll_sync.c │ │ │ │ │ │ ├── ble_ll_trace.c │ │ │ │ │ │ ├── ble_ll_utils.c │ │ │ │ │ │ └── ble_ll_whitelist.c │ │ │ │ ├── drivers │ │ │ │ │ ├── nrf51 │ │ │ │ │ │ ├── include │ │ │ │ │ │ │ └── ble │ │ │ │ │ │ │ │ └── xcvr.h │ │ │ │ │ │ └── src │ │ │ │ │ │ │ ├── ble_hw.c │ │ │ │ │ │ │ └── ble_phy.c │ │ │ │ │ └── nrf52 │ │ │ │ │ │ ├── include │ │ │ │ │ │ └── ble │ │ │ │ │ │ │ └── xcvr.h │ │ │ │ │ │ └── src │ │ │ │ │ │ ├── ble_hw.c │ │ │ │ │ │ ├── ble_phy.c │ │ │ │ │ │ └── ble_phy_trace.c │ │ │ │ ├── host │ │ │ │ │ ├── include │ │ │ │ │ │ └── host │ │ │ │ │ │ │ ├── ble_att.h │ │ │ │ │ │ │ ├── ble_eddystone.h │ │ │ │ │ │ │ ├── ble_gap.h │ │ │ │ │ │ │ ├── ble_gatt.h │ │ │ │ │ │ │ ├── ble_hs.h │ │ │ │ │ │ │ ├── ble_hs_adv.h │ │ │ │ │ │ │ ├── ble_hs_hci.h │ │ │ │ │ │ │ ├── ble_hs_id.h │ │ │ │ │ │ │ ├── ble_hs_log.h │ │ │ │ │ │ │ ├── ble_hs_mbuf.h │ │ │ │ │ │ │ ├── ble_hs_pvcy.h │ │ │ │ │ │ │ ├── ble_hs_stop.h │ │ │ │ │ │ │ ├── ble_ibeacon.h │ │ │ │ │ │ │ ├── ble_l2cap.h │ │ │ │ │ │ │ ├── ble_monitor.h │ │ │ │ │ │ │ ├── ble_sm.h │ │ │ │ │ │ │ ├── ble_store.h │ │ │ │ │ │ │ └── ble_uuid.h │ │ │ │ │ ├── mesh │ │ │ │ │ │ ├── include │ │ │ │ │ │ │ └── mesh │ │ │ │ │ │ │ │ ├── access.h │ │ │ │ │ │ │ │ ├── atomic.h │ │ │ │ │ │ │ │ ├── cdb.h │ │ │ │ │ │ │ │ ├── cfg.h │ │ │ │ │ │ │ │ ├── cfg_cli.h │ │ │ │ │ │ │ │ ├── cfg_srv.h │ │ │ │ │ │ │ │ ├── glue.h │ │ │ │ │ │ │ │ ├── health_cli.h │ │ │ │ │ │ │ │ ├── health_srv.h │ │ │ │ │ │ │ │ ├── heartbeat.h │ │ │ │ │ │ │ │ ├── main.h │ │ │ │ │ │ │ │ ├── mesh.h │ │ │ │ │ │ │ │ ├── model_cli.h │ │ │ │ │ │ │ │ ├── model_srv.h │ │ │ │ │ │ │ │ ├── porting.h │ │ │ │ │ │ │ │ ├── proxy.h │ │ │ │ │ │ │ │ ├── slist.h │ │ │ │ │ │ │ │ └── testing.h │ │ │ │ │ │ └── src │ │ │ │ │ │ │ ├── access.c │ │ │ │ │ │ │ ├── access.h │ │ │ │ │ │ │ ├── adv.c │ │ │ │ │ │ │ ├── adv.h │ │ │ │ │ │ │ ├── aes-ccm.c │ │ │ │ │ │ │ ├── app_keys.c │ │ │ │ │ │ │ ├── app_keys.h │ │ │ │ │ │ │ ├── atomic.h │ │ │ │ │ │ │ ├── beacon.c │ │ │ │ │ │ │ ├── beacon.h │ │ │ │ │ │ │ ├── cdb.c │ │ │ │ │ │ │ ├── cfg.c │ │ │ │ │ │ │ ├── cfg.h │ │ │ │ │ │ │ ├── cfg_cli.c │ │ │ │ │ │ │ ├── cfg_srv.c │ │ │ │ │ │ │ ├── crypto.c │ │ │ │ │ │ │ ├── crypto.h │ │ │ │ │ │ │ ├── foundation.h │ │ │ │ │ │ │ ├── friend.c │ │ │ │ │ │ │ ├── friend.h │ │ │ │ │ │ │ ├── glue.c │ │ │ │ │ │ │ ├── health_cli.c │ │ │ │ │ │ │ ├── health_srv.c │ │ │ │ │ │ │ ├── heartbeat.c │ │ │ │ │ │ │ ├── heartbeat.h │ │ │ │ │ │ │ ├── light_model.c │ │ │ │ │ │ │ ├── light_model.h │ │ │ │ │ │ │ ├── lpn.c │ │ │ │ │ │ │ ├── lpn.h │ │ │ │ │ │ │ ├── mesh.c │ │ │ │ │ │ │ ├── mesh_priv.h │ │ │ │ │ │ │ ├── model_cli.c │ │ │ │ │ │ │ ├── model_srv.c │ │ │ │ │ │ │ ├── net.c │ │ │ │ │ │ │ ├── net.h │ │ │ │ │ │ │ ├── nodes.c │ │ │ │ │ │ │ ├── nodes.h │ │ │ │ │ │ │ ├── pb_adv.c │ │ │ │ │ │ │ ├── pb_gatt.c │ │ │ │ │ │ │ ├── prov.c │ │ │ │ │ │ │ ├── prov.h │ │ │ │ │ │ │ ├── prov_bearer.h │ │ │ │ │ │ │ ├── prov_device.c │ │ │ │ │ │ │ ├── provisioner.c │ │ │ │ │ │ │ ├── provisioner.h │ │ │ │ │ │ │ ├── proxy.c │ │ │ │ │ │ │ ├── proxy.h │ │ │ │ │ │ │ ├── rpl.c │ │ │ │ │ │ │ ├── rpl.h │ │ │ │ │ │ │ ├── settings.c │ │ │ │ │ │ │ ├── settings.h │ │ │ │ │ │ │ ├── shell.c │ │ │ │ │ │ │ ├── shell.h │ │ │ │ │ │ │ ├── subnet.c │ │ │ │ │ │ │ ├── subnet.h │ │ │ │ │ │ │ ├── transport.c │ │ │ │ │ │ │ └── transport.h │ │ │ │ │ ├── services │ │ │ │ │ │ ├── ans │ │ │ │ │ │ │ ├── include │ │ │ │ │ │ │ │ └── services │ │ │ │ │ │ │ │ │ └── ans │ │ │ │ │ │ │ │ │ └── ble_svc_ans.h │ │ │ │ │ │ │ └── src │ │ │ │ │ │ │ │ └── ble_svc_ans.c │ │ │ │ │ │ ├── bas │ │ │ │ │ │ │ ├── include │ │ │ │ │ │ │ │ └── services │ │ │ │ │ │ │ │ │ └── bas │ │ │ │ │ │ │ │ │ └── ble_svc_bas.h │ │ │ │ │ │ │ └── src │ │ │ │ │ │ │ │ └── ble_svc_bas.c │ │ │ │ │ │ ├── dis │ │ │ │ │ │ │ ├── include │ │ │ │ │ │ │ │ └── services │ │ │ │ │ │ │ │ │ └── dis │ │ │ │ │ │ │ │ │ └── ble_svc_dis.h │ │ │ │ │ │ │ └── src │ │ │ │ │ │ │ │ └── ble_svc_dis.c │ │ │ │ │ │ ├── gap │ │ │ │ │ │ │ ├── include │ │ │ │ │ │ │ │ └── services │ │ │ │ │ │ │ │ │ └── gap │ │ │ │ │ │ │ │ │ └── ble_svc_gap.h │ │ │ │ │ │ │ └── src │ │ │ │ │ │ │ │ └── ble_svc_gap.c │ │ │ │ │ │ ├── gatt │ │ │ │ │ │ │ ├── include │ │ │ │ │ │ │ │ └── services │ │ │ │ │ │ │ │ │ └── gatt │ │ │ │ │ │ │ │ │ └── ble_svc_gatt.h │ │ │ │ │ │ │ └── src │ │ │ │ │ │ │ │ └── ble_svc_gatt.c │ │ │ │ │ │ ├── ias │ │ │ │ │ │ │ ├── include │ │ │ │ │ │ │ │ └── services │ │ │ │ │ │ │ │ │ └── ias │ │ │ │ │ │ │ │ │ └── ble_svc_ias.h │ │ │ │ │ │ │ └── src │ │ │ │ │ │ │ │ └── ble_svc_ias.c │ │ │ │ │ │ ├── ipss │ │ │ │ │ │ │ ├── include │ │ │ │ │ │ │ │ └── services │ │ │ │ │ │ │ │ │ └── ipss │ │ │ │ │ │ │ │ │ └── ble_svc_ipss.h │ │ │ │ │ │ │ └── src │ │ │ │ │ │ │ │ └── ble_svc_ipss.c │ │ │ │ │ │ └── lls │ │ │ │ │ │ │ ├── include │ │ │ │ │ │ │ └── services │ │ │ │ │ │ │ │ └── lls │ │ │ │ │ │ │ │ └── ble_svc_lls.h │ │ │ │ │ │ │ └── src │ │ │ │ │ │ │ └── ble_svc_lls.c │ │ │ │ │ ├── src │ │ │ │ │ │ ├── ble_att.c │ │ │ │ │ │ ├── ble_att_clt.c │ │ │ │ │ │ ├── ble_att_cmd.c │ │ │ │ │ │ ├── ble_att_cmd_priv.h │ │ │ │ │ │ ├── ble_att_priv.h │ │ │ │ │ │ ├── ble_att_svr.c │ │ │ │ │ │ ├── ble_eddystone.c │ │ │ │ │ │ ├── ble_gap.c │ │ │ │ │ │ ├── ble_gap_priv.h │ │ │ │ │ │ ├── ble_gatt_priv.h │ │ │ │ │ │ ├── ble_gattc.c │ │ │ │ │ │ ├── ble_gatts.c │ │ │ │ │ │ ├── ble_gatts_lcl.c │ │ │ │ │ │ ├── ble_hs.c │ │ │ │ │ │ ├── ble_hs_adv.c │ │ │ │ │ │ ├── ble_hs_adv_priv.h │ │ │ │ │ │ ├── ble_hs_atomic.c │ │ │ │ │ │ ├── ble_hs_atomic_priv.h │ │ │ │ │ │ ├── ble_hs_cfg.c │ │ │ │ │ │ ├── ble_hs_conn.c │ │ │ │ │ │ ├── ble_hs_conn_priv.h │ │ │ │ │ │ ├── ble_hs_flow.c │ │ │ │ │ │ ├── ble_hs_flow_priv.h │ │ │ │ │ │ ├── ble_hs_hci.c │ │ │ │ │ │ ├── ble_hs_hci_cmd.c │ │ │ │ │ │ ├── ble_hs_hci_evt.c │ │ │ │ │ │ ├── ble_hs_hci_priv.h │ │ │ │ │ │ ├── ble_hs_hci_util.c │ │ │ │ │ │ ├── ble_hs_id.c │ │ │ │ │ │ ├── ble_hs_id_priv.h │ │ │ │ │ │ ├── ble_hs_log.c │ │ │ │ │ │ ├── ble_hs_mbuf.c │ │ │ │ │ │ ├── ble_hs_mbuf_priv.h │ │ │ │ │ │ ├── ble_hs_misc.c │ │ │ │ │ │ ├── ble_hs_mqueue.c │ │ │ │ │ │ ├── ble_hs_periodic_sync.c │ │ │ │ │ │ ├── ble_hs_periodic_sync_priv.h │ │ │ │ │ │ ├── ble_hs_priv.h │ │ │ │ │ │ ├── ble_hs_pvcy.c │ │ │ │ │ │ ├── ble_hs_pvcy_priv.h │ │ │ │ │ │ ├── ble_hs_resolv.c │ │ │ │ │ │ ├── ble_hs_resolv_priv.h │ │ │ │ │ │ ├── ble_hs_shutdown.c │ │ │ │ │ │ ├── ble_hs_startup.c │ │ │ │ │ │ ├── ble_hs_startup_priv.h │ │ │ │ │ │ ├── ble_hs_stop.c │ │ │ │ │ │ ├── ble_ibeacon.c │ │ │ │ │ │ ├── ble_l2cap.c │ │ │ │ │ │ ├── ble_l2cap_coc.c │ │ │ │ │ │ ├── ble_l2cap_coc_priv.h │ │ │ │ │ │ ├── ble_l2cap_priv.h │ │ │ │ │ │ ├── ble_l2cap_sig.c │ │ │ │ │ │ ├── ble_l2cap_sig_cmd.c │ │ │ │ │ │ ├── ble_l2cap_sig_priv.h │ │ │ │ │ │ ├── ble_monitor.c │ │ │ │ │ │ ├── ble_monitor_priv.h │ │ │ │ │ │ ├── ble_sm.c │ │ │ │ │ │ ├── ble_sm_alg.c │ │ │ │ │ │ ├── ble_sm_cmd.c │ │ │ │ │ │ ├── ble_sm_lgcy.c │ │ │ │ │ │ ├── ble_sm_priv.h │ │ │ │ │ │ ├── ble_sm_sc.c │ │ │ │ │ │ ├── ble_store.c │ │ │ │ │ │ ├── ble_store_util.c │ │ │ │ │ │ ├── ble_uuid.c │ │ │ │ │ │ └── ble_uuid_priv.h │ │ │ │ │ ├── store │ │ │ │ │ │ └── config │ │ │ │ │ │ │ ├── include │ │ │ │ │ │ │ └── store │ │ │ │ │ │ │ │ └── config │ │ │ │ │ │ │ │ └── ble_store_config.h │ │ │ │ │ │ │ └── src │ │ │ │ │ │ │ ├── ble_store_config.c │ │ │ │ │ │ │ ├── ble_store_config_conf.c │ │ │ │ │ │ │ ├── ble_store_config_priv.h │ │ │ │ │ │ │ └── ble_store_nvs.c │ │ │ │ │ └── util │ │ │ │ │ │ ├── include │ │ │ │ │ │ └── host │ │ │ │ │ │ │ └── util │ │ │ │ │ │ │ └── util.h │ │ │ │ │ │ └── src │ │ │ │ │ │ └── addr.c │ │ │ │ ├── include │ │ │ │ │ └── nimble │ │ │ │ │ │ ├── ble.h │ │ │ │ │ │ ├── ble_hci_trans.h │ │ │ │ │ │ ├── hci_common.h │ │ │ │ │ │ ├── nimble_npl.h │ │ │ │ │ │ ├── nimble_opt.h │ │ │ │ │ │ └── nimble_opt_auto.h │ │ │ │ └── transport │ │ │ │ │ └── ram │ │ │ │ │ ├── include │ │ │ │ │ └── transport │ │ │ │ │ │ └── ram │ │ │ │ │ │ └── ble_hci_ram.h │ │ │ │ │ └── src │ │ │ │ │ └── ble_hci_ram.c │ │ │ └── porting │ │ │ │ ├── nimble │ │ │ │ ├── include │ │ │ │ │ ├── hal │ │ │ │ │ │ └── hal_timer.h │ │ │ │ │ ├── log │ │ │ │ │ │ └── log.h │ │ │ │ │ ├── log_common │ │ │ │ │ │ ├── ignore.h │ │ │ │ │ │ └── log_common.h │ │ │ │ │ ├── logcfg │ │ │ │ │ │ └── logcfg.h │ │ │ │ │ ├── mem │ │ │ │ │ │ └── mem.h │ │ │ │ │ ├── modlog │ │ │ │ │ │ └── modlog.h │ │ │ │ │ ├── nimble │ │ │ │ │ │ └── nimble_port.h │ │ │ │ │ ├── os │ │ │ │ │ │ ├── endian.h │ │ │ │ │ │ ├── os.h │ │ │ │ │ │ ├── os_cputime.h │ │ │ │ │ │ ├── os_error.h │ │ │ │ │ │ ├── os_mbuf.h │ │ │ │ │ │ ├── os_mempool.h │ │ │ │ │ │ ├── os_trace_api.h │ │ │ │ │ │ ├── queue.h │ │ │ │ │ │ └── util.h │ │ │ │ │ ├── stats │ │ │ │ │ │ └── stats.h │ │ │ │ │ ├── syscfg │ │ │ │ │ │ └── syscfg.h │ │ │ │ │ ├── sysflash │ │ │ │ │ │ └── sysflash.h │ │ │ │ │ └── sysinit │ │ │ │ │ │ └── sysinit.h │ │ │ │ └── src │ │ │ │ │ ├── endian.c │ │ │ │ │ ├── hal_timer.c │ │ │ │ │ ├── hal_uart.c │ │ │ │ │ ├── mem.c │ │ │ │ │ ├── nimble_port.c │ │ │ │ │ ├── os_cputime.c │ │ │ │ │ ├── os_cputime_pwr2.c │ │ │ │ │ ├── os_mbuf.c │ │ │ │ │ ├── os_mempool.c │ │ │ │ │ └── os_msys_init.c │ │ │ │ └── npl │ │ │ │ └── freertos │ │ │ │ ├── include │ │ │ │ └── nimble │ │ │ │ │ ├── nimble_npl_os.h │ │ │ │ │ ├── nimble_port_freertos.h │ │ │ │ │ └── npl_freertos.h │ │ │ │ └── src │ │ │ │ ├── nimble_port_freertos.c │ │ │ │ └── npl_os_freertos.c │ │ │ ├── nimconfig.h │ │ │ └── nimconfig_rename.h │ ├── QMC5883LCompass │ │ ├── LICENSE │ │ ├── changelog.md │ │ ├── examples │ │ │ ├── azimuth │ │ │ │ └── azimuth.ino │ │ │ ├── bearing │ │ │ │ └── bearing.ino │ │ │ ├── calibration │ │ │ │ └── calibration.ino │ │ │ ├── direction │ │ │ │ └── direction.ino │ │ │ ├── smoothing │ │ │ │ └── smoothing.ino │ │ │ └── xyz │ │ │ │ └── xyz.ino │ │ ├── keywords.txt │ │ ├── library.properties │ │ ├── readme.md │ │ └── src │ │ │ ├── QMC5883LCompass.cpp │ │ │ └── QMC5883LCompass.h │ ├── README │ ├── TinyGPSPlus │ │ ├── README.md │ │ ├── examples │ │ │ ├── BasicExample │ │ │ │ └── BasicExample.ino │ │ │ ├── DeviceExample │ │ │ │ └── DeviceExample.ino │ │ │ ├── FullExample │ │ │ │ └── FullExample.ino │ │ │ ├── KitchenSink │ │ │ │ └── KitchenSink.ino │ │ │ ├── SatElevTracker │ │ │ │ ├── SatElevTracker.ino │ │ │ │ └── sample_satellite_elevation_log.txt │ │ │ ├── SatelliteTracker │ │ │ │ └── SatelliteTracker.ino │ │ │ └── UsingCustomFields │ │ │ │ └── UsingCustomFields.ino │ │ ├── keywords.txt │ │ ├── library.json │ │ ├── library.properties │ │ └── src │ │ │ ├── TinyGPS++.cpp │ │ │ ├── TinyGPS++.h │ │ │ └── TinyGPSPlus.h │ └── lv_conf.h ├── platformio.ini ├── src │ ├── App │ │ ├── App.cpp │ │ ├── App.h │ │ ├── Common │ │ │ ├── DataProc │ │ │ │ ├── DP_BLE.cpp │ │ │ │ ├── DP_Backlight.cpp │ │ │ │ ├── DP_Clock.cpp │ │ │ │ ├── DP_GPS.cpp │ │ │ │ ├── DP_IMU.cpp │ │ │ │ ├── DP_LIST.inc │ │ │ │ ├── DP_MAG.cpp │ │ │ │ ├── DP_MusicPlayer.cpp │ │ │ │ ├── DP_Power.cpp │ │ │ │ ├── DP_Recorder.cpp │ │ │ │ ├── DP_SmartAssistant.cpp │ │ │ │ ├── DP_SportStatus.cpp │ │ │ │ ├── DP_Storage.cpp │ │ │ │ ├── DP_SysConfig.cpp │ │ │ │ ├── DP_TrackFilter.cpp │ │ │ │ ├── DP_TzConv.cpp │ │ │ │ ├── DP_WiFi.cpp │ │ │ │ ├── DataProc.cpp │ │ │ │ ├── DataProc.h │ │ │ │ └── DataProc_Def.h │ │ │ ├── HAL │ │ │ │ ├── CommonMacro.h │ │ │ │ ├── HAL.cpp │ │ │ │ ├── HAL.h │ │ │ │ ├── HAL_Audio.cpp │ │ │ │ ├── HAL_BLE.cpp │ │ │ │ ├── HAL_Backlight.cpp │ │ │ │ ├── HAL_Buzz.cpp │ │ │ │ ├── HAL_Clock.cpp │ │ │ │ ├── HAL_Def.h │ │ │ │ ├── HAL_ENV.cpp │ │ │ │ ├── HAL_GPS.cpp │ │ │ │ ├── HAL_IMU.cpp │ │ │ │ ├── HAL_MAG.cpp │ │ │ │ ├── HAL_Power.cpp │ │ │ │ ├── HAL_SD.cpp │ │ │ │ ├── HAL_SmartAssistant.cpp │ │ │ │ └── HAL_WiFi.cpp │ │ │ └── Music │ │ │ │ ├── MusicCode.h │ │ │ │ └── ToneMap.h │ │ ├── Config │ │ │ └── Config.h │ │ ├── Pages │ │ │ ├── AppFactory.cpp │ │ │ ├── AppFactory.h │ │ │ ├── BLEKeyboard │ │ │ │ ├── BLEKeyboard.cpp │ │ │ │ ├── BLEKeyboard.h │ │ │ │ ├── BLEKeyboardModel.cpp │ │ │ │ ├── BLEKeyboardModel.h │ │ │ │ ├── BLEKeyboardView.cpp │ │ │ │ └── BLEKeyboardView.h │ │ │ ├── Compass │ │ │ │ ├── Compass.cpp │ │ │ │ ├── Compass.h │ │ │ │ ├── CompassModel.cpp │ │ │ │ ├── CompassModel.h │ │ │ │ ├── CompassView.cpp │ │ │ │ └── CompassView.h │ │ │ ├── Dialplate │ │ │ │ ├── Dialplate.cpp │ │ │ │ ├── Dialplate.h │ │ │ │ ├── DialplateModel.cpp │ │ │ │ ├── DialplateModel.h │ │ │ │ ├── DialplateView.cpp │ │ │ │ └── DialplateView.h │ │ │ ├── LaunchOut │ │ │ │ ├── LaunchOut.cpp │ │ │ │ ├── LaunchOut.h │ │ │ │ ├── LaunchOutModel.cpp │ │ │ │ ├── LaunchOutModel.h │ │ │ │ ├── LaunchOutView.cpp │ │ │ │ └── LaunchOutView.h │ │ │ ├── LiveMap │ │ │ │ ├── LiveMap.cpp │ │ │ │ ├── LiveMap.h │ │ │ │ ├── LiveMapModel.cpp │ │ │ │ ├── LiveMapModel.h │ │ │ │ ├── LiveMapView.cpp │ │ │ │ └── LiveMapView.h │ │ │ ├── Page.h │ │ │ ├── Popcat │ │ │ │ ├── Popcat.cpp │ │ │ │ ├── Popcat.h │ │ │ │ ├── PopcatModel.cpp │ │ │ │ ├── PopcatModel.h │ │ │ │ ├── PopcatView.cpp │ │ │ │ └── PopcatView.h │ │ │ ├── Settings │ │ │ │ ├── Settings.cpp │ │ │ │ ├── Settings.h │ │ │ │ ├── SettingsModel.cpp │ │ │ │ ├── SettingsModel.h │ │ │ │ ├── SettingsView.cpp │ │ │ │ └── SettingsView.h │ │ │ ├── SmartAssistant │ │ │ │ ├── SmartAssistant.cpp │ │ │ │ ├── SmartAssistant.h │ │ │ │ ├── SmartAssistantModel.cpp │ │ │ │ ├── SmartAssistantModel.h │ │ │ │ ├── SmartAssistantView.cpp │ │ │ │ └── SmartAssistantView.h │ │ │ ├── StartUp │ │ │ │ ├── StartUp.cpp │ │ │ │ ├── StartUp.h │ │ │ │ ├── StartUpModel.cpp │ │ │ │ ├── StartUpModel.h │ │ │ │ ├── StartUpView.cpp │ │ │ │ └── StartUpView.h │ │ │ ├── StatusBar │ │ │ │ ├── StatusBar.cpp │ │ │ │ └── StatusBar.h │ │ │ ├── SystemInfos │ │ │ │ ├── SystemInfos.cpp │ │ │ │ ├── SystemInfos.h │ │ │ │ ├── SystemInfosModel.cpp │ │ │ │ ├── SystemInfosModel.h │ │ │ │ ├── SystemInfosView.cpp │ │ │ │ └── SystemInfosView.h │ │ │ ├── WaveTable │ │ │ │ ├── WaveTable.cpp │ │ │ │ ├── WaveTable.h │ │ │ │ ├── WaveTableModel.cpp │ │ │ │ ├── WaveTableModel.h │ │ │ │ ├── WaveTableView.cpp │ │ │ │ └── WaveTableView.h │ │ │ └── _Template │ │ │ │ ├── Template.cpp │ │ │ │ ├── Template.h │ │ │ │ ├── TemplateModel.cpp │ │ │ │ ├── TemplateModel.h │ │ │ │ ├── TemplateView.cpp │ │ │ │ └── TemplateView.h │ │ ├── Resource │ │ │ ├── Font │ │ │ │ ├── font_agencyb_36.c │ │ │ │ ├── font_bahnschrift_13.c │ │ │ │ ├── font_bahnschrift_17.c │ │ │ │ ├── font_bahnschrift_32.c │ │ │ │ ├── font_bahnschrift_65.c │ │ │ │ ├── font_compass_24.c │ │ │ │ ├── font_smiley_36.c │ │ │ │ └── font_smileysd_16.c │ │ │ ├── Image │ │ │ │ ├── img_src_alarm.c │ │ │ │ ├── img_src_battery.c │ │ │ │ ├── img_src_battery_info.c │ │ │ │ ├── img_src_bicycle.c │ │ │ │ ├── img_src_compass.c │ │ │ │ ├── img_src_compass_bg.c │ │ │ │ ├── img_src_gps_arrow_dark.c │ │ │ │ ├── img_src_gps_arrow_default.c │ │ │ │ ├── img_src_gps_arrow_light.c │ │ │ │ ├── img_src_gps_pin.c │ │ │ │ ├── img_src_gyroscope.c │ │ │ │ ├── img_src_locate.c │ │ │ │ ├── img_src_map_location.c │ │ │ │ ├── img_src_menu.c │ │ │ │ ├── img_src_origin_point.c │ │ │ │ ├── img_src_pause.c │ │ │ │ ├── img_src_popcat_close.c │ │ │ │ ├── img_src_popcat_open.c │ │ │ │ ├── img_src_satellite.c │ │ │ │ ├── img_src_sd_card.c │ │ │ │ ├── img_src_start.c │ │ │ │ ├── img_src_stop.c │ │ │ │ ├── img_src_storage.c │ │ │ │ ├── img_src_system_info.c │ │ │ │ ├── img_src_time_info.c │ │ │ │ └── img_src_trip.c │ │ │ ├── ResourcePool.cpp │ │ │ └── ResourcePool.h │ │ ├── Utils │ │ │ ├── DataCenter │ │ │ │ ├── Account.cpp │ │ │ │ ├── Account.h │ │ │ │ ├── DataCenter.cpp │ │ │ │ ├── DataCenter.h │ │ │ │ ├── DataCenterLog.h │ │ │ │ └── PingPongBuffer │ │ │ │ │ ├── PingPongBuffer.c │ │ │ │ │ └── PingPongBuffer.h │ │ │ ├── Filters │ │ │ │ ├── FilterBase.h │ │ │ │ ├── Filters.h │ │ │ │ ├── HysteresisFilter.h │ │ │ │ ├── LowpassFilter.h │ │ │ │ ├── MedianFilter.h │ │ │ │ ├── MedianQueueFilter.h │ │ │ │ └── SlidingFilter.h │ │ │ ├── GPX │ │ │ │ ├── Examples │ │ │ │ │ └── Static_Track │ │ │ │ │ │ └── Static_Track.pde │ │ │ │ ├── GPX.cpp │ │ │ │ └── GPX.h │ │ │ ├── GPX_Parser │ │ │ │ ├── GPX_Parser.cpp │ │ │ │ └── GPX_Parser.h │ │ │ ├── MapConv │ │ │ │ ├── GPS_Transform │ │ │ │ │ ├── GPS_Transform.c │ │ │ │ │ └── GPS_Transform.h │ │ │ │ ├── MapConv.cpp │ │ │ │ ├── MapConv.h │ │ │ │ └── TileSystem │ │ │ │ │ ├── TileSystem.cpp │ │ │ │ │ └── TileSystem.h │ │ │ ├── PageManager │ │ │ │ ├── PM_Anim.cpp │ │ │ │ ├── PM_Base.cpp │ │ │ │ ├── PM_Drag.cpp │ │ │ │ ├── PM_Log.h │ │ │ │ ├── PM_Router.cpp │ │ │ │ ├── PM_State.cpp │ │ │ │ ├── PageBase.cpp │ │ │ │ ├── PageBase.h │ │ │ │ ├── PageFactory.h │ │ │ │ └── PageManager.h │ │ │ ├── PointContainer │ │ │ │ ├── PointContainer.cpp │ │ │ │ └── PointContainer.h │ │ │ ├── ResourceManager │ │ │ │ ├── ResourceManager.cpp │ │ │ │ └── ResourceManager.h │ │ │ ├── StorageService │ │ │ │ ├── StorageService.cpp │ │ │ │ └── StorageService.h │ │ │ ├── TileConv │ │ │ │ ├── TileConv.cpp │ │ │ │ └── TileConv.h │ │ │ ├── Time │ │ │ │ ├── DateStrings.cpp │ │ │ │ ├── Readme.txt │ │ │ │ ├── Time.cpp │ │ │ │ ├── Time.h │ │ │ │ ├── TimeLib.h │ │ │ │ ├── examples │ │ │ │ │ ├── Processing │ │ │ │ │ │ └── SyncArduinoClock │ │ │ │ │ │ │ ├── SyncArduinoClock.pde │ │ │ │ │ │ │ └── readme.txt │ │ │ │ │ ├── TimeArduinoDue │ │ │ │ │ │ └── TimeArduinoDue.ino │ │ │ │ │ ├── TimeGPS │ │ │ │ │ │ └── TimeGPS.ino │ │ │ │ │ ├── TimeNTP │ │ │ │ │ │ └── TimeNTP.ino │ │ │ │ │ ├── TimeNTP_ESP8266WiFi │ │ │ │ │ │ └── TimeNTP_ESP8266WiFi.ino │ │ │ │ │ ├── TimeRTC │ │ │ │ │ │ └── TimeRTC.ino │ │ │ │ │ ├── TimeRTCLog │ │ │ │ │ │ └── TimeRTCLog.ino │ │ │ │ │ ├── TimeRTCSet │ │ │ │ │ │ └── TimeRTCSet.ino │ │ │ │ │ ├── TimeSerial │ │ │ │ │ │ └── TimeSerial.ino │ │ │ │ │ ├── TimeSerialDateStrings │ │ │ │ │ │ └── TimeSerialDateStrings.ino │ │ │ │ │ └── TimeTeensy3 │ │ │ │ │ │ └── TimeTeensy3.ino │ │ │ │ ├── keywords.txt │ │ │ │ ├── library.json │ │ │ │ └── library.properties │ │ │ ├── TonePlayer │ │ │ │ ├── TonePlayer.cpp │ │ │ │ └── TonePlayer.h │ │ │ ├── TrackFilter │ │ │ │ ├── TrackFilter.h │ │ │ │ ├── TrackLineFilter.cpp │ │ │ │ ├── TrackLineFilter.h │ │ │ │ ├── TrackPointFilter.cpp │ │ │ │ └── TrackPointFilter.h │ │ │ ├── lv_allocator │ │ │ │ └── lv_allocator.h │ │ │ ├── lv_anim_label │ │ │ │ ├── lv_anim_label.c │ │ │ │ └── lv_anim_label.h │ │ │ ├── lv_ext │ │ │ │ ├── lv_anim_timeline_wrapper.c │ │ │ │ ├── lv_anim_timeline_wrapper.h │ │ │ │ ├── lv_obj_ext_func.cpp │ │ │ │ └── lv_obj_ext_func.h │ │ │ └── lv_poly_line │ │ │ │ ├── lv_poly_line.cpp │ │ │ │ └── lv_poly_line.h │ │ └── Version.h │ ├── ChappieCore │ │ ├── BLE │ │ │ └── ChappieBLE.hpp │ │ ├── Button │ │ │ ├── Button │ │ │ │ ├── Button.cpp │ │ │ │ ├── Button.h │ │ │ │ └── README.md │ │ │ └── EmmaButton.hpp │ │ ├── Buzzer │ │ │ ├── EmmaBuzzer.hpp │ │ │ ├── Melody.cpp │ │ │ └── Melody.h │ │ ├── CTP │ │ │ └── ChappieCTP.hpp │ │ ├── ChappieCore.cpp │ │ ├── ChappieCore.h │ │ ├── ChappieCore_config.h │ │ ├── ENV │ │ │ └── ChappieENV.hpp │ │ ├── GPS │ │ │ └── ChappieGPS.hpp │ │ ├── IMU │ │ │ └── ChappieIMU.hpp │ │ ├── Lvgl │ │ │ ├── ChappieLvgl.hpp │ │ │ ├── LGFX_ChappieCore.hpp │ │ │ ├── demos │ │ │ │ ├── README.md │ │ │ │ ├── benchmark │ │ │ │ │ ├── README.md │ │ │ │ │ ├── assets │ │ │ │ │ │ ├── img_benchmark_cogwheel_alpha16.c │ │ │ │ │ │ ├── img_benchmark_cogwheel_argb.c │ │ │ │ │ │ ├── img_benchmark_cogwheel_chroma_keyed.c │ │ │ │ │ │ ├── img_benchmark_cogwheel_indexed16.c │ │ │ │ │ │ ├── img_benchmark_cogwheel_rgb.c │ │ │ │ │ │ ├── img_benchmark_cogwheel_rgb565a8.c │ │ │ │ │ │ ├── lv_font_bechmark_montserrat_12_compr_az.c.c │ │ │ │ │ │ ├── lv_font_bechmark_montserrat_16_compr_az.c.c │ │ │ │ │ │ └── lv_font_bechmark_montserrat_28_compr_az.c.c │ │ │ │ │ ├── lv_demo_benchmark.c │ │ │ │ │ └── lv_demo_benchmark.h │ │ │ │ ├── keypad_encoder │ │ │ │ │ ├── README.md │ │ │ │ │ ├── lv_demo_keypad_encoder.c │ │ │ │ │ └── lv_demo_keypad_encoder.h │ │ │ │ ├── lv_demos.h │ │ │ │ ├── lv_demos.mk │ │ │ │ ├── stress │ │ │ │ │ ├── README.md │ │ │ │ │ ├── lv_demo_stress.c │ │ │ │ │ └── lv_demo_stress.h │ │ │ │ └── widgets │ │ │ │ │ ├── assets │ │ │ │ │ ├── img_clothes.c │ │ │ │ │ ├── img_demo_widgets_avatar.c │ │ │ │ │ └── img_lvgl_logo.c │ │ │ │ │ ├── lv_demo_widgets.c │ │ │ │ │ ├── lv_demo_widgets.h │ │ │ │ │ └── lv_demo_widgets.py │ │ │ ├── lv_conf_template.h │ │ │ ├── lvgl.h │ │ │ └── porting │ │ │ │ ├── lv_port_disp.cpp │ │ │ │ ├── lv_port_disp.h │ │ │ │ ├── lv_port_fs.cpp │ │ │ │ ├── lv_port_fs.h │ │ │ │ ├── lv_port_indev.cpp │ │ │ │ └── lv_port_indev.h │ │ ├── MAG │ │ │ └── ChappieMAG.hpp │ │ ├── Mic │ │ │ ├── EmmaMicPDM.hpp │ │ │ └── Mic │ │ │ │ ├── Mic_Class.cpp │ │ │ │ └── Mic_Class.hpp │ │ ├── Power │ │ │ └── ChappiePower.hpp │ │ ├── RGBLED │ │ │ └── EmmaRGBLED.hpp │ │ ├── SD │ │ │ └── ChappieSD.hpp │ │ ├── SmartAssistantAPI │ │ │ ├── BaiduASR │ │ │ │ ├── BaiduASR.cpp │ │ │ │ └── BaiduASR.h │ │ │ ├── BaiduErnieBot │ │ │ │ ├── BaiduErnieBot.cpp │ │ │ │ └── BaiduErnieBot.h │ │ │ ├── BaiduTTS │ │ │ │ ├── BaiduTTS.cpp │ │ │ │ └── BaiduTTS.h │ │ │ ├── MiniMaxLlm │ │ │ │ ├── MiniMaxLlm.cpp │ │ │ │ └── MiniMaxLlm.h │ │ │ └── SmartAssistantAPI.hpp │ │ ├── Speaker │ │ │ ├── EmmaSpeaker.hpp │ │ │ └── Speaker │ │ │ │ ├── Speaker_Class.cpp │ │ │ │ └── Speaker_Class.hpp │ │ ├── Utility │ │ │ ├── Adafruit_BMP280 │ │ │ │ ├── Adafruit_BMP280.cpp │ │ │ │ ├── Adafruit_BMP280.h │ │ │ │ └── README.md │ │ │ ├── Adafruit_BusIO │ │ │ │ ├── Adafruit_BusIO_Register.cpp │ │ │ │ ├── Adafruit_BusIO_Register.h │ │ │ │ ├── Adafruit_I2CDevice.cpp │ │ │ │ ├── Adafruit_I2CDevice.h │ │ │ │ ├── Adafruit_I2CRegister.h │ │ │ │ ├── Adafruit_SPIDevice.cpp │ │ │ │ ├── Adafruit_SPIDevice.h │ │ │ │ ├── LICENSE │ │ │ │ └── README.md │ │ │ ├── BM8563 │ │ │ │ ├── I2C_BM8563.cpp │ │ │ │ ├── I2C_BM8563.h │ │ │ │ └── README.md │ │ │ ├── I2Cdev │ │ │ │ ├── I2Cdev.cpp │ │ │ │ └── I2Cdev.h │ │ │ └── MPU6050 │ │ │ │ ├── MPU6050.cpp │ │ │ │ ├── MPU6050.h │ │ │ │ ├── MPU6050_6Axis_MotionApps20.h │ │ │ │ ├── MPU6050_6Axis_MotionApps_V6_12.h │ │ │ │ ├── MPU6050_9Axis_MotionApps41.h │ │ │ │ ├── README.md │ │ │ │ └── helper_3dmath.h │ │ └── WiFi │ │ │ ├── ConfigWiFi.cpp │ │ │ └── ConfigWiFi.h │ └── main.cpp └── test │ └── README ├── 3.Models ├── README.md ├── button.stl └── shell.stl ├── 4.Pics ├── XMind.png ├── frontCover.jpg ├── map.png ├── pic1.jpg ├── pic2.jpg └── ssa.png ├── 5.Resource ├── MicroSDcard │ ├── .SystemSaveBackup.json │ ├── FONT │ │ └── font_smileysd_16.bin │ ├── MAP │ │ ├── README.md │ │ └── image.png │ ├── README.md │ ├── SystemSave.json │ └── TilesConverterForLVGL.exe └── SmartAssistant │ └── README.md ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | 1.Hardware/.vscode 3 | 2.Firmware/.vscode 4 | 3.Models/.vscode 5 | 4.Pics/.vscode 6 | 2.Firmware/.pio 7 | 8 | -------------------------------------------------------------------------------- /1.Hardware/Gerber_PCB_EasyGPS_V1.4_2024-06-16.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhangKeLiang0627/EasyGPS/337eaeb32b96d579334ffd86bbdc8d0d308706ba/1.Hardware/Gerber_PCB_EasyGPS_V1.4_2024-06-16.zip -------------------------------------------------------------------------------- /1.Hardware/README.md: -------------------------------------------------------------------------------- 1 | # 【EASY-GPS】基于ESP32S3的GPS定位器 2 | 3 | ### 本项目基于:X-TRACK & CHAPPIE 4 | 5 | ### Author: kkl 6 | 7 | --- 8 | 9 | > 压缩包(Version: 1.4)可直接用于立创PCB下单! 10 | 11 | 视频介绍:[戳这儿:)](https://www.bilibili.com/video/BV1M44219745/) 12 | 13 | 硬件开源:[戳这里:P](https://oshwhub.com/hugego/easygps-ji-yu-esp32s3-de-gps-zhui-zong-qi) 14 | 15 | -------------------------------------------------------------------------------- /2.Firmware/.gitignore: -------------------------------------------------------------------------------- 1 | .pio 2 | .vscode/.browse.c_cpp.db* 3 | .vscode/c_cpp_properties.json 4 | .vscode/launch.json 5 | .vscode/ipch 6 | -------------------------------------------------------------------------------- /2.Firmware/README.md: -------------------------------------------------------------------------------- 1 | #### 编译该源码需要注意 lib/lv_conf.h 2 | 3 | - 需要将 `lv_conf.h` 放在lvgl库文件夹的同一目录: .pio/libdeps/esp32-s3-devkitc-1 4 | -------------------------------------------------------------------------------- /2.Firmware/include/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project header files. 3 | 4 | A header file is a file containing C declarations and macro definitions 5 | to be shared between several project source files. You request the use of a 6 | header file in your project source file (C, C++, etc) located in `src` folder 7 | by including it, with the C preprocessing directive `#include'. 8 | 9 | ```src/main.c 10 | 11 | #include "header.h" 12 | 13 | int main (void) 14 | { 15 | ... 16 | } 17 | ``` 18 | 19 | Including a header file produces the same results as copying the header file 20 | into each source file that needs it. Such copying would be time-consuming 21 | and error-prone. With a header file, the related declarations appear 22 | in only one place. If they need to be changed, they can be changed in one 23 | place, and programs that include the header file will automatically use the 24 | new version when next recompiled. The header file eliminates the labor of 25 | finding and changing all the copies as well as the risk that a failure to 26 | find one copy will result in inconsistencies within a program. 27 | 28 | In C, the usual convention is to give header files names that end with `.h'. 29 | It is most portable to use only letters, digits, dashes, and underscores in 30 | header file names, and at most one dot. 31 | 32 | Read more about using header files in official GCC documentation: 33 | 34 | * Include Syntax 35 | * Include Operation 36 | * Once-Only Headers 37 | * Computed Includes 38 | 39 | https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html 40 | -------------------------------------------------------------------------------- /2.Firmware/lib/ESP32-BLE-Combo/BleMouse.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define MOUSE_LEFT 1 4 | #define MOUSE_RIGHT 2 5 | #define MOUSE_MIDDLE 4 6 | #define MOUSE_BACK 8 7 | #define MOUSE_FORWARD 16 8 | #define MOUSE_ALL (MOUSE_LEFT | MOUSE_RIGHT | MOUSE_MIDDLE) 9 | #define MOUSE_ALL_ALL (MOUSE_ALL | MOUSE_BACK | MOUSE_FORWARD) 10 | 11 | class Mouse_ 12 | { 13 | public: 14 | void begin(void); 15 | void end(void); 16 | void click(uint16_t b = MOUSE_LEFT); 17 | void move(int x, int y, signed char wheel = 0, signed char hwheel = 0); 18 | void wheel(signed char wheel = 0, signed char hwheel = 0); 19 | void press(uint16_t b = MOUSE_LEFT); 20 | void release(uint16_t b = MOUSE_LEFT); 21 | void releaseAll(void); 22 | bool isPressed(uint16_t b = MOUSE_LEFT); 23 | }; 24 | 25 | extern Mouse_ Mouse; 26 | -------------------------------------------------------------------------------- /2.Firmware/lib/ESP32-BLE-Combo/Gamepad.cpp: -------------------------------------------------------------------------------- 1 | #include "BleGamepad.h" 2 | Gamepad_ Gamepad; 3 | 4 | void Gamepad_::resetButtons() { 5 | bleDevice.resetButtons(); 6 | } 7 | 8 | 9 | void Gamepad_::begin(void) 10 | { 11 | bleDevice.begin(); 12 | } 13 | 14 | void Gamepad_::end(void) 15 | { 16 | bleDevice.end(); 17 | } 18 | 19 | void Gamepad_::setAxes(int16_t x, int16_t y, int16_t a1, int16_t a2, int16_t a3, int16_t a4, int16_t a5, int16_t a6, signed char hat1, signed char hat2, signed char hat3, signed char hat4) 20 | { 21 | bleDevice.setAxes(x,y,a1,a2,a3,a4,a5,a6,hat1,hat2,hat3,hat4); 22 | } 23 | 24 | // indexed button (1..128) 25 | void Gamepad_::press(uint8_t b) 26 | { 27 | bleDevice.pressButton(b); 28 | 29 | } 30 | 31 | // indexed button (1..128) 32 | void Gamepad_::release(uint8_t b) 33 | { 34 | bleDevice.releaseButton(b); 35 | } 36 | 37 | // indexed button (1..128) 38 | bool Gamepad_::isPressed(uint8_t b) 39 | { 40 | return bleDevice.isPressedButton(b); 41 | } 42 | 43 | -------------------------------------------------------------------------------- /2.Firmware/lib/ESP32-BLE-Combo/Keyboard.cpp: -------------------------------------------------------------------------------- 1 | #include "BleKeyboard.h" 2 | 3 | Keyboard_ Keyboard; 4 | 5 | void Keyboard_::begin() 6 | { 7 | bleDevice.begin(); 8 | } 9 | 10 | void Keyboard_::end() 11 | { 12 | bleDevice.end(); 13 | } 14 | 15 | size_t Keyboard_::write(uint8_t k) 16 | { 17 | return bleDevice.write(k); 18 | } 19 | 20 | size_t Keyboard_::write(const MediaKeyReport m) 21 | { 22 | return bleDevice.write(m); 23 | } 24 | 25 | size_t Keyboard_::write(const uint8_t *buffer, size_t size) 26 | { 27 | return bleDevice.write(buffer, size); 28 | } 29 | 30 | size_t Keyboard_::press(uint8_t k) 31 | { 32 | return bleDevice.press(k); 33 | } 34 | 35 | size_t Keyboard_::press(const MediaKeyReport m) 36 | { 37 | return bleDevice.press(m); 38 | } 39 | 40 | size_t Keyboard_::release(uint8_t k) 41 | { 42 | return bleDevice.release(k); 43 | } 44 | 45 | size_t Keyboard_::release(const MediaKeyReport m) 46 | { 47 | return bleDevice.release(m); 48 | } 49 | 50 | void Keyboard_::releaseAll() 51 | { 52 | bleDevice.releaseAll(); 53 | } -------------------------------------------------------------------------------- /2.Firmware/lib/ESP32-BLE-Combo/Mouse.cpp: -------------------------------------------------------------------------------- 1 | #include "BleMouse.h" 2 | Mouse_ Mouse; 3 | 4 | void Mouse_::begin() 5 | { 6 | bleDevice.begin(); 7 | } 8 | 9 | void Mouse_::end() 10 | { 11 | bleDevice.end(); 12 | } 13 | 14 | void Mouse_::click(uint16_t b) 15 | { 16 | bleDevice.click(b); 17 | } 18 | 19 | void Mouse_::move(int x, int y, signed char wheel, signed char hwheel) 20 | { 21 | bleDevice.move(x, y, wheel, hwheel); 22 | } 23 | 24 | void Mouse_::wheel(signed char wheel, signed char hwheel) 25 | { 26 | bleDevice.wheel(wheel, hwheel); 27 | } 28 | 29 | void Mouse_::press(uint16_t b) 30 | { 31 | bleDevice.pressMouse(b); 32 | } 33 | 34 | void Mouse_::release(uint16_t b) 35 | { 36 | bleDevice.releaseMouse(b); 37 | } 38 | 39 | void Mouse_::releaseAll() 40 | { 41 | bleDevice.release(MOUSE_ALL_ALL); 42 | } 43 | 44 | bool Mouse_::isPressed(uint16_t b) 45 | { 46 | return bleDevice.isPressed(b); 47 | } -------------------------------------------------------------------------------- /2.Firmware/lib/ESP32-BLE-Combo/examples/MouseButtons/MouseButtons.ino: -------------------------------------------------------------------------------- 1 | /** 2 | * This example turns the ESP32 into a Bluetooth LE mouse that continuously moves the mouse. 3 | */ 4 | #include 5 | 6 | void setup() { 7 | Serial.begin(115200); 8 | Serial.println("Starting BLE work!"); 9 | Mouse.begin(); 10 | } 11 | 12 | void loop() { 13 | if(bleDevice.isConnected()) { 14 | Serial.println("Left click"); 15 | Mouse.click(MOUSE_LEFT); 16 | delay(500); 17 | 18 | Serial.println("Right click"); 19 | Mouse.click(MOUSE_RIGHT); 20 | delay(500); 21 | 22 | Serial.println("Scroll wheel click"); 23 | Mouse.click(MOUSE_MIDDLE); 24 | delay(500); 25 | 26 | Serial.println("Back button click"); 27 | Mouse.click(MOUSE_BACK); 28 | delay(500); 29 | 30 | Serial.println("Forward button click"); 31 | Mouse.click(MOUSE_FORWARD); 32 | delay(500); 33 | 34 | Serial.println("Click left+right mouse button at the same time"); 35 | Mouse.click(MOUSE_LEFT | MOUSE_RIGHT); 36 | delay(500); 37 | 38 | Serial.println("Click left+right mouse button and scroll wheel at the same time"); 39 | Mouse.click(MOUSE_LEFT | MOUSE_RIGHT | MOUSE_MIDDLE); 40 | delay(500); 41 | 42 | } 43 | } -------------------------------------------------------------------------------- /2.Firmware/lib/ESP32-BLE-Combo/examples/SendKeyStrokes/SendKeyStrokes.ino: -------------------------------------------------------------------------------- 1 | /** 2 | * This example turns the ESP32 into a Bluetooth LE keyboard that writes the words, presses Enter, presses a media key and then Ctrl+Alt+Delete 3 | */ 4 | #include 5 | 6 | 7 | void setup() { 8 | Serial.begin(115200); 9 | Serial.println("Starting BLE work!"); 10 | Keyboard.begin(); 11 | } 12 | 13 | void loop() { 14 | if(bleDevice.isConnected()) { 15 | Serial.println("Sending 'Hello world'..."); 16 | Keyboard.print("Hello world"); 17 | 18 | delay(1000); 19 | 20 | Serial.println("Sending Enter key..."); 21 | Keyboard.write(KEY_RETURN); 22 | 23 | delay(1000); 24 | 25 | Serial.println("Sending Play/Pause media key..."); 26 | Keyboard.write(KEY_MEDIA_PLAY_PAUSE); 27 | 28 | delay(1000); 29 | } 30 | 31 | Serial.println("Waiting 5 seconds..."); 32 | delay(5000); 33 | } 34 | -------------------------------------------------------------------------------- /2.Firmware/lib/ESP32-BLE-Combo/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For ESP32 BLE Keyboard 3 | ####################################### 4 | # Class 5 | ####################################### 6 | 7 | BleCombo KEYWORD1 8 | Keyboard_ KEYWORD1 9 | Mouse_ KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions 13 | ####################################### 14 | 15 | begin KEYWORD2 16 | end KEYWORD2 17 | write KEYWORD2 18 | press KEYWORD2 19 | release KEYWORD2 20 | releaseAll KEYWORD2 21 | setBatteryLevel KEYWORD2 22 | isConnected KEYWORD2 23 | 24 | ####################################### 25 | # Constants 26 | ####################################### 27 | -------------------------------------------------------------------------------- /2.Firmware/lib/ESP32-BLE-Combo/library.properties: -------------------------------------------------------------------------------- 1 | name=ESP32 BLE HID Combo 2 | version=0.3.1 3 | author=T-vK 4 | maintainer=T-vK 5 | sentence=Bluetooth LE HID Combo library for the ESP32. 6 | paragraph=Bluetooth LE HID Combo library for the ESP32. 7 | category=Communication 8 | url=https://github.com/Georgegipa/ESP32-BLE-Combo 9 | architectures=esp32 10 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/.gitignore: -------------------------------------------------------------------------------- 1 | *.gch 2 | *~ 3 | /.vscode 4 | /docs/html 5 | /docs/latex 6 | /docs/doxygen-awesome-css 7 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 FastLED 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/ci/ci-compile: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # compile FastLED examples with platformio for various boards. This script 4 | # is usually run by the CI, but can also be run locally. Only dependency 5 | # is platformio. 6 | # 7 | # usage: 8 | # [BOARDS=boards] [EXAMPLES=examples] ./ci-compile 9 | # 10 | # e.g. 11 | # $ ./compile-ci 12 | # - compile all board/examples combinations 13 | # 14 | # $ BOARDS="esp32 esp01" EXAMPLES=Blink ./compile-ci 15 | # - compile only Blink example for the esp32 and esp8266 platforms 16 | # 17 | set -eou pipefail 18 | 19 | # List of examples that will be compiled by default 20 | EXAMPLES=${EXAMPLES:-"Blink ColorPalette ColorTemperature Cylon DemoReel100 21 | Fire2012 FirstLight Multiple/MultipleStripsInOneArray 22 | Multiple/ArrayOfLedArrays Noise NoisePlayground NoisePlusPalette Pacifica 23 | Pride2015 RGBCalibrate RGBSetDemo TwinkleFox XYMatrix"} 24 | 25 | # list of boards to compile for by default 26 | BOARDS=${BOARDS:-"uno esp32dev esp01 yun digix teensy30"} 27 | 28 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 29 | BOARD_OPTS=$(for b in $BOARDS; do echo -n "--board $b "; done) 30 | 31 | cd "$DIR/.." 32 | 33 | export PLATFORMIO_EXTRA_SCRIPTS="pre:lib/ci/ci-flags.py" 34 | 35 | for d in $EXAMPLES ; do 36 | echo "*** building example $d for $BOARDS ***" 37 | pio ci $BOARD_OPTS --lib=ci --lib=src "examples/$d/"*ino 38 | done 39 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/ci/ci-flags.py: -------------------------------------------------------------------------------- 1 | Import("env") 2 | 3 | env.Append(CXXFLAGS=["-Wno-register"]) 4 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/component.mk: -------------------------------------------------------------------------------- 1 | COMPONENT_ADD_INCLUDEDIRS := ./src src/platforms/esp/32 2 | COMPONENT_SRCDIRS := ./src src/platforms/esp/32 3 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/docs/include/fastled-docs.css: -------------------------------------------------------------------------------- 1 | /** 2 | FastLED Doxygen Stylesheet 3 | https://github.com/FastLED/FastLED/ 4 | */ 5 | 6 | /** Hide "Detailed Description" sub-header when the 7 | * detailed description is at the top of a page. 8 | */ 9 | .contents a#details + h2.groupheader { 10 | display:none; 11 | } 12 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/docs/include/fastled_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhangKeLiang0627/EasyGPS/337eaeb32b96d579334ffd86bbdc8d0d308706ba/2.Firmware/lib/FastLED/docs/include/fastled_logo.png -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/docs/include/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/examples/Multiple/OctoWS2811Demo/OctoWS2811Demo.ino: -------------------------------------------------------------------------------- 1 | /// @file OctoWS2811Demo.ino 2 | /// @brief Demonstrates how to use OctoWS2811 output 3 | /// @example OctoWS2811Demo.ino 4 | 5 | #define USE_OCTOWS2811 6 | #include 7 | #include 8 | 9 | #define NUM_LEDS_PER_STRIP 64 10 | #define NUM_STRIPS 8 11 | 12 | CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP]; 13 | 14 | // Pin layouts on the teensy 3: 15 | // OctoWS2811: 2,14,7,8,6,20,21,5 16 | 17 | void setup() { 18 | FastLED.addLeds(leds, NUM_LEDS_PER_STRIP); 19 | FastLED.setBrightness(32); 20 | } 21 | 22 | void loop() { 23 | static uint8_t hue = 0; 24 | for(int i = 0; i < NUM_STRIPS; i++) { 25 | for(int j = 0; j < NUM_LEDS_PER_STRIP; j++) { 26 | leds[(i*NUM_LEDS_PER_STRIP) + j] = CHSV((32*i) + hue+j,192,255); 27 | } 28 | } 29 | 30 | // Set the first n leds on each strip to show which strip it is 31 | for(int i = 0; i < NUM_STRIPS; i++) { 32 | for(int j = 0; j <= i; j++) { 33 | leds[(i*NUM_LEDS_PER_STRIP) + j] = CRGB::Red; 34 | } 35 | } 36 | 37 | hue++; 38 | 39 | FastLED.show(); 40 | FastLED.delay(10); 41 | } 42 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/examples/RGBSetDemo/RGBSetDemo.ino: -------------------------------------------------------------------------------- 1 | /// @file RGBSetDemo.ino 2 | /// @brief Demonstrates how to create an LED group with CRGBArray 3 | /// @example RGBSetDemo.ino 4 | 5 | #include 6 | #define NUM_LEDS 40 7 | 8 | CRGBArray leds; 9 | 10 | void setup() { FastLED.addLeds(leds, NUM_LEDS); } 11 | 12 | void loop(){ 13 | static uint8_t hue; 14 | for(int i = 0; i < NUM_LEDS/2; i++) { 15 | // fade everything out 16 | leds.fadeToBlackBy(40); 17 | 18 | // let's set an led value 19 | leds[i] = CHSV(hue++,255,255); 20 | 21 | // now, let's first 20 leds to the top 20 leds, 22 | leds(NUM_LEDS/2,NUM_LEDS-1) = leds(NUM_LEDS/2 - 1 ,0); 23 | FastLED.delay(33); 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/extras/AppleII.s65: -------------------------------------------------------------------------------- 1 | KBD = $C000 ;Read keydown 2 | KBDSTRB = $C010 ;Reset keybd 3 | 4 | SPKR = $C030 ;Toggle speaker 5 | 6 | ; TTL digital output pins on 7 | ; 16-pin DIP game connector 8 | SETAN0 = $C058 9 | CLRAN0 = $C059 10 | SETAN1 = $C05A 11 | CLRAN1 = $C05B 12 | SETAN2 = $C05C 13 | CLRAN2 = $C05D 14 | SETAN3 = $C05E 15 | CLRAN3 = $C05F 16 | 17 | PIN12ON = CLRAN3 18 | PIN12OFF= SETAN3 19 | PIN13ON = CLRAN2 20 | PIN13OFF= SETAN2 21 | PIN14ON = CLRAN1 22 | PIN14OFF= SETAN1 23 | PIN15ON = CLRAN0 24 | PIN15OFF= SETAN0 25 | 26 | ;Special for pin 5, except on //gs 27 | C040STROBE = $C040 28 | PIN5STROBE = C040STROBE 29 | 30 | SolidApple = $C062 ; read SW1 or SA 31 | OpenApple = $C061 ; read SW0 or OA 32 | 33 | VBL = $C019 ; vertical blanking 34 | 35 | WAIT = $FCA8 ; wait a little while 36 | 37 | CROUT = $FD8E ; print a CR 38 | PRBYTE = $FDDA ; print a hex byte 39 | 40 | 41 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/extras/RainbowDemo.bin.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhangKeLiang0627/EasyGPS/337eaeb32b96d579334ffd86bbdc8d0d308706ba/2.Firmware/lib/FastLED/extras/RainbowDemo.bin.zip -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/bitswap.cpp: -------------------------------------------------------------------------------- 1 | /// @file bitswap.cpp 2 | /// Functions for doing a rotation of bits/bytes used by parallel output 3 | 4 | /// Disables pragma messages and warnings 5 | #define FASTLED_INTERNAL 6 | 7 | #include "FastLED.h" 8 | 9 | void transpose8x1_noinline(unsigned char *A, unsigned char *B) { 10 | uint32_t x, y, t; 11 | 12 | // Load the array and pack it into x and y. 13 | y = *(unsigned int*)(A); 14 | x = *(unsigned int*)(A+4); 15 | 16 | // pre-transform x 17 | t = (x ^ (x >> 7)) & 0x00AA00AA; x = x ^ t ^ (t << 7); 18 | t = (x ^ (x >>14)) & 0x0000CCCC; x = x ^ t ^ (t <<14); 19 | 20 | // pre-transform y 21 | t = (y ^ (y >> 7)) & 0x00AA00AA; y = y ^ t ^ (t << 7); 22 | t = (y ^ (y >>14)) & 0x0000CCCC; y = y ^ t ^ (t <<14); 23 | 24 | // final transform 25 | t = (x & 0xF0F0F0F0) | ((y >> 4) & 0x0F0F0F0F); 26 | y = ((x << 4) & 0xF0F0F0F0) | (y & 0x0F0F0F0F); 27 | x = t; 28 | 29 | *((uint32_t*)B) = y; 30 | *((uint32_t*)(B+4)) = x; 31 | } 32 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/colorpalettes.h: -------------------------------------------------------------------------------- 1 | #ifndef __INC_COLORPALETTES_H 2 | #define __INC_COLORPALETTES_H 3 | 4 | #include "FastLED.h" 5 | #include "colorutils.h" 6 | 7 | /// @file colorpalettes.h 8 | /// Declarations for the predefined color palettes supplied by FastLED. 9 | 10 | // Have Doxygen ignore these declarations 11 | /// @cond 12 | 13 | FASTLED_NAMESPACE_BEGIN 14 | 15 | extern const TProgmemRGBPalette16 CloudColors_p FL_PROGMEM; 16 | extern const TProgmemRGBPalette16 LavaColors_p FL_PROGMEM; 17 | extern const TProgmemRGBPalette16 OceanColors_p FL_PROGMEM; 18 | extern const TProgmemRGBPalette16 ForestColors_p FL_PROGMEM; 19 | 20 | extern const TProgmemRGBPalette16 RainbowColors_p FL_PROGMEM; 21 | 22 | /// Alias of RainbowStripeColors_p 23 | #define RainbowStripesColors_p RainbowStripeColors_p 24 | extern const TProgmemRGBPalette16 RainbowStripeColors_p FL_PROGMEM; 25 | 26 | extern const TProgmemRGBPalette16 PartyColors_p FL_PROGMEM; 27 | 28 | extern const TProgmemRGBPalette16 HeatColors_p FL_PROGMEM; 29 | 30 | 31 | DECLARE_GRADIENT_PALETTE( Rainbow_gp); 32 | 33 | FASTLED_NAMESPACE_END 34 | 35 | /// @endcond 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/cpp_compat.h: -------------------------------------------------------------------------------- 1 | /// @file cpp_compat.h 2 | /// Compatibility functions based on C++ version 3 | 4 | #ifndef __INC_CPP_COMPAT_H 5 | #define __INC_CPP_COMPAT_H 6 | 7 | #include "FastLED.h" 8 | 9 | #if __cplusplus <= 199711L 10 | 11 | /// Compile-time assertion checking, introduced in C++11 12 | /// @see https://en.cppreference.com/w/cpp/language/static_assert 13 | #define static_assert(expression, message) 14 | 15 | /// Declares that it is possible to evaluate a value at compile time, introduced in C++11 16 | /// @see https://en.cppreference.com/w/cpp/language/constexpr 17 | #define constexpr const 18 | 19 | #else 20 | 21 | // things that we can turn on if we're in a C++11 environment 22 | #endif 23 | 24 | #if __cplusplus < 201703L 25 | #define REGISTER register 26 | #else 27 | #define REGISTER 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/fastspi_dma.h: -------------------------------------------------------------------------------- 1 | /// @file fastspi_dma.h 2 | /// Direct memory access (DMA) functions for SPI interfaces 3 | /// @deprecated This header file is empty. 4 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/apollo3/fastled_apollo3.h: -------------------------------------------------------------------------------- 1 | #ifndef __INC_FASTLED_APOLLO3_H 2 | #define __INC_FASTLED_APOLLO3_H 3 | 4 | #include "fastpin_apollo3.h" 5 | #include "fastspi_apollo3.h" 6 | #include "clockless_apollo3.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/apollo3/led_sysdefs_apollo3.h: -------------------------------------------------------------------------------- 1 | #ifndef __INC_LED_SYSDEFS_APOLLO3_H 2 | #define __INC_LED_SYSDEFS_APOLLO3_H 3 | 4 | #define FASTLED_APOLLO3 5 | 6 | #ifndef INTERRUPT_THRESHOLD 7 | #define INTERRUPT_THRESHOLD 1 8 | #endif 9 | 10 | // Default to allowing interrupts 11 | #ifndef FASTLED_ALLOW_INTERRUPTS 12 | #define FASTLED_ALLOW_INTERRUPTS 1 13 | #endif 14 | 15 | #if FASTLED_ALLOW_INTERRUPTS == 1 16 | #define FASTLED_ACCURATE_CLOCK 17 | #endif 18 | 19 | #ifndef F_CPU 20 | #define F_CPU 48000000 21 | #endif 22 | 23 | // Default to NOT using PROGMEM 24 | #ifndef FASTLED_USE_PROGMEM 25 | #define FASTLED_USE_PROGMEM 0 26 | #endif 27 | 28 | // data type defs 29 | typedef volatile uint8_t RoReg; /**< Read only 8-bit register (volatile const unsigned int) */ 30 | typedef volatile uint8_t RwReg; /**< Read-Write 8-bit register (volatile unsigned int) */ 31 | 32 | #define FASTLED_NO_PINMAP 33 | 34 | // reusing/abusing cli/sei defs for due 35 | // These should be fine for the Apollo3. It has its own defines in cmsis_gcc.h 36 | #define cli() __disable_irq(); //__disable_fault_irq(); 37 | #define sei() __enable_irq(); //__enable_fault_irq(); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/arm/d21/fastled_arm_d21.h: -------------------------------------------------------------------------------- 1 | #ifndef __INC_FASTLED_ARM_D21_H 2 | #define __INC_FASTLED_ARM_D21_H 3 | 4 | #include "fastpin_arm_d21.h" 5 | #include "clockless_arm_d21.h" 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/arm/d21/led_sysdefs_arm_d21.h: -------------------------------------------------------------------------------- 1 | #ifndef __INC_LED_SYSDEFS_ARM_D21_H 2 | #define __INC_LED_SYSDEFS_ARM_D21_H 3 | 4 | 5 | #define FASTLED_ARM 6 | #define FASTLED_ARM_M0_PLUS 7 | 8 | #ifndef INTERRUPT_THRESHOLD 9 | #define INTERRUPT_THRESHOLD 1 10 | #endif 11 | 12 | // Default to allowing interrupts 13 | #ifndef FASTLED_ALLOW_INTERRUPTS 14 | #define FASTLED_ALLOW_INTERRUPTS 1 15 | #endif 16 | 17 | #if FASTLED_ALLOW_INTERRUPTS == 1 18 | #define FASTLED_ACCURATE_CLOCK 19 | #endif 20 | 21 | // reusing/abusing cli/sei defs for due 22 | #define cli() __disable_irq(); 23 | #define sei() __enable_irq(); 24 | 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/arm/d51/README.txt: -------------------------------------------------------------------------------- 1 | FastLED updates for adafruit FEATHER M4 and fixes to ITSBITSY M4 compiles 2 | SAMD51 3 | 4 | Tested on 5 | - FEATHER M4 with DOTSTAR and neopixel strips 6 | - Seeed Wio Terminal and WS2812B and APA102 LED strips using either SPI or GPIO pins 7 | 8 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/arm/d51/fastled_arm_d51.h: -------------------------------------------------------------------------------- 1 | #ifndef __INC_FASTLED_ARM_D51_H 2 | #define __INC_FASTLED_ARM_D51_H 3 | 4 | #include "fastpin_arm_d51.h" 5 | #include "../../fastspi_ardunio_core.h" 6 | #include "clockless_arm_d51.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/arm/d51/led_sysdefs_arm_d51.h: -------------------------------------------------------------------------------- 1 | #ifndef __INC_LED_SYSDEFS_ARM_D51_H 2 | #define __INC_LED_SYSDEFS_ARM_D51_H 3 | 4 | 5 | #define FASTLED_ARM 6 | 7 | #ifndef INTERRUPT_THRESHOLD 8 | #define INTERRUPT_THRESHOLD 1 9 | #endif 10 | 11 | // Default to allowing interrupts 12 | #ifndef FASTLED_ALLOW_INTERRUPTS 13 | #define FASTLED_ALLOW_INTERRUPTS 1 14 | #endif 15 | 16 | #if FASTLED_ALLOW_INTERRUPTS == 1 17 | #define FASTLED_ACCURATE_CLOCK 18 | #endif 19 | 20 | // reusing/abusing cli/sei defs for due 21 | #define cli() __disable_irq(); 22 | #define sei() __enable_irq(); 23 | 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/arm/k20/fastled_arm_k20.h: -------------------------------------------------------------------------------- 1 | #ifndef __INC_FASTLED_ARM_K20_H 2 | #define __INC_FASTLED_ARM_K20_H 3 | 4 | // Include the k20 headers 5 | #include "fastpin_arm_k20.h" 6 | #include "fastspi_arm_k20.h" 7 | #include "octows2811_controller.h" 8 | #include "ws2812serial_controller.h" 9 | #include "smartmatrix_t3.h" 10 | #include "clockless_arm_k20.h" 11 | #include "clockless_block_arm_k20.h" 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/arm/k20/led_sysdefs_arm_k20.h: -------------------------------------------------------------------------------- 1 | #ifndef __INC_LED_SYSDEFS_ARM_K20_H 2 | #define __INC_LED_SYSDEFS_ARM_K20_H 3 | 4 | #define FASTLED_TEENSY3 5 | #define FASTLED_ARM 6 | 7 | #ifndef INTERRUPT_THRESHOLD 8 | #define INTERRUPT_THRESHOLD 1 9 | #endif 10 | 11 | // Default to allowing interrupts 12 | #ifndef FASTLED_ALLOW_INTERRUPTS 13 | #define FASTLED_ALLOW_INTERRUPTS 1 14 | #endif 15 | 16 | #if FASTLED_ALLOW_INTERRUPTS == 1 17 | #define FASTLED_ACCURATE_CLOCK 18 | #endif 19 | 20 | #if (F_CPU == 96000000) 21 | #define CLK_DBL 1 22 | #endif 23 | 24 | // Get some system include files 25 | #include 26 | #include // for cli/se definitions 27 | 28 | // Define the register types 29 | #if defined(ARDUINO) // && ARDUINO < 150 30 | typedef volatile uint8_t RoReg; /**< Read only 8-bit register (volatile const unsigned int) */ 31 | typedef volatile uint8_t RwReg; /**< Read-Write 8-bit register (volatile unsigned int) */ 32 | #endif 33 | 34 | extern volatile uint32_t systick_millis_count; 35 | # define MS_COUNTER systick_millis_count 36 | 37 | 38 | // Default to using PROGMEM, since TEENSY3 provides it 39 | // even though all it does is ignore it. Just being 40 | // conservative here in case TEENSY3 changes. 41 | #ifndef FASTLED_USE_PROGMEM 42 | #define FASTLED_USE_PROGMEM 1 43 | #endif 44 | 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/arm/k20/ws2812serial_controller.h: -------------------------------------------------------------------------------- 1 | #ifndef __INC_WS2812SERIAL_CONTROLLER_H 2 | #define __INC_WS2812SERIAL_CONTROLLER_H 3 | 4 | #ifdef USE_WS2812SERIAL 5 | 6 | FASTLED_NAMESPACE_BEGIN 7 | 8 | template 9 | class CWS2812SerialController : public CPixelLEDController { 10 | WS2812Serial *pserial; 11 | uint8_t *drawbuffer,*framebuffer; 12 | 13 | void _init(int nLeds) { 14 | if (pserial == NULL) { 15 | drawbuffer = (uint8_t*)malloc(nLeds * 3); 16 | framebuffer = (uint8_t*)malloc(nLeds * 12); 17 | pserial = new WS2812Serial(nLeds, framebuffer, drawbuffer, DATA_PIN, WS2812_RGB); 18 | pserial->begin(); 19 | } 20 | } 21 | 22 | public: 23 | CWS2812SerialController() { pserial = NULL; } 24 | 25 | virtual void init() { /* do nothing yet */ } 26 | 27 | virtual void showPixels(PixelController & pixels) { 28 | _init(pixels.size()); 29 | 30 | uint8_t *p = drawbuffer; 31 | 32 | while(pixels.has(1)) { 33 | *p++ = pixels.loadAndScale0(); 34 | *p++ = pixels.loadAndScale1(); 35 | *p++ = pixels.loadAndScale2(); 36 | pixels.stepDithering(); 37 | pixels.advanceData(); 38 | } 39 | pserial->show(); 40 | } 41 | 42 | }; 43 | 44 | FASTLED_NAMESPACE_END 45 | 46 | #endif // USE_WS2812SERIAL 47 | #endif // __INC_WS2812SERIAL_CONTROLLER_H 48 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/arm/k66/fastled_arm_k66.h: -------------------------------------------------------------------------------- 1 | #ifndef __INC_FASTLED_ARM_K66_H 2 | #define __INC_FASTLED_ARM_K66_H 3 | 4 | // Include the k66 headers 5 | #include "fastpin_arm_k66.h" 6 | #include "fastspi_arm_k66.h" 7 | #include "../k20/octows2811_controller.h" 8 | #include "../k20/ws2812serial_controller.h" 9 | #include "../k20/smartmatrix_t3.h" 10 | #include "clockless_arm_k66.h" 11 | #include "clockless_block_arm_k66.h" 12 | 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/arm/k66/led_sysdefs_arm_k66.h: -------------------------------------------------------------------------------- 1 | #ifndef __INC_LED_SYSDEFS_ARM_K66_H 2 | #define __INC_LED_SYSDEFS_ARM_K66_H 3 | 4 | #define FASTLED_TEENSY3 5 | #define FASTLED_ARM 6 | 7 | #ifndef INTERRUPT_THRESHOLD 8 | #define INTERRUPT_THRESHOLD 1 9 | #endif 10 | 11 | // Default to allowing interrupts 12 | #ifndef FASTLED_ALLOW_INTERRUPTS 13 | #define FASTLED_ALLOW_INTERRUPTS 1 14 | #endif 15 | 16 | #if FASTLED_ALLOW_INTERRUPTS == 1 17 | #define FASTLED_ACCURATE_CLOCK 18 | #endif 19 | 20 | #if (F_CPU == 192000000) 21 | #define CLK_DBL 1 22 | #endif 23 | 24 | // Get some system include files 25 | #include 26 | #include // for cli/se definitions 27 | 28 | // Define the register types 29 | #if defined(ARDUINO) // && ARDUINO < 150 30 | typedef volatile uint8_t RoReg; /**< Read only 8-bit register (volatile const unsigned int) */ 31 | typedef volatile uint8_t RwReg; /**< Read-Write 8-bit register (volatile unsigned int) */ 32 | #endif 33 | 34 | extern volatile uint32_t systick_millis_count; 35 | # define MS_COUNTER systick_millis_count 36 | 37 | 38 | // Default to using PROGMEM, since TEENSY3 provides it 39 | // even though all it does is ignore it. Just being 40 | // conservative here in case TEENSY3 changes. 41 | #ifndef FASTLED_USE_PROGMEM 42 | #define FASTLED_USE_PROGMEM 1 43 | #endif 44 | 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/arm/kl26/fastled_arm_kl26.h: -------------------------------------------------------------------------------- 1 | #ifndef __INC_FASTLED_ARM_KL26_H 2 | #define __INC_FASTLED_ARM_KL26_H 3 | 4 | // Include the k20 headers 5 | #include "fastpin_arm_kl26.h" 6 | #include "fastspi_arm_kl26.h" 7 | #include "clockless_arm_kl26.h" 8 | #include "../k20/ws2812serial_controller.h" 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/arm/kl26/led_sysdefs_arm_kl26.h: -------------------------------------------------------------------------------- 1 | #ifndef __INC_LED_SYSDEFS_ARM_KL26_H 2 | #define __INC_LED_SYSDEFS_ARM_KL26_H 3 | 4 | #define FASTLED_TEENSYLC 5 | #define FASTLED_ARM 6 | #define FASTLED_ARM_M0_PLUS 7 | 8 | #ifndef INTERRUPT_THRESHOLD 9 | #define INTERRUPT_THRESHOLD 1 10 | #endif 11 | 12 | #define FASTLED_SPI_BYTE_ONLY 13 | 14 | // Default to allowing interrupts 15 | #ifndef FASTLED_ALLOW_INTERRUPTS 16 | // #define FASTLED_ALLOW_INTERRUPTS 1 17 | #endif 18 | 19 | #if FASTLED_ALLOW_INTERRUPTS == 1 20 | #define FASTLED_ACCURATE_CLOCK 21 | #endif 22 | 23 | #if (F_CPU == 96000000) 24 | #define CLK_DBL 1 25 | #endif 26 | 27 | // Get some system include files 28 | #include 29 | #include // for cli/se definitions 30 | 31 | // Define the register types 32 | #if defined(ARDUINO) // && ARDUINO < 150 33 | typedef volatile uint8_t RoReg; /**< Read only 8-bit register (volatile const unsigned int) */ 34 | typedef volatile uint8_t RwReg; /**< Read-Write 8-bit register (volatile unsigned int) */ 35 | #endif 36 | 37 | extern volatile uint32_t systick_millis_count; 38 | # define MS_COUNTER systick_millis_count 39 | 40 | // Default to using PROGMEM since TEENSYLC provides it 41 | // even though all it does is ignore it. Just being 42 | // conservative here in case TEENSYLC changes. 43 | #ifndef FASTLED_USE_PROGMEM 44 | #define FASTLED_USE_PROGMEM 1 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/arm/mxrt1062/fastled_arm_mxrt1062.h: -------------------------------------------------------------------------------- 1 | #ifndef __INC_FASTLED_ARM_MXRT1062_H 2 | #define __INC_FASTLED_ARM_MXRT1062_H 3 | 4 | #include "fastpin_arm_mxrt1062.h" 5 | #include "fastspi_arm_mxrt1062.h" 6 | #include "octows2811_controller.h" 7 | #include "../k20/ws2812serial_controller.h" 8 | #include "../k20/smartmatrix_t3.h" 9 | #include "clockless_arm_mxrt1062.h" 10 | #include "block_clockless_arm_mxrt1062.h" 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/arm/mxrt1062/led_sysdefs_arm_mxrt1062.h: -------------------------------------------------------------------------------- 1 | #ifndef __INC_LED_SYSDEFS_ARM_MXRT1062_H 2 | #define __INC_LED_SYSDEFS_ARM_MXRT1062_H 3 | 4 | #define FASTLED_TEENSY4 5 | #define FASTLED_ARM 6 | 7 | #ifndef INTERRUPT_THRESHOLD 8 | #define INTERRUPT_THRESHOLD 1 9 | #endif 10 | 11 | // Default to allowing interrupts 12 | #ifndef FASTLED_ALLOW_INTERRUPTS 13 | #define FASTLED_ALLOW_INTERRUPTS 1 14 | #endif 15 | 16 | #if FASTLED_ALLOW_INTERRUPTS == 1 17 | #define FASTLED_ACCURATE_CLOCK 18 | #endif 19 | 20 | #if (F_CPU == 96000000) 21 | #define CLK_DBL 1 22 | #endif 23 | 24 | // Get some system include files 25 | #include 26 | #include // for cli/se definitions 27 | 28 | // Define the register types 29 | #if defined(ARDUINO) // && ARDUINO < 150 30 | typedef volatile uint32_t RoReg; /**< Read only 8-bit register (volatile const unsigned int) */ 31 | typedef volatile uint32_t RwReg; /**< Read-Write 8-bit register (volatile unsigned int) */ 32 | #endif 33 | 34 | // extern volatile uint32_t systick_millis_count; 35 | // # define MS_COUNTER systick_millis_count 36 | 37 | // Teensy4 provides progmem 38 | #ifndef FASTLED_USE_PROGMEM 39 | #define FASTLED_USE_PROGMEM 1 40 | #endif 41 | 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/arm/nrf51/fastled_arm_nrf51.h: -------------------------------------------------------------------------------- 1 | #ifndef __INC_FASTLED_ARM_NRF51_H 2 | #define __INC_FASTLED_ARM_NRF51_H 3 | 4 | // Include the k20 headers 5 | #include "fastpin_arm_nrf51.h" 6 | #include "fastspi_arm_nrf51.h" 7 | #include "clockless_arm_nrf51.h" 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/arm/nrf51/led_sysdefs_arm_nrf51.h: -------------------------------------------------------------------------------- 1 | #ifndef __LED_SYSDEFS_ARM_NRF51 2 | #define __LED_SYSDEFS_ARM_NRF51 3 | 4 | #ifndef NRF51 5 | #define NRF51 6 | #endif 7 | 8 | #define LED_TIMER NRF_TIMER1 9 | #define FASTLED_NO_PINMAP 10 | #define FASTLED_HAS_CLOCKLESS 11 | 12 | #define FASTLED_SPI_BYTE_ONLY 13 | 14 | #define FASTLED_ARM 15 | #define FASTLED_ARM_M0 16 | 17 | #ifndef F_CPU 18 | #define F_CPU 16000000 19 | #endif 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | typedef volatile uint32_t RoReg; 26 | typedef volatile uint32_t RwReg; 27 | typedef uint32_t prog_uint32_t; 28 | typedef uint8_t boolean; 29 | 30 | #define PROGMEM 31 | #define NO_PROGMEM 32 | #define NEED_CXX_BITS 33 | 34 | // Default to NOT using PROGMEM here 35 | #ifndef FASTLED_USE_PROGMEM 36 | #define FASTLED_USE_PROGMEM 0 37 | #endif 38 | 39 | #ifndef FASTLED_ALLOW_INTERRUPTS 40 | #define FASTLED_ALLOW_INTERRUPTS 1 41 | #endif 42 | 43 | #define cli() __disable_irq(); 44 | #define sei() __enable_irq(); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/arm/nrf52/fastled_arm_nrf52.h: -------------------------------------------------------------------------------- 1 | #ifndef __INC_FASTLED_ARM_NRF52_H 2 | #define __INC_FASTLED_ARM_NRF52_H 3 | 4 | #include "led_sysdefs_arm_nrf52.h" 5 | #include "arbiter_nrf52.h" 6 | #include "fastpin_arm_nrf52.h" 7 | #include "fastspi_arm_nrf52.h" 8 | #include "clockless_arm_nrf52.h" 9 | 10 | #endif // #ifndef __INC_FASTLED_ARM_NRF52_H 11 | 12 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/arm/rp2040/fastled_arm_rp2040.h: -------------------------------------------------------------------------------- 1 | #ifndef __INC_FASTLED_ARM_RP2040_H 2 | #define __INC_FASTLED_ARM_RP2040_H 3 | 4 | // Include the rp2040 headers 5 | #include "fastpin_arm_rp2040.h" 6 | #include "clockless_arm_rp2040.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/arm/sam/fastled_arm_sam.h: -------------------------------------------------------------------------------- 1 | #ifndef __INC_FASTLED_ARM_SAM_H 2 | #define __INC_FASTLED_ARM_SAM_H 3 | 4 | // Include the sam headers 5 | #include "fastpin_arm_sam.h" 6 | #include "fastspi_arm_sam.h" 7 | #include "clockless_arm_sam.h" 8 | #include "clockless_block_arm_sam.h" 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/arm/sam/led_sysdefs_arm_sam.h: -------------------------------------------------------------------------------- 1 | #ifndef __INC_LED_SYSDEFS_ARM_SAM_H 2 | #define __INC_LED_SYSDEFS_ARM_SAM_H 3 | 4 | 5 | #define FASTLED_ARM 6 | 7 | // Setup DUE timer defines/channels/etc... 8 | #ifndef DUE_TIMER_CHANNEL 9 | #define DUE_TIMER_GROUP 0 10 | #endif 11 | 12 | #ifndef DUE_TIMER_CHANNEL 13 | #define DUE_TIMER_CHANNEL 0 14 | #endif 15 | 16 | #define DUE_TIMER ((DUE_TIMER_GROUP==0) ? TC0 : ((DUE_TIMER_GROUP==1) ? TC1 : TC2)) 17 | #define DUE_TIMER_ID (ID_TC0 + (DUE_TIMER_GROUP*3) + DUE_TIMER_CHANNEL) 18 | #define DUE_TIMER_VAL (DUE_TIMER->TC_CHANNEL[DUE_TIMER_CHANNEL].TC_CV << 1) 19 | #define DUE_TIMER_RUNNING ((DUE_TIMER->TC_CHANNEL[DUE_TIMER_CHANNEL].TC_SR & TC_SR_CLKSTA) != 0) 20 | 21 | #ifndef INTERRUPT_THRESHOLD 22 | #define INTERRUPT_THRESHOLD 1 23 | #endif 24 | 25 | // Default to allowing interrupts 26 | #ifndef FASTLED_ALLOW_INTERRUPTS 27 | #define FASTLED_ALLOW_INTERRUPTS 1 28 | #endif 29 | 30 | #if FASTLED_ALLOW_INTERRUPTS == 1 31 | #define FASTLED_ACCURATE_CLOCK 32 | #endif 33 | 34 | // reusing/abusing cli/sei defs for due 35 | #define cli() __disable_irq(); __disable_fault_irq(); 36 | #define sei() __enable_irq(); __enable_fault_irq(); 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/arm/stm32/fastled_arm_stm32.h: -------------------------------------------------------------------------------- 1 | #ifndef __INC_FASTLED_ARM_SAM_H 2 | #define __INC_FASTLED_ARM_SAM_H 3 | 4 | // Include the sam headers 5 | #include "fastpin_arm_stm32.h" 6 | // #include "fastspi_arm_stm32.h" 7 | #include "clockless_arm_stm32.h" 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/avr/fastled_avr.h: -------------------------------------------------------------------------------- 1 | #ifndef __INC_FASTLED_AVR_H 2 | #define __INC_FASTLED_AVR_H 3 | 4 | #include "fastpin_avr.h" 5 | #include "fastspi_avr.h" 6 | #include "clockless_trinket.h" 7 | 8 | // Default to using PROGMEM 9 | #ifndef FASTLED_USE_PROGMEM 10 | #define FASTLED_USE_PROGMEM 1 11 | #endif 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/esp/32/fastled_esp32.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "fastpin_esp32.h" 4 | 5 | #ifdef FASTLED_ALL_PINS_HARDWARE_SPI 6 | #include "fastspi_esp32.h" 7 | #endif 8 | 9 | #ifdef FASTLED_ESP32_I2S 10 | #include "clockless_i2s_esp32.h" 11 | #else 12 | #include "clockless_rmt_esp32.h" 13 | #endif 14 | 15 | // #include "clockless_block_esp32.h" 16 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/esp/32/led_sysdefs_esp32.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "esp32-hal.h" 3 | #ifndef ESP32 4 | #define ESP32 5 | #endif 6 | 7 | #define FASTLED_ESP32 8 | 9 | #if CONFIG_IDF_TARGET_ARCH_RISCV 10 | #define FASTLED_RISCV 11 | #else 12 | #define FASTLED_XTENSA 13 | #endif 14 | 15 | // Handling for older versions of ESP32 Arduino core 16 | #if !defined(ESP_IDF_VERSION) 17 | // Older versions of ESP_IDF only supported ESP32 18 | #define CONFIG_IDF_TARGET_ESP32 1 19 | // Define missing version macros. Hard code older version 3.0 since actual version is unknown 20 | #define ESP_IDF_VERSION_VAL(major, minor, patch) ((major << 16) | (minor << 8) | (patch)) 21 | #define ESP_IDF_VERSION ESP_IDF_VERSION_VAL(3, 0, 0) 22 | #endif 23 | 24 | // Use system millis timer 25 | #define FASTLED_HAS_MILLIS 26 | 27 | typedef volatile uint32_t RoReg; 28 | typedef volatile uint32_t RwReg; 29 | typedef unsigned long prog_uint32_t; 30 | 31 | 32 | // Default to NOT using PROGMEM here 33 | #ifndef FASTLED_USE_PROGMEM 34 | # define FASTLED_USE_PROGMEM 0 35 | #endif 36 | 37 | #ifndef FASTLED_ALLOW_INTERRUPTS 38 | # define FASTLED_ALLOW_INTERRUPTS 1 39 | # define INTERRUPT_THRESHOLD 0 40 | #endif 41 | 42 | #define NEED_CXX_BITS 43 | 44 | // These can be overridden 45 | # define FASTLED_ESP32_RAW_PIN_ORDER 46 | 47 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/esp/8266/fastled_esp8266.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "fastpin_esp8266.h" 4 | 5 | #ifdef FASTLED_ALL_PINS_HARDWARE_SPI 6 | #include "fastspi_esp8266.h" 7 | #endif 8 | 9 | #include "clockless_esp8266.h" 10 | #include "clockless_block_esp8266.h" 11 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/src/platforms/esp/8266/led_sysdefs_esp8266.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef ESP8266 4 | #define ESP8266 5 | #endif 6 | 7 | #define FASTLED_ESP8266 8 | 9 | // Use system millis timer 10 | #define FASTLED_HAS_MILLIS 11 | 12 | typedef volatile uint32_t RoReg; 13 | typedef volatile uint32_t RwReg; 14 | typedef uint32_t prog_uint32_t; 15 | 16 | 17 | // Default to NOT using PROGMEM here 18 | #ifndef FASTLED_USE_PROGMEM 19 | # define FASTLED_USE_PROGMEM 0 20 | #endif 21 | 22 | #ifndef FASTLED_ALLOW_INTERRUPTS 23 | # define FASTLED_ALLOW_INTERRUPTS 1 24 | # define INTERRUPT_THRESHOLD 0 25 | #endif 26 | 27 | #define NEED_CXX_BITS 28 | 29 | // These can be overridden 30 | #if !defined(FASTLED_ESP8266_RAW_PIN_ORDER) && !defined(FASTLED_ESP8266_NODEMCU_PIN_ORDER) && !defined(FASTLED_ESP8266_D1_PIN_ORDER) 31 | # ifdef ARDUINO_ESP8266_NODEMCU 32 | # define FASTLED_ESP8266_NODEMCU_PIN_ORDER 33 | # else 34 | # define FASTLED_ESP8266_RAW_PIN_ORDER 35 | # endif 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /2.Firmware/lib/FastLED/workspace.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ] 7 | } -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/.gitignore: -------------------------------------------------------------------------------- 1 | docs/doxydocs 2 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/examples/BLE_Beacon_Scanner/BLE_Beacon_Scanner.md: -------------------------------------------------------------------------------- 1 | ## BLE Beacon Scanner 2 | 3 | Initiates a BLE device scan. 4 | Checks if the discovered devices are 5 | - an iBeacon 6 | - an Eddystone TLM beacon 7 | - an Eddystone URL beacon 8 | 9 | and sends the decoded beacon information over Serial log -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/examples/BLE_EddystoneTLM_Beacon/BLE_EddystoneTLM_Beacon.md: -------------------------------------------------------------------------------- 1 | ## Eddystone TLM beacon 2 | EddystoneTLM beacon by BeeGee based on 3 | [pcbreflux ESP32 Eddystone TLM deepsleep](https://github.com/pcbreflux/espressif/blob/master/esp32/arduino/sketchbook/ESP32_Eddystone_TLM_deepsleep/ESP32_Eddystone_TLM_deepsleep.ino) 4 | 5 | [EddystoneTLM frame specification](https://github.com/google/eddystone/blob/master/eddystone-tlm/tlm-plain.md) 6 | 7 | Create a BLE server that will send periodic Eddystone TLM frames. 8 | The design of creating the BLE server is: 9 | 1. Create a BLE Server 10 | 2. Create advertising data 11 | 3. Start advertising. 12 | 4. wait 13 | 5. Stop advertising. 14 | 6. deep sleep 15 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/examples/BLE_EddystoneURL_Beacon/BLE_EddystoneURL_Beacon.md: -------------------------------------------------------------------------------- 1 | ## Eddystone URL beacon 2 | EddystoneURL beacon by BeeGee based on 3 | [pcbreflux ESP32 Eddystone URL deepsleep](https://github.com/pcbreflux/espressif/tree/master/esp32/arduino/sketchbook/ESP32_Eddystone_URL_deepsleep) 4 | 5 | [EddystoneURL frame specification](https://github.com/google/eddystone/blob/master/eddystone-url/README.md) 6 | 7 | Create a BLE server that will send periodic Eddystone URL frames. 8 | The design of creating the BLE server is: 9 | 1. Create a BLE Server 10 | 2. Create advertising data 11 | 3. Start advertising. 12 | 4. wait 13 | 5. Stop advertising. 14 | 6. deep sleep 15 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/examples/NimBLE_Service_Data_Advertiser/NimBLE_Service_Data_Advertiser.ino: -------------------------------------------------------------------------------- 1 | /** NimBLE_Service_Data_Advertiser Demo: 2 | * 3 | * Simple demo of advertising service data that changes every 5 seconds 4 | * 5 | * Created: on February 7 2021 6 | * Author: H2zero 7 | * 8 | */ 9 | 10 | #include 11 | 12 | #define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b" 13 | 14 | static NimBLEUUID dataUuid(SERVICE_UUID); 15 | static NimBLEAdvertising *pAdvertising = nullptr; 16 | static uint32_t count = 0; 17 | 18 | void setup() { 19 | Serial.begin(115200); 20 | Serial.println("Starting BLE work!"); 21 | 22 | NimBLEDevice::init("svc data"); 23 | pAdvertising = NimBLEDevice::getAdvertising(); 24 | } 25 | 26 | void loop() { 27 | pAdvertising->stop(); 28 | pAdvertising->setServiceData(dataUuid, std::string((char*)&count, sizeof(count))); 29 | pAdvertising->start(); 30 | 31 | Serial.printf("Advertising count = %d\n", count); 32 | count++; 33 | delay(5000); 34 | } 35 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/library.properties: -------------------------------------------------------------------------------- 1 | name=NimBLE-Arduino 2 | version=1.4.1 3 | author=h2zero 4 | maintainer=h2zero 5 | sentence=Bluetooth low energy (BLE) library for arduino-esp32 based on NimBLE. 6 | paragraph=This is a more updated and lower resource alternative to the original bluedroid BLE library for esp32. Uses 50% less flash space and approximately 100KB less ram with the same functionality. Nearly 100% compatible with existing application code, migration guide included. 7 | url=https://github.com/h2zero/NimBLE-Arduino 8 | category=Communication 9 | architectures=esp32,arm-ble 10 | includes=NimBLEDevice.h -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/NimBLEBeacon.h: -------------------------------------------------------------------------------- 1 | /* 2 | * NimBLEBeacon2.h 3 | * 4 | * Created: on March 15 2020 5 | * Author H2zero 6 | * 7 | * Originally: 8 | * 9 | * BLEBeacon2.h 10 | * 11 | * Created on: Jan 4, 2018 12 | * Author: kolban 13 | */ 14 | 15 | #ifndef MAIN_NIMBLEBEACON_H_ 16 | #define MAIN_NIMBLEBEACON_H_ 17 | 18 | #include "NimBLEUUID.h" 19 | /** 20 | * @brief Representation of a beacon. 21 | * See: 22 | * * https://en.wikipedia.org/wiki/IBeacon 23 | */ 24 | class NimBLEBeacon { 25 | private: 26 | struct { 27 | uint16_t manufacturerId; 28 | uint8_t subType; 29 | uint8_t subTypeLength; 30 | uint8_t proximityUUID[16]; 31 | uint16_t major; 32 | uint16_t minor; 33 | int8_t signalPower; 34 | } __attribute__((packed)) m_beaconData; 35 | public: 36 | NimBLEBeacon(); 37 | std::string getData(); 38 | uint16_t getMajor(); 39 | uint16_t getMinor(); 40 | uint16_t getManufacturerId(); 41 | NimBLEUUID getProximityUUID(); 42 | int8_t getSignalPower(); 43 | void setData(const std::string &data); 44 | void setMajor(uint16_t major); 45 | void setMinor(uint16_t minor); 46 | void setManufacturerId(uint16_t manufacturerId); 47 | void setProximityUUID(const NimBLEUUID &uuid); 48 | void setSignalPower(int8_t signalPower); 49 | }; // NimBLEBeacon 50 | 51 | #endif /* MAIN_NIMBLEBEACON_H_ */ 52 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/NimBLEEddystoneURL.h: -------------------------------------------------------------------------------- 1 | /* 2 | * NimBLEEddystoneURL.h 3 | * 4 | * Created: on March 15 2020 5 | * Author H2zero 6 | * 7 | * Originally: 8 | * 9 | * BLEEddystoneURL.h 10 | * 11 | * Created on: Mar 12, 2018 12 | * Author: pcbreflux 13 | */ 14 | 15 | #ifndef _NIMBLEEddystoneURL_H_ 16 | #define _NIMBLEEddystoneURL_H_ 17 | #include "NimBLEUUID.h" 18 | 19 | #include 20 | 21 | #define EDDYSTONE_URL_FRAME_TYPE 0x10 22 | 23 | /** 24 | * @brief Representation of a beacon. 25 | * See: 26 | * * https://github.com/google/eddystone 27 | */ 28 | class NimBLEEddystoneURL { 29 | public: 30 | NimBLEEddystoneURL(); 31 | std::string getData(); 32 | NimBLEUUID getUUID(); 33 | int8_t getPower(); 34 | std::string getURL(); 35 | std::string getDecodedURL(); 36 | void setData(const std::string &data); 37 | void setUUID(const NimBLEUUID &l_uuid); 38 | void setPower(int8_t advertisedTxPower); 39 | void setURL(const std::string &url); 40 | 41 | private: 42 | uint16_t beaconUUID; 43 | uint8_t lengthURL; 44 | struct { 45 | uint8_t frameType; 46 | int8_t advertisedTxPower; 47 | uint8_t url[16]; 48 | } __attribute__((packed)) m_eddystoneData; 49 | 50 | }; // NIMBLEEddystoneURL 51 | 52 | #endif /* _NIMBLEEddystoneURL_H_ */ 53 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/NimBLEUtils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * NimBLEUtils.h 3 | * 4 | * Created: on Jan 25 2020 5 | * Author H2zero 6 | * 7 | */ 8 | 9 | #ifndef COMPONENTS_NIMBLEUTILS_H_ 10 | #define COMPONENTS_NIMBLEUTILS_H_ 11 | 12 | #include "nimconfig.h" 13 | #if defined(CONFIG_BT_ENABLED) 14 | 15 | #if defined(CONFIG_NIMBLE_CPP_IDF) 16 | #include "host/ble_gap.h" 17 | #else 18 | #include "nimble/nimble/host/include/host/ble_gap.h" 19 | #endif 20 | 21 | /**** FIX COMPILATION ****/ 22 | #undef min 23 | #undef max 24 | /**************************/ 25 | 26 | #include 27 | 28 | typedef struct { 29 | void *pATT; 30 | TaskHandle_t task; 31 | int rc; 32 | void *buf; 33 | } ble_task_data_t; 34 | 35 | 36 | /** 37 | * @brief A BLE Utility class with methods for debugging and general purpose use. 38 | */ 39 | class NimBLEUtils { 40 | public: 41 | static void dumpGapEvent(ble_gap_event *event, void *arg); 42 | static const char* gapEventToString(uint8_t eventType); 43 | static char* buildHexData(uint8_t* target, const uint8_t* source, uint8_t length); 44 | static const char* advTypeToString(uint8_t advType); 45 | static const char* returnCodeToString(int rc); 46 | static int checkConnParams(ble_gap_conn_params* params); 47 | }; 48 | 49 | 50 | #endif // CONFIG_BT_ENABLED 51 | #endif // COMPONENTS_NIMBLEUTILS_H_ 52 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/NOTICE: -------------------------------------------------------------------------------- 1 | Apache Mynewt NimBLE 2 | Copyright 2015-2020 The Apache Software Foundation 3 | Modifications Copyright 2017-2020 Espressif Systems (Shanghai) CO., LTD. 4 | 5 | This product includes software developed at 6 | The Apache Software Foundation (http://www.apache.org/). 7 | 8 | Portions of this software were developed at 9 | Runtime Inc, copyright 2015. 10 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | # RELEASE NOTES 2 | 3 | 24 March 2021 - Apache NimBLE v1.4.0 4 | 5 | For full release notes, please visit the 6 | [Apache Mynewt Wiki](https://cwiki.apache.org/confluence/display/MYNEWT/Release+Notes). 7 | 8 | Apache NimBLE is an open-source Bluetooth 5.1 stack (both Host & Controller) that completely 9 | replaces the proprietary SoftDevice on Nordic chipsets. 10 | 11 | New features in this version of NimBLE include: 12 | 13 | * Support for PHY on Dialog Configurable MAC (CMAC) 14 | * Support for PHY on Nordic nRF5340 15 | * Support for Apache NuttX port of NimBLE 16 | * Controller-to-host flow control support 17 | * Support for USB transport 18 | * Various bugfixes 19 | 20 | If working on next-generation RTOS and Bluetooth protocol stack 21 | sounds exciting to you, get in touch, by sending a mail to the Apache Mynewt 22 | Developer's list, dev@mynewt.apache.org. 23 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/console/console.h: -------------------------------------------------------------------------------- 1 | #ifndef __CONSOLE_H__ 2 | #define __CONSOLE_H__ 3 | 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #define console_printf(_fmt, ...) printf(_fmt, ##__VA_ARGS__) 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #endif /* __CONSOLE_H__ */ -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/esp_port/port/include/esp_nimble_mem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #ifndef __ESP_NIMBLE_MEM_H__ 8 | #define __ESP_NIMBLE_MEM_H__ 9 | 10 | #include 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | void *nimble_platform_mem_malloc(size_t size); 17 | void *nimble_platform_mem_calloc(size_t n, size_t size); 18 | void nimble_platform_mem_free(void *ptr); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | #endif /* __ESP_NIMBLE_MEM_H__ */ 25 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/ext/tinycrypt/AUTHORS: -------------------------------------------------------------------------------- 1 | Architect: 2 | Rafael Misoczki 3 | 4 | Open Source Maintainer: 5 | Constanza Heath 6 | Rafael Misoczki 7 | 8 | Contributors: 9 | Constanza Heath 10 | Rafael Misoczki 11 | Flavio Santes 12 | Jarkko Sakkinen 13 | Chris Morrison 14 | Marti Bolivar 15 | Colin Ian King 16 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/ext/tinycrypt/VERSION: -------------------------------------------------------------------------------- 1 | 0.2.8 2 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/controller/include/controller/ble_ll_test.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #ifndef H_LL_TEST_ 21 | #define H_LL_TEST_ 22 | 23 | #include 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | int ble_ll_csa2_test_all(void); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/controller/include/controller/ble_ll_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #include 21 | 22 | uint32_t ble_ll_utils_calc_access_addr(void); 23 | uint8_t ble_ll_utils_remapped_channel(uint8_t remap_index, const uint8_t *chanmap); 24 | uint8_t ble_ll_utils_calc_dci_csa2(uint16_t event_cntr, uint16_t channel_id, 25 | uint8_t num_used_chans, const uint8_t *chanmap); 26 | uint8_t ble_ll_utils_calc_num_used_chans(const uint8_t *chanmap); 27 | uint32_t ble_ll_utils_calc_window_widening(uint32_t anchor_point, 28 | uint32_t last_anchor_point, 29 | uint8_t master_sca); 30 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/include/host/ble_ibeacon.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #ifndef H_BLE_IBEACON_ 21 | #define H_BLE_IBEACON_ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | int ble_ibeacon_set_adv_data(void *uuid128, uint16_t major, 28 | uint16_t minor, int8_t measured_power); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/include/host/ble_monitor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #ifndef H_BLE_MONITOR_ 21 | #define H_BLE_MONITOR_ 22 | 23 | #include "nimble/porting/nimble/include/syscfg/syscfg.h" 24 | 25 | #undef BLE_MONITOR 26 | #define BLE_MONITOR (MYNEWT_VAL(BLE_MONITOR_UART) || MYNEWT_VAL(BLE_MONITOR_RTT)) 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | int ble_monitor_log(int level, const char *fmt, ...); 33 | 34 | int ble_monitor_out(int c); 35 | void ble_monitor_deinit(void); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/mesh/include/mesh/cfg_srv.h: -------------------------------------------------------------------------------- 1 | /** @file 2 | * @brief Bluetooth Mesh Configuration Server Model APIs. 3 | */ 4 | 5 | /* 6 | * Copyright (c) 2017 Intel Corporation 7 | * 8 | * SPDX-License-Identifier: Apache-2.0 9 | */ 10 | #ifndef __BT_MESH_CFG_SRV_H 11 | #define __BT_MESH_CFG_SRV_H 12 | 13 | /** 14 | * @brief Bluetooth Mesh 15 | * @defgroup bt_mesh_cfg_srv Bluetooth Mesh Configuration Server Model 16 | * @ingroup bt_mesh 17 | * @{ 18 | */ 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | 25 | extern const struct bt_mesh_model_op bt_mesh_cfg_srv_op[]; 26 | extern const struct bt_mesh_model_cb bt_mesh_cfg_srv_cb; 27 | 28 | #define BT_MESH_MODEL_CFG_SRV \ 29 | BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_CFG_SRV, bt_mesh_cfg_srv_op, NULL, \ 30 | NULL, &bt_mesh_cfg_srv_cb) 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | /** 37 | * @} 38 | */ 39 | 40 | #endif /* __BT_MESH_CFG_SRV_H */ 41 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/mesh/include/mesh/mesh.h: -------------------------------------------------------------------------------- 1 | /** @file 2 | * @brief Bluetooth Mesh Profile APIs. 3 | */ 4 | 5 | /* 6 | * Copyright (c) 2017 Intel Corporation 7 | * 8 | * SPDX-License-Identifier: Apache-2.0 9 | */ 10 | #ifndef __BT_MESH_H 11 | #define __BT_MESH_H 12 | 13 | #include 14 | #include "nimble/porting/nimble/include/syscfg/syscfg.h" 15 | #include "nimble/porting/nimble/include/os/os_mbuf.h" 16 | 17 | #include "glue.h" 18 | #include "access.h" 19 | #include "main.h" 20 | #include "cfg.h" 21 | #include "cfg_srv.h" 22 | #include "health_srv.h" 23 | #include "cfg_cli.h" 24 | #include "health_cli.h" 25 | #include "proxy.h" 26 | #include "cdb.h" 27 | #include "cfg.h" 28 | #include "heartbeat.h" 29 | #include "../../src/app_keys.h" 30 | 31 | #endif /* __BT_MESH_H */ 32 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/mesh/include/mesh/porting.h: -------------------------------------------------------------------------------- 1 | /** @file 2 | * @brief Bluetooth Mesh Porting APIs. 3 | */ 4 | 5 | /* 6 | * Copyright (c) 2017 Intel Corporation 7 | * 8 | * SPDX-License-Identifier: Apache-2.0 9 | */ 10 | #ifndef __BT_MESH_PORTING_H 11 | #define __BT_MESH_PORTING_H 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | void mesh_adv_thread(void *args); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | /** 24 | * @} 25 | */ 26 | 27 | #endif /* __BT_MESH_PORTING_H */ 28 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/mesh/include/mesh/proxy.h: -------------------------------------------------------------------------------- 1 | /** @file 2 | * @brief Bluetooth Mesh Proxy APIs. 3 | */ 4 | 5 | /* 6 | * Copyright (c) 2017 Intel Corporation 7 | * 8 | * SPDX-License-Identifier: Apache-2.0 9 | */ 10 | #ifndef __BT_MESH_PROXY_H 11 | #define __BT_MESH_PROXY_H 12 | 13 | /** 14 | * @brief Bluetooth Mesh Proxy 15 | * @defgroup bt_mesh_proxy Bluetooth Mesh Proxy 16 | * @ingroup bt_mesh 17 | * @{ 18 | */ 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /** 25 | * @brief Enable advertising with Node Identity. 26 | * 27 | * This API requires that GATT Proxy support has been enabled. Once called 28 | * each subnet will start advertising using Node Identity for the next 29 | * 60 seconds. 30 | * 31 | * @return 0 on success, or (negative) error code on failure. 32 | */ 33 | int bt_mesh_proxy_identity_enable(void); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | /** 40 | * @} 41 | */ 42 | 43 | #endif /* __BT_MESH_PROXY_H */ 44 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/mesh/src/beacon.h: -------------------------------------------------------------------------------- 1 | /* Bluetooth Mesh */ 2 | 3 | /* 4 | * Copyright (c) 2017 Intel Corporation 5 | * 6 | * SPDX-License-Identifier: Apache-2.0 7 | */ 8 | 9 | #ifndef __BEACON_H__ 10 | #define __BEACON_H__ 11 | 12 | #include "nimble/porting/nimble/include/os/os_mbuf.h" 13 | 14 | void bt_mesh_beacon_enable(void); 15 | void bt_mesh_beacon_disable(void); 16 | 17 | void bt_mesh_beacon_ivu_initiator(bool enable); 18 | 19 | void bt_mesh_beacon_recv(struct os_mbuf *buf); 20 | 21 | void bt_mesh_beacon_create(struct bt_mesh_subnet *sub, 22 | struct os_mbuf *buf); 23 | 24 | void bt_mesh_beacon_init(void); 25 | void bt_mesh_beacon_update(struct bt_mesh_subnet *sub); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/mesh/src/cfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 Nordic Semiconductor ASA 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | void bt_mesh_cfg_init(void); 8 | 9 | bool bt_mesh_fixed_group_match(uint16_t addr); -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/mesh/src/heartbeat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 Nordic Semiconductor ASA 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #include "../include/mesh/heartbeat.h" 8 | 9 | static inline uint16_t bt_mesh_hb_pwr2(uint8_t val) 10 | { 11 | if (!val) { 12 | return 0x0000; 13 | } else if (val == 0xff || val == 0x11) { 14 | return 0xffff; 15 | } else { 16 | return (1 << (val - 1)); 17 | } 18 | } 19 | 20 | static inline uint8_t bt_mesh_hb_log(uint32_t val) 21 | { 22 | if (!val) { 23 | return 0x00; 24 | } else if (val == 0xffff) { 25 | return 0xff; 26 | } else { 27 | return 32 - __builtin_clz(val); 28 | } 29 | } 30 | 31 | void bt_mesh_hb_init(void); 32 | void bt_mesh_hb_start(void); 33 | void bt_mesh_hb_suspend(void); 34 | void bt_mesh_hb_resume(void); 35 | 36 | int bt_mesh_hb_recv(struct bt_mesh_net_rx *rx, struct os_mbuf *buf); 37 | void bt_mesh_hb_feature_changed(uint16_t features); 38 | 39 | uint8_t bt_mesh_hb_pub_set(struct bt_mesh_hb_pub *hb_pub); 40 | uint8_t bt_mesh_hb_sub_set(uint16_t src, uint16_t dst, uint32_t period); 41 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/mesh/src/light_model.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | #ifndef __BT_MESH_LIGHT_MODEL_H 7 | #define __BT_MESH_LIGHT_MODEL_H 8 | 9 | #include "nimble/porting/nimble/include/syscfg/syscfg.h" 10 | #include "../include/mesh/mesh.h" 11 | 12 | int light_model_gen_onoff_get(struct bt_mesh_model *model, uint8_t *state); 13 | int light_model_gen_onoff_set(struct bt_mesh_model *model, uint8_t state); 14 | int light_model_gen_level_get(struct bt_mesh_model *model, int16_t *level); 15 | int light_model_gen_level_set(struct bt_mesh_model *model, int16_t level); 16 | int light_model_light_lightness_get(struct bt_mesh_model *model, int16_t *lightness); 17 | int light_model_light_lightness_set(struct bt_mesh_model *model, int16_t lightness); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/mesh/src/nodes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Tobias Svehagen 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | struct bt_mesh_node *bt_mesh_node_find(u16_t addr); 8 | struct bt_mesh_node *bt_mesh_node_alloc(u16_t addr, u8_t num_elem, 9 | u16_t net_idx); 10 | void bt_mesh_node_del(struct bt_mesh_node *node, bool store); -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/mesh/src/provisioner.h: -------------------------------------------------------------------------------- 1 | /* Bluetooth Mesh */ 2 | 3 | /* 4 | * Copyright (c) 2017 Intel Corporation 5 | * 6 | * SPDX-License-Identifier: Apache-2.0 7 | */ 8 | 9 | int bt_mesh_pb_adv_open(const uint8_t uuid[16], uint16_t net_idx, uint16_t addr, 10 | uint8_t attention_duration); -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/mesh/src/rpl.h: -------------------------------------------------------------------------------- 1 | /* Bluetooth Mesh */ 2 | 3 | /* 4 | * Copyright (c) 2017 Intel Corporation 5 | * Copyright (c) 2020 Lingao Meng 6 | * 7 | * SPDX-License-Identifier: Apache-2.0 8 | */ 9 | 10 | struct bt_mesh_rpl { 11 | uint16_t src; 12 | bool old_iv; 13 | #if defined(CONFIG_BT_SETTINGS) 14 | bool store; 15 | #endif 16 | uint32_t seq; 17 | }; 18 | 19 | typedef void (*bt_mesh_rpl_func_t)(struct bt_mesh_rpl *rpl, 20 | void *user_data); 21 | 22 | void bt_mesh_rpl_reset(void); 23 | bool bt_mesh_rpl_check(struct bt_mesh_net_rx *rx, 24 | struct bt_mesh_rpl **match); 25 | void bt_mesh_rpl_clear(void); 26 | struct bt_mesh_rpl *bt_mesh_rpl_find(uint16_t src); 27 | struct bt_mesh_rpl *bt_mesh_rpl_alloc(uint16_t src); 28 | void bt_mesh_rpl_foreach(bt_mesh_rpl_func_t func, void *user_data); 29 | void bt_mesh_rpl_update(struct bt_mesh_rpl *rpl, 30 | struct bt_mesh_net_rx *rx); -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/mesh/src/settings.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | void bt_mesh_store_net(void); 8 | void bt_mesh_store_iv(bool only_duration); 9 | void bt_mesh_store_seq(void); 10 | void bt_mesh_store_rpl(struct bt_mesh_rpl *rpl); 11 | void bt_mesh_store_subnet(uint16_t net_idx); 12 | void bt_mesh_store_app_key(uint16_t app_idx); 13 | void bt_mesh_store_hb_pub(void); 14 | void bt_mesh_store_cfg(void); 15 | void bt_mesh_store_mod_bind(struct bt_mesh_model *mod); 16 | void bt_mesh_store_mod_sub(struct bt_mesh_model *mod); 17 | void bt_mesh_store_mod_pub(struct bt_mesh_model *mod); 18 | void bt_mesh_store_label(void); 19 | void bt_mesh_store_cdb(void); 20 | void bt_mesh_store_cdb_node(const struct bt_mesh_cdb_node *node); 21 | void bt_mesh_store_cdb_subnet(const struct bt_mesh_cdb_subnet *sub); 22 | void bt_mesh_store_cdb_app_key(const struct bt_mesh_cdb_app_key *app); 23 | 24 | void bt_mesh_clear_net(void); 25 | void bt_mesh_clear_subnet(uint16_t net_idx); 26 | void bt_mesh_clear_app_key(uint16_t app_idx); 27 | void bt_mesh_clear_rpl(void); 28 | void bt_mesh_clear_cdb_node(struct bt_mesh_cdb_node *node); 29 | void bt_mesh_clear_cdb_subnet(struct bt_mesh_cdb_subnet *sub); 30 | void bt_mesh_clear_cdb_app_key(struct bt_mesh_cdb_app_key *app); 31 | 32 | void bt_mesh_settings_init(void); 33 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/mesh/src/shell.h: -------------------------------------------------------------------------------- 1 | #ifndef __SHELL_H__ 2 | #define __SHELL_H__ 3 | 4 | void ble_mesh_shell_init(void); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/services/bas/include/services/bas/ble_svc_bas.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #ifndef H_BLE_SVC_BAS_ 21 | #define H_BLE_SVC_BAS_ 22 | 23 | /* 16 Bit Battery Service UUID */ 24 | #define BLE_SVC_BAS_UUID16 0x180F 25 | 26 | /* 16 Bit Battery Service Characteristic UUIDs */ 27 | #define BLE_SVC_BAS_CHR_UUID16_BATTERY_LEVEL 0x2A19 28 | 29 | int ble_svc_bas_battery_level_set(uint8_t level); 30 | 31 | void ble_svc_bas_init(void); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/services/gatt/include/services/gatt/ble_svc_gatt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #ifndef H_BLE_SVC_GATT_ 21 | #define H_BLE_SVC_GATT_ 22 | 23 | #include 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | struct ble_hs_cfg; 30 | 31 | #define BLE_SVC_GATT_CHR_SERVICE_CHANGED_UUID16 0x2a05 32 | 33 | void ble_svc_gatt_changed(uint16_t start_handle, uint16_t end_handle); 34 | void ble_svc_gatt_init(void); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/services/ipss/include/services/ipss/ble_svc_ipss.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #ifndef H_BLE_SVC_IPSS_ 21 | #define H_BLE_SVC_IPSS_ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | #define BLE_SVC_IPSS_UUID16 0x1820 28 | 29 | /** 30 | * @brief Initialize the IPSS service 31 | */ 32 | void ble_svc_ipss_init(void); 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/src/ble_hs_adv_priv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #ifndef H_BLE_HS_ADV_PRIV_ 21 | #define H_BLE_HS_ADV_PRIV_ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | int ble_hs_adv_set_flat(uint8_t type, int data_len, const void *data, 28 | uint8_t *dst, uint8_t *dst_len, uint8_t max_len); 29 | int ble_hs_adv_find_field(uint8_t type, const uint8_t *data, uint8_t length, 30 | const struct ble_hs_adv_field **out); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/src/ble_hs_atomic_priv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #ifndef H_BLE_HS_ATOMIC_ 21 | #define H_BLE_HS_ATOMIC_ 22 | 23 | #include "ble_hs_conn_priv.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | int ble_hs_atomic_conn_delete(uint16_t conn_handle); 30 | void ble_hs_atomic_conn_insert(struct ble_hs_conn *conn); 31 | int ble_hs_atomic_conn_flags(uint16_t conn_handle, 32 | ble_hs_conn_flags_t *out_flags); 33 | int ble_hs_atomic_conn_set_flags(uint16_t conn_handle, 34 | ble_hs_conn_flags_t flags, int on); 35 | uint16_t ble_hs_atomic_first_conn_handle(void); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/src/ble_hs_cfg.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #include "nimble/porting/nimble/include/syscfg/syscfg.h" 21 | #include "nimble/nimble/host/include/host/ble_hs.h" 22 | 23 | struct ble_hs_cfg ble_hs_cfg = { 24 | /** Security manager settings. */ 25 | .sm_io_cap = MYNEWT_VAL(BLE_SM_IO_CAP), 26 | .sm_oob_data_flag = MYNEWT_VAL(BLE_SM_OOB_DATA_FLAG), 27 | .sm_bonding = MYNEWT_VAL(BLE_SM_BONDING), 28 | .sm_mitm = MYNEWT_VAL(BLE_SM_MITM), 29 | .sm_sc = MYNEWT_VAL(BLE_SM_SC), 30 | .sm_keypress = MYNEWT_VAL(BLE_SM_KEYPRESS), 31 | .sm_our_key_dist = MYNEWT_VAL(BLE_SM_OUR_KEY_DIST), 32 | .sm_their_key_dist = MYNEWT_VAL(BLE_SM_THEIR_KEY_DIST), 33 | }; 34 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/src/ble_hs_flow_priv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #ifndef H_BLE_HS_FLOW_PRIV_ 21 | #define H_BLE_HS_FLOW_PRIV_ 22 | 23 | #include 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | void ble_hs_flow_connection_broken(uint16_t conn_handle); 29 | void ble_hs_flow_track_data_mbuf(struct os_mbuf *om); 30 | int ble_hs_flow_startup(void); 31 | void ble_hs_flow_stop(void); 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/src/ble_hs_log.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #include "nimble/porting/nimble/include/os/os.h" 21 | #include "nimble/nimble/host/include/host/ble_hs.h" 22 | 23 | struct log ble_hs_log; 24 | 25 | void 26 | ble_hs_log_mbuf(const struct os_mbuf *om) 27 | { 28 | uint8_t u8; 29 | int i; 30 | 31 | for (i = 0; i < OS_MBUF_PKTLEN(om); i++) { 32 | os_mbuf_copydata(om, i, 1, &u8); 33 | BLE_HS_LOG(DEBUG, "0x%02x ", u8); 34 | } 35 | } 36 | 37 | void 38 | ble_hs_log_flat_buf(const void *data, int len) 39 | { 40 | const uint8_t *u8ptr; 41 | int i; 42 | 43 | u8ptr = data; 44 | for (i = 0; i < len; i++) { 45 | BLE_HS_LOG(DEBUG, "0x%02x ", u8ptr[i]); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/src/ble_hs_mbuf_priv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #ifndef H_BLE_HS_MBUF_PRIV_ 21 | #define H_BLE_HS_MBUF_PRIV_ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | struct os_mbuf; 28 | 29 | struct os_mbuf *ble_hs_mbuf_bare_pkt(void); 30 | struct os_mbuf *ble_hs_mbuf_acl_pkt(void); 31 | struct os_mbuf *ble_hs_mbuf_l2cap_pkt(void); 32 | int ble_hs_mbuf_pullup_base(struct os_mbuf **om, int base_len); 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/src/ble_hs_startup_priv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #ifndef H_BLE_HS_STARTUP_ 21 | #define H_BLE_HS_STARTUP_ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | int ble_hs_startup_go(void); 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/host/store/config/include/store/config/ble_store_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #ifndef H_BLE_STORE_CONFIG_ 21 | #define H_BLE_STORE_CONFIG_ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | union ble_store_key; 28 | union ble_store_value; 29 | 30 | int ble_store_config_read(int obj_type, const union ble_store_key *key, 31 | union ble_store_value *value); 32 | int ble_store_config_write(int obj_type, const union ble_store_value *val); 33 | int ble_store_config_delete(int obj_type, const union ble_store_key *key); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/include/nimble/nimble_opt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #ifndef H_NIMBLE_OPT_ 21 | #define H_NIMBLE_OPT_ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | /* Include automatically-generated settings. */ 28 | #include "nimble_opt_auto.h" 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/nimble/transport/ram/include/transport/ram/ble_hci_ram.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #ifndef H_BLE_HCI_RAM_ 21 | #define H_BLE_HCI_RAM_ 22 | 23 | #include "nimble/nimble/include/nimble/ble_hci_trans.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | void ble_hci_ram_init(void); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/porting/nimble/include/log/log.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #ifndef __LOG_H__ 21 | #define __LOG_H__ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | struct log { 28 | }; 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif /* __LOG_H__ */ 35 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/porting/nimble/include/sysflash/sysflash.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file was generated by Apache newt version: 1.9.0-dev 3 | */ 4 | 5 | #ifndef H_MYNEWT_SYSFLASH_ 6 | #define H_MYNEWT_SYSFLASH_ 7 | 8 | #include "flash_map/flash_map.h" 9 | 10 | /** 11 | * This flash map definition is used for two purposes: 12 | * 1. To locate the meta area, which contains the true flash map definition. 13 | * 2. As a fallback in case the meta area cannot be read from flash. 14 | */ 15 | extern const struct flash_area sysflash_map_dflt[6]; 16 | 17 | #define FLASH_AREA_BOOTLOADER 0 18 | #define FLASH_AREA_IMAGE_0 1 19 | #define FLASH_AREA_IMAGE_1 2 20 | #define FLASH_AREA_IMAGE_SCRATCH 3 21 | #define FLASH_AREA_REBOOT_LOG 16 22 | #define FLASH_AREA_NFFS 17 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /2.Firmware/lib/NimBLE-Arduino/src/nimble/porting/nimble/include/sysinit/sysinit.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #ifndef __SYSINIT_H__ 21 | #define __SYSINIT_H__ 22 | 23 | #include 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #define SYSINIT_ASSERT_ACTIVE() 30 | 31 | #define SYSINIT_PANIC_ASSERT(rc) assert(rc); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif /* __SYSINIT_H__ */ 38 | -------------------------------------------------------------------------------- /2.Firmware/lib/QMC5883LCompass/examples/azimuth/azimuth.ino: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================================================== 3 | QMC5883LCompass.h Library Azimuth Example Sketch 4 | Learn more at [https://github.com/mprograms/QMC5883Compas] 5 | =============================================================================================================== 6 | v0.3 - June 12, 2019 7 | Written by MRPrograms 8 | Github: [https://github.com/mprograms/] 9 | 10 | Release under the GNU General Public License v3 11 | [https://www.gnu.org/licenses/gpl-3.0.en.html] 12 | =============================================================================================================== 13 | */ 14 | #include 15 | 16 | QMC5883LCompass compass; 17 | 18 | void setup() { 19 | Serial.begin(9600); 20 | compass.init(); 21 | 22 | } 23 | 24 | void loop() { 25 | int a; 26 | 27 | // Read compass values 28 | compass.read(); 29 | 30 | // Return Azimuth reading 31 | a = compass.getAzimuth(); 32 | 33 | Serial.print("A: "); 34 | Serial.print(a); 35 | Serial.println(); 36 | 37 | delay(250); 38 | } 39 | -------------------------------------------------------------------------------- /2.Firmware/lib/QMC5883LCompass/examples/bearing/bearing.ino: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================================================== 3 | QMC5883LCompass.h Library Bearing Example Sketch 4 | Learn more at [https://github.com/mprograms/QMC5883Compas] 5 | 6 | This example shows how to get the range that the current bearing is in. You can use this to roll 7 | your very own direction output. 8 | 9 | =============================================================================================================== 10 | Release under the GNU General Public License v3 11 | [https://www.gnu.org/licenses/gpl-3.0.en.html] 12 | =============================================================================================================== 13 | */ 14 | #include 15 | 16 | QMC5883LCompass compass; 17 | 18 | void setup() { 19 | Serial.begin(9600); 20 | compass.init(); 21 | } 22 | 23 | void loop() { 24 | compass.read(); 25 | 26 | byte a = compass.getAzimuth(); 27 | // Output here will be a value from 0 - 15 based on the direction of the bearing / azimuth. 28 | byte b = compass.getBearing(a); 29 | 30 | Serial.print("B: "); 31 | Serial.print(b); 32 | Serial.println(); 33 | 34 | delay(250); 35 | } 36 | -------------------------------------------------------------------------------- /2.Firmware/lib/QMC5883LCompass/examples/direction/direction.ino: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================================================== 3 | QMC5883LCompass.h Library Direction Example Sketch 4 | Learn more at [https://github.com/mprograms/QMC5883Compas] 5 | 6 | This example shows how to get Compass direction. 7 | 8 | =============================================================================================================== 9 | Release under the GNU General Public License v3 10 | [https://www.gnu.org/licenses/gpl-3.0.en.html] 11 | =============================================================================================================== 12 | */ 13 | #include 14 | 15 | QMC5883LCompass compass; 16 | 17 | void setup() { 18 | Serial.begin(9600); 19 | compass.init(); 20 | } 21 | 22 | void loop() { 23 | compass.read(); 24 | 25 | byte a = compass.getAzimuth(); 26 | 27 | char myArray[3]; 28 | compass.getDirection(myArray, a); 29 | 30 | Serial.print(myArray[0]); 31 | Serial.print(myArray[1]); 32 | Serial.print(myArray[2]); 33 | Serial.println(); 34 | 35 | delay(250); 36 | } 37 | -------------------------------------------------------------------------------- /2.Firmware/lib/QMC5883LCompass/examples/xyz/xyz.ino: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================================================== 3 | QMC5883LCompass.h Library XYZ Example Sketch 4 | Learn more at [https://github.com/mprograms/QMC5883LCompass] 5 | 6 | This example shows how to get the XYZ values from the sensor. 7 | 8 | =============================================================================================================== 9 | Release under the GNU General Public License v3 10 | [https://www.gnu.org/licenses/gpl-3.0.en.html] 11 | =============================================================================================================== 12 | */ 13 | #include 14 | 15 | QMC5883LCompass compass; 16 | 17 | void setup() { 18 | Serial.begin(9600); 19 | compass.init(); 20 | 21 | } 22 | 23 | void loop() { 24 | int x, y, z; 25 | 26 | // Read compass values 27 | compass.read(); 28 | 29 | // Return XYZ readings 30 | x = compass.getX(); 31 | y = compass.getY(); 32 | z = compass.getZ(); 33 | 34 | Serial.print("X: "); 35 | Serial.print(x); 36 | Serial.print(" Y: "); 37 | Serial.print(y); 38 | Serial.print(" Z: "); 39 | Serial.print(z); 40 | Serial.println(); 41 | 42 | delay(250); 43 | } 44 | -------------------------------------------------------------------------------- /2.Firmware/lib/QMC5883LCompass/keywords.txt: -------------------------------------------------------------------------------- 1 | QMC5883LCompass KEYWORD1 2 | init KEYWORD2 3 | setADDR KEYWORD2 4 | setMode KEYWORD2 5 | setSmoothing KEYWORD2 6 | setReset KEYWORD2 7 | read KEYWORD2 8 | getX KEYWORD2 9 | getY KEYWORD2 10 | getZ KEYWORD2 11 | getAzimuth KEYWORD2 12 | getBearing KEYWORD2 13 | getDirection KEYWORD2 14 | init KEYWORD2 15 | setADDR KEYWORD2 16 | setMode KEYWORD2 17 | setSmoothing KEYWORD2 -------------------------------------------------------------------------------- /2.Firmware/lib/QMC5883LCompass/library.properties: -------------------------------------------------------------------------------- 1 | name=QMC5883LCompass 2 | version=1.2.3 3 | author=MPrograms 4 | maintainer=MPrograms 5 | sentence=Library for using QMC5583L series chip boards as a compass. 6 | paragraph=QMC5883L Compass is a Arduino library for using QMC5583L series chip boards as a compass. 7 | category=Sensors 8 | url=https://github.com/mprograms/QMC5883LCompass 9 | architectures=* 10 | includes=QMC5883LCompass.h 11 | -------------------------------------------------------------------------------- /2.Firmware/lib/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project specific (private) libraries. 3 | PlatformIO will compile them to static libraries and link into executable file. 4 | 5 | The source code of each library should be placed in a an own separate directory 6 | ("lib/your_library_name/[here are source files]"). 7 | 8 | For example, see a structure of the following two libraries `Foo` and `Bar`: 9 | 10 | |--lib 11 | | | 12 | | |--Bar 13 | | | |--docs 14 | | | |--examples 15 | | | |--src 16 | | | |- Bar.c 17 | | | |- Bar.h 18 | | | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html 19 | | | 20 | | |--Foo 21 | | | |- Foo.c 22 | | | |- Foo.h 23 | | | 24 | | |- README --> THIS FILE 25 | | 26 | |- platformio.ini 27 | |--src 28 | |- main.c 29 | 30 | and a contents of `src/main.c`: 31 | ``` 32 | #include 33 | #include 34 | 35 | int main (void) 36 | { 37 | ... 38 | } 39 | 40 | ``` 41 | 42 | PlatformIO Library Dependency Finder will find automatically dependent 43 | libraries scanning project source files. 44 | 45 | More information about PlatformIO Library Dependency Finder 46 | - https://docs.platformio.org/page/librarymanager/ldf.html 47 | -------------------------------------------------------------------------------- /2.Firmware/lib/TinyGPSPlus/README.md: -------------------------------------------------------------------------------- 1 | # TinyGPSPlus 2 | A new, customizable Arduino NMEA parsing library 3 | A *NEW* Full-featured GPS/NMEA Parser for Arduino 4 | TinyGPSPlus is a new Arduino library for parsing NMEA data streams provided by GPS modules. 5 | 6 | Like its predecessor, TinyGPS, this library provides compact and easy-to-use methods for extracting position, date, time, altitude, speed, and course from consumer GPS devices. 7 | 8 | However, TinyGPSPlus’s programmer interface is considerably simpler to use than TinyGPS, and the new library can extract arbitrary data from any of the myriad NMEA sentences out there, even proprietary ones. 9 | 10 | See [Arduiniana - TinyGPSPlus](http://arduiniana.org/libraries/tinygpsplus/) for more detailed information on how to use TinyGPSPlus 11 | -------------------------------------------------------------------------------- /2.Firmware/lib/TinyGPSPlus/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "TinyGPSPlus", 3 | "version": "1.0.3", 4 | "keywords": "gps,NMEA", 5 | "description": "A new, customizable Arduino NMEA parsing library", 6 | "repository": 7 | { 8 | "type": "git", 9 | "url": "https://github.com/mikalhart/TinyGPSPlus.git" 10 | }, 11 | "authors": 12 | [ 13 | { 14 | "name": "Mikal Hart", 15 | "email": "mikal@arduniana.org", 16 | "url": "http://arduiniana.org", 17 | "maintainer": true 18 | } 19 | ], 20 | "frameworks": "arduino", 21 | "platforms": "*" 22 | } 23 | -------------------------------------------------------------------------------- /2.Firmware/lib/TinyGPSPlus/library.properties: -------------------------------------------------------------------------------- 1 | name=TinyGPSPlus 2 | version=1.0.3 3 | author=Mikal Hart 4 | maintainer=Mikal Hart 5 | sentence=TinyGPSPlus provides object-oriented parsing of GPS (NMEA) sentences 6 | paragraph=NMEA is the standard format GPS devices use to report location, time, altitude, etc. TinyGPSPlus is a compact, resilient library that parses the most common NMEA 'sentences' used: GGA and RMC. It can also be customized to extract data from *any* compliant sentence. 7 | category=Communication 8 | url=https://github.com/mikalhart/TinyGPSPlus 9 | architectures=* 10 | -------------------------------------------------------------------------------- /2.Firmware/lib/TinyGPSPlus/src/TinyGPSPlus.h: -------------------------------------------------------------------------------- 1 | /* 2 | TinyGPSPlus - a small GPS library for Arduino providing universal NMEA parsing 3 | Based on work by and "distanceBetween" and "courseTo" courtesy of Maarten Lamers. 4 | Suggestion to add satellites, courseTo(), and cardinal() by Matt Monson. 5 | Location precision improvements suggested by Wayne Holder. 6 | Copyright (C) 2008-2013 Mikal Hart 7 | All rights reserved. 8 | 9 | This library is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU Lesser General Public 11 | License as published by the Free Software Foundation; either 12 | version 2.1 of the License, or (at your option) any later version. 13 | 14 | This library is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | Lesser General Public License for more details. 18 | 19 | You should have received a copy of the GNU Lesser General Public 20 | License along with this library; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 22 | */ 23 | 24 | #ifndef __TinyGPSPlus_h 25 | #include "TinyGPS++.h" 26 | #endif -------------------------------------------------------------------------------- /2.Firmware/platformio.ini: -------------------------------------------------------------------------------- 1 | ; PlatformIO Project Configuration File 2 | ; 3 | ; Build options: build flags, source filter 4 | ; Upload options: custom upload port, speed and extra flags 5 | ; Library options: dependencies, extra library storages 6 | ; Advanced options: extra scripting 7 | ; 8 | ; Please visit documentation for the other options and examples 9 | ; https://docs.platformio.org/page/projectconf.html 10 | 11 | [env:esp32-s3-devkitc-1] 12 | platform = espressif32@6.4.0 13 | board = esp32-s3-devkitc-1 14 | framework = arduino 15 | monitor_speed = 115200 16 | board_build.f_cpu = 240000000L ; Custom CPU Frequency 17 | 18 | board_build.f_flash = 80000000L ; Custom FLASH Frequency 19 | board_build.flash_mode = qio ; Custom FLASH Mode 20 | 21 | ; if use esp32s3fh4r2 22 | ; board_build.arduino.partitions = huge_app.csv # 设置分区表 23 | ; board_upload.flash_size = 4MB #FLASH大小 24 | 25 | ; if use esp32s3r8 or module 26 | board_build.arduino.memory_type = qio_opi ; if use r8_module, please open it! 27 | board_build.arduino.partitions = default_8MB.csv # 设置分区表 28 | board_upload.flash_size = 8MB #FLASH大小 29 | 30 | build_unflags = -Os 31 | 32 | build_flags = 33 | ; -DARDUINO_USB_CDC_ON_BOOT=1 34 | ; -DARDUINO_USB_MODE=1 35 | 36 | -O2 37 | 38 | -D BOARD_HAS_PSRAM #用于指示编译器当前的目标设备是否具有 PSRAM 39 | -mfix-esp32-psram-cache-issue #用于修复 ESP32 上的 PSRAM 缓存一致性问题的编译选项 40 | 41 | -D USE_NIMBLE 42 | ; -DCORE_DEBUG_LEVEL=3 43 | 44 | 45 | 46 | lib_deps = 47 | bblanchon/ArduinoJson@^6.21.2 48 | lovyan03/LovyanGFX@^1.1.12 49 | lvgl/lvgl@^8.3.1 50 | -------------------------------------------------------------------------------- /2.Firmware/src/App/App.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * Copyright (c) 2021 _VIFEXTech 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | * SOFTWARE. 22 | */ 23 | #ifndef __APP_H 24 | #define __APP_H 25 | 26 | 27 | 28 | void App_Init(void); 29 | void App_Uninit(void); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Common/DataProc/DP_Backlight.cpp: -------------------------------------------------------------------------------- 1 | #include "DataProc.h" 2 | #include "../HAL/HAL.h" 3 | #include "App/Config/Config.h" 4 | 5 | static void onTimer(Account *account) 6 | { 7 | } 8 | 9 | static int onEvent(Account *account, Account::EventParam_t *param) 10 | { 11 | 12 | if (param->event == Account::EVENT_TIMER) 13 | { 14 | onTimer(account); 15 | return Account::RES_OK; 16 | } 17 | 18 | if (param->event != Account::EVENT_SUB_PULL && param->event != Account::EVENT_NOTIFY) 19 | { 20 | return Account::RES_UNSUPPORTED_REQUEST; 21 | } 22 | 23 | if (param->size != sizeof(uint16_t)) 24 | { 25 | return Account::RES_SIZE_MISMATCH; 26 | } 27 | 28 | if (param->event == Account::EVENT_SUB_PULL) 29 | { 30 | uint16_t *info = (uint16_t *)param->data_p; 31 | 32 | *info = HAL::Backlight_GetValue(); 33 | 34 | printf("[DP] BacklightPULL\r\n"); 35 | } 36 | else if (param->event == Account::EVENT_NOTIFY) 37 | { 38 | uint16_t *info = (uint16_t *)param->data_p; 39 | 40 | HAL::Backlight_SetValue(constrain(*info, 10, 255)); // 限制最低亮度为10,不要完全黑屏 41 | 42 | printf("[DP] BacklightNOTOFIY\r\n"); 43 | } 44 | 45 | return Account::RES_OK; 46 | } 47 | 48 | DATA_PROC_INIT_DEF(Backlight) 49 | { 50 | account->SetEventCallback(onEvent); 51 | } 52 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Common/DataProc/DP_IMU.cpp: -------------------------------------------------------------------------------- 1 | #include "DataProc.h" 2 | #include "../HAL/HAL.h" 3 | 4 | DATA_PROC_INIT_DEF(IMU) 5 | { 6 | HAL::IMU_SetCommitCallback([](void* info, void* userData){ 7 | Account* account = (Account*)userData; 8 | return account->Commit(info, sizeof(HAL::IMU_Info_t)); 9 | }, account); 10 | } 11 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Common/DataProc/DP_LIST.inc: -------------------------------------------------------------------------------- 1 | 2 | /* Data processing node list */ 3 | DP_DEF(Storage, 0); 4 | DP_DEF(Clock, 0); 5 | DP_DEF(GPS, sizeof(HAL::GPS_Info_t)); 6 | DP_DEF(Power, 0); 7 | DP_DEF(SportStatus, sizeof(HAL::SportStatus_Info_t)); 8 | DP_DEF(Recorder, 0); 9 | DP_DEF(IMU, sizeof(HAL::IMU_Info_t)); 10 | DP_DEF(MAG, sizeof(HAL::MAG_Info_t)); 11 | DP_DEF(StatusBar, 0); 12 | DP_DEF(MusicPlayer, 0); 13 | DP_DEF(WiFi, sizeof(HAL::WiFi_Info_t)); 14 | DP_DEF(BLE, sizeof(HAL::BLE_Info_t)); 15 | DP_DEF(Backlight, sizeof(uint16_t)); 16 | DP_DEF(TzConv, 0); 17 | DP_DEF(SysConfig, 0); 18 | DP_DEF(TrackFilter, 0); 19 | DP_DEF(SmartAssistant, sizeof(HAL::Saa_Info_t)); 20 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Common/DataProc/DP_MusicPlayer.cpp: -------------------------------------------------------------------------------- 1 | #include "DataProc.h" 2 | #include "../HAL/HAL.h" 3 | 4 | static int onEvent(Account* account, Account::EventParam_t* param) 5 | { 6 | if (param->event != Account::EVENT_NOTIFY) 7 | { 8 | return Account::RES_UNSUPPORTED_REQUEST; 9 | } 10 | 11 | if (param->size != sizeof(DataProc::MusicPlayer_Info_t)) 12 | { 13 | return Account::RES_SIZE_MISMATCH; 14 | } 15 | 16 | DataProc::MusicPlayer_Info_t* info = (DataProc::MusicPlayer_Info_t*)param->data_p; 17 | 18 | HAL::Audio_PlayMusic(info->music); 19 | 20 | return Account::RES_OK; 21 | } 22 | 23 | DATA_PROC_INIT_DEF(MusicPlayer) 24 | { 25 | account->SetEventCallback(onEvent); 26 | } 27 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Common/DataProc/DP_SmartAssistant.cpp: -------------------------------------------------------------------------------- 1 | #include "DataProc.h" 2 | #include "../HAL/HAL.h" 3 | #include "App/Config/Config.h" 4 | 5 | static void onTimer(Account *account) 6 | { 7 | } 8 | 9 | static int onEvent(Account *account, Account::EventParam_t *param) 10 | { 11 | 12 | if (param->event == Account::EVENT_TIMER) 13 | { 14 | onTimer(account); 15 | return Account::RES_OK; 16 | } 17 | 18 | if (param->event != Account::EVENT_SUB_PULL && param->event != Account::EVENT_NOTIFY) 19 | { 20 | return Account::RES_UNSUPPORTED_REQUEST; 21 | } 22 | 23 | if (param->size != sizeof(HAL::Saa_Info_t)) 24 | { 25 | return Account::RES_SIZE_MISMATCH; 26 | } 27 | 28 | if (param->event == Account::EVENT_SUB_PULL) 29 | { 30 | HAL::Saa_Info_t *info = (HAL::Saa_Info_t *)param->data_p; 31 | 32 | HAL::SmartAssistant_GetInfo(info); 33 | 34 | printf("[DP] SmartAssistantPULL\r\n"); 35 | } 36 | else if (param->event == Account::EVENT_NOTIFY) 37 | { 38 | 39 | HAL::SmartAssistant_SetBegin(true); 40 | 41 | printf("[DP] SmartAssistantNOTOFIY\r\n"); 42 | } 43 | 44 | return Account::RES_OK; 45 | } 46 | 47 | DATA_PROC_INIT_DEF(SmartAssistant) 48 | { 49 | account->SetEventCallback(onEvent); 50 | } 51 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Common/DataProc/DP_TzConv.cpp: -------------------------------------------------------------------------------- 1 | #include "DataProc.h" 2 | #include "../HAL/HAL.h" 3 | #include "App/Utils/Time/Time.h" 4 | #include "App/Config/Config.h" 5 | 6 | using namespace DataProc; 7 | 8 | static int onEvent(Account* account, Account::EventParam_t* param) 9 | { 10 | if (param->event != Account::EVENT_SUB_PULL) 11 | { 12 | return Account::RES_UNSUPPORTED_REQUEST; 13 | } 14 | 15 | if (param->size != sizeof(HAL::Clock_Info_t)) 16 | { 17 | return Account::RES_SIZE_MISMATCH; 18 | } 19 | 20 | HAL::GPS_Info_t gps; 21 | if (account->Pull("GPS", &gps, sizeof(gps)) != Account::RES_OK) 22 | { 23 | return Account::RES_UNKNOW; 24 | } 25 | 26 | DataProc::SysConfig_Info_t sysCfg; 27 | if (account->Pull("SysConfig", &sysCfg, sizeof(sysCfg)) != Account::RES_OK) 28 | { 29 | return Account::RES_UNKNOW; 30 | } 31 | 32 | setTime( 33 | gps.clock.hour, 34 | gps.clock.minute, 35 | gps.clock.second, 36 | gps.clock.day, 37 | gps.clock.month, 38 | gps.clock.year 39 | ); 40 | adjustTime(sysCfg.timeZone * SECS_PER_HOUR); 41 | 42 | HAL::Clock_Info_t* info = (HAL::Clock_Info_t*)param->data_p; 43 | info->year = year(); 44 | info->month = month(); 45 | info->day = day(); 46 | info->hour = hour(); 47 | info->minute = minute(); 48 | info->second = second(); 49 | 50 | return Account::RES_OK; 51 | } 52 | 53 | DATA_PROC_INIT_DEF(TzConv) 54 | { 55 | account->Subscribe("GPS"); 56 | account->Subscribe("SysConfig"); 57 | account->SetEventCallback(onEvent); 58 | } 59 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Common/DataProc/DP_WiFi.cpp: -------------------------------------------------------------------------------- 1 | #include "DataProc.h" 2 | #include "../HAL/HAL.h" 3 | #include "App/Config/Config.h" 4 | 5 | static void onTimer(Account *account) 6 | { 7 | } 8 | 9 | static int onEvent(Account *account, Account::EventParam_t *param) 10 | { 11 | 12 | if (param->event == Account::EVENT_TIMER) 13 | { 14 | onTimer(account); 15 | return Account::RES_OK; 16 | } 17 | 18 | if (param->event != Account::EVENT_SUB_PULL && param->event != Account::EVENT_NOTIFY) 19 | { 20 | return Account::RES_UNSUPPORTED_REQUEST; 21 | } 22 | 23 | if (param->size != sizeof(HAL::WiFi_Info_t)) 24 | { 25 | return Account::RES_SIZE_MISMATCH; 26 | } 27 | 28 | if (param->event == Account::EVENT_SUB_PULL) 29 | { 30 | HAL::WiFi_Info_t *info = (HAL::WiFi_Info_t *)param->data_p; 31 | HAL::WiFi_GetInfo(info); 32 | printf("[DP] WiFiPULL\r\n"); 33 | } 34 | else if (param->event == Account::EVENT_NOTIFY) 35 | { 36 | HAL::WiFi_Info_t *info = (HAL::WiFi_Info_t *)param->data_p; 37 | 38 | HAL::WiFi_APSetEnable(info->isAPEnabled); 39 | HAL::WiFi_STASetEnable(info->isWiFiEnabled); 40 | 41 | printf("[DP] WiFiNOTOFIY\r\n"); 42 | } 43 | 44 | return Account::RES_OK; 45 | } 46 | 47 | DATA_PROC_INIT_DEF(WiFi) 48 | { 49 | account->SetEventCallback(onEvent); 50 | } 51 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Common/DataProc/DataProc.cpp: -------------------------------------------------------------------------------- 1 | #include "DataProc.h" 2 | #include "../HAL/HAL.h" 3 | 4 | static DataCenter center("CENTER"); 5 | 6 | DataCenter* DataProc::Center() 7 | { 8 | return ¢er; 9 | } 10 | 11 | void DataProc_Init() 12 | { 13 | #define DP_DEF(NODE_NAME, BUFFER_SIZE)\ 14 | Account* act##NODE_NAME = new Account(#NODE_NAME, ¢er, BUFFER_SIZE); 15 | # include "DP_LIST.inc" 16 | #undef DP_DEF 17 | 18 | #define DP_DEF(NODE_NAME, BUFFER_SIZE)\ 19 | do{\ 20 | DATA_PROC_INIT_DEF(NODE_NAME);\ 21 | _DP_##NODE_NAME##_Init(act##NODE_NAME);\ 22 | }while(0) 23 | # include "DP_LIST.inc" 24 | #undef DP_DEF 25 | 26 | } 27 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Common/DataProc/DataProc.h: -------------------------------------------------------------------------------- 1 | #ifndef __DATA_PROC_H 2 | #define __DATA_PROC_H 3 | 4 | #include "App/Utils/DataCenter/DataCenter.h" 5 | #include "App/Common/HAL/HAL_Def.h" 6 | #include "DataProc_Def.h" 7 | 8 | #define DATA_PROC_INIT_DEF(name) void _DP_##name##_Init(Account* account) 9 | #define DATA_PROC_INIT_STRUCT(sct) memset(&sct, 0, sizeof(sct)) 10 | 11 | void DataProc_Init(); 12 | 13 | namespace DataProc 14 | { 15 | 16 | DataCenter* Center(); 17 | uint32_t GetTick(); 18 | uint32_t GetTickElaps(uint32_t prevTick); 19 | const char* MakeTimeString(uint64_t ms, char* buf, uint16_t len); 20 | 21 | } 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Common/HAL/HAL.cpp: -------------------------------------------------------------------------------- 1 | #include "HAL.h" 2 | 3 | /** 4 | * @brief Task to handle hal timer 5 | * 6 | * @param param 7 | */ 8 | static void task_hal_update_handler(void *param) 9 | { 10 | while (1) 11 | { 12 | HAL::HAL_Update(); 13 | delay(10); 14 | } 15 | vTaskDelete(NULL); 16 | } 17 | 18 | void HAL::HAL_Init(void) 19 | { 20 | // Buzz_init(); 21 | // Audio_Init(); 22 | Power_Init(); 23 | 24 | xTaskCreate(task_hal_update_handler, "Hal", 1024 * 5, nullptr, 5, nullptr); 25 | } 26 | 27 | void HAL::HAL_Update(void) 28 | { 29 | __IntervalExecute(HAL::IMU_Update(), 200); 30 | __IntervalExecute(HAL::MAG_Update(), 50); 31 | __IntervalExecute(HAL::Power_Update(), 500); 32 | __IntervalExecute(HAL::WiFi_Update(), 100); 33 | __IntervalExecute(HAL::GPS_Update(), 500); 34 | // __IntervalExecute(HAL::ENV_Update(), 100); 35 | } -------------------------------------------------------------------------------- /2.Firmware/src/App/Common/HAL/HAL_Audio.cpp: -------------------------------------------------------------------------------- 1 | #include "HAL.h" 2 | #include "App/Utils/TonePlayer/TonePlayer.h" 3 | 4 | static TonePlayer player; 5 | 6 | #include "App/Common/Music/MusicCode.h" 7 | 8 | void HAL::Audio_Init() 9 | { 10 | player.SetCallback([](uint32_t freq, uint16_t volume) 11 | { HAL::Buzz_Tone(freq); }); 12 | } 13 | 14 | void HAL::Audio_Update() 15 | { 16 | player.Update(millis()); 17 | } 18 | 19 | bool HAL::Audio_PlayMusic(const char *name) 20 | { 21 | bool retval = false; 22 | for (int i = 0; i < sizeof(MusicList) / sizeof(MusicList[0]); i++) 23 | { 24 | if (strcmp(name, MusicList[i].name) == 0) 25 | { 26 | player.Play(MusicList[i].mc, MusicList[i].length); 27 | retval = true; 28 | break; 29 | } 30 | } 31 | return retval; 32 | } -------------------------------------------------------------------------------- /2.Firmware/src/App/Common/HAL/HAL_BLE.cpp: -------------------------------------------------------------------------------- 1 | #include "HAL.h" 2 | #include "ChappieCore/ChappieCore.h" 3 | 4 | extern ChappieCore Chappie; 5 | 6 | /** 7 | * @brief BLE初始化 8 | * @param 无 9 | * @retval 无 10 | */ 11 | void HAL::BLE_Init() 12 | { 13 | // ... 14 | } 15 | 16 | void HAL::BLE_Update(void) 17 | { 18 | // ... 19 | } 20 | 21 | void HAL::BLE_SetBegin(void) 22 | { 23 | Chappie.Ble.begin(); 24 | } 25 | 26 | void HAL::BLE_SetSleep(void) 27 | { 28 | Chappie.Ble.sleep(); 29 | } 30 | 31 | void HAL::BLE_SetKeyboardValue(uint8_t *c) 32 | { 33 | printf("[BLE] c[0]: %d, c[1]: %d\n", c[0], c[1]); 34 | uint16_t Ret = Chappie.Ble.write(c); 35 | 36 | printf("[BLE] Ret: %d\n", Ret); 37 | } 38 | 39 | void HAL::BLE_SetMouseMoveValue(uint8_t *c) 40 | { 41 | printf("[BLE] c[0]: %d, c[1]: %d, c[2]: %d, c[3]: %d\n", c[0], c[1], c[2], c[3]); 42 | Chappie.Ble.move(c); 43 | } 44 | 45 | void HAL::BLE_SetMouseClickValue(uint16_t b) 46 | { 47 | printf("[BLE] b: %d\n", b); 48 | Chappie.Ble.click(b); 49 | } 50 | 51 | void HAL::BLE_GetInfo(HAL::BLE_Info_t *info) 52 | { 53 | info->name = Chappie.Ble.GetName(); 54 | info->isConnected = Chappie.Ble.isConnected(); 55 | info->isEnabled = Chappie.Ble.isEnabled(); 56 | } -------------------------------------------------------------------------------- /2.Firmware/src/App/Common/HAL/HAL_Buzz.cpp: -------------------------------------------------------------------------------- 1 | #include "HAL.h" 2 | #include "App/Config/Config.h" 3 | 4 | #include "ChappieCore/ChappieCore.h" 5 | 6 | extern ChappieCore Chappie; 7 | 8 | static bool IsEnable = true; 9 | static int32_t duration = 0; 10 | static uint32_t freq = 0; 11 | 12 | static void BuzzerThread(void *argument) 13 | { 14 | for (;;) 15 | { 16 | if (duration > 0) 17 | { 18 | ledcWriteTone(CONFIG_BUZZ_CHANNEL, freq); 19 | delay(duration); 20 | ledcWriteTone(CONFIG_BUZZ_CHANNEL, 0); 21 | 22 | duration = 0; 23 | } 24 | 25 | delay(50); 26 | } 27 | } 28 | 29 | void HAL::Buzz_init() 30 | { 31 | pinMode(CONFIG_BUZZ_PIN, OUTPUT); 32 | ledcAttachPin(CONFIG_BUZZ_PIN, CONFIG_BUZZ_CHANNEL); 33 | ledcSetup(CONFIG_BUZZ_CHANNEL, 0, 8); 34 | ledcWriteTone(CONFIG_BUZZ_CHANNEL, 0); 35 | 36 | // Create Buzzer thread 37 | TaskHandle_t handleBuzzerThread; 38 | xTaskCreate( 39 | BuzzerThread, 40 | "BuzzerThread", 41 | 800, 42 | nullptr, 43 | 1, 44 | &handleBuzzerThread); 45 | } 46 | 47 | void HAL::Buzz_SetEnable(bool en) 48 | { 49 | IsEnable = en; 50 | } 51 | 52 | void HAL::Buzz_Tone(uint32_t _freq, int32_t _duration) 53 | { 54 | if (!IsEnable) 55 | return; 56 | 57 | if (_duration == 0) 58 | { 59 | ledcWriteTone(CONFIG_BUZZ_CHANNEL, _freq); 60 | } 61 | else 62 | { 63 | freq = _freq; 64 | duration = _duration; 65 | } 66 | } -------------------------------------------------------------------------------- /2.Firmware/src/App/Common/HAL/HAL_Clock.cpp: -------------------------------------------------------------------------------- 1 | #include "HAL.h" 2 | #include "ChappieCore/ChappieCore.h" 3 | 4 | extern ChappieCore Chappie; 5 | 6 | void HAL::Clock_Init() 7 | { 8 | // ... 9 | } 10 | 11 | void HAL::Clock_GetInfo(Clock_Info_t *info) 12 | { 13 | // Get RTC time 14 | I2C_BM8563_TimeTypeDef timeStruct; 15 | 16 | // Get RTC Date 17 | I2C_BM8563_DateTypeDef dateStruct; 18 | 19 | Chappie.Rtc.getTime(&timeStruct); 20 | Chappie.Rtc.getDate(&dateStruct); 21 | 22 | info->year = dateStruct.year; 23 | info->month = dateStruct.month; 24 | info->day = dateStruct.date; 25 | info->week = dateStruct.weekDay; 26 | info->hour = timeStruct.hours; 27 | info->minute = timeStruct.minutes; 28 | info->second = timeStruct.seconds; 29 | info->millisecond = 0; 30 | } 31 | 32 | void HAL::Clock_SetInfo(const Clock_Info_t *info) 33 | { 34 | // Set RTC time 35 | I2C_BM8563_TimeTypeDef timeStruct; 36 | timeStruct.hours = info->hour; 37 | timeStruct.minutes = info->minute; 38 | timeStruct.seconds = info->second; 39 | Chappie.Rtc.setTime(&timeStruct); 40 | 41 | // Set RTC Date 42 | I2C_BM8563_DateTypeDef dateStruct; 43 | dateStruct.month = info->month; 44 | dateStruct.date = info->day; 45 | dateStruct.year = info->year; 46 | Chappie.Rtc.setDate(&dateStruct); 47 | } 48 | 49 | const char *HAL::Clock_GetWeekString(uint8_t week) 50 | { 51 | const char *week_str[] = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"}; 52 | return week < 7 ? week_str[week] : ""; 53 | } 54 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Common/HAL/HAL_ENV.cpp: -------------------------------------------------------------------------------- 1 | #include "HAL.h" 2 | #include "ChappieCore/ChappieCore.h" 3 | 4 | extern ChappieCore Chappie; 5 | static HAL::CommitFunc_t CommitFunc = nullptr; 6 | static void *UserData = nullptr; 7 | 8 | void HAL::ENV_Init(void) 9 | { 10 | // ... 11 | } 12 | 13 | void HAL::ENV_SetCommitCallback(CommitFunc_t func, void *userData) 14 | { 15 | CommitFunc = func; 16 | UserData = userData; 17 | } 18 | 19 | void HAL::ENV_Update(void) 20 | { 21 | MAG_Info_t magInfo = {0}; 22 | 23 | magInfo.x = (int32_t)(Chappie.Env.readPressure()); 24 | magInfo.y = (int32_t)(Chappie.Env.readAltitude()); 25 | magInfo.z = (int32_t)(Chappie.Env.readTemperature()); 26 | // Serial.printf("%d,%d,%d\n", mag.m.x, mag.m.y, mag.m.z); 27 | 28 | if (CommitFunc) 29 | { 30 | CommitFunc(&magInfo, UserData); 31 | } 32 | } -------------------------------------------------------------------------------- /2.Firmware/src/App/Common/HAL/HAL_IMU.cpp: -------------------------------------------------------------------------------- 1 | #include "HAL.h" 2 | #include "ChappieCore/ChappieCore.h" 3 | 4 | extern ChappieCore Chappie; 5 | 6 | static HAL::CommitFunc_t CommitFunc = nullptr; 7 | static void *UserData = nullptr; 8 | 9 | void HAL::IMU_Init(void) 10 | { 11 | // ... 12 | } 13 | 14 | void HAL::IMU_SetCommitCallback(CommitFunc_t func, void *userData) 15 | { 16 | CommitFunc = func; 17 | UserData = userData; 18 | } 19 | 20 | void HAL::IMU_Update() 21 | { 22 | IMU_Info_t imuInfo = {0}; 23 | // float data[3] = {0}; 24 | Chappie.Imu.getMotion6( 25 | &imuInfo.ax, &imuInfo.ay, &imuInfo.az, 26 | &imuInfo.gx, &imuInfo.gy, &imuInfo.gz); 27 | 28 | // Chappie.Imu.getYawPitchRoll(data[0], data[1], data[2]); // 使用此函数会闪退重启 29 | 30 | // imuInfo.ax = (int16_t)data[0]; 31 | // imuInfo.ay = (int16_t)data[1]; 32 | // imuInfo.az = (int16_t)data[2]; 33 | 34 | // Serial.printf( 35 | // "ax = %d, ay = %d, az = %d, gx = %d, gy = %d, gz = %d\r\n", 36 | // imuInfo.ax, imuInfo.ay, imuInfo.az, imuInfo.gx, imuInfo.gy, imuInfo.gz 37 | // ); 38 | 39 | // imuInfo.steps = Chappie.Imu.dmpGetSampleStepSizeMS(); 40 | 41 | if (CommitFunc) 42 | { 43 | CommitFunc(&imuInfo, UserData); 44 | } 45 | } -------------------------------------------------------------------------------- /2.Firmware/src/App/Common/HAL/HAL_SmartAssistant.cpp: -------------------------------------------------------------------------------- 1 | #include "HAL.h" 2 | #include "ChappieCore/ChappieCore.h" 3 | 4 | extern ChappieCore Chappie; 5 | 6 | bool HAL::SmartAssistant_Init() 7 | { 8 | // ... 9 | return 0; 10 | } 11 | 12 | /** 13 | * @brief 启动智能助手对话 14 | * @param en 15 | * @retval 无 16 | */ 17 | void HAL::SmartAssistant_SetBegin(bool en) 18 | { 19 | if (!en) 20 | return; 21 | 22 | Chappie.saa.begin(); 23 | 24 | } 25 | 26 | /** 27 | * @brief 获取智能助手的信息 28 | * @param 无 29 | * @retval 无 30 | */ 31 | void HAL::SmartAssistant_GetInfo(HAL::Saa_Info_t *info) 32 | { 33 | info->inputText = Chappie.saa.getInputText(); 34 | info->outputText = Chappie.saa.getOutputText(); 35 | info->isRunning = Chappie.saa.isRunning(); 36 | info->isListening = Chappie.saa.isListening(); 37 | } -------------------------------------------------------------------------------- /2.Firmware/src/App/Common/Music/ToneMap.h: -------------------------------------------------------------------------------- 1 | #ifndef __TONE_MAP_H 2 | #define __TONE_MAP_H 3 | 4 | /*音符频率对应表*/ 5 | enum ToneMap 6 | { 7 | L1 = 262, 8 | L1h = 277, 9 | L2 = 294, 10 | L2h = 311, 11 | L3 = 330, 12 | L4 = 349, 13 | L4h = 370, 14 | L5 = 392, 15 | L5h = 415, 16 | L6 = 440, 17 | L6h = 466, 18 | L7 = 494, 19 | M1 = 523, 20 | M1h = 554, 21 | M2 = 587, 22 | M2h = 622, 23 | M3 = 659, 24 | M4 = 698, 25 | M4h = 740, 26 | M5 = 784, 27 | M5h = 831, 28 | M6 = 880, 29 | M6h = 932, 30 | M7 = 988, 31 | H1 = 1046, 32 | H1h = 1109, 33 | H2 = 1175, 34 | H2h = 1245, 35 | H3 = 1318, 36 | H4 = 1397, 37 | H4h = 1480, 38 | H5 = 1568, 39 | H5h = 1661, 40 | H6 = 1760, 41 | H6h = 1865, 42 | H7 = 1976, 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/AppFactory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * Copyright (c) 2021 _VIFEXTech 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | * SOFTWARE. 22 | */ 23 | #include "../Utils/PageManager/PageManager.h" 24 | 25 | class AppFactory : public PageFactory 26 | { 27 | public: 28 | virtual PageBase* CreatePage(const char* name); 29 | private: 30 | 31 | }; 32 | 33 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/BLEKeyboard/BLEKeyboard.h: -------------------------------------------------------------------------------- 1 | #ifndef __BLEKEYBOARD_PRESENTER_H 2 | #define __BLEKEYBOARD_PRESENTER_H 3 | 4 | #include "BLEKeyboardView.h" 5 | #include "BLEKeyboardModel.h" 6 | 7 | namespace Page 8 | { 9 | 10 | class BLEKeyboard : public PageBase 11 | { 12 | 13 | public: 14 | BLEKeyboard(); 15 | virtual ~BLEKeyboard(); 16 | 17 | virtual void onCustomAttrConfig(); 18 | virtual void onViewLoad(); 19 | virtual void onViewDidLoad(); 20 | virtual void onViewWillAppear(); 21 | virtual void onViewDidAppear(); 22 | virtual void onViewWillDisappear(); 23 | virtual void onViewDidDisappear(); 24 | virtual void onViewUnload(); 25 | virtual void onViewDidUnload(); 26 | 27 | private: 28 | void Update(); 29 | void AttachEvent(lv_obj_t *obj); 30 | static void onTimerUpdate(lv_timer_t *timer); 31 | static void onEvent(lv_event_t *event); 32 | 33 | public: 34 | static void musicCtrlBtnHandler(lv_event_t *event); 35 | static void directionCtrlBtnHandler(lv_event_t *event); 36 | static void mouseMoveCtrlBtnHandler(lv_event_t *event); 37 | static void mouseClickCtrlBtnHandler(lv_event_t *event); 38 | 39 | private: 40 | BLEKeyboardView View; 41 | BLEKeyboardModel Model; 42 | lv_timer_t *timer; 43 | }; 44 | 45 | } 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/BLEKeyboard/BLEKeyboardModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __BLEKEYBOARD_MODEL_H 2 | #define __BLEKEYBOARD_MODEL_H 3 | 4 | #include "App/Common/DataProc/DataProc.h" 5 | #include "lvgl.h" 6 | 7 | namespace Page 8 | { 9 | 10 | class BLEKeyboardModel 11 | { 12 | public: 13 | public: 14 | void Init(); 15 | void Deinit(); 16 | 17 | void GetBLEInfo(char *name, bool *isConnected, bool *isEnabled); 18 | void SendBLEKeyboardValue(uint8_t *KeyVal); 19 | void SendBLEMouseMoveValue(uint8_t *MouseVal); 20 | void SendBLEMouseClickValue(uint16_t MouseClick); 21 | 22 | void SetStatusBarStyle(DataProc::StatusBar_Style_t style); 23 | void SetStatusBarAppear(bool en); 24 | 25 | private: 26 | Account *account; 27 | 28 | private: 29 | static int onEvent(Account *account, Account::EventParam_t *param); 30 | }; 31 | 32 | } 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/Compass/Compass.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPASS_PRESENTER_H 2 | #define __COMPASS_PRESENTER_H 3 | 4 | #include "CompassView.h" 5 | #include "CompassModel.h" 6 | 7 | namespace Page 8 | { 9 | 10 | class Compass : public PageBase 11 | { 12 | public: 13 | Compass(); 14 | virtual ~Compass(); 15 | 16 | virtual void onCustomAttrConfig(); 17 | virtual void onViewLoad(); 18 | virtual void onViewDidLoad(); 19 | virtual void onViewWillAppear(); 20 | virtual void onViewDidAppear(); 21 | virtual void onViewWillDisappear(); 22 | virtual void onViewDidDisappear(); 23 | virtual void onViewUnload(); 24 | virtual void onViewDidUnload(); 25 | 26 | private: 27 | void Update(); 28 | void AttachEvent(lv_obj_t *obj); 29 | static void onTimerUpdate(lv_timer_t *timer); 30 | static void onEvent(lv_event_t *event); 31 | 32 | private: 33 | CompassView View; 34 | CompassModel Model; 35 | lv_timer_t *timer; 36 | char text[16] = "THINKING..."; 37 | }; 38 | 39 | } 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/Compass/CompassModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPASS_MODEL_H 2 | #define __COMPASS_MODEL_H 3 | 4 | #include "App/Common/DataProc/DataProc.h" 5 | #include "lvgl.h" 6 | 7 | namespace Page 8 | { 9 | 10 | class CompassModel 11 | { 12 | public: 13 | void GetMAGInfo( 14 | int *dir, 15 | int *x, 16 | int *y, 17 | int *z, 18 | bool *isCalibrated); 19 | 20 | void SetMAGCalibration(void); 21 | 22 | public: 23 | void Init(); 24 | void Deinit(); 25 | 26 | void SetStatusBarStyle(DataProc::StatusBar_Style_t style); 27 | 28 | private: 29 | Account *account; 30 | 31 | private: 32 | static int onEvent(Account *account, Account::EventParam_t *param); 33 | }; 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/Dialplate/Dialplate.h: -------------------------------------------------------------------------------- 1 | #ifndef __DIALPLATE_PRESENTER_H 2 | #define __DIALPLATE_PRESENTER_H 3 | 4 | #include "DialplateView.h" 5 | #include "DialplateModel.h" 6 | 7 | namespace Page 8 | { 9 | 10 | class Dialplate : public PageBase // public继承 11 | { 12 | public: 13 | Dialplate(); // 构造函数 14 | virtual ~Dialplate(); // 析构函数 15 | 16 | virtual void onCustomAttrConfig(); 17 | virtual void onViewLoad(); 18 | virtual void onViewDidLoad(); 19 | virtual void onViewWillAppear(); 20 | virtual void onViewDidAppear(); 21 | virtual void onViewWillDisappear(); 22 | virtual void onViewDidDisappear(); 23 | virtual void onViewUnload(); 24 | virtual void onViewDidUnload(); 25 | 26 | private: 27 | typedef enum 28 | { 29 | RECORD_STATE_READY, 30 | RECORD_STATE_RUN, 31 | RECORD_STATE_PAUSE, 32 | RECORD_STATE_STOP 33 | } RecordState_t; 34 | 35 | private: 36 | void Update(); 37 | void AttachEvent(lv_obj_t *obj); 38 | static void onTimerUpdate(lv_timer_t *timer); 39 | static void onEvent(lv_event_t *event); 40 | void onBtnClicked(lv_obj_t *btn); 41 | void onRecord(bool longPress); 42 | void SetBtnRecImgSrc(const char *srcName); 43 | 44 | private: 45 | DialplateView View; 46 | DialplateModel Model; 47 | lv_timer_t *timer; 48 | RecordState_t recState; 49 | lv_obj_t *lastFocus; 50 | }; 51 | 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/Dialplate/DialplateModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __DIALPLATE_MODEL_H 2 | #define __DIALPLATE_MODEL_H 3 | 4 | #include "App/Common/DataProc/DataProc.h" 5 | 6 | namespace Page 7 | { 8 | 9 | class DialplateModel 10 | { 11 | public: 12 | typedef enum 13 | { 14 | REC_START = DataProc::RECORDER_CMD_START, 15 | REC_PAUSE = DataProc::RECORDER_CMD_PAUSE, 16 | REC_CONTINUE = DataProc::RECORDER_CMD_CONTINUE, 17 | REC_STOP = DataProc::RECORDER_CMD_STOP, 18 | REC_READY_STOP 19 | } RecCmd_t; 20 | 21 | public: 22 | HAL::SportStatus_Info_t sportStatusInfo; 23 | 24 | public: 25 | void Init(); 26 | void Deinit(); 27 | 28 | bool GetGPSReady(); 29 | 30 | float GetSpeed() 31 | { 32 | return sportStatusInfo.speedKph; 33 | } 34 | 35 | float GetAvgSpeed() 36 | { 37 | return sportStatusInfo.speedAvgKph; 38 | } 39 | 40 | void RecorderCommand(RecCmd_t cmd); 41 | void PlayMusic(const char* music); 42 | void SetStatusBarStyle(DataProc::StatusBar_Style_t style); 43 | void SetStatusBarAppear(bool en); 44 | 45 | private: 46 | Account *account; 47 | 48 | private: 49 | static int onEvent(Account* account, Account::EventParam_t* param); 50 | }; 51 | 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/Dialplate/DialplateView.h: -------------------------------------------------------------------------------- 1 | #ifndef __DIALPLATE_VIEW_H 2 | #define __DIALPLATE_VIEW_H 3 | 4 | #include "../Page.h" 5 | 6 | namespace Page 7 | { 8 | 9 | class DialplateView 10 | { 11 | 12 | public: 13 | typedef struct 14 | { 15 | lv_obj_t* cont; 16 | lv_obj_t* lableValue; 17 | lv_obj_t* lableUnit; 18 | } SubInfo_t; 19 | 20 | public: 21 | struct 22 | { 23 | struct 24 | { 25 | lv_obj_t* cont; 26 | lv_obj_t* labelSpeed; 27 | lv_obj_t* labelUint; 28 | } topInfo; 29 | 30 | struct 31 | { 32 | lv_obj_t* cont; 33 | SubInfo_t labelInfoGrp[4]; 34 | } bottomInfo; 35 | 36 | struct 37 | { 38 | lv_obj_t* cont; 39 | lv_obj_t* btnMap; 40 | lv_obj_t* btnRec; 41 | lv_obj_t* btnMenu; 42 | } btnCont; 43 | 44 | lv_anim_timeline_t* anim_timeline; 45 | } ui; 46 | 47 | void Create(lv_obj_t* root); 48 | void Delete(); 49 | void AppearAnimStart(bool reverse = false); 50 | 51 | private: 52 | void TopInfo_Create(lv_obj_t* par); 53 | void BottomInfo_Create(lv_obj_t* par); 54 | void SubInfoGrp_Create(lv_obj_t* par, SubInfo_t* info, const char* unitText); 55 | void BtnCont_Create(lv_obj_t* par); 56 | lv_obj_t* Btn_Create(lv_obj_t* par, const void* img_src, lv_coord_t x_ofs); 57 | }; 58 | 59 | } 60 | 61 | #endif // !__VIEW_H 62 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/LaunchOut/LaunchOut.h: -------------------------------------------------------------------------------- 1 | #ifndef __LAUNCHOUT_PRESENTER_H 2 | #define __LAUNCHOUT_PRESENTER_H 3 | 4 | #include "LaunchOutView.h" 5 | #include "LaunchOutModel.h" 6 | 7 | namespace Page 8 | { 9 | 10 | class LaunchOut : public PageBase 11 | { 12 | public: 13 | 14 | public: 15 | LaunchOut(); 16 | virtual ~LaunchOut(); 17 | 18 | virtual void onCustomAttrConfig(); 19 | virtual void onViewLoad(); 20 | virtual void onViewDidLoad(); 21 | virtual void onViewWillAppear(); 22 | virtual void onViewDidAppear(); 23 | virtual void onViewWillDisappear(); 24 | virtual void onViewDidDisappear(); 25 | virtual void onViewUnload(); 26 | virtual void onViewDidUnload(); 27 | 28 | private: 29 | static void onTimer(lv_timer_t* timer); 30 | static void onEvent(lv_event_t* event); 31 | 32 | private: 33 | LaunchOutView View; 34 | LaunchOutModel Model; 35 | }; 36 | 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/LaunchOut/LaunchOutModel.cpp: -------------------------------------------------------------------------------- 1 | #include "LaunchOutModel.h" 2 | 3 | using namespace Page; 4 | 5 | void LaunchOutModel::Init() 6 | { 7 | account = new Account("LaunchOutModel", DataProc::Center(), 0, this); 8 | account->Subscribe("MusicPlayer"); 9 | account->Subscribe("StatusBar"); 10 | } 11 | 12 | void LaunchOutModel::Deinit() 13 | { 14 | if (account) 15 | { 16 | delete account; 17 | account = nullptr; 18 | } 19 | } 20 | 21 | void LaunchOutModel::PlayMusic(const char* music) 22 | { 23 | DataProc::MusicPlayer_Info_t info; 24 | DATA_PROC_INIT_STRUCT(info); 25 | info.music = music; 26 | account->Notify("MusicPlayer", &info, sizeof(info)); 27 | } 28 | 29 | void LaunchOutModel::SetStatusBarAppear(bool en) 30 | { 31 | DataProc::StatusBar_Info_t info; 32 | DATA_PROC_INIT_STRUCT(info); 33 | info.cmd = DataProc::STATUS_BAR_CMD_APPEAR; 34 | info.param.appear = en; 35 | account->Notify("StatusBar", &info, sizeof(info)); 36 | } 37 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/LaunchOut/LaunchOutModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __LAUNCHOUT_MODEL_H 2 | #define __LAUNCHOUT_MODEL_H 3 | 4 | #include "App/Common/DataProc/DataProc.h" 5 | #include "App/Common/HAL/HAL.h" 6 | 7 | namespace Page 8 | { 9 | 10 | class LaunchOutModel 11 | { 12 | public: 13 | void Init(); 14 | void Deinit(); 15 | void PlayMusic(const char* music); 16 | void SetEncoderEnable(bool en) 17 | { 18 | HAL::Encoder_SetEnable(en); 19 | } 20 | void SetStatusBarAppear(bool en); 21 | 22 | private: 23 | Account* account; 24 | }; 25 | 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/LaunchOut/LaunchOutView.h: -------------------------------------------------------------------------------- 1 | #ifndef __LAUNCHOUT_VIEW_H 2 | #define __LAUNCHOUT_VIEW_H 3 | 4 | #include "../Page.h" 5 | 6 | namespace Page 7 | { 8 | 9 | class LaunchOutView 10 | { 11 | public: 12 | void Create(lv_obj_t* root); 13 | void Delete(); 14 | 15 | public: 16 | struct 17 | { 18 | lv_obj_t *cont; 19 | lv_obj_t *circleFront; 20 | lv_obj_t *circleMiddle; 21 | lv_obj_t *circleBehind; 22 | lv_obj_t *square; 23 | lv_obj_t* labelLogo; 24 | 25 | lv_anim_timeline_t* anim_timeline; 26 | } ui; 27 | 28 | private: 29 | }; 30 | 31 | } 32 | 33 | #endif // !__VIEW_H 34 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/LiveMap/LiveMapModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIVEMAP_MODEL_H 2 | #define __LIVEMAP_MODEL_H 3 | 4 | #include "lvgl.h" 5 | #include "App/Utils/MapConv/MapConv.h" 6 | #include "App/Utils/TileConv/TileConv.h" 7 | #include "App/Utils/TrackFilter/TrackFilter.h" 8 | #include "App/Common/DataProc/DataProc.h" 9 | #include 10 | 11 | namespace Page 12 | { 13 | 14 | class LiveMapModel 15 | { 16 | public: 17 | LiveMapModel(); 18 | ~LiveMapModel() {} 19 | void Init(); 20 | void Deinit(); 21 | void GetGPS_Info(HAL::GPS_Info_t* info); 22 | void GetArrowTheme(char* buf, uint32_t size); 23 | bool GetTrackFilterActive(); 24 | void TrackReload(TrackPointFilter::Callback_t callback, void* userData); 25 | void SetStatusBarStyle(DataProc::StatusBar_Style_t style); 26 | 27 | public: 28 | MapConv mapConv; 29 | TileConv tileConv; 30 | TrackPointFilter pointFilter; 31 | TrackLineFilter lineFilter; 32 | HAL::SportStatus_Info_t sportStatusInfo; 33 | 34 | private: 35 | Account* account; 36 | 37 | private: 38 | static int onEvent(Account* account, Account::EventParam_t* param); 39 | 40 | private: 41 | }; 42 | 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/Page.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * Copyright (c) 2021 _VIFEXTech 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | * SOFTWARE. 22 | */ 23 | #ifndef __PAGE_H 24 | #define __PAGE_H 25 | 26 | #include "lvgl.h" 27 | #include "App/Utils/PageManager/PageManager.h" 28 | #include "App/Utils/lv_ext/lv_obj_ext_func.h" 29 | #include "App/Utils/lv_ext/lv_anim_timeline_wrapper.h" 30 | #include "App/Resource/ResourcePool.h" 31 | #include "App/Pages/StatusBar/StatusBar.h" 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/Popcat/Popcat.h: -------------------------------------------------------------------------------- 1 | #ifndef __POPCAT_PRESENTER_H 2 | #define __POPCAT_PRESENTER_H 3 | 4 | #include "PopcatView.h" 5 | #include "PopcatModel.h" 6 | 7 | namespace Page 8 | { 9 | 10 | class Popcat : public PageBase 11 | { 12 | public: 13 | Popcat(); 14 | virtual ~Popcat(); 15 | 16 | virtual void onCustomAttrConfig(); 17 | virtual void onViewLoad(); 18 | virtual void onViewDidLoad(); 19 | virtual void onViewWillAppear(); 20 | virtual void onViewDidAppear(); 21 | virtual void onViewWillDisappear(); 22 | virtual void onViewDidDisappear(); 23 | virtual void onViewUnload(); 24 | virtual void onViewDidUnload(); 25 | 26 | private: 27 | void Update(); 28 | void AttachEvent(lv_obj_t *obj); 29 | static void onTimerUpdate(lv_timer_t *timer); 30 | static void onEvent(lv_event_t *event); 31 | 32 | private: 33 | PopcatView View; 34 | PopcatModel Model; 35 | lv_timer_t *timer; 36 | }; 37 | 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/Popcat/PopcatModel.cpp: -------------------------------------------------------------------------------- 1 | #include "PopcatModel.h" 2 | 3 | using namespace Page; 4 | 5 | void PopcatModel::Init() 6 | { 7 | account = new Account("PopcatModel", DataProc::Center(), 0, this); // 创建一个账户,注意这里把this传给了userdata 8 | 9 | account->Subscribe("StatusBar"); 10 | 11 | account->SetEventCallback(onEvent); // 设置回调函数,好忙啊 12 | } 13 | 14 | void PopcatModel::Deinit() // 恢复缺省 15 | { 16 | if (account) 17 | { 18 | delete account; // 删除类 19 | account = nullptr; 20 | } 21 | } 22 | 23 | int PopcatModel::onEvent(Account *account, Account::EventParam_t *param) 24 | { 25 | if (param->event != Account::EVENT_PUB_PUBLISH) // 如果发行人/出版社没有发布数据 26 | { 27 | return Account::RES_UNSUPPORTED_REQUEST; // 则返回不支持请求 28 | } 29 | 30 | if (strcmp(param->tran->ID, "StatusBar") != 0) 31 | { 32 | return Account::RES_PARAM_ERROR; 33 | } 34 | 35 | PopcatModel *instance = (PopcatModel *)account->UserData; 36 | 37 | return Account::RES_OK; 38 | } 39 | 40 | void PopcatModel::SetStatusBarStyle(DataProc::StatusBar_Style_t style) 41 | { 42 | DataProc::StatusBar_Info_t info; 43 | DATA_PROC_INIT_STRUCT(info); 44 | 45 | info.cmd = DataProc::STATUS_BAR_CMD_SET_STYLE; 46 | info.param.style = style; 47 | 48 | account->Notify("StatusBar", &info, sizeof(info)); 49 | } 50 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/Popcat/PopcatModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __POPCAT_MODEL_H 2 | #define __POPCAT_MODEL_H 3 | 4 | #include "App/Common/DataProc/DataProc.h" 5 | 6 | #if defined(LV_LVGL_H_INCLUDE_SIMPLE) 7 | #include "lvgl.h" 8 | #else 9 | #include "lvgl.h" 10 | #endif 11 | 12 | namespace Page 13 | { 14 | 15 | class PopcatModel 16 | { 17 | public: 18 | 19 | 20 | public: 21 | void Init(); 22 | void Deinit(); 23 | 24 | void SetStatusBarStyle(DataProc::StatusBar_Style_t style); 25 | 26 | private: 27 | Account *account; 28 | 29 | private: 30 | static int onEvent(Account *account, Account::EventParam_t *param); 31 | }; 32 | 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/Popcat/PopcatView.h: -------------------------------------------------------------------------------- 1 | #ifndef __POPCAT_VIEW_H 2 | #define __POPCAT_VIEW_H 3 | 4 | #include "../Page.h" 5 | 6 | namespace Page 7 | { 8 | 9 | class PopcatView 10 | { 11 | public: 12 | public: 13 | struct 14 | { 15 | 16 | struct 17 | { 18 | lv_obj_t *cont; 19 | lv_obj_t *imgPopCat; 20 | } popcatInfo; 21 | 22 | lv_anim_timeline_t *anim_timeline; 23 | 24 | } ui; 25 | 26 | void Create(lv_obj_t *root); 27 | void Delete(); 28 | void AppearAnimStart(bool reverse = false); 29 | 30 | private: 31 | }; 32 | 33 | } 34 | 35 | #endif // !__VIEW_H 36 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/Settings/Settings.h: -------------------------------------------------------------------------------- 1 | #ifndef __SETTINGS_PRESENTER_H 2 | #define __SETTINGS_PRESENTER_H 3 | 4 | #include "SettingsView.h" 5 | #include "SettingsModel.h" 6 | 7 | namespace Page 8 | { 9 | class Settings : public PageBase // public继承 10 | { 11 | public: 12 | Settings(); // 构造函数 13 | virtual ~Settings(); // 析构函数 14 | 15 | virtual void onCustomAttrConfig(); 16 | virtual void onViewLoad(); 17 | virtual void onViewDidLoad(); 18 | virtual void onViewWillAppear(); 19 | virtual void onViewDidAppear(); 20 | virtual void onViewWillDisappear(); 21 | virtual void onViewDidDisappear(); 22 | virtual void onViewUnload(); 23 | virtual void onViewDidUnload(); 24 | 25 | private: 26 | void Update(); 27 | void AttachEvent(lv_obj_t *obj); 28 | static void onEvent(lv_event_t *event); 29 | static void onTimerUpdate(lv_timer_t *timer); 30 | 31 | void Content_Update(lv_obj_t *obj, const char *text); 32 | void Switch_Update(lv_obj_t *obj, bool isChecked); 33 | void Slider_Update(lv_obj_t *obj, int32_t val); 34 | 35 | public: 36 | static void WiFiSwitchHandler(lv_event_t *event); 37 | static void BLESwitchHandler(lv_event_t *event); 38 | static void DisplaySliderHandler(lv_event_t *event); 39 | static void PowerSwitchHandler(lv_event_t *event); 40 | 41 | private: 42 | SettingsView View; 43 | SettingsModel Model; 44 | lv_timer_t *timer; 45 | }; 46 | 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/SmartAssistant/SmartAssistant.h: -------------------------------------------------------------------------------- 1 | #ifndef __SMARTASSISTANT_PRESENTER_H 2 | #define __SMARTASSISTANT_PRESENTER_H 3 | 4 | #include "SmartAssistantView.h" 5 | #include "SmartAssistantModel.h" 6 | 7 | namespace Page 8 | { 9 | 10 | class SmartAssistant : public PageBase 11 | { 12 | public: 13 | SmartAssistant(); 14 | virtual ~SmartAssistant(); 15 | 16 | virtual void onCustomAttrConfig(); 17 | virtual void onViewLoad(); 18 | virtual void onViewDidLoad(); 19 | virtual void onViewWillAppear(); 20 | virtual void onViewDidAppear(); 21 | virtual void onViewWillDisappear(); 22 | virtual void onViewDidDisappear(); 23 | virtual void onViewUnload(); 24 | virtual void onViewDidUnload(); 25 | 26 | private: 27 | void Update(); 28 | void AttachEvent(lv_obj_t *obj); 29 | static void onTimerUpdate(lv_timer_t *timer); 30 | static void onEvent(lv_event_t *event); 31 | 32 | private: 33 | SmartAssistantView View; 34 | SmartAssistantModel Model; 35 | lv_timer_t *timer; 36 | char text[16] = "THINKING..."; 37 | }; 38 | 39 | } 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/SmartAssistant/SmartAssistantModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __SMARTASSISTANT_MODEL_H 2 | #define __SMARTASSISTANT_MODEL_H 3 | 4 | #include "App/Common/DataProc/DataProc.h" 5 | #include "lvgl.h" 6 | 7 | namespace Page 8 | { 9 | 10 | class SmartAssistantModel 11 | { 12 | public: 13 | public: 14 | void Init(); 15 | void Deinit(); 16 | 17 | void SetStatusBarStyle(DataProc::StatusBar_Style_t style); 18 | void SetSmartAssistantBegin(bool en); 19 | void GetSmartAssistantInfo(char *inputText, char *outputText, bool *isRunning, bool *isListening); 20 | 21 | private: 22 | Account *account; 23 | 24 | private: 25 | static int onEvent(Account *account, Account::EventParam_t *param); 26 | }; 27 | 28 | } 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/SmartAssistant/SmartAssistantView.h: -------------------------------------------------------------------------------- 1 | #ifndef __SMARTASSISTANT_VIEW_H 2 | #define __SMARTASSISTANT_VIEW_H 3 | 4 | #include "../Page.h" 5 | 6 | namespace Page 7 | { 8 | 9 | class SmartAssistantView 10 | { 11 | public: 12 | public: 13 | struct 14 | { 15 | struct 16 | { 17 | lv_obj_t *cont; 18 | lv_obj_t *label; 19 | lv_obj_t *textCont; 20 | lv_obj_t *inputText; 21 | lv_obj_t *outputText; 22 | } labelCont; 23 | 24 | struct 25 | { 26 | lv_obj_t *cont; 27 | lv_obj_t *btn; 28 | } btnCont; 29 | lv_anim_timeline_t *anim_timeline; 30 | lv_anim_timeline_t *anim_timelineClick; 31 | } ui; 32 | 33 | void Create(lv_obj_t *root); 34 | void Delete(); 35 | void AppearAnimStart(bool reverse = false); 36 | void AppearAnimClick(bool reverse = false); 37 | 38 | private: 39 | void LabelCont_Create(lv_obj_t *par); 40 | void BtnCont_Create(lv_obj_t *par); 41 | lv_obj_t *Btn_Create(lv_obj_t *par, const void *img_src, lv_coord_t y_ofs); 42 | lv_obj_t *RoundRect_Create(lv_obj_t *par, lv_coord_t x_ofs, lv_coord_t y_ofs); 43 | }; 44 | 45 | } 46 | 47 | #endif // !__VIEW_H 48 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/StartUp/StartUp.h: -------------------------------------------------------------------------------- 1 | #ifndef __STARTUP_PRESENTER_H 2 | #define __STARTUP_PRESENTER_H 3 | 4 | #include "StartUpView.h" 5 | #include "StartUpModel.h" 6 | 7 | namespace Page 8 | { 9 | 10 | class Startup : public PageBase 11 | { 12 | public: 13 | 14 | public: 15 | Startup(); 16 | virtual ~Startup(); 17 | 18 | virtual void onCustomAttrConfig(); 19 | virtual void onViewLoad(); 20 | virtual void onViewDidLoad(); 21 | virtual void onViewWillAppear(); 22 | virtual void onViewDidAppear(); 23 | virtual void onViewWillDisappear(); 24 | virtual void onViewDidDisappear(); 25 | virtual void onViewUnload(); 26 | virtual void onViewDidUnload(); 27 | 28 | private: 29 | static void onTimer(lv_timer_t* timer); 30 | static void onEvent(lv_event_t* event); 31 | 32 | private: 33 | StartupView View; 34 | StartupModel Model; 35 | }; 36 | 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/StartUp/StartUpModel.cpp: -------------------------------------------------------------------------------- 1 | #include "StartUpModel.h" 2 | 3 | using namespace Page; 4 | 5 | void StartupModel::Init() 6 | { 7 | account = new Account("StartupModel", DataProc::Center(), 0, this); 8 | account->Subscribe("MusicPlayer"); 9 | account->Subscribe("StatusBar"); 10 | } 11 | 12 | void StartupModel::Deinit() 13 | { 14 | if (account) 15 | { 16 | delete account; 17 | account = nullptr; 18 | } 19 | } 20 | 21 | void StartupModel::PlayMusic(const char *music) 22 | { 23 | DataProc::MusicPlayer_Info_t info = {0}; 24 | DATA_PROC_INIT_STRUCT(info); 25 | info.music = music; 26 | account->Notify("MusicPlayer", &info, sizeof(info)); 27 | } 28 | 29 | void StartupModel::SetStatusBarAppear(bool en) 30 | { 31 | DataProc::StatusBar_Info_t info; 32 | DATA_PROC_INIT_STRUCT(info); 33 | info.cmd = DataProc::STATUS_BAR_CMD_APPEAR; 34 | info.param.appear = en; 35 | account->Notify("StatusBar", &info, sizeof(info)); 36 | } 37 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/StartUp/StartUpModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __STARTUP_MODEL_H 2 | #define __STARTUP_MODEL_H 3 | 4 | #include "App/Common/DataProc/DataProc.h" 5 | #include "App/Common/HAL/HAL.h" 6 | 7 | namespace Page 8 | { 9 | 10 | class StartupModel 11 | { 12 | public: 13 | void Init(); 14 | void Deinit(); 15 | void PlayMusic(const char* music); 16 | void SetEncoderEnable(bool en) 17 | { 18 | // HAL::Encoder_SetEnable(en); 19 | } 20 | void SetStatusBarAppear(bool en); 21 | 22 | private: 23 | Account* account; 24 | }; 25 | 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/StartUp/StartUpView.h: -------------------------------------------------------------------------------- 1 | #ifndef __STARTUP_VIEW_H 2 | #define __STARTUP_VIEW_H 3 | 4 | #include "../Page.h" 5 | 6 | namespace Page 7 | { 8 | 9 | class StartupView 10 | { 11 | public: 12 | void Create(lv_obj_t* root); 13 | void Delete(); 14 | 15 | public: 16 | struct 17 | { 18 | lv_obj_t* cont; 19 | lv_obj_t* labelLogo; 20 | 21 | lv_anim_timeline_t* anim_timeline; 22 | } ui; 23 | 24 | private: 25 | }; 26 | 27 | } 28 | 29 | #endif // !__VIEW_H 30 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/StatusBar/StatusBar.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * Copyright (c) 2021 _VIFEXTech 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | * SOFTWARE. 22 | */ 23 | #ifndef __STATUS_BAR_H 24 | #define __STATUS_BAR_H 25 | 26 | #include "lvgl.h" 27 | 28 | namespace Page 29 | { 30 | 31 | lv_obj_t* StatusBar_Create(lv_obj_t* par); 32 | 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/SystemInfos/SystemInfos.h: -------------------------------------------------------------------------------- 1 | #ifndef __SYSTEM_INFOS_PRESENTER_H 2 | #define __SYSTEM_INFOS_PRESENTER_H 3 | 4 | #include "SystemInfosView.h" 5 | #include "SystemInfosModel.h" 6 | 7 | namespace Page 8 | { 9 | 10 | class SystemInfos : public PageBase 11 | { 12 | public: 13 | 14 | public: 15 | SystemInfos(); 16 | virtual ~SystemInfos(); 17 | 18 | virtual void onCustomAttrConfig(); 19 | virtual void onViewLoad(); 20 | virtual void onViewDidLoad(); 21 | virtual void onViewWillAppear(); 22 | virtual void onViewDidAppear(); 23 | virtual void onViewWillDisappear(); 24 | virtual void onViewDidDisappear(); 25 | virtual void onViewUnload(); 26 | virtual void onViewDidUnload(); 27 | 28 | private: 29 | void Update(); 30 | void AttachEvent(lv_obj_t* obj); 31 | static void onTimerUpdate(lv_timer_t* timer); 32 | static void onEvent(lv_event_t* event); 33 | 34 | private: 35 | SystemInfosView View; 36 | SystemInfosModel Model; 37 | lv_timer_t* timer; 38 | }; 39 | 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/SystemInfos/SystemInfosModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __SYSTEM_INFOS_MODEL_H 2 | #define __SYSTEM_INFOS_MODEL_H 3 | 4 | #include "App/Common/DataProc/DataProc.h" 5 | 6 | namespace Page 7 | { 8 | 9 | class SystemInfosModel 10 | { 11 | public: 12 | void Init(); 13 | void Deinit(); 14 | 15 | void GetSportInfo( 16 | float* trip, 17 | char* time, uint32_t len, 18 | float* maxSpd 19 | ); 20 | 21 | void GetGPSInfo( 22 | float* lat, 23 | float* lng, 24 | float* alt, 25 | char* utc, uint32_t len, 26 | float* course, 27 | float* speed 28 | ); 29 | 30 | void GetMAGInfo( 31 | float* dir, 32 | int* x, 33 | int* y, 34 | int* z 35 | ); 36 | 37 | void GetIMUInfo( 38 | int* step, 39 | char* info, uint32_t len 40 | ); 41 | 42 | void GetRTCInfo( 43 | char* dateTime, uint32_t len 44 | ); 45 | 46 | void GetBatteryInfo( 47 | int* usage, 48 | float* voltage, 49 | char* state, uint32_t len 50 | ); 51 | 52 | void GetStorageInfo( 53 | bool* detect, 54 | const char** type, 55 | char* size, uint32_t len 56 | ); 57 | 58 | void SetStatusBarStyle(DataProc::StatusBar_Style_t style); 59 | void SetStatusBarAppear(bool en); 60 | 61 | private: 62 | Account *account; 63 | 64 | private: 65 | 66 | }; 67 | 68 | } 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/WaveTable/WaveTable.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVETABLE_PRESENTER_H 2 | #define __WAVETABLE_PRESENTER_H 3 | 4 | #include "WaveTableView.h" 5 | #include "WaveTableModel.h" 6 | 7 | namespace Page 8 | { 9 | 10 | class WaveTable : public PageBase 11 | { 12 | public: 13 | WaveTable(); 14 | virtual ~WaveTable(); 15 | 16 | virtual void onCustomAttrConfig(); 17 | virtual void onViewLoad(); 18 | virtual void onViewDidLoad(); 19 | virtual void onViewWillAppear(); 20 | virtual void onViewDidAppear(); 21 | virtual void onViewWillDisappear(); 22 | virtual void onViewDidDisappear(); 23 | virtual void onViewUnload(); 24 | virtual void onViewDidUnload(); 25 | 26 | private: 27 | void Update(); 28 | void AttachEvent(lv_obj_t *obj); 29 | static void onTimerUpdate(lv_timer_t *timer); 30 | static void scrollEventCallback(lv_event_t *e); 31 | static void onEvent(lv_event_t *event); 32 | 33 | private: 34 | WaveTableView View; 35 | WaveTableModel Model; 36 | lv_timer_t *timer; 37 | }; 38 | 39 | } 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/WaveTable/WaveTableModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVETABLE_MODEL_H 2 | #define __WAVETABLE_MODEL_H 3 | 4 | #include "App/Common/DataProc/DataProc.h" 5 | #include "lvgl.h" 6 | 7 | namespace Page 8 | { 9 | 10 | class WaveTableModel 11 | { 12 | public: 13 | public: 14 | void Init(); 15 | void Deinit(); 16 | 17 | void SetStatusBarStyle(DataProc::StatusBar_Style_t style); 18 | void SetStatusBarAppear(bool en); 19 | 20 | private: 21 | Account *account; 22 | 23 | private: 24 | static int onEvent(Account *account, Account::EventParam_t *param); 25 | }; 26 | 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/WaveTable/WaveTableView.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVETABLE_VIEW_H 2 | #define __WAVETABLE_VIEW_H 3 | 4 | #include "../Page.h" 5 | 6 | namespace Page 7 | { 8 | class WaveTableView 9 | { 10 | public: 11 | struct btnCont 12 | { 13 | lv_obj_t *btn; 14 | lv_obj_t *img; 15 | lv_obj_t *label; 16 | }; 17 | 18 | public: 19 | struct 20 | { 21 | lv_obj_t *cont; 22 | 23 | btnCont btnA; 24 | btnCont btnB; 25 | btnCont btnC; 26 | btnCont btnD; 27 | btnCont btnE; 28 | btnCont btnF; 29 | btnCont btnG; 30 | 31 | lv_anim_timeline_t *anim_timeline; 32 | } ui; 33 | 34 | void Create(lv_obj_t *root); 35 | void Delete(); 36 | void AppearAnimStart(bool reverse = false); 37 | 38 | private: 39 | void BtnCont_Create(lv_obj_t *par); 40 | void Btn_Create(lv_obj_t *par, btnCont *cont, const char *name, const void *img_src); 41 | }; 42 | 43 | } 44 | 45 | #endif // !__VIEW_H 46 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/_Template/Template.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEMPLATE_PRESENTER_H 2 | #define __TEMPLATE_PRESENTER_H 3 | 4 | #include "TemplateView.h" 5 | #include "TemplateModel.h" 6 | 7 | namespace Page 8 | { 9 | 10 | class Template : public PageBase 11 | { 12 | public: 13 | typedef struct 14 | { 15 | uint16_t time; 16 | lv_color_t color; 17 | } Param_t; 18 | 19 | public: 20 | Template(); 21 | virtual ~Template(); 22 | 23 | virtual void onCustomAttrConfig(); 24 | virtual void onViewLoad(); 25 | virtual void onViewDidLoad(); 26 | virtual void onViewWillAppear(); 27 | virtual void onViewDidAppear(); 28 | virtual void onViewWillDisappear(); 29 | virtual void onViewDidDisappear(); 30 | virtual void onViewUnload(); 31 | virtual void onViewDidUnload(); 32 | 33 | private: 34 | void Update(); 35 | void AttachEvent(lv_obj_t *obj); 36 | static void onTimerUpdate(lv_timer_t* timer); 37 | static void onEvent(lv_event_t* event); 38 | 39 | private: 40 | TemplateView View; 41 | TemplateModel Model; 42 | lv_timer_t* timer; 43 | lv_obj_t *lastFocus; 44 | uint16_t ClickCount; 45 | }; 46 | 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/_Template/TemplateModel.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEMPLATE_MODEL_H 2 | #define __TEMPLATE_MODEL_H 3 | 4 | #include "App/Common/DataProc/DataProc.h" 5 | #include "lvgl.h" 6 | 7 | namespace Page 8 | { 9 | 10 | class TemplateModel 11 | { 12 | public: 13 | uint32_t TickSave; 14 | uint32_t GetData(); 15 | public: 16 | void Init(); 17 | void Deinit(); 18 | 19 | void SetStatusBarStyle(DataProc::StatusBar_Style_t style); 20 | void SetStatusBarAppear(bool en); 21 | 22 | private: 23 | Account *account; 24 | 25 | private: 26 | static int onEvent(Account *account, Account::EventParam_t *param); 27 | }; 28 | 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Pages/_Template/TemplateView.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEMPLATE_VIEW_H 2 | #define __TEMPLATE_VIEW_H 3 | 4 | #include "../Page.h" 5 | 6 | namespace Page 7 | { 8 | 9 | class TemplateView 10 | { 11 | public: 12 | public: 13 | struct 14 | { 15 | struct 16 | { 17 | lv_obj_t *cont; 18 | lv_obj_t *labelHello; 19 | lv_obj_t *labelUint; 20 | } topInfo; 21 | 22 | struct 23 | { 24 | lv_obj_t *cont; 25 | 26 | } bottomInfo; 27 | struct 28 | { 29 | lv_obj_t *cont; 30 | lv_obj_t *btnSayHi; // haha有点直白 31 | lv_obj_t *btnMenu; // 进入菜单 32 | lv_obj_t *labelSayHi; 33 | } btnCont; 34 | 35 | lv_anim_timeline_t *anim_timeline; 36 | lv_anim_timeline_t *anim_timelineForSayHi; 37 | } ui; 38 | 39 | void Create(lv_obj_t *root); 40 | void Delete(); 41 | void AppearAnimStart(bool reverse = false); 42 | void AppearAnimSayHi(bool reverse = false); 43 | 44 | private: 45 | void TopInfo_Create(lv_obj_t *par); 46 | void BottomInfo_Create(lv_obj_t *par); 47 | void BtnCont_Create(lv_obj_t *par); 48 | lv_obj_t *Btn_Create(lv_obj_t *par, const void *img_src, lv_coord_t y_ofs); 49 | }; 50 | 51 | } 52 | 53 | #endif // !__VIEW_H 54 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Resource/ResourcePool.h: -------------------------------------------------------------------------------- 1 | #ifndef __RESOURCE_POOL 2 | #define __RESOURCE_POOL 3 | 4 | #include "lvgl.h" 5 | 6 | namespace ResourcePool 7 | { 8 | 9 | void Init(); 10 | lv_font_t* GetFont(const char* name); 11 | const void* GetImage(const char* name); 12 | 13 | } 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Utils/Filters/Filters.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * Copyright (c) 2021 _VIFEXTech 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | * SOFTWARE. 22 | */ 23 | #ifndef __FILTERS_H 24 | #define __FILTERS_H 25 | 26 | #include "HysteresisFilter.h" 27 | #include "LowpassFilter.h" 28 | #include "MedianFilter.h" 29 | #include "MedianQueueFilter.h" 30 | #include "SlidingFilter.h" 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Utils/GPX/Examples/Static_Track/Static_Track.pde: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | GPX myGPX; 4 | 5 | void setup() 6 | { 7 | // start serial port at 9600 bps: 8 | Serial.begin(9600); 9 | String dumbString(""); 10 | } 11 | 12 | void loop(){ 13 | Serial.print(myGPX.getOpen()); 14 | myGPX.setMetaDesc("foofoofoo"); 15 | myGPX.setName("track name"); 16 | myGPX.setDesc("Track description"); 17 | myGPX.setSrc("SUP500Ff"); 18 | Serial.print(myGPX.getMetaData()); 19 | Serial.print(myGPX.getTrakOpen()); 20 | Serial.print(myGPX.getInfo()); 21 | Serial.print(myGPX.getTrakSegOpen()); 22 | Serial.print(myGPX.getPt(GPX_TRKPT,"41.123","-71.456")); 23 | Serial.print(myGPX.getPt(GPX_TRKPT,"42.123","-72.456")); 24 | Serial.print(myGPX.getPt(GPX_TRKPT,"43.123","-73.456")); 25 | Serial.print(myGPX.getTrakSegClose()); 26 | Serial.print(myGPX.getTrakClose()); 27 | Serial.print(myGPX.getClose()); 28 | delay(10000); 29 | } 30 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Utils/MapConv/GPS_Transform/GPS_Transform.h: -------------------------------------------------------------------------------- 1 | #ifndef __GPS_TRANSFORM_H 2 | #define __GPS_TRANSFORM_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | void GPS_Transform(double wgLat, double wgLon, double* mgLat, double* mgLon); 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Utils/PageManager/PageFactory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * Copyright (c) 2021 _VIFEXTech 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | * SOFTWARE. 22 | */ 23 | #ifndef __PAGE_FACTORY_H 24 | #define __PAGE_FACTORY_H 25 | 26 | #include "PageBase.h" 27 | 28 | class PageFactory 29 | { 30 | public: 31 | 32 | virtual PageBase* CreatePage(const char* name) 33 | { 34 | return nullptr; 35 | }; 36 | }; 37 | 38 | 39 | #endif // !__PAGE_FACTORY_H 40 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Utils/Time/Time.h: -------------------------------------------------------------------------------- 1 | #include "TimeLib.h" 2 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Utils/Time/examples/Processing/SyncArduinoClock/readme.txt: -------------------------------------------------------------------------------- 1 | SyncArduinoClock is a Processing sketch that responds to Arduino requests for 2 | time synchronization messages. 3 | 4 | The portIndex must be set the Serial port connected to Arduino. 5 | 6 | Download TimeSerial.pde onto Arduino and you should see the time 7 | message displayed when you run SyncArduinoClock in Processing. 8 | The Arduino time is set from the time on your computer through the 9 | Processing sketch. 10 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Utils/Time/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For Time 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | time_t KEYWORD1 9 | ####################################### 10 | # Methods and Functions (KEYWORD2) 11 | ####################################### 12 | now KEYWORD2 13 | second KEYWORD2 14 | minute KEYWORD2 15 | hour KEYWORD2 16 | day KEYWORD2 17 | month KEYWORD2 18 | year KEYWORD2 19 | isAM KEYWORD2 20 | isPM KEYWORD2 21 | weekday KEYWORD2 22 | setTime KEYWORD2 23 | adjustTime KEYWORD2 24 | setSyncProvider KEYWORD2 25 | setSyncInterval KEYWORD2 26 | timeStatus KEYWORD2 27 | TimeLib KEYWORD2 28 | ####################################### 29 | # Instances (KEYWORD2) 30 | ####################################### 31 | 32 | ####################################### 33 | # Constants (LITERAL1) 34 | ####################################### 35 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Utils/Time/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Time", 3 | "frameworks": "Arduino", 4 | "keywords": "Time, date, hour, minute, second, day, week, month, year, RTC", 5 | "description": "Time keeping library", 6 | "url": "http://playground.arduino.cc/Code/Time", 7 | "authors": 8 | [ 9 | { 10 | "name": "Michael Margolis" 11 | }, 12 | { 13 | "name": "Paul Stoffregen" 14 | } 15 | ], 16 | "repository": 17 | { 18 | "type": "git", 19 | "url": "https://github.com/PaulStoffregen/Time" 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Utils/Time/library.properties: -------------------------------------------------------------------------------- 1 | name=Time 2 | version=1.5 3 | author=Michael Margolis 4 | maintainer=Paul Stoffregen 5 | sentence=Timekeeping functionality for Arduino 6 | paragraph=Date and Time functions, with provisions to synchronize to external time sources like GPS and NTP (Internet). This library is often used together with TimeAlarms and DS1307RTC. 7 | category=Timing 8 | url=http://playground.arduino.cc/code/time 9 | architectures=* 10 | 11 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Utils/TrackFilter/TrackFilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * Copyright (c) 2021 _VIFEXTech 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | * SOFTWARE. 22 | */ 23 | #ifndef __TRACK_FILTER_H 24 | #define __TRACK_FILTER_H 25 | 26 | #include "TrackPointFilter.h" 27 | #include "TrackLineFilter.h" 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Utils/lv_ext/lv_anim_timeline_wrapper.c: -------------------------------------------------------------------------------- 1 | #include "lv_anim_timeline_wrapper.h" 2 | 3 | void lv_anim_timeline_add_wrapper(lv_anim_timeline_t* at, const lv_anim_timeline_wrapper_t* wrapper) 4 | { 5 | for(uint32_t i = 0; wrapper[i].obj != NULL; i++) 6 | { 7 | const lv_anim_timeline_wrapper_t* atw = &wrapper[i]; 8 | 9 | lv_anim_t a; 10 | lv_anim_init(&a); 11 | lv_anim_set_var(&a, atw->obj); 12 | lv_anim_set_values(&a, atw->start, atw->end); 13 | lv_anim_set_exec_cb(&a, atw->exec_cb); 14 | lv_anim_set_time(&a, atw->duration); 15 | lv_anim_set_path_cb(&a, atw->path_cb); 16 | lv_anim_set_early_apply(&a, atw->early_apply); 17 | 18 | lv_anim_timeline_add(at, atw->start_time, &a); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Utils/lv_ext/lv_anim_timeline_wrapper.h: -------------------------------------------------------------------------------- 1 | #ifndef LV_ANIM_TIMELINE_WRAPPER_H 2 | #define LV_ANIM_TIMELINE_WRAPPER_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include "lvgl.h" 9 | 10 | /*Data of anim_timeline*/ 11 | typedef struct { 12 | uint32_t start_time; 13 | lv_obj_t* obj; 14 | lv_anim_exec_xcb_t exec_cb; 15 | int32_t start; 16 | int32_t end; 17 | uint16_t duration; 18 | lv_anim_path_cb_t path_cb; 19 | bool early_apply; 20 | } lv_anim_timeline_wrapper_t; 21 | 22 | /********************** 23 | * GLOBAL PROTOTYPES 24 | **********************/ 25 | 26 | /** 27 | * Start animation according to the timeline 28 | * @param anim_timeline timeline array address 29 | * @param playback whether to play in reverse 30 | * @return timeline total time spent 31 | */ 32 | void lv_anim_timeline_add_wrapper(lv_anim_timeline_t* at, const lv_anim_timeline_wrapper_t* wrapper); 33 | 34 | /********************** 35 | * MACROS 36 | **********************/ 37 | 38 | #define LV_ANIM_TIMELINE_WRAPPER_END {0, NULL} 39 | 40 | #ifdef __cplusplus 41 | } /*extern "C"*/ 42 | #endif 43 | 44 | #endif /*LV_ANIM_TIMELINE_wrapper_H*/ 45 | -------------------------------------------------------------------------------- /2.Firmware/src/App/Utils/lv_poly_line/lv_poly_line.h: -------------------------------------------------------------------------------- 1 | #ifndef LV_POLY_LINE_H 2 | #define LV_POLY_LINE_H 3 | 4 | #include "lvgl.h" 5 | #include 6 | 7 | class lv_poly_line 8 | { 9 | public: 10 | lv_poly_line(lv_obj_t* par); 11 | ~lv_poly_line(); 12 | 13 | void set_style(lv_style_t* style) 14 | { 15 | styleLine = style; 16 | } 17 | 18 | void start(); 19 | void append(const lv_point_t* point); 20 | void append(lv_coord_t x, lv_coord_t y) 21 | { 22 | lv_point_t point = { x, y }; 23 | append(&point); 24 | } 25 | void append_to_end(const lv_point_t* point); 26 | void append_to_end(lv_coord_t x, lv_coord_t y) 27 | { 28 | lv_point_t point = { x, y }; 29 | append_to_end(&point); 30 | } 31 | void stop(); 32 | void reset(); 33 | bool get_end_point(lv_point_t* point); 34 | 35 | private: 36 | typedef struct 37 | { 38 | lv_obj_t* line; 39 | std::vector points; 40 | } single_line_t; 41 | 42 | private: 43 | void add_line(); 44 | void refresh_line(); 45 | single_line_t* get_end_line(); 46 | const lv_point_t* get_points(single_line_t* single_line); 47 | 48 | private: 49 | std::vector poly_line; 50 | uint32_t current_index; 51 | lv_style_t* styleLine; 52 | lv_obj_t* parent; 53 | }; 54 | 55 | #endif // !LV_POLY_LINE_H 56 | -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/Button/Button/Button.h: -------------------------------------------------------------------------------- 1 | /* 2 | Button - a small library for Arduino to handle button debouncing 3 | 4 | MIT licensed. 5 | */ 6 | 7 | #ifndef Button_h 8 | #define Button_h 9 | #include "Arduino.h" 10 | 11 | class __Button 12 | { 13 | public: 14 | __Button(uint8_t pin, uint16_t debounce_ms = 100); 15 | void begin(); 16 | bool read(); 17 | bool toggled(); 18 | bool pressed(); 19 | bool released(); 20 | bool has_changed(); 21 | 22 | const static bool PRESSED = LOW; 23 | const static bool RELEASED = HIGH; 24 | 25 | private: 26 | uint8_t _pin; 27 | uint16_t _delay; 28 | bool _state; 29 | uint32_t _ignore_until; 30 | bool _has_changed; 31 | }; 32 | 33 | #endif -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/Button/EmmaButton.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file EmmaButton.hpp 3 | * @author Forairaaaaa 4 | * @brief 5 | * @version 0.1 6 | * @date 2023-02-20 7 | * 8 | * @copyright Copyright (c) 2023 9 | * 10 | */ 11 | #pragma once 12 | // #include "../../EmmaConfig.h" 13 | 14 | /* Enable module Button */ 15 | #define EMMA_MODULE_BUTTON 1 16 | #if EMMA_MODULE_BUTTON 17 | /* Set pin -1 to disable */ 18 | #define EMMA_BTN_A_PIN -1 19 | #define EMMA_BTN_B_PIN 0 20 | #define EMMA_BTN_C_PIN -1 21 | /* Add more button in "Button/EmmaButton.hpp" */ 22 | #endif 23 | 24 | #include "Button/Button.h" 25 | #if EMMA_MODULE_BUTTON 26 | 27 | /* Add your button with this */ 28 | #define Button_Add(name, pin) __Button name = __Button(pin) 29 | 30 | class EmmaButton { 31 | private: 32 | public: 33 | 34 | #if EMMA_BTN_A_PIN >= 0 35 | Button_Add(A, EMMA_BTN_A_PIN); 36 | #endif 37 | 38 | #if EMMA_BTN_B_PIN >= 0 39 | Button_Add(B, EMMA_BTN_B_PIN); 40 | #endif 41 | 42 | #if EMMA_BTN_C_PIN >= 0 43 | Button_Add(C, EMMA_BTN_C_PIN); 44 | #endif 45 | 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/ChappieCore_config.h: -------------------------------------------------------------------------------- 1 | #ifndef _CHAPPIECORE_CONFIG_H_ 2 | #define _CHAPPIECORE_CONFIG_H_ 3 | 4 | /* Config */ 5 | #define FIRMWARE_NAME "[EasyGPS]" 6 | #define VERSION_SOFTWARE "v1.2" 7 | #define VERSION_HARDWARE "v1.4" 8 | #define VERSION_AUTHOR_NAME "kkl" 9 | 10 | #define CHAPPIE_CORE_USE_LVGL_WITHOUT_RTOS 0 // 宏:是否使用RTOS执行LVGL 11 | #define CHAPPIE_CORE_LVGL_USE_PSRAM 1 // 宏:是否使用片外RAM作为LVGL的缓存Buffer 12 | #define CHAPPIE_CORE_USE_BLE 1 // 宏:是否使用蓝牙 13 | 14 | // #define CHAPPIE_CORE_LVGL_DIS_PORTRAIT 0 15 | 16 | #endif -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/GPS/ChappieGPS.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ChappieGPS.hpp 3 | * @author kkl 4 | * @brief Reference: https://github.com/mikalhart/TinyGPSPlus 5 | * @version 0.1 6 | * @date 2023-04-16 7 | * 8 | * @copyright Copyright (c) 2024 9 | * 10 | */ 11 | #pragma once 12 | #include 13 | #include "TinyGPS++.h" 14 | 15 | #define GPS_SERIAL Serial1 16 | #define DEBUG_SERIAL Serial 17 | #define GPS_USE_TRANSPARENT 0 18 | 19 | #define GPS_ENABLE_PIN 18 20 | 21 | class ChappieGPS : public TinyGPSPlus 22 | { 23 | private: 24 | public: 25 | ChappieGPS() {} 26 | ~ChappieGPS() {} 27 | 28 | inline void init() 29 | { 30 | // describe version 31 | printf("GPS: TinyGPS++ library v. "); 32 | printf(TinyGPSPlus::libraryVersion()); 33 | printf(" by Mikal Hart\r\n"); 34 | 35 | // en 36 | enable(); 37 | 38 | delay(1000); 39 | 40 | // initialize 41 | GPS_SERIAL.begin(9600); 42 | } 43 | 44 | /* For hardware enable pin if exist */ 45 | inline void enable() { setCtrlPin(0); } 46 | inline void disable() { setCtrlPin(1); } 47 | inline void setCtrlPin(uint8_t level) 48 | { 49 | gpio_reset_pin((gpio_num_t)GPS_ENABLE_PIN); 50 | gpio_set_direction((gpio_num_t)GPS_ENABLE_PIN, GPIO_MODE_OUTPUT_OD); 51 | gpio_set_level((gpio_num_t)GPS_ENABLE_PIN, level); 52 | } 53 | }; 54 | -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/Lvgl/demos/benchmark/lv_demo_benchmark.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_demo_benchmark.h 3 | * 4 | */ 5 | 6 | #ifndef LV_DEMO_BENCHMARK_H 7 | #define LV_DEMO_BENCHMARK_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../lv_demos.h" 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | /********************** 23 | * TYPEDEFS 24 | **********************/ 25 | typedef void finished_cb_t(void); 26 | 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | void lv_demo_benchmark(void); 32 | 33 | void lv_demo_benchmark_run_scene(int_fast16_t scene_no); 34 | 35 | void lv_demo_benchmark_set_finished_cb(finished_cb_t * finished_cb); 36 | 37 | /** 38 | * Make the benchmark work at the highest frame rate 39 | * @param en true: highest frame rate; false: default frame rate 40 | */ 41 | void lv_demo_benchmark_set_max_speed(bool en); 42 | 43 | /********************** 44 | * MACROS 45 | **********************/ 46 | 47 | #ifdef __cplusplus 48 | } /* extern "C" */ 49 | #endif 50 | 51 | #endif /*LV_DEMO_BENCHMARK_H*/ 52 | -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/Lvgl/demos/keypad_encoder/README.md: -------------------------------------------------------------------------------- 1 | # Keypad and Encoder demo 2 | 3 | ## Overview 4 | 5 | LVGL allows you to control the widgets with keypad and/or encoder without touchpad. 6 | This demo shows how to handle buttons, drop-down lists, rollers, sliders, switches and text inputs without touchpad. 7 | Learn more about the touchpad-less usage of LVGL [here](https://docs.lvgl.io/master/overview/indev.html#keypad-and-encoder). 8 | 9 | ![Keypad and encoder navigation in LVGL embedded GUI library](screenshot1.gif) 10 | 11 | ## Run the demo 12 | - In `lv_conf.h` or equivalent places set `LV_USE_DEMO_KEYPAD_AND_ENCODER 1` 13 | - After `lv_init()` and initializing the drivers call `lv_demo_keypad_encoder()` 14 | -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/Lvgl/demos/keypad_encoder/lv_demo_keypad_encoder.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_demo_keypad_encoder.h 3 | * 4 | */ 5 | 6 | #ifndef LV_DEMO_KEYPAD_ENCODER_H 7 | #define LV_DEMO_KEYPAD_ENCODER_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../lv_demos.h" 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | /********************** 23 | * TYPEDEFS 24 | **********************/ 25 | 26 | /********************** 27 | * GLOBAL PROTOTYPES 28 | **********************/ 29 | void lv_demo_keypad_encoder(void); 30 | 31 | /********************** 32 | * MACROS 33 | **********************/ 34 | 35 | #ifdef __cplusplus 36 | } /* extern "C" */ 37 | #endif 38 | 39 | #endif /*LV_DEMO_KEYPAD_ENCODER_H*/ 40 | -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/Lvgl/demos/lv_demos.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_demos.h 3 | * 4 | */ 5 | 6 | #ifndef LV_DEMOS_H 7 | #define LV_DEMOS_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../lvgl.h" 17 | 18 | #if LV_USE_DEMO_WIDGETS 19 | #include "widgets/lv_demo_widgets.h" 20 | #endif 21 | 22 | #if LV_USE_DEMO_BENCHMARK 23 | #include "benchmark/lv_demo_benchmark.h" 24 | #endif 25 | 26 | #if LV_USE_DEMO_STRESS 27 | #include "stress/lv_demo_stress.h" 28 | #endif 29 | 30 | #if LV_USE_DEMO_KEYPAD_AND_ENCODER 31 | #include "keypad_encoder/lv_demo_keypad_encoder.h" 32 | #endif 33 | 34 | #if LV_USE_DEMO_MUSIC 35 | #include "music/lv_demo_music.h" 36 | #endif 37 | 38 | /********************* 39 | * DEFINES 40 | *********************/ 41 | 42 | /********************** 43 | * TYPEDEFS 44 | **********************/ 45 | 46 | /********************** 47 | * GLOBAL PROTOTYPES 48 | **********************/ 49 | 50 | 51 | /********************** 52 | * MACROS 53 | **********************/ 54 | 55 | #ifdef __cplusplus 56 | } /* extern "C" */ 57 | #endif 58 | 59 | #endif /*LV_DEMO_H*/ 60 | -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/Lvgl/demos/lv_demos.mk: -------------------------------------------------------------------------------- 1 | CSRCS += $(shell find -L $(LVGL_DIR)/$(LVGL_DIR_NAME)/demos -name "*.c") 2 | -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/Lvgl/demos/stress/README.md: -------------------------------------------------------------------------------- 1 | # Stress demo 2 | 3 | ## Overview 4 | 5 | A stress test for LVGL. 6 | It contains a lot of object creation, deletion, animations, styles usage, and so on. It can be used if there is any memory corruption during heavy usage or any memory leaks. 7 | 8 | ![Stress demo with LVGL embedded GUI library](screenshot1.gif) 9 | 10 | ## Run the demo 11 | - In `lv_conf.h` or equivalent places set `LV_USE_DEMO_STRESS 1` 12 | - In `lv_conf.h` enable all the widgets (`LV_USE_BTN 1`) and the animations (`LV_USE_ANIMATION 1`) 13 | - After `lv_init()` and initializing the drivers call `lv_demo_stress()` 14 | -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/Lvgl/demos/stress/lv_demo_stress.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_demo_stress.h 3 | * 4 | */ 5 | 6 | #ifndef LV_DEMO_STRESS_H 7 | #define LV_DEMO_STRESS_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../lv_demos.h" 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | #define LV_DEMO_STRESS_TIME_STEP 50 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | void lv_demo_stress(void); 32 | 33 | /********************** 34 | * MACROS 35 | **********************/ 36 | 37 | #ifdef __cplusplus 38 | } /* extern "C" */ 39 | #endif 40 | 41 | #endif /*LV_DEMO_STRESS_H*/ 42 | -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/Lvgl/demos/widgets/lv_demo_widgets.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_demo_widgets.h 3 | * 4 | */ 5 | 6 | #ifndef LV_DEMO_WIDGETS_H 7 | #define LV_DEMO_WIDGETS_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../lv_demos.h" 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | /********************** 23 | * TYPEDEFS 24 | **********************/ 25 | 26 | /********************** 27 | * GLOBAL PROTOTYPES 28 | **********************/ 29 | void lv_demo_widgets(void); 30 | 31 | /********************** 32 | * MACROS 33 | **********************/ 34 | 35 | #ifdef __cplusplus 36 | } /* extern "C" */ 37 | #endif 38 | 39 | #endif /*LV_DEMO_WIDGETS_H*/ 40 | -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/Lvgl/lvgl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lvgl.h 3 | * @author Forairaaaaa 4 | * @brief Fake lvgl.h to cheat demos 5 | * @version 0.1 6 | * @date 2023-03-11 7 | * 8 | * @copyright Copyright (c) 2023 9 | * 10 | */ 11 | #pragma once 12 | #include 13 | -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/Lvgl/porting/lv_port_fs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_port_fs_templ.h 3 | * 4 | */ 5 | 6 | /*Copy this file as "lv_port_fs.h" and set this value to "1" to enable content*/ 7 | #if 1 8 | 9 | #ifndef LV_PORT_FS_TEMPL_H 10 | #define LV_PORT_FS_TEMPL_H 11 | 12 | #ifdef __cplusplus 13 | // extern "C" { 14 | #endif 15 | 16 | /********************* 17 | * INCLUDES 18 | *********************/ 19 | // #include "lvgl/lvgl.h" 20 | #include 21 | 22 | /********************* 23 | * DEFINES 24 | *********************/ 25 | 26 | /********************** 27 | * TYPEDEFS 28 | **********************/ 29 | 30 | /********************** 31 | * GLOBAL PROTOTYPES 32 | **********************/ 33 | // void lv_port_fs_init(void); 34 | void lv_fs_fatfs_init(void); 35 | 36 | /********************** 37 | * MACROS 38 | **********************/ 39 | 40 | #ifdef __cplusplus 41 | // } /*extern "C"*/ 42 | #endif 43 | 44 | #endif /*LV_PORT_FS_TEMPL_H*/ 45 | 46 | #endif /*Disable/Enable content*/ 47 | -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/Lvgl/porting/lv_port_indev.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @file lv_port_indev_templ.h 4 | * 5 | */ 6 | 7 | /*Copy this file as "lv_port_indev.h" and set this value to "1" to enable content*/ 8 | #if 1 9 | 10 | #ifndef LV_PORT_INDEV_TEMPL_H 11 | #define LV_PORT_INDEV_TEMPL_H 12 | 13 | #ifdef __cplusplus 14 | // extern "C" { 15 | #endif 16 | 17 | /********************* 18 | * INCLUDES 19 | *********************/ 20 | // #include "lvgl/lvgl.h" 21 | #include "lvgl.h" 22 | #include "../../CTP/ChappieCTP.hpp" 23 | 24 | /********************* 25 | * DEFINES 26 | *********************/ 27 | 28 | /********************** 29 | * TYPEDEFS 30 | **********************/ 31 | 32 | /********************** 33 | * GLOBAL PROTOTYPES 34 | **********************/ 35 | // void lv_port_indev_init(void); 36 | void lv_port_indev_init(ChappieCTP *tp); 37 | 38 | /********************** 39 | * MACROS 40 | **********************/ 41 | 42 | #ifdef __cplusplus 43 | // } /*extern "C"*/ 44 | #endif 45 | 46 | #endif /*LV_PORT_INDEV_TEMPL_H*/ 47 | 48 | #endif /*Disable/Enable content*/ 49 | -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/MAG/ChappieMAG.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ChappieMAG.hpp 3 | * @author kkl 4 | * @brief Reference: https://github.com/mprograms/QMC5883LCompass 5 | * @version 0.1 6 | * @date 2024-03-30 7 | * 8 | * @copyright Copyright (c) 2024 9 | * 10 | */ 11 | #pragma once 12 | #include 13 | #include 14 | #include 15 | 16 | class ChappieMAG : public QMC5883LCompass 17 | { 18 | private: 19 | public: 20 | ChappieMAG() {} 21 | ~ChappieMAG() {} 22 | 23 | inline void init() 24 | { 25 | // initialize device 26 | QMC5883LCompass::init(); 27 | QMC5883LCompass::setSmoothing(10, true); 28 | setMagneticDeclination(-3, 0); 29 | printf("[MAG] init!\r\n"); 30 | } 31 | 32 | /** 33 | * @brief Set Mag to sleep 34 | * 35 | * @param en 36 | * @return none 37 | */ 38 | inline void sleep(bool en) 39 | { 40 | if (!en) 41 | return; // en == false 42 | // reset device 43 | QMC5883LCompass::setReset(); 44 | QMC5883LCompass::setMode(0, 0, 0, 0); 45 | } 46 | }; 47 | -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/RGBLED/EmmaRGBLED.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file EmmaRGBLED.hpp 3 | * @author Forairaaaaa 4 | * @brief 5 | * @version 0.1 6 | * @date 2023-02-18 7 | * 8 | * @copyright Copyright (c) 2023 9 | * 10 | */ 11 | #pragma once 12 | // #include "../../EmmaConfig.h" 13 | 14 | /* Enable module RGB led */ 15 | /* Require: https://github.com/FastLED/FastLED.git */ 16 | #define EMMA_MODULE_RGB_LED 1 17 | #if EMMA_MODULE_RGB_LED 18 | #define EMMA_RGBLED_PIN 14 19 | #define EMMA_RGBLED_NUM 1 20 | #endif 21 | 22 | #if EMMA_MODULE_RGB_LED 23 | #include "FastLED.h" 24 | #include "esp32-hal-log.h" 25 | 26 | #define TAG_RGBLED "RGBLED" 27 | 28 | 29 | class EmmaRGBLED 30 | { 31 | private: 32 | public: 33 | CRGB* leds; 34 | 35 | EmmaRGBLED() 36 | { 37 | ESP_LOGI(TAG_RGBLED, "init..."); 38 | 39 | leds = (CRGB*)malloc(sizeof(CRGB) * EMMA_RGBLED_NUM); 40 | if (leds == NULL) { 41 | ESP_LOGE(TAG_RGBLED, "malloc failed!"); 42 | while (1); 43 | } 44 | 45 | // FastLED.addLeds(leds, EMMA_RGBLED_NUM); 46 | FastLED.addLeds(leds, EMMA_RGBLED_NUM); 47 | ESP_LOGI(TAG_RGBLED, "success!"); 48 | } 49 | 50 | ~EmmaRGBLED() { free(leds); } 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/SmartAssistantAPI/BaiduASR/BaiduASR.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BaiduSST.h 3 | * @author kkl 4 | * @brief 5 | * @version 0.1 6 | * @date 2024-04-06 7 | * 8 | * @copyright Copyright (c) 2024 9 | * 10 | */ 11 | 12 | #pragma once 13 | 14 | #include 15 | #include 16 | #include 17 | #include // 用于参数数据的 18 | #include "base64.h" 19 | 20 | class BaiduASR 21 | { 22 | 23 | public: 24 | BaiduASR() {} 25 | BaiduASR(char *payLoad) : _payLoad(payLoad) {} 26 | ~BaiduASR() { _payLoad = nullptr; } 27 | 28 | void init(char *payLoad) 29 | { 30 | // load param 加载变量 31 | _payLoad = payLoad; 32 | getToken(); 33 | } 34 | 35 | String getRecognitionResult(int16_t *rawdata, uint32_t len); 36 | 37 | void getToken(void); 38 | 39 | void gainToken(void); 40 | 41 | private: 42 | char *_payLoad = nullptr; 43 | String _token = ""; 44 | String apiASRUrl = "https://vop.baidu.com/pro_api"; 45 | // http://vop.baidu.com/server_api # 标准版 46 | // https://vop.baidu.com/pro_api # 极速版 47 | }; 48 | 49 | /** 50 | * @brief Define the way to format logout 51 | * 52 | */ 53 | #define _LOG(format, args...) printf(format, ##args) 54 | -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/SmartAssistantAPI/BaiduErnieBot/BaiduErnieBot.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BaiduErnieBot.h 3 | * @author kkl 4 | * @brief 5 | * @version 0.1 6 | * @date 2024-04-06 7 | * 8 | * @copyright Copyright (c) 2024 9 | * 10 | */ 11 | 12 | #pragma once 13 | 14 | #include 15 | #include 16 | #include 17 | #include // 用于参数数据的 18 | 19 | class BaiduErnieBot 20 | { 21 | 22 | public: 23 | BaiduErnieBot() {} 24 | ~BaiduErnieBot() {} 25 | 26 | void init(void) 27 | { 28 | // load param 加载变量 29 | getToken(); 30 | } 31 | 32 | String getResponse(String inputText); 33 | 34 | void getToken(void); 35 | 36 | void gainToken(void); 37 | 38 | private: 39 | // String _token = "24.a5491e2c24a7530134953afb40aa0a23.2592000.1718098342.282335-57964024"; 40 | String _token = ""; 41 | String apiErnieBotUrl = "https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions?access_token="; 42 | // https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions // ERNIE-3.5-8K 43 | // https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions_pro // ERNIE-4.0-8K 44 | }; 45 | 46 | /** 47 | * @brief Define the way to format logout 48 | * 49 | */ 50 | #define _LOG(format, args...) printf(format, ##args) 51 | -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/SmartAssistantAPI/BaiduTTS/BaiduTTS.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BaiduTTS.h 3 | * @author kkl 4 | * @brief 5 | * @version 0.1 6 | * @date 2024-04-07 7 | * 8 | * @copyright Copyright (c) 2024 9 | * 10 | */ 11 | 12 | #pragma once 13 | 14 | #include 15 | #include 16 | #include 17 | #include // 用于参数数据的 18 | 19 | class BaiduTTS 20 | { 21 | 22 | public: 23 | BaiduTTS() {} 24 | BaiduTTS(char *payLoad) : _payLoad(payLoad) {} 25 | ~BaiduTTS() { _payLoad = nullptr; } 26 | 27 | void init(char *payLoad) 28 | { 29 | // load param 加载变量 30 | _payLoad = payLoad; 31 | getToken(); 32 | } 33 | 34 | bool getSynthesis(String inputText, int16_t *rawData, int32_t *len); 35 | 36 | void getToken(void); 37 | 38 | void gainToken(void); 39 | 40 | private: 41 | char *_payLoad = nullptr; 42 | String _token = ""; 43 | String apiTTSUrl = "http://tsn.baidu.com/text2audio"; 44 | }; 45 | 46 | /** 47 | * @brief Define the way to format logout 48 | * 49 | */ 50 | #define _LOG(format, args...) printf(format, ##args) 51 | -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/SmartAssistantAPI/MiniMaxLlm/MiniMaxLlm.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file MiniMaxLlm.h 3 | * @author kkl 4 | * @brief 5 | * @version 0.1 6 | * @date 2024-05-06 7 | * 8 | * @copyright Copyright (c) 2024 9 | * 10 | */ 11 | 12 | #pragma once 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | class MiniMaxLlm 19 | { 20 | 21 | public: 22 | MiniMaxLlm() {} 23 | ~MiniMaxLlm() {} 24 | 25 | String getResponse(String inputText); 26 | 27 | String getToken(void); 28 | 29 | private: 30 | const String apiKey = "xxxxxxxxxxxxxxxxxxxI1NiIsInR5cCI6IkpXVCJ9.eyJHcm91cE5hbWUiOiJDaGVuc2hhbiIsIlVzZXJOYW1lIjoiQ2hlbnNoYW4iLCJBY2NvdW50IjoiIiwiU3ViamVjdElEIjoiMTc4MjU4ODUwOTcwNjUyMjkxMSIsIlBob25lIjoiMTMyNDYxNjYyMTAiLCJHcm91cElEIjoiMTc4MjU4ODUwOTY5ODEzNDMwMyIsIlBhZ2VOYW1lIjoiIiwiTWFpbCI6IiIsIkNyZWF0ZVRpbWUiOiIyMDI0LTA1LTA2IDIyOjM0OjM4IiwiaXNzIjoibWluaW1heCJ9.D_rzFIdaHRBvQ68XCgYKNWs5DkupWPW8RApkDwjWE9A43StEi04Y_UxdFzYABVVce3EJNxL0mSc3nzDN1-0U_QmkJvjGUFioA81tcoGnDn-EWitv7h70xBmQraqc2-zc8rXW8nKYNA5hLMMA5j35whNLqwEBnMgbCrWUNLfmd1TfY80m1uLCErwzlvhh8Hd2EkXLq0SQLWCdbBlHy2Gw9EYle_osy_kvPJhl7mmRmQej1IfQrZUaP5y7bXznGG3gSluT85NOzSCRHOhFSIUQMTUJOInaoFVH37-Tgd2-mkM4MKF9koseg3SmgVxLmTmsZQK4U57BLUeZo1Qbfla3tw"; 31 | const String apiUrl = "https://api.minimax.chat/v1/text/chatcompletion_v2"; 32 | }; 33 | 34 | /** 35 | * @brief Define the way to format logout 36 | * 37 | */ 38 | #define _LOG(format, args...) printf(format, ##args) 39 | -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/Utility/Adafruit_BusIO/Adafruit_I2CDevice.h: -------------------------------------------------------------------------------- 1 | #ifndef Adafruit_I2CDevice_h 2 | #define Adafruit_I2CDevice_h 3 | 4 | #include 5 | #include 6 | 7 | ///< The class which defines how we will talk to this device over I2C 8 | class Adafruit_I2CDevice { 9 | public: 10 | Adafruit_I2CDevice(uint8_t addr, TwoWire *theWire = &Wire); 11 | uint8_t address(void); 12 | bool begin(bool addr_detect = true); 13 | void end(void); 14 | bool detected(void); 15 | 16 | bool read(uint8_t *buffer, size_t len, bool stop = true); 17 | bool write(const uint8_t *buffer, size_t len, bool stop = true, 18 | const uint8_t *prefix_buffer = nullptr, size_t prefix_len = 0); 19 | bool write_then_read(const uint8_t *write_buffer, size_t write_len, 20 | uint8_t *read_buffer, size_t read_len, 21 | bool stop = false); 22 | bool setSpeed(uint32_t desiredclk); 23 | 24 | /*! @brief How many bytes we can read in a transaction 25 | * @return The size of the Wire receive/transmit buffer */ 26 | size_t maxBufferSize() { return _maxBufferSize; } 27 | 28 | private: 29 | uint8_t _addr; 30 | TwoWire *_wire; 31 | bool _begun; 32 | size_t _maxBufferSize; 33 | bool _read(uint8_t *buffer, size_t len, bool stop); 34 | }; 35 | 36 | #endif // Adafruit_I2CDevice_h 37 | -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/Utility/Adafruit_BusIO/Adafruit_I2CRegister.h: -------------------------------------------------------------------------------- 1 | #ifndef _ADAFRUIT_I2C_REGISTER_H_ 2 | #define _ADAFRUIT_I2C_REGISTER_H_ 3 | 4 | #include 5 | #include 6 | 7 | typedef Adafruit_BusIO_Register Adafruit_I2CRegister; 8 | typedef Adafruit_BusIO_RegisterBits Adafruit_I2CRegisterBits; 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/Utility/Adafruit_BusIO/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Adafruit Industries 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/Utility/Adafruit_BusIO/README.md: -------------------------------------------------------------------------------- 1 | # Adafruit Bus IO Library [![Build Status](https://github.com/adafruit/Adafruit_BusIO/workflows/Arduino%20Library%20CI/badge.svg)](https://github.com/adafruit/Adafruit_BusIO/actions) 2 | 3 | 4 | This is a helper library to abstract away I2C & SPI transactions and registers 5 | 6 | Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! 7 | 8 | MIT license, all text above must be included in any redistribution 9 | -------------------------------------------------------------------------------- /2.Firmware/src/ChappieCore/Utility/BM8563/I2C_BM8563.h: -------------------------------------------------------------------------------- 1 | #ifndef __I2C_BM8563_H__ 2 | #define __I2C_BM8563_H__ 3 | 4 | #include 5 | 6 | #define I2C_BM8563_DEFAULT_ADDRESS 0x51 7 | 8 | typedef struct 9 | { 10 | int8_t hours; 11 | int8_t minutes; 12 | int8_t seconds; 13 | } I2C_BM8563_TimeTypeDef; 14 | 15 | typedef struct 16 | { 17 | int8_t weekDay; 18 | int8_t month; 19 | int8_t date; 20 | int16_t year; 21 | } I2C_BM8563_DateTypeDef; 22 | 23 | class I2C_BM8563 { 24 | public: 25 | I2C_BM8563(uint8_t deviceAddress = I2C_BM8563_DEFAULT_ADDRESS, TwoWire &i2cPort = Wire); 26 | 27 | void begin(void); 28 | bool getVoltLow(); 29 | 30 | void getTime(I2C_BM8563_TimeTypeDef* I2C_BM8563_TimeStruct); 31 | void getDate(I2C_BM8563_DateTypeDef* I2C_BM8563_DateStruct); 32 | 33 | void setTime(I2C_BM8563_TimeTypeDef* I2C_BM8563_TimeStruct); 34 | void setDate(I2C_BM8563_DateTypeDef* I2C_BM8563_DateStruct); 35 | 36 | int SetAlarmIRQ(int afterSeconds); 37 | int SetAlarmIRQ(const I2C_BM8563_TimeTypeDef &I2C_BM8563_TimeStruct); 38 | int SetAlarmIRQ(const I2C_BM8563_DateTypeDef &I2C_BM8563_DateStruct, const I2C_BM8563_TimeTypeDef &I2C_BM8563_TimeStruct); 39 | 40 | void clearIRQ(); 41 | void disableIRQ(); 42 | 43 | void WriteReg(uint8_t reg, uint8_t data); 44 | uint8_t ReadReg(uint8_t reg); 45 | 46 | private: 47 | uint8_t bcd2ToByte(uint8_t value); 48 | uint8_t byteToBcd2(uint8_t value); 49 | 50 | uint8_t trdata[7]; 51 | TwoWire *_i2cPort; 52 | int _deviceAddress; 53 | }; 54 | 55 | #endif -------------------------------------------------------------------------------- /2.Firmware/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lvgl.h" 3 | #include "ChappieCore/ChappieCore.h" 4 | #include "App/App.h" 5 | #include "App/Common/HAL/HAL.h" 6 | 7 | ChappieCore Chappie; 8 | 9 | void setup() 10 | { 11 | /* Init Chappie Core */ 12 | Chappie.begin(); 13 | 14 | /* Connect HAL */ 15 | HAL::HAL_Init(); 16 | 17 | /* UI Create */ 18 | App_Init(); 19 | 20 | /* Memory Check */ 21 | _LOG("[PSRAM] free PSRAM: %d\r\n", ESP.getFreePsram()); 22 | // Serial.printf("Deafult free size: %d\n", heap_caps_get_free_size(MALLOC_CAP_DEFAULT)); 23 | // Serial.printf("PSRAM free size: %d\n", heap_caps_get_free_size(MALLOC_CAP_SPIRAM)); 24 | 25 | #if !CHAPPIE_CORE_USE_LVGL_WITHOUT_RTOS 26 | Chappie.lvgl.enable(); 27 | #endif 28 | } 29 | 30 | void loop() 31 | { 32 | #if CHAPPIE_CORE_USE_LVGL_WITHOUT_RTOS 33 | lv_timer_handler(); 34 | delay(1); 35 | #endif 36 | // HAL::HAL_Update(); 37 | delay(10); 38 | } 39 | -------------------------------------------------------------------------------- /2.Firmware/test/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for PlatformIO Test Runner 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 PlatformIO Unit Testing: 11 | - https://docs.platformio.org/en/latest/advanced/unit-testing/index.html 12 | -------------------------------------------------------------------------------- /3.Models/README.md: -------------------------------------------------------------------------------- 1 | #### button.stl 需要修剪 2 | - button.stl 当中有两颗按钮,我们需要将中间的连接件分离。 3 | - 对每颗按钮的外延边进行修剪,剪成呈梯形状即可。 4 | -------------------------------------------------------------------------------- /3.Models/button.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhangKeLiang0627/EasyGPS/337eaeb32b96d579334ffd86bbdc8d0d308706ba/3.Models/button.stl -------------------------------------------------------------------------------- /3.Models/shell.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhangKeLiang0627/EasyGPS/337eaeb32b96d579334ffd86bbdc8d0d308706ba/3.Models/shell.stl -------------------------------------------------------------------------------- /4.Pics/XMind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhangKeLiang0627/EasyGPS/337eaeb32b96d579334ffd86bbdc8d0d308706ba/4.Pics/XMind.png -------------------------------------------------------------------------------- /4.Pics/frontCover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhangKeLiang0627/EasyGPS/337eaeb32b96d579334ffd86bbdc8d0d308706ba/4.Pics/frontCover.jpg -------------------------------------------------------------------------------- /4.Pics/map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhangKeLiang0627/EasyGPS/337eaeb32b96d579334ffd86bbdc8d0d308706ba/4.Pics/map.png -------------------------------------------------------------------------------- /4.Pics/pic1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhangKeLiang0627/EasyGPS/337eaeb32b96d579334ffd86bbdc8d0d308706ba/4.Pics/pic1.jpg -------------------------------------------------------------------------------- /4.Pics/pic2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhangKeLiang0627/EasyGPS/337eaeb32b96d579334ffd86bbdc8d0d308706ba/4.Pics/pic2.jpg -------------------------------------------------------------------------------- /4.Pics/ssa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhangKeLiang0627/EasyGPS/337eaeb32b96d579334ffd86bbdc8d0d308706ba/4.Pics/ssa.png -------------------------------------------------------------------------------- /5.Resource/MicroSDcard/.SystemSaveBackup.json: -------------------------------------------------------------------------------- 1 | { 2 | "sportStatus.totalDistance": 11912.2373, 3 | "sportStatus.totalTimeUINT32[0]": 8895260, 4 | "sportStatus.totalTimeUINT32[1]": 0, 5 | "sportStatus.speedMaxKph": 117.1760406, 6 | "sportStatus.weight": 65, 7 | "sysConfig.longitude": 113.9342575, 8 | "sysConfig.latitude": 22.53647423, 9 | "sysConfig.soundEnable": 1, 10 | "sysConfig.timeZone": 8, 11 | "sysConfig.language": "en-GB", 12 | "sysConfig.arrowTheme": "default", 13 | "sysConfig.mapDirPath": "/MAP", 14 | "sysConfig.mapExtName": "bin", 15 | "sysConfig.mapWGS84": 0 16 | } -------------------------------------------------------------------------------- /5.Resource/MicroSDcard/FONT/font_smileysd_16.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhangKeLiang0627/EasyGPS/337eaeb32b96d579334ffd86bbdc8d0d308706ba/5.Resource/MicroSDcard/FONT/font_smileysd_16.bin -------------------------------------------------------------------------------- /5.Resource/MicroSDcard/MAP/README.md: -------------------------------------------------------------------------------- 1 | ### 关于MAP 2 | - 由于体积原因,请自行下载地图瓦片到此处! 3 | - 原生项目`X-TRACK`的地图下载说明:[戳这儿!](https://github.com/FASTSHIFT/X-TRACK/tree/main/Tools) 4 | - `Crimson/地图下载器`的下载地址:[在这儿!](https://gitee.com/CrimsonHu/java_map_download/) 5 | 6 | ### 注意事项 7 | 本项目与原生项目的地图下载大相径庭,跟着说明走就行,只有几点需要注意一下: 8 | 9 | - 地图瓦片格式转换时注意选择`Binary RGB565`,否则在EasyGPS上显示是反色的效果。 10 | 11 | ![](../../../4.Pics/map.png) 12 | 13 | - SD卡的内存应当 ≤ 32GB,SD卡需要格式化为FAT32格式。 -------------------------------------------------------------------------------- /5.Resource/MicroSDcard/MAP/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhangKeLiang0627/EasyGPS/337eaeb32b96d579334ffd86bbdc8d0d308706ba/5.Resource/MicroSDcard/MAP/image.png -------------------------------------------------------------------------------- /5.Resource/MicroSDcard/README.md: -------------------------------------------------------------------------------- 1 | ## TF卡文件树 2 | ```bash 3 | MicroSDcard/ 4 | ├─FONT 5 | │ └─font_smileysd_16.bin 6 | ├─MAP 7 | ├─EasyGPS 8 | ├─SystemSave.json 9 | └─.SystemSaveBackup.json 10 | ``` 11 | 12 | ## 提醒 13 | - 请按照上述文件夹格式制作您的TF卡内容。 14 | - 地图功能和智能语音助手需要使用TF卡资源,请插卡后使用。 15 | - 请在制作TF卡内容时手动创建`EasyGPS`文件夹,创建完成后用于保存路径轨迹`gpx`格式文件,**请手动创建,否则无法正常保存轨迹文件。** -------------------------------------------------------------------------------- /5.Resource/MicroSDcard/SystemSave.json: -------------------------------------------------------------------------------- 1 | { 2 | "sportStatus.totalDistance": 11912.2373, 3 | "sportStatus.totalTimeUINT32[0]": 8895260, 4 | "sportStatus.totalTimeUINT32[1]": 0, 5 | "sportStatus.speedMaxKph": 117.1760406, 6 | "sportStatus.weight": 65, 7 | "sysConfig.longitude": 113.9342575, 8 | "sysConfig.latitude": 22.53647423, 9 | "sysConfig.soundEnable": 1, 10 | "sysConfig.timeZone": 8, 11 | "sysConfig.language": "en-GB", 12 | "sysConfig.arrowTheme": "default", 13 | "sysConfig.mapDirPath": "/MAP", 14 | "sysConfig.mapExtName": "bin", 15 | "sysConfig.mapWGS84": 0 16 | } -------------------------------------------------------------------------------- /5.Resource/MicroSDcard/TilesConverterForLVGL.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhangKeLiang0627/EasyGPS/337eaeb32b96d579334ffd86bbdc8d0d308706ba/5.Resource/MicroSDcard/TilesConverterForLVGL.exe -------------------------------------------------------------------------------- /5.Resource/SmartAssistant/README.md: -------------------------------------------------------------------------------- 1 | ## 关于智能语音助手SmartAssistant的使用方法 2 | 3 | ![ssa流程](/4.Pics/ssa.png) 4 | 5 | ### 1. 获得密钥 6 | 7 | - 百度在线语音识别 & 百度在线语音合成(共用一套密钥) 8 | 9 | > 请您[戳这里:)](https://zhangkeliang0627.github.io/2024/03/24/ESP32S3%E6%8E%A5%E5%85%A5%E7%99%BE%E5%BA%A6%E5%9C%A8%E7%BA%BF%E8%AF%AD%E9%9F%B3%E8%AF%86%E5%88%AB/README/)了解密钥的详细获取方法! 10 | 11 | - 文心一言API 12 | 13 | > 请您[戳这里:)](https://zhangkeliang0627.github.io/2024/03/25/ESP32S3%E6%8E%A5%E5%85%A5%E6%96%87%E5%BF%83%E4%B8%80%E8%A8%80/README/)了解密钥的详细获取方法! 14 | 15 | ### 2. 填入密钥 16 | 17 | 请分别前往源码: 18 | - `src/ChappieCore/SmartAssistantAPI/BaiduASR` 19 | - `src/ChappieCore/SmartAssistantAPI/BaiduTTS` 20 | - `src/ChappieCore/SmartAssistantAPI/BaiduErnieBot` 21 | 22 | 找到对应的`gainToken`函数,替换您自己的密钥。 23 | 24 | ### 3. 上机调试 25 | 基本上按步骤到这里就可以成功啦,如果没有成功使用智能语音助手,请考虑是否连上WiFi、密钥是否输入正确、账户是否有领取免费次数等原因。祝您复刻成功! -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # EASY-GPS 2 | 3 | ### 本项目基于:X-TRACK & CHAPPIE 4 | 5 | ### Author: kkl 6 | 7 | --- 8 | 9 | 视频介绍:[戳这儿:)](https://www.bilibili.com/video/BV1M44219745/) 10 | 11 | 硬件开源:[戳这里:P](https://oshwhub.com/hugego/easygps-ji-yu-esp32s3-de-gps-zhui-zong-qi) 12 | 13 | ![Pic](/4.Pics/frontCover.jpg) 14 | ![Pic](/4.Pics/pic1.jpg) 15 | ![Pic](/4.Pics/pic2.jpg) 16 | 17 | ## 源码文件树 18 | ```bash 19 | EasyGPS/ 20 | ├─lib 21 | │ ├─ESP32-BLE-Combo 22 | │ ├─FastLED 23 | │ ├─NimBLE-Arduino 24 | │ ├─QMC5883LCompass 25 | │ └─TinyGPSPlus 26 | ├─src 27 | │ ├─App 28 | │ └─ChappieCore 29 | ├── platformio.ini 30 | ``` 31 | 32 | ## TF卡文件树 33 | ```bash 34 | MicroSDcard/ 35 | ├─FONT 36 | │ └─font_smileysd_16.bin 37 | ├─MAP 38 | ├─SystemSave.json 39 | └─.SystemSaveBackup.json 40 | ``` 41 | 42 | ## 思维导图 43 | ![Pic](/4.Pics/XMind.png) 44 | 45 | ## 鸣谢 46 | - 感谢[@FASTSHIFT](https://github.com/FASTSHIFT)的[X-TRACK](https://github.com/FASTSHIFT/X-TRACK)项目:提供了本项目的大致框架。 47 | - 感谢[@Forairaaaaa](https://github.com/Forairaaaaa)的[Chappie-Core](https://github.com/Forairaaaaa/Chappie-Core)项目:提供了ESP32S3在Arduino开发框架的BSP,同时提供硬件的参考设计。 48 | - 感谢[@启凡科创](https://oshwhub.com/dhx233/works)的[QF-HEYE](https://oshwhub.com/dhx233/gai-ban-re-cheng-xiang)项目:提供了部分硬件的参考设计。 49 | - 感谢[@Yeely0162](https://github.com/Yeely0162)开源了ESP32进行WiFi连接时的Web端设计。 --------------------------------------------------------------------------------