Skip to content

Commit 55342cf

Browse files
authored
Merge pull request #45 from harp-tech/8-add-a-bit-flag-to-heartbeat-with-synchronization-flag
Add hearbeat register
2 parents e131f8a + 9abef7c commit 55342cf

File tree

1 file changed

+48
-2
lines changed

1 file changed

+48
-2
lines changed

Device.md

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ As an application example, devices using USB as the transport layer can poll for
5050
|R\_TIMESTAMP\_OFFSET|No|No|U8|015|b)|Adds an offset if user updates the Timestamp|Optional|
5151
|R\_UID|No|Yes|U8|016|b)|Stores a unique identifier (UID) |Optional|
5252
|R\_TAG|-|Yes|U8|017|b)|Firmware tag|Optional|
53+
|R\_HEARTBEAT|Yes|Yes|U16|018|b)|Provides information about the state of the device|Yes|
5354

5455
||a) These values are stored during factory process and are persistent, i.e., they cannot be changed by the user.<br>b) Check register notes on the specific register explanation<br>c) Only parts of the functionality is mandatory. Check register notes on the explanation.|
5556
| :- | :- |
@@ -145,7 +146,7 @@ gantt
145146
```
146147

147148

148-
#### **`R_OPERATION_CTRL` (U16) – Operation mode configuration**
149+
#### **`R_OPERATION_CTRL` (U8) – Operation mode configuration**
149150

150151
Address: `010`
151152

@@ -225,7 +226,7 @@ a) Standby Mode and Active Mode are mandatory. Speed Mode is optional.
225226
| 1 | Speed Mode. |
226227
| 0.1 | A critical error occurred. Only a hardware reset or a new power up can remove the device from this Mode. |
227228

228-
* **ALIVE_EN [Bit 7]:** If set to 1, the device sends an `Event` Message with the `R_TIMESTAMP_SECONDS` content each second (i.e. Heartbeat). This allows the host to check that the device is alive. Although this is an optional feature, it’s strongly recommended to be implemented.
229+
* **ALIVE_EN [Bit 7]:** If set to 1, the device sends an `Event` Message with the `R_HEARTBEAT` content each second. This allows the host to check the status of the device periodically. This is a required feature.
229230

230231

231232

@@ -429,6 +430,47 @@ Address: `017`
429430

430431
An array of 8 bytes that can be used to store a tag for a specific firmware version. For instance, it could be used to store the git hash of a specific release/commit. If not used, all bytes should be set to 0. The byte-order is little-endian.
431432

433+
#### **`R_HEARTBEAT` (U16) – Heartbeat register reporting the current status of the device**
434+
435+
Address: `018`
436+
437+
```mermaid
438+
---
439+
displayMode: compact
440+
---
441+
gantt
442+
title R_HEARTBEAT (018)
443+
dateFormat X
444+
axisFormat %
445+
446+
section Bit
447+
15-2 :reserved, 0, 1
448+
1 :bit1, 1, 2
449+
0 :bit0, 2, 3
450+
451+
section Id
452+
- :idr, 0, 1
453+
IS_ACTIVE :id0, 1, 2
454+
IS_SYNCHRONIZED :id1, 2, 3
455+
456+
section Default
457+
- :dr, 0, 1
458+
- :d7, 1, 2
459+
- :d6, 2, 3
460+
```
461+
462+
> **Note**
463+
>
464+
> This register is read-only and is used to provide status information about the device. The bits are set by the device and sent through a period event. If enabled (via `R_OPERATION_CTRL` bit `ALIVE_EN`), the event will be periodically emitted at a rate of 1Hz, triggered by updates to the `R_TIMESTAMP_SECOND` register.
465+
466+
467+
The status of the device is given by the following bits:
468+
469+
470+
* **IS_STANDBY [Bit 0]:** If 1, the device will be in Standby Mode. Any other modes will be coded as 0. (See `R_OPERATION_CTRL` bit `OP_MODE` for more information).
471+
472+
* **IS_SYNCHRONIZED [Bit 1]:** If set to 1, the device is synchronized with an external Harp clock generator. If the device is itself a clock generator (see `R_CLOCK_CONFIG` bit `CLK_GEN`), by definition, this bit will always be set to 1.
473+
432474

433475
## Release notes:
434476

@@ -486,3 +528,7 @@ An array of 8 bytes that can be used to store a tag for a specific firmware vers
486528

487529
- v1.11.0
488530
* Add new `Tag` register.
531+
532+
- v1.12.0
533+
* Add heartbeat register providing status information
534+
* Fix typo in `OPERATION_CTRL` register data type (U16 -> U8)

0 commit comments

Comments
 (0)