From 47f73269bbf24aeabeacd5190d64133f46372525 Mon Sep 17 00:00:00 2001 From: Arsen6331 Date: Wed, 24 Nov 2021 22:22:04 +0000 Subject: Add BLE FS docs link to BLE docs --- doc/ble.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'doc/ble.md') diff --git a/doc/ble.md b/doc/ble.md index 8573166f..c36fa62b 100644 --- a/doc/ble.md +++ b/doc/ble.md @@ -9,6 +9,7 @@ This page describes the BLE implementation and API built in this firmware. ### Table of Contents - [BLE Connection](#ble-connection) +- [BLE FS](#ble-fs) - [BLE UUIDs](#ble-uuids) - [BLE Services](#ble-services) - [CTS](#cts) @@ -51,6 +52,13 @@ If **CTS** is detected, it'll request the current time to the companion applicat --- +## BLE FS + +The documentation for BLE FS can be found here: +[BLEFS.md](./BLEFS.md) + +--- + ## BLE UUIDs When possible, InfiniTime tries to implement BLE services defined by the BLE specification. @@ -285,4 +293,4 @@ This characteristic expects a particular format: - Microsecond divided by `1e6*256` (`uint8`) - Binary 0001 (`uint8`) -Write all of these together, encoded as little-endian, to the current time characteristic. \ No newline at end of file +Write all of these together, encoded as little-endian, to the current time characteristic. -- cgit v1.2.3-70-g09d2 From 3eebe66d659c9c8e72a7c355973c74c2b8899174 Mon Sep 17 00:00:00 2001 From: Avamander Date: Sat, 4 Dec 2021 17:12:34 +0200 Subject: Updated docs and renamed functions for consistency --- doc/ble.md | 18 +++++++++++------- src/components/ble/weather/WeatherService.cpp | 4 ++-- src/components/ble/weather/WeatherService.h | 11 +++++++---- 3 files changed, 20 insertions(+), 13 deletions(-) (limited to 'doc/ble.md') diff --git a/doc/ble.md b/doc/ble.md index 8573166f..2b86243e 100644 --- a/doc/ble.md +++ b/doc/ble.md @@ -2,7 +2,7 @@ ## Introduction This page describes the BLE implementation and API built in this firmware. -**Note** : I'm a beginner in BLE related technologies and the information in this document reflects my current knowledge and understanding of the BLE stack. This information might be erroneous or incomplete. Feel free to submit a PR if you think you can improve it. +**Note**: I'm a beginner in BLE related technologies and the information in this document reflects my current knowledge and understanding of the BLE stack. This information might be erroneous or incomplete. Feel free to submit a PR if you think you can improve it. --- @@ -72,12 +72,16 @@ The following custom services are implemented in InfiniTime: * [Navigation Service](NavigationService.md) : 00010000-78fc-48fe-8e23-433b3a1942d0 - - Since InfiniTime 0.13 - * Call characteristic (extension to the Alert Notification Service): 00020001-78fc-48fe-8e23-433b3a1942d0 - - - - Since InfiniTime 1.7: - * [Motion Service](MotionService.md) : 00030000-78fc-48fe-8e23-433b3a1942d0 +- Since InfiniTime 0.13 + * Call characteristic (extension to the Alert Notification Service): 00020001-78fc-48fe-8e23-433b3a1942d0 + + +- Since InfiniTime 1.7: + * [Motion Service](MotionService.md): 00030000-78fc-48fe-8e23-433b3a1942d0 + + +- Since InfiniTime 1.8: + * [Weather Service](/src/components/ble/weather/WeatherService.h): 00040000-78fc-48fe-8e23-433b3a1942d0 --- diff --git a/src/components/ble/weather/WeatherService.cpp b/src/components/ble/weather/WeatherService.cpp index f3be35f2..23f53b74 100644 --- a/src/components/ble/weather/WeatherService.cpp +++ b/src/components/ble/weather/WeatherService.cpp @@ -550,7 +550,7 @@ namespace Pinetime { return std::chrono::duration_cast(dateTimeController.CurrentDateTime().time_since_epoch()).count(); } - int16_t WeatherService::getTodayMinTemp() const { + int16_t WeatherService::GetTodayMinTemp() const { uint64_t currentTimestamp = GetCurrentUnixTimestamp(); uint64_t currentDayEnd = currentTimestamp - ((24 - dateTimeController.Hours()) * 60 * 60) - ((60 - dateTimeController.Minutes()) * 60) - (60 - dateTimeController.Seconds()); @@ -573,7 +573,7 @@ namespace Pinetime { return result; } - int16_t WeatherService::getTodayMaxTemp() const { + int16_t WeatherService::GetTodayMaxTemp() const { uint64_t currentTimestamp = GetCurrentUnixTimestamp(); uint64_t currentDayEnd = currentTimestamp - ((24 - dateTimeController.Hours()) * 60 * 60) - ((60 - dateTimeController.Minutes()) * 60) - (60 - dateTimeController.Seconds()); diff --git a/src/components/ble/weather/WeatherService.h b/src/components/ble/weather/WeatherService.h index a9f02b16..eca70cbd 100644 --- a/src/components/ble/weather/WeatherService.h +++ b/src/components/ble/weather/WeatherService.h @@ -64,14 +64,14 @@ namespace Pinetime { /** * Searches for the current day's maximum temperature - * @return -32768 if there's no data, degrees celcius times 100 otherwise + * @return -32768 if there's no data, degrees Celsius times 100 otherwise */ - int16_t getTodayMaxTemp() const; + int16_t GetTodayMaxTemp() const; /** * Searches for the current day's minimum temperature - * @return -32768 if there's no data, degrees celcius times 100 otherwise + * @return -32768 if there's no data, degrees Celsius times 100 otherwise */ - int16_t getTodayMinTemp() const; + int16_t GetTodayMinTemp() const; /* * Management functions @@ -163,6 +163,9 @@ namespace Pinetime { */ static bool IsEventStillValid(const std::unique_ptr& uniquePtr, const uint64_t timestamp); + /** + * This is a helper function that closes a QCBOR map and decoding context cleanly + */ void CleanUpQcbor(QCBORDecodeContext* decodeContext); }; } -- cgit v1.2.3-70-g09d2 From 90352af626cc0087143e824f62f5dcee9f58f29c Mon Sep 17 00:00:00 2001 From: Eli Weiss Date: Thu, 2 Dec 2021 14:50:59 -0600 Subject: Improved documentation readability Improved documentation readability by rephrasing confusing sentences. Added Sitronix ST7789V datasheet link to SPI-LCD-driver.md for easier reference. --- doc/NavigationService.md | 4 ++-- doc/PinetimeStubWithNrf52DK.md | 12 ++++++------ doc/SPI-LCD-driver.md | 2 +- doc/SWD.md | 4 ++-- doc/ble.md | 4 ++-- doc/branches.md | 2 +- doc/openOCD.md | 10 +++++----- 7 files changed, 19 insertions(+), 19 deletions(-) (limited to 'doc/ble.md') diff --git a/doc/NavigationService.md b/doc/NavigationService.md index fd81d0bf..b24a03b7 100644 --- a/doc/NavigationService.md +++ b/doc/NavigationService.md @@ -1,6 +1,6 @@ # Navigation Service ## Introduction -The navigation ble service provides 4 characteristics to allow the the watch to display navigation instructions from a companion application. The intended purpose is when performing some outdoor activities, for example running or cycling. +The navigation ble service provides 4 characteristics to allow the the watch to display navigation instructions from a companion application. This service is intended to be used when performing some outdoor activities, for example running or cycling. The 4 characteristics are: flag (string) - Upcoming icon name @@ -22,7 +22,7 @@ This is a client supplied string describing the upcoming instruction such as "At This is a short string describing the distance to the upcoming instruction such as "50 m". ## Progress (UUID 00010004-78fc-48fe-8e23-433b3a1942d0) -The percent complete in a uint8. The watch displays this as an overall progress in a progress bar. +The percent complete in a uint8. The watch displays this as an overall progress in a progress bar. ## Full icon list * arrive diff --git a/doc/PinetimeStubWithNrf52DK.md b/doc/PinetimeStubWithNrf52DK.md index c4857921..e85bd554 100644 --- a/doc/PinetimeStubWithNrf52DK.md +++ b/doc/PinetimeStubWithNrf52DK.md @@ -1,11 +1,11 @@ # Build a stub for PineTime using NRF52-DK -[NRF52-DK](https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52-DK) is the official developpment kit for NRF52832 SoC from Nordic Semiconductor. +[NRF52-DK](https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52-DK) is the official developpment kit for the NRF52832 SoC from Nordic Semiconductor used in the PineTime. -It can be very useful for PineTime development: - * You can use it embedded JLink SWD programmer/debugger to program and debug you code on the PineTime - * As it's based on the same SoC than the PineTime, you can program it to actually run the same code than the PineTime. +This development kit can be very useful for PineTime development: + * You can use its embedded JLink SWD programmer/debugger to program and debug your code on the PineTime + * As it's based on the same SoC than the PineTime, you can program it to actually run the same code as the PineTime. -This page is about the 2nd point : we will build a stub that will allow us to run the same code than the one you could run on the PineTime. This will allow you to work more easily if you don't have a PineTime dev kit around, if you don't want to modify your dev kit for SWD programming, or if you want to use some feature from the DK (like power measurement). +This page is about the 2nd point : we will build a stub that will allow us to run the same code you can run on the PineTime. This will allow you to work more easily if you don't have a PineTime dev kit around, if you don't want to modify your dev kit for SWD programming, or if you want to use some feature from the NRF52-DK (like power measurement). This stub only implements the display, the button and the BLE radio. The other features from the pintime are missing: * heart rate sensor @@ -41,7 +41,7 @@ You just need to make the following connections: | P0.13 | Button IN (D3 in my case) | | GND | GND | -You also need to enable the I/O expander to disconnect pins from buttons and led on the NRF52-DK and leave them available on the pin headers: +You also need to enable the I/O expander to disconnect pins from the buttons and LED on the NRF52-DK and leave them available on the pin headers: | NRF52 -DK | NRF52- DK | | --------- | --------- | diff --git a/doc/SPI-LCD-driver.md b/doc/SPI-LCD-driver.md index f787aab7..29f3bbfa 100644 --- a/doc/SPI-LCD-driver.md +++ b/doc/SPI-LCD-driver.md @@ -1,6 +1,6 @@ # The SPI LCD driver ## Introduction -The LCD controller that drive the display of the Pinetime is the Sitronix ST7789V. This controller is easy to integrate with an MCU thanks to its SPI interface, and has some interesting features like: +The LCD controller that drives the display of the Pinetime is the [Sitronix ST7789V](https://wiki.pine64.org/images/5/54/ST7789V_v1.6.pdf). This controller is easy to integrate with an MCU thanks to its SPI interface, and has some interesting features like: - an on-chip display data RAM that can store the whole framebuffer - partial screen update - hardware assisted vertical scrolling diff --git a/doc/SWD.md b/doc/SWD.md index 4146e6ae..668eaa5c 100644 --- a/doc/SWD.md +++ b/doc/SWD.md @@ -4,9 +4,9 @@ Download the files **bootloader.bin**, **image-x.y.z.bin** and **pinetime-graphi ![Image file](imageFile.png) The bootloader reads a boot logo from the external SPI flash memory. The first step consists of flashing a tool in the MCU that will flash the boot logo into this SPI flash memory. This first step is optional but recommended (the bootloader will display garbage on screen for a few second if you don't do it). -Using your SWD tool, flash **pinetime-graphics-x.y.z.bin** at offset **0x0000**. Reset the MCU and wait for a few second, until the logo is completely drawn on the display. +Using your SWD tool, flash **pinetime-graphics-x.y.z.bin** at offset **0x0000**. Reset the MCU and wait for a few seconds until the logo is completely drawn on the display. -Then, using your SWD tool, flash those file at specific offset: +Then, using your SWD tool. Flash those file at specific offset: - bootloader.bin : **0x0000** - image-x.y.z.bin : **0x8000** diff --git a/doc/ble.md b/doc/ble.md index 314097d7..d2502636 100644 --- a/doc/ble.md +++ b/doc/ble.md @@ -120,11 +120,11 @@ Reading a value from the firmware version characteristic will yield a UTF-8 enco #### Battery Level -Reading from the battery level characteristic yields a single byte of data. This byte can be converted to an unsigned 8-bit integer which will be the battery percentage. This characteristic allows notify for updates as the value changes. +Reading from the battery level characteristic yields a single byte of data. This byte can be converted to an unsigned 8-bit integer which will be the battery percentage. This characteristic allows notifications for updates as the value changes. #### Heart Rate -Reading from the heart rate characteristic yields two bytes of data. I am not sure of the function of the first byte. It appears to always be zero. The second byte can be converted to an unsigned 8-bit integer which is the current heart rate. This characteristic also allows notify for updates as the value changes. +Reading from the heart rate characteristic yields two bytes of data. I am not sure of the function of the first byte. It appears to always be zero. The second byte can be converted to an unsigned 8-bit integer which is the current heart rate. This characteristic also allows notifications for updates as the value changes. --- diff --git a/doc/branches.md b/doc/branches.md index ef280f40..b06c10cc 100644 --- a/doc/branches.md +++ b/doc/branches.md @@ -9,4 +9,4 @@ New features should be implemented in **feature branches** created from **develo To release a new version of the application, when develop is considered stable, a **release** branch is created from **develop**. This can be considered as a *release candidate* branch. When everything is OK, this release branch is merged into **master** and the release is generated (a tag is applied to git, the release note is finalized, binaries are built,...) from **master**. -Git flow also supports the creation of **hotfix** branches when a bug is discovered in a released version. The **hotfix** branch is created from **master** and will be used only to implement a fix to this bug. Multiple hotfix branches can be created for the same release if more than one bugs are discovered. \ No newline at end of file +Git flow also supports the creation of **hotfix** branches when a bug is discovered in a released version. The **hotfix** branch is created from **master** and will be used only to implement a fix to this bug. Multiple hotfix branches can be created for the same release if multiple bugs are discovered. \ No newline at end of file diff --git a/doc/openOCD.md b/doc/openOCD.md index b3661cee..a7386e34 100644 --- a/doc/openOCD.md +++ b/doc/openOCD.md @@ -1,12 +1,12 @@ # OpenOCD and STLink OpenOCD (**Open O**n **C**hip **D**ebugger) is an open source tool that interfaces with many SWD/JTAG debugger to provide debugging and *in-system* programming for embedded target devices. -It supports the **NRF52** (the CPU of the PineTime) and the **STLinkV2**, a cheap SWD debugger. +OpenOCD supports the **NRF52** (the CPU of the PineTime) and the **STLinkV2**, a cheap SWD debugger. -It works on X86 computers, as well as ARM/ARM64 computers and SBC (like the RaspberryPi and Pine64 Pinebook Pro) ! +OpenOCD works on X86 computers, ARM/ARM64 computers, and SBCs (like the RaspberryPi and Pine64 Pinebook Pro)! ## Installation -We will build OpenOCD from sources, as packages from Linux distributions are most of the time outdated and do not support the NRF52 correctly. +We will build OpenOCD from sources, as packages from Linux distributions are often outdated and do not support the NRF52 correctly. - Fetch the sources from GIT, and build and install it: @@ -27,7 +27,7 @@ sudo cp contrib/60-openocd.rules /etc/udev/rules.d/ sudo udevadm control --reload-rules ``` - - You can now plug your STLinkV2 in a USB port and run OpenOCD to see if it's working correctly: + - You can now plug your STLinkV2 into a USB port and run OpenOCD to see if it's working correctly: ``` $ openocd -f interface/stlink.cfg -f target/nrf52.cfg @@ -63,7 +63,7 @@ gdb_breakpoint_override hard source [find target/nrf52.cfg] ``` -This file specifies to OpenOCD which debugger and target it will be connected to.. +This file specifies to OpenOCD which debugger and target it will be connected to. Then, we use various *user files* to use OpenOCD to flash InfiniTime binary files. -- cgit v1.2.3-70-g09d2