From b65eabf4037eabd123c0f6ccb04855f7b65b7683 Mon Sep 17 00:00:00 2001 From: yuenkaifai Date: Fri, 7 Feb 2025 16:28:55 +0800 Subject: [PATCH 1/3] update ameba doc -remove basic example doc in common folder. -remove back-up EPDIF, FarfsSDcard and FlashMemory API doc. +add uncommon basic example doc on all board. +add EPDIF, FarfsSDcard and FlashMemory API doc in common API folder. + add OTA example doc in common example folder. *Update custon_script.py for new updated common doc. *update AMB21 name to AMB21/22 in main page index. *Rename AudioCodec, FlashMemory, OTA, PowerSave, and TensorFlowLite image folders to prevent build error. *Update ambpro2 Flash Memory API doc for missing ~ header. --- .../API_Documents/Analog/Class AmebaServo.rst | 286 ---- .../_common/API_Documents/Analog/index.rst | 7 - .../AudioCodec/Class AudioCodec.rst | 788 --------- .../API_Documents/AudioCodec/Class FFT.rst | 217 --- .../AudioCodec/Class PlaybackWav.rst | 475 ------ .../AudioCodec/Class RecordWav.rst | 405 ----- .../API_Documents/AudioCodec/index.rst | 10 - .../API_Documents/BLE/Class BLEAddr.rst | 137 -- .../API_Documents/BLE/Class BLEAdvert.rst | 327 ---- .../API_Documents/BLE/Class BLEAdvertData.rst | 982 ----------- .../API_Documents/BLE/Class BLEBeacon.rst | 633 -------- .../BLE/Class BLECharacteristic.rst | 1445 ----------------- .../API_Documents/BLE/Class BLEClient.rst | 317 ---- .../API_Documents/BLE/Class BLEConnect.rst | 468 ------ .../API_Documents/BLE/Class BLEDevice.rst | 658 -------- .../API_Documents/BLE/Class BLEHIDDevice.rst | 595 ------- .../API_Documents/BLE/Class BLEHIDGamepad.rst | 530 ------ .../BLE/Class BLEHIDKeyboard.rst | 429 ----- .../API_Documents/BLE/Class BLEHIDMouse.rst | 337 ---- .../BLE/Class BLERemoteCharacteristic.rst | 831 ---------- .../BLE/Class BLERemoteDescriptor.rst | 493 ------ .../BLE/Class BLERemoteService.rst | 103 -- .../API_Documents/BLE/Class BLEScan.rst | 349 ---- .../API_Documents/BLE/Class BLESecurity.rst | 399 ----- .../API_Documents/BLE/Class BLEService.rst | 201 --- .../API_Documents/BLE/Class BLEUUID.rst | 213 --- .../BLE/Class BLEWifiConfigService.rst | 208 --- bak/ambd/_common/API_Documents/BLE/index.rst | 26 - .../FatfsSDcard/Class FatFsSD.rst | 461 ------ .../FatfsSDcard/Class SdFatFile.rst | 520 ------ .../FlashMemory/Class FlashMemoryClass.rst | 421 ----- ...OTA - Update Firmware to Ameba via OTA.rst | 2 - .../API_Documents/EPDIF/Class EpdIF.rst | 302 ++-- .../_common/API_Documents/EPDIF/index.rst | 2 +- .../FatfsSDcard/Class FatFsSD.rst | 475 ++++++ .../FatfsSDcard/Class SdFatFile.rst | 316 ++++ .../API_Documents/FatfsSDcard/index.rst | 0 .../FlashMemory/Class FlashMemoryClass.rst | 244 +++ .../API_Documents/FlashMemory/index.rst | 0 ...OTA - Update Firmware to Ameba via OTA.rst | 163 ++ .../_common/Example_Guides/OTA/index.rst | 1 + .../image01.png | Bin .../image02.png | Bin .../image03.png | Bin .../image04.png | Bin .../Audio Codec_FFT/image01.png | Bin .../Audio Codec_FFT/image02.png | Bin .../Audio Codec_InputFFT/image01.png | Bin .../Audio Codec_InputFFT/image02.png | Bin .../Audio Codec_InputFFT/image03.png | Bin .../Audio Codec_InputFFT/image04.png | Bin .../Audio Codec_Output Sine Wave/image01.png | Bin .../Audio Codec_Output Sine Wave/image02.png | Bin .../Audio Codec_Output Sine Wave/image03.png | Bin .../image01.png | Bin .../image02.png | Bin .../image03.png | Bin .../image04.png | Bin .../image01.png | Bin .../image02.png | Bin .../image01.png | Bin .../image01.png | Bin .../image02.png | Bin .../image03.png | Bin .../image04.png | Bin .../image05.png | Bin .../image06.png | Bin .../image07.png | Bin .../image08.png | Bin .../image09.png | Bin .../image10.png | Bin .../image11.png | Bin .../image12.png | Bin .../image13.png | Bin .../Power_Save_Deep_Sleep_DHT_LCD/image01.png | Bin .../Power_Save_Deep_Sleep_DHT_LCD/image02.png | Bin .../Power_Save_Deep_Sleep_DHT_LCD/image03.png | Bin .../image01.png | Bin .../image02.png | Bin .../image03.png | Bin .../Power_Save_Deep_Sleep_Mode/image01.png | Bin .../Power_Save_Deep_Sleep_Mode/image02.png | Bin .../Power_Save_Deep_Sleep_Mode/image03.png | Bin .../Power_Save_Deep_Sleep_Mode/image04.png | Bin .../Power_Save_Deep_Sleep_Mode/image05.png | Bin .../Power_Save_Deep_Sleep_Mode/image06.png | Bin .../Power_Save_Deep_Sleep_Mode/image07.png | Bin .../Power_Save_Deep_Sleep_Mode/image08.png | Bin .../Power_Save_Deep_Sleep_Mode/image09.png | Bin .../Power_Save_Deep_Sleep_Mode/image10.png | Bin .../Power_Save_Tickless_Mode/image01.png | Bin .../Power_Save_Tickless_Mode/image02.png | Bin .../Power_Save_Tickless_Mode/image03.png | Bin .../Power_Save_Tickless_Mode/image04.png | Bin .../Power_Save_Tickless_Mode/image05.png | Bin .../Power_Save_Tickless_Mode/image06.png | Bin .../Power_Save_Tickless_Mode/image07.png | Bin .../Power_Save_Tickless_Mode/image08.png | Bin .../Power_Save_Tickless_Mode/image09.png | Bin .../Power_Save_Tickless_Mode/image10.png | Bin .../TensorFlow Lite_Hello World/image01.png | Bin .../TensorFlow Lite_Hello World/image02.png | Bin .../TensorFlow Lite_Magic Wand/image01.png | Bin .../TensorFlow Lite_Magic Wand/image02.png | Bin .../TensorFlow Lite_Magic Wand/image03.png | Bin .../TensorFlow Lite_Magic Wand/image04.png | Bin .../TensorFlow Lite_Magic Wand/image05.png | Bin .../TensorFlow Lite_Magic Wand/image06.PNG | Bin .../TensorFlow Lite_Magic Wand/image07.png | Bin .../TensorFlow Lite_Magic Wand/image08.png | Bin .../TensorFlow Lite_Magic Wand/image09.png | Bin .../TensorFlow Lite_Magic Wand/image10.png | Bin .../TensorFlow Lite_Magic Wand/image11.png | Bin .../TensorFlow Lite_Micro Speech/image01.png | Bin .../TensorFlow Lite_Micro Speech/image02.png | Bin .../TensorFlow Lite_Micro Speech/image03.png | Bin .../TensorFlow Lite_Micro Speech/image04.png | Bin .../TensorFlow Lite_Micro Speech/image05.png | Bin .../image01.png | Bin .../image02.png | Bin .../image03.png | Bin .../image04.png | Bin .../image05.png | Bin .../image06.png | Bin .../image07.png | Bin .../image08.png | Bin .../image09.png | Bin source/amb21/API_Documents/index.rst | 3 + .../Basic/Arduino-build-in example.rst | 168 ++ .../Example_Guides/Basic/index.rst | 14 +- source/amb23/API_Documents/index.rst | 3 + .../Basic/Arduino-build-in example.rst | 170 ++ source/amb23/Example_Guides/Basic/index.rst | 7 + source/amb25/API_Documents/index.rst | 3 + .../Basic/Arduino-build-in example.rst | 180 ++ source/amb25/Example_Guides/Basic/index.rst | 7 + source/amb26/API_Documents/index.rst | 3 + .../Basic/Arduino-build-in example.rst | 180 ++ source/amb26/Example_Guides/Basic/index.rst | 7 + .../FlashMemory/Class FlashMemoryClass.rst | 2 + .../Basic/Arduino-build-in example.rst | 190 +++ .../amebapro2/Example_Guides/Basic/index.rst | 7 + source/aw-cu488/API_Documents/index.rst | 3 + .../Basic/Arduino-build-in example.rst | 405 ++--- .../aw-cu488/Example_Guides/Basic/index.rst | 7 + source/bw16-typeb/API_Documents/index.rst | 3 + .../Basic/Arduino-build-in example.rst | 153 ++ .../bw16-typeb/Example_Guides/Basic/index.rst | 7 + source/bw16-typec/API_Documents/index.rst | 3 + .../Basic/Arduino-build-in example.rst | 153 ++ .../bw16-typec/Example_Guides/Basic/index.rst | 7 + source/custom_script.py | 35 +- source/index.rst | 4 +- 153 files changed, 2824 insertions(+), 13676 deletions(-) delete mode 100644 bak/ambd/_common/API_Documents/Analog/Class AmebaServo.rst delete mode 100644 bak/ambd/_common/API_Documents/Analog/index.rst delete mode 100644 bak/ambd/_common/API_Documents/AudioCodec/Class AudioCodec.rst delete mode 100644 bak/ambd/_common/API_Documents/AudioCodec/Class FFT.rst delete mode 100644 bak/ambd/_common/API_Documents/AudioCodec/Class PlaybackWav.rst delete mode 100644 bak/ambd/_common/API_Documents/AudioCodec/Class RecordWav.rst delete mode 100644 bak/ambd/_common/API_Documents/AudioCodec/index.rst delete mode 100644 bak/ambd/_common/API_Documents/BLE/Class BLEAddr.rst delete mode 100644 bak/ambd/_common/API_Documents/BLE/Class BLEAdvert.rst delete mode 100644 bak/ambd/_common/API_Documents/BLE/Class BLEAdvertData.rst delete mode 100644 bak/ambd/_common/API_Documents/BLE/Class BLEBeacon.rst delete mode 100644 bak/ambd/_common/API_Documents/BLE/Class BLECharacteristic.rst delete mode 100644 bak/ambd/_common/API_Documents/BLE/Class BLEClient.rst delete mode 100644 bak/ambd/_common/API_Documents/BLE/Class BLEConnect.rst delete mode 100644 bak/ambd/_common/API_Documents/BLE/Class BLEDevice.rst delete mode 100644 bak/ambd/_common/API_Documents/BLE/Class BLEHIDDevice.rst delete mode 100644 bak/ambd/_common/API_Documents/BLE/Class BLEHIDGamepad.rst delete mode 100644 bak/ambd/_common/API_Documents/BLE/Class BLEHIDKeyboard.rst delete mode 100644 bak/ambd/_common/API_Documents/BLE/Class BLEHIDMouse.rst delete mode 100644 bak/ambd/_common/API_Documents/BLE/Class BLERemoteCharacteristic.rst delete mode 100644 bak/ambd/_common/API_Documents/BLE/Class BLERemoteDescriptor.rst delete mode 100644 bak/ambd/_common/API_Documents/BLE/Class BLERemoteService.rst delete mode 100644 bak/ambd/_common/API_Documents/BLE/Class BLEScan.rst delete mode 100644 bak/ambd/_common/API_Documents/BLE/Class BLESecurity.rst delete mode 100644 bak/ambd/_common/API_Documents/BLE/Class BLEService.rst delete mode 100644 bak/ambd/_common/API_Documents/BLE/Class BLEUUID.rst delete mode 100644 bak/ambd/_common/API_Documents/BLE/Class BLEWifiConfigService.rst delete mode 100644 bak/ambd/_common/API_Documents/BLE/index.rst delete mode 100644 bak/ambd/_common/API_Documents/FatfsSDcard/Class FatFsSD.rst delete mode 100644 bak/ambd/_common/API_Documents/FatfsSDcard/Class SdFatFile.rst delete mode 100644 bak/ambd/_common/API_Documents/FlashMemory/Class FlashMemoryClass.rst delete mode 100644 bak/ambd/_common/Example_Guides/OTA/OTA - Update Firmware to Ameba via OTA.rst rename {bak/ambd => source}/_common/API_Documents/EPDIF/Class EpdIF.rst (54%) rename {bak/ambd => source}/_common/API_Documents/EPDIF/index.rst (66%) create mode 100644 source/_common/API_Documents/FatfsSDcard/Class FatFsSD.rst create mode 100644 source/_common/API_Documents/FatfsSDcard/Class SdFatFile.rst rename {bak/ambd => source}/_common/API_Documents/FatfsSDcard/index.rst (100%) create mode 100644 source/_common/API_Documents/FlashMemory/Class FlashMemoryClass.rst rename {bak/ambd => source}/_common/API_Documents/FlashMemory/index.rst (100%) create mode 100644 source/_common/Example_Guides/OTA/OTA - Update Firmware to Ameba via OTA.rst rename {bak/ambd => source}/_common/Example_Guides/OTA/index.rst (59%) rename source/_static/amebad/Example_Guides/{Audio Codec => AudioCodec}/Audio Codec_Basic Input Output/image01.png (100%) rename source/_static/amebad/Example_Guides/{Audio Codec => AudioCodec}/Audio Codec_Basic Input Output/image02.png (100%) rename source/_static/amebad/Example_Guides/{Audio Codec => AudioCodec}/Audio Codec_Basic Input Output/image03.png (100%) rename source/_static/amebad/Example_Guides/{Audio Codec => AudioCodec}/Audio Codec_Basic Input Output/image04.png (100%) rename source/_static/amebad/Example_Guides/{Audio Codec => AudioCodec}/Audio Codec_FFT/image01.png (100%) rename source/_static/amebad/Example_Guides/{Audio Codec => AudioCodec}/Audio Codec_FFT/image02.png (100%) rename source/_static/amebad/Example_Guides/{Audio Codec => AudioCodec}/Audio Codec_InputFFT/image01.png (100%) rename source/_static/amebad/Example_Guides/{Audio Codec => AudioCodec}/Audio Codec_InputFFT/image02.png (100%) rename source/_static/amebad/Example_Guides/{Audio Codec => AudioCodec}/Audio Codec_InputFFT/image03.png (100%) rename source/_static/amebad/Example_Guides/{Audio Codec => AudioCodec}/Audio Codec_InputFFT/image04.png (100%) rename source/_static/amebad/Example_Guides/{Audio Codec => AudioCodec}/Audio Codec_Output Sine Wave/image01.png (100%) rename source/_static/amebad/Example_Guides/{Audio Codec => AudioCodec}/Audio Codec_Output Sine Wave/image02.png (100%) rename source/_static/amebad/Example_Guides/{Audio Codec => AudioCodec}/Audio Codec_Output Sine Wave/image03.png (100%) rename source/_static/amebad/Example_Guides/{Audio Codec => AudioCodec}/Audio Codec_play and record wav files/image01.png (100%) rename source/_static/amebad/Example_Guides/{Audio Codec => AudioCodec}/Audio Codec_play and record wav files/image02.png (100%) rename source/_static/amebad/Example_Guides/{Audio Codec => AudioCodec}/Audio Codec_play and record wav files/image03.png (100%) rename source/_static/amebad/Example_Guides/{Audio Codec => AudioCodec}/Audio Codec_play and record wav files/image04.png (100%) rename source/_static/amebad/Example_Guides/{Flash Memory => FlashMemory}/Flash Memory_Store data in Flash EEPROM/image01.png (100%) rename source/_static/amebad/Example_Guides/{Flash Memory => FlashMemory}/Flash Memory_Store data in Flash EEPROM/image02.png (100%) rename source/_static/amebad/Example_Guides/{Flash Memory => FlashMemory}/Flash Memory_Use Flash Memory Larger Than 4K/image01.png (100%) rename source/_static/amebad/Example_Guides/OTA/{OTA _Update Firmware to Ameba via OTA => OTA_Update_Firmware_to_Ameba_via_OTA}/image01.png (100%) rename source/_static/amebad/Example_Guides/OTA/{OTA _Update Firmware to Ameba via OTA => OTA_Update_Firmware_to_Ameba_via_OTA}/image02.png (100%) rename source/_static/amebad/Example_Guides/OTA/{OTA _Update Firmware to Ameba via OTA => OTA_Update_Firmware_to_Ameba_via_OTA}/image03.png (100%) rename source/_static/amebad/Example_Guides/OTA/{OTA _Update Firmware to Ameba via OTA => OTA_Update_Firmware_to_Ameba_via_OTA}/image04.png (100%) rename source/_static/amebad/Example_Guides/OTA/{OTA _Update Firmware to Ameba via OTA => OTA_Update_Firmware_to_Ameba_via_OTA}/image05.png (100%) rename source/_static/amebad/Example_Guides/OTA/{OTA _Update Firmware to Ameba via OTA => OTA_Update_Firmware_to_Ameba_via_OTA}/image06.png (100%) rename source/_static/amebad/Example_Guides/OTA/{OTA _Update Firmware to Ameba via OTA => OTA_Update_Firmware_to_Ameba_via_OTA}/image07.png (100%) rename source/_static/amebad/Example_Guides/OTA/{OTA _Update Firmware to Ameba via OTA => OTA_Update_Firmware_to_Ameba_via_OTA}/image08.png (100%) rename source/_static/amebad/Example_Guides/OTA/{OTA _Update Firmware to Ameba via OTA => OTA_Update_Firmware_to_Ameba_via_OTA}/image09.png (100%) rename source/_static/amebad/Example_Guides/OTA/{OTA _Update Firmware to Ameba via OTA => OTA_Update_Firmware_to_Ameba_via_OTA}/image10.png (100%) rename source/_static/amebad/Example_Guides/OTA/{OTA _Update Firmware to Ameba via OTA => OTA_Update_Firmware_to_Ameba_via_OTA}/image11.png (100%) rename source/_static/amebad/Example_Guides/OTA/{OTA _Update Firmware to Ameba via OTA => OTA_Update_Firmware_to_Ameba_via_OTA}/image12.png (100%) rename source/_static/amebad/Example_Guides/OTA/{OTA _Update Firmware to Ameba via OTA => OTA_Update_Firmware_to_Ameba_via_OTA}/image13.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Deep_Sleep_DHT_LCD/image01.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Deep_Sleep_DHT_LCD/image02.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Deep_Sleep_DHT_LCD/image03.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Deep_Sleep_For_DHT_Epaper/image01.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Deep_Sleep_For_DHT_Epaper/image02.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Deep_Sleep_For_DHT_Epaper/image03.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Deep_Sleep_Mode/image01.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Deep_Sleep_Mode/image02.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Deep_Sleep_Mode/image03.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Deep_Sleep_Mode/image04.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Deep_Sleep_Mode/image05.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Deep_Sleep_Mode/image06.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Deep_Sleep_Mode/image07.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Deep_Sleep_Mode/image08.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Deep_Sleep_Mode/image09.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Deep_Sleep_Mode/image10.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Tickless_Mode/image01.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Tickless_Mode/image02.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Tickless_Mode/image03.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Tickless_Mode/image04.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Tickless_Mode/image05.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Tickless_Mode/image06.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Tickless_Mode/image07.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Tickless_Mode/image08.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Tickless_Mode/image09.png (100%) rename source/_static/amebad/Example_Guides/{Power Save => PowerSave}/Power_Save_Tickless_Mode/image10.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Hello World/image01.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Hello World/image02.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Magic Wand/image01.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Magic Wand/image02.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Magic Wand/image03.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Magic Wand/image04.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Magic Wand/image05.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Magic Wand/image06.PNG (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Magic Wand/image07.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Magic Wand/image08.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Magic Wand/image09.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Magic Wand/image10.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Magic Wand/image11.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Micro Speech/image01.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Micro Speech/image02.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Micro Speech/image03.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Micro Speech/image04.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Micro Speech/image05.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Person Detection/image01.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Person Detection/image02.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Person Detection/image03.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Person Detection/image04.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Person Detection/image05.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Person Detection/image06.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Person Detection/image07.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Person Detection/image08.png (100%) rename source/_static/amebad/Example_Guides/{TensorFlow Lite => TensorFlowLite}/TensorFlow Lite_Person Detection/image09.png (100%) create mode 100644 source/amb21/Example_Guides/Basic/Arduino-build-in example.rst rename source/{_common => amb21}/Example_Guides/Basic/index.rst (91%) create mode 100644 source/amb23/Example_Guides/Basic/Arduino-build-in example.rst create mode 100644 source/amb23/Example_Guides/Basic/index.rst create mode 100644 source/amb25/Example_Guides/Basic/Arduino-build-in example.rst create mode 100644 source/amb25/Example_Guides/Basic/index.rst create mode 100644 source/amb26/Example_Guides/Basic/Arduino-build-in example.rst create mode 100644 source/amb26/Example_Guides/Basic/index.rst create mode 100644 source/amebapro2/Example_Guides/Basic/Arduino-build-in example.rst create mode 100644 source/amebapro2/Example_Guides/Basic/index.rst rename source/{_common => aw-cu488}/Example_Guides/Basic/Arduino-build-in example.rst (90%) create mode 100644 source/aw-cu488/Example_Guides/Basic/index.rst create mode 100644 source/bw16-typeb/Example_Guides/Basic/Arduino-build-in example.rst create mode 100644 source/bw16-typeb/Example_Guides/Basic/index.rst create mode 100644 source/bw16-typec/Example_Guides/Basic/Arduino-build-in example.rst create mode 100644 source/bw16-typec/Example_Guides/Basic/index.rst diff --git a/bak/ambd/_common/API_Documents/Analog/Class AmebaServo.rst b/bak/ambd/_common/API_Documents/Analog/Class AmebaServo.rst deleted file mode 100644 index cd405ba..0000000 --- a/bak/ambd/_common/API_Documents/Analog/Class AmebaServo.rst +++ /dev/null @@ -1,286 +0,0 @@ -Class AmebaServo -================ - -.. contents:: - :local: - :depth: 2 - -**AmebaServo Class** --------------------- - -**Description** -~~~~~~~~~~~~~~~ - -A class used for controlling servo motors connected to Ameba boards. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - class AmebaServo - -**Members** -~~~~~~~~~~~ - -+-------------------------------+-----------------------------------------+ -| **Public Constructors** | -+===============================+=========================================+ -| AmebaServo::AmebaServo | Constructs an AmebaServo object. | -+-------------------------------+-----------------------------------------+ -| **Public Methods** | -+-------------------------------+-----------------------------------------+ -| AmebaServo::attach | Attach a PWM pin to control servo. | -+-------------------------------+-----------------------------------------+ -| AmebaServo::detach | Detach the servo. | -+-------------------------------+-----------------------------------------+ -| AmebaServo::write | Write a value to control servo. The | -| | value is between 0 - 180 degrees. | -+-------------------------------+-----------------------------------------+ -| AmebaServo::writeMicroseconds | Write a value to control servo. The | -| | value is between 544 - 2400us. | -+-------------------------------+-----------------------------------------+ -| AmebaServo::read | Read the value from servo and returns | -| | current pulse width as an angle between | -| | 0 and 180 degrees. | -+-------------------------------+-----------------------------------------+ -| AmebaServo::readMicroseconds | Read the value from servo and returns | -| | current pulse width in microseconds. | -+-------------------------------+-----------------------------------------+ -| AmebaServo::attached | Check if the servo is attached. | -+-------------------------------+-----------------------------------------+ - -**AmebaServo::attach** ----------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Attach a PWM pin to control servo on Ameba boards. Minimum and maximum pulse width can be set optionally. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint8_t attach(int pin); - uint8_t attach(int pin, int min, int max); - -**Parameters** -~~~~~~~~~~~~~~ - -pin: A PWM pin that is one of the Ameba boards' PWM pins. - -min: Minimum pulse width to be set for PWM. Default value is 544us. - -max: Maximum pulse width to be set for PWM. Default value is 2400us. - -**Returns** -~~~~~~~~~~~ - -0 - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `ServoSweep `_ - -The code demonstrates a servo motor sweeping from 0 - 180 - 0 degrees, in 1-degree intervals. - -.. note :: "AmebaServo.h" must be included to use the class function. - -**AmebaServo::detach** ----------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Detach the servo by disabling the PWM pin previously set in attach(). - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void detach(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "AmebaServo.h" must be included to use the class function. - -**AmebaServo::write** ---------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Write an integer value to control servo. The value is between 0 - 180 degrees. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void write(int value); - -**Parameters** -~~~~~~~~~~~~~~ - -value: An integer value. - -- 0 to 180 (If the value is < 0, it will be taken as 0 and if the value >180, it will be taken as 180) - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `ServoSweep `_ - -.. note :: "AmebaServo.h" must be included to use the class function. - -**AmebaServo::writeMicroseconds** ---------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Write a value to control servo. The value is between 544 - 2400us that represents pulse width. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void writeMicroseconds(int value); - -**Parameters** -~~~~~~~~~~~~~~ - -value: An integer value (us) as pulse width. - -- 544 to 2400 (If the value is < 544, it will be taken as 544 and if the value > 2400, it will be taken as 2400) - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "AmebaServo.h" must be included to use the class function. - -**AmebaServo::read** --------------------- - -**Description** -~~~~~~~~~~~~~~~ - -The function reads the value from servo and returns current pulse width as an angle between 0 - 180 degrees. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - int read(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns integer value that represents pulse width between 0 - 180 degrees. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "AmebaServo.h" must be included to use the class function. - -**AmebaServo::readMicroseconds** --------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -The function reads and returns the pulse width of the current servo in microseconds. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - int readMicroseconds(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns an integer value that represents pulse width in microseconds. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "AmebaServo.h" must be included to use the class function. - -**AmebaServo::attached** ------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Check if the servo PWM pin is attached successfully. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool attached(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns 1 if the servo has been attached, else it returns 0. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `ServoSweep `_ - -.. note :: "AmebaServo.h" must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/Analog/index.rst b/bak/ambd/_common/API_Documents/Analog/index.rst deleted file mode 100644 index 73af77d..0000000 --- a/bak/ambd/_common/API_Documents/Analog/index.rst +++ /dev/null @@ -1,7 +0,0 @@ -Analog -====== - -.. toctree:: - :maxdepth: 1 - - Class AmebaServo diff --git a/bak/ambd/_common/API_Documents/AudioCodec/Class AudioCodec.rst b/bak/ambd/_common/API_Documents/AudioCodec/Class AudioCodec.rst deleted file mode 100644 index 0520e31..0000000 --- a/bak/ambd/_common/API_Documents/AudioCodec/Class AudioCodec.rst +++ /dev/null @@ -1,788 +0,0 @@ -Class AudioCodec -================ - -.. contents:: - :local: - :depth: 2 - -**AudioCodec Class** --------------------- - -**Description** -~~~~~~~~~~~~~~~ - - -A class used for general control and management of the hardware audio -codec functions. - -**Syntax** -~~~~~~~~~~ - - -.. code:: c++ - - class AudioCodec - - -**Members** -~~~~~~~~~~~ - -+-------------------------------+-----------------------------------------+ -| **Public Constructors** | -+===============================+=========================================+ -| The public constructor is not recommended to be used as a | -| singleton class. Class is for built-in Audio Codec. | -+-------------------------------+-----------------------------------------+ -| **Public Methods** | -+-------------------------------+-----------------------------------------+ -| AudioCodec::begin | Configure Audio Codec to start | -| | transmitting and receiving operations. | -+-------------------------------+-----------------------------------------+ -| AudioCodec::end | Deinitialize all Audio Codec operations.| -+-------------------------------+-----------------------------------------+ -| AudioCodec::getBufferPageSize | Get byte size per page, and default | -| | value is 1024. | -+-------------------------------+-----------------------------------------+ -| AudioCodec::setSampleRate | Set the sample rate for transmitting | -| | and receiving. | -+-------------------------------+-----------------------------------------+ -| AudioCodec::setBitDepth | Set the bit depth (bits per sample) for | -| | transmitting and receiving. | -+-------------------------------+-----------------------------------------+ -| AudioCodec::setChannelCount | Set the number of channels for | -| | transmitting and receiving | -| | (Mono or Stereo). | -+-------------------------------+-----------------------------------------+ -| AudioCodec::setInputMicType | Set microphone type input | -| | (analog or digital). | -+-------------------------------+-----------------------------------------+ -| AudioCodec::setInputLRMux | Set input for audio multiplexing | -| | (left and right). | -+-------------------------------+-----------------------------------------+ -| AudioCodec::setDMicBoost | Set boost gain for digital | -| | microphone input | -+-------------------------------+-----------------------------------------+ -| AudioCodec::setAMicBoost | Set boost gain for analog | -| | microphone input | -+-------------------------------+-----------------------------------------+ -| AudioCodec::setADCGain | Set Analog Digital Converter (ADC) | -| | gain to obtain analog input. | -+-------------------------------+-----------------------------------------+ -| AudioCodec::muteInput | Mute input audio. | -+-------------------------------+-----------------------------------------+ -| AudioCodec::setOutputVolume | Set output audio volume. | -+-------------------------------+-----------------------------------------+ -| AudioCodec::muteOutput | Mute output audio | -+-------------------------------+-----------------------------------------+ -| AudioCodec::writeAvaliable | Check if data buffer is | -| | available for data writing. | -+-------------------------------+-----------------------------------------+ -| AudioCodec::writeDataPage | Write audio data to the available | -| | data buffer for data transmission. | -+-------------------------------+-----------------------------------------+ -| AudioCodec::readAvaliable | Check for data buffer with audio data | -| | to be read. | -+-------------------------------+-----------------------------------------+ -| AudioCodec::readDataPage | Read received audio data from buffer. | -+-------------------------------+-----------------------------------------+ -| AudioCodec::setWriteCallback | Set a callback function to be notified | -| | when a data buffer is available | -| | for data write. | -+-------------------------------+-----------------------------------------+ -| AudioCodec::setReadCallback | Set a callback function to be notified | -| | when there is available data buffer with| -| | audio data to be read. | -+-------------------------------+-----------------------------------------+ - -**AudioCodec::begin** ---------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Configure and start the audio codec for transmit and receive operation. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void begin(bool input, bool output); - -**Parameters** -~~~~~~~~~~~~~~ - -input: enable Audio Codec data input -output: enable Audio Codec data output - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BasicInputOutput `_ - -.. note :: “AudioCodec.h” must be included to use the class function. - -**AudioCodec::end** -------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Deintialize all Audio Codec input and output operations. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void end(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -.. note :: “AudioCodec.h” must be included to use the class function. - -**AudioCodec::getBufferPageSize** ---------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get byte size per page, and default value is 1024 bytes. - -**Syntax** -~~~~~~~~~~ - - -.. code:: c++ - - uint32_t getBufferPageSize(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the size per page, in number of bytes (default: 1024). - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: The AudioCodec class includes a Tx and Rx buffer for storing audio sample data while it is being transferred to and from the DAC output and ADC input. The buffer is divided into fixed-size pages, allowing audio data to be read and written one page at a time. A buffer page may contain a different number of audio samples depending on the bit depth (bits per audio sample) and channel count set. - “AudioCodec.h” must be included to use the class function. - -**AudioCodec::setSampleRate** - -**Description** -~~~~~~~~~~~~~~~ - -Set the sample rate for transmitting and receiving. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void setSampleRate(uint32_t sampleRate); - -**Parameters** -~~~~~~~~~~~~~~ - -sampleRate: Audio Codec's sampling rate in Hz. (Default: 48000 Hz). Supported values: 8000, 16000, 32000, 44100, 48000, 88200, 96000 (in Hz). - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BasicInputOutput `_ - -.. note :: Higher sample rates beyond 48000Hz will require more frequent buffer read and write operations to keep up with the large amount of data input and output. If there is insufficient processing time dedicated to this task, audio quality will be degraded. - “AudioCodec.h” must be included to use the class function. - -**AudioCodec::setBitDepth** ---------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the bit depth (bits per sample) for transmitting and receiving. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void setBitDepth(uint8_t bitDepth); - -**Parameters** -~~~~~~~~~~~~~~ - -bitDepth: Number of bits per sample. (Default: 16 bits). -Supported values: -- 8 bits -- 16 bits -- 24 bits - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Setting a bit depth of 24 bits per sample will require 32 bits (4 bytes) of buffer space for storing each sample, with the most significant byte ignored. - “AudioCodec.h” must be included to use the class function. - -**AudioCodec::setChannelCount** -------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the number of channels for transmitting and receiving (Mono or Stereo). - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void setChannelCount(uint8_t monoStereo); - -**Parameters** -~~~~~~~~~~~~~~ - -monoStereo: number of channels. (Default: 1). -Supported values: -- 1 (Mono Channel) -- 2 (Stereo Channel) - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `PlaybackWavFile `_ - -.. note :: “AudioCodec.h” must be included to use the class function. - -**AudioCodec::setInputMicType** -------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set microphone type input (analog or digital). - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - Void setInputMicType(Mic_Type micType); - -**Parameters** -~~~~~~~~~~~~~~ - -micType: Input microphone type. (Default: ANALOGMIC). -Valid values: -- ANALOGMIC - microphone with an analog output -- PDMMIC - digital microphone with a PDM output - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: For analog single-ended output, connect to PA_4 for the left channel and PA_2 for the right channel. - For digital PDM output, connect the PDM clock to PB_1 and PDM data to PB_2. - “AudioCodec.h” must be included to use the class function. - -**AudioCodec::setInputLRMux** ------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Set input for audio multiplexing (left and right). - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void setInputLRMux(uint32_t mux); - -**Parameters** -~~~~~~~~~~~~~~ - -mux: Left and right audio channel multiplexing setting. (Default value: RX_CH_LL). -Valid values: -- RX_CH_LR: Rx selected as left and right channel -- RX_CH_RL : Rx selected as right and left channel -- RX_CH_LL : Rx selected as only left channel -- RX_CH_RR : Rx selected as only right channel - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: In mono channel mode, by selecting RX_CH_LR or RX_CH_LL will result in getting sampling input data from the left channel of the microphone while by selecting RX_CH_RL or RX_CH_RR will result in getting sampling input data from the right channel of the microphone. - In stereo channel mode, RX_CH_RL will switch the positions of input data sampled from the microphones. RX_CH_RR and RX_CH_LL will result in duplicated samples from the right and left microphones respectively. - “AudioCodec.h” must be included to use the class function. - -**AudioCodec::setDMicBoost** ----------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set boost gain for digital microphone input. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void setDMicBoost(uint32_t leftBoost, uint32_t rightBoost); - -**Parameters** -~~~~~~~~~~~~~~ - -leftBoost: boost gain for left channel digital microphone input (Default: 0). -rightBoost: boost gain for right channel digital microphone input (Default: 0). -Valid boost gain values: - -- 0 : 0dB -- 1 : 12dB -- 2 : 24dB -- 3 : 36dB - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: “AudioCodec.h” must be included to use the class function. - -**AudioCodec::setAMicBoost** ----------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set boost gain for analog microphone input. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void setAMicBoost(uint32_t leftBoost, uint32_t rightBoost); - -**Parameters** -~~~~~~~~~~~~~~ - -leftBoost: boost gain for left channel analog microphone input (Default: 0). -rightBoost: boost gain for right channel analog microphone input (Default: 0). -Valid boost gain values: - -- 0 : 0dB -- 1 : 20dB -- 2 : 30dB -- 3 : 40dB - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Only use this function if additional gain is required after using setADCGain function. - “AudioCodec.h” must be included to use the class function. - -**AudioCodec::setADCGain** --------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set Analog Digital Converter (ADC) gain to obtain analog input. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void setADCGain(uint32_t leftGain, uint32_t rightGain); - -**Parameters** -~~~~~~~~~~~~~~ - -leftGain: Gain for left channel ADC (Default: 0). -rightGain: Gain for right channel ADC (Default: 0). -Valid value range is from 0x00 to 0x7f. Gain increases by 0.375dB for every increment in value: - -- 0x00 : -17.625dB -- 0x01 : -17.25dB -- 0x2f : 0dB -- 0x30 : 0.375dB -- 0x7f : 30dB - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: “AudioCodec.h” must be included to use the class function. - -**AudioCodec::muteInput** -------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Mute input audio. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void muteInput(uint8_t leftMute, uint8_t rightMute); - -**Parameters** -~~~~~~~~~~~~~~ - -leftMute: 1 to mute left channel input, 0 to unmute (Default: 1). -rightMute: 1 to mute right channel input, 0 to unmute (Default: 1). - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: “AudioCodec.h” must be included to use the class function. - -**AudioCodec::setOutputVolume** -------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set output audio volume. Valid value ranges from 0 to 100 corresponding to a volume of -65.625dB to 0dB. If value > 100, it will be taken as 100. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void setOutputVolume(uint8_t leftVol, uint8_t rightVol); - -**Parameters** -~~~~~~~~~~~~~~ - -leftVol: left channel output volume -rightVol: right channel output volume - -**Returns** -~~~~~~~~~~~ - -Na - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BasicInputOutput `_ - -.. note :: “AudioCodec.h” must be included to use the class function. - -**AudioCodec::muteOutput** --------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Mute output audio. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void muteOutput(uint8_t leftMute, uint8_t rightMute); - -**Parameters** -~~~~~~~~~~~~~~ - -leftMute: 1 to mute left channel output, 0 to unmute (Default: 1). -rightMute: 1 to mute right channel output, 0 to unmute (Default: 1). - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: “AudioCodec.h” must be included to use the class function. - -**AudioCodec::writeAvaliable** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Check if data buffer is available for data writing. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - bool writeAvaliable(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns true if there is a data buffer available for writing data. It returns false if no data buffers are available. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BasicInputOutput `_ - -.. note :: “AudioCodec.h” must be included to use the class function. - -**AudioCodec::writeDataPage** ------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Write audio data to the available data buffer for data transmission. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - uint32_t writeDataPage(int8_t* src, uint32_t len); - uint32_t writeDataPage(int16_t* src, uint32_t len); - -**Parameters** -~~~~~~~~~~~~~~ - -src: pointer to array containing audio samples to write to Audio Codec. -len: number of audio samples in array. - -**Returns** -~~~~~~~~~~~ - -This function returns the total number of audio samples written to the Audio Codec if there is available data buffer for data writting. Otherwise, it will return 0. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BasicInputOutput `_ - -.. note :: “AudioCodec.h” must be included to use the class function. - -**AudioCodec::readAvaliable** ------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Check for data buffer with audio data to be read. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - bool readAvaliable(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns true if there is a data buffer with new data to be read. It returns false if all pages are empty. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BasicInputOutput `_ - -.. note :: “AudioCodec.h” must be included to use the class function. - -**AudioCodec::readDataPage** ----------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Read received audio data from data buffer. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - uint32_t readDataPage(int8_t* dst, uint32_t len); - uint32_t readDataPage(int16_t* dst, uint32_t len); - -**Parameters** -~~~~~~~~~~~~~~ - -dst: pointer to array to contain audio samples read from Audio Codec. -len: number of audio samples to read. - -**Returns** -~~~~~~~~~~~ - -This function returns the total number of audio samples read from Audio Codec if data buffer with new data is present. Otherwise, it will return 0. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BasicInputOutput `_ - -.. note :: “AudioCodec.h” must be included to use the class function. - -**AudioCodec::setWriteCallback** --------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set a callback function to be notified when a data buffer is available for data write. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void setWriteCallback(void(*writeCB)(void)); - -**Parameters** -~~~~~~~~~~~~~~ - -writeCB: function to be called when data buffer becomes available for data write. Takes no arguments and returns nothing. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: After starting the Audio Codec with AudioCodec::begin(), the callback function will be called each time the Audio Codec finishes outputting the data in a buffer page. - “AudioCodec.h” must be included to use the class function. - -**AudioCodec::setReadCallback** -------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set a callback function to be notified when there is available data buffer with audio data to be read. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void setReadCallback(void(*readCB)(void)); - -**Parameters** -~~~~~~~~~~~~~~ - -readCB: function to be called when data buffer with new data becomes available for data read. Takes no arguments and returns nothing. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: After starting the Audio Codec with AudioCodec::begin(), the callback function will be called each time the Audio Codec fills up a buffer page with newly acquired audio samples. - “AudioCodec.h” must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/AudioCodec/Class FFT.rst b/bak/ambd/_common/API_Documents/AudioCodec/Class FFT.rst deleted file mode 100644 index ebde3a1..0000000 --- a/bak/ambd/_common/API_Documents/AudioCodec/Class FFT.rst +++ /dev/null @@ -1,217 +0,0 @@ -Class FFT -========= - -.. contents:: - :local: - :depth: 2 - -**FFT Class** -------------- - -**Description** -~~~~~~~~~~~~~~~ - -A class used for performing FFT calculations with real-number inputs and outputs. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - class FFT - -**Members** -~~~~~~~~~~~ - -+---------------------------+---------------------------------------------+ -| **Public Constructors** | -+===========================+=============================================+ -| FFT::FFT | Constructs a FFT class object. | -+---------------------------+---------------------------------------------+ -| **Public Methods** | -+---------------------------+---------------------------------------------+ -| FFT::setWindow | Set window function used for FFT | -| | calculations | -+---------------------------+---------------------------------------------+ -| FFT::calculate | Calculate FFT for an array of input values. | -+---------------------------+---------------------------------------------+ -| FFT::getFrequencyBins | Get the FFT output frequency bins. | -+---------------------------+---------------------------------------------+ -| FFT::getFFTSize | Get the size of FFT output for a given | -| | SampleCount. | -+---------------------------+---------------------------------------------+ - -**FFT::FFT** ------------- - -**Description** -~~~~~~~~~~~~~~~ - -Constructs a FFT class object. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void FFT(Void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `FFT `_ - -.. note :: “FFT.h” must be included to use the class function. - -**FFT::setWindow** ------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set window function used for FFT calculations. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void setWindow(FFTWindow_t window, uint16_t sampleCount); - -**Parameters** -~~~~~~~~~~~~~~ - -window: The window function to be used in FFT calculations. -Valid values: -- None (Default rectangular window) -- Hann -- Hamming -sampleCount: Number of sample datapoints in the input array. Valid values: 16, 32, 64, 128, 256, 512, 1024, 2048. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `FFT `_ - -.. note :: The window function is used to reduce the effects of discontinuities that occur when the input signal has frequencies that do not fit an integer number of periods in the sample datapoints. - More information on FFTs and window functions can be seen at: - https://download.ni.com/evaluation/pxi/Understanding%20FFTs%20and%20Windowing.pdf - https://en.wikipedia.org/wiki/Window_function - “FFT.h” must be included to use the class function. - -**FFT::Calculate** ------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Calculate FFT for an array of input values. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void calculate(float* inputBuf, float* outputBuf, uint16_t sampleCount); - void calculate(int16_t* inputBuf, float* outputBuf, uint16_t sampleCount); - -**Parameters** -~~~~~~~~~~~~~~ - -inputBuf: pointer to an array of sampleCount size, containing input sample datapoints, in float or uint16_t format. -outputBuf: pointer to a float array of (sampleCount / 2) size, for containing calculated FFT result. -sampleCount: number of sample datapoints in the input array. Valid values: 16, 32, 64, 128, 256, 512, 1024, 2048. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `FFT `_ - -.. note :: Larger sample counts will require more time for FFT calculations, but will provide a higher frequency resolution output. - “FFT.h” must be included to use the class function. - -**FFT::getFrequencyBins** -------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get a corresponding output FFT frequency bin for a given sample rate and sample count. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void getFrequencyBins(uint16_t* outputBuf, uint16_t sampleCount, uint32_t sampleRate); - -**Parameters** -~~~~~~~~~~~~~~ - -outputBuf: pointer to a uint16_t array of (sampleCount / 2) size, for containing the calculated center frequency of each FFT output element. -sampleCount: number of sample datapoints in the input array. Valid values: 16, 32, 64, 128, 256, 512, 1024, 2048. -sampleRate: Defines how many times an audio signal is sampled in a second. In the example “FFT.ino”, sample rate is set at 16000, which means that each audio signal contains 16000 individual samples. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `FFT `_ - -.. note :: “FFT.h” must be included to use the class function. - -**FFT::getFFTSize** -------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the size of FFT output for a given sampleCount. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - uint16_t getFFTSize(uint16_t sampleCount); - -**Parameters** -~~~~~~~~~~~~~~ - -sampleCount: number of sample datapoints in the input array. Valid values: 16, 32, 64, 128, 256, 512, 1024, 2048. - -**Returns** -~~~~~~~~~~~ - -This function returns the FFT output size for the given sampleCount, which is (sampleCount / 2). - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: “FFT.h” must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/AudioCodec/Class PlaybackWav.rst b/bak/ambd/_common/API_Documents/AudioCodec/Class PlaybackWav.rst deleted file mode 100644 index 026389f..0000000 --- a/bak/ambd/_common/API_Documents/AudioCodec/Class PlaybackWav.rst +++ /dev/null @@ -1,475 +0,0 @@ -Class PlaybackWav -================= - -.. contents:: - :local: - :depth: 2 - -**PlaybackWav Class** ---------------------- - -**Description** -~~~~~~~~~~~~~~~ - -A class used for controlling and playback of .wav file format audio data. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - class PlaybackWav - -**Members** -~~~~~~~~~~~ - -+---------------------------------+----------------------------------------------------------+ -| **Public Constructors** | -+=================================+==========================================================+ -| PlaybackWav::PlaybackWav | Constructs a PlaybackWav class object. | -+---------------------------------+----------------------------------------------------------+ -| **Public Methods** | -+---------------------------------+----------------------------------------------------------+ -| PlaybackWav::openFile | Open a .wav audio file for playback. | -+---------------------------------+----------------------------------------------------------+ -| PlaybackWav::closeFile | Close a previously opened audio file. | -+---------------------------------+----------------------------------------------------------+ -| PlaybackWav::fileOpened | Check if a .wav file is already opened. | -+---------------------------------+----------------------------------------------------------+ -| PlaybackWav::getSampleRate | Get the sample rate of the .wav file. | -+---------------------------------+----------------------------------------------------------+ -| PlaybackWav::getChannelCount | Get the number of audio channels in the .wav file. | -+---------------------------------+----------------------------------------------------------+ -| PlaybackWav::getBitDepth | Get the bit depth of each sample in the .wav file. | -+---------------------------------+----------------------------------------------------------+ -| PlaybackWav::getLengthMillis | Get the playback length of the .wav file in milliseconds.| -+---------------------------------+----------------------------------------------------------+ -| PlaybackWav::getPositionMillis | Get the current playback position in milliseconds. | -+---------------------------------+----------------------------------------------------------+ -| PlaybackWav::setPositionMillis | Set the current playback position in milliseconds. | -+---------------------------------+----------------------------------------------------------+ -| PlaybackWav::millisToBytes | Convert a playback duration from milliseconds to bytes. | -+---------------------------------+----------------------------------------------------------+ -| PlaybackWav::bytesToMillis | Convert a playback duration from bytes to milliseconds. | -+---------------------------------+----------------------------------------------------------+ -| PlaybackWav::readAudioData | Read audio data from the .wav file. | -+---------------------------------+----------------------------------------------------------+ - -**PlaybackWav::PlaybackWav** ----------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Constructs a PlaybackWav class object. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void PlaybackWav(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `PlaybackWavFile `_ - -.. note :: “PlaybackWav.h” must be included to use the class function. - -**PlaybackWav::openFile** -------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Open a .wav file for playback. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void openFile(const char* absFilepath); - -**Syntax** -~~~~~~~~~~ - -absFilepath: The filepath of the .wav file that will be opened. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `PlaybackWavFile `_ - -.. note :: “PlaybackWav.h” must be included to use the class function. - -**PlaybackWav::closeFile** --------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Close a previously opened audio file. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void closeFile(void); - -**Syntax** -~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: “PlaybackWav.h” must be included to use the class function. - -**PlaybackWav::fileOpened** ---------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Check if a .wav file is already opened. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - bool fileOpened(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns true if a .wav file is already open, false otherwise. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `RecordPlaybackWav `_ - -.. note :: “PlaybackWav.h” must be included to use the class function. - -**PlaybackWav::getSampleRate** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the sample rate of the .wav file. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - uint32_t getSampleRate(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -The function returns sampling rate encoded in the .wav file header. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `PlaybackWavFile `_ - -.. note :: “PlaybackWav.h” must be included to use the class function. - -**PlaybackWav::getChannelCount** --------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the number of audio channels in the .wav file. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - uint16_t getChannelCount(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -The function returns channel count encoded in the .wav file header. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `PlaybackWavFile `_ - -.. note :: “PlaybackWav.h” must be included to use the class function. - -**PlaybackWav::getBitDepth** ----------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the bit depth of each sample in the .wav file. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - uint16_t getBitDepth(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -The function returns bit depth encoded in the .wav file header. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `PlaybackWavFile `_ - -.. note :: “PlaybackWav.h” must be included to use the class function. - -**PlaybackWav::getLengthMillis** --------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the playback length of the .wav file in milliseconds. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - uint32_t getLengthMillis(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -The function returns the total playback length of the currently open .wav file in milliseconds. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `PlaybackWavFile `_ - -.. note :: “PlaybackWav.h” must be included to use the class function. - -**PlaybackWav::getPositionMillis** ----------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the current playback position in milliseconds. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - uint32_t getPositionMillis(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -The function returns the current playback position of the currently open .wav file in milliseconds. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `PlaybackWavFile `_ - -.. note :: “PlaybackWav.h” must be included to use the class function. - -**PlaybackWav::setPositionMillis** ----------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the current playback position in milliseconds. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void setPositionMillis(uint32_t pos); - -**Parameters** -~~~~~~~~~~~~~~ - -pos: The desired playback position expressed in milliseconds. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `PlaybackWavFile `_ - -.. note :: Any changes to playback position will only take effect on the next call to PlaybackWav::readAudioData. If the desired playback position is beyond the total playback length of the file, the playback position will be set to the end of file, and no audio data will be output on subsequent data reads. - “PlaybackWav.h” must be included to use the class function. - -**PlaybackWav::millisToBytes** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Convert a playback duration from milliseconds to bytes. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - uint32_t millisToBytes(uint32_t ms); - -**Parameters** -~~~~~~~~~~~~~~ - -ms: playback duration in milliseconds. - -**Returns** -~~~~~~~~~~~ - -This function returns the number of bytes that is equivalent to the input playback duration in ms, converted using the current sample rate, number of channels and bit depth. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: “PlaybackWav.h” must be included to use the class function. - -**PlaybackWav::bytesToMillis** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Convert a playback duration from bytes to milliseconds. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - uint32_t bytesToMillis(uint32_t bytes); - -**Parameters** -~~~~~~~~~~~~~~ - -bytes: playback duration in number of bytes. - -**Returns** -~~~~~~~~~~~ - -This function returns the time duration in milliseconds that is equivalent to the input number of bytes, converted using the current sample rate, number of channels and bit depth. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: “PlaybackWav.h” must be included to use the class function. - -**PlaybackWav::readAudioData** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Read audio data from the .wav file. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - uint32_t readAudioData(int8_t* dst, uint32_t len); - uint32_t readAudioData(int16_t* dst, uint32_t len); - -**Parameters** -~~~~~~~~~~~~~~ - -dst: Pointer to an array that stores audio data from .wav file to be read . -len: number of audio samples to be read from .wav file. - -**Returns** -~~~~~~~~~~~ - -This function returns number of audio samples to be read. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `PlaybackWavFile `_ - -.. note :: “PlaybackWav.h” must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/AudioCodec/Class RecordWav.rst b/bak/ambd/_common/API_Documents/AudioCodec/Class RecordWav.rst deleted file mode 100644 index b961632..0000000 --- a/bak/ambd/_common/API_Documents/AudioCodec/Class RecordWav.rst +++ /dev/null @@ -1,405 +0,0 @@ -Class RecordWav -=============== - -.. contents:: - :local: - :depth: 2 - -**RecordWav Class** -------------------- - -**Description** -~~~~~~~~~~~~~~~ - -A class used for control and recording of .wav file format audio data. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - class RecordWav - -**Members** -~~~~~~~~~~~ - -+------------------------------+-------------------------------------------------------------------+ -| **Public Constructors** | | -+==============================+===================================================================+ -| RecordWav::RecordWav | Constructs and initializes a RecordWav class object. | -+------------------------------+-------------------------------------------------------------------+ -| **Public Methods** | | -+------------------------------+-------------------------------------------------------------------+ -| RecordWav::openFile | Open a .wav audio file for recording. | -+------------------------------+-------------------------------------------------------------------+ -| RecordWav::closeFile | Close a previously opened audio file. | -+------------------------------+-------------------------------------------------------------------+ -| RecordWav::fileOpened | Check if a .wav file is already opened. | -+------------------------------+-------------------------------------------------------------------+ -| RecordWav::setSampleRate | Set the recording sample rate of the .wav file. | -+------------------------------+-------------------------------------------------------------------+ -| RecordWav::setChannelCount | Set the number of audio channels in the .wav file. | -+------------------------------+-------------------------------------------------------------------+ -| RecordWav::setBitDepth | Set the bit depth of each sample in the .wav file. | -+------------------------------+-------------------------------------------------------------------+ -| RecordWav::getLengthMillis | Get the current length of the recorded .wav file in milliseconds. | -+------------------------------+-------------------------------------------------------------------+ -| RecordWav::millisToBytes | Convert a playback duration from milliseconds to bytes. | -+------------------------------+-------------------------------------------------------------------+ -| RecordWav::bytesToMillis | Convert a playback duration from bytes to milliseconds. | -+------------------------------+-------------------------------------------------------------------+ -| RecordWav::writeAudioData | Write audio data to the .wav file. | -+------------------------------+-------------------------------------------------------------------+ - -**RecordWav::RecordWav** ------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Constructs a RecordWav class object. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void RecordWav(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `RecordWavFile `_ - -.. note :: “RecordWav.h” must be included to use the class function. - -**RecordWav::openFile** ------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Open a .wav audio file for recording. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void openFile(const char* absFilepath); - -**Parameters** -~~~~~~~~~~~~~~ - -absFilepath: The absolute filepath of the .wav file that to be opened. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `RecordWavFile `_ - -.. note :: “RecordWav.h” must be included to use the class function. - -**RecordWav::closeFile** ------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Close a previously opened audio file. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void closeFile(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `RecordWavFile `_ - -.. note :: After recording is complete, any open.wav files should be closed; otherwise, recorded audio data may be lost. - “RecordWav.h” must be included to use the class function. - -**RecordWav::fileOpened** -------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Check if a .wav file is already opened. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - bool fileOpened(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns true if a .wav file is already open, false otherwise. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `RecordWavFile `_ - -.. note :: “RecordWav.h” must be included to use the class function. - -**RecordWav::setSampleRate** ----------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the recording sample rate of the .wav file. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void setSampleRate(uint32_t sampleRate); - -**Parameters** -~~~~~~~~~~~~~~ - -sampleRate: recording sample rate. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `RecordWavFile `_ - -.. note :: “RecordWav.h” must be included to use the class function. - -**RecordWav::setChannelCount** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the number of recording audio channels in the .wav file. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - void setChannelCount(uint16_t channelCount); - -**Parameters** -~~~~~~~~~~~~~~ - -channelCount: number of recording audio channels. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: “RecordWav.h” must be included to use the class function. - -**RecordWav::setBitDepth** --------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the recording bit depth of each sample in the .wav file. - -**Syntax** -~~~~~~~~~~ -.. code:: c++ - - void setBitDepth(uint16_t bitDepth); - -**Parameters** -~~~~~~~~~~~~~~ - -bitDepth: number of bits per sample. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: “RecordWav.h” must be included to use the class function. - -**RecordWav::getLengthMillis** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the current length of the recorded .wav file in milliseconds. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - uint32_t getLengthMillis(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the current length of the recorded .wav file in milliseconds. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: “RecordWav.h” must be included to use the class function. - -**RecordWav::millisToBytes** ----------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Convert a playback duration from milliseconds to bytes. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - uint32_t millisToBytes(uint32_t ms); - -**Parameters** -~~~~~~~~~~~~~~ - -ms: playback duration in milliseconds. - -**Returns** -~~~~~~~~~~~ - -This function returns the number of bytes that is equivalent to the input playback duration in ms, converted using the current sample rate, number of channels and bit depth. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: “RecordWav.h” must be included to use the class function. - -**RecordWav::bytesToMillis** ----------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Convert a playback duration from bytes to milliseconds. - -**Syntax** -~~~~~~~~~~ - -.. code:: c++ - - uint32_t bytesToMillis(uint32_t bytes); - -**Parameters** -~~~~~~~~~~~~~~ - -bytes: playback duration in number of bytes. - -**Returns** -~~~~~~~~~~~ - -This function returns the time duration in milliseconds that is equivalent to the input number of bytes, converted using the current sample rate, number of channels and bit depth. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: “RecordWav.h” must be included to use the class function. - -**RecordWav::writeAudioData** ------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Write audio data to the .wav file. - -**Syntax** -~~~~~~~~~~ -.. code:: c++ - - uint32_t writeAudioData(int8_t* src, uint32_t len); - uint32_t writeAudioData(int16_t* src, uint32_t len); - -**Parameters** -~~~~~~~~~~~~~~ - -src: pointer to array containing data to write to .wav file. -len: number of audio samples to write to .wav file. - -**Returns** -~~~~~~~~~~~ - -The function returns number of audio samples written to the .wav file. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `RecordWavFile `_ - -.. note :: “RecordWav.h” must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/AudioCodec/index.rst b/bak/ambd/_common/API_Documents/AudioCodec/index.rst deleted file mode 100644 index 57320ca..0000000 --- a/bak/ambd/_common/API_Documents/AudioCodec/index.rst +++ /dev/null @@ -1,10 +0,0 @@ -AudioCodec -========== - -.. toctree:: - :maxdepth: 1 - - Class AudioCodec - Class FFT - Class PlaybackWav - Class RecordWav diff --git a/bak/ambd/_common/API_Documents/BLE/Class BLEAddr.rst b/bak/ambd/_common/API_Documents/BLE/Class BLEAddr.rst deleted file mode 100644 index feff24b..0000000 --- a/bak/ambd/_common/API_Documents/BLE/Class BLEAddr.rst +++ /dev/null @@ -1,137 +0,0 @@ -Class BLEAddr -============= - -.. contents:: - :local: - :depth: 2 - -**BLEAddr Class** ------------------ - -**Description** -~~~~~~~~~~~~~~~ - -A class used for managing Bluetooth addresses. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - class BLEAddr - -**Members** -~~~~~~~~~~~ - -+------------------------------+--------------------------------------+ -| **Public Constructors** | -+==============================+======================================+ -| BLEAddr::BLEAddr | Constructs a BLEAddr object | -+------------------------------+--------------------------------------+ -| **Public Methods** | -+------------------------------+--------------------------------------+ -| BLEAddr::str | Get the Bluetooth address | -| | represented as a formatted string | -+------------------------------+--------------------------------------+ -| BLEAddr::data | Get the Bluetooth address | -| | represented as an integer array | -+------------------------------+--------------------------------------+ - -**BLEAddr::BLEAddr** --------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Constructs a BLEAddr object. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLEAddr(void); - BLEAddr(uint8_t (&addr)[6]); - BLEAddr(const char * str); - -**Parameters** -~~~~~~~~~~~~~~ - -addr: An array of 6 bytes containing the desired Bluetooth address. - -str: desired Bluetooth address represented in character string. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: When expressing the Bluetooth address as a string, it should be written as 6 bytes in hexadecimal format. The bytes can be separated using a colon ":", for example – 00:11:22:33:EE:FF. "BLEAddr.h" must be included to use the class function. - -**BLEAddr::str** ----------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the Bluetooth address represented as a formatted string. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - const char* str(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns a pointer to the character string containing the hexadecimal representation of the Bluetooth address. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEScan `_ - -.. note :: When expressing the Bluetooth address as a string, it should be written as 6 bytes in hexadecimal format. The bytes can be separated using a colon ":", for example – 00:11:22:33:EE:FF. "BLEAddr.h" must be included to use the class function. - -**BLEAddr::data** ------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Get the Bluetooth address represented as an integer array. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint8_t* data(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns a pointer to a 6-byte array containing the Bluetooth address. - -**Example Code** - -NA - -.. note :: The MSB of Bluetooth address is stored at index 5 of the byte array. "BLEAddr.h" must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/BLE/Class BLEAdvert.rst b/bak/ambd/_common/API_Documents/BLE/Class BLEAdvert.rst deleted file mode 100644 index fef3f73..0000000 --- a/bak/ambd/_common/API_Documents/BLE/Class BLEAdvert.rst +++ /dev/null @@ -1,327 +0,0 @@ -Class BLEAdvert -=============== - -.. contents:: - :local: - :depth: 2 - -**BLEAdvert Class** -------------------- - -**Description** -~~~~~~~~~~~~~~~ - -A class used for managing BLE advertising settings. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - class BLEAdvert - -**Members** -~~~~~~~~~~~ - -+---------------------------------+----------------------------------------------------------------------+ -| **Public Constructors** | No public constructor is available as this class is intended to be a | -| | singleton class. You can get a pointer to this class using | -| | BLEDevice::configAdvert(). | -+=================================+======================================================================+ -| **Public Methods** | -+---------------------------------+----------------------------------------------------------------------+ -| BLEAdvert::updateAdvertParams | Update the current BLE advertisement settings. | -+---------------------------------+----------------------------------------------------------------------+ -| BLEAdvert::startAdv | Start BLE advertising. | -+---------------------------------+----------------------------------------------------------------------+ -| BLEAdvert::stopAdv | Stop BLE advertising. | -+---------------------------------+----------------------------------------------------------------------+ -| BLEAdvert::setAdvType | Set the BLE advertising type. | -+---------------------------------+----------------------------------------------------------------------+ -| BLEAdvert::setMinInterval | Set the BLE advertising minimum interval. | -+---------------------------------+----------------------------------------------------------------------+ -| BLEAdvert::setMaxInterval | Set the BLE advertising maximum interval. | -+---------------------------------+----------------------------------------------------------------------+ -| BLEAdvert::setAdvData | Set BLE advertising data. | -+---------------------------------+----------------------------------------------------------------------+ -| BLEAdvert::setScanRspData | Set BLE scan response data. | -+---------------------------------+----------------------------------------------------------------------+ - -**BLEAdvert::updateAdvertParams** ---------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Update the current BLE advertisement settings. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void updateAdvertParams(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEWifiConfig `_ - -.. note :: Please use the other class member functions to set the BLE advertising parameters before using this function to update the advert data. "BLEAdvert.h" must be included to use the class function. - -**BLEAdvert::startAdv** ------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Start BLE advertising. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void startAdv(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEWifiConfig `_ - -.. note :: This function gives you more control and flexibility over BLE advertising parameters. This function should not be used to start the BLE advertising process without first registering the necessary callback and handler functions. Call BLEDevice::beginPeripheral() to register the necessary functions and start advertising for the first time."BLEAdvert.h" must be included to use the class function. - -**BLEAdvert::stopAdv** ----------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Stop BLE advertising. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void stopAdv(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEWifiConfig `_ - -.. note :: This function gives you more control and flexibility over BLE advertising parameters. This function should not be used to directly stop the BLE advertising process. Call BLEDevice::end() to stop advertising and free up used resources. "BLEAdvert.h" must be included to use the class function. - -**BLEAdvert::setAdvType** -------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the BLE advertising type. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setAdvType(uint8_t advType); - -**Parameters** -~~~~~~~~~~~~~~ - -advType: the desired advertisement type. - -- GAP_ADTYPE_ADV_IND (0, connectable undirected advertisement) - -- GAP_ADTYPE_ADV_HDC_DIRECT_IND (1, connectable high duty cycle directed advertisement) - -- GAP_ADTYPE_ADV_SCAN_IND (2, scannable undirected advertisement) - -- GAP_ADTYPE_ADV_NONCONN_IND (3, Non-connectable undirected advertisement) - -- GAP_ADTYPE_ADV_LDC_DIRECT_IND (4, connectable low duty cycle directed advertisement) - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBeacon `_ - -.. note :: If connection requests should be allowed, call this function with GAP_ADTYPE_ADV_IND. If all connection requests should be rejected, call this function with GAP_ADTYPE_ADV_NONCONN_IND. "BLEAdvert.h" must be included to use the class function. - -**BLEAdvert::setMinInterval** ------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Set the minimum BLE advertising interval. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setMinInterval(uint16_t minInt_ms); - -**Parameters** -~~~~~~~~~~~~~~ - -minInt_ms: the desired advertisement minimum interval, expressed in milliseconds. - -- 20 to 10240. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: BLE advertisements will repeat with an interval between the set minimum and maximum intervals. Set a shorter interval for the BLE device to be discovered rapidly and set a longer interval to conserve power. "BLEAdvert.h" must be included to use the class function. - -**BLEAdvert::setMaxInterval** ------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Set the maximum BLE advertising interval. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setMaxInterval(uint16_t minInt_ms); - -**Parameters** -~~~~~~~~~~~~~~ - -minInt_ms: the desired advertisement maximum interval, expressed in milliseconds. - -- 20ms to 10240. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: BLE advertisements will repeat with an interval between the set minimum and maximum intervals. Set a shorter interval for the BLE device to be discovered rapidly and set a longer interval to conserve power. "BLEAdvert.h" must be included to use the class function. - -**BLEAdvert::setAdvData** -------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set BLE advertising data. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setAdvData(BLEAdvertData adData); - void setAdvData(uint8_t* pData, uint8_t size); - -**Parameters** -~~~~~~~~~~~~~~ - -adData: advertising data formatted in a BLEAdvertData class object. - -pData: pointer to a byte array containing the required advertising data. - -size: number of bytes the advertising data contains, maximum of 31 bytes. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEWifiConfig `_ - -.. note :: "BLEAdvert.h" must be included to use the class function. - -**BLEAdvert::setScanRspData** ------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Set BLE scan response data. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setScanRspData(BLEAdvertData adData); - void setScanRspData(uint8_t* pData, uint8_t size); - -**Parameters** -~~~~~~~~~~~~~~ - -adData: scan response data formatted in a BLEAdvertData class object. - -pData: pointer to a byte array containing the required scan response data. - -size: number of bytes the scan response data contains, maximum of 31 bytes. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEAdvert.h" must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/BLE/Class BLEAdvertData.rst b/bak/ambd/_common/API_Documents/BLE/Class BLEAdvertData.rst deleted file mode 100644 index decf490..0000000 --- a/bak/ambd/_common/API_Documents/BLE/Class BLEAdvertData.rst +++ /dev/null @@ -1,982 +0,0 @@ -Class BLEAdvertData -=================== - -.. contents:: - :local: - :depth: 2 - -**BLEAdvertData Class** ------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -A class used for managing BLE advertising data. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - class BLEAdvertData - -**Members** -~~~~~~~~~~~ - -+----------------------------------+------------------------------------+ -| **Public Constructors** | -+==================================+====================================+ -| BLEAdvertData::BLEAdvertData | Constructs a BLEAdvertData object | -+----------------------------------+------------------------------------+ -| **Public Methods** | -+----------------------------------+------------------------------------+ -| BLEAdvertData::clear | Clear all advertising data. | -+----------------------------------+------------------------------------+ -| BLEAdvertData::addData | Add binary data to advertising | -| | data packet. | -+----------------------------------+------------------------------------+ -| BLEAdvertData::addFlags | Add flags to advertising data | -| | packet. | -+----------------------------------+------------------------------------+ -| BLEAdvertData::addPartialServices| Add partial list of service UUIDs | -| | to advertising data packet. | -+----------------------------------+------------------------------------+ -| BLEAdvertData:: | Add complete service UUIDs to | -| addCompleteServices | advertising data packet. | -+----------------------------------+------------------------------------+ -| BLEAdvertData::addAppearance | Add device appearance to | -| | advertising data packet. | -+----------------------------------+------------------------------------+ -| BLEAdvertData::addShortName | Add shortened device name to | -| | advertising data packet. | -+----------------------------------+------------------------------------+ -| BLEAdvertData::addCompleteName | Add complete device name to | -| | advertising data packet. | -+----------------------------------+------------------------------------+ -| BLEAdvertData::parseScanInfo | Parse advertising data packets | -| | received from a scan. | -+----------------------------------+------------------------------------+ -| BLEAdvertData::hasFlags | Check if received data includes | -| | advertising flags. | -+----------------------------------+------------------------------------+ -| BLEAdvertData::hasUUID | Check if received data includes | -| | service UUIDs. | -+----------------------------------+------------------------------------+ -| BLEAdvertData::hasName | Check if received data includes | -| | device name. | -+----------------------------------+------------------------------------+ -| BLEAdvertData::hasManufacturer | Check if received data includes | -| | manufacturer data. | -+----------------------------------+------------------------------------+ -| BLEAdvertData::getAdvType | Get advertising type of received | -| | data. | -+----------------------------------+------------------------------------+ -| BLEAdvertData::getAddrType | Get Bluetooth address type of | -| | received data. | -+----------------------------------+------------------------------------+ -| BLEAdvertData::getAddr | Get Bluetooth address of received | -| | data. | -+----------------------------------+------------------------------------+ -| BLEAdvertData::getRSSI | Get received signal strength | -| | indicator (RSSI) of received data. | -+----------------------------------+------------------------------------+ -| BLEAdvertData::getFlags | Get advertising flags of received | -| | data | -+----------------------------------+------------------------------------+ -| BLEAdvertData::getServiceCount | Get the total number of advertised | -| | services in the received data. | -+----------------------------------+------------------------------------+ -| BLEAdvertData::getServiceList | Get a list of advertised service | -| | UUIDs in received data. | -+----------------------------------+------------------------------------+ -| BLEAdvertData::getName | Get advertised device name in | -| | received data. | -+----------------------------------+------------------------------------+ -| BLEAdvertData::getTxPower | Get the advertised transmission | -| | power from received data. | -+----------------------------------+------------------------------------+ -| BLEAdvertData::getAppearance | Get advertised device appearance | -| | in received data. | -+----------------------------------+------------------------------------+ -| BLEAdvertData::getManufacturer | Get advertised manufacturer in | -| | received data. | -+----------------------------------+------------------------------------+ -| BLEAdvertData:: | Get length of manufacturer data in | -| getManufacturerDataLength | received data. | -+----------------------------------+------------------------------------+ -| BLEAdvertData:: | Get advertised manufacturer data | -| getManufacturerData | in received data. | -+----------------------------------+------------------------------------+ - -**BLEAdvertData::BLEAdvertData** --------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Constructs a BLEAdvertData object. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLEAdvertData(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: This class is used for managing BLE advertising data for two primary uses. First is to assemble advertising data for broadcasting as advertising packets. Second is to process and split up the advertising data received from a scan into separate types. "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData::clear** ------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Clear all advertising data. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void clear(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData::addData** --------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Add binary data to advertising data packet. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void addData(const uint8_t* data, uint8_t size); - -**Parameters** -~~~~~~~~~~~~~~ - -data: pointer to array containing desired advertising data. - -size: number of bytes in the array. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: This function is provided for flexibility in adding BLE advertising data. Other functions should be used for adding advertising data, if possible, as this function does not perform any checks on the validity of the data. "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData::addFlags** ---------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Add flags to advertising data packet. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint8_t addFlags(uint8_t flags); - -**Parameters** -~~~~~~~~~~~~~~ - -flags: desired flags to add to advertising data. Default value is (GAP_ADTYPE_FLAGS_LIMITED | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED). - -- GAP_ADTYPE_FLAGS_LIMITED (LE Limited Discoverable Mode - -- GAP_ADTYPE_FLAGS_GENERAL (LE General Discoverable Mode) - -- GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED (BR/EDR Not Supported) - -- GAP_ADTYPE_FLAGS_SIMULTANEOUS_LE_BREDR_CONTROLLER (Simultaneous LE and BR/EDR Controller Supported) - -- GAP_ADTYPE_FLAGS_SIMULTANEOUS_LE_BREDR_HOST (Simultaneous LE and BR/EDR Host Supported) - -**Returns** -~~~~~~~~~~~ - -This function returns the current total size of advertising data. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBatteryService `_ - -.. note :: "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData::addPartialServices** -------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Add partial list of service UUIDs to advertising data packet. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint8_t addPartialServices(BLEUUID uuid); - -**Parameters** -~~~~~~~~~~~~~~ - -uuid: the desired UUID contained in BLEUUID class object. - -**Returns** -~~~~~~~~~~~ - -This function returns the current total size of the advertising data. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData:: addCompleteServices** ---------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Add complete list of service UUIDs to advertising data packet. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint8_t addCompleteServices(BLEUUID uuid); - uint8_t addCompleteServices(uint8_t uuidBitLength); - -**Parameters** -~~~~~~~~~~~~~~ - -uuid: the desired UUID contained in BLEUUID class object. - -uuidBitLength: UUID bit length for which a blank entry is to be added. - -- 16. - -- 32. - -- 128. - -**Returns** - -This function returns the current total size of the advertising data. - -**Example Code** - -Example: `BLEBatteryService `_ - -.. note :: uuidBitLength is used when a blank entry in the advertisement data is required to be present. It is to indicate that no services with UUIDs of a certain length are available. "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData::addAppearance** --------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Add device appearance to advertising data. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint8_t addAppearance(uint16_t appearance); - -**Parameters** -~~~~~~~~~~~~~~ - -appearance: the desired device appearance. - -**Returns** -~~~~~~~~~~~ - -This function returns the current total size of the advertising data. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDGamepad `_ - -.. note :: Refer to "gap_le_types.h" or Bluetooth specifications for a full list of device appearance values. "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData::addShortName** -------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Add shortened device name to advertising data packet. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint8_t addShortName(const char* str); - -**Parameters** -~~~~~~~~~~~~~~ - -str: character string containing desired short device name. - -**Returns** -~~~~~~~~~~~ - -This function returns the current total size of the advertising data. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData::addCompleteName** ----------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Add complete device name to advertising data packet. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint8_t addCompleteName(const char* str); - -**Parameters** -~~~~~~~~~~~~~~ - -str: character string containing desired device name. - -**Returns** -~~~~~~~~~~~ - -This function returns the current total size of the advertising data. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBatteryService `_ - -.. note :: "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData::parseScanInfo** --------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Parse advertising data packets received from a scan. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void parseScanInfo(T_LE_CB_DATA *p_data); - -**Parameters** -~~~~~~~~~~~~~~ - -p_data: pointer to advertising data received from a Bluetooth scan. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBatteryClient `_ - -.. note :: The information of the received data from advertising data can be accessed using the member functions starting with "has" and "get". "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData::hasFlags** ---------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Check if received data includes advertising flags. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool hasFlags(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns true if flags are present in received advertising data. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData::hasUUID** --------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Check if received data includes service UUIDs. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool hasUUID(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns true if service UUIDs are present in received advertising data. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData::hasName** --------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Check if received data includes device name. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool hasName(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns true if device name is present in received advertising data. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBatteryClient `_ - -.. note :: "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData::hasManufacturer** ----------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Check if received data includes manufacturer data. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool hasManufacturer(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns true if manufacturer data is present in the received advertising data. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData::getAdvType** ------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Get advertising type of received data. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - T_GAP_ADV_EVT_TYPE getAdvType(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the advertising type of received advertising data. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: - - Possible types: - - - GAP_ADV_EVT_TYPE_UNDIRECTED - - - GAP_ADV_EVT_TYPE_DIRECTED - - - GAP_ADV_EVT_TYPE_SCANNABLE - - - GAP_ADV_EVT_TYPE_NON_CONNECTABLE - - - GAP_ADV_EVT_TYPE_SCAN_RSP - - "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData::getAddrType** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get Bluetooth address type of received data. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: C++ - - T_GAP_REMOTE_ADDR_TYPE getAddrType(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the Bluetooth address type of received data. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: - - Possible types: - - - GAP_REMOTE_ADDR_LE_PUBLIC - - - GAP_REMOTE_ADDR_LE_RANDOM - - "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData::getRSSI** --------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get received signal strength indicator (RSSI) of received data. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - Int8_t getRSSI(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the received signal strength. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData::getFlags** ---------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get advertising flags of received data. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint8_t getFlags(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns a single byte containing the advertising flags found in received advertising data. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData::getServiceCount** ----------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the total number of advertised services in the received data. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint8_t getServiceCount(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the number of advertised service UUIDs in received data. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBatteryClient `_ - -.. note :: "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData::getServiceList** ---------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get a list of advertised service UUIDs in received data. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLEUUID* getServiceList(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns a pointer to a BLEUUID array containing all advertised service UUIDs. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBatteryClient `_ - -.. note :: "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData::getName** --------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get advertised device name in received data. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - String getName(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns advertised device name contained in a String class object. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBatteryClient `_ - -.. note :: "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData::getTxPower** ------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Get the advertised transmission power of the received data. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - int8_t getTxPower(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns advertised transmission power of the received data. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData::getAppearance** --------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get advertised device appearance in received data. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint16_t getAppearance(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns advertised device appearance of the received data. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Refer to "gap_le_types.h" or Bluetooth specifications for full list of device appearance values. "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData::getManufacturer** ----------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get advertised manufacturer in received data. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint16_t getManufacturer(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns advertised manufacturer of the received data. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Refer to Bluetooth specifications for full list of manufacturer codes. "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData::getManufacturerDataLength** --------------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get length of manufacturer data in received data. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint8_t getManufacturerDataLength(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the number of bytes of manufacturer data present in received advertising data. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEAdvertData.h" must be included to use the class function. - -**BLEAdvertData::getManufacturerData** --------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get manufacturer data in received data. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint8_t* getManufacturerData(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns a pointer to an array containing manufacturer data. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEAdvertData.h" must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/BLE/Class BLEBeacon.rst b/bak/ambd/_common/API_Documents/BLE/Class BLEBeacon.rst deleted file mode 100644 index 1ae8cf5..0000000 --- a/bak/ambd/_common/API_Documents/BLE/Class BLEBeacon.rst +++ /dev/null @@ -1,633 +0,0 @@ -Class BLEBeacon -=============== - -.. contents:: - :local: - :depth: 2 - -**iBeacon Class** ------------------ - -**Description** -~~~~~~~~~~~~~~~ - -A class used for managing iBeacon BLE advertising data. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - class iBeacon - -**Members** -~~~~~~~~~~~ - -+------------------------------+-------------------------------------------+ -| **Public Constructors** | -+==============================+===========================================+ -| iBeacon::iBeacon | Constructs an iBeacon object | -+------------------------------+-------------------------------------------+ -| **Public Methods** | -+------------------------------+-------------------------------------------+ -| iBeacon::getManufacturerId | Get current manufacturer ID value | -+------------------------------+-------------------------------------------+ -| iBeacon::getUUID | Get current UUID value | -+------------------------------+-------------------------------------------+ -| iBeacon::getMajor | Get current Major value for customizing | -| | beacons | -+------------------------------+-------------------------------------------+ -| iBeacon::getMinor | Get current Minor value for customizing | -| | beacons | -+------------------------------+-------------------------------------------+ -| iBeacon::getRSSI | Get current received signal strength | -| | indicator (RSSI) value | -+------------------------------+-------------------------------------------+ -| iBeacon::setManufacturerId | Set manufacturer ID value | -+------------------------------+-------------------------------------------+ -| iBeacon::setUUID | Set UUID value | -+------------------------------+-------------------------------------------+ -| iBeacon::setMajor | Set Major value for customizing beacons | -+------------------------------+-------------------------------------------+ -| iBeacon::setMinor | Set Minor value for customizing beacons | -+------------------------------+-------------------------------------------+ -| iBeacon::setRSSI | Set received signal strength indicator | -| | (RSSI) value | -+------------------------------+-------------------------------------------+ -| iBeacon::getAdvData | Get current advertising data | -+------------------------------+-------------------------------------------+ -| iBeacon::getScanRsp | Get current scan response data | -+------------------------------+-------------------------------------------+ - -**altBeacon Class** -------------------- - -**Description** -~~~~~~~~~~~~~~~ - -A class used for managing altBeacon BLE advertising data. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - class altBeacon - -**Members** -~~~~~~~~~~~ - -+------------------------------+---------------------------------------+ -| **Public Constructors** | -+==============================+=======================================+ -| altBeacon::altBeacon | Constructs an altBeacon object | -+------------------------------+---------------------------------------+ -| **Public Methods** | -+------------------------------+---------------------------------------+ -| altBeacon::getManufacturerId | Get current manufacturer ID value | -+------------------------------+---------------------------------------+ -| altBeacon::getUUID | Get current UUID value | -+------------------------------+---------------------------------------+ -| altBeacon::getMajor | Get current Major value for | -| | customizing beacons | -+------------------------------+---------------------------------------+ -| altBeacon::getMinor | Get current Minor value for | -| | customizing beacons | -+------------------------------+---------------------------------------+ -| altBeacon::getRSSI | Get current received signal strength | -| | indicator (RSSI) value | -+------------------------------+---------------------------------------+ -| altBeacon::getRSVD | Get current Reserved value | -+------------------------------+---------------------------------------+ -| altBeacon::setManufacturerId | Set manufacturer ID value | -+------------------------------+---------------------------------------+ -| altBeacon::setUUID | Set UUID value | -+------------------------------+---------------------------------------+ -| altBeacon::setMajor | Set Major value for customizing | -| | beacons | -+------------------------------+---------------------------------------+ -| altBeacon::setMinor | Set Minor value for customizing | -| | beacons | -+------------------------------+---------------------------------------+ -| altBeacon::setRSSI | Set received signal strength | -| | indicator (RSSI) value | -+------------------------------+---------------------------------------+ -| altBeacon::setRSVD | Set Reserved value | -+------------------------------+---------------------------------------+ -| altBeacon::getAdvData | Get current advertising data | -+------------------------------+---------------------------------------+ -| altBeacon::getScanRsp | Get current scan response data | -+------------------------------+---------------------------------------+ - -**iBeacon::iBeacon** --------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Constructs an iBeacon object. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void iBeacon(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEBeacon.h" must be included to use the class function. - -**altBeacon::altBeacon** ------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Constructs an altBeacon object - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void altBeacon(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEBeacon.h" must be included to use the class function. - -**iBeacon::getManufacturerId** / **altBeacon::getManufacturerId** ------------------------------------------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Get current Manufacturer ID value. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint16_t getManufacturerId(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -The function returns a 16-bit unsigned integer containing the current Company ID. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Refer to https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers/ for the full list of assigned Bluetooth company identifiers. "BLEBeacon.h" must be included to use the class function. - -**iBeacon::getUUID** / **altBeacon::getUUID** ---------------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the current UUID value. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void getUUID(uint8_t* UUID); - -**Parameters** -~~~~~~~~~~~~~~ - -UUID: Provide a pointer to a 16 elements uint8_t array containing current UUID. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: UUID is a 128-bit number used to uniquely identify a beacon. It is commonly expressed as a 32-character hexadecimal string. UUIDs can be generated at https://www.uuidgenerator.net/. "BLEBeacon.h" must be included to use the class function. - -**iBeacon::getMajor** / **altBeacon::getMajor** ------------------------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Get current Major value for customizing beacons. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint16_t getMajor(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns a 16-bit unsigned integer containing the current major value. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Major and Minor are values used for customizing beacons. These can be set to any value. Refer to https://developer.apple.com/ibeacon/ or https://altbeacon.org/ for more information. "BLEBeacon.h" must be included to use the class function. - -**iBeacon::getMinor** - **altBeacon::getMinor** ------------------------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Get current Minor value for customizing beacons. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint16_t getMinor(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns a 16-bit unsigned integer containing the current minor value. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Major and Minor are values used for customizing beacons. These can be set to any value. Refer to https://developer.apple.com/ibeacon/ or https://altbeacon.org/ for more information. "BLEBeacon.h" must be included to use the class function. - -**iBeacon::getRSSI** / **altBeacon::getRSSI** ---------------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the current received signal strength indicator (RSSI) value. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - int8_t getRSSI(void); - -**Parameters** -~~~~~~~~~~~~~~ -NA - -**Returns** -~~~~~~~~~~~ - -This function returns an 8-bit signed integer containing the currently set RSSI value. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: The beacon RSSI value is the received signal strength at 1 meter. This can be used to estimate the distance to the beacon. Refer to https://developer.apple.com/ibeacon/ or https://altbeacon.org/ for more information. "BLEBeacon.h" must be included to use the class function. - -**iBeacon::setManufacturerId** / **altBeacon::setManufacturerId** ------------------------------------------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Set Manufacturer ID value. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setManufacturerId(uint16_t id); - -**Parameters** -~~~~~~~~~~~~~~ - -id: desired Manufacturer ID - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBeacon `_ - -.. note :: Refer to https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers/ for the full list of assigned Bluetooth company identifiers. "BLEBeacon.h" must be included to use the class function. - -**iBeacon::setUUID** / **altBeacon::setUUID** ---------------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set UUID value. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setUUID(uint8_t* UUID); - void setUUID(const char* UUID); - -**Parameters** -~~~~~~~~~~~~~~ - -uint8_t* UUID: Provide pointer to a 16 element uint8_t array containing the desired UUID. - -const char* UUID: desired UUID expressed as a character string. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBeacon `_ - -.. note :: UUID is a 128-bit number used to uniquely identify a beacon. It is commonly expressed as a 32-character hexadecimal string. UUIDs can be generated at https://www.uuidgenerator.net/. "BLEBeacon.h" must be included to use the class function. - -**iBeacon::setMajor** / **altBeacon::setMajor** ------------------------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Set Major value for customizing beacons. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setMajor(uint16_t major); - -**Parameters** -~~~~~~~~~~~~~~ - -major: desired Major value - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBeacon `_ - -.. note :: Major and Minor are values used for customizing beacons. These can be set to any value. Refer to https://developer.apple.com/ibeacon/ or https://altbeacon.org/ for more information. "BLEBeacon.h" must be included to use the class function. - -**iBeacon::setMinor** / **altBeacon::setMinor** ------------------------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Set Minor value for customizing beacons. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setMinor(uint16_t minor); - -**Parameters** -~~~~~~~~~~~~~~ - -minor: desired Minor value - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBeacon `_ - -.. note :: Major and Minor are values used for customizing beacons. These can be set to any value. Refer to https://developer.apple.com/ibeacon/ or https://altbeacon.org/ for more information. "BLEBeacon.h" must be included to use the class function. - -**iBeacon::setRSSI** / **altBeacon::setRSSI** ---------------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set RSSI value. - -**Syntax** -~~~~~~~~~~ - -.. code-block::c++ - - void setRSSI(int8_t RSSI); - -**Parameters** -~~~~~~~~~~~~~~ - -RSSI: desired RSSI value - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBeacon `_ - -.. note :: The beacon RSSI value is the received signal strength at 1 meter. This can be used to estimate the distance to the beacon. Refer to https://developer.apple.com/ibeacon/ or https://altbeacon.org/ for more information. "BLEBeacon.h" must be included to use the class function. - -**iBeacon::getAdvData** / **altBeacon::getAdvData** ---------------------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get current beacon advertising data. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint8_t* getAdvData(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns a uint8_t pointer to the structure containing beacon advertising data. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Avoid changing the beacon data through the returned pointer, use the member functions instead. "BLEBeacon.h" must be included to use the class function. - -**iBeacon::getScanRsp** / **altBeacon::getScanRsp** ---------------------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get current beacon advertising scan response data. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint8_t* getScanRsp(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns a uint8_t pointer to the structure containing beacon advertising scan response data. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Avoid changing the beacon data through the returned pointer, use the member functions instead. "BLEBeacon.h" must be included to use the class function. - -**altBeacon::getRSVD** ----------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get current Reserved value. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint8_t getRSVD(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns an 8-bit unsigned integer containing the current Reserved value. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Reserved for use by the manufacturer to implement special features. The interpretation of this value is to be defined by the manufacturer and is to be evaluated based on the MFG ID value. Refer to https://altbeacon.org/ for more information. "BLEBeacon.h" must be included to use the class function. - -**altBeacon::setRSVD** ----------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set Reserved value. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setRSVD(uint8_t rsvd); - -**Parameters** -~~~~~~~~~~~~~~ - -rsvd: desired Reserved value - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ -NA - -.. note :: Reserved for use by the manufacturer to implement special features. The interpretation of this value is to be defined by the manufacturer and is to be evaluated based on the MFG ID value. Refer to https://altbeacon.org/ for more information. "BLEBeacon.h" must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/BLE/Class BLECharacteristic.rst b/bak/ambd/_common/API_Documents/BLE/Class BLECharacteristic.rst deleted file mode 100644 index 29844c9..0000000 --- a/bak/ambd/_common/API_Documents/BLE/Class BLECharacteristic.rst +++ /dev/null @@ -1,1445 +0,0 @@ -Class BLECharacteristic -======================= - -.. contents:: - :local: - :depth: 2 - -**BLECharacteristic Class** ---------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -A class used for creating and managing BLE GATT characteristics. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - class BLECharacteristic - -**Members** -~~~~~~~~~~~ - -+-------------------------------------------+----------------------------------+ -| **Public Constructors** | -+===========================================+==================================+ -| BLECharacteristic::BLECharacteristic | Constructs a BLECharacteristic | -| | object | -+-------------------------------------------+----------------------------------+ -| **Public Methods** | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::setUUID | Set the UUID of the | -| | characteristic. | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::getUUID | Get the UUID of the | -| | characteristic. | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::setBufferLen | Set the size of the internal | -| | data buffer | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::getBufferLen | Get the current size of the | -| | internal data buffer | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::setReadProperty | Set the Read property value | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::setWriteProperty | Set the Write property value | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::setWriteNRProperty | Set the write without response | -| | property value | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::setNotifyProperty | Set the Notify property value | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::setIndicateProperty | Set the Indicate property value | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::setProperties | Set the characteristic properties| -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::getProperties | Get the characteristic properties| -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::setReadPermissions | Set the characteristic read | -| | permissions | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::setWritePermissions | Set the characteristic write | -| | permissions | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::setPermissions | Set the characteristic | -| | permissions | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::getPermissions | Get the characteristic | -| | permissions | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::readString | Read the characteristic data | -| | buffer as a String object | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::readData8 | Read the characteristic data | -| | buffer as an unsigned 8-bit | -| | integer | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::readData16 | Read the characteristic data | -| | buffer as an unsigned 16-bit | -| | integer | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::readData32 | Read the characteristic data | -| | buffer as an unsigned 32-bit | -| | integer | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::writeString | Write data to the characteristic | -| | data buffer as a String object or| -| | character array | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::writeData8 | Write data to the | -| | characteristic data buffer as | -| | an unsigned 8-bit integer | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::writeData16 | Write data to the | -| | characteristic data buffer as | -| | an unsigned 16-bit integer | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::writeData32 | Write data to the | -| | characteristic data buffer as | -| | an unsigned 16-bit integer | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::setData | Write data to the | -| | characteristic data buffer | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::getData | Read data from the | -| | characteristic data buffer | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::getDataBuff | Get a pointer to the | -| | characteristic data buffer | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::getDataLen | Get the length of data (in | -| | bytes) in the characteristic | -| | data buffer. | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::notify | Send a notification to a | -| | connected device | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::indicate | Send an indication to a | -| | connected device | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::setUserDescriptor | Add a user description | -| | descriptor to characteristic | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::setFormatDescriptor | Add a data format descriptor to | -| | characteristic | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::setReportRefDescriptor | Add a report reference | -| | descriptor to a characteristic | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::getReportRefID | Get the previously set report | -| | reference descriptor ID | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::getReportRefType | Get the previously set report | -| | reference descriptor type | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::setReadCallback | Set a user function as a read | -| | callback | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::setWriteCallback | Set a user function as a write | -| | callback | -+-------------------------------------------+----------------------------------+ -| BLECharacteristic::setCCCDCallback | Set a user function as a CCCD | -| | write callback | -+-------------------------------------------+----------------------------------+ - -**BLECharacteristic::BLECharacteristic** ----------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Constructs a BLECharacteristic object. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLECharacteristic::BLECharacteristic(BLEUUID uuid); - BLECharacteristic::BLECharacteristic(const char* uuid); - -**Parameters** -~~~~~~~~~~~~~~ - -uuid: characteristic UUID, expressed as a BLEUUID class object or a character array - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEUartService `_ - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::setUUID** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the UUID of the characteristic. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setUUID(BLEUUID uuid); - -**Parameters** -~~~~~~~~~~~~~~ - -uuid: new UUID for the characteristic, expressed as a BLEUUID class object. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::getUUID** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the UUID of the characteristic. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLEUUID getUUID(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -The function returns the UUID of the characteristic in a BLEUUID class object. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::setBufferLen** ------------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Set the size of the internal data buffer of the characteristic. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setBufferLen(uint16_t max_len); - -**Parameters** -~~~~~~~~~~~~~~ - -max_len: the number of bytes that the internal buffer will be resized to - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEUartService `_ - -.. note :: Characteristic data buffer has a default size of 20 bytes and can be increased up to 230 bytes. "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::getBufferLen** ------------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Get the current size of the internal data buffer of the characteristic. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint16_t getBufferLen(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -The function returns the currently set internal buffer size. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::setReadProperty** --------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the Read property value of the characteristic. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setReadProperty(bool value); - -**Parameters** -~~~~~~~~~~~~~~ - -value: To allow connected devices to read characteristic's data. - -- true. - -- false. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBatteryService `_ - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::setWriteProperty** ---------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the Write property value of the characteristic. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setWriteProperty(bool value); - -**Parameters** -~~~~~~~~~~~~~~ - -value: To allow connected devices to write characteristic data. - -- true. - -- false. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEUartService `_ - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::setWriteNRProperty** ------------------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Set the write without response property value of the characteristic. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setWriteNRProperty(bool value); - -**Parameters** -~~~~~~~~~~~~~~ - -value: To allow connected devices to write characteristic data with no response. - -- true. - -- false. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLECharacteristic.h" must be included to use the class function.\ ** - -**BLECharacteristic::setNotifyProperty** ----------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the Notify property of the characteristic. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setNotifyProperty(bool value); - -**Parameters** -~~~~~~~~~~~~~~ - -value: To allow connected devices to receive characteristic data notification messages. - -- true. - -- false. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEUartService `_ - -.. note :: Enabling this property will add a CCCD descriptor to the characteristic. "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::setIndicateProperty** ------------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the Indicate property value of characteristic. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setIndicateProperty(bool value); - -**Parameters** -~~~~~~~~~~~~~~ - -value: To allow connected devices to receive characteristic data indication messages. - -- true. - -- false. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Enabling this property will add a CCCD descriptor to the characteristic. "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::setProperties** ------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the characteristic properties. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setProperties(uint8_t value); - -**Parameters** -~~~~~~~~~~~~~~ - -value: desired characteristic properties. Default value is 0x00 (no properties) - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::getProperties** ------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get characteristic properties that is currently set. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint8_t getProperties(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the currently set characteristic properties expressed as an unsigned 8-bit integer. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::setReadPermissions** ------------------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Set the characteristic read permissions. - -**Syntax** -~~~~~~~~~~ - -void setReadPermissions(uint32_t value); - -**Parameters** -~~~~~~~~~~~~~~ - -value: desired characteristic read permissions. - -- GATT_PERM_READ - -- GATT_PERM_READ_AUTHEN_REQ - -- GATT_PREM_READ_AUTHOR_REQ - -- GATT_PERM_READ_ENCRYPTED_REQ - -- GATT_PERM_READ_AUTHEN_SC_REQ - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEUartService `_ - -.. note :: If no permissions are set, the default permission is GATT_PERM_NONE. "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::setWritePermissions** ------------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the characteristic write permissions. - -**Syntax** -~~~~~~~~~~ - -void setWritePermissions(uint32_t value); - -**Parameters** -~~~~~~~~~~~~~~ - -value: desired characteristic write permissions. - -- GATT_PERM_WRITE - -- GATT_PERM_WRITE_AUTHEN_REQ - -- GATT_PREM_WRITE_AUTHOR_REQ - -- GATT_PERM_WRITE_ENCRYPTED_REQ - -- GATT_PERM_WRITE_AUTHEN_SC_REQ - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEUartService `_ - -.. note :: If no permissions are set, the default permission is GATT_PERM_NONE. "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::setPermissions** -------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the characteristic permissions. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setPermissions(uint32_t value); - -**Parameters** -~~~~~~~~~~~~~~ - -value: desired characteristic permissions. - -- GATT_PERM_READ - -- GATT_PERM_READ_AUTHEN_REQ - -- GATT_PREM_READ_AUTHOR_REQ - -- GATT_PERM_READ_ENCRYPTED_REQ - -- GATT_PERM_READ_AUTHEN_SC_REQ - -- GATT_PERM_WRITE - -- GATT_PERM_WRITE_AUTHEN_REQ - -- GATT_PREM_WRITE_AUTHOR_REQ - -- GATT_PERM_WRITE_ENCRYPTED_REQ - -- GATT_PERM_WRITE_AUTHEN_SC_REQ - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: If no permissions are set, the default permission is GATT_PERM_NONE. "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::getPermissions** -------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the characteristic permissions. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint32_t getPermissions(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the characteristic permissions that are previously set using the setReadPermissions, setWritePermissions and setPermissions functions. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::readString** ---------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Read the characteristic data buffer as a String object. - -**Syntax** -~~~~~~~~~~ - -String readString(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -The function returns the data in the characteristic internal buffer as a String class object. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEUartService `_ - -.. note :: Non-ASCII data may result in unexpected characters in the string. "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::readData8** --------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Read the data in the characteristic internal buffer, expressed as an unsigned 8-bit integer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint8_t readData8(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the data in the characteristic internal buffer expressed as a uint8_t value. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::readData16** ---------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Read the data in the characteristic internal buffer, expressed as an unsigned 16-bit integer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint16_t readData16(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the data in the characteristic internal buffer expressed as a uint16_t value. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::readData32** ---------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Read the data in the characteristic internal buffer, expressed as an unsigned 32-bit integer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint32_t readData32(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the data in the characteristic internal buffer expressed as a uint32_t value. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::writeString** ----------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Write data to the characteristic data buffer as a String object or character array. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool writeString(String str); - bool writeString(const char* str); - -**Parameters** -~~~~~~~~~~~~~~ - -str: the data to write to the characteristic buffer, expressed as a String class object or a char array. - -**Returns** -~~~~~~~~~~~ - -This function returns TRUE if write data is successful. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEUartService `_ - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::writeData8** ---------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Write data to the characteristic data buffer as an unsigned 8-bit integer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool writeData8(uint8_t num); - -**Parameters** -~~~~~~~~~~~~~~ - -num: the data to write to the characteristic buffer expressed as an unsigned 8-bit integer. - -**Returns** -~~~~~~~~~~~ - -This function returns TRUE if write data is successful. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBatteryService `_ - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::writeData16** ----------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Write data to the characteristic data buffer as an unsigned 16-bit integer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool writeData16(uint16_t num); - -**Parameters** -~~~~~~~~~~~~~~ - -num: the data to write to the characteristic buffer expressed as an unsigned 16-bit integer. - -**Returns** -~~~~~~~~~~~ - -This function returns TRUE if write data is successful. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::writeData32** ----------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Write data to the characteristic data buffer as an unsigned 32-bit integer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: C++ - - bool writeData32(uint32_t num); - bool writeData32(int num); - -**Parameters** -~~~~~~~~~~~~~~ - -num: the data to write to the characteristic buffer expressed as a signed or unsigned 32-bit integer. - -**Returns** -~~~~~~~~~~~ - -This function returns TRUE if write data is successful. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::setData** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Write data to the characteristic data buffer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool setData(uint8_t* data, uint16_t datalen); - -**Parameters** -~~~~~~~~~~~~~~ - -data: pointer to byte array containing desired data. - -datalen: number of bytes of data to write. - -**Returns** -~~~~~~~~~~~ - -This function returns TRUE if write data is successful. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::getData** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Read data from the characteristic data buffer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint16_t getData(uint8_t* data, uint16_t datalen); - -**Parameters** -~~~~~~~~~~~~~~ - -data: pointer to byte array containing saved data from data buffer. - -datalen: number of bytes of data to be read. - -**Returns** -~~~~~~~~~~~ - -This function returns the number of bytes read. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: If the data buffer contains less data than requested, it will only read the available number of bytes of data. "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::getDataBuff** ----------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get a pointer to the characteristic data buffer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint8_t* getDataBuff(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns a pointer to the uint8_t array used as the characteristic internal buffer. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::getDataLen** ---------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the length of data (in bytes) in the characteristic data buffer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint16_t getDataLen(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the length of the last written data (in bytes) in the internal data buffer. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::notify** ------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Send a notification to a connected device. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void notify(uint8_t conn_id); - -**Parameters** -~~~~~~~~~~~~~~ - -conn_id: the connection ID for the device to send a notification to. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** - -Example: `BLEUartService `_ - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::indicate** -------------------------------- - -Send an indication to a connected device. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void indicate(uint8_t conn_id); - -**Parameters** -~~~~~~~~~~~~~~ - -conn_id: the connection ID for the device to send an indication to. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::setUserDescriptor** ----------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Add a user description descriptor attribute (UUID 0x2901) to the characteristic. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setUserDescriptor(const char* description); - -**Parameters** -~~~~~~~~~~~~~~ - -description: the desired user description string expressed in a char array. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::setFormatDescriptor** ------------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Add a data format descriptor attribute (UUID 0x2904) to the characteristic. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setFormatDescriptor(uint8_t format, uint8_t exponent, uint16_t unit, uint16_t description); - -**Parameters** -~~~~~~~~~~~~~~ - -format: refer to https://www.bluetooth.com/specifications/assigned-numbers/format-types/ for the valid values and associated format types. - -exponent: base-10 exponent to be applied to characteristic data value. - -unit: refer to https://btprodspecificationrefs.blob.core.windows.net/assigned-values/16-bit%20UUID%20Numbers%20Document.pdf for the valid values and associated units. - -description: refer to https://www.bluetooth.com/specifications/assigned-numbers/gatt-namespace-descriptors/ for the valid values and associated descriptors. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::setReportRefDescriptor** ---------------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Add a HID report reference descriptor attribute (UUID 0x2908) to the characteristic. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setReportRefDescriptor(uint8_t id, uint8_t type); - -**Parameters** -~~~~~~~~~~~~~~ - -id: HID report reference ID - -type: HID report type. - -- 0x01 (input report) - -- 0x02 (output report) - -- 0x03 (feature report) - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: HID report reference ID should begin at 1. Some HID host systems may consider an ID of 0 as invalid. "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::getReportRefID** -------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the previously set HID report reference descriptor ID. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint8_t getReportRefID(void); - -**Parameters** - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the report reference ID previously set using the setReportRefDescriptor function. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::getReportRefType** ---------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the previously set HID report reference descriptor type. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint8_t getReportRefType(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the report reference type previously set using the setReportRefDescriptor function. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::setReadCallback** --------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set a user function to be called when the characteristic data is read by a connected device. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setReadCallback(void (*fCallback) (BLECharacteristic* chr, uint8_t conn_id)); - -**Parameters** -~~~~~~~~~~~~~~ - -fCallback: A user callback function that returns void and takes two arguments. - -chr: pointer to BLECharacteristic object containing data read. - -conn_id: connection ID of connected device that read characteristic data. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBatteryService `_ - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::setWriteCallback** ---------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set a user function to be called when the characteristic data is written by a connected device. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setWriteCallback(void (*fCallback) (BLECharacteristic* chr, uint8_t conn_id)); - -**Parameters** -~~~~~~~~~~~~~~ - -fCallback: A user callback function that returns void and takes two arguments. - -chr: pointer to BLECharacteristic object containing written data. - -conn_id: connection ID of connected device that wrote characteristic data. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEUartService `_ - -.. note :: "BLECharacteristic.h" must be included to use the class function. - -**BLECharacteristic::setCCCDCallback** --------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set a user function to be called when a connected device modifies the characteristic CCCD to enable or disable notifications or indications. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setCCCDCallback(void (*fCallback) (BLECharacteristic* chr, uint8_t conn_id, uint16_t ccc_bits)); - -**Parameters** -~~~~~~~~~~~~~~ - -fCallback: A user callback function that returns void and takes two arguments. - -chr: pointer to BLECharacteristic object containing written data. - -conn_id: connection ID of connected device that wrote characteristic data. - -ccc_bits: the new CCCD data bits after modification by the connected device. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** - -Example: `BLEUartService `_ - -.. note :: "BLECharacteristic.h" must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/BLE/Class BLEClient.rst b/bak/ambd/_common/API_Documents/BLE/Class BLEClient.rst deleted file mode 100644 index 5c3d5b2..0000000 --- a/bak/ambd/_common/API_Documents/BLE/Class BLEClient.rst +++ /dev/null @@ -1,317 +0,0 @@ -Class BLEClient -=============== - -.. contents:: - :local: - :depth: 2 - -**BLEClient Class** -------------------- - -**Description** -~~~~~~~~~~~~~~~ - -A class used for discovering and accessing BLE GATT services on a connected remote device. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - class BLEClient - -**Members** -~~~~~~~~~~~ - -+------------------------------------+------------------------------------+ -| **Public Constructors** | -+====================================+====================================+ -| No public constructor is available for this class. You can get a pointer| -| to an instance of this class using BLEDevice::addClient(). | -+------------------------------------+------------------------------------+ -| **Public Methods** | -+------------------------------------+------------------------------------+ -| BLEClient::connected | Check if the remote device | -| | associated with the client is | -| | connected. | -+------------------------------------+------------------------------------+ -| BLEClient::discoverServices | Start service discovery process | -| | for connected device | -+------------------------------------+------------------------------------+ -| BLEClient::discoveryDone | Determine if service discovery | -| | process has been completed | -+------------------------------------+------------------------------------+ -| BLEClient::printServices | Format and print discovered | -| | services to serial port | -+------------------------------------+------------------------------------+ -| BLEClient::getService | Get a service with the | -| | specified UUID on the remote | -| | device | -+------------------------------------+------------------------------------+ -| BLEClient::getConnId | Get connection ID corresponding | -| | to remote device | -+------------------------------------+------------------------------------+ -| BLEClient::getClientId | Get corresponding client ID | -+------------------------------------+------------------------------------+ -| BLEClient::setDisconnectCallback | Set a user function to be | -| | called when the remote device | -| | is disconnected | -+------------------------------------+------------------------------------+ - -**BLEClient::connected** ------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Check if the remote device associated with the client is connected. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool connected(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns TRUE if the remote device is connected. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEClient.h" must be included to use the class function. - -**BLEClient::discoverServices** -------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Start the service discovery process for the connected remote device. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void discoverServices(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEUartClient `_ - -.. note :: "BLEClient.h" must be included to use the class function. - -**BLEClient::discoveryDone** - -**Description** -~~~~~~~~~~~~~~~ - -Determine if the service discovery process has been completed. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool discoveryDone(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns TRUE if the service discovery process has been completed successfully, FALSE if the service discovery process failed, is still in progress, or has yet to start. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEUartClient `_ - -.. note :: "BLEClient.h" must be included to use the class function. - -**BLEClient::printServices** ----------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Print out a formatted list of discovered services to the serial port. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void printServices(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEClient.h" must be included to use the class function. - -**BLEClient::getService** -------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get a service with the specified UUID on the remote device. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLERemoteService* getService(const char* uuid); - BLERemoteService* getService(BLEUUID uuid); - -**Parameters** -~~~~~~~~~~~~~~ - -uuid: the desired service UUID, expressed as a character array or a BLEUUID object. - -**Returns** -~~~~~~~~~~~ - -This function returns the discovered service as a BLERemoteService object pointer, otherwise nullptr is returned if a service with the UUID is not found. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEUartClient `_ - -.. note :: "BLEClient.h" must be included to use the class function. - -**BLEClient::getConnId** ------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the connection ID associated with the remote device. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint8_t getConnId(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the connection ID for the connected remote device. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEClient.h" must be included to use the class function. - -**BLEClient::getClientId** --------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the client ID for the BLEClient object. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - T_CLIENT_ID getClientId(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the BLEClient object's client ID. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: The client ID is used when calling internal GATT client API. "BLEClient.h" must be included to use the class function. - -**BLEClient::setDisconnectCallback** ------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set a user function as a callback function when the remote device is disconnected. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setDisconnectCallback(void (*fCallback) (BLEClient* client)); - -**Parameters** -~~~~~~~~~~~~~~ - -fCallback: A user callback function that returns void and takes one argument. - -client: A pointer to the BLEClient object corresponding to the disconnected remote device. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: The user callback function will be called after the remote device has disconnected, before the characteristics, services and client associated with the remote device are deleted. "BLEClient.h" must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/BLE/Class BLEConnect.rst b/bak/ambd/_common/API_Documents/BLE/Class BLEConnect.rst deleted file mode 100644 index a3838b9..0000000 --- a/bak/ambd/_common/API_Documents/BLE/Class BLEConnect.rst +++ /dev/null @@ -1,468 +0,0 @@ -Class BLEConnect -================ - -.. contents:: - :local: - :depth: 2 - -**BLEConnect Class** --------------------- - -**Description** -~~~~~~~~~~~~~~~ - -A class used for managing BLE connection settings. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - class BLEConnect - -**Members** -~~~~~~~~~~~ - -+------------------------------------+------------------------------------+ -| **Public Constructors** | -+====================================+====================================+ -| No public constructor is available as this class is intended to be a | -| singleton class. You can get a pointer to this class using | -| BLEDevice::configConnection | -+------------------------------------+------------------------------------+ -| **Public Methods** | -+------------------------------------+------------------------------------+ -| BLEConnect::connect | Scan and search for all accessible | -| | BLE devices, then select and | -| | connect to one of them | -+------------------------------------+------------------------------------+ -| BLEConnect::disconnect | Disconnect from targeted BLE device| -+------------------------------------+------------------------------------+ -| BLEConnect::setScanInterval | Set the scan interval when | -| | searching for the targeted device | -+------------------------------------+------------------------------------+ -| BLEConnect::setScanWindow | Set the BLE scan window when | -| | searching for the targeted device | -| | to connect to | -+------------------------------------+------------------------------------+ -| BLEConnect::setConnInterval | Set the BLE connection interval | -| | duration | -+------------------------------------+------------------------------------+ -| BLEConnect::setConnLatency | Set the BLE connection slave | -| | latency value | -+------------------------------------+------------------------------------+ -| BLEConnect::setConnTimeout | Set the BLE connection timeout | -| | value | -+------------------------------------+------------------------------------+ -| BLEConnect::updateConnParams | Update a connected device with new | -| | connection parameters | -+------------------------------------+------------------------------------+ -| BLEConnect::getConnInfo | Get connection information | -+------------------------------------+------------------------------------+ -| BLEConnect::getConnAddr | Get the Bluetooth address for a | -| | certain connection | -+------------------------------------+------------------------------------+ -| BLEConnect::getConnId | Get the connection ID for a certain| -| | device | -+------------------------------------+------------------------------------+ - -**BLEConnect::connect** ------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -This class function is used to scan and search for all accessible BLE devices, then select and connect to one of them. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool connect(char* btAddr, T_GAP_REMOTE_ADDR_TYPE destAddrType, uint16_t scanTimeout); - bool connect(uint8_t (&btAddr)[6], T_GAP_REMOTE_ADDR_TYPE destAddrType, uint16_t scanTimeout); - bool connect(BLEAdvertData targetDevice, uint16_t scanTimeout); - bool connect(BLEAddr destAddr, T_GAP_REMOTE_ADDR_TYPE destAddrType, uint16_t scanTimeout); - -**Parameters** -~~~~~~~~~~~~~~ - -char* btAddr: pointer to the targeted BLE device's Bluetooth address expressed as a character string. - -uint8_t (&btAddr): targeted BLE device's Bluetooth address contained in a 6-byte array. - -destAddr: targeted BLE device's Bluetooth address contained in BLEAddr class object. - -targetDevice: advertising data packet scanned from targeted BLE device. - -destAddrType: Bluetooth address type of targeted BLE device. - -- GAP_REMOTE_ADDR_LE_PUBLIC - -- GAP_REMOTE_ADDR_LE_RANDOM - -scan timeout: duration in milliseconds for which to look for the targeted BLE device before giving up. - -**Returns** -~~~~~~~~~~~ - -This function returns true if the connection is successful, otherwise false. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBatteryClient `_ - -.. note :: "BLEConnect.h" must be included to use the class function. - -**BLEConnect::disconnect** --------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Disconnect from targeted BLE device. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool disconnect(uint8_t connId); - -**Parameters** -~~~~~~~~~~~~~~ - -connId: connection ID for target device. Default value is 0. - -**Returns** -~~~~~~~~~~~ - -This function returns true if the operation is successful, otherwise false. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEConnect.h" must be included to use the class function. - -**BLEConnect::setScanInterval** -------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the scan interval when searching for the targeted device. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setScanInterval(uint16_t scanInt_ms); - -**Parameters** -~~~~~~~~~~~~~~ - -scanInt_ms: scan interval in milliseconds. - -- 3 to 10240. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Scan interval defines how often the scanning process is started. The value set for scanInt_ms must be equal or larger than the value set for scanWindow_ms. scanInt_ms value is defined in units of 625 microseconds. "BLEConnect.h" must be included to use the class function. - -**BLEConnect::setScanWindow** ------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Set the BLE scan window when searching for the targeted device to connect to. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setScanWindow(uint16_t scanWindow_ms); - -**Parameters** -~~~~~~~~~~~~~~ - -scanWindow_ms: scan window in milliseconds. - -- 3 to 10240. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: BLE scan window defines how long each interval should be scanned for. The value set for scanWindow_ms set must be equal or smaller than the value set for scanInt_ms. scanWindow_ms value is defined in units of 625 microseconds. "BLEConnect.h" must be included to use the class function. - -**BLEConnect::setConnInterval** -------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the BLE connection interval duration. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setConnInterval(uint16_t min_ms, uint16_t max_ms); - -**Parameters** -~~~~~~~~~~~~~~ - -min_ms: minimum acceptable connection interval in milliseconds. - -- 8 to 4000. - -max_ms: maximum acceptable connection interval in milliseconds. - -- 8 to 4000. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: The BLE connection interval defines the period between successive connection events between a connected central and peripheral device. Even if there is no data to exchange, a connection event is required to maintain the connection. max_ms should be larger than or equal to min_ms. "BLEConnect.h" must be included to use the class function. - -**BLEConnect::setConnLatency** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the BLE connection slave latency value. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setConnLatency(uint16_t latency); - -**Parameters** -~~~~~~~~~~~~~~ - -latency: Connection slave latency value. - -- 0 to 499. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: The BLE connection slave latency defines the number of successive connection events a connected peripheral device can ignore without being considered as disconnected by the central device. "BLEConnect.h" must be included to use the class function. - -**BLEConnect::setConnTimeout** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the BLE connection timeout value. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setConnTimeout(uint16_t timeout_ms); - -**Parameters** -~~~~~~~~~~~~~~ - -timeout_ms: connection timeout in milliseconds. - -- 100 to 32000. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: The BLE connection timeout defines the duration a peripheral or central device must wait after a failed connection event to consider the connection broken. "BLEConnect.h" must be included to use the class function. - -**BLEConnect::updateConnParams** --------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Update a connected device with new connection parameters. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void updateConnParams(uint8_t conn_id); - -**Parameters** -~~~~~~~~~~~~~~ - -conn_id: connection ID of targeted device to update connection parameters. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Update the connected device with new connection parameters such as connection interval, slave latency and timeout values. The connected device may reject the new values if it is unable to conform to them. "BLEConnect.h" must be included to use the class function. - -**BLEConnect::getConnInfo** ---------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get connection information. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool getConnInfo(uint8_t connId, T_GAP_CONN_INFO *pConnInfo); - -**Parameters** -~~~~~~~~~~~~~~ - -connId: connection ID to device get connection information from. - -pConnInfo: pointer to T_GAP_CONN_INFO structure to store obtained connection information. - -**Returns** -~~~~~~~~~~~ - -This function returns true if the connection information is successfully obtained. Otherwise, false. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEConnect.h" must be included to use the class function. - -**BLEConnect::getConnAddr** ---------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the Bluetooth address for a certain connection. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool getConnAddr(uint8_t connId, uint8_t* addr, uint8_t* addrType); - -**Parameters** -~~~~~~~~~~~~~~ - -connId: connection ID of device to get Bluetooth address of. - -addr: pointer to 6 byte array to store retrieved Bluetooth address. - -addrType: pointer to uint8_t variable to store retrieved Bluetooth address type. - -**Returns** -~~~~~~~~~~~ - -This function returns true if the connection address information is successfully obtained. Otherwise, false. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEConnect.h" must be included to use the class function. - -**BLEConnect::getConnId** -------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the connection ID for a certain device. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - int8_t getConnId(char* btAddr, uint8_t addrType); - int8_t getConnId(uint8_t* btAddr, uint8_t addrType); - int8_t getConnId(BLEAdvertData targetDevice); - -**Parameters** -~~~~~~~~~~~~~~ - -char* btAddr: targeted device Bluetooth address expressed as a character string. - -uint8_t* btAddr: pointer to a 6-byte array containing targeted device Bluetooth address. - -targetDevice: advertising data packet scanned from targeted device. - -addrType: Bluetooth address type of targeted device. - -- GAP_REMOTE_ADDR_LE_PUBLIC - -- GAP_REMOTE_ADDR_LE_RANDOM - -**Returns** -~~~~~~~~~~~ - -This function returns the requested connection ID. Else, returns -1 if failed to obtain connection ID. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBatteryClient `_ - -.. note :: "BLEConnect.h" must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/BLE/Class BLEDevice.rst b/bak/ambd/_common/API_Documents/BLE/Class BLEDevice.rst deleted file mode 100644 index c529a9f..0000000 --- a/bak/ambd/_common/API_Documents/BLE/Class BLEDevice.rst +++ /dev/null @@ -1,658 +0,0 @@ -Class BLEDevice -=============== - -.. contents:: - :local: - :depth: 2 - -**BLEDevice Class** -------------------- - -**Description** -~~~~~~~~~~~~~~~ - -A class used for general control and management of BLE functions. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - class BLEDevice - -**Members** -~~~~~~~~~~~ - -+------------------------------------+------------------------------------+ -| **Public Constructors** | -+====================================+====================================+ -| The public constructor should not be used as this class is intended to | -| be a singleton class. Access member functions using the object instance | -| named BLE. | -+------------------------------------+------------------------------------+ -| **Public Methods** | -+------------------------------------+------------------------------------+ -| BLEDevice:: init | Initialize resources that are | -| | required for BLE to function | -+------------------------------------+------------------------------------+ -| BLEDevice::deinit | Deinitialize all the operations for| -| | BLE. | -+------------------------------------+------------------------------------+ -| BLEDevice::connected | Check if a BLE device is connected | -+------------------------------------+------------------------------------+ -| BLEDevice::setDeviceName | Set BLE Generic Access Profile | -| | (GAP) device name | -+------------------------------------+------------------------------------+ -| BLEDevice::setDeviceAppearance | Set BLE Generic Access Profile | -| | (GAP) device appearance | -+------------------------------------+------------------------------------+ -| BLEDevice::configAdvert | Configure BLE advertising | -| | parameters | -+------------------------------------+------------------------------------+ -| BLEDevice::configScan | Configure BLE scan parameters | -+------------------------------------+------------------------------------+ -| BLEDevice::configConnection | Configure BLE connection parameters| -+------------------------------------+------------------------------------+ -| BLEDevice::configSecurity | Configure BLE bonding security | -| | parameters | -+------------------------------------+------------------------------------+ -| BLEDevice::setScanCallback | Set callback function for BLE scan | -| | results | -+------------------------------------+------------------------------------+ -| BLEDevice::beginCentral | Start BLE stack to operate as a | -| | central device. | -+------------------------------------+------------------------------------+ -| BLEDevice::beginPeripheral | Start BLE stack to operate as a | -| | peripheral device. | -+------------------------------------+------------------------------------+ -| BLEDevice::end | Stop the operation of BLE stack as | -| | a peripheral or central device. | -+------------------------------------+------------------------------------+ -| BLEDevice::configServer | Configure BLE stack for services | -+------------------------------------+------------------------------------+ -| BLEDevice::addService | Add a service to the BLE stack | -+------------------------------------+------------------------------------+ -| BLEDevice::configClient | Configure BLE stack for clients | -+------------------------------------+------------------------------------+ -| BLEDevice::addClient | Add a new client to the BLE stack | -+------------------------------------+------------------------------------+ -| BLEDevice::getLocalAddr | Get local device Bluetooth address | -+------------------------------------+------------------------------------+ - -**BLEDevice:: init** --------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Initialize resources that are required for BLE to function. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void init(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBatteryService `_ - -.. note :: Call this member function first before using any other member functions in the BLEDevice class. "BLEDevice.h" must be included to use the class function. - -**BLEDevice::deinit** ---------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Deinitialize all the operations for BLE. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void deinit(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Call this member function last after all other BLE operations have been terminated. "BLEDevice.h" must be included to use the class function. - -**BLEDevice::connected** ------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Check if a BLE device is connected. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool connected(uint8_t connId); - -**Parameters** -~~~~~~~~~~~~~~ - -connId: connection ID to check connection status. - -**Returns** -~~~~~~~~~~~ - -This function returns TRUE if BLE device is connected, otherwise false. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Peripheral mode should use connId = 0. "BLEDevice.h" must be included to use the class function. - -**BLEDevice::setDeviceName** ----------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the BLE Generic Access Profile (GAP) device name which will be visible after a connection is estabalished. The default device name is set as "AMEBA_BLE_DEV". - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setDeviceName(String devName); - -**Parameters** -~~~~~~~~~~~~~~ - -devName: desired device name expressed as a character string. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: The GAP device name has a maximum length of 39 characters. Other devices can see this name after a BLE connection is established. This name is separate and different from the device name sent in a BLE advertisement, the names should be the same but are not required. "BLEDevice.h" must be included to use the class function. - -**BLEDevice::setDeviceAppearance** ----------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the BLE Generic Access Profile (GAP) device appearance. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setDeviceAppearance(uint16_t devAppearance); - -**Parameters** -~~~~~~~~~~~~~~ - -devAppearance: desired device appearance expressed as a 16-bit unsigned integer. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Refer to Bluetooth SIG assigned device appearances at https://www.bluetooth.com/specifications/gatt/characteristics/. "BLEDevice.h" must be included to use the class function. - -**BLEDevice::configAdvert** ---------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Configure BLE advertising parameters. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLEAdvert* configAdvert(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns a pointer to a BLEAdvert class instance for configuring BLE advertising parameters. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBatteryService `_ - -.. note :: Use this member function instead of creating a BLEAdvert class instance manually. "BLEDevice.h" must be included to use the class function. - -**BLEDevice::configScan** -------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Configure BLE scanning parameters. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLEScan* configScan(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns a pointer to a BLEScan class instance for configuring BLE scanning parameters. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEScan `_ - -.. note :: Use this member function instead of creating a BLEScan class instance manually. "BLEDevice.h" must be included to use the class function. - -**BLEDevice::configConnection** -------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Configure BLE connection parameters. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLEConnect* configConnection(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns a pointer to a BLEConnect class instance for configuring BLE connection parameters. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBatteryClient `_ - -.. note :: Use this member function instead of creating a BLEConnect class instance manually. "BLEDevice.h" must be included to use the class function. - -**BLEDevice::configSecurity** ------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Configure BLE bonding security parameters. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLESecurity* configSecurity(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns a pointer to a BLESecurity class instance for configuring BLE bonding security parameters. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDMouse `_ - -.. note :: Use this member function instead of creating a BLESecurity class instance manually "BLEDevice.h" must be included to use the class function. - -**BLEDevice::setScanCallback** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set a callback function for processing BLE scan results. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setScanCallback(void (*scanCB)(T_LE_CB_DATA*)); - -**Parameters** -~~~~~~~~~~~~~~ - -scanCB: a function that returns nothing and takes in a scan data pointer of type T_LE_CB_DATA. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEScan `_ - -.. note :: Use this member function to set a callback function that will be called for each BLE device scan result found. "BLEDevice.h" must be included to use the class function. - -**BLEDevice::beginCentral** ---------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Start the BLE stack to operate as a central device. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void beginCentral(uint8_t connCount); - -**Parameters** -~~~~~~~~~~~~~~ - -connCount: maximum number of allowed connected devices. If no argument is provided, default is maximum allowed connected devices for specific board. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEScan `_ - -.. note :: Use this member function to start the device to operate as a central BLE device, after other BLE parameters are set correctly. "BLEDevice.h" must be included to use the class function. - -**BLEDevice::beginPeripheral** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Start the BLE stack to operate as a peripheral device. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void beginPeripheral(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBatteryService `_ - -.. note :: Use this member function to start the device to operate as a peripheral BLE device, after other BLE parameters are set correctly. "BLEDevice.h" must be included to use the class function. - -**BLEDevice:: end** -------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Stop the operation of BLE stack as a peripheral or central device. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void end(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Use this member function to stop the device operating in either BLE peripheral mode or BLE central mode. "BLEDevice.h" must be included to use the class function. - -**BLEDevice::configServer** ---------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Configure the BLE stack for services. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void configServer(uint8_t maxServiceCount); - -**Parameters** -~~~~~~~~~~~~~~ - -maxServiceCount: Maximum number of services that will run on the device. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBatteryService `_ - -.. note :: Use this member function before adding any service to the BLE stack. "BLEDevice.h" must be included to use the class function. - -**BLEDevice::addService** -------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Add a new service to the BLE stack. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void addService(BLEService& newService); - -**Parameters** -~~~~~~~~~~~~~~ - -newService: the service to be added, defined using a BLEService class object. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBatteryService `_ - -.. note :: "BLEDevice.h" must be included to use the class function. - -**BLEDevice::configClient** ---------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Configure the BLE stack for clients. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void configClient(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBatteryClient `_ - -.. note :: Use this member function before adding any client to the BLE stack. "BLEDevice.h" must be included to use the class function. - -**BLEDevice::addClient** ------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Add a new client to the BLE stack. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLEClient* addClient(uint8_t connId); - -**Parameters** -~~~~~~~~~~~~~~ - -connId: the connection ID of the connected device to create a client for. - -**Returns** -~~~~~~~~~~~ - -This function returns a pointer to a BLEClient class object, corresponding to the device with the specified connection ID, which can be used to access the services and characteristics on the connected device. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBatteryClient `_ - -.. note :: Only one client should be added per connected device. The BLEClient object and any service, characteristic, descriptor associated with the connected device will be deleted when the device is disconnected. "BLEDevice.h" must be included to use the class function. - -**BLEDevice::getLocalAddr** ---------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get local device Bluetooth address. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void getLocalAddr(uint8_t (&addr)[GAP_BD_ADDR_LEN]); - -**Parameters** -~~~~~~~~~~~~~~ - -addr: 6 byte array to store local device Bluetooth address. - -GAP_BD_ADDR_LEN: Default Bluetooth device address length of 6 bytes. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Local device address is only available after starting in central or peripheral mode. This function will return all zeros for the address if central or peripheral mode is not in operation. "BLEDevice.h" must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/BLE/Class BLEHIDDevice.rst b/bak/ambd/_common/API_Documents/BLE/Class BLEHIDDevice.rst deleted file mode 100644 index e19e494..0000000 --- a/bak/ambd/_common/API_Documents/BLE/Class BLEHIDDevice.rst +++ /dev/null @@ -1,595 +0,0 @@ -Class BLEHIDDevice -================== - -.. contents:: - :local: - :depth: 2 - -**BLEHIDDevice Class** ----------------------- - -**Description** -~~~~~~~~~~~~~~~ - -A class used for creating and managing HID over GATT Profile (HOGP) services. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - class BLEHIDDevice - -**Members** -~~~~~~~~~~~ - -+------------------------------------+------------------------------------+ -| **Public Constructors** | -+====================================+====================================+ -| The public constructor should not be used as this class is intended to | -| be a singleton class. Access member functions using the object instance | -| named BLEHIDDev. | -+------------------------------------+------------------------------------+ -| **Public Methods** | -+------------------------------------+------------------------------------+ -| BLEHIDDevice::init | Initialize the HID Device | -| | Profile by creating the | -| | required services and | -| | characteristics | -+------------------------------------+------------------------------------+ -| BLEHIDDevice::setNumOutputReport | Set the number of HID output | -| | reports to be generated. | -+------------------------------------+------------------------------------+ -| BLEHIDDevice::setNumInputReport | Set the number of HID input | -| | reports to be generated. | -+------------------------------------+------------------------------------+ -| BLEHIDDevice::setReportMap | Set the HID report map | -| | characteristics with a HID | -| | report descriptor | -+------------------------------------+------------------------------------+ -| BLEHIDDevice::inputReport | Send a HID input report to | -| | connected device | -+------------------------------------+------------------------------------+ -| BLEHIDDevice:: | Set a user callback function | -| setOutputReportCallback | for receiving HID output | -| | reports | -+------------------------------------+------------------------------------+ -| BLEHIDDevice::bootKeyboardReport | Send a HID boot keyboard input | -| | report to connected device | -+------------------------------------+------------------------------------+ -| BLEHIDDevice::setHidInfo | Set HID info of the HID service | -+------------------------------------+------------------------------------+ -| BLEHIDDevice::setBattLevel | Set battery level info of the | -| | Battery service | -+------------------------------------+------------------------------------+ -| BLEHIDDevice::setPNPInfo | Set PNP information of the | -| | Device Information service | -+------------------------------------+------------------------------------+ -| BLEHIDDevice::setManufacturerString| Set manufacturer information of | -| | the Device Information service | -+------------------------------------+------------------------------------+ -| BLEHIDDevice::setModelString | Set model information of the | -| | Device Information service | -+------------------------------------+------------------------------------+ -| BLEHIDDevice::hidService | Get reference to HID service | -+------------------------------------+------------------------------------+ -| BLEHIDDevice::devInfoService | Get reference to Device | -| | Information service | -+------------------------------------+------------------------------------+ -| BLEHIDDevice::battService | Get reference to Battery | -| | service | -+------------------------------------+------------------------------------+ - -**BLEHIDDevice::init** ----------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Initialize the HID Device profile by creating the required services and characteristics. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void init(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDGamepad `_ - -.. note :: The HID Device object should be initialized before any HID reports can be sent. "BLEHIDDevice.h" must be included to use the class function. - -**BLEHIDDevice::setNumOutputReport** ------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the number of HID output reports to be generated. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setNumOutputReport (uint8_t numOutputReports); - -**Parameters** -~~~~~~~~~~~~~~ - -numOutputReports: number of output reports. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: The number of output reports should be set before BLEHIDDevice init() function is called.The default number of HID output report to be generated is 1 if it is not set. "BLEHIDDevice.h" must be included to use the class function. - -**BLEHIDDevice::setNumInputReport** ------------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Set the number of HID input reports to be generated. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setNumInputReport (uint8_t numInputReports); - -**Parameters** -~~~~~~~~~~~~~~ - -numInputReports: number of input reports. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: The number of input reports should be set before BLEHIDDevice init() function is called.The default number of HID input report to be generated is 3 if it is not set. "BLEHIDDevice.h" must be included to use the class function. - -**BLEHIDDevice::setReportMap** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the HID report map characteristics with a HID report descriptor. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setReportMap (uint8_t* report_map, uint16_t len); - -**Parameters** -~~~~~~~~~~~~~~ - -report_map: pointer to HID report descriptor. - -len: HID report descriptor length in bytes. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDGamepad `_ - -.. note :: - - The HID report map characteristic can only be configured after BLEHIDDevice init() function is called. - - HID report descriptor is a hard coded array of bytes that describe the device's data packets. For example, how many packets the device supports, how large are the packets and the purpose of each byte and bit in the packets. - - For more information on HID report descriptor, refer to https://eleccelerator.com/tutorial-about-usb-hid-report-descriptors/. - - "BLEHIDDevice.h" must be included to use the class function. - -**BLEHIDDevice::inputReport** ------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID input report to connected device. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void inputReport (uint8_t reportID, uint8_t* data, uint16_t len, uint8_t conn_id); - -**Parameters** -~~~~~~~~~~~~~~ - -reportID: HID report ID of input report. - -data: pointer to the HID input report data to be sent. - -len: length of HID input report data in bytes. - -conn_id: connection ID of device that the HID report will be sent to. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: HID input reports can only be sent after BLEHIDDevice init() function has been called. "BLEHIDDevice.h" must be included to use the class function. - -**BLEHIDDevice::setOutputReportCallback** ------------------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Set a user callback function for receiving HID output report data. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setOutputReportCallback (uint8_t reportID, void (*fCallback) (BLECharacteristic* chr, uint8_t conn_id)); - -**Parameters** -~~~~~~~~~~~~~~ - -reportID: HID report ID of output report - -chr: BLECharacteristic class object containing received HID output report data. - -conn_id: connection ID of the device that send out HID report data. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Setting a user callback function for output reports can only occur after BLEHIDDevice init() function has been called. "BLEHIDDevice.h" must be included to use the class function. - -**BLEHIDDevice::bootKeyboardReport** ------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID boot keyboard input report to connected device. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void bootKeyboardReport (uint8_t* data, uint16_t len, uint8_t conn_id); - -**Parameters** -~~~~~~~~~~~~~~ - -data: pointer to the HID input report data to be sent. - -len: length of HID input report data in bytes. - -conn_id: connection ID of device that the HID input report will be sent to. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: By default, the HID service Protocol Mode characteristic has boot mode disabled. To send boot keyboard input reports, the Protocol Mode characteristic needs to have boot mode enabled. "BLEHIDDevice.h" must be included to use the class function. - -**BLEHIDDevice::setHidInfo** ----------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set HID information such as HID class specification version, country code and flags for HID service. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setHidInfo (uint16_t bcd, uint8_t country, uint8_t flags); - -**Parameters** -~~~~~~~~~~~~~~ - -bcd: 16-bit unsigned integer representing version number of base USB HID Specification implemented by HID Device. - -country: 8-bit integer identifying country HID Device hardware is localized for. Most hardware is not localized (value 0x00). - -flags: Bit flags indicating remote-wake capability and advertising when bonded but not connected. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: For detailed information on the characteristic, refer to Bluetooth SIG HID Service specifications. "BLEHIDDevice.h" must be included to use the class function. - -**BLEHIDDevice::setBattLevel** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set battery level data of the Battery service. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setBattLevel (uint8_t level); - -**Parameters** -~~~~~~~~~~~~~~ - -level: battery level expressed as % of full charge. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Battery level is set to 100% by default. For detailed information refer to Bluetooth SIG Battery service specifications. "BLEHIDDevice.h" must be included to use the class function. - -**BLEHIDDevice::setPNPInfo** ----------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set PNP data of the Device Information service. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setPNPInfo (uint8_t sig, uint16_t vid, uint16_t pid, uint16_t version); - -**Parameters** -~~~~~~~~~~~~~~ - -sig: The Vendor ID Source field designates which organization assigned the value used in the Vendor ID field value. - -vid: The Vendor ID field is intended to uniquely identify the vendor of the device. - -pid: The Product ID field is intended to distinguish between different products made by the vendor. - -version: The Product Version field is a numeric expression identifying the device release number in Binary-Coded Decimal. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: By default, sig and vid are configured to indicate Realtek as the vendor. For detailed information refer to Bluetooth SIG Device Information service specifications. "BLEHIDDevice.h" must be included to use the class function. - -**BLEHIDDevice::setManufacturerString** ---------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set manufacturer information of the Device Information service. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setManufacturerString (const char* manufacturer); - -**Parameters** -~~~~~~~~~~~~~~ - -manufacturer: pointer to character string containing manufacturer name. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Manufacturer is set to "Realtek" by default. For detailed information refer to Bluetooth SIG Device Information service specifications. "BLEHIDDevice.h" must be included to use the class function. - -**BLEHIDDevice::setModelString** --------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set model information of the Device Information service. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setModelString (const char* model); - -**Parameters** -~~~~~~~~~~~~~~ - -model: pointer to character string containing device model info. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Model is set to "Ameba_BLE_HID" by default. For detailed information refer to Bluetooth SIG Device Information service specifications. "BLEHIDDevice.h" must be included to use the class function. - -**BLEHIDDevice::hidService** ----------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get reference to HID service. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLEService& hidService (void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns a pointer to the BLEService class object for the HID service. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDMouse `_ - -.. note :: "BLEHIDDevice.h" must be included to use the class function. - -**BLEHIDDevice::devInfoService** --------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get reference to Device Information service. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLEService& devInfoService (void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns a pointer to the BLEService class object for the Device Information service. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDMouse `_ - -.. note :: "BLEHIDDevice.h" must be included to use the class function. - -**BLEHIDDevice::battService** ------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Get reference to Battery service. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLEService& battService (void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns a pointer to the BLEService class object for the Battery service. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDMouse `_ - -.. note :: "BLEHIDDevice.h" must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/BLE/Class BLEHIDGamepad.rst b/bak/ambd/_common/API_Documents/BLE/Class BLEHIDGamepad.rst deleted file mode 100644 index 41f1297..0000000 --- a/bak/ambd/_common/API_Documents/BLE/Class BLEHIDGamepad.rst +++ /dev/null @@ -1,530 +0,0 @@ -Class BLEHIDGamepad -=================== - -.. contents:: - :local: - :depth: 2 - -**BLEHIDGamepad Class** ------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -A class used for creating and managing a BLE HID Gamepad. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - class BLEHIDGamepad - -**Members** -~~~~~~~~~~~ - -+----------------------------+-----------------------------------------+ -| **Public Constructors** | -+============================+=========================================+ -| BLEHIDGamepad::BLEHIDG | Constructs a BLEHIDGamepad object | -| amepad | | -+----------------------------+-----------------------------------------+ -| **Public Methods** | -+----------------------------+-----------------------------------------+ -| BLEHIDGamepad::setReportID | Set HID report ID for the HID Gamepad | -+----------------------------+-----------------------------------------+ -| BLEHIDGamepad::gamepad | Send a HID Gamepad report | -| Report | | -+----------------------------+-----------------------------------------+ -| BLEHIDGamepad::buttonPress | Send a HID Gamepad report indicating | -| | buttons pressed | -+----------------------------+-----------------------------------------+ -| BLEHIDGamepad:: | Send a HID Gamepad report indicating | -| buttonRelease | buttons released | -+----------------------------+-----------------------------------------+ -| BLEHIDGamepad:: | Send a HID Gamepad report indicating no | -| buttonReleaseAll | buttons pressed | -+----------------------------+-----------------------------------------+ -| BLEHIDGamepad::setHat | Send a HID Gamepad report indicating | -| | hat switch position | -+----------------------------+-----------------------------------------+ -| BLEHIDGamepad::setAxes | Send a HID Gamepad report indicating | -| | position of all axes | -+----------------------------+-----------------------------------------+ -|BLEHIDGamepad::setLeftStick | Send a HID Gamepad report indicating | -| | position of axes corresponding to left | -| | analog stick | -+----------------------------+-----------------------------------------+ -| BLEHIDGamepad:: | Send a HID Gamepad report indicating | -| setRightStick | position of axes corresponding to right | -| | analog stick | -+----------------------------+-----------------------------------------+ -| BLEHIDGamepad::setTriggers | Send a HID Gamepad report indicating | -| | position of axes corresponding to | -| | triggers | -+----------------------------+-----------------------------------------+ - -**BLEHIDGamepad::BLEHIDGamepad** --------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Constructs a BLEHIDGamepad object. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLEHIDGamepad(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDGamepad `_ - -.. note :: By default, the BLEHIDGamepad class assumes the HID report descriptor implements a gamepad device with 16 buttons, 6 16-bit axes and an 8-direction hat switch. This class will not work if a different gamepad report descriptor is implemented. "BLEHIDGamepad.h" must be included to use the class function. - -**BLEHIDGamepad::setReportID** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set HID report ID for the HID Gamepad. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setReportID (uint8_t reportID); - -**Parameters** -~~~~~~~~~~~~~~ - -reportID: The report ID for the gamepad device, corresponding to the HID report descriptor. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDGamepad `_ - -.. note :: HID report ID should start at 1. Some systems may consider a report ID of 0 as invalid. "BLEHIDGamepad.h" must be included to use the class function. - -**BLEHIDGamepad::gamepadReport** --------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID Gamepad report. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void gamepadReport (hid_gamepad_report_t* report); - void gamepadReport (uint16_t buttons, uint8_t hat, int16_t x, int16_t y, int16_t z, int16_t Rz, int16_t Rx, int16_t Ry); - -**Parameters** -~~~~~~~~~~~~~~ - -report: pointer to gamepad report structure containing data on all inputs. - -buttons: bitmap indicating state of each button. - -- 1 (pressed) - -- 0 (released) - -hat: position of hat switch. - -- GAMEPAD_HAT_CENTERED (0) - -- GAMEPAD_HAT_UP (1) - -- GAMEPAD_HAT_UP_RIGHT (2) - -- GAMEPAD_HAT_RIGHT (3) - -- GAMEPAD_HAT_DOWN_RIGHT (4) - -- GAMEPAD_HAT_DOWN (5) - -- GAMEPAD_HAT_DOWN_LEFT (6) - -- GAMEPAD_HAT_LEFT (7) - -- GAMEPAD_HAT_UP_LEFT (8) - -x: position of x axis in integer. - -- -32767 to 32767. - -y: position of y axis in integer. - -- -32767 to 32767. - -z: position of z axis in integer. - -- -32767 to 32767. - -Rz: position of Rz axis in integer. - -- -32767 to 32767. - -Rx: position of Rx axis in integer. - -- -32767 to 32767. - -Ry: position of Ry axis in integer. - -- -32767 to 32767. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDGamepad `_ - -.. note :: "BLEHIDGamepad.h" must be included to use the class function. - -**BLEHIDGamepad::buttonPress** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID Gamepad report indicating buttons pressed. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void buttonPress (uint16_t buttons); - -**Parameters** -~~~~~~~~~~~~~~ - -buttons: bitmap indicating buttons pressed. - -- 1 (pressed) - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEHIDGamepad.h" must be included to use the class function. - -**BLEHIDGamepad::buttonRelease** --------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID Gamepad report indicating buttons released. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void buttonRelease (uint16_t buttons); - -**Parameters** -~~~~~~~~~~~~~~ - -buttons: bitmap indicating buttons released. - -- 1 (pressed) - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEHIDGamepad.h" must be included to use the class function. - -**BLEHIDGamepad::buttonReleaseAll** ------------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID Gamepad report indicating no buttons pressed. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void buttonReleaseAll (void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDGamepad `_ - -.. note :: "BLEHIDGamepad.h" must be included to use the class function. - -**BLEHIDGamepad::setHat** -------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID Gamepad report indicating hat switch position. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setHat (uint8_t hat); - -**Parameters** -~~~~~~~~~~~~~~ - -hat: position of hat switch. - -- GAMEPAD_HAT_CENTERED (0) - -- GAMEPAD_HAT_UP (1) - -- GAMEPAD_HAT_UP_RIGHT (2) - -- GAMEPAD_HAT_RIGHT (3) - -- GAMEPAD_HAT_DOWN_RIGHT (4) - -- GAMEPAD_HAT_DOWN (5) - -- GAMEPAD_HAT_DOWN_LEFT (6) - -- GAMEPAD_HAT_LEFT (7) - -- GAMEPAD_HAT_UP_LEFT (8) - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEHIDGamepad.h" must be included to use the class function. - -**BLEHIDGamepad::setAxes** --------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID Gamepad report indicating position of all axes. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setAxes (int16_t x, int16_t y, int16_t z, int16_t Rz, int16_t Rx, int16_t Ry); - -**Parameters** -~~~~~~~~~~~~~~ - -x: position of x axis in integer. - -- -32767 to 32767. - -y: position of y axis in integer. - -- -32767 to 32767. - -z: position of z axis in integer. - -- -32767 to 32767. - -Rz: position of Rz axis in integer. - -- -32767 to 32767. - -Rx: position of Rx axis in integer. - -- -32767 to 32767. - -Ry: position of Ry axis in integer. - -- -32767 to 32767. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDGamepad `_ - -.. note :: "BLEHIDGamepad.h" must be included to use the class function. - -**BLEHIDGamepad::setLeftStick** -------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID Gamepad report indicating position of axes corresponding to left analog stick. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setLeftStick (int16_t x, int16_t y); - -**Parameters** -~~~~~~~~~~~~~~ - -x: position of x axis in integer. - -- -32767 to 32767. - -y: position of y axis in integer. - -- -32767 to 32767. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEHIDGamepad.h" must be included to use the class function. - -**BLEHIDGamepad::setRightStick** --------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID Gamepad report indicating position of axes corresponding to right analog stick. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setLeftStick (int16_t z, int16_t Rz); - -**Parameters** -~~~~~~~~~~~~~~ - -z: position of z axis in integer. - -- -32767 to 32767. - -Rz: position of Rz axis in integer. - -- -32767 to 32767. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEHIDGamepad.h" must be included to use the class function. - -**BLEHIDGamepad::setTriggers** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID Gamepad report indicating position of axes corresponding to triggers. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setTriggers (int16_t Rx, int16_t Ry); - -**Parameters** -~~~~~~~~~~~~~~ - -Rx: position of Rx axis in integer. - -- -32767 to 32767. - -Ry: position of Ry axis in integer. - -- -32767 to 32767. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEHIDGamepad.h" must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/BLE/Class BLEHIDKeyboard.rst b/bak/ambd/_common/API_Documents/BLE/Class BLEHIDKeyboard.rst deleted file mode 100644 index 8dfeef9..0000000 --- a/bak/ambd/_common/API_Documents/BLE/Class BLEHIDKeyboard.rst +++ /dev/null @@ -1,429 +0,0 @@ -Class BLEHIDKeyboard -==================== - -.. contents:: - :local: - :depth: 2 - -**BLEHIDKeyboard Class** ------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -A class used for creating and managing a BLE HID Keyboard. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - class BLEHIDKeyboard - -**Members** -~~~~~~~~~~~ - -**Public Constructors** - -+------------------------------------+------------------------------------+ -| **Public Constructors** | -+====================================+====================================+ -| BLEHIDKeyboard::BLEHIDKeyboard | Constructs a BLEHIDKeyboard | -| | object | -+------------------------------------+------------------------------------+ -| **Public Methods** | -+------------------------------------+------------------------------------+ -| BLEHIDKeyboard::setReportID | Set HID report ID for the HID | -| | Keyboard and HID consumer | -| | control | -+------------------------------------+------------------------------------+ -| BLEHIDKeyboard::consumerReport | Send a HID Consumer report | -+------------------------------------+------------------------------------+ -| BLEHIDKeyboard::keyboardReport | Send a HID Keyboard report | -+------------------------------------+------------------------------------+ -| BLEHIDKeyboard::consumerPress | Send a HID Consumer report | -| | indicating button pressed | -+------------------------------------+------------------------------------+ -| BLEHIDKeyboard::consumerRelease | Send a HID Consumer report | -| | indicating button released | -+------------------------------------+------------------------------------+ -| BLEHIDKeyboard::keypress | Send a HID Keyboard report | -| | indicating keys pressed | -+------------------------------------+------------------------------------+ -| BLEHIDKeyboard::keyRelease | Send a HID Keyboard report | -| | indicating keys released | -+------------------------------------+------------------------------------+ -| BLEHIDKeyboard::keyReleaseAll | Send a HID Keyboard report | -| | indicating no keys pressed | -+------------------------------------+------------------------------------+ -| BLEHIDKeyboard::keyCharPress | Send a HID Keyboard report | -| | indicating keys pressed to | -| | output an ASCII character | -+------------------------------------+------------------------------------+ -| BLEHIDKeyboard::keySequence | Send a HID Keyboard report | -| | indicating keys pressed to | -| | output an ASCII string | -+------------------------------------+------------------------------------+ - -**BLEHIDKeyboard::BLEHIDKeyboard** ----------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Constructs a BLEHIDKeyboard object. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLEHIDKeyboard(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDKeyboard `_ - -.. note :: "BLEHIDKeyboard.h" must be included to use the class function. - -**BLEHIDKeyboard::setReportID** - -**Description** -~~~~~~~~~~~~~~~ - -Set HID report ID for the HID Keyboard and HID consumer control. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setReportID (uint8_t reportIDKeyboard, uint8_t reportIDConsumer); - -**Parameters** -~~~~~~~~~~~~~~ - -reportIDKeyboard: The report ID for the HID keyboard device, corresponding to the HID report descriptor. - -reportIDConsumer: The report ID for the HID consumer control device, corresponding to the HID report descriptor. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEHIDKeyboard.h" must be included to use the class function. - -**BLEHIDKeyboard::consumerReport** ----------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID Consumer report. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void consumerReport (uint16_t usage_code); - -**Parameters** -~~~~~~~~~~~~~~ - -usage_code: HID consumer control usage code for the button pressed. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEHIDKeyboard.h" must be included to use the class function. - -**BLEHIDKeyboard::keyboardReport** ----------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID Keyboard report. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void keyboardReport (void); - void keyboardReport (uint8_t modifiers, uint8_t keycode[6]); - -**Parameters** -~~~~~~~~~~~~~~ - -modifiers: bitmap indicating key modifiers pressed (CTRL, ALT, SHIFT). - -keycode: byte array indicating keys pressed. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEHIDKeyboard.h" must be included to use the class function. - -**BLEHIDKeyboard::consumerPress** ---------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID Consumer report indicating button pressed. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void consumerPress (uint16_t usage_code); - -**Parameters** -~~~~~~~~~~~~~~ - -usage_code: HID consumer control usage code for the button pressed. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDKeyboard `_ - -.. note :: "BLEHIDKeyboard.h" must be included to use the class function. - -**BLEHIDKeyboard::consumerRelease** ------------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID Consumer report indicating button released. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void consumerRelease (void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDKeyboard `_ - -.. note :: "BLEHIDKeyboard.h" must be included to use the class function. - -**BLEHIDKeyboard::keypress** ----------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID Keyboard report indicating keys pressed. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void keyPress (uint16_t key); - -**Parameters** -~~~~~~~~~~~~~~ - -key: HID keycode for key pressed. - -- 0x00 to 0xE7. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDKeyboard `_ - -.. note :: "BLEHIDKeyboard.h" must be included to use the class function. - -**BLEHIDKeyboard::keyRelease** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID Keyboard report indicating keys released. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void keyRelease (uint16_t key); - -**Parameters** -~~~~~~~~~~~~~~ - -key: HID keycode for key pressed. - -- 0x00 to 0xE7. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEHIDKeyboard.h" must be included to use the class function. - -**BLEHIDKeyboard::keyReleaseAll** ---------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID Keyboard report indicating no keys pressed. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void keyReleaseAll (void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDKeyboard `_ - -.. note :: "BLEHIDKeyboard.h" must be included to use the class function. - -**BLEHIDKeyboard::keyCharPress** --------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID Keyboard report indicating keys pressed to output a specific ASCII character. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void keyCharPress (char ch); - -**Parameters** -~~~~~~~~~~~~~~ - -ch: ASCII character to output. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEHIDKeyboard.h" must be included to use the class function. - -**BLEHIDKeyboard::keySequence** -------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID Keyboard report indicating keys pressed to output an ASCII string. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void keySequence (const char* str, uint16_t delayTime); - void keySequence (String str, uint16_t delayTime); - -**Parameters** -~~~~~~~~~~~~~~ - -str: character string to output, expressed as a pointer to a character array or a String class object. - -delayTime: time delay between key press and release, in milliseconds. Default value is 5. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDKeyboard `_ - -.. note :: "BLEHIDKeyboard.h" must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/BLE/Class BLEHIDMouse.rst b/bak/ambd/_common/API_Documents/BLE/Class BLEHIDMouse.rst deleted file mode 100644 index d5904c6..0000000 --- a/bak/ambd/_common/API_Documents/BLE/Class BLEHIDMouse.rst +++ /dev/null @@ -1,337 +0,0 @@ -Class BLEHIDMouse -================= - -.. contents:: - :local: - :depth: 2 - -**BLEHIDMouse Class** ---------------------- - -**Description** -~~~~~~~~~~~~~~~ - -A class used for creating and managing a BLE HID Mouse. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - class BLEHIDMouse - -**Members** -~~~~~~~~~~~ - -+----------------------------+-----------------------------------------+ -| **Public Constructors** | -+============================+=========================================+ -| BLEHIDMouse::BLEHIDMouse | Constructs a BLEHIDMouse object | -+----------------------------+-----------------------------------------+ -| **Public Methods** | -+----------------------------+-----------------------------------------+ -| BLEHIDMouse::setReportID | Set HID report ID for the HID Mouse | -+----------------------------+-----------------------------------------+ -| BLEHIDMouse::mouseReport | Send a HID Mouse report | -+----------------------------+-----------------------------------------+ -| BLEHIDMouse::mousePress | Send a HID Mouse report indicating | -| | buttons pressed | -+----------------------------+-----------------------------------------+ -| BLEHIDMouse::mouseRelease | Send a HID Mouse report indicating | -| | buttons release | -+----------------------------+-----------------------------------------+ -| BLEHIDMouse:: | Send a HID Mouse report indicating no | -| mouseReleaseAll | button Pressed | -+----------------------------+-----------------------------------------+ -| BLEHIDMouse::mouseMove | Send a HID Mouse report indicating | -| | mouse movement | -+----------------------------+-----------------------------------------+ -| BLEHIDMouse::mouseScroll | Send a HID Mouse report indicating | -| | mouse scroll wheel movement | -+----------------------------+-----------------------------------------+ - -**BLEHIDMouse::BLEHIDMouse** ----------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Constructs a BLEHIDMouse object. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLEHIDMouse(void); - -**Parameters** -~~~~~~~~~~~~~~ -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDMouse `_ - -.. note :: "BLEHIDMouse.h" must be included to use the class function. - -**BLEHIDMouse::setReportID** ----------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set HID report ID for the HID Mouse. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setReportID (uint8_t reportID); - -**Parameters** -~~~~~~~~~~~~~~ - -reportID: The report ID for the HID mouse device, corresponding to the HID report descriptor. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEHIDMouse.h" must be included to use the class function. - -**BLEHIDMouse::mouseReport** ----------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID Mouse report. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void mouseReport (hid_mouse_report_t* report); - void mouseReport (uint8_t buttons, int8_t x, int8_t y, int8_t scroll); - -**Parameters** -~~~~~~~~~~~~~~ - -report: pointer to mouse report structure containing data on mouse inputs. - -buttons: bitmap indicating state of each button. - -- 1 (pressed) - -- 0 (released) - -x: mouse x-axis movement in integer. - -- -127 to 127. - -y: mouse y-axis movement in integer. - -- -127 to 127. - -scroll: mouse scroll wheel movement in integer. - -- -127 to 127. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEHIDMouse.h" must be included to use the class function. - -**BLEHIDMouse::mousePress** ---------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID Mouse report indicating buttons pressed. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void mousePress (uint8_t buttons); - -**Parameters** -~~~~~~~~~~~~~~ - -buttons: bitmap indicating buttons pressed. - -- 1 (pressed) - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDMouse `_ - -.. note :: "BLEHIDMouse.h" must be included to use the class function. - -**BLEHIDMouse::mouseRelease** ------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID Mouse report indicating buttons released. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void mouseRelease (uint8_t buttons); - -**Parameters** -~~~~~~~~~~~~~~ - -buttons: bitmap indicating buttons released. - -- 1 (pressed) - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDMouse `_ - -.. note :: "BLEHIDMouse.h" must be included to use the class function. - -**BLEHIDMouse::mouseReleaseAll** --------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID Mouse report indicating no buttons pressed. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void mouseReleaseAll(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEHIDMouse.h" must be included to use the class function. - -**BLEHIDMouse::mouseMove** --------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID Mouse report indicating mouse movement. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void mouseMove (int8_t x, int8_t y); - -**Parameters** -~~~~~~~~~~~~~~ - -x: mouse x-axis movement in integer. - -- -127 to 127. - -y: mouse y-axis movement in integer. - -- -127 to 127. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDMouse `_ - -.. note :: "BLEHIDMouse.h" must be included to use the class function. - -**BLEHIDMouse::mouseScroll** ----------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Send a HID Mouse report indicating mouse scroll wheel movement. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void mouseScroll (int8_t scroll); - -**Parameters** -~~~~~~~~~~~~~~ - -scroll: mouse scroll wheel movement in integer. - -- -127 to 127. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDMouse `_ - -.. note :: "BLEHIDMouse.h" must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/BLE/Class BLERemoteCharacteristic.rst b/bak/ambd/_common/API_Documents/BLE/Class BLERemoteCharacteristic.rst deleted file mode 100644 index cc46415..0000000 --- a/bak/ambd/_common/API_Documents/BLE/Class BLERemoteCharacteristic.rst +++ /dev/null @@ -1,831 +0,0 @@ -Class BLERemoteCharacteristic -============================= - -.. contents:: - :local: - :depth: 2 - -**BLERemoteCharacteristic Class** ---------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -A class used for managing BLE GATT characteristics on connected remote devices. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - class BLERemoteCharacteristic - -**Members** -~~~~~~~~~~~ - -+------------------------------------+---------------------------------+ -| **Public Constructors** | -+====================================+=================================+ -| No public constructor is available for this class. You can get a | -| pointer to an instance of this class using | -| BLERemoteService::getCharacteristic(). | -+------------------------------------+---------------------------------+ -| **Public Methods** | -+------------------------------------+---------------------------------+ -| BLERemoteCharacteristic:: | Get a descriptor with the | -| getDescriptor | specified UUID on the | -| | remotedevice | -+------------------------------------+---------------------------------+ -| BLERemoteCharacteristic::getUUID | Get the characteristic UUID | -| | | -+------------------------------------+---------------------------------+ -| BLERemoteCharacteristic:: | Set the size of the internal | -| setBufferLen | data buffer | -+------------------------------------+---------------------------------+ -| BLERemoteCharacteristic:: | Get the current size of the | -| getBufferLen | internal data buffer | -+------------------------------------+---------------------------------+ -| BLERemoteCharacteristic::canRead | Determine if characteristic has | -| | read property enabled | -+------------------------------------+---------------------------------+ -| BLERemoteCharacteristic::canWrite | Determine if characteristic has | -| | write property enabled | -+------------------------------------+---------------------------------+ -| BLERemoteCharacteristic::canNotify | Determine if characteristic has | -| | notify property enabled | -+------------------------------------+---------------------------------+ -| BLERemoteCharacteristic:: | Determine if characteristic has | -| canIndicate | indicate property enabled | -+------------------------------------+---------------------------------+ -| BLERemoteCharacteris tic:: | Get the characteristic | -| getProperties | properties | -+------------------------------------+---------------------------------+ -| BLERemoteCharacteristic::readString| Read the characteristic data | -| | buffer as a String object | -+------------------------------------+---------------------------------+ -| BLERemoteCharacteristic::readData8 | Read the characteristic data | -| | buffer as an unsigned 8-bit | -| | integer | -+------------------------------------+---------------------------------+ -| BLERemoteCharacteristic::readData16| Read the characteristic data | -| | buffer as an unsigned 16-bit | -| | integer | -+------------------------------------+---------------------------------+ -| BLERemoteCharacteristic::readData32| Read the characteristic data | -| | buffer as an unsigned 32-bit | -| | integer | -+------------------------------------+---------------------------------+ -| BLERemoteCharacteristic:: | Write data to the | -| writeString | characteristic as a String | -| | object or character array | -+------------------------------------+---------------------------------+ -| BLERemoteCharacteristic::writeData8| Write data to the | -| | characteristic as an unsigned | -| | 8-bit integer | -+------------------------------------+---------------------------------+ -| BLERemoteCharacteristic:: | Write data to the | -| writeData16 | characteristic as an unsigned | -| | 16-bit integer | -+------------------------------------+---------------------------------+ -| BLERemoteCharacteristic:: | Write data to the | -| writeData32 | characteristic as an unsigned | -| | 32-bit integer | -+------------------------------------+---------------------------------+ -| BLERemoteCharacteristic::setData | Write data to the remote device | -| | characteristic | -+------------------------------------+---------------------------------+ -| BLERemoteCharacteristic::getData | Get the characteristic data | -| | from the remote device and read | -| | the data in the buffer | -+------------------------------------+---------------------------------+ -| BLERemoteCharacteristic:: | Enable notification or | -| enableNotifyIndicate | indication for the | -| | characteristic | -+------------------------------------+---------------------------------+ -| BLERemoteCharacteristic:: | Disable notification and | -| disableNotifyIndicate | indication for the | -| | characteristic | -+------------------------------------+---------------------------------+ -| BLERemoteCharacteristic:: | Set a user function as a | -| setNotifyCallback | notification callback | -+------------------------------------+---------------------------------+ - -**BLERemoteCharacteristic::getDescriptor** ------------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get a descriptor with the specified UUID on the remote device. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLERemoteDescriptor* getDescriptor(const char* uuid); - BLERemoteDescriptor* getDescriptor(BLEUUID uuid); - -**Parameters** -~~~~~~~~~~~~~~ - -uuid: the desired descriptor UUID, expressed as a character array or a BLEUUID object. - -**Returns** -~~~~~~~~~~~ - -This function returns the found descriptor as a BLERemoteDescriptor object pointer, otherwise nullptr is returned if a descriptor with the UUID is not found. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteCharacteristic.h" must be included to use the class function. - -**BLERemoteCharacteristic::getUUID** ------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the characteristic UUID. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLEUUID getUUID(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -The function returns the characteristic UUID as a BLEUUID class object. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteCharacteristic.h" must be included to use the class function. - -**BLERemoteCharacteristic::setBufferLen** ------------------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Set the size of the internal data buffer of the characteristic. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setBufferLen(uint16_t max_len); - -**Parameters** -~~~~~~~~~~~~~~ - -max_len: the size in bytes to resize the internal buffer to. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEUartClient `_ - -.. note :: Characteristic data buffer has a default size of 20 bytes and can be increased up to 230 bytes. "BLERemoteCharacteristic.h" must be included to use the class function. - -**BLERemoteCharacteristic::getBufferLen** ------------------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Get the current size of the characteristic internal buffer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint16_t getBufferLen(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the current internal buffer size that is set. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteCharacteristic.h" must be included to use the clas function. - -**BLERemoteCharacteristic::canRead** ------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Determine if characteristic has read property enabled. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool canRead(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns TRUE if the read property for the characteristic is enabled. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteCharacteristic.h" must be included to use the class function. - -**BLERemoteCharacteristic::canWrite** -------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Determine if characteristic has write property enabled. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool canWrite(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns TRUE if the write property or the write no response property for the characteristic is enabled. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteCharacteristic.h" must be included to use the class function. - -**BLERemoteCharacteristic::canNotify** --------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Determine if characteristic has notify property enabled. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool canNotify(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -The function returns TRUE if the notify property for the characteristic is enabled. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteCharacteristic.h" must be included to use the class function. - -**BLERemoteCharacteristic::canIndicate** ----------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Determine if characteristic has indicate property enabled. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool canIndicate(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -The function returns TRUE if the indicate property for the characteristic is enabled. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteCharacteristic.h" must be included to use the class function. - -**BLERemoteCharacteristic::getProperties** ------------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the characteristic properties. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint16_t getProperties(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -The function returns the characteristic properties. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteCharacteristic.h" must be included to use the class function. - -**BLERemoteCharacteristic::readString** ---------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Request for characteristic data from the remote device and read the data in the buffer, expressed as a String class object. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - String readString(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -The function returns the data in the characteristic data buffer expressed as a String class object. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEUartClient `_ - -.. note :: "BLERemoteCharacteristic.h" must be included to use the class function. - -**BLERemoteCharacteristic::readData8** --------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Request for characteristic data from the remote device and read the data in the buffer, expressed as an unsigned 8-bit integer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint8_t readData8(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the data in the characteristic data buffer expressed as a uint8_t value. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEBatteryClient `_ - -.. note :: "BLERemoteCharacteristic.h" must be included to use the class function. - -**BLERemoteCharacteristic::readData16** ---------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Request for characteristic data from the remote device and read the data in the buffer, expressed as an unsigned 16-bit integer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint16_t readData16(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the data in the characteristic data buffer expressed as a uint16_t value. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteCharacteristic.h" must be included to use the class function. - -**BLERemoteCharacteristic::readData32** ---------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Request for characteristic data from the remote device and read the data in the buffer, expressed as an unsigned 32-bit integer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint32_t readData32(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the data in the characteristic data buffer expressed as a uint32_t value. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteCharacteristic.h" must be included to use the class function. - -**BLERemoteCharacteristic::writeString** ----------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Write data to the remote device characteristic as a String object or character array. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool writeString(String str); - bool writeString(const char* str); - -**Parameters** -~~~~~~~~~~~~~~ - -str: the data to write to the remote characteristic, expressed as a String class object or a char array. - -**Returns** -~~~~~~~~~~~ - -This function returns TRUE if writing data to the remote device characteristic is successful. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteCharacteristic.h" must be included to use the class function. - -**BLERemoteCharacteristic::writeData8** ---------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Write data to the remote device characteristic as an unsigned 8-bit integer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool writeData8(uint8_t num); - -**Parameters** -~~~~~~~~~~~~~~ - -num: the data to write to the characteristic buffer expressed as an unsigned 8-bit integer. - -**Returns** -~~~~~~~~~~~ - -This function returns TRUE if writing data to the remote device characteristic is successful. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteCharacteristic.h" must be included to use the class function. - -**BLERemoteCharacteristic::writeData16** ----------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Write data to the remote device characteristic as an unsigned 16-bit integer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool writeData16(uint16_t num); - -**Parameters** -~~~~~~~~~~~~~~ - -num: the data to write to the characteristic buffer expressed as an unsigned 16-bit integer. - -**Returns** -~~~~~~~~~~~ - -This function returns TRUE if writing data to the remote device characteristic is successful. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteCharacteristic.h" must be included to use the class function. - -**BLERemoteCharacteristic::writeData32** ----------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Write data to the remote device characteristic as a 32-bit integer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool writeData32(uint32_t num); - bool writeData32(int num); - -**Parameters** -~~~~~~~~~~~~~~ - -num: the data to write to the characteristic buffer expressed as a 32-bit integer. - -**Returns** -~~~~~~~~~~~ - -This function returns TRUE if writing data to the remote device characteristic is successful. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteCharacteristic.h" must be included to use the class function. - -**BLERemoteCharacteristic::setData** ------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Write data to the remote device characteristic. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool setData(uint8_t* data, uint16_t datalen); - -**Parameters** -~~~~~~~~~~~~~~ - -data: pointer to byte array containing desired data. - -datalen: number of bytes of data to write. - -**Returns** -~~~~~~~~~~~ - -This function returns TRUE if writing data to the remote device characteristic is successful. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note ::"BLERemoteCharacteristic.h" must be included to use the class function. - -**BLERemoteCharacteristic::getData** ------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the characteristic data from the remote device and read the data in the buffer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint16_t getData (uint8_t* data, uint16_t datalen); - -**Parameters** -~~~~~~~~~~~~~~ - -data: pointer to byte array to save data read from buffer. - -datalen: number of bytes of data to read. - -**Returns** -~~~~~~~~~~~ - -This function returns the number of bytes read. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: If the data buffer contains less data than requested, it will only read the available number of bytes of data. "BLERemoteCharacteristic.h" must be included to use the class function. - -**BLERemoteCharacteristic::enableNotifyIndicate** -------------------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Enable the remote device to send notifications or indications for the characteristic. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void enableNotifyIndicate(bool notify); - -**Parameters** -~~~~~~~~~~~~~~ - -notify: Enable notifications or indications. Default value is TRUE. - -- TRUE (enable notifications) - -- FALSE (enable indications) - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEUartClient `_ - -.. note :: "BLERemoteCharacteristic.h" must be included to use the class function. - -**BLERemoteCharacteristic::disableNotifyIndicate** --------------------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Disable receiving notifications and indications for the characteristic from the remote device. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void disableNotifyIndicate(void); - -**Parameters** - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteCharacteristic.h" must be included to use the class function. - -**BLERemoteCharacteristic::setNotifyCallback** ----------------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set a user function to be called when the characteristic receives a notification from the remote device. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setNotifyCallback(void (*fCallback) (BLERemoteCharacteristic* chr, uint8_t* data, uint16_t length)); - -**Parameters** -~~~~~~~~~~~~~~ - -fCallback: A user callback function that returns void and takes three arguments. - -chr: pointer to BLERemoteCharacteristic object associated with notification. - -data: pointer to byte array containing notification data. - -length: number of bytes of notification data in array. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEUartClient `_ - -.. note :: "BLERemoteCharacteristic.h" must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/BLE/Class BLERemoteDescriptor.rst b/bak/ambd/_common/API_Documents/BLE/Class BLERemoteDescriptor.rst deleted file mode 100644 index 83ee5c7..0000000 --- a/bak/ambd/_common/API_Documents/BLE/Class BLERemoteDescriptor.rst +++ /dev/null @@ -1,493 +0,0 @@ -Class BLERemoteDescriptor -========================= - -.. contents:: - :local: - :depth: 2 - -**BLERemoteDescriptor Class** ------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -A class used for managing BLE GATT descriptors on connected remote devices. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - class BLERemoteDescriptor - -**Members** -~~~~~~~~~~~ - -+------------------------------------+---------------------------------+ -| **Public Constructors** | -+====================================+=================================+ -| No public constructor is available for this class. You can get a | -| pointer to an instance of this class using | -| BLERemoteCharacteristic::getDescriptor() | -+------------------------------------+---------------------------------+ -| **Public Methods** | -+------------------------------------+---------------------------------+ -| BLERemoteDescriptor::getUUID | Get the descriptor UUID | -+------------------------------------+---------------------------------+ -| BLERemoteDescriptor::setBufferLen | Set the size of the internal | -| | data buffer | -+------------------------------------+---------------------------------+ -| BLERemoteDescriptor::getBufferLen | Get the current size of the | -| | internal data buffer | -+------------------------------------+---------------------------------+ -| BLERemoteDescriptor::readString | Read the descriptor data buffer | -| | as a String object | -+------------------------------------+---------------------------------+ -| BLERemoteDescriptor::readData8 | Read the descriptor data buffer | -| | as an unsigned 8-bit integer | -+------------------------------------+---------------------------------+ -| BLERemoteDescriptor::readData16 | Read the descriptor data buffer | -| | as an unsigned 16-bit integer | -+------------------------------------+---------------------------------+ -| BLERemoteDescriptor::readData32 | Read the descriptor data buffer | -| | as an unsigned 32-bit integer | -+------------------------------------+---------------------------------+ -| BLERemoteDescriptor::writeString | Write data to the descriptor as | -| | a String object or character | -| | array | -+------------------------------------+---------------------------------+ -| BLERemoteDescriptor::writeData8 | Write data to the descriptor | -| | as an unsigned 8-bit integer | -+------------------------------------+---------------------------------+ -| BLERemoteDescriptor::writeData16 | Write data to the descriptor | -| | as an unsigned 16-bit integer | -+------------------------------------+---------------------------------+ -| BLERemoteDescriptor::writeData32 | Write data to the descriptor | -| | as an unsigned 32-bit integer | -+------------------------------------+---------------------------------+ -| BLERemoteDescriptor::setData | Write data to the descriptor | -+------------------------------------+---------------------------------+ -| BLERemoteDescriptor::getData | Get data from the descriptor | -+------------------------------------+---------------------------------+ - -**BLERemoteDescriptor::getUUID** --------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the descriptor UUID. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLEUUID getUUID(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the descriptor UUID as a BLEUUID class object. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteDescriptor.h" must be included to use the class function. - -**BLERemoteDescriptor::setBufferLen** -------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the size of the internal data buffer of the descriptor. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setBufferLen(uint16_t max_len); - -**Parameters** -~~~~~~~~~~~~~~ - -max_len: the size in bytes to resize the internal buffer to. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Descriptor data buffer has a default size of 20 bytes and can be increased up to 230 bytes. "BLERemoteDescriptor.h" must be included to use the class function. - -**BLERemoteDescriptor::getBufferLen** -------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the current size of the descriptor internal buffer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint16_t getBufferLen(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the current internal buffer size that is set. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteDescriptor.h" must be included to use the class function. - -**BLERemoteDescriptor::readString** ------------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Request for descriptor data from the remote device and read the data in the buffer, expressed as a String class object. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - String readString(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -The function returns the data in the descriptor buffer expressed as a String class object. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteDescriptor.h" must be included to use the class function. - -**BLERemoteDescriptor::readData8** ----------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Request for descriptor data from the remote device and read the data in the buffer, expressed as an unsigned 8-bit integer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint8_t readData8(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -The function returns the data in the descriptor buffer expressed as a uint8_t value. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteDescriptor.h" must be included to use the class function. - -**BLERemoteDescriptor::readData16** ------------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Request for descriptor data from the remote device and read the data in the buffer, expressed as an unsigned 16-bit integer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint16_t readData16(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -The function returns the data in the descriptor buffer expressed as a uint16_t value. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteDescriptor.h" must be included to use the class function. - -**BLERemoteDescriptor::readData32** ------------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Request for descriptor data from the remote device and read the data in the buffer, expressed as an unsigned 32-bit integer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint32_t readData32(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -The function returns the data in the descriptor buffer expressed as a uint32_t value. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteDescriptor.h" must be included to use the class function. - -**BLERemoteDescriptor::writeString** ------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Write data to the remote device descriptor as a String object or character array. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool writeString(String str); - bool writeString(const char* str); - -**Parameters** -~~~~~~~~~~~~~~ - -str: the data to write to the remote descriptor, expressed as a String class object or a char array. - -**Returns** -~~~~~~~~~~~ - -This function returns TRUE if writing data to remote device descriptor is successful. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteDescriptor.h" must be included to use the class function. - -**BLERemoteDescriptor::writeData8** ------------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Write data to the remote device descriptor as an unsigned 8-bit integer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool writeData8(uint8_t num); - -**Parameters** -~~~~~~~~~~~~~~ - -num: the data to write to the descriptor buffer expressed as an unsigned 8-bit integer. - -**Returns** -~~~~~~~~~~~ - -This function returns TRUE if writing data to remote device descriptor is successful. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteDescriptor.h" must be included to use the class function. - -**BLERemoteDescriptor::writeData16** ------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Write data to the remote device descriptor as an unsigned 16-bit integer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool writeData16(uint16_t num); - -**Parameters** -~~~~~~~~~~~~~~ - -num: the data to write to the descriptor buffer expressed as an unsigned 16-bit integer. - -**Returns** -~~~~~~~~~~~ - -This function returns TRUE if writing data to remote device descriptor is successful. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteDescriptor.h" must be included to use the class function. - -**BLERemoteDescriptor::writeData32** ------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Write data to the remote device descriptor as a 32-bit integer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool writeData32(uint32_t num); - bool writeData32(int num); - -**Parameters** -~~~~~~~~~~~~~~ - -num: the data to write to the descriptor buffer expressed as a 32-bit integer. - -**Returns** -~~~~~~~~~~~ - -This function returns TRUE if writing data to remote device descriptor is successful. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteDescriptor.h" must be included to use the class function. - -**BLERemoteDescriptor::setData** --------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Write data to the descriptor. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool setData(uint8_t* data, uint16_t datalen); - -**Parameters** -~~~~~~~~~~~~~~ - -data: pointer to byte array containing desired data to write. - -datalen: number of bytes of data to write. - -**Returns** -~~~~~~~~~~~ - -This function returns TRUE if writing data to remote device descriptor is successful. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteDescriptor.h" must be included to use the class function. - -**BLERemoteDescriptor::getData** --------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the descriptor data from the remote device and read the data in the buffer. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint16_t getData(uint8_t* data, uint16_t datalen); - -**Parameters** -~~~~~~~~~~~~~~ - -data: pointer to byte array to save data read from buffer. - -datalen: number of bytes of data to read. - -**Returns** -~~~~~~~~~~~ - -The function returns the number of bytes read. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: If the data buffer contains less data than requested, it will only read the available number of bytes of data. "BLERemoteDescriptor.h" must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/BLE/Class BLERemoteService.rst b/bak/ambd/_common/API_Documents/BLE/Class BLERemoteService.rst deleted file mode 100644 index 1548e02..0000000 --- a/bak/ambd/_common/API_Documents/BLE/Class BLERemoteService.rst +++ /dev/null @@ -1,103 +0,0 @@ -Class BLERemoteService -====================== - -.. contents:: - :local: - :depth: 2 - -**BLERemoteService Class** --------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -A class used for managing BLE GATT services on connected remote devices. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - class BLERemoteService - -**Members** -~~~~~~~~~~~ - -+------------------------------------+---------------------------------+ -| **Public Constructors** | -+====================================+=================================+ -| No public constructor is available for this class. You can get a | -| pointer to an instance of this class using BLEClient::getService(). | -+------------------------------------+---------------------------------+ -| **Public Methods** | -+------------------------------------+---------------------------------+ -| BLERemoteService::getUUID | Get the service UUID | -+------------------------------------+---------------------------------+ -| BLERemoteService::getCharacteristic| Get a specific characteristic | -| | on the remote device | -+------------------------------------+---------------------------------+ - -**BLERemoteService::getUUID** ------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Get the service UUID. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLEUUID getUUID(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the service UUID as a BLEUUID class object. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLERemoteService.h" must be included to use the class function. - -**BLERemoteService::getCharacteristic** ---------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get a characteristic with the specified UUID on the remote device. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLERemoteCharacteristic* getCharacteristic (const char* uuid); - BLERemoteCharacteristic* getCharacteristic (BLEUUID uuid); - -**Parameters** -~~~~~~~~~~~~~~ - -uuid: the desired characteristic UUID, expressed as a character array or a BLEUUID class object. - -**Returns** -~~~~~~~~~~~ - -The function returns the found characteristic as a BLERemoteCharacteristic object pointer, otherwise nullptr is returned if a characteristic with the UUID is not found. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEUartClient `_ - -.. note :: BLERemoteService.h" must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/BLE/Class BLEScan.rst b/bak/ambd/_common/API_Documents/BLE/Class BLEScan.rst deleted file mode 100644 index c2b3beb..0000000 --- a/bak/ambd/_common/API_Documents/BLE/Class BLEScan.rst +++ /dev/null @@ -1,349 +0,0 @@ -Class BLEScan -============= - -.. contents:: - :local: - :depth: 2 - -**BLEScan Class** ------------------ - -**Description** -~~~~~~~~~~~~~~~ - -A class used for managing BLE scanning settings. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - class BLEScan - -**Members** -~~~~~~~~~~~ - -+----------------------------------------------------------------------+ -| **Public Constructors** | -+======================================================================+ -| No public constructor is available as this class is intended to be a | -| singleton class. You can get a pointer to this class using | -| BLEDevice::configScan | -+----------------------------------------------------------------------+ -| **Public Methods** | -+------------------------------------+---------------------------------+ -| BLEScan::updateScanParams | Update the lower Bluetooth | -| | stack with the current scan | -| | settings | -+------------------------------------+---------------------------------+ -| BLEScan::startScan | Start a BLE scan | -+------------------------------------+---------------------------------+ -| BLEScan::stopScan | Stop a BLE scan | -+------------------------------------+---------------------------------+ -| BLEScan::setScanMode | Set the BLE scanning mode | -+------------------------------------+---------------------------------+ -| BLEScan::setScanInterval | Set the BLE scanning interval | -+------------------------------------+---------------------------------+ -| BLEScan::setScanWindow | Set the BLE scanning window | -+------------------------------------+---------------------------------+ -| BLEScan::setScanDuplicateFilter | Set the BLE scan duplicate | -| | filter | -+------------------------------------+---------------------------------+ -| BLEScan::scanInProgress | Check if a scan is currently in | -| | progress | -+------------------------------------+---------------------------------+ -| BLEScan::printScanInfo | Print out scanned information | -+------------------------------------+---------------------------------+ - -**BLEScan::updateScanParams** ------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Update the lower Bluetooth stack with the current scan settings. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void updateScanParams(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEScan `_ - -.. note :: Stop any scans in progress first before using this function. "BLEScan.h" must be included to use the class function. - -**BLEScan::startScan** ----------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Start BLE scanning. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void startScan(void); - void startScan(uint32_t scanDuration_ms); - -**Parameters** -~~~~~~~~~~~~~~ - -scanDuration: BLE scan will stop after scanDuration milliseconds. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEScan `_ - -.. note :: Set the scan parameters first before starting a scan. BLE scans will occur continuously for the duration set with BLEDevice::setScanWindow() and will repeat with a time interval set with BLEDevice::setScanInterval(). Call this member function without an argument to start scanning until BLEDevice::stopScan() is called. "BLEScan.h" must be included to use the class function. - -**BLEScan::stopScan** ---------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Stop BLE scanning. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void stopScan(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEScan.h" must be included to use the class function. - -**BLEScan::setScanMode** ------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the BLE scanning mode. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setScanMode(uint8_t scanMode); - -**Parameters** -~~~~~~~~~~~~~~ - -scanMode: GAP_SCAN_MODE_PASSIVE for passive scanning, GAP_SCAN_MODE_ACTIVE for active scanning. Default value is GAP_SCAN_MODE_ACTIVE. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEScan `_ - -.. note :: Active scanning will request for scan response packets after discovering an advertising device. Passive scanning will only capture advertising data packets. "BLEScan.h" must be included to use the class function. - -**BLEScan::setScanInterval** ----------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the BLE scanning interval. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setScanInterval(uint16_t scanInt_ms); - -**Parameters** -~~~~~~~~~~~~~~ - -scanInt_ms: scan interval in milliseconds. Default value is 40. - -- 3 to 10240. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEScan `_ - -.. note :: A BLE scan will repeat with a time interval set with this member function. "BLEScan.h" must be included to use the class function. - -**BLEScan::setScanWindow** --------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set the BLE scanning window. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setScanWindow(uint16_t scanWindow_ms); - -**Parameters** -~~~~~~~~~~~~~~ - -scanWindow_ms: scan window in milliseconds. Default value is 30. - -- 3 to 10240. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEScan `_ - -.. note :: A BLE scan will scan continuously for a window duration set with this member function. The scan window should be less than or equal to the scan interval. "BLEScan.h" must be included to use the class function. - -**BLEScan::setScanDuplicateFilter** ------------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Set the scan duplicate filter. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setScanDuplicateFilter(bool dupeFilter); - -**Parameters** -~~~~~~~~~~~~~~ - -dupeFilter: TRUE to enable duplicate filtering. Enabled by default. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Enabling duplicate filters will ignore scan results for devices already discovered previously. "BLEScan.h" must be included to use the class function. - -**BLEScan::scanInProgress** ---------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Check if scanning is currently in progress. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - bool scanInProgress(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns TRUE if BLE scanning is in progress. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEScan.h" must be included to use the class function. - -**BLEScan::printScanInfo** --------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Parse and print out scanned information. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void printScanInfo(T_LE_CB_DATA* p_data); - -**Parameters** -~~~~~~~~~~~~~~ - -p_data: pointer to scan data of type T_LE_CB_DATA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEScan `_ - -.. note :: Use this member function to parse the various fields of received advertisement data packets and print the results out to the serial monitor. "BLEScan.h" must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/BLE/Class BLESecurity.rst b/bak/ambd/_common/API_Documents/BLE/Class BLESecurity.rst deleted file mode 100644 index 4c9f612..0000000 --- a/bak/ambd/_common/API_Documents/BLE/Class BLESecurity.rst +++ /dev/null @@ -1,399 +0,0 @@ -Class BLESecurity -================= - -.. contents:: - :local: - :depth: 2 - -**BLESecurity Class** ---------------------- - -**Description** -~~~~~~~~~~~~~~~ - -A class used for creating and managing BLE bonding security parameters. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - class BLESecurity - -**Members** -~~~~~~~~~~~ - -+------------------------------------+---------------------------------+ -| **Public Constructors** | -+====================================+=================================+ -| No public constructor is available as this class is intended to be a | -| singleton class. You can get a pointer to this class using | -| BLEDevice::configSecurity | -+------------------------------------+---------------------------------+ -| **Public Methods** | -+------------------------------------+---------------------------------+ -| BLESecurity::setPairable | Enable pairing and bonding after| -| | BLE connection | -+------------------------------------+---------------------------------+ -| BLESecurity::setAuthFlags | Set BLE bonding security | -| | requirements | -+------------------------------------+---------------------------------+ -| BLESecurity::setIOCapability | Set input and output | -| | capabilities of the device | -+------------------------------------+---------------------------------+ -| BLESecurity::setSecReqEnable | Enable sending SMP security | -| | request when BLE connected | -+------------------------------------+---------------------------------+ -| BLESecurity::setSecReqFlags | Set security request | -| | requirements | -+------------------------------------+---------------------------------+ -| BLESecurity::setStaticPin | Configure device to use static | -| | pin input for BLE bonding | -+------------------------------------+---------------------------------+ -| BLESecurity:: | Set a user callback function for| -| setPasskeyDisplayCallback | passkey display during BLE | -| | bonding | -+------------------------------------+---------------------------------+ -| BLESecurity:: | Set a user callback function for| -| setPasskeyInputCallback | passkey input during BLE bonding| -+------------------------------------+---------------------------------+ -| BLESecurity:: | Set a user callback function for| -| setNumericComparisonCallback | numeric comparison during BLE | -| | bonding | -+------------------------------------+---------------------------------+ - -**BLESecurity::setPairable** ----------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Enable pairing and bonding after BLE connection. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setPairable(bool pairMode); - -**Parameters** -~~~~~~~~~~~~~~ - -pairMode: True to enable pairing and bonding, False to disable. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDMouse `_ - -.. note :: "BLESecurity.h" must be included to use the class function. - -**BLESecurity::setAuthFlags** ------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Set BLE bonding security requirements. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setAuthFlags(uint16_t authFlags); - -**Parameters** -~~~~~~~~~~~~~~ - -authFlags: desired BLE bonding security requirements. - -- GAP_AUTHEN_BIT_NONE - -- GAP_AUTHEN_BIT_BONDING_FLAG - -- GAP_AUTHEN_BIT_MITM_FLAG - -- GAP_AUTHEN_BIT_SC_FLAG - -- GAP_AUTHEN_BIT_SC_ONLY_FLAG - -- GAP_AUTHEN_BIT_FORCE_BONDING_FLAG - -Default value: GAP_AUTHEN_BIT_NONE - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEHIDMouse `_ - -.. note :: "BLESecurity.h" must be included to use the class function. - -**BLESecurity::setIOCapability** --------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set BLE device input and output capabilities. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setIOCap(uint8_t ioCap); - -**Parameters** -~~~~~~~~~~~~~~ - -ioCap: desired device input output capabilities. Default value is GAP_IO_CAP_NO_INPUT_NO_OUTPUT. - -- GAP_IO_CAP_NO_INPUT_NO_OUTPUT - -- GAP_IO_CAP_DISPLAY_ONLY - -- GAP_IO_CAP_DISPLAY_YES_NO - -- GAP_IO_CAP_KEYBOARD_ONLY - -- GAP_IO_CAP_KEYBOARD_DISPLAY - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: The IO capabilities of the peripheral and central device will determine which bonding authentication method is used. "BLESecurity.h" must be included to use the class function. - -**BLESecurity::setSecReqEnable** --------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Enable sending SMP security request when BLE connected. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setSecReqEnable(bool secReq); - -**Parameters** -~~~~~~~~~~~~~~ - -secReq: TRUE to enable, FALSE to disable. Default value is FALSE. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLESecurity.h" must be included to use the class function. - -**BLESecurity::setSecReqFlags** -------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set security request requirements. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setSecReqFlags(uint16_t secReqFlags); - -**Parameters** -~~~~~~~~~~~~~~ - -secReqFlags: desired security requirements. Default value is GAP_AUTHEN_BIT_NONE. - -- GAP_AUTHEN_BIT_NONE - -- GAP_AUTHEN_BIT_BONDING_FLAG - -- GAP_AUTHEN_BIT_MITM_FLAG - -- GAP_AUTHEN_BIT_SC_FLAG - -- GAP_AUTHEN_BIT_SC_ONLY_FLAG - -- GAP_AUTHEN_BIT_FORCE_BONDING_FLAG - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLESecurity.h" must be included to use the class function. - -**BLESecurity::setStaticPin** ------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Configure device to use static pin input for BLE bonding. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setStaticPin(uint32_t pin); - -**Parameters** -~~~~~~~~~~~~~~ - -pin: BLE bonding static pin. Valid values are 6-digit integers. - -- 000000 to 999999. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Using a static pin will enable BLE bonding and pairing, set the IO capability to GAP_IO_CAP_DISPLAY_ONLY and set the bonding security requirements flags to (GAP_AUTHEN_BIT_BONDING_FLAG | GAP_AUTHEN_BIT_MITM_FLAG | GAP_AUTHEN_BIT_SC_FLAG). "BLESecurity.h" must be included to use the class function. - -**BLESecurity::setPasskeyDisplayCallback** ------------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set a user callback function for passkey display during BLE bonding. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setPasskeyDisplayCallback(void (*fCallback) (uint8_t conn_id, uint32_t passkey)); - -**Parameters** -~~~~~~~~~~~~~~ - -fCallback: A user callback function that returns void and takes two arguments. - -conn_id: connection ID of connecting device. - -passkey: bonding passkey to display to user to confirm connection. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLESecurity.h" must be included to use the class function. - -**BLESecurity::setPasskeyInputCallback** ----------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set a user callback function for passkey input during BLE bonding. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setPasskeyInputCallback(uint32_t (*fCallback) (uint8_t conn_id)); - -**Parameters** -~~~~~~~~~~~~~~ - -fCallback: A user callback function that takes no arguments and returns the bonding passkey entered by the user. - -conn_id: connection ID of connecting device. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLESecurity.h" must be included to use the class function. - -**BLESecurity::setNumericComparisonCallback** ---------------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Set a user callback function for numeric comparison during BLE bonding. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setNumericComparisonCallback(bool (*fCallback) (uint8_t conn_id, uint32_t passkey)); - -**Parameters** -~~~~~~~~~~~~~~ - -fCallback: A user callback function that takes two arguments and returns a Boolean to indicate user approval for the numeric comparison. - -conn_id: connection ID of connecting device. - -passkey: bonding passkey to display to user to confirm connection. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLESecurity.h" must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/BLE/Class BLEService.rst b/bak/ambd/_common/API_Documents/BLE/Class BLEService.rst deleted file mode 100644 index 1594968..0000000 --- a/bak/ambd/_common/API_Documents/BLE/Class BLEService.rst +++ /dev/null @@ -1,201 +0,0 @@ -Class BLEService -================ - -.. contents:: - :local: - :depth: 2 - -**BLEService Class** --------------------- - -**Description** -~~~~~~~~~~~~~~~ - -A class used for creating and managing BLE GATT services. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - class BLEService - -**Members** -~~~~~~~~~~~ - -+------------------------------------+---------------------------------+ -| **Public Constructors** | -+====================================+=================================+ -| BLEService::BLEService | Constructs a BLEService object | -+------------------------------------+---------------------------------+ -| **Public Methods** | -+------------------------------------+---------------------------------+ -| BLEService::setUUID | Set service UUID | -+------------------------------------+---------------------------------+ -| BLEService::getUUID | Get service UUID | -+------------------------------------+---------------------------------+ -| BLEService::addCharacteristic | Add a characteristic to service | -+------------------------------------+---------------------------------+ -| BLEService::getCharacteristic | Get a previously added | -| | characteristic | -+------------------------------------+---------------------------------+ - -**BLEService::BLEService** --------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Constructs a BLEService object. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLEService(BLEUUID uuid); - BLEService(const char* uuid); - -**Parameters** -~~~~~~~~~~~~~~ - -uuid: service UUID, expressed as a BLEUUID class object or a character array. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEUartService `_ - -.. note :: "BLEService.h" must be included to use the class function. - -**BLEService::setUUID** ------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Set the service UUID. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void setUUID(BLEUUID uuid); - -**Parameters** -~~~~~~~~~~~~~~ - -uuid: service UUID, expressed as a BLEUUID class object. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEService.h" must be included to use the class function. - -**BLEService::getUUID** ------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Get the service UUID. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLEUUID getUUID(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the service UUID in a BLEUUID class object. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEService.h" must be included to use the class function. - -**BLE::addCharacteristic** - -**Description** -~~~~~~~~~~~~~~~ - -Add a characteristic to the service. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void addCharacteristic(BLECharacteristic& newChar); - -**Parameters** -~~~~~~~~~~~~~~ - -newChar: the BLECharacteristic to add to the service. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEUartService `_ - -.. note :: "BLEService.h" must be included to use the class function. - -**BLE::getCharacteristic** --------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get a previously added characteristic. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLECharacteristic* getCharacteristic(uint8_t charIndex); - -**Parameters** -~~~~~~~~~~~~~~ - -charIndex: position index of characteristic. - -**Returns** -~~~~~~~~~~~ - -This function returns a pointer to the BLECharacteristic at the requested position index else return NULL. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEService.h" must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/BLE/Class BLEUUID.rst b/bak/ambd/_common/API_Documents/BLE/Class BLEUUID.rst deleted file mode 100644 index 54b21b8..0000000 --- a/bak/ambd/_common/API_Documents/BLE/Class BLEUUID.rst +++ /dev/null @@ -1,213 +0,0 @@ -Class BLEUUID -============= - -.. contents:: - :local: - :depth: 2 - -**BLEUUID Class** ------------------ - -**Description** -~~~~~~~~~~~~~~~ - -A class used for creating and managing UUIDs. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - class BLEUUID - -**Members** -~~~~~~~~~~~ - -+------------------------------------+---------------------------------+ -| **Public Constructors** | -+====================================+=================================+ -| BLEUUID::BLEUUID | Create a BLEUUID object | -+------------------------------------+---------------------------------+ -| **Public Methods** | -+------------------------------------+---------------------------------+ -| BLEUUID::str | Get the character string | -| | representation of UUID | -+------------------------------------+---------------------------------+ -| BLEUUID::data | Get the binary representation of| -| | UUID, with the UUID MSB in array| -| | index [0] | -+------------------------------------+---------------------------------+ -| BLEUUID::dataNative | Get the binary representation of| -| | UUID, with the UUID LSB in array| -| | index [0] | -+------------------------------------+---------------------------------+ -| BLEUUID::length | Get the length of UUID | -+------------------------------------+---------------------------------+ - -**BLEUUID::BLEUUID** --------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Create a BLEUUID object from a UUID character string. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLEUUID(void); - BLEUUID(const char* str); - BLEUUID(uint8_t* data, uint8_t length); - -**Parameters** -~~~~~~~~~~~~~~ - -str: UUID as character string used to create object - -data: pointer to byte array containing the desired UUID - -length: number of bytes in array containing the desired UUID. - -- 2, 4 or 16. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEUUID.h" must be included to use the class function. - -**BLEUUID::str** ----------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the character string representation of UUID. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - const char* str(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns a pointer to the UUID represented as a character string. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEUUID.h" must be included to use the class function. - -**BLEUUID::data** ------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Get the binary representation of UUID, with the UUID MSB in array index[0]. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - const uint8_t* data(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns a pointer to an unsigned 8-bit integer array containing the UUID expressed in binary form. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Returned pointer is of const uint8_t* type and will not allow changing of the data. "BLEUUID.h" must be included to use the class function. - -**BLEUUID::dataNative** ------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Get the binary representation of UUID, with the UUID LSB in array index [0]. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - const uint8_t* dataNative(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns a pointer to an unsigned 8-bit integer array containing the UUID expressed in binary form. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: Returned pointer is of const uint8_t* type and will not allow changing of the data. "BLEUUID.h" must be included to use the class function. - -**BLEUUID::length** -------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get the length of UUID. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - uint8_t length(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns the length of the UUID, in units of bytes. - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: A 4-character UUID will be 16 bits / 2 bytes long. A 8-character UUID will be 32 bits / 4 bytes long. A 32-character UUID will be 128 bits / 16 bytes long. "BLEUUID.h" must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/BLE/Class BLEWifiConfigService.rst b/bak/ambd/_common/API_Documents/BLE/Class BLEWifiConfigService.rst deleted file mode 100644 index 9fcf4f6..0000000 --- a/bak/ambd/_common/API_Documents/BLE/Class BLEWifiConfigService.rst +++ /dev/null @@ -1,208 +0,0 @@ -Class BLEWifiConfigService -========================== - -.. contents:: - :local: - :depth: 2 - -**BLEWifiConfigService Class** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -A class used for managing a BLE WiFi configuration service running on -the device - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - class BLEWifiConfigService - -**Members** -~~~~~~~~~~~ - -+------------------------------------+---------------------------------+ -| **Public Constructors** | -+====================================+=================================+ -| BLEWifiConfigService:: | Create an instance of the | -| BLEWifiConfigService | BLEWifiConfigService object | -+------------------------------------+---------------------------------+ -| **Public Methods** | -+------------------------------------+---------------------------------+ -| BLEWifiConfigService::begin | Start background thread to | -| | process WiFi configuration | -| | commands | -+------------------------------------+---------------------------------+ -| BLEWifiConfigService::end | Stop background thread | -| | processing WiFi configuration | -| | commands | -+------------------------------------+---------------------------------+ -| BLEWifiConfigService::addService | Add the service to the BLE stack| -+------------------------------------+---------------------------------+ -| BLEWifiConfigService::advData | Get advertising data correctly | -| | formatted for WiFi configuration| -| | service | -+------------------------------------+---------------------------------+ - -**BLEWifiConfigService::BLEWifiConfigService** ----------------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Create an instance of the BLEWifiConfigService object. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void BLEWifiConfigService (void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEWifiConfig `_ - -.. note :: Only one instance of this class / service should be created. "BLEWifiConfigService.h" must be included to use the class function. - -**BLEWifiConfigService::begin** -------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Start background thread to process WiFi configuration commands. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void begin(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEWifiConfig `_ - -.. note :: "BLEWifiConfigService.h" must be included to use the class function. - -**BLEWifiConfigService::end** ------------------------------ - -**Description** -~~~~~~~~~~~~~~~ - -Stop background thread processing WiFi configuration commands. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void end(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "BLEWifiConfigService.h" must be included to use the class function. - -**BLEWifiConfigService::addService** ------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Add the WiFi configuration service to the BLE stack. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void addService(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEWifiConfig `_ - -.. note :: "BLEWifiConfigService.h" must be included to use the class function. - -**BLEWifiConfigService::advData** ---------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Get advertising data correctly formatted for WiFi configuration service. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - BLEAdvertData advData(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -This function returns a BLEAdvertData object that contains the required advertising data fields for the WiFi configuration service to work. - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `BLEWifiConfig `_ - -.. note :: The advertisement data needs to be correctly formatted for the corresponding smartphone app to recognise the device. WiFi configuration service advertisement data requires the local BT address, and should be called only after peripheral mode is started and may also require stopping and restarting the advertising process. "BLEWifiConfigService.h" must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/BLE/index.rst b/bak/ambd/_common/API_Documents/BLE/index.rst deleted file mode 100644 index f3ca32a..0000000 --- a/bak/ambd/_common/API_Documents/BLE/index.rst +++ /dev/null @@ -1,26 +0,0 @@ -BLE -=== - -.. toctree:: - :maxdepth: 1 - - Class BLEAddr - Class BLEAdvert - Class BLEAdvertData - Class BLEBeacon - Class BLECharacteristic - Class BLEClient - Class BLEConnect - Class BLEDevice - Class BLEHIDDevice - Class BLEHIDGamepad - Class BLEHIDKeyboard - Class BLEHIDMouse - Class BLERemoteCharacteristic - Class BLERemoteDescriptor - Class BLERemoteService - Class BLEScan - Class BLESecurity - Class BLEService - Class BLEUUID - Class BLEWifiConfigService diff --git a/bak/ambd/_common/API_Documents/FatfsSDcard/Class FatFsSD.rst b/bak/ambd/_common/API_Documents/FatfsSDcard/Class FatFsSD.rst deleted file mode 100644 index 3a8dc43..0000000 --- a/bak/ambd/_common/API_Documents/FatfsSDcard/Class FatFsSD.rst +++ /dev/null @@ -1,461 +0,0 @@ -#################### -Class FatFsSD -#################### - -**Description** - -Defines a class of SD FAT File system. - -**Syntax** - -.. code:: cpp - - class SdFatFs - -**Members** - -**Public Constructors** - -+-------------------------+-------------------------------------------+ -|SdFatFs::SdFatFs | Constructs a SdFatFs object | -+-------------------------+-------------------------------------------+ -|SdFatFs::~SdFatFs | Destructs a SdFatFs object | -+-------------------------+-------------------------------------------+ - - -**Public Methods** - -+-------------------------+-------------------------------------------+ -| SdFatFs::begin | Initialize SD FAT File System | -+=========================+===========================================+ -| SdFatFs::end | Deinitialize SD FAT File System | -+-------------------------+-------------------------------------------+ -| SdFatFs::\*getRootPath | Get the root path of the SD FAT File | -| | System | -+-------------------------+-------------------------------------------+ -| SdFatFs::readDir | List items under a specific folder | -+-------------------------+-------------------------------------------+ -| SdFatFs::mkdir | Create folder | -+-------------------------+-------------------------------------------+ -| SdFatFs::rm | Remove folder or file | -+-------------------------+-------------------------------------------+ -| SdFatFs::isDir | Check if a specific path is a directory | -+-------------------------+-------------------------------------------+ -| SdFatFs::isFile | Check if a specific path is a file | -+-------------------------+-------------------------------------------+ -| SdFatFs::getLastModTime | Get the last modified time for a file or | -| | directory | -+-------------------------+-------------------------------------------+ -| SdFatFs::setLastModTime | Set the last modified time for a file or | -| | directory | -+-------------------------+-------------------------------------------+ -| SdFatFs::status | Return the current status of SD | -+-------------------------+-------------------------------------------+ -| SdFatFs::open | Open a file | -+-------------------------+-------------------------------------------+ - --------------------------------------------- - -.. method:: SdFatFs::begin - - -**Description** - -Initialize SD FAT File System. - -**Syntax** - -.. code:: cpp - - int SdFatFs::begin(void); - -**Parameters** - -The function requires no input parameter. - -**Returns** - -Returns **0** if success, else returns a negative value. - -**Example Code** - -Example: create_folder; file_read_write; get_file_attribute; last_modified_time; list_root_files. - -**Notes and Warnings** - -Include “SdFatFs.h” to use the class function. - -------------------------------------------- - -.. method:: SdFatFs::end - - -**Description** - -De-initialize SD FAT File System. - -**Syntax** - -.. code:: cpp - - int SdFatFs::end(void); - -**Parameters** - -The function requires no input parameter. - -**Returns** - -Returns “0” if success, else returns a negative value. - -**Example Code** - -Example: create_folder; file_read_write; get_file_attribute; last_modified_time; list_root_files. - -**Notes and Warnings** - -Include “SdFatFs.h” to use the class function. - --------------------------------------------------- - -.. method:: SdFatFs::*getRootPath** - - -**Description** - -Get the root path of the SD FAT File System. The logical volume -character is starting from ‘0’, so the root path would like “0:/”. - -**Syntax** - -.. code:: cpp - - char *SdFatFs::getRootPath(void); - -**Parameters** - -The function requires no input parameter. - -**Returns** - -The function returns the root path. - -**Example Code** - -Example: create_folder; file_read_write; get_file_attribute; last_modified_time; list_root_files. - -**Notes and Warnings** - -Include “SdFatFs.h” to use the class function. - ------------------------------------------------------- - -.. method:: SdFatFs::readDir - - -**Description** - -List items under a specific folder. List items under a specific folder -and store the result in the buffer that user specified. Each item is -separated by ‘\0’. - -**Syntax** - -.. code:: cpp - - int SdFatFs::readDir(char *path, char *result_buf, unsigned int bufsize); - -**Parameters** - -``path``: The absolute directory path to be listed. - -``result_buf`` : The buffer to be stored results. - -``bufsize`` : The size of result_buf. If results exceed this size, then the results larger than this size would be discarded. - -**Returns** - -Returns ``0`` if success, else returns a negative value. - -**Example Code** - -Example: get_file_attribute; list_root_files - -**Notes and Warnings** - -Include “SdFatFs.h” to use the class function. - -------------------------------- - -.. method:: SdFatFs::mkdir - -**Description** - -Create folder. - -**Syntax** - -.. code:: cpp - - int SdFatFs::mkdir(char *absolute_path); - -**Parameters** - -``absolute_path`` : The absolute directory path to be created - -**Returns** - -Returns ``0`` if success, else returns a negative value. - -**Example Code** - -Example: create_folder - -**Notes and Warnings** - -Include “SdFatFs.h” to use the class function. - -------------------------------------- - -.. method:: SdFatFs::rm - - -**Description** - -Remove folder or file. - -**Syntax** - -.. code:: cpp - - int SdFatFs::rm(char *absolute_path); - -**Parameters** - -``absolute_path`` : The absolute directory or file path to be deleted - -**Returns** - -Returns ``0`` if success, else returns a negative value. - -**Example Code** - -NA - -**Notes and Warnings** - -Include “SdFatFs.h” to use the class function. - -------------------------------------------- - -.. method:: SdFatFs::isDir - - -**Description** - -Check if a specific path is a directory. - -**Syntax** - -.. code:: cpp - - unsigned char SdFatFs::isDir(char *absolute_path); - -**Parameters** - -``absolute_path``: The absolute path to be queried - -**Returns** - -The function returns ``1`` if it is a directory, else returns ``0``. - -**Example Code** - -Example: get_file_attribute - -**Notes and Warnings** - -Include “SdFatFs.h” to use the class function. - ---------------------------------------------------- - -.. method:: SdFatFs::isFile - - -**Description** - -Check if a specific path is a file. - -**Syntax** - -.. code:: cpp - - unsigned char SdFatFs::isFile(char *absolute_path); - -**Parameters** - -``absolute_path`` : The absolute path to be queried - -**Returns** - -The function returns “1” if it is a directory, else returns “0”. - -**Example Code** - -Example: get_file_attribute - -**Notes and Warnings** - -Include “SdFatFs.h” to use the class function. - --------------------------------- - -.. method:: SdFatFs::getLastModTime - - -**Description** - -Get the last modified time for a file or directory. - -**Syntax** - -.. code:: cpp - - int SdFatFs::getLastModTime(char *absolute_path, uint16_t *year, uint16_t *month, uint16_t *date, uint16_t *hour, uint16_t *minute, uint16_t *second); - -**Parameters** - -``absolute_path``: The absolute path to be queried. - -``year``: The value of the year. - -``month``: The value of the month. - -``date``: The value of the date. - -``hour``: The value of an hour. - -``minute``: The value of a minute. - -``second``: field “second” contains no valid information in the current version. - -**Returns** - -The function returns “0” if success, otherwise returns a negative - -value for failure. - -**Example Code** - -Example: last_modified_time - -**Notes and Warnings** - -Include “SdFatFs.h” to use the class function. - ------------------------------------------------- - -.. method:: SdFatFs::setLastModTime - - -**Description** - -Set the last modified time for a file or directory. Ameba doesn’t have built-in RTC. So we manually change file/directory last modified time. - -**Syntax** - -.. code:: cpp - - int SdFatFs::setLastModTime(char *absolute_path, uint16_t year,uint16_t month, uint16_t date, uint16_t hour, uint16_t minute, uint16_t second); - -**Parameters** - -``absolute_path``: The absolute path to be queried. - -``year``: The value of the year. - -``month``: The value of the month. - -``date``: The value of the date. - -``hour``: The value of an hour. - -``minute``: The value of a minute. - -``second``: field “second” contains no valid information in the current version. - -**Returns** - -The function returns “0” if success, otherwise returns a negative -value for failure. - -**Example Code** - -Example: last_modified_time - -**Notes and Warnings** - -Include “SdFatFs.h” to use the class function. - --------------------------------------------------------------- - -.. method:: SdFatFs::open - - -**Description** - -Open a file. - -**Syntax** - -.. code:: cpp - - SdFatFile SdFatFs::open(char *absolute_path); - -**Parameters** - -``absolute_path``: The path to a file. - -**Returns** - -The file object is an instance of SdFatFile. - -**Example Code** - -Example: create_folder; file_read_write; get_file_attribute; last_modified_time; list_root_files. - -**Notes and Warnings** - -Include “SdFatFs.h” to use the class function. - --------------------------------------------------- - -.. method:: SdFatFs::status - - -**Description** - -Return the current status of SD. - -**Syntax** - -.. code:: cpp - - int SdFatFs::status(void); - -**Parameters** - -The function requires no input parameter. - -**Returns** - -Function returns “1” if ready to use, else return “0” if the status is -inactivating or abnormal. - -**Example Code** - -NA. - -**Notes and Warnings** - -Include “SdFatFs.h” to use the class function. diff --git a/bak/ambd/_common/API_Documents/FatfsSDcard/Class SdFatFile.rst b/bak/ambd/_common/API_Documents/FatfsSDcard/Class SdFatFile.rst deleted file mode 100644 index ac6c449..0000000 --- a/bak/ambd/_common/API_Documents/FatfsSDcard/Class SdFatFile.rst +++ /dev/null @@ -1,520 +0,0 @@ -#################### -Class SdFatFile -#################### - -**Description** - -Defines a class of SD FAT File. - -**Syntax** - -.. code:: cpp - - class SdFatFile - -**Members** - -======================= =========================================== -**Public Constructors**   -======================= =========================================== -SdFatFile::SdFatFile Constructs a SdFatFile object -SdFatFile::~SdFatFile Destructs a SdFatFile object -**Public Methods**   -SdFatFile::write Write 1 byte/bytes to file -SdFatFile::read Read 1 byte/bytes from the file -SdFatFile::peek Read 1 byte from file without move curser -SdFatFile::available Check if the cursor is at EOF (End-Of-File) -SdFatFile::bool Check if file is opened -SdFatFile::seek Change cursor to a specific position -SdFatFile::close Close file -======================= =========================================== - -------------------------------------- - -.. method:: SdFatFile::write - - -**Description** - -Write 1 byte or bytes to the file. - -**Syntax** - -.. code:: cpp - - size_t SdFatFile::write(uint8_t c); - -.. code:: cpp - - size_t SdFatFile::write(const uint8_t *buf, size_t size); - -**Parameters** - -``c`` : The character to be written. - -``buf`` : The buffer to be written. - -``size`` : The length of buffer to be written. - -**Returns** - -The function returns the number of byte count that has been -successfully written to the file. - -**Example Code** - -NA. - -**Notes and Warnings** - -Include “SdFatFile.h” to use the class function.  - ----------------------------------------------------------------- - -.. method:: SdFatFile:: read - -**Description** - -Read 1 byte or bytes from the file. - -**Syntax** - -.. code:: cpp - - int SdFatFile::read(void); - -.. code:: cpp - - int SdFatFile::read(void *buf, uint16_t nbyte); - -**Parameters** - -``buf``: The buffer to store the content. - -``nbyte``: The buffer size. (Or can be regarded as the desired length to read). - -**Returns** - -The function returns a read character or the read size of the buffer. - -**Example Code** - -1. #include "FatFs_SD.h" - -2.   - -3. char dirname[] = "testdir"; - -4. char filename[] = "test.txt"; - -5. char write_content[] = "hello world!"; - -6.   - -7. FatFsSD fs; - -8.   - -9. void setup() { - -10. char buf[128]; - -11. char absolute_filename[128]; - -12.   - -13. fs.begin(); - -14.   - -15. sprintf(absolute_filename, "%s%s", fs.getRootPath(), dirname); - -16. fs.mkdir(absolute_filename); - -17. printf("create dir at \\"%s\"\r\n", absolute_filename); - -18.   - -19. sprintf(absolute_filename, "%s%s/%s", fs.getRootPath(), dirname, - filename); - -20. SdFatFile file = fs.open(absolute_filename); - -21. file.println(write_content); - -22. file.close(); - -23. printf("create file at \\"%s\"\r\n", absolute_filename); - -24.   - -25. printf("read back from \\"%s\"\r\n", absolute_filename); - -26. file = fs.open(absolute_filename); - -27.   - -28. memset(buf, 0, sizeof(buf)); - -29. file.read(buf, sizeof(buf)); - -30.   - -31. file.close(); - -32. printf("==== content ====\r\n"); - -33. printf("%s", buf); - -34. printf("==== end ====\r\n"); - -35.   - -36. fs.end(); - -37. } - -38.   - -39. void loop() { - -40. delay(1000); - -41. } - -42.   - -| Example: create_folder; -| This example shows how to create a folder and open a file under it. - -1. #include "FatFs_SD.h" - -2.   - -3. char filename[] = "test.txt"; - -4. char write_content[] = "hello world!"; - -5.   - -6. FatFsSD fs; - -7.   - -8. void setup() { - -9. char buf[128]; - -10. char absolute_filename[128]; - -11.   - -12. fs.begin(); - -13.   - -14. printf("write something to \\"%s\"\r\n", filename); - -15. sprintf(absolute_filename, "%s%s", fs.getRootPath(), filename); - -16. SdFatFile file = fs.open(absolute_filename); - -17.   - -18. file.println(write_content); - -19.   - -20. file.close(); - -21. printf("write finish\r\n\r\n"); - -22.   - -23. printf("read back from \\"%s\"\r\n", filename); - -24. file = fs.open(absolute_filename); - -25.   - -26. memset(buf, 0, sizeof(buf)); - -27. file.read(buf, sizeof(buf)); - -28.   - -29. file.close(); - -30. printf("==== content ====\r\n"); - -31. printf("%s", buf); - -32. printf("==== end ====\r\n"); - -33.   - -34. fs.end(); - -35. } - -36.   - -37. void loop() { - -38. delay(1000); - -39. } - -40.   - -| Example: file_read_write; -| This example shows how to open/close files and perform read/write to - it. - -**Notes and Warnings** - -Include “SdFatFile.h” to use the class function.  - ----------------------------------------------------------------- - -.. method:: SdFatFile:: peek - - -**Description** - -Read one byte from the file without moving the curser. - -**Syntax** - -.. code:: cpp - - int SdFatFile::peek(void); - -**Parameters** - -The function requires no input parameter. - -**Returns** - -The function returns the read character as an integer number. - -**Example Code** - -NA - -**Notes and Warnings** - -Include “SdFatFile.h” to use the class function.  - ------------------------------------------------------------------- - -.. method:: SdFatFile:: available - -**Description** - -Check if the cursor is at EOF. - -**Syntax** - -.. code:: cpp - - int SdFatFile::available(void); - -**Parameters** - -The function requires no input parameter. - -**Returns** - -The function returns ``0`` if the cursor is at EOF, else returns “1”. - -**Example Code** - -NA - -**Notes and Warnings** - -Include “SdFatFile.h” to use the class function.  - ------------------------------------------------------------------ - -.. method:: SdFatFile:: flush - - -**Description** - -It is a nop. This is an inherited function from class Stream. And it -does not affect SD File. - -**Syntax** - -.. code:: cpp - - void SdFatFile::flush(void); - -**Parameters** - -The function requires no input parameter. - -**Returns** - -The function returns nothing. - -**Example Code** - -NA - -**Notes and Warnings** - -Include “SdFatFile.h” to use the class function.  - ----------------------------------------------- - -.. method:: SdFatFile:: seek - - -**Description** - -Change cursor to a specific position. - -**Syntax** - -.. code:: cpp - - int SdFatFile::seek(uint32_t pos); - -**Parameters** - -pos: The desired position. - -**Returns** - -The function returns 0 if success otherwise returns a negative value. - -**Example Code** - -NA - -**Notes and Warnings** - -Include “SdFatFile.h” in order to use the class function.  - --------------------------------------------------- - -.. method:: SdFatFile:: close - - -**Description** - -Close file. - -**Syntax** - -.. code:: cpp - - int SdFatFile::close(void); - -**Parameters** - -The function requires no input parameter. - -**Returns** - -The function returns 0 if runs successfully otherwise it returns a -negative value. - -**Example Code** - -Example: last_modified_time; - -The example shows how to get and set last modified time of a file. - -Example: create_folder; - -This example shows how to create a folder and open a file under it. - -the details of the code can be found in the section of SdFatFile::read. - -Example: file_read_write; - -This example shows how to open/close files and perform read/write to - -it. The details of the code can be found in the section of SdFatFile::read. - -1. #include - -2.   - -3. FatFsSD fs; - -4.   - -5. char filename[] = "test.txt"; - -6.   - -7. void setup() { - -8. char absolute_filename[128]; - -9.   - -10. uint16_t year = 2021; - -11. uint16_t month = 4; - -12. uint16_t date = 4; - -13. uint16_t hour = 12; - -14. uint16_t minute = 12; - -15. uint16_t second = 12; - -16.   - -17. fs.begin(); - -18.   - -19. sprintf(absolute_filename, "%s%s", fs.getRootPath(), filename); - -20. SdFatFile file = fs.open(absolute_filename); - -21. file.close(); - -22.   - -23. fs.setLastModTime(absolute_filename, year, month, date, hour, - minute, second); - -24.   - -25. fs.getLastModTime(absolute_filename, &year, &month, &date, &hour, - &minute, &second); - -26. printf("filename:\"%s\"\r\n", absolute_filename); - -27. printf("time mod:%04d/%02d/%02d %02d:%02d:%02d\r\n", year, month, - date, hour, minute, second); - -28.   - -29. fs.end(); - -30. } - -31.   - -32. void loop() { - -33. delay(1000); - -34. } - -35.   - - -**Notes and Warnings** - -Include “SdFatFile.h” in order to use the class function. diff --git a/bak/ambd/_common/API_Documents/FlashMemory/Class FlashMemoryClass.rst b/bak/ambd/_common/API_Documents/FlashMemory/Class FlashMemoryClass.rst deleted file mode 100644 index 67f255b..0000000 --- a/bak/ambd/_common/API_Documents/FlashMemory/Class FlashMemoryClass.rst +++ /dev/null @@ -1,421 +0,0 @@ -Class FlashMemory -================= - -.. contents:: - :local: - :depth: 2 - -**FlashMemoryClass Class** --------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -A class for Flash memory API. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - class FlashMemoryClass - -**Members** -~~~~~~~~~~~ - -+------------------------------------+----------------------------------+ -| **Public Constructors** | -+====================================+==================================+ -| FlashMemoryClass::FlashMemoryClass | Constructs a FlashMemoryClass | -| | object | -+------------------------------------+----------------------------------+ -| **Public Methods** | -+------------------------------------+----------------------------------+ -| FlashMemoryClass::begin | Initialize/Re-initialize the | -| | base address and size | -+------------------------------------+----------------------------------+ -| FlashMemoryClass::end | Free the buf set by begin, | -| | deinit flash memory process | -+------------------------------------+----------------------------------+ -| FlashMemoryClass::read | Read content (stream of word) | -| | from flash memory to buffer. | -| | Able to set address with | -| | specific offset. | -+------------------------------------+----------------------------------+ -| FlashMemoryClass::write | Write the content in the buffer | -| | back to the flash memory. Able | -| | to set address with specific | -| | offset. | -+------------------------------------+----------------------------------+ -| FlashMemoryClass::readWord | Read word (4 bytes) from flash | -| | memory based on the new base | -| | address with specific offset. | -+------------------------------------+----------------------------------+ -| FlashMemoryClass::writeWord | Write word to flash memory based | -| | on the new base address with | -| | specific offset. | -+------------------------------------+----------------------------------+ -| FlashMemoryClass::eraseSector | Erase flash memory by sector (4K | -| | bytes) | -+------------------------------------+----------------------------------+ -| FlashMemoryClass::eraseWord | Erase flash memory by word | -+------------------------------------+----------------------------------+ -| FlashMemoryClass::buf_size | The buf size regarded as work | -| | size | -+------------------------------------+----------------------------------+ -| FlashMemoryClass::buf | The buf to be operated | -+------------------------------------+----------------------------------+ - -**FlashMemoryClass::FlashMemoryClass** --------------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Constructs a FlashMemoryClass object. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - FlashMemoryClass(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `ReadWriteWord `_ - -.. note :: "FlashMemory.h" must be included to use the class function. - -**FlashMemoryClass::begin** ---------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Initialize/Re-initialize the base address and size. The default usable flash memory size is 0x3000. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void begin(unsigned int flash_base_address, unsigned int flash_buf_size); - -**Parameters** -~~~~~~~~~~~~~~ - -flash_base_address: The starting location/position of the flash memory. - -flash_buf_size: The desired buffer size. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `ReadWriteWord `_ - -.. note :: "FlashMemory.h" must be included to use the class function. - -**FlashMemoryClass::end** - -**Description** -~~~~~~~~~~~~~~~ - -Free the buf set by begin, deinit flash memory process. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void end(void); - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "FlashMemory.h" must be included to use the class function. - -**FlashMemoryClass::read** --------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Read from the flash memory and copy into a buffer. All modification of the contents will be done in the buffer before updating the flash memory. The default length of the buf is buf_size with 0x3000. Update buf and buf_size by function "begin()". Indicate the starting address by "offset". - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void read(unsigned int offset = 0); - -**Parameters** -~~~~~~~~~~~~~~ - -offset: offset to the base address. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `ReadWriteStream `_ - -.. note :: "FlashMemory.h" must be included to use the class function. - -**FlashMemoryClass::write** - -**Description** -~~~~~~~~~~~~~~~ - -Write buf back to flash memory. Indicate the starting address by "offset". The default length of the buf is buf_size with 0x3000. Update buf and buf_size by function "begin()" - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void write(unsigned int offset = 0); - -**Parameters** -~~~~~~~~~~~~~~ - -offset: offset to the base address. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `ReadWriteStream `_ - -.. note :: "FlashMemory.h" must be included to use the class function. - -**FlashMemoryClass::readWord** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Read 4 bytes data (a word) from a flash address, based on the new base address with specific offset. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - unsigned int readWord(unsigned int offset); - -**Parameters** -~~~~~~~~~~~~~~ - -offset: offset to the base address. - -**Returns** -~~~~~~~~~~~ - -This function returns the 4 bytes read data. The return type is "unsigned int". - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `ReadWriteWord `_ - -.. note :: "FlashMemory.h" must be included to use the class function. - -**FlashMemoryClass::writeWord** -------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Write 4 bytes data (a word) to a flash address, based on the new base address with specific offset. Then read data from the address and compare with the original data. If there is difference. Buffer a flash sector from the new base address, then erase the sector from the flash. Replace the correct data back into buffer. Then rewrite the buffer into the flash. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void writeWord(unsigned int offset, unsigned int data); - -**Parameters** -~~~~~~~~~~~~~~ - -offset: offset to the base address. - -data: The data to be written (4 bytes / a word) - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `ReadWriteWord `_ - -.. note :: "FlashMemory.h" must be included to use the class function. - -**FlashMemoryClass::eraseSector** ---------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Erase flash memory by sector (4K bytes). The erase size should be the multiples of sector size. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void eraseSector(unsigned int sector_offset); - -**Parameters** -~~~~~~~~~~~~~~ - -offset: offset to the base address. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "FlashMemory.h" must be included to use the class function. - -**FlashMemoryClass::eraseWord** -------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -Erase flash memory by word (4 bytes). The offset according to base address. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - void eraseWord(unsigned int offset); - -**Parameters** -~~~~~~~~~~~~~~ - -offset: offset to the base address. - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -NA - -.. note :: "FlashMemory.h" must be included to use the class function. - -**FlashMemoryClass::buf_size** ------------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -The buf size regarded as work size. Maximum size is MAX_FLASH_MEMORY_APP_SIZE that is 0x3000. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - unsigned int buf_size; - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `ReadWriteWord `_ - -.. note :: "FlashMemory.h" must be included to use the class function. - -**FlashMemoryClass::buf** -------------------------- - -**Description** -~~~~~~~~~~~~~~~ - -The buf to be operated. Modify buf won't change the content of buf. It needs update to write back to flash memory. - -**Syntax** -~~~~~~~~~~ - -.. code-block:: c++ - - unsigned char *buf; - -**Parameters** -~~~~~~~~~~~~~~ - -NA - -**Returns** -~~~~~~~~~~~ - -NA - -**Example Code** -~~~~~~~~~~~~~~~~ - -Example: `ReadWriteWord `_ - -.. note :: "FlashMemory.h" must be included to use the class function. diff --git a/bak/ambd/_common/Example_Guides/OTA/OTA - Update Firmware to Ameba via OTA.rst b/bak/ambd/_common/Example_Guides/OTA/OTA - Update Firmware to Ameba via OTA.rst deleted file mode 100644 index 5d1842e..0000000 --- a/bak/ambd/_common/Example_Guides/OTA/OTA - Update Firmware to Ameba via OTA.rst +++ /dev/null @@ -1,2 +0,0 @@ -OTA - Update Firmware to Ameba via OTA -====================================== \ No newline at end of file diff --git a/bak/ambd/_common/API_Documents/EPDIF/Class EpdIF.rst b/source/_common/API_Documents/EPDIF/Class EpdIF.rst similarity index 54% rename from bak/ambd/_common/API_Documents/EPDIF/Class EpdIF.rst rename to source/_common/API_Documents/EPDIF/Class EpdIF.rst index e9d6169..09998eb 100644 --- a/bak/ambd/_common/API_Documents/EPDIF/Class EpdIF.rst +++ b/source/_common/API_Documents/EPDIF/Class EpdIF.rst @@ -1,83 +1,95 @@ -#################### Class EpdIF -#################### +=========== + +.. contents:: + :local: + :depth: 2 + +**EpdIF Class** +--------------- **Description** +~~~~~~~~~~~~~~~ A class used to control the electronic paper display internal functions. **Syntax** +~~~~~~~~~~ -.. code:: cpp +.. code-block:: c++ class EpdIf **Members** +~~~~~~~~~~~ -+----------------------------------------------------------------------+ ++--------------------------------+-------------------------------------+ | **Public Constructors** | -+======================================================================+ ++================================+=====================================+ | A public constructor should not be used as this class is intended to | | be a singleton class. Access member functions using the object | | instance named EpdIf. | -+----------------------------------------------------------------------+ - -+--------------------------------+------------------------------------+ -| **Public Methods** |   | -+================================+====================================+ -| EpdIf::EPD_Dis_Part | Put an image buffer to the frame | -| | memory, but not updating the | -| | display | -+--------------------------------+------------------------------------+ -| EpdIf::EPD_SetFrame | Put display data to the frame | -| | memory, usually used for setup | -| | text display functions | -+--------------------------------+------------------------------------+ -| EpdIf::EPD_SetRAMValue_BaseMap | To read image data stored in the | -| | RAM, but not display on the screen | -+--------------------------------+------------------------------------+ -| EpdIf::EPD_SetFrameMemory | To read image data stored in the | -| | buffer, but not display on the | -| | screen | -+--------------------------------+------------------------------------+ -| EpdIf::EPD_UpdateDisplay | Update the display | -+--------------------------------+------------------------------------+ -| EpdIf::EPD_ClearScreen_White | Clear the frame memory with the | -| | White color, but not updating the | -| | display | -+--------------------------------+------------------------------------+ -| EpdIf::EPD_ClearScreen_Black | Clear the frame memory with the | -| | Black color, but not updating the | -| | display | -+--------------------------------+------------------------------------+ -| EpdIf::EPD_Busy | Wait until the Busy pin goes to | -| | low, which is the idle state | -+--------------------------------+------------------------------------+ -| EpdIf::EPD_Reset | Used for the Epaper module reset. | -| | Often used to awaken the module in | -| | deep sleep | -+--------------------------------+------------------------------------+ -| EpdIf::EPD_Sleep | After this command is transmitted, | -| | the chip would enter the | -| | deep-sleep mode to save power | -+--------------------------------+------------------------------------+ - -------------------- - -.. method:: EpdIf:: EPD_Dis_Part - ++--------------------------------+-------------------------------------+ +| **Public Methods** | | ++--------------------------------+-------------------------------------+ +| EpdIf::EPD_Dis_Part | Transfer image data in the image | +| | buffer to the frame memory without | +| | updating the display. | ++--------------------------------+-------------------------------------+ +| EpdIf::EPD_SetFrame | Transfer the character string data | +| | in the image buffer to the frame | +| | memory without updating the display.| ++--------------------------------+-------------------------------------+ +| EpdIf::EPD_SetRAMValue_BaseMap | Set the RAM value with image data. | +| | Read the image data stored in the | +| | RAM, but not displaying on | +| | the screen. | ++--------------------------------+-------------------------------------+ +| EpdIf::EPD_SetFrameMemory | To read image data stored in the | +| | buffer, but not display on the | +| | screen | ++--------------------------------+-------------------------------------+ +| EpdIf::EPD_UpdateDisplay | Update the display | ++--------------------------------+-------------------------------------+ +| EpdIf::EPD_ClearScreen_White | Clear the frame memory with the | +| | White color, but not updating the | +| | display | ++--------------------------------+-------------------------------------+ +| EpdIf::EPD_ClearScreen_Black | Clear the frame memory with the | +| | Black color, but not updating the | +| | display | ++--------------------------------+-------------------------------------+ +| EpdIf::EPD_Busy | Check the status of the busy pin to | +| | see if next commands can continue | +| | to be executed. | ++--------------------------------+-------------------------------------+ +| EpdIf::EPD_Reset | Resetting the E-paper display | +| | module. It is often used to wake the| +| | module while it is in the deep | +| | sleep mode. | ++--------------------------------+-------------------------------------+ +| EpdIf::EPD_Sleep | This function will get the E-paper | +| | display module to enter Deep Sleep | +| | mode for power saving. | ++--------------------------------+-------------------------------------+ + +**EpdIf::EPD_Dis_Part** +----------------------- **Description** +~~~~~~~~~~~~~~~ Put an image buffer to the frame memory, but not updating the display. **Syntax** +~~~~~~~~~~ -.. code:: cpp +.. code-block:: c++ void EPD_Dis_Part(unsigned int x_start, unsigned int y_start, const unsigned char * datas, unsigned int PART_COLUMN, unsigned int PART_LINE); **Parameters** +~~~~~~~~~~~~~~ ``x_start`` : starting position of the x-axis @@ -90,33 +102,32 @@ Put an image buffer to the frame memory, but not updating the display. ``PART_LINE`` : width of the display area **Returns** - -The function returns nothing. - -**Example Code** +~~~~~~~~~~~ NA -**Notes and Warnings** +**Example Code** +~~~~~~~~~~~~~~~~ NA --------------------------- - -.. method:: EpdIf:: EPD_SetFrame - +**EpdIf:: EPD_SetFrame** +------------------------ **Description** +~~~~~~~~~~~~~~~ Put display data to the frame memory, usually used for setup text display functions. **Syntax** +~~~~~~~~~~ -.. code:: cpp +.. code-block:: c++ void EPD_SetFrame(const unsigned char * image_buffer, int x, int y, int image_width, int image_height); **Parameters** +~~~~~~~~~~~~~~ ``image_buffer`` : the buffer which stores the data to be displayed on the e-paper module, usually used to display texts. @@ -129,266 +140,259 @@ Put display data to the frame memory, usually used for setup text display functi ``image_height`` : height of the display area **Returns** - -The function returns nothing. - -**Example Code** +~~~~~~~~~~~ NA -**Notes and Warnings** +**Example Code** +~~~~~~~~~~~~~~~~ NA --------------- - -.. method:: EpdIf:: EPD_SetRAMValue_BaseMap - +**EpdIf:: EPD_SetRAMValue_BaseMap** +----------------------------------- **Description** +~~~~~~~~~~~~~~~ To read image data stored in the RAM, but not display on the screen. **Syntax** +~~~~~~~~~~ -.. code:: cpp +.. code-block:: c++ void EPD_SetRAMValue_BaseMap(const unsigned char * datas); **Parameters** +~~~~~~~~~~~~~~ ``datas`` : contains the black and white information that forms the image stored in RAM **Returns** - -The function returns nothing. - -**Example Code** +~~~~~~~~~~~ NA -**Notes and Warnings** +**Example Code** +~~~~~~~~~~~~~~~~ NA ------------------- - - -.. method:: EpdIf:: EPD_SetFrameMemory - +**EpdIf:: EPD_SetFrameMemory** +------------------------------ **Description** +~~~~~~~~~~~~~~~ To read image data stored in the buffer but not display on the screen. **Syntax** +~~~~~~~~~~ -.. code:: cpp +.. code-block:: c++ void EPD_SetFrameMemory(const unsigned char * image_buffer); **Parameters** +~~~~~~~~~~~~~~ ``image_buffer``: the buffer where stores the image data in hexadecimal numbers **Returns** - -The function returns nothing. - -**Example Code** +~~~~~~~~~~~ NA -**Notes and Warnings** +**Example Code** +~~~~~~~~~~~~~~~~ NA ------------ - -.. method:: EpdIf:: EPD_UpdateDisplay - +**EpdIf:: EPD_UpdateDisplay** +----------------------------- **Description** +~~~~~~~~~~~~~~~ Update the ePaper display module. Always combined used with functions set the frames. **Syntax** +~~~~~~~~~~ -.. code:: cpp +.. code-block:: c++ void EPD_UpdateDisplay(void); **Parameters** +~~~~~~~~~~~~~~ The function requires no input parameter. **Returns** +~~~~~~~~~~~ -The function returns nothing. +NA **Example Code** +~~~~~~~~~~~~~~~~ NA -**Notes and Warnings** - -There are 2 memory areas embedded in the e-paper display but once this -function is called, then the next action of SetFrameMemory or -ClearScreen will set the other memory area. - ----------- - -.. method:: EpdIf:: EPD_ClearScreen_White +.. note :: There are 2 memory areas embedded in the e-paper display but once this function is called, then the next action of SetFrameMemory or ClearScreen will set the other memory area. +**EpdIf:: EPD_ClearScreen_White** +--------------------------------- **Description** +~~~~~~~~~~~~~~~ Clear the frame memory with the White color. **Syntax** +~~~~~~~~~~ -.. code:: cpp +.. code-block:: c++ void EpdIf::EPD_ClearScreen_White(void); **Parameters** +~~~~~~~~~~~~~~ The function requires no input parameter. **Returns** +~~~~~~~~~~~ -The function returns nothing. +NA **Example Code** +~~~~~~~~~~~~~~~~ NA -**Notes and Warnings** - -If the users want to see the actual display on the e-paper screen, the -function EPD_UpdateDisplay() is required to be added behind this code. - -------------------------- - -.. method:: EpdIf:: EPD_ClearScreen_Black +.. note :: If the users want to see the actual display on the e-paper screen, the function EPD_UpdateDisplay() is required to be added behind this code. +**EpdIf:: EPD_ClearScreen_Black** +--------------------------------- **Description** +~~~~~~~~~~~~~~~ Clear the frame memory with the Black color. **Syntax** +~~~~~~~~~~ -.. code:: cpp +.. code-block:: c++ void EpdIf::EPD_ClearScreen_Black(void); **Parameters** +~~~~~~~~~~~~~~ The function requires no input parameter. **Returns** +~~~~~~~~~~~ -The function returns nothing. +NA **Example Code** +~~~~~~~~~~~~~~~~ NA -**Notes and Warnings** - -If the users want to see the actual display on the e-paper screen, the function EPD_UpdateDisplay() is required to be added behind this code. - -------------------------------- - -.. method:: EpdIf:: EPD_Busy +.. note :: If the users want to see the actual display on the e-paper screen, the function EPD_UpdateDisplay() is required to be added behind this code. +**EpdIf:: EPD_Busy** +-------------------- **Description** +~~~~~~~~~~~~~~~ Wait until the busy_pin goes to low, which is the idle state. **Syntax** +~~~~~~~~~~ -.. code:: cpp +.. code-block:: c++ void EpdIf::EPD_Busy(void); **Parameters** +~~~~~~~~~~~~~~ The function requires no input parameter. **Returns** +~~~~~~~~~~~ -The function returns nothing. +NA **Example Code** +~~~~~~~~~~~~~~~~ NA -**Notes and Warnings** - -If the users want to see the actual display on the e-paper screen, the function EPD_UpdateDisplay() is required to be added behind this code. - ------------------- - -.. method:: EpdIf:: EPD_Reset +.. note :: If the users want to see the actual display on the e-paper screen, the function EPD_UpdateDisplay() is required to be added behind this code. +**EpdIf:: EPD_Reset** +--------------------- **Description** +~~~~~~~~~~~~~~~ -This command will let the E-paper module reset, it is often used to awaken the module in while it’s in the deep sleep mode, you will find -more details in the function ``EpdIf:: EPD_Sleep()``. +This command will let the E-paper module reset, it is often used to awaken the module in while it's in the deep sleep mode, you will find more details in the function ``EpdIf:: EPD_Sleep()``. **Syntax** +~~~~~~~~~~ -.. code:: cpp +.. code-block:: c++ void EpdIf::EPD_Reset(void); **Parameters** +~~~~~~~~~~~~~~ The function requires no input parameter. **Returns** - -The function returns nothing. - -**Example Code** +~~~~~~~~~~~ NA -**Notes and Warnings** +**Example Code** +~~~~~~~~~~~~~~~~ NA ------------------ - -.. method:: EpdIf::EPD_Sleep - +**EpdIf::EPD_Sleep** +-------------------- **Description** +~~~~~~~~~~~~~~~ After this command is transmitted, the chip would enter the deep-sleep mode to save power. The deep sleep mode would return to standby by hardware reset. You can use EPD:: Init() to awaken the E-paper module. **Syntax** +~~~~~~~~~~ -.. code:: cpp +.. code-block:: c++ void EpdIf::EPD_Sleep(void); **Parameters** +~~~~~~~~~~~~~~ The function requires no input parameter. **Returns** - -The function returns nothing. - -**Example Code** +~~~~~~~~~~~ NA -**Notes and Warnings** +**Example Code** +~~~~~~~~~~~~~~~~ NA diff --git a/bak/ambd/_common/API_Documents/EPDIF/index.rst b/source/_common/API_Documents/EPDIF/index.rst similarity index 66% rename from bak/ambd/_common/API_Documents/EPDIF/index.rst rename to source/_common/API_Documents/EPDIF/index.rst index 75e32c9..afbc3cf 100644 --- a/bak/ambd/_common/API_Documents/EPDIF/index.rst +++ b/source/_common/API_Documents/EPDIF/index.rst @@ -4,4 +4,4 @@ EPDIF .. toctree:: :maxdepth: 1 - Class EPDIF + Class EpdIF diff --git a/source/_common/API_Documents/FatfsSDcard/Class FatFsSD.rst b/source/_common/API_Documents/FatfsSDcard/Class FatFsSD.rst new file mode 100644 index 0000000..c04f21b --- /dev/null +++ b/source/_common/API_Documents/FatfsSDcard/Class FatFsSD.rst @@ -0,0 +1,475 @@ +Class FatFsSD +============= + +.. contents:: + :local: + :depth: 2 + +**FatFsSD Class** +----------------- + +**Description** +~~~~~~~~~~~~~~~ + +Defines a class of SD FAT File system. + +**Syntax** +~~~~~~~~~~ + +.. code:: c++ + + class FatFsSD + +**Members** +~~~~~~~~~~~ + ++-------------------------+-------------------------------------------+ +|**Public Constructors** | ++=========================+===========================================+ +|FatFsSD::FatFsSD | Constructs a FatFsSD object | ++-------------------------+-------------------------------------------+ +|FatFsSD::~FatFsSD | Destructs a FatFsSD object | ++-------------------------+-------------------------------------------+ +|**Public Methods** | ++-------------------------+-------------------------------------------+ +| FatFsSD::begin | Initialize SD FAT File System | ++-------------------------+-------------------------------------------+ +| FatFsSD::end | Deinitialize SD FAT File System | ++-------------------------+-------------------------------------------+ +| FatFsSD::\*getRootPath | Get the root path of the SD FAT File | +| | System | ++-------------------------+-------------------------------------------+ +| FatFsSD::readDir | List items under a specific folder | ++-------------------------+-------------------------------------------+ +| FatFsSD::mkdir | Create folder | ++-------------------------+-------------------------------------------+ +| FatFsSD::rm | Remove folder or file | ++-------------------------+-------------------------------------------+ +| FatFsSD::isDir | Check if a specific path is a directory | ++-------------------------+-------------------------------------------+ +| FatFsSD::isFile | Check if a specific path is a file | ++-------------------------+-------------------------------------------+ +| FatFsSD::getLastModTime | Get the last modified time for a file or | +| | directory | ++-------------------------+-------------------------------------------+ +| FatFsSD::setLastModTime | Set the last modified time for a file or | +| | directory | ++-------------------------+-------------------------------------------+ +| FatFsSD::status | Return the current status of SD | ++-------------------------+-------------------------------------------+ +| FatFsSD::open | Open a file | ++-------------------------+-------------------------------------------+ + +**FatFsSD::begin** +------------------ + +**Description** +~~~~~~~~~~~~~~~ + +Initialize SD FAT File System. + +**Syntax** +~~~~~~~~~~ + +.. code:: c++ + + int begin(void); + +**Parameters** +~~~~~~~~~~~~~~ + +NA + +**Returns** +~~~~~~~~~~~ + +Returns **0** if success, else returns a negative value. + +**Example Code** +~~~~~~~~~~~~~~~~ + +Example: `create_folder `_ + +.. note :: “FatFs_SD.h” must be included to use the class function. + +**FatFsSD::end** +---------------- + +**Description** +~~~~~~~~~~~~~~~ + +De-initialize SD FAT File System. + +**Syntax** +~~~~~~~~~~ + +.. code:: c++ + + int end(void); + +**Parameters** +~~~~~~~~~~~~~~ + +NA + +**Returns** +~~~~~~~~~~~ + +Returns “0” if success, else returns a negative value. + +**Example Code** +~~~~~~~~~~~~~~~~ + +Example: `create_folder `_ + +.. note :: “FatFs_SD.h” must be included to use the class function. + +**FatFsSD::*getRootPath** +------------------------- + +**Description** +~~~~~~~~~~~~~~~ + +Get the root path of the SD FAT File System. The logical volume character is starting from '0', so the root path would like “0:/”. + +**Syntax** +~~~~~~~~~~ + +.. code:: c++ + + char *getRootPath(void); + +**Parameters** +~~~~~~~~~~~~~~ + +NA + +**Returns** +~~~~~~~~~~~ + +The function returns the root path. + +**Example Code** +~~~~~~~~~~~~~~~~ + +Example: `create_folder `_ + +.. note :: “FatFs_SD.h” must be included to use the class function. + +**FatFsSD::readDir** +-------------------- + +**Description** +~~~~~~~~~~~~~~~ + +List items under a specific folder. List items under a specific folder +and store the result in the buffer that user specified. Each item is +separated by '\0'. + +**Syntax** +~~~~~~~~~~ + +.. code:: c++ + + int readDir(char *path, char *result_buf, unsigned int bufsize); + +**Parameters** +~~~~~~~~~~~~~~ + +``path``: The absolute directory path to be listed. + +``result_buf`` : The buffer to be stored results. + +``bufsize`` : The size of result_buf. If results exceed this size, then the results larger than this size would be discarded. + +**Returns** +~~~~~~~~~~~ + +Returns ``0`` if success, else returns a negative value. + +**Example Code** +~~~~~~~~~~~~~~~~ + +Example: `get_file_attribute `_ + +.. note :: “FatFs_SD.h” must be included to use the class function. + +**FatFsSD::mkdir** +------------------ + +**Description** +~~~~~~~~~~~~~~~ + +Create folder. + +**Syntax** +~~~~~~~~~~ + +.. code:: c++ + + int mkdir(char *absolute_path); + +**Parameters** +~~~~~~~~~~~~~~ + +``absolute_path`` : The absolute directory path to be created + +**Returns** +~~~~~~~~~~~ + +Returns ``0`` if success, else returns a negative value. + +**Example Code** +~~~~~~~~~~~~~~~~ + +Example: `create_folder `_ + +.. note :: “FatFs_SD.h” must be included to use the class function. + +**FatFsSD::rm** +--------------- + +**Description** +~~~~~~~~~~~~~~~ + +Remove folder or file. + +**Syntax** +~~~~~~~~~~ + +.. code:: c++ + + int rm(char *absolute_path); + +**Parameters** +~~~~~~~~~~~~~~ + +``absolute_path`` : The absolute directory or file path to be deleted + +**Returns** +~~~~~~~~~~~ + +Returns ``0`` if success, else returns a negative value. + +**Example Code** +~~~~~~~~~~~~~~~~ + +NA + +.. note :: “FatFs_SD.h” must be included to use the class function. + +**FatFsSD::isDir** +------------------ + +**Description** +~~~~~~~~~~~~~~~ + +Check if a specific path is a directory. + +**Syntax** +~~~~~~~~~~ + +.. code:: c++ + + unsigned char isDir(char *absolute_path); + +**Parameters** +~~~~~~~~~~~~~~ + +``absolute_path``: The absolute path to be queried + +**Returns** +~~~~~~~~~~~ + +The function returns ``1`` if it is a directory, else returns ``0``. + +**Example Code** +~~~~~~~~~~~~~~~~ + +Example: `get_file_attribute `_ + +.. note :: “FatFs_SD.h” must be included to use the class function. + +**FatFsSD::isFile** +------------------- + +**Description** +~~~~~~~~~~~~~~~ + +Check if a specific path is a file. + +**Syntax** +~~~~~~~~~~ + +.. code:: c++ + + unsigned char isFile(char *absolute_path); + +**Parameters** +~~~~~~~~~~~~~~ + +``absolute_path`` : The absolute path to be queried + +**Returns** +~~~~~~~~~~~ + +The function returns “1” if it is a directory, else returns “0”. + +**Example Code** +~~~~~~~~~~~~~~~~ + +Example: `get_file_attribute `_ + +.. note :: “FatFs_SD.h” must be included to use the class function. + +**FatFsSD::getLastModTime** +--------------------------- + +**Description** +~~~~~~~~~~~~~~~ + +Get the last modified time for a file or directory. + +**Syntax** +~~~~~~~~~~ + +.. code:: c++ + + int getLastModTime(char *absolute_path, uint16_t *year, uint16_t *month, uint16_t *date, uint16_t *hour, uint16_t *minute, uint16_t *second); + +**Parameters** +~~~~~~~~~~~~~~ + +``absolute_path``: The absolute path to be queried. + +``year``: The value of the year. + +``month``: The value of the month. + +``date``: The value of the date. + +``hour``: The value of an hour. + +``minute``: The value of a minute. + +``second``: field “second” contains no valid information in the current version. + +**Returns** +~~~~~~~~~~~ + +The function returns “0” if success, otherwise returns a negative value for failure. + +**Example Code** +~~~~~~~~~~~~~~~~ + +Example: `last_modified_time `_ + +.. note :: “FatFs_SD.h” must be included to use the class function. + +**FatFsSD::setLastModTime** +--------------------------- + +**Description** +~~~~~~~~~~~~~~~ + +Set the last modified time for a file or directory. Ameba doesn't have built-in RTC. So we manually change file/directory last modified time. + +**Syntax** +~~~~~~~~~~ + +.. code:: c++ + + int setLastModTime(char *absolute_path, uint16_t year,uint16_t month, uint16_t date, uint16_t hour, uint16_t minute, uint16_t second); + +**Parameters** +~~~~~~~~~~~~~~ + +``absolute_path``: The absolute path to be queried. + +``year``: The value of the year. + +``month``: The value of the month. + +``date``: The value of the date. + +``hour``: The value of an hour. + +``minute``: The value of a minute. + +``second``: field “second” contains no valid information in the current version. + +**Returns** +~~~~~~~~~~~ + +The function returns “0” if success, otherwise returns a negative value for failure. + +**Example Code** +~~~~~~~~~~~~~~~~ + +Example: `last_modified_time `_ + +.. note :: “FatFs_SD.h” must be included to use the class function. + +**FatFsSD::status** +------------------- + +**Description** +~~~~~~~~~~~~~~~ + +Return the current status of SD. + +**Syntax** +~~~~~~~~~~ + +.. code:: c++ + + int status(void); + +**Parameters** +~~~~~~~~~~~~~~ + +NA + +**Returns** +~~~~~~~~~~~ + +Function returns “1” if ready to use, else return “0” if the status is inactivating or abnormal. + +**Example Code** +~~~~~~~~~~~~~~~~ + +NA. + +.. note :: “FatFs_SD.h” must be included to use the class function. + +**FatFsSD::open** +----------------- + +**Description** +~~~~~~~~~~~~~~~ + +Open a file. + +**Syntax** +~~~~~~~~~~ + +.. code:: c++ + + SdFatFile open(char *absolute_path); + +**Parameters** +~~~~~~~~~~~~~~ + +``absolute_path``: The path to a file. + +**Returns** +~~~~~~~~~~~ + +The file object is an instance of SdFatFile. + +**Example Code** +~~~~~~~~~~~~~~~~ + +Example: `create_folder `_ + +.. note :: “FatFs_SD.h” must be included to use the class function. diff --git a/source/_common/API_Documents/FatfsSDcard/Class SdFatFile.rst b/source/_common/API_Documents/FatfsSDcard/Class SdFatFile.rst new file mode 100644 index 0000000..db84688 --- /dev/null +++ b/source/_common/API_Documents/FatfsSDcard/Class SdFatFile.rst @@ -0,0 +1,316 @@ +Class SdFatFile +=============== + +.. contents:: + :local: + :depth: 2 + +**SdFatFile Class** +------------------- + +**Description** +~~~~~~~~~~~~~~~ + +Defines a class of SD FAT File. + +**Syntax** +~~~~~~~~~~ + +.. code:: c++ + + class SdFatFile + +**Members** +~~~~~~~~~~~ + ++-----------------------+-------------------------------------------+ +|**Public Constructors** | ++=======================+===========================================+ +|SdFatFile::SdFatFile | Constructs a SdFatFile object | ++-----------------------+-------------------------------------------+ +|SdFatFile::~SdFatFile | Destructs a SdFatFile object | ++-----------------------+-------------------------------------------+ +|**Public Methods** | ++-----------------------+-------------------------------------------+ +|SdFatFile::write | Write content 1 byte/bytes to file | ++-----------------------+-------------------------------------------+ +|SdFatFile::read | Read content (1 byte or bytes) from | +| | the file | ++-----------------------+-------------------------------------------+ +|SdFatFile::peek | Read 1 byte from file without move curser | ++-----------------------+-------------------------------------------+ +|SdFatFile::available | Check if the cursor is at EOF | +| | (End-Of-File) | ++-----------------------+-------------------------------------------+ +|SdFatFile::seek | Change cursor to a specific position | ++-----------------------+-------------------------------------------+ +|SdFatFile::close | Close file | ++-----------------------+-------------------------------------------+ +|SdFatFile::cursor_pos | Indicate the current cursor position | ++-----------------------+-------------------------------------------+ +|SdFatFile::file_size | Output the size of file (DWORDs) | ++-----------------------+-------------------------------------------+ + +**SdFatFile::write** +-------------------- + +**Description** +~~~~~~~~~~~~~~~ + +Write 1 byte or bytes to the file. + +**Syntax** +~~~~~~~~~~ + +.. code:: c++ + + virtual size_t write(uint8_t c); + virtual size_t write(const uint8_t *buf, size_t size); + +**Parameters** +~~~~~~~~~~~~~~ + +``c`` : The character to be written. + +``buf`` : The buffer to be written. + +``size`` : The length of buffer to be written. + +**Returns** +~~~~~~~~~~~ + +The function returns the number of byte count that has been successfully written to the file. + +**Example Code** +~~~~~~~~~~~~~~~~ + +NA. + +.. note :: “SdFatFile.h” must be included to use the class function. + +**SdFatFile::read** +------------------- + +**Description** +~~~~~~~~~~~~~~~ + +Read 1 byte or bytes from the file. + +**Syntax** +~~~~~~~~~~ + +.. code:: c++ + + virtual int read(void); + int read(void *buf, uint16_t nbyte); + +**Parameters** +~~~~~~~~~~~~~~ + +``buf``: The buffer to store the content. + +``nbyte``: The buffer size. (Or can be regarded as the desired length to read). + +**Returns** +~~~~~~~~~~~ + +The function returns a read character or the read size of the buffer. + +**Example Code** +~~~~~~~~~~~~~~~~ + +Example: `create_folder `_ + +.. note :: “SdFatFile.h” must be included to use the class function. + +**SdFatFile::peek** +------------------- + +**Description** +~~~~~~~~~~~~~~~ + +Read one byte from the file without moving the cursor. + +**Syntax** +~~~~~~~~~~ + +.. code:: c++ + + virtual int peek(void); + +**Parameters** +~~~~~~~~~~~~~~ + +NA + +**Returns** +~~~~~~~~~~~ + +This function returns the read character as an integer number. + +**Example Code** +~~~~~~~~~~~~~~~~ + +NA + +.. note :: “SdFatFile.h” must be included to use the class function. + +**SdFatFile::available** +------------------------ + +**Description** +~~~~~~~~~~~~~~~ + +Check if the cursor is at EOF. + +**Syntax** +~~~~~~~~~~ + +.. code:: c++ + + virtual int available(void); + +**Parameters** +~~~~~~~~~~~~~~ + +NA + +**Returns** +~~~~~~~~~~~ + +The function returns ``0`` if the cursor is at EOF, else returns “1”. + +**Example Code** +~~~~~~~~~~~~~~~~ + +NA + +.. note :: “SdFatFile.h” must be included to use the class function. + +**SdFatFile::seek** +------------------- + +**Description** +~~~~~~~~~~~~~~~ + +Change cursor to a specific position. + +**Syntax** +~~~~~~~~~~ + +.. code:: c++ + + int seek(uint32_t pos); + +**Parameters** +~~~~~~~~~~~~~~ + +``pos``: The desired position. + +**Returns** +~~~~~~~~~~~ + +This function returns 0 if the cursor is set a specific position successfully otherwise returns a negative value. + +**Example Code** +~~~~~~~~~~~~~~~~ + +NA + +.. note :: “SdFatFile.h” must be included to use the class function. + +**SdFatFile::close** +-------------------- + +**Description** +~~~~~~~~~~~~~~~ + +Close file. + +**Syntax** +~~~~~~~~~~ + +.. code:: c++ + + int close(void); + +**Parameters** +~~~~~~~~~~~~~~ + +NA + +**Returns** +~~~~~~~~~~~ + +The function returns 0 if runs successfully otherwise it returns a negative value. + +**Example Code** +~~~~~~~~~~~~~~~~ + +Example: `create_folder `_ + +.. note :: “SdFatFile.h” in order to use the class function. + +**SdFatFile::cursor_pos** +------------------------- + +**Description** +~~~~~~~~~~~~~~~ + +Indicate the current cursor position. It is a file read/write pointer (Zeroed on file open). + +**Syntax** +~~~~~~~~~~ + +.. code:: c++ + + uint32_t cursor_pos (void); + +**Parameters** +~~~~~~~~~~~~~~ + +NA + +**Returns** +~~~~~~~~~~~ + +This function returns a file read/write pointer. “0” on file open. + +**Example Code** +~~~~~~~~~~~~~~~~ + +NA + +.. note :: “SdFatFile.h” in order to use the class function. + +**SdFatFile::file_size** +------------------------ + +**Description** +~~~~~~~~~~~~~~~ + +Output the size of file (DWORDs). + +**Syntax** +~~~~~~~~~~ + +.. code:: c++ + + uint32_t file_size (void); + +**Parameters** +~~~~~~~~~~~~~~ + +NA + +**Returns** +~~~~~~~~~~~ + +This function returns a DWORD value as the file size. + +**Example Code** +~~~~~~~~~~~~~~~~ + +NA + +.. note :: “SdFatFile.h” in order to use the class function. diff --git a/bak/ambd/_common/API_Documents/FatfsSDcard/index.rst b/source/_common/API_Documents/FatfsSDcard/index.rst similarity index 100% rename from bak/ambd/_common/API_Documents/FatfsSDcard/index.rst rename to source/_common/API_Documents/FatfsSDcard/index.rst diff --git a/source/_common/API_Documents/FlashMemory/Class FlashMemoryClass.rst b/source/_common/API_Documents/FlashMemory/Class FlashMemoryClass.rst new file mode 100644 index 0000000..cd83bb1 --- /dev/null +++ b/source/_common/API_Documents/FlashMemory/Class FlashMemoryClass.rst @@ -0,0 +1,244 @@ +Class FlashMemory +================= + +.. contents:: + :local: + :depth: 2 + +**FlashMemoryClass Class** +-------------------------- + +**Description** +~~~~~~~~~~~~~~~ + +A class for Flash memory API. + +**Syntax** +~~~~~~~~~~ + +.. code-block:: c++ + + class FlashMemoryClass + +**Members** +~~~~~~~~~~~ + ++------------------------------------+----------------------------------+ +| **Public Constructors** | ++====================================+==================================+ +| FlashMemoryClass::FlashMemoryClass | Constructs a FlashMemoryClass | +| | object | ++------------------------------------+----------------------------------+ +| **Public Methods** | ++------------------------------------+----------------------------------+ +| FlashMemoryClass::begin | Initialize/Re-initialize the | +| | base address and size | ++------------------------------------+----------------------------------+ +| FlashMemoryClass::read | Read content from flash memory | +| | to buffer | ++------------------------------------+----------------------------------+ +| FlashMemoryClass::update | Write the content in the buffer | +| | back to the flash memory | ++------------------------------------+----------------------------------+ +| FlashMemoryClass::readWord | Read 4 bytes from flash | +| | memory based on the new base | +| | address with specific offset. | ++------------------------------------+----------------------------------+ +| FlashMemoryClass::writeWord | Write word to flash memory | ++------------------------------------+----------------------------------+ + +**FlashMemoryClass::FlashMemoryClass** +-------------------------------------- + +**Description** +~~~~~~~~~~~~~~~ + +Constructs a FlashMemoryClass object. + +**Syntax** +~~~~~~~~~~ + +.. code-block:: c++ + + FlashMemoryClass(unsigned int _base_address, unsigned int _buf_size); + +**Parameters** +~~~~~~~~~~~~~~ + +``_base_address``: The starting location/position of the flash memory area +``_buf_size``: The buf size for mirroring a copy to reduce flash memory operation + +**Returns** +~~~~~~~~~~~ + +NA + +**Example Code** +~~~~~~~~~~~~~~~~ + +Example: `FleshMemory_Basic `_ + +.. note :: "FlashMemory.h" must be included to use the class function. + +**FlashMemoryClass::begin** +--------------------------- + +**Description** +~~~~~~~~~~~~~~~ + +Initialize/Re-initialize the base address and size. The default usable flash memory size is 0x1000. + +**Syntax** +~~~~~~~~~~ + +.. code-block:: c++ + + void begin(unsigned int _base_address, unsigned int _buf_size); + +**Parameters** +~~~~~~~~~~~~~~ + +``_base_address``: The starting location/position of the flash memory area +``_buf_size``: The desired buffer size + +**Returns** +~~~~~~~~~~~ + +NA + +**Example Code** +~~~~~~~~~~~~~~~~ + +Example: `FleshMemory_Basic `_ + +.. note :: "FlashMemory.h" must be included to use the class function. + +**FlashMemoryClass::read** +-------------------------- + +**Description** +~~~~~~~~~~~~~~~ + +When read() is called, contents will be read from the flash memory and copy into a buffer. All modification of the contents will be done in the buffer before updating the flash memory. The default length of the data to read is 0x1000 (flash sector size). + +**Syntax** +~~~~~~~~~~ + +.. code-block:: c++ + + void read(void); + +**Parameters** +~~~~~~~~~~~~~~ + +NA + +**Returns** +~~~~~~~~~~~ + +NA + +**Example Code** +~~~~~~~~~~~~~~~~ + +Example: `FleshMemory_Basic `_ + +.. note :: "FlashMemory.h" must be included to use the class function. + +**FlashMemoryClass::update** +---------------------------- + +**Description** +~~~~~~~~~~~~~~~ + +Write the content of the buffer into the flash memory. The default length of the data is 0x1000 (flash sector size). + +**Syntax** +~~~~~~~~~~ + +.. code-block:: c++ + + void update(bool erase = true); + +**Parameters** +~~~~~~~~~~~~~~ + +erase: It is set to true by default and erases flash memory before writing. + +**Returns** +~~~~~~~~~~~ + +NA + +**Example Code** +~~~~~~~~~~~~~~~~ + +Example: `FleshMemory_Basic `_ + +.. note :: "FlashMemory.h" must be included to use the class function. + +**FlashMemoryClass::readWord** +------------------------------ + +**Description** +~~~~~~~~~~~~~~~ + +Read 4 bytes data (a word) from a flash address, based on the new base address with specific offset. + +**Syntax** +~~~~~~~~~~ + +.. code-block:: c++ + + unsigned int readWord(unsigned int offset); + +**Parameters** +~~~~~~~~~~~~~~ + +``offset``: offset to the base address. + +**Returns** +~~~~~~~~~~~ + +This function returns the 4 bytes read data. + +**Example Code** +~~~~~~~~~~~~~~~~ + +Example: `ReadWriteOneWord `_ + +.. note :: "FlashMemory.h" must be included to use the class function. + +**FlashMemoryClass::writeWord** +------------------------------- + +**Description** +~~~~~~~~~~~~~~~ + +Write 4 bytes data (a word) to a flash address, based on the new base address with specific offset. Then read data from the address and compare with the origianl data. If there is difference. Buffer a flash sector from the new base address, then erase the sector from the flash. Replace the correct data back into buffer. Then rewrite the buffer in to the flash. + +**Syntax** +~~~~~~~~~~ + +.. code-block:: c++ + + void writeWord(unsigned int offset, unsigned int data); + +**Parameters** +~~~~~~~~~~~~~~ + +``offset``: offset to the base address. + +``data``: The data to be written (4 bytes / a word) + +**Returns** +~~~~~~~~~~~ + +NA + +**Example Code** +~~~~~~~~~~~~~~~~ + +Example: `ReadWriteOneWord `_ + +.. note :: "FlashMemory.h" must be included to use the class function. diff --git a/bak/ambd/_common/API_Documents/FlashMemory/index.rst b/source/_common/API_Documents/FlashMemory/index.rst similarity index 100% rename from bak/ambd/_common/API_Documents/FlashMemory/index.rst rename to source/_common/API_Documents/FlashMemory/index.rst diff --git a/source/_common/Example_Guides/OTA/OTA - Update Firmware to Ameba via OTA.rst b/source/_common/Example_Guides/OTA/OTA - Update Firmware to Ameba via OTA.rst new file mode 100644 index 0000000..49a8416 --- /dev/null +++ b/source/_common/Example_Guides/OTA/OTA - Update Firmware to Ameba via OTA.rst @@ -0,0 +1,163 @@ +OTA - Update Firmware to Ameba via OTA +====================================== + +.. contents:: + :local: + :depth: 2 + +Materials +--------- + +- AmebaD [AMB21 / AMB22 / AMB23 / AMB26 / BW16 / AW-CU488 Thing Plus] x 1 + +Example +------- + +OTA (Over-The-Air) refers to the online upgrade mechanism via Internet. Arduino IDE offers OTA feature, which follows the workflow in the figure below: + +|image01| + +1. Arduino IDE established the mDNS (multicast Domain Name Services) and multicast it’s IP address. This IP address will be used for OTA server to bind with an incoming TCP socket in a Local Area Network (LAN). + +2. Since mDNS service is running on Ameba, Ameba responds to the mDNS search and opens the specific TCP port for connection. + +3. Ameba works as OTA client and establishes a TCP connection that waits for an incoming TCP socket connection from the OTA server. + +4. Once the previously established network port can be found in Arduino IDE. By clicking the “Upload” button in Arduino IDE, user prepared OTA image will be sent via OTA server to the specific IP and network port. Upon the upload procedure is finished, Ameba will boot from the OTA image automatically. + +The workflow consists of 3 parts: mDNS, TCP and OTA image process. Details related to mDNS is described in the mDNS example guide: [MDNS - Set up mDNS Client on Arduino IDE]. TCP socket programming is used in transferring image, which is programmed in OTA server tool and OTA API. + +In the next section, we will discuss on how to process the OTA image and introduce some basic knowledge on Ameba flash memory layout and boot flow. + +Ameba Flash Memory Layout +~~~~~~~~~~~~~~~~~~~~~~~~~ + +The default flash memory size of AmebaD is 2MB, ranges from 0x0800_0000 to 0x0820_0000 - + +1. As shown in the figure below, Ameba program occupies three parts of the flash memory: + +|image02| + +- Boot Image (KM0 Boot and KM4 Boot): That is, the bootloader. When Ameba boots up, it places the boot image to memory and performs initialization. Furthermore, it determines where to proceed after the bootloader. Bootloader looks at the OTA address and determines which image will be executed afterwards. At the end of the bootloader, it places the image to memory and proceeds to execute it. + +- Backup: Backup Flash area starts from 0x0800_2000 - 0x0800_3000-1, reserved for system use. When program system data, this area will be used as backup area. + +- System Data: System data block starts from 0x0800_3000 - 0x0800_4000-1, user should program this area carefully. + +- Default Image 2 (KM0 IMG2 and KM4 IMG2): The developer code is placed in this part; the address starts from 0x0800_6000 or 0x0810_6000. The first 16-byte is for image header, which comprises the bootloader Signature for flash calibration. The Signature is used to verify whether the image is valid. + +- OTA Image (OTA1 and OTA2): The data in this part is also developer code. By default, this part of memory starts from 0x0800_0000. The main differences between OTA image and Default Image 2 are the OTA image contains special 32 Bytes firmware file header. + +Generate Cloud OTA Image +~~~~~~~~~~~~~~~~~~~~~~~~ + +Steps to generate a Cloud OTA image are as follows: + +1. Compile user’s sketch. “km0_km4_image2.bin” will be generated upon Arduino's sketch Verify (compilation) process done in the file path: C:\Users\USERNAME\AppData\Local\Arduino15\packages\realtek\tools\ameba_d_tools\x.x.x. This file will be used as the source binary to be converted to an OTA binary later. + +2. Retrieve the “ImageTool.exe” from GitHub ambd_sdk: https://github.com/ambiot/ambd_sdk/tree/dev/tools/AmebaD/Image_Tool, double click to open it. + +3. Select “OTA_All” as Generate Target type (in red). + +4. Input Image Version, the default value is “0xFFFFFFFF”. + +5. Click Browse button to select target images to be converted to an OTA binary. The address can be ignored. The Memory Layout bar will show the relative positions of the two images. If they overlap, the overlapped area is in red colour for warning. + +6. Click Generate button to specify the name and path of the output file. After the operation is done, the cloud image (OTA_All.bin) is generated at your specified folder. We recommend placing it in the default tools folder for Arduino Ameba: + a. Windows + C:\Users\username\AppData\Local\Arduino15\packages\realtek\tools\ameba_d_tools\x.x.x\ + b. Linux + /home/username/.arduino15/packages/Realtek/tools/ameba_d_tools/x.x.x/ + c. MacOS + /Users/username/Library/Arduino15/packages/Realtek/tools/ameba_d_tools/x.x.x/ + +When navigating to the designated tools folder on your target operating system, create a new folder called “misc” and put the OTA image (OTA_All.bin) within it. + +|image03| + +Open the example: “File” -> “Examples” -> “AmebaOTA” -> “OTA_Basic”: +Fill in the Wi-Fi SSID and password in the sample code for network connection and establish the mDNS service. + +|image04| + +There are some parameters related to OTA: +- OTA_PORT: Arduino IDE will find Ameba via mDNS. Ameba will tell Arduino IDE that it opens TCP port 8020 to wait for OTA image. This port number is also matching with the port number of OTA server. + +|image05| + +Then we use USB upload program to Ameba. Click “Tools” -> “Ports”, check the serial port to use: + +|image06| + +Upon opening the serial monitor and pressing the “Reset” button, Ameba connects to the AP and obtains an IP address assigned via DHCP: “192.168.xxx.xxx” as shown below. + +|image07| + +Upon the mDNS service is established successfully, this IP address will be multicast and appears in Arduino IDE “Tools” -> “Port” -> “Network Ports: My Ameba at 192.168.xxx.xxx”. + +|image08| + +|image09| + +If you cannot find the network port of Ameba, please confirm: + +- Whether your computer and Ameba are in the same LAN? +- Try to restart Arduino IDE. +- Check log message in Serial Monitor to see whether your board is connected to the AP or establish mDNS successfully. + +The Ameba board with mDNS is currently functioning as an OTA server, which is listening for incoming TCP socket connections from potential OTA clients. To establish an OTA client, you can select “Tools” -> “Port” -> “Network Ports: My Ameba at 192.168.xxx.xxx” in the Arduino IDE from any of the three supported operating systems (Windows, Linux, and macOS), and then click “Upload”. +The OTA client will establish a TCP connection to Ameba's network IP and port 8020, and then transmit the OTA firmware. Once the OTA process is complete, the Arduino IDE will display the message “Client Disconnected” without any error messages. + +|image10| + +Once the OTA transmission is complete and you see the log message “[beginOTA] Update task exit” in your serial monitor, the board will perform a soft reset automatically and reboot from the OTA image in your flash memory. + +|image11| + +According to the OTA boot select diagram, AmebaD is default boot from OTA2 when there are valid images in OTA2 sections. + +|image12| + +Therefore, please Enable the “Erase Flash” options in Arduino IDE if you wish to upload new images via the Serial Port. + +|image13| + +.. |image01| image:: ../../../_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image01.png + :width: 601 px + :height: 299 px +.. |image02| image:: ../../../_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image02.png + :width: 602 px + :height: 323 px +.. |image03| image:: ../../../_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image03.png + :width: 529px + :height: 716 px +.. |image04| image:: ../../../_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image04.png + :width: 586 px + :height: 537 px +.. |image05| image:: ../../../_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image05.png + :width: 531 px + :height: 245 px +.. |image06| image:: ../../../_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image06.png + :width: 602 px + :height: 553 px +.. |image07| image:: ../../../_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image07.png + :width: 602 px + :height: 549 px +.. |image08| image:: ../../../_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image08.png + :width: 602 px + :height: 548 px +.. |image09| image:: ../../../_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image09.png + :width: 602 px + :height: 637 px +.. |image10| image:: ../../../_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image10.png + :width: 602 px + :height: 637 px +.. |image11| image:: ../../../_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image11.png + :width: 602 px + :height: 548 px +.. |image12| image:: ../../../_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image12.png + :width: 601 px + :height: 307 px +.. |image13| image:: ../../../_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image13.png + :width: 602 px + :height: 279 px diff --git a/bak/ambd/_common/Example_Guides/OTA/index.rst b/source/_common/Example_Guides/OTA/index.rst similarity index 59% rename from bak/ambd/_common/Example_Guides/OTA/index.rst rename to source/_common/Example_Guides/OTA/index.rst index 6459e9c..930df51 100644 --- a/bak/ambd/_common/Example_Guides/OTA/index.rst +++ b/source/_common/Example_Guides/OTA/index.rst @@ -4,4 +4,5 @@ OTA .. toctree:: :maxdepth: 1 + Ameba Over-the-Air Firmware Update via HTTP OTA - Update Firmware to Ameba via OTA diff --git a/source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_Basic Input Output/image01.png b/source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_Basic Input Output/image01.png similarity index 100% rename from source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_Basic Input Output/image01.png rename to source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_Basic Input Output/image01.png diff --git a/source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_Basic Input Output/image02.png b/source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_Basic Input Output/image02.png similarity index 100% rename from source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_Basic Input Output/image02.png rename to source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_Basic Input Output/image02.png diff --git a/source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_Basic Input Output/image03.png b/source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_Basic Input Output/image03.png similarity index 100% rename from source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_Basic Input Output/image03.png rename to source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_Basic Input Output/image03.png diff --git a/source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_Basic Input Output/image04.png b/source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_Basic Input Output/image04.png similarity index 100% rename from source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_Basic Input Output/image04.png rename to source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_Basic Input Output/image04.png diff --git a/source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_FFT/image01.png b/source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_FFT/image01.png similarity index 100% rename from source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_FFT/image01.png rename to source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_FFT/image01.png diff --git a/source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_FFT/image02.png b/source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_FFT/image02.png similarity index 100% rename from source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_FFT/image02.png rename to source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_FFT/image02.png diff --git a/source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_InputFFT/image01.png b/source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_InputFFT/image01.png similarity index 100% rename from source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_InputFFT/image01.png rename to source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_InputFFT/image01.png diff --git a/source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_InputFFT/image02.png b/source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_InputFFT/image02.png similarity index 100% rename from source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_InputFFT/image02.png rename to source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_InputFFT/image02.png diff --git a/source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_InputFFT/image03.png b/source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_InputFFT/image03.png similarity index 100% rename from source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_InputFFT/image03.png rename to source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_InputFFT/image03.png diff --git a/source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_InputFFT/image04.png b/source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_InputFFT/image04.png similarity index 100% rename from source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_InputFFT/image04.png rename to source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_InputFFT/image04.png diff --git a/source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_Output Sine Wave/image01.png b/source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_Output Sine Wave/image01.png similarity index 100% rename from source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_Output Sine Wave/image01.png rename to source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_Output Sine Wave/image01.png diff --git a/source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_Output Sine Wave/image02.png b/source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_Output Sine Wave/image02.png similarity index 100% rename from source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_Output Sine Wave/image02.png rename to source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_Output Sine Wave/image02.png diff --git a/source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_Output Sine Wave/image03.png b/source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_Output Sine Wave/image03.png similarity index 100% rename from source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_Output Sine Wave/image03.png rename to source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_Output Sine Wave/image03.png diff --git a/source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_play and record wav files/image01.png b/source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_play and record wav files/image01.png similarity index 100% rename from source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_play and record wav files/image01.png rename to source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_play and record wav files/image01.png diff --git a/source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_play and record wav files/image02.png b/source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_play and record wav files/image02.png similarity index 100% rename from source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_play and record wav files/image02.png rename to source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_play and record wav files/image02.png diff --git a/source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_play and record wav files/image03.png b/source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_play and record wav files/image03.png similarity index 100% rename from source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_play and record wav files/image03.png rename to source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_play and record wav files/image03.png diff --git a/source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_play and record wav files/image04.png b/source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_play and record wav files/image04.png similarity index 100% rename from source/_static/amebad/Example_Guides/Audio Codec/Audio Codec_play and record wav files/image04.png rename to source/_static/amebad/Example_Guides/AudioCodec/Audio Codec_play and record wav files/image04.png diff --git a/source/_static/amebad/Example_Guides/Flash Memory/Flash Memory_Store data in Flash EEPROM/image01.png b/source/_static/amebad/Example_Guides/FlashMemory/Flash Memory_Store data in Flash EEPROM/image01.png similarity index 100% rename from source/_static/amebad/Example_Guides/Flash Memory/Flash Memory_Store data in Flash EEPROM/image01.png rename to source/_static/amebad/Example_Guides/FlashMemory/Flash Memory_Store data in Flash EEPROM/image01.png diff --git a/source/_static/amebad/Example_Guides/Flash Memory/Flash Memory_Store data in Flash EEPROM/image02.png b/source/_static/amebad/Example_Guides/FlashMemory/Flash Memory_Store data in Flash EEPROM/image02.png similarity index 100% rename from source/_static/amebad/Example_Guides/Flash Memory/Flash Memory_Store data in Flash EEPROM/image02.png rename to source/_static/amebad/Example_Guides/FlashMemory/Flash Memory_Store data in Flash EEPROM/image02.png diff --git a/source/_static/amebad/Example_Guides/Flash Memory/Flash Memory_Use Flash Memory Larger Than 4K/image01.png b/source/_static/amebad/Example_Guides/FlashMemory/Flash Memory_Use Flash Memory Larger Than 4K/image01.png similarity index 100% rename from source/_static/amebad/Example_Guides/Flash Memory/Flash Memory_Use Flash Memory Larger Than 4K/image01.png rename to source/_static/amebad/Example_Guides/FlashMemory/Flash Memory_Use Flash Memory Larger Than 4K/image01.png diff --git a/source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image01.png b/source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image01.png similarity index 100% rename from source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image01.png rename to source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image01.png diff --git a/source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image02.png b/source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image02.png similarity index 100% rename from source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image02.png rename to source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image02.png diff --git a/source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image03.png b/source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image03.png similarity index 100% rename from source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image03.png rename to source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image03.png diff --git a/source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image04.png b/source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image04.png similarity index 100% rename from source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image04.png rename to source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image04.png diff --git a/source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image05.png b/source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image05.png similarity index 100% rename from source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image05.png rename to source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image05.png diff --git a/source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image06.png b/source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image06.png similarity index 100% rename from source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image06.png rename to source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image06.png diff --git a/source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image07.png b/source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image07.png similarity index 100% rename from source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image07.png rename to source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image07.png diff --git a/source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image08.png b/source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image08.png similarity index 100% rename from source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image08.png rename to source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image08.png diff --git a/source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image09.png b/source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image09.png similarity index 100% rename from source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image09.png rename to source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image09.png diff --git a/source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image10.png b/source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image10.png similarity index 100% rename from source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image10.png rename to source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image10.png diff --git a/source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image11.png b/source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image11.png similarity index 100% rename from source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image11.png rename to source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image11.png diff --git a/source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image12.png b/source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image12.png similarity index 100% rename from source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image12.png rename to source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image12.png diff --git a/source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image13.png b/source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image13.png similarity index 100% rename from source/_static/amebad/Example_Guides/OTA/OTA _Update Firmware to Ameba via OTA/image13.png rename to source/_static/amebad/Example_Guides/OTA/OTA_Update_Firmware_to_Ameba_via_OTA/image13.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_DHT_LCD/image01.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_DHT_LCD/image01.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_DHT_LCD/image01.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_DHT_LCD/image01.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_DHT_LCD/image02.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_DHT_LCD/image02.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_DHT_LCD/image02.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_DHT_LCD/image02.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_DHT_LCD/image03.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_DHT_LCD/image03.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_DHT_LCD/image03.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_DHT_LCD/image03.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_For_DHT_Epaper/image01.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_For_DHT_Epaper/image01.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_For_DHT_Epaper/image01.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_For_DHT_Epaper/image01.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_For_DHT_Epaper/image02.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_For_DHT_Epaper/image02.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_For_DHT_Epaper/image02.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_For_DHT_Epaper/image02.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_For_DHT_Epaper/image03.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_For_DHT_Epaper/image03.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_For_DHT_Epaper/image03.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_For_DHT_Epaper/image03.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_Mode/image01.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image01.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_Mode/image01.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image01.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_Mode/image02.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image02.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_Mode/image02.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image02.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_Mode/image03.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image03.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_Mode/image03.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image03.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_Mode/image04.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image04.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_Mode/image04.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image04.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_Mode/image05.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image05.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_Mode/image05.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image05.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_Mode/image06.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image06.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_Mode/image06.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image06.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_Mode/image07.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image07.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_Mode/image07.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image07.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_Mode/image08.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image08.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_Mode/image08.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image08.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_Mode/image09.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image09.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_Mode/image09.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image09.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_Mode/image10.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image10.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Deep_Sleep_Mode/image10.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image10.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Tickless_Mode/image01.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Tickless_Mode/image01.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Tickless_Mode/image01.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Tickless_Mode/image01.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Tickless_Mode/image02.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Tickless_Mode/image02.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Tickless_Mode/image02.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Tickless_Mode/image02.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Tickless_Mode/image03.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Tickless_Mode/image03.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Tickless_Mode/image03.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Tickless_Mode/image03.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Tickless_Mode/image04.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Tickless_Mode/image04.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Tickless_Mode/image04.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Tickless_Mode/image04.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Tickless_Mode/image05.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Tickless_Mode/image05.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Tickless_Mode/image05.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Tickless_Mode/image05.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Tickless_Mode/image06.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Tickless_Mode/image06.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Tickless_Mode/image06.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Tickless_Mode/image06.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Tickless_Mode/image07.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Tickless_Mode/image07.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Tickless_Mode/image07.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Tickless_Mode/image07.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Tickless_Mode/image08.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Tickless_Mode/image08.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Tickless_Mode/image08.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Tickless_Mode/image08.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Tickless_Mode/image09.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Tickless_Mode/image09.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Tickless_Mode/image09.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Tickless_Mode/image09.png diff --git a/source/_static/amebad/Example_Guides/Power Save/Power_Save_Tickless_Mode/image10.png b/source/_static/amebad/Example_Guides/PowerSave/Power_Save_Tickless_Mode/image10.png similarity index 100% rename from source/_static/amebad/Example_Guides/Power Save/Power_Save_Tickless_Mode/image10.png rename to source/_static/amebad/Example_Guides/PowerSave/Power_Save_Tickless_Mode/image10.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Hello World/image01.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Hello World/image01.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Hello World/image01.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Hello World/image01.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Hello World/image02.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Hello World/image02.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Hello World/image02.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Hello World/image02.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Magic Wand/image01.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Magic Wand/image01.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Magic Wand/image01.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Magic Wand/image01.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Magic Wand/image02.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Magic Wand/image02.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Magic Wand/image02.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Magic Wand/image02.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Magic Wand/image03.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Magic Wand/image03.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Magic Wand/image03.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Magic Wand/image03.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Magic Wand/image04.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Magic Wand/image04.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Magic Wand/image04.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Magic Wand/image04.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Magic Wand/image05.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Magic Wand/image05.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Magic Wand/image05.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Magic Wand/image05.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Magic Wand/image06.PNG b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Magic Wand/image06.PNG similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Magic Wand/image06.PNG rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Magic Wand/image06.PNG diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Magic Wand/image07.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Magic Wand/image07.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Magic Wand/image07.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Magic Wand/image07.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Magic Wand/image08.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Magic Wand/image08.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Magic Wand/image08.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Magic Wand/image08.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Magic Wand/image09.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Magic Wand/image09.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Magic Wand/image09.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Magic Wand/image09.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Magic Wand/image10.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Magic Wand/image10.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Magic Wand/image10.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Magic Wand/image10.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Magic Wand/image11.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Magic Wand/image11.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Magic Wand/image11.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Magic Wand/image11.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Micro Speech/image01.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Micro Speech/image01.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Micro Speech/image01.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Micro Speech/image01.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Micro Speech/image02.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Micro Speech/image02.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Micro Speech/image02.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Micro Speech/image02.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Micro Speech/image03.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Micro Speech/image03.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Micro Speech/image03.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Micro Speech/image03.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Micro Speech/image04.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Micro Speech/image04.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Micro Speech/image04.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Micro Speech/image04.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Micro Speech/image05.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Micro Speech/image05.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Micro Speech/image05.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Micro Speech/image05.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Person Detection/image01.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Person Detection/image01.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Person Detection/image01.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Person Detection/image01.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Person Detection/image02.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Person Detection/image02.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Person Detection/image02.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Person Detection/image02.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Person Detection/image03.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Person Detection/image03.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Person Detection/image03.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Person Detection/image03.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Person Detection/image04.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Person Detection/image04.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Person Detection/image04.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Person Detection/image04.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Person Detection/image05.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Person Detection/image05.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Person Detection/image05.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Person Detection/image05.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Person Detection/image06.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Person Detection/image06.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Person Detection/image06.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Person Detection/image06.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Person Detection/image07.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Person Detection/image07.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Person Detection/image07.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Person Detection/image07.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Person Detection/image08.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Person Detection/image08.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Person Detection/image08.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Person Detection/image08.png diff --git a/source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Person Detection/image09.png b/source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Person Detection/image09.png similarity index 100% rename from source/_static/amebad/Example_Guides/TensorFlow Lite/TensorFlow Lite_Person Detection/image09.png rename to source/_static/amebad/Example_Guides/TensorFlowLite/TensorFlow Lite_Person Detection/image09.png diff --git a/source/amb21/API_Documents/index.rst b/source/amb21/API_Documents/index.rst index 41d9749..fe9c8ea 100644 --- a/source/amb21/API_Documents/index.rst +++ b/source/amb21/API_Documents/index.rst @@ -7,5 +7,8 @@ API Documents Analog/index AudioCodec/index BLE/index + EPDIF/index + FatfsSDcard/index + FlashMemory/index OTA/index WiFi/index \ No newline at end of file diff --git a/source/amb21/Example_Guides/Basic/Arduino-build-in example.rst b/source/amb21/Example_Guides/Basic/Arduino-build-in example.rst new file mode 100644 index 0000000..16f2560 --- /dev/null +++ b/source/amb21/Example_Guides/Basic/Arduino-build-in example.rst @@ -0,0 +1,168 @@ +Arduino-build-in example +======================== + +.. contents:: + :local: + :depth: 2 + +AMB21 Supported ARDUINO built-in example table +---------------------------------------------- + +There are many built-in examples in Arduino. All examples that listed are compatible with Ameba. + +- `Arduino built-in example details `_ + ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| **Category** | **Name** | **Comment** | **Remarks** | ++===============+===========================+===============================================+====================================================+ +| Basics | AnalogReadSerial | | Connect potentiometer to 3.3V | | ADC pin options A0, A1, A2, A3, A4, A5, | +| | | | | | and A6 | +| | | | ADC pin used, up to 3.3V | | | +| | | | and can be calibrated by using | | ADC pin reading voltage range 0 to 3.3V | +| | | | analogSet(float gain, float offset) | | | +| | | | | ADC value can be calibrated by | +| | | | | modifying _offset and _gain | +| | | | | using 2 points calibration method. | +| | | | | analogSet(float gain, float offset) | +| | | | | can be used to update the calibrated offset | +| | | | | and gain values | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | BareMinimum | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Blink | | LED_BUILTIN sets to Pin 8. | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | DigitalReadSerial | | | Button options, on-board button, PUSH_BTN | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Fade | | For analogWrite(), | | PWM capable Pin 8, 9, 10, 11, 12, 13, 16, 17, 18,| +| | | | use PWM capable pin | | 20, 21, 23, and 24 | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | ReadAnalogVoltage | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Digital | BlinkWithoutDelay | | LED_BUILTIN sets to Pin 8. | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Button | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Debounce | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | DigitalInputPullup | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StateChangeDetection | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | toneKeyboard | | ADC pin used, up to 3.3V | | +| +---------------------------+ | and can be calibrated by +----------------------------------------------------+ +| | toneMelody | | using analogSet(float gain, float offset) | | +| +---------------------------+ | +----------------------------------------------------+ +| | toneMultiple | | For analogRead(), use ADC pin name | | +| +---------------------------+ | (A0 to A6) instead the integer number +----------------------------------------------------+ +| | tonePitchFollower | | | | +| | | | For "tone()" and "noTone()", | | +| | | | use PWM capable pin | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Analog | AnalogInOutSerial | | ADC pin used, up to 3.3V | | +| +---------------------------+ | and can be calibrated by using +----------------------------------------------------+ +| | AnalogInput | | analogSet(float gain, float offset) | | +| +---------------------------+ | +----------------------------------------------------+ +| | AnalogWriteMega | | For analogWrite(), | | +| +---------------------------+ | use PWM capable pin +----------------------------------------------------+ +| | Calibration | | | +| +---------------------------+ +----------------------------------------------------+ +| | Fading | | | +| +---------------------------+ +----------------------------------------------------+ +| | Smoothing | | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Communication | ASCIITable | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Dimmer | | For analogWrite(), | | +| | | | use PWM capable pin | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Graph | | Connect potentiometer to 3.3V | | +| | | | | | +| | | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Midi | | Use Serial1, MIDI jack pin 5 | | +| | | | connected to SERIAL1_TX | | +| | | | | | +| | | | Use Serial2, MIDI jack pin 5 | | +| | | | connected to SERIAL2_TX | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | MultiSerial | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | PhysicalPixel | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | ReadASCIIString | | For analogWrite(), | | +| | | | use PWM capable pin | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | SerialCallResponse | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| | | | | | +| | | | For analogRead(), | | +| | | | use ADC pin name (A0 to A6) | | +| | | | instead the integer number | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | SerialCallResponseASCII | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | SerialEvent | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | SerialPassthrough | | | Serial options, Serial, | +| | | | | Serial1 or Serial2 | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | VirtualColorMixer | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Control | Arrays | | ADC pin used, up to 3.3V | | +| +---------------------------+ | and can be calibrated by using +----------------------------------------------------+ +| | ForLoopIteration | | analogSet(float gain, float offset) | | +| +---------------------------+ | Pin 7 is NC, replace it with another pin. +----------------------------------------------------+ +| | IfStatementConditional | | For “analogWrite()”, use PWM capable pin. | | +| +---------------------------+ +----------------------------------------------------+ +| | switchCase | | | +| +---------------------------+ +----------------------------------------------------+ +| | switchCase2 | | | +| +---------------------------+ +----------------------------------------------------+ +| | WhileStatementConditional | | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Display | barGraph | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+ | Pin 7 is NC, replace it with another pin. +----------------------------------------------------+ +| | RowColumnScanning | | | +| | | | | +| | | | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Strings | CharacterAnalysis | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringAdditionOperator | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringAppendOperator | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringCaseChanges | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringCharacters | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringComparisonOperators | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringIndexOf | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringLength | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringLengthTrim | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringReplace | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringStartsWithEndsWith | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringSubstring | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringToInt | | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ + diff --git a/source/_common/Example_Guides/Basic/index.rst b/source/amb21/Example_Guides/Basic/index.rst similarity index 91% rename from source/_common/Example_Guides/Basic/index.rst rename to source/amb21/Example_Guides/Basic/index.rst index 77bd444..428db90 100644 --- a/source/_common/Example_Guides/Basic/index.rst +++ b/source/amb21/Example_Guides/Basic/index.rst @@ -1,7 +1,7 @@ -Basic -===== - -.. toctree:: - :maxdepth: 1 - - Arduino-build-in example +Basic +===== + +.. toctree:: + :maxdepth: 1 + + Arduino-build-in example diff --git a/source/amb23/API_Documents/index.rst b/source/amb23/API_Documents/index.rst index 41d9749..fe9c8ea 100644 --- a/source/amb23/API_Documents/index.rst +++ b/source/amb23/API_Documents/index.rst @@ -7,5 +7,8 @@ API Documents Analog/index AudioCodec/index BLE/index + EPDIF/index + FatfsSDcard/index + FlashMemory/index OTA/index WiFi/index \ No newline at end of file diff --git a/source/amb23/Example_Guides/Basic/Arduino-build-in example.rst b/source/amb23/Example_Guides/Basic/Arduino-build-in example.rst new file mode 100644 index 0000000..f95ed96 --- /dev/null +++ b/source/amb23/Example_Guides/Basic/Arduino-build-in example.rst @@ -0,0 +1,170 @@ +Arduino-build-in example +======================== + +.. contents:: + :local: + :depth: 2 + +AMB23 Supported ARDUINO built-in example table +---------------------------------------------- + +There are many built-in examples in Arduino. All examples that listed are compatible with Ameba. + +- `Arduino built-in example details `_ + ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| **Category** | **Name** | **Comment** | **Remarks** | ++===============+===========================+===============================================+====================================================+ +| Basics | AnalogReadSerial | | Connect potentiometer to 3.3V | | ADC pin options A0, A1, A2, A3, A4, A5, | +| | | | | | and A6 | +| | | | ADC pin used, up to 3.3V | | | +| | | | and can be calibrated by using | | ADC pin reading voltage range 0 to 3.3V | +| | | | analogSet(float gain, float offset) | | | +| | | | | ADC value can be calibrated by | +| | | | | modifying _offset and _gain | +| | | | | using 2 points calibration method. | +| | | | | analogSet(float gain, float offset) | +| | | | | can be used to update the calibrated offset | +| | | | | and gain values | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | BareMinimum | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Blink | | LED_BUILTIN sets to | | LED options, on-board LED, LED_B (blue) | +| | | | LED_B (on-board LED blue) | | or LED_G (green) | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | DigitalReadSerial | | | Button options, on-board button, PUSH_BTN | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Fade | | For analogWrite(), | | PWM capable Pin 4, 5, 7, 9, 10, 14, 17, 20, | +| | | | use PWM capable pin | | and 21 | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | ReadAnalogVoltage | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Digital | BlinkWithoutDelay | | LED_BUILTIN sets to | | LED options, on-board LED | +| | | | LED_B (on-board LED blue) | | Button options, on-board button | +| +---------------------------+-----------------------------------------------+ | +| | Button | | | +| +---------------------------+-----------------------------------------------+ | +| | Debounce | | | +| +---------------------------+-----------------------------------------------+ | +| | DigitalInputPullup | | | +| +---------------------------+-----------------------------------------------+ | +| | StateChangeDetection | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | toneKeyboard | | ADC pin used, up to 3.3V | | +| +---------------------------+ | and can be calibrated by +----------------------------------------------------+ +| | toneMelody | | using analogSet(float gain, float offset) | | +| +---------------------------+ | +----------------------------------------------------+ +| | toneMultiple | | For analogRead(), use ADC pin name | | +| +---------------------------+ | (A0 to A6) instead the integer number +----------------------------------------------------+ +| | tonePitchFollower | | | | +| | | | For "tone()" and "noTone()", | | +| | | | use PWM capable pin | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Analog | AnalogInOutSerial | | ADC pin used, up to 3.3V | | +| +---------------------------+ | and can be calibrated by using +----------------------------------------------------+ +| | AnalogInput | | analogSet(float gain, float offset) | | LED options, on-board LED | +| +---------------------------+ | +----------------------------------------------------+ +| | AnalogWriteMega | | For analogWrite(), | | +| +---------------------------+ | use PWM capable pin +----------------------------------------------------+ +| | Calibration | | | +| +---------------------------+ +----------------------------------------------------+ +| | Fading | | | +| +---------------------------+ +----------------------------------------------------+ +| | Smoothing | | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Communication | ASCIITable | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Dimmer | | For analogWrite(), | | +| | | | use PWM capable pin | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Graph | | Connect potentiometer to 3.3V | | +| | | | | | +| | | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Midi | | Use Serial1, MIDI jack pin 5 | | +| | | | connected to SERIAL1_TX | | +| | | | | | +| | | | Use Serial2, MIDI jack pin 5 | | +| | | | connected to SERIAL2_TX | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | MultiSerial | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | PhysicalPixel | | | LED options, on-board LED | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | ReadASCIIString | | For analogWrite(), | | +| | | | use PWM capable pin | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | SerialCallResponse | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| | | | | +| | | | For analogRead(), | | +| | | | use ADC pin name (A0 to A6) | | +| | | | instead the integer number | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | SerialCallResponseASCII | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | SerialEvent | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | SerialPassthrough | | | Serial options, Serial, | +| | | | | Serial1 or Serial2 | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | VirtualColorMixer | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Control | Arrays | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | ForLoopIteration | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | IfStatementConditional | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | switchCase | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | switchCase2 | | | +| +---------------------------+ +----------------------------------------------------+ +| | WhileStatementConditional | | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Display | barGraph | | ADC pin used, up to 3.3V | | +| +---------------------------+ +----------------------------------------------------+ +| | RowColumnScanning | | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Strings | CharacterAnalysis | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringAdditionOperator | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringAppendOperator | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringCaseChanges | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringCharacters | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringComparisonOperators | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringIndexOf | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringLength | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringLengthTrim | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringReplace | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringStartsWithEndsWith | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringSubstring | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringToInt | | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ + diff --git a/source/amb23/Example_Guides/Basic/index.rst b/source/amb23/Example_Guides/Basic/index.rst new file mode 100644 index 0000000..428db90 --- /dev/null +++ b/source/amb23/Example_Guides/Basic/index.rst @@ -0,0 +1,7 @@ +Basic +===== + +.. toctree:: + :maxdepth: 1 + + Arduino-build-in example diff --git a/source/amb25/API_Documents/index.rst b/source/amb25/API_Documents/index.rst index 41d9749..fe9c8ea 100644 --- a/source/amb25/API_Documents/index.rst +++ b/source/amb25/API_Documents/index.rst @@ -7,5 +7,8 @@ API Documents Analog/index AudioCodec/index BLE/index + EPDIF/index + FatfsSDcard/index + FlashMemory/index OTA/index WiFi/index \ No newline at end of file diff --git a/source/amb25/Example_Guides/Basic/Arduino-build-in example.rst b/source/amb25/Example_Guides/Basic/Arduino-build-in example.rst new file mode 100644 index 0000000..e8d1a1d --- /dev/null +++ b/source/amb25/Example_Guides/Basic/Arduino-build-in example.rst @@ -0,0 +1,180 @@ +Arduino-build-in example +======================== + +.. contents:: + :local: + :depth: 2 + +AMB25 Supported ARDUINO built-in example table +---------------------------------------------- + +There are many built-in examples in Arduino. All examples that listed are compatible with Ameba. + +- `Arduino built-in example details `_ + ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| **Category** | **Name** | **Comment** | **Remarks** | ++===============+===========================+===============================================+====================================================+ +| Basics | AnalogReadSerial | | Connect potentiometer to 3.3V | | ADC pin options A4 (PB1), A5 (PB2), A6 (PB3). | +| | | | | +| | | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | ADC pin reading voltage range 0 to 3.3V | +| | | | analogSet(float gain, float offset) | | +| | | | | ADC value can be calibrated by | +| | | | | modifying _offset and _gain | +| | | | | using 2 points calibration method. | +| | | | | analogSet(float gain, float offset) | +| | | | | can be used to update the calibrated offset | +| | | | | and gain values | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | BareMinimum | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Blink | | LED_BUILTIN sets to | | +| | | | to any GPIO Pins | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | DigitalReadSerial | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Fade | | For analogWrite(), | | PWM capable Pin 2, 3, 4, 5, 6, 7, 14, 15, 16, | +| | | | use PWM capable pin | | 17, 18, and 19 | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | ReadAnalogVoltage | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Digital | BlinkWithoutDelay | | LED_BUILTIN sets to | | +| | | | to any GPIO Pins | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Button | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Debounce | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | DigitalInputPullup | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StateChangeDetection | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | toneKeyboard | | ADC pin used, up to 3.3V | | +| +---------------------------+ | and can be calibrated by +----------------------------------------------------+ +| | toneMelody | | using analogSet(float gain, float offset) | | +| +---------------------------+ +----------------------------------------------------+ +| | toneMultiple | | For analogRead(), use ADC pin name | | +| +---------------------------+ | (A4 to A6) instead the integer number +----------------------------------------------------+ +| | tonePitchFollower | | | +| | | | For "tone()" and "noTone()", | | +| | | | use PWM capable pin | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Analog | AnalogInOutSerial | | ADC pin used, up to 3.3V | | +| +---------------------------+ | and can be calibrated by using +----------------------------------------------------+ +| | AnalogInput | | analogSet(float gain, float offset) | | +| +---------------------------+ +----------------------------------------------------+ +| | AnalogWriteMega | | For analogWrite(), | | +| +---------------------------+ | use PWM capable pin +----------------------------------------------------+ +| | Calibration | | | +| +---------------------------+ +----------------------------------------------------+ +| | Fading | | | +| +---------------------------+ +----------------------------------------------------+ +| | Smoothing | | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Communication | ASCIITable | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Dimmer | | For analogWrite(), | | +| | | | use PWM capable pin | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Graph | | Connect potentiometer to 3.3V | | +| | | | | +| | | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Midi | | Use Serial1, MIDI jack pin 5 | | +| | | | connected to SERIAL1_TX; | | +| | | | | +| | | | Use Serial2, MIDI jack pin 5 | | +| | | | connected to SERIAL2_TX; | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | MultiSerial | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | PhysicalPixel | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | SerialCallResponse | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| | | | | +| | | | For analogRead(), | | +| | | | use ADC pin name (A4 to A6) | | +| | | | instead the integer number | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | ReadASCIIString | | For analogWrite(), | | +| | | | use PWM capable pin | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | SerialEvent | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | SerialPassthrough | | | Serial options, Serial, | +| | | | | Serial1 or Serial2 | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | VirtualColorMixer | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Control | Arrays | | | +| +---------------------------+ +----------------------------------------------------+ +| | ForLoopIteration | | | +| +---------------------------+ +----------------------------------------------------+ +| | IfStatementConditional | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+ | For analogWrite(), +----------------------------------------------------+ +| | switchCase | | use PWM capable pin | | +| | | | | +| | | | | +| +---------------------------+ +----------------------------------------------------+ +| | switchCase2 | | | +| +---------------------------+ +----------------------------------------------------+ +| | WhileStatementConditional | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Display | barGraph | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | RowColumnScanning | | ADC pin used, up to 3.3V and can be | | +| | | | calibrated by using analogSet | | +| | | | (float gain, float offset). In line 41, | | +| | | | replace, pin 11 and pin 10 with | | +| | | | pin 1 and pin 0 respectively. | | +| | | | For “analogRead()”, use A4 and A5 | | +| | | | instead of A0 and A1. After line 101, | | +| | | | add delay(1); | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Strings | CharacterAnalysis | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringAdditionOperator | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringAppendOperator | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringCaseChanges | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringCharacters | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringComparisonOperators | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringIndexOf | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringLength | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringLengthTrim | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringReplace | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringStartsWithEndsWith | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringSubstring | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringToInt | | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ + diff --git a/source/amb25/Example_Guides/Basic/index.rst b/source/amb25/Example_Guides/Basic/index.rst new file mode 100644 index 0000000..428db90 --- /dev/null +++ b/source/amb25/Example_Guides/Basic/index.rst @@ -0,0 +1,7 @@ +Basic +===== + +.. toctree:: + :maxdepth: 1 + + Arduino-build-in example diff --git a/source/amb26/API_Documents/index.rst b/source/amb26/API_Documents/index.rst index 41d9749..fe9c8ea 100644 --- a/source/amb26/API_Documents/index.rst +++ b/source/amb26/API_Documents/index.rst @@ -7,5 +7,8 @@ API Documents Analog/index AudioCodec/index BLE/index + EPDIF/index + FatfsSDcard/index + FlashMemory/index OTA/index WiFi/index \ No newline at end of file diff --git a/source/amb26/Example_Guides/Basic/Arduino-build-in example.rst b/source/amb26/Example_Guides/Basic/Arduino-build-in example.rst new file mode 100644 index 0000000..b366c64 --- /dev/null +++ b/source/amb26/Example_Guides/Basic/Arduino-build-in example.rst @@ -0,0 +1,180 @@ +Arduino-build-in example +======================== + +.. contents:: + :local: + :depth: 2 + +AMB26 Supported ARDUINO built-in example table +---------------------------------------------- + +There are many built-in examples in Arduino. All examples that listed are compatible with Ameba. + +- `Arduino built-in example details `_ + ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| **Category** | **Name** | **Comment** | **Remarks** | ++===============+===========================+===============================================+====================================================+ +| Basics | AnalogReadSerial | | Connect potentiometer to 3.3V | | ADC pin options A4 (PB1), A5 (PB2), A6 (PB3). | +| | | | | +| | | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | ADC pin reading voltage range 0 to 3.3V | +| | | | analogSet(float gain, float offset) | | +| | | | | ADC value can be calibrated by | +| | | | | modifying _offset and _gain | +| | | | | using 2 points calibration method. | +| | | | | analogSet(float gain, float offset) | +| | | | | can be used to update the calibrated offset | +| | | | | and gain values | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | BareMinimum | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Blink | | LED_BUILTIN sets to | | +| | | | to any GPIO Pins | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | DigitalReadSerial | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Fade | | For analogWrite(), | | PWM capable Pin 2, 3, 5, 6, 7, 14, 15, 16, | +| | | | use PWM capable pin | | 17, 18, and 19 | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | ReadAnalogVoltage | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Digital | BlinkWithoutDelay | | LED_BUILTIN sets to | | +| | | | to any GPIO Pins | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Button | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Debounce | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | DigitalInputPullup | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StateChangeDetection | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | toneKeyboard | | ADC pin used, up to 3.3V | | +| +---------------------------+ | and can be calibrated by +----------------------------------------------------+ +| | toneMelody | | using analogSet(float gain, float offset) | | +| +---------------------------+ +----------------------------------------------------+ +| | toneMultiple | | For analogRead(), use ADC pin name | | +| +---------------------------+ | (A4 to A6) instead the integer number +----------------------------------------------------+ +| | tonePitchFollower | | | +| | | | For "tone()" and "noTone()", | | +| | | | use PWM capable pin | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Analog | AnalogInOutSerial | | ADC pin used, up to 3.3V | | +| +---------------------------+ | and can be calibrated by using +----------------------------------------------------+ +| | AnalogInput | | analogSet(float gain, float offset) | | +| +---------------------------+ +----------------------------------------------------+ +| | AnalogWriteMega | | For analogWrite(), | | +| +---------------------------+ | use PWM capable pin +----------------------------------------------------+ +| | Calibration | | | +| +---------------------------+ +----------------------------------------------------+ +| | Fading | | | +| +---------------------------+ +----------------------------------------------------+ +| | Smoothing | | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Communication | ASCIITable | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Dimmer | | For analogWrite(), | | +| | | | use PWM capable pin | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Graph | | Connect potentiometer to 3.3V | | +| | | | | +| | | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Midi | | Use Serial1, MIDI jack pin 5 | | +| | | | connected to SERIAL1_TX; | | +| | | | | +| | | | Use Serial2, MIDI jack pin 5 | | +| | | | connected to SERIAL2_TX; | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | MultiSerial | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | PhysicalPixel | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | SerialCallResponse | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| | | | | +| | | | For analogRead(), | | +| | | | use ADC pin name (A4 to A6) | | +| | | | instead the integer number | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | ReadASCIIString | | For analogWrite(), | | +| | | | use PWM capable pin | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | SerialEvent | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | SerialPassthrough | | | Serial options, Serial, | +| | | | | Serial1 or Serial2 | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | VirtualColorMixer | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Control | Arrays | | | +| +---------------------------+ +----------------------------------------------------+ +| | ForLoopIteration | | | +| +---------------------------+ +----------------------------------------------------+ +| | IfStatementConditional | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+ | For analogWrite(), +----------------------------------------------------+ +| | switchCase | | use PWM capable pin | | +| | | | | +| | | | | +| +---------------------------+ +----------------------------------------------------+ +| | switchCase2 | | | +| +---------------------------+ +----------------------------------------------------+ +| | WhileStatementConditional | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Display | barGraph | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | RowColumnScanning | | ADC pin used, up to 3.3V and can be | | +| | | | calibrated by using analogSet | | +| | | | (float gain, float offset). In line 41, | | +| | | | replace, pin 11 and pin 10 with | | +| | | | pin 1 and pin 0 respectively. | | +| | | | For “analogRead()”, use A4 and A5 | | +| | | | instead of A0 and A1. After line 101, | | +| | | | add delay(1); | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Strings | CharacterAnalysis | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringAdditionOperator | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringAppendOperator | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringCaseChanges | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringCharacters | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringComparisonOperators | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringIndexOf | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringLength | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringLengthTrim | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringReplace | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringStartsWithEndsWith | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringSubstring | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringToInt | | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ + diff --git a/source/amb26/Example_Guides/Basic/index.rst b/source/amb26/Example_Guides/Basic/index.rst new file mode 100644 index 0000000..428db90 --- /dev/null +++ b/source/amb26/Example_Guides/Basic/index.rst @@ -0,0 +1,7 @@ +Basic +===== + +.. toctree:: + :maxdepth: 1 + + Arduino-build-in example diff --git a/source/amebapro2/API_Documents/FlashMemory/Class FlashMemoryClass.rst b/source/amebapro2/API_Documents/FlashMemory/Class FlashMemoryClass.rst index 8d9b85a..6390542 100644 --- a/source/amebapro2/API_Documents/FlashMemory/Class FlashMemoryClass.rst +++ b/source/amebapro2/API_Documents/FlashMemory/Class FlashMemoryClass.rst @@ -133,6 +133,7 @@ Example: `ReadWriteWord `_ + ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| **Category** | **Name** | **Comment** | **Remarks** | ++===============+===========================+===============================================+====================================================+ +| Basics | AnalogReadSerial | | Connect potentiometer to 3.3V | | ADC pin options A0, A1, A2, A3, A4, A5, | +| | | | | | A6 and A7 | +| | | | ADC pin used, up to 3.3V | | | +| | | | and can be alibrated by using | | ADC pin reading voltage range 0 to 3.3V | +| | | | analogSet(float gain, float offset) | | | +| | | | | ADC value can be calibrated by | +| | | | | modifying _offset and _gain | +| | | | | using 2 points calibration method. | +| | | | | analogSet(float gain, float offset) | +| | | | | can be used to update the calibrated offset | +| | | | | and gain values | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | BareMinimum | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Blink | | LED_BUILTIN sets to | | LED options, on-board LED, LED_B (blue) | +| | | | LED_B (on-board LED blue) | | or LED_G (green) | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | DigitalReadSerial | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Fade | | For analogWrite(), | | PWM capable Pin 1, 2, 3, 4, 5, 6, 7, 8, | +| | | | use PWM capable pin | | and 23 (LED_B, for LED usage only) | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | ReadAnalogVoltage | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Digital | BlinkWithoutDelay | | LED_BUILTIN sets to | | LED options, on-board LED | +| | | | LED_B (on-board LED blue) | | Button options, on-board button | +| +---------------------------+-----------------------------------------------+ | +| | Button | | | +| +---------------------------+-----------------------------------------------+ | +| | Debounce | | | +| +---------------------------+-----------------------------------------------+ | +| | DigitalInputPullup | | | +| +---------------------------+-----------------------------------------------+ | +| | StateChangeDetection | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | toneKeyboard | | ADC pin used, up to 3.3V | | +| +---------------------------+ | and can be calibrated by +----------------------------------------------------+ +| | toneMelody | | using analogSet(float gain, float offset) | | +| +---------------------------+ +----------------------------------------------------+ +| | toneMultiple | | For analogRead(), use ADC pin name | | +| +---------------------------+ | (A0 to A7) instead the integer number +----------------------------------------------------+ +| | tonePitchFollower | | | +| | | | For "tone()" and "noTone()", | | +| | | | use PWM capable pin | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Analog | AnalogInOutSerial | | ADC pin used, up to 3.3V | | +| +---------------------------+ | and can be calibrated by using +----------------------------------------------------+ +| | AnalogInput | | analogSet(float gain, float offset) | | LED options, on-board LED | +| +---------------------------+ +----------------------------------------------------+ +| | AnalogWriteMega | | For analogWrite(), | | +| +---------------------------+ | use PWM capable pin +----------------------------------------------------+ +| | Calibration | | | +| +---------------------------+ +----------------------------------------------------+ +| | Fading | | | +| +---------------------------+ +----------------------------------------------------+ +| | Smoothing | | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Communication | ASCIITable | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Dimmer | | For analogWrite(), | | +| | | | use PWM capable pin | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Graph | | Connect potentiometer to 3.3V | | +| | | | | +| | | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Midi | | Use Serial1, MIDI jack pin 5 | | +| | | | connected to SERIAL1_TX | | +| | | | | +| | | | Use Serial2, MIDI jack pin 5 | | +| | | | connected to SERIAL2_TX | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | MultiSerial | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | PhysicalPixel | | | LED options, on-board LED | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | ReadASCIIString | | For analogWrite(), | | +| | | | use PWM capable pin | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | SerialCallResponse | | ADC pin used, up to 3.3V | | Modify code for processing software, | +| | | | and can be calibrated by using | | xpos = serialInArray[2]; | +| | | | analogSet(float gain, float offset) | | ypos = serialInArray[1]; | +| | | | | fgcolor = serialInArray[0]; | +| | | | For analogRead(), | | +| | | | use ADC pin name (A0 to A7) | | +| | | | instead the integer number | | +| | | | | +| | | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | SerialCallResponseASCII | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | SerialEvent | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | SerialPassthrough | | | Serial options, Serial, | +| | | | | Serial1 or Serial2 | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | VirtualColorMixer | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Control | Arrays | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | ForLoopIteration | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | IfStatementConditional | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | switchCase | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | switchCase2 | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | WhileStatementConditional | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| | | | | +| | | | For analogWrite(), | | +| | | | use PWM capable pin | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Display | barGraph | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | RowColumnScanning | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| | | | | +| | | | For analogRead(), use | | +| | | | A6 and A7 instead of | | +| | | | A0 and A1. After line 101, | | +| | | | add delay(1); | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Strings | CharacterAnalysis | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringAdditionOperator | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringAppendOperator | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringCaseChanges | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringCharacters | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringComparisonOperators | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringConstructors | | Select "Arduino_STD_PRINTF" from | | +| | | | Arduino IDE menu | | +| | | | "Tools/* Standard Lib Enable" | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringIndexOf | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringLength | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringLengthTrim | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringReplace | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringStartsWithEndsWith | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringSubstring | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringToInt | | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ + diff --git a/source/amebapro2/Example_Guides/Basic/index.rst b/source/amebapro2/Example_Guides/Basic/index.rst new file mode 100644 index 0000000..428db90 --- /dev/null +++ b/source/amebapro2/Example_Guides/Basic/index.rst @@ -0,0 +1,7 @@ +Basic +===== + +.. toctree:: + :maxdepth: 1 + + Arduino-build-in example diff --git a/source/aw-cu488/API_Documents/index.rst b/source/aw-cu488/API_Documents/index.rst index 41d9749..fe9c8ea 100644 --- a/source/aw-cu488/API_Documents/index.rst +++ b/source/aw-cu488/API_Documents/index.rst @@ -7,5 +7,8 @@ API Documents Analog/index AudioCodec/index BLE/index + EPDIF/index + FatfsSDcard/index + FlashMemory/index OTA/index WiFi/index \ No newline at end of file diff --git a/source/_common/Example_Guides/Basic/Arduino-build-in example.rst b/source/aw-cu488/Example_Guides/Basic/Arduino-build-in example.rst similarity index 90% rename from source/_common/Example_Guides/Basic/Arduino-build-in example.rst rename to source/aw-cu488/Example_Guides/Basic/Arduino-build-in example.rst index 6391efa..238e473 100644 --- a/source/_common/Example_Guides/Basic/Arduino-build-in example.rst +++ b/source/aw-cu488/Example_Guides/Basic/Arduino-build-in example.rst @@ -1,229 +1,176 @@ -Arduino-build-in example -======================== - -.. contents:: - :local: - :depth: 2 - -.. only:: amb21 - -AMB21 Supported ARDUINO built-in example table ----------------------------------------------- - -.. only:: end amb21 - -.. only:: amb23 - -AMB23 Supported ARDUINO built-in example table ----------------------------------------------- - -.. only:: end amb23 - -.. only:: amb25 - -AMB25 Supported ARDUINO built-in example table ----------------------------------------------- - -.. only:: end amb25 - -.. only:: amb26 - -AMB26 Supported ARDUINO built-in example table ----------------------------------------------- - -.. only:: end amb26 - -.. only:: bw16-typeb - -bw16 Supported ARDUINO built-in example table ---------------------------------------------- - -.. only:: end bw16-typeb - -.. only:: bw16-typec - -bw16 Type C Supported ARDUINO built-in example table ----------------------------------------------------- - -.. only:: end bw16-typec - -.. only:: aw-cu488 - -AW_CU488 Supported ARDUINO built-in example table -------------------------------------------------- - -.. only:: end aw-cu488 - -.. only:: amebapro2 - -AMB82-mini (RTL8735B) Supported ARDUINO built-in example table --------------------------------------------------------------- - -.. only:: end amebapro2 - -There are many built-in examples in Arduino. All examples that listed are compatible with Ameba. - -- `Arduino built-in example details `_ - -+---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ -| **Category** | **Name** | **Comment** | **Remarks** | -+===============+===========================+===============================================+====================================================+ -| Basics | AnalogReadSerial | | Connect potentiometer to 3.3V | | ADC pin options A0, A1, A2, A3, A4, A5, | -| | | | | | and A6 | -| | | | ADC pin used, up to 3.3V | | | -| | | | and can be calibrated by using | | ADC pin reading voltage range 0 to 3.3V | -| | | | analogSet(float gain, float offset) | | | -| | | | | ADC value can be calibrated by | -| | | | | modifying _offset and _gain | -| | | | | using 2 points calibration method. | -| | | | | analogSet(float gain, float offset) | -| | | | | can be used to update the calibrated offset | -| | | | | and gain values | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | BareMinimum | | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | Blink | | LED_BUILTIN sets to Pin 8. | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | DigitalReadSerial | | | Button options, on-board button, PUSH_BTN | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | Fade | | For analogWrite(), | | PWM capable Pin 8, 9, 10, 11, 12, 13, 16, 17, 18,| -| | | | use PWM capable pin | | 20, 21, 23, and 24 | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | ReadAnalogVoltage | | ADC pin used, up to 3.3V | | -| | | | and can be calibrated by using | | -| | | | analogSet(float gain, float offset) | | -+---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ -| Digital | BlinkWithoutDelay | | LED_BUILTIN sets to Pin 8. | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | Button | | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | Debounce | | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | DigitalInputPullup | | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | StateChangeDetection | | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | toneKeyboard | | ADC pin used, up to 3.3V | | -| +---------------------------+ | and can be calibrated by +----------------------------------------------------+ -| | toneMelody | | using analogSet(float gain, float offset) | | -| +---------------------------+ | +----------------------------------------------------+ -| | toneMultiple | | For analogRead(), use ADC pin name | | -| +---------------------------+ | (A0 to A6) instead the integer number +----------------------------------------------------+ -| | tonePitchFollower | | | | -| | | | For "tone()" and "noTone()", | | -| | | | use PWM capable pin | | -+---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ -| Analog | AnalogInOutSerial | | ADC pin used, up to 3.3V | | -| +---------------------------+ | and can be calibrated by using +----------------------------------------------------+ -| | AnalogInput | | analogSet(float gain, float offset) | | -| +---------------------------+ | +----------------------------------------------------+ -| | AnalogWriteMega | | For analogWrite(), | | -| +---------------------------+ | use PWM capable pin +----------------------------------------------------+ -| | Calibration | | | -| +---------------------------+ +----------------------------------------------------+ -| | Fading | | | -| +---------------------------+ +----------------------------------------------------+ -| | Smoothing | | | -+---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ -| Communication | ASCIITable | | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | Dimmer | | For analogWrite(), | | -| | | | use PWM capable pin | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | Graph | | Connect potentiometer to 3.3V | | -| | | | | | -| | | | ADC pin used, up to 3.3V | | -| | | | and can be calibrated by using | | -| | | | analogSet(float gain, float offset) | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | Midi | | Use Serial1, MIDI jack pin 5 | | -| | | | connected to SERIAL1_TX | | -| | | | | | -| | | | Use Serial2, MIDI jack pin 5 | | -| | | | connected to SERIAL2_TX | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | MultiSerial | | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | PhysicalPixel | | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | ReadASCIIString | | For analogWrite(), | | -| | | | use PWM capable pin | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | SerialCallResponse | | ADC pin used, up to 3.3V | | -| | | | and can be calibrated by using | | -| | | | analogSet(float gain, float offset) | | -| | | | | | -| | | | For analogRead(), | | -| | | | use ADC pin name (A0 to A6) | | -| | | | instead the integer number | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | SerialCallResponseASCII | | ADC pin used, up to 3.3V | | -| | | | and can be calibrated by using | | -| | | | analogSet(float gain, float offset) | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | SerialEvent | | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | SerialPassthrough | | | Serial options, Serial, | -| | | | | Serial1 or Serial2 | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | VirtualColorMixer | | ADC pin used, up to 3.3V | | -| | | | and can be calibrated by using | | -| | | | analogSet(float gain, float offset) | | -+---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ -| Control | Arrays | | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | ForLoopIteration | | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | IfStatementConditional | | ADC pin used, up to 3.3V | | -| | | | and can be calibrated by using | | -| | | | analogSet(float gain, float offset) | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | switchCase | | ADC pin used, up to 3.3V | | -| | | | and can be calibrated by using | | -| | | | analogSet(float gain, float offset) | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | switchCase2 | | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | WhileStatementConditional | | ADC pin used, up to 3.3V | | -| | | | and can be calibrated by using | | -| | | | analogSet(float gain, float offset) | | -| | | | | | -| | | | For analogWrite(), | | -| | | | use PWM capable pin | | -+---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ -| Display | barGraph | | ADC pin used, up to 3.3V | | -| | | | and can be calibrated by using | | -| | | | analogSet(float gain, float offset) | | -| +---------------------------+ +----------------------------------------------------+ -| | RowColumnScanning | | | -| | | | | -| | | | | -+---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ -| Strings | CharacterAnalysis | | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | StringAdditionOperator | | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | StringAppendOperator | | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | StringCaseChanges | | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | StringCharacters | | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | StringComparisonOperators | | ADC pin used, up to 3.3V | | -| | | | and can be calibrated by using | | -| | | | analogSet(float gain, float offset) | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | StringIndexOf | | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | StringLength | | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | StringLengthTrim | | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | StringReplace | | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | StringStartsWithEndsWith | | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | StringSubstring | | | -| +---------------------------+-----------------------------------------------+----------------------------------------------------+ -| | StringToInt | | | -+---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +Arduino-build-in example +======================== + +.. contents:: + :local: + :depth: 2 + +AW_CU488 Supported ARDUINO built-in example table +------------------------------------------------- + +There are many built-in examples in Arduino. All examples that listed are compatible with Ameba. + +- `Arduino built-in example details `_ + ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| **Category** | **Name** | **Comment** | **Remarks** | ++===============+===========================+===============================================+====================================================+ +| Basics | AnalogReadSerial | | Connect potentiometer to 3.3V | | ADC pin options A0, A1, A2, A3, A4, A5, | +| | | | | | and A6 | +| | | | ADC pin used, up to 3.3V | | | +| | | | and can be calibrated by using | | ADC pin reading voltage range 0 to 3.3V | +| | | | | | +| | | | | ADC value can be calibrated by | +| | | | | modifying _offset and _gain | +| | | | | using 2 points calibration method. | +| | | | | analogSet(float gain, float offset) | +| | | | | can be used to update the calibrated offset | +| | | | | and gain values | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | BareMinimum | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Blink | | LED_BUILTIN sets to | | +| | | | LED_B (on-board LED blue) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | DigitalReadSerial | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Fade | | For analogWrite(), | | PWM capable Pin 3, 4, 5, 6, 7, 8, 10, 11, 12, 14,| +| | | | use PWM capable pin | | 15, 17, and 26. | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | ReadAnalogVoltage | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Digital | BlinkWithoutDelay | | LED_BUILTIN sets to | | +| | | | LED_B (on-board LED blue) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Button | | | LED options, on-board LED, | +| +---------------------------+-----------------------------------------------+ | LED_BUILTIN (blue) | +| | Debounce | | | +| +---------------------------+-----------------------------------------------+ | +| | DigitalInputPullup | | | +| +---------------------------+-----------------------------------------------+ | +| | StateChangeDetection | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | toneKeyboard | | ADC pin used, up to 3.3V | | +| +---------------------------+ | and can be calibrated by +----------------------------------------------------+ +| | toneMelody | | using analogSet(float gain, float offset) | | +| +---------------------------+ | +----------------------------------------------------+ +| | toneMultiple | | For analogRead(), use ADC pin name | | +| +---------------------------+ | (A0 to A6) instead the integer number +----------------------------------------------------+ +| | tonePitchFollower | | | | +| | | | For "tone()" and "noTone()", | | +| | | | use PWM capable pin | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Analog | AnalogInOutSerial | | ADC pin used, up to 3.3V | | +| +---------------------------+ | and can be calibrated by using +----------------------------------------------------+ +| | AnalogInput | | analogSet(float gain, float offset) | | LED options, on-board LED | +| +---------------------------+ | +----------------------------------------------------+ +| | AnalogWriteMega | | For analogWrite(), | | +| +---------------------------+ | use PWM capable pin +----------------------------------------------------+ +| | Calibration | | | +| +---------------------------+ +----------------------------------------------------+ +| | Fading | | | +| +---------------------------+ +----------------------------------------------------+ +| | Smoothing | | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Communication | ASCIITable | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Dimmer | | For analogWrite(), | | +| | | | use PWM capable pin | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Graph | | Connect potentiometer to 3.3V | | +| | | | | | +| | | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Midi | | Use Serial1, MIDI jack pin 5 | | +| | | | connected to SERIAL1_TX | | +| | | | | | +| | | | Use Serial2, MIDI jack pin 5 | | +| | | | connected to SERIAL2_TX | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | MultiSerial | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | PhysicalPixel | | | LED options, on-board LED | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | ReadASCIIString | | For analogWrite(), | | +| | | | use PWM capable pin | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | SerialCallResponse | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| | | | | | +| | | | For analogRead(), | | +| | | | use ADC pin name (A0 to A6) | | +| | | | instead the integer number | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | SerialCallResponseASCII | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | SerialEvent | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | SerialPassthrough | | | Serial options, Serial, | +| | | | | Serial1 or Serial2 | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | VirtualColorMixer | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Control | Arrays | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | ForLoopIteration | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | IfStatementConditional | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | switchCase | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | switchCase2 | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | WhileStatementConditional | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Display | barGraph | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+ +----------------------------------------------------+ +| | RowColumnScanning | | | +| | | | | +| | | | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Strings | CharacterAnalysis | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringAdditionOperator | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringAppendOperator | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringCaseChanges | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringCharacters | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringComparisonOperators | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringIndexOf | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringLength | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringLengthTrim | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringReplace | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringStartsWithEndsWith | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringSubstring | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringToInt | | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ + diff --git a/source/aw-cu488/Example_Guides/Basic/index.rst b/source/aw-cu488/Example_Guides/Basic/index.rst new file mode 100644 index 0000000..428db90 --- /dev/null +++ b/source/aw-cu488/Example_Guides/Basic/index.rst @@ -0,0 +1,7 @@ +Basic +===== + +.. toctree:: + :maxdepth: 1 + + Arduino-build-in example diff --git a/source/bw16-typeb/API_Documents/index.rst b/source/bw16-typeb/API_Documents/index.rst index 41d9749..fe9c8ea 100644 --- a/source/bw16-typeb/API_Documents/index.rst +++ b/source/bw16-typeb/API_Documents/index.rst @@ -7,5 +7,8 @@ API Documents Analog/index AudioCodec/index BLE/index + EPDIF/index + FatfsSDcard/index + FlashMemory/index OTA/index WiFi/index \ No newline at end of file diff --git a/source/bw16-typeb/Example_Guides/Basic/Arduino-build-in example.rst b/source/bw16-typeb/Example_Guides/Basic/Arduino-build-in example.rst new file mode 100644 index 0000000..aebfec8 --- /dev/null +++ b/source/bw16-typeb/Example_Guides/Basic/Arduino-build-in example.rst @@ -0,0 +1,153 @@ +Arduino-build-in example +======================== + +.. contents:: + :local: + :depth: 2 + +bw16 Supported ARDUINO built-in example table +--------------------------------------------- + +There are many built-in examples in Arduino. All examples that listed are compatible with Ameba. + +- `Arduino built-in example details `_ + ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| **Category** | **Name** | **Comment** | **Remarks** | ++===============+===========================+===============================================+====================================================+ +| Basics | AnalogReadSerial | | Connect potentiometer to 3.3V | | ADC pin options A2 (PB3). | +| | | | | +| | | | ADC pin used, up to 3.3V | | +| | | | and can be alibrated by using | | ADC pin reading voltage range 0 to 3.3V | +| | | | analogSet(float gain, float offset) | | +| | | | | ADC value can be calibrated by | +| | | | | modifying _offset and _gain | +| | | | | using 2 points calibration method. | +| | | | | analogSet(float gain, float offset) | +| | | | | can be used to update the calibrated offset | +| | | | | and gain values | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | BareMinimum | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Blink | | LED_BUILTIN sets to | | LED options, on-board LED, LED_R (Red), | +| | | | LED_G (on-board LED blue) | | LED_B (Blue) or LED_G (Green). | +| | | | | LED_B and LED_G are PWM capable LED. | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | DigitalReadSerial | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Fade | | For “analogWrite()”, use PWM capable pin. | | PWM capable Pin 3, 7, 8, 11 and 12. | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | ReadAnalogVoltage | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Digital | BlinkWithoutDelay | | LED_BUILTIN sets to | LED options, on-board LED | +| | | | LED_B (on-board LED blue) | | +| +---------------------------+-----------------------------------------------+ | +| | Button | | | +| +---------------------------+ Replace any Pin that sets beyond Pin 0 to 12. | | +| | Debounce | | | +| +---------------------------+ | | +| | DigitalInputPullup | | | +| +---------------------------+ | | +| | StateChangeDetection | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | toneKeyboard | | ADC pin used, up to 3.3V | | +| +---------------------------+ | and can be calibrated by +----------------------------------------------------+ +| | toneMelody | | using analogSet(float gain, float offset) | | +| +---------------------------+ +----------------------------------------------------+ +| | toneMultiple | | For analogRead(), use ADC pin name | | +| +---------------------------+ | (A2) instead the integer number +----------------------------------------------------+ +| | tonePitchFollower | | | +| | | | For "tone()" and "noTone()", | | +| | | | use PWM capable pin | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Analog | AnalogInOutSerial | | ADC pin used, up to 3.3V | | LED options, on-board LED | +| +---------------------------+ | and can be calibrated by using | | LED_B and LED_G are PWM capable LED. | +| | AnalogInput | | analogSet(float gain, float offset) | | +| +---------------------------+ | | +| | AnalogWriteMega | | For analogWrite(), | | +| +---------------------------+ | use PWM capable pin | | +| | Calibration | | Replace any Pin that | | +| +---------------------------+ | sets beyond Pin 0 to 12. | | +| | Fading | | | +| +---------------------------+ | | +| | Smoothing | | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Communication | ASCIITable | | | LED options, on-board LED | +| +---------------------------+-----------------------------------------------+ | LED_B and LED_G are PWM capable LED. | +| | Dimmer | | For "analogWrite()", | | +| | | | use PWM capable pin. | | +| +---------------------------+-----------------------------------------------+ | +| | Graph | | Connect potentiometer to 3.3V | | +| | | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+ | +| | Midi | | Use Serial1, MIDI jack pin 5 | | +| | | | connected to SERIAL1_TX | | +| +---------------------------+-----------------------------------------------+ | +| | MultiSerial | Required external USB-to-UART module. | | +| +---------------------------+-----------------------------------------------+ | +| | PhysicalPixel | Replace any Pin that sets beyond Pin 0 to 12.| | +| +---------------------------+-----------------------------------------------+ | +| | ReadASCIIString | For analogWrite(), use PWM capable pin | | +| +---------------------------+-----------------------------------------------+ | +| | SerialEvent | | | +| +---------------------------+-----------------------------------------------+ | +| | SerialPassthrough | Required external USB-to-UART module. | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Control | Arrays | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | ForLoopIteration | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | IfStatementConditional | | ADC pin used, up to 3.3V | LED options, on-board LED. | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| | | | Replace any Pin that sets | | +| | | | beyond Pin 0 to 12. | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | switchCase | ADC pin used, up to 3.3V | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | switchCase2 | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | WhileStatementConditional | | ADC pin used, up to 3.3V | | LED options, on-board LED. | +| | | | and can be calibrated by using | | LED_B and LED_G are PWM capable LED. | +| | | | analogSet(float gain, float offset) | | +| | | | For analogWrite(), | | +| | | | use PWM capable pin | | +| | | | Replace any Pin that sets | | +| | | | beyond Pin 0 to 12. | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Display | barGraph | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Strings | CharacterAnalysis | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringAdditionOperator | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringAppendOperator | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringCaseChanges | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringCharacters | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringComparisonOperators | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringIndexOf | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringLength | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringLengthTrim | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringReplace | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringStartsWithEndsWith | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringSubstring | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringToInt | | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ diff --git a/source/bw16-typeb/Example_Guides/Basic/index.rst b/source/bw16-typeb/Example_Guides/Basic/index.rst new file mode 100644 index 0000000..428db90 --- /dev/null +++ b/source/bw16-typeb/Example_Guides/Basic/index.rst @@ -0,0 +1,7 @@ +Basic +===== + +.. toctree:: + :maxdepth: 1 + + Arduino-build-in example diff --git a/source/bw16-typec/API_Documents/index.rst b/source/bw16-typec/API_Documents/index.rst index 41d9749..fe9c8ea 100644 --- a/source/bw16-typec/API_Documents/index.rst +++ b/source/bw16-typec/API_Documents/index.rst @@ -7,5 +7,8 @@ API Documents Analog/index AudioCodec/index BLE/index + EPDIF/index + FatfsSDcard/index + FlashMemory/index OTA/index WiFi/index \ No newline at end of file diff --git a/source/bw16-typec/Example_Guides/Basic/Arduino-build-in example.rst b/source/bw16-typec/Example_Guides/Basic/Arduino-build-in example.rst new file mode 100644 index 0000000..fc8a01e --- /dev/null +++ b/source/bw16-typec/Example_Guides/Basic/Arduino-build-in example.rst @@ -0,0 +1,153 @@ +Arduino-build-in example +======================== + +.. contents:: + :local: + :depth: 2 + +bw16 Type C Supported ARDUINO built-in example table +---------------------------------------------------- + +There are many built-in examples in Arduino. All examples that listed are compatible with Ameba. + +- `Arduino built-in example details `_ + ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| **Category** | **Name** | **Comment** | **Remarks** | ++===============+===========================+===============================================+====================================================+ +| Basics | AnalogReadSerial | | Connect potentiometer to 3.3V | | ADC pin options A2 (PB3). | +| | | | | +| | | | ADC pin used, up to 3.3V | | +| | | | and can be alibrated by using | | ADC pin reading voltage range 0 to 3.3V | +| | | | analogSet(float gain, float offset) | | +| | | | | ADC value can be calibrated by | +| | | | | modifying _offset and _gain | +| | | | | using 2 points calibration method. | +| | | | | analogSet(float gain, float offset) | +| | | | | can be used to update the calibrated offset | +| | | | | and gain values | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | BareMinimum | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Blink | | LED_BUILTIN sets to | | LED options, on-board LED, LED_R (Red), | +| | | | LED_G (on-board LED blue) | | LED_B (Blue) or LED_G (Green). | +| | | | | LED_B and LED_G are PWM capable LED. | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | DigitalReadSerial | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | Fade | | For “analogWrite()”, use PWM capable pin. | | PWM capable Pin 3, 7, 8, 11 and 12. | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | ReadAnalogVoltage | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Digital | BlinkWithoutDelay | | LED_BUILTIN sets to | LED options, on-board LED | +| | | | LED_B (on-board LED blue) | | +| +---------------------------+-----------------------------------------------+ | +| | Button | | | +| +---------------------------+ Replace any Pin that sets beyond Pin 0 to 12. | | +| | Debounce | | | +| +---------------------------+ | | +| | DigitalInputPullup | | | +| +---------------------------+ | | +| | StateChangeDetection | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | toneKeyboard | | ADC pin used, up to 3.3V | | +| +---------------------------+ | and can be calibrated by +----------------------------------------------------+ +| | toneMelody | | using analogSet(float gain, float offset) | | +| +---------------------------+ +----------------------------------------------------+ +| | toneMultiple | | For analogRead(), use ADC pin name | | +| +---------------------------+ | (A2) instead the integer number +----------------------------------------------------+ +| | tonePitchFollower | | | +| | | | For "tone()" and "noTone()", | | +| | | | use PWM capable pin | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Analog | AnalogInOutSerial | | ADC pin used, up to 3.3V | | LED options, on-board LED | +| +---------------------------+ | and can be calibrated by using | | LED_B and LED_G are PWM capable LED. | +| | AnalogInput | | analogSet(float gain, float offset) | | +| +---------------------------+ | | +| | AnalogWriteMega | | For analogWrite(), | | +| +---------------------------+ | use PWM capable pin | | +| | Calibration | | Replace any Pin that | | +| +---------------------------+ | sets beyond Pin 0 to 12. | | +| | Fading | | | +| +---------------------------+ | | +| | Smoothing | | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Communication | ASCIITable | | | LED options, on-board LED | +| +---------------------------+-----------------------------------------------+ | LED_B and LED_G are PWM capable LED. | +| | Dimmer | | For "analogWrite()", | | +| | | | use PWM capable pin. | | +| +---------------------------+-----------------------------------------------+ | +| | Graph | | Connect potentiometer to 3.3V | | +| | | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+ | +| | Midi | | Use Serial1, MIDI jack pin 5 | | +| | | | connected to SERIAL1_TX | | +| +---------------------------+-----------------------------------------------+ | +| | MultiSerial | Required external USB-to-UART module. | | +| +---------------------------+-----------------------------------------------+ | +| | PhysicalPixel | Replace any Pin that sets beyond Pin 0 to 12.| | +| +---------------------------+-----------------------------------------------+ | +| | ReadASCIIString | For analogWrite(), use PWM capable pin | | +| +---------------------------+-----------------------------------------------+ | +| | SerialEvent | | | +| +---------------------------+-----------------------------------------------+ | +| | SerialPassthrough | Required external USB-to-UART module. | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Control | Arrays | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | ForLoopIteration | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | IfStatementConditional | | ADC pin used, up to 3.3V | LED options, on-board LED. | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| | | | Replace any Pin that sets | | +| | | | beyond Pin 0 to 12. | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | switchCase | ADC pin used, up to 3.3V | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | switchCase2 | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | WhileStatementConditional | | ADC pin used, up to 3.3V | | LED options, on-board LED. | +| | | | and can be calibrated by using | | LED_B and LED_G are PWM capable LED. | +| | | | analogSet(float gain, float offset) | | +| | | | For analogWrite(), | | +| | | | use PWM capable pin | | +| | | | Replace any Pin that sets | | +| | | | beyond Pin 0 to 12. | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Display | barGraph | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ +| Strings | CharacterAnalysis | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringAdditionOperator | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringAppendOperator | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringCaseChanges | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringCharacters | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringComparisonOperators | | ADC pin used, up to 3.3V | | +| | | | and can be calibrated by using | | +| | | | analogSet(float gain, float offset) | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringIndexOf | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringLength | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringLengthTrim | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringReplace | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringStartsWithEndsWith | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringSubstring | | | +| +---------------------------+-----------------------------------------------+----------------------------------------------------+ +| | StringToInt | | | ++---------------+---------------------------+-----------------------------------------------+----------------------------------------------------+ diff --git a/source/bw16-typec/Example_Guides/Basic/index.rst b/source/bw16-typec/Example_Guides/Basic/index.rst new file mode 100644 index 0000000..428db90 --- /dev/null +++ b/source/bw16-typec/Example_Guides/Basic/index.rst @@ -0,0 +1,7 @@ +Basic +===== + +.. toctree:: + :maxdepth: 1 + + Arduino-build-in example diff --git a/source/custom_script.py b/source/custom_script.py index 0774456..d223ac5 100644 --- a/source/custom_script.py +++ b/source/custom_script.py @@ -7,21 +7,26 @@ # Define board-specific mappings board_mappings = { - 'amb21': ['_common/Example_Guides/Basic', '_common/API_Documents/Analog', '_common/API_Documents/AudioCodec' - , '_common/API_Documents/BLE'], - 'amb23': ['_common/Example_Guides/Basic', '_common/API_Documents/Analog', '_common/API_Documents/AudioCodec' - , '_common/API_Documents/BLE'], - 'amb25': ['_common/Example_Guides/Basic', '_common/API_Documents/Analog', '_common/API_Documents/AudioCodec' - , '_common/API_Documents/BLE'], - 'amb26': ['_common/Example_Guides/Basic', '_common/API_Documents/Analog', '_common/API_Documents/AudioCodec' - , '_common/API_Documents/BLE'], - 'amebapro2': ['_common/Example_Guides/Basic'], - 'bw16-typeb': ['_common/Example_Guides/Basic', '_common/API_Documents/Analog', '_common/API_Documents/AudioCodec' - , '_common/API_Documents/BLE'], - 'aw-cu488': ['_common/Example_Guides/Basic', '_common/API_Documents/Analog', '_common/API_Documents/AudioCodec' - , '_common/API_Documents/BLE'], - 'bw16-typec': ['_common/Example_Guides/Basic', '_common/API_Documents/Analog', '_common/API_Documents/AudioCodec' - , '_common/API_Documents/BLE'], + 'amb21': ['_common/API_Documents/Analog', '_common/API_Documents/AudioCodec' + , '_common/API_Documents/BLE', '_common/Example_Guides/OTA', '_common/API_Documents/EPDIF', '_common/API_Documents/FatfsSDcard', '_common/API_Documents/FlashMemory'], + + 'amb23': ['_common/API_Documents/Analog', '_common/API_Documents/AudioCodec' + , '_common/API_Documents/BLE', '_common/Example_Guides/OTA', '_common/API_Documents/EPDIF', '_common/API_Documents/FatfsSDcard', '_common/API_Documents/FlashMemory'], + + 'amb25': ['_common/API_Documents/Analog', '_common/API_Documents/AudioCodec' + , '_common/API_Documents/BLE', '_common/Example_Guides/OTA', '_common/API_Documents/EPDIF', '_common/API_Documents/FatfsSDcard', '_common/API_Documents/FlashMemory'], + + 'amb26': ['_common/API_Documents/Analog', '_common/API_Documents/AudioCodec' + , '_common/API_Documents/BLE', '_common/Example_Guides/OTA', '_common/API_Documents/EPDIF', '_common/API_Documents/FatfsSDcard', '_common/API_Documents/FlashMemory'], + + 'bw16-typeb': ['_common/API_Documents/Analog', '_common/API_Documents/AudioCodec' + , '_common/API_Documents/BLE', '_common/Example_Guides/OTA', '_common/API_Documents/EPDIF', '_common/API_Documents/FatfsSDcard', '_common/API_Documents/FlashMemory'], + + 'aw-cu488': ['_common/API_Documents/Analog', '_common/API_Documents/AudioCodec' + , '_common/API_Documents/BLE', '_common/Example_Guides/OTA', '_common/API_Documents/EPDIF', '_common/API_Documents/FatfsSDcard', '_common/API_Documents/FlashMemory'], + + 'bw16-typec': ['_common/API_Documents/Analog', '_common/API_Documents/AudioCodec' + , '_common/API_Documents/BLE', '_common/Example_Guides/OTA', '_common/API_Documents/EPDIF', '_common/API_Documents/FatfsSDcard', '_common/API_Documents/FlashMemory'], } def create_folder(folder_name): diff --git a/source/index.rst b/source/index.rst index 5eb369f..1354f41 100644 --- a/source/index.rst +++ b/source/index.rst @@ -13,7 +13,7 @@ Welcome to Ameba Arduino Documentation! :maxdepth: 1 :caption: Ameba D EVBs: - AMB21 + AMB21/22 AMB23 AMB25 AMB26 @@ -29,7 +29,7 @@ Welcome to Ameba Arduino Documentation! .. tab:: Ameba D - `AMB21 `_ + `AMB21/22 `_ `AMB23 `_ From 51acbbfa934b2d86e6b7b6a598734c750c6dc74e Mon Sep 17 00:00:00 2001 From: yuenkaifai Date: Fri, 7 Feb 2025 16:41:36 +0800 Subject: [PATCH 2/3] Correct the spell errors --- source/_common/API_Documents/FatfsSDcard/Class SdFatFile.rst | 2 +- .../API_Documents/FlashMemory/Class FlashMemoryClass.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/_common/API_Documents/FatfsSDcard/Class SdFatFile.rst b/source/_common/API_Documents/FatfsSDcard/Class SdFatFile.rst index db84688..6893937 100644 --- a/source/_common/API_Documents/FatfsSDcard/Class SdFatFile.rst +++ b/source/_common/API_Documents/FatfsSDcard/Class SdFatFile.rst @@ -37,7 +37,7 @@ Defines a class of SD FAT File. |SdFatFile::read | Read content (1 byte or bytes) from | | | the file | +-----------------------+-------------------------------------------+ -|SdFatFile::peek | Read 1 byte from file without move curser | +|SdFatFile::peek | Read 1 byte from file without move cursor | +-----------------------+-------------------------------------------+ |SdFatFile::available | Check if the cursor is at EOF | | | (End-Of-File) | diff --git a/source/_common/API_Documents/FlashMemory/Class FlashMemoryClass.rst b/source/_common/API_Documents/FlashMemory/Class FlashMemoryClass.rst index cd83bb1..8ff7240 100644 --- a/source/_common/API_Documents/FlashMemory/Class FlashMemoryClass.rst +++ b/source/_common/API_Documents/FlashMemory/Class FlashMemoryClass.rst @@ -215,7 +215,7 @@ Example: `ReadWriteOneWord Date: Fri, 7 Feb 2025 17:14:42 +0800 Subject: [PATCH 3/3] Update spell_check.yml To ignore spelling error for "datas" --- .github/workflows/spell_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spell_check.yml b/.github/workflows/spell_check.yml index a24ff20..f8675c3 100644 --- a/.github/workflows/spell_check.yml +++ b/.github/workflows/spell_check.yml @@ -21,6 +21,6 @@ jobs: uses: codespell-project/actions-codespell@v2 with: #skip: Arduino_package/hardware/libraries/NeuralNetwork/examples/AudioClassification/AudioClassList.h,Arduino_package/hardware/libraries/USB/src/usbd_uvc_parm.c,Arduino_package/hardware/libraries/SPI/src/JPEGDEC_Libraries/jpeg.inl - ignore_words_list: ameba + ignore_words_list: ameba,datas # ignore_words_file: .codespellignore path: ${{ matrix.path }}