Skip to content

Commit 457cab8

Browse files
committed
Add implementation of HEARTBEAT register
1 parent 555fc51 commit 457cab8

File tree

1 file changed

+56
-2
lines changed

1 file changed

+56
-2
lines changed

Device.md

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<img src="./assets/HarpLogo.svg" width="200">
1+
<img src="./assets/HarpLogo.svg" width="200">
22

33
# Common Registers and Operation (Device 1.2)
44

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

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.
228+
* **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. Although this is an optional feature, it’s strongly recommended to be implemented.
229229

230230

231231

@@ -429,6 +429,59 @@ Address: `017`
429429

430430
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.
431431

432+
#### **`R_HEARTBEAT` (U16) – Heartbeat register reporting the current status of the device**
433+
434+
Address: `018`
435+
436+
```mermaid
437+
---
438+
displayMode: compact
439+
---
440+
gantt
441+
title R_HEARTBEAT (018)
442+
dateFormat X
443+
axisFormat %
444+
445+
section Bit
446+
15 :bit15, 0, 1
447+
14 :bit14, after bit15 , 2
448+
13 :bit13, after bit14 , 3
449+
12 :bit12, after bit13 , 4
450+
11 :bit11, after bit12 , 5
451+
10 :bit10, after bit11 , 6
452+
9 :bit9, after bit10 , 7
453+
9 :bit8, after bit9 , 8
454+
7 :bit7, after bit8 , 9
455+
6 :bit6, after bit7 , 10
456+
5 :bit5, after bit6 , 11
457+
4 :bit4, after bit5 , 12
458+
3 :bit3, after bit4 , 13
459+
2 :bit2, after bit3 , 14
460+
1 :bit1, after bit2 , 15
461+
0 :bit0, after bit1 , 16
462+
463+
section Id
464+
IS_ACTIVE :id0, 15, 16
465+
IS_ERROR_STATE :id1, 14, 15
466+
IS_SYNCHRONIZED :id2, 13, 14
467+
468+
section Default
469+
- :d7, 15, 16
470+
- :d6, 14 , 15
471+
- :d5, 13 , 14
472+
```
473+
474+
> **Note**
475+
>
476+
> 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, aligned to when the `R_TIMESTAMP_SECOND` register is updated. The status of the device is given by the following bits:
477+
478+
479+
* **IS_ACTIVE [Bit 0]:** If 1, the device will be in Active Mode. Any other modes will be coded as 0. (See `R_OPERATION_CTRL` bit `OP_MODE` for more information).
480+
481+
* **IS_ERROR_STATE [Bit 1]:** This bit will be read as 1 if the device is in an error state. The implementation of an error state is expected largely implementation specific, however this state should be entered when the device is in a state where it cannot recover without manual intervention.
482+
483+
* **IS_SYNCHRONIZED [Bit 3]:** If set to 1, the device is synchronized with the Harp Synchronization Clock. If the device is a clock generator (see `R_CLOCK_CONFIG` bit `CLK_GEN`), by definition, this bit will always be set to 1.
484+
432485

433486
## Release notes:
434487

@@ -488,4 +541,5 @@ An array of 8 bytes that can be used to store a tag for a specific firmware vers
488541
* Add new `Tag` register.
489542

490543
- v1.12.0
544+
* Add heartbeat register providing status information
491545
* Fix typo in `OPERATION_CTRL` register data type (U16 -> U8)

0 commit comments

Comments
 (0)