Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ jobs:
# for it already exist in this repo.
#
# Built as a universal binary (x86_64 + arm64) so a single download runs on
# both Intel and Apple Silicon Macs. The deployment target is 10.15, so Intel
# support reaches back to Catalina.
# both Intel and Apple Silicon Macs. The deployment target is 12.0, so Intel
# support reaches back to Monterey.
macos:
name: macOS universal
needs: version
Expand Down Expand Up @@ -331,6 +331,9 @@ jobs:
with:
generate_release_notes: true
fail_on_unmatched_files: true
# A tag like v3.4.0-rc1 must stay out of /releases/latest, which is
# what the in-app update check reads.
prerelease: ${{ contains(github.ref_name, '-') }}
files: |
release/OpenView-linux-x64.zip
release/OpenView-linux-arm64.zip
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Three transports, gated per board — the app only offers what the board actuall
| ADS1292R · ADS1293 · AFE4490 | ✅ | — | — |
| MAX30001 · MAX30003 · MAX86150 | ✅ | — | — |
| Pulse Express · TinyGSR | ✅ | — | — |
| [easyEMG](https://protocentral.com/product/easyemg-surface-emg-breakout-qwiic/) · easyECG | ✅ | — | — |
| [ST1VAFE3BX](https://protocentral.com/product/protocentral-st1vafe3bx-breakout-kit/) | ✅ | — | — |
| TMF8829 dToF (depth map) | ✅ | — | — |

Expand Down
8 changes: 8 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
analyzer:
exclude:
- build/**
- android/**
- ios/**
- windows/**
- macos/**
- linux/**
include: package:flutter_lints/flutter.yaml

linter:
Expand Down
3 changes: 3 additions & 0 deletions lib/boards/board_descriptor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import 'channel_spec.dart';
import 'matrix_spec.dart';
import 'metric_spec.dart';
import 'packet_spec.dart';
import 'transport_profile.dart';

Expand All @@ -21,6 +22,7 @@ class BoardDescriptor {
final List<MatrixSpec> matrices;
final List<PacketSpec> packets;
final List<CommandSpec> commands;
final List<MetricSpec> metrics;
final String notes;

const BoardDescriptor({
Expand All @@ -34,6 +36,7 @@ class BoardDescriptor {
this.matrices = const [],
this.packets = const [],
this.commands = const [],
this.metrics = const [],
this.notes = '',
});

Expand Down
4 changes: 4 additions & 0 deletions lib/boards/board_registry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import 'board_descriptor.dart';
import 'descriptors/ads1292r.dart';
import 'descriptors/ads1293.dart';
import 'descriptors/afe4490.dart';
import 'descriptors/easyecg.dart';
import 'descriptors/easyemg.dart';
import 'descriptors/healthypi.dart';
import 'descriptors/max30001.dart';
import 'descriptors/max30003.dart';
Expand Down Expand Up @@ -35,6 +37,8 @@ class BoardRegistry {
max86150Descriptor,
pulseExpressDescriptor,
tinyGsrDescriptor,
easyEcgDescriptor,
easyEmgDescriptor,
st1vafe3bxDescriptor,
tmf8829Descriptor,
];
Expand Down
18 changes: 18 additions & 0 deletions lib/boards/channel_spec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ class ChannelSpec {
final double displayMax;
final List<FilterPreset> defaultFilters;

/// Starts hidden in the live view, with a toggle to show it. Mainly for
/// diagnostic traces; the channel is still buffered and recorded.
final bool optional;

/// ADC counts per millivolt at the electrodes. When set, the live view draws
/// this channel on an ECG paper grid by default instead of auto-fitting it.
final double? countsPerMv;

/// Starts the live view on a fixed Y range of [displayMin]..[displayMax]
/// instead of auto-fitting it. Use it for signals whose size is the point,
/// such as sEMG: auto-fit stretches a resting trace to the same height as a
/// contraction, so the two look alike.
final bool fixedRange;

const ChannelSpec({
required this.id,
required this.label,
Expand All @@ -21,6 +35,9 @@ class ChannelSpec {
this.displayMin = -1,
this.displayMax = 1,
this.defaultFilters = const [],
this.optional = false,
this.countsPerMv,
this.fixedRange = false,
});
}

Expand All @@ -47,6 +64,7 @@ enum ChannelKind {
gsr,
imu,
eeg,
emg,
capacitance,
derived,
unknown,
Expand Down
33 changes: 33 additions & 0 deletions lib/boards/decoders/easyecg_decoders.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright (c) 2024-2026 protocentral
// SPDX-License-Identifier: MIT

import 'dart:typed_data';

import '../../protocol/decoded_packet.dart';
import 'shared_codecs.dart';

/// easyECG Breakout — pktType 2 — 125 Hz, signed 12-bit ADC counts.
///
/// Streamed by the `04.OpenView` example in protocentral_easyecg_arduino. The
/// firmware samples at 1000 SPS, applies a mains notch and a 40 Hz low-pass,
/// and decimates to 125 Hz.
///
/// Payload layout (8 bytes):
/// [0-1] ECG, filtered int16 LE (counts)
/// [2-3] ECG, unfiltered int16 LE (counts; 0 if the sketch disables it)
/// [4-5] Heart rate int16 LE (bpm; 0 until established)
/// [6-7] Signal status int16 LE (0 = OK, 1 = lead-off or mains pickup,
/// 2 = amplifier saturated)
DecodedPacket decodeEasyEcgPkt2(Uint8List p) {
return DecodedPacket(
pktType: 2,
channelSamples: {
'ecg': [Codec.readInt16LE(p, 0).toDouble()],
'ecg_unfiltered': [Codec.readInt16LE(p, 2).toDouble()],
},
events: {
'heartRate': Codec.readInt16LE(p, 4),
'signalStatus': Codec.readInt16LE(p, 6),
},
);
}
45 changes: 45 additions & 0 deletions lib/boards/decoders/easyemg_decoders.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright (c) 2024-2026 protocentral
// SPDX-License-Identifier: MIT

import 'dart:typed_data';

import '../../protocol/decoded_packet.dart';
import 'shared_codecs.dart';

/// Microvolts at the electrodes per ADC count: the TLA2024's +/-0.256 V range
/// over 2048 counts, divided by the front end's x51.7 gain. Matches
/// `countsToMicrovolts()` in the Arduino library.
const double easyEmgMicrovoltsPerCount = 0.256 / 2048 * 1e6 / 51.7;

/// easyEMG Breakout — pktType 2 — 500 Hz, decoded to µV at the electrodes.
///
/// Streamed by the `06.OpenView` example in protocentral_easyemg_arduino. The
/// firmware samples at 1000 SPS and averages 2 samples into each packet, so
/// the sEMG trace is band-limited to 250 Hz. The envelope is computed from
/// every 1000 SPS sample and keeps the full bandwidth. Both arrive already
/// filtered: a 20 Hz high-pass and, by default, a notch on every mains
/// harmonic up to 450 Hz.
///
/// Payload layout (8 bytes):
/// [0-1] sEMG int16 LE (counts, +/-2048)
/// [2-3] RMS envelope int16 LE (counts, 0..2048)
/// [4-5] %MVC int16 LE (0 until an MVC has been recorded)
/// [6] MVC step 0 none, 1 relax, 2 contract, 3 too weak, 4 set
/// (library 1.1.0; always 0 from 1.0.0)
/// [7] Reserved always 0
///
/// sEMG and the envelope are scaled by [easyEmgMicrovoltsPerCount], about
/// 2.42 µV per count; %MVC is passed through.
DecodedPacket decodeEasyEmgPkt2(Uint8List p) {
return DecodedPacket(
pktType: 2,
channelSamples: {
'emg': [Codec.readInt16LE(p, 0) * easyEmgMicrovoltsPerCount],
'emg_envelope': [Codec.readInt16LE(p, 2) * easyEmgMicrovoltsPerCount],
},
events: {
'percentMvc': Codec.readInt16LE(p, 4),
'mvcStep': p[6],
},
);
}
2 changes: 2 additions & 0 deletions lib/boards/descriptors/ads1292r.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import '../board_descriptor.dart';
import '../channel_spec.dart';
import '../decoders/ads1292r_decoders.dart';
import '../metric_spec.dart';
import '../packet_spec.dart';
import '../transport_profile.dart';

Expand Down Expand Up @@ -39,5 +40,6 @@ final BoardDescriptor ads1292rDescriptor = BoardDescriptor(
decode: decodeAds1292rPkt2,
),
],
metrics: const [heartRateMetric, respRateMetric],
notes: 'TI ADS1292R 2-channel ECG/respiration analog front-end.',
);
2 changes: 2 additions & 0 deletions lib/boards/descriptors/afe4490.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import '../board_descriptor.dart';
import '../channel_spec.dart';
import '../decoders/afe4490_decoders.dart';
import '../metric_spec.dart';
import '../packet_spec.dart';
import '../transport_profile.dart';

Expand Down Expand Up @@ -39,6 +40,7 @@ final BoardDescriptor afe4490Descriptor = BoardDescriptor(
decode: decodeAfe4490Pkt2,
),
],
metrics: const [heartRateMetric, spo2Metric],
notes: 'TI AFE4490 22-bit dual-LED pulse-oximetry front-end. '
'Accepts standard Nellcor-compatible DB9 SpO2 finger probe. '
'SpO2 and heart rate computed on-device.',
Expand Down
78 changes: 78 additions & 0 deletions lib/boards/descriptors/easyecg.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// Copyright (c) 2024-2026 protocentral
// SPDX-License-Identifier: MIT

import '../board_descriptor.dart';
import '../channel_spec.dart';
import '../decoders/easyecg_decoders.dart';
import '../metric_spec.dart';
import '../packet_spec.dart';
import '../transport_profile.dart';

// One count is 1 mV at the ADC (2.048 V full scale, 12-bit) and the front end's
// gain is x535, so 1 mV at the electrodes is 535 counts. That gain is the
// schematic's design value, not yet measured on production boards.
const double _countsPerMv = 535;

final BoardDescriptor easyEcgDescriptor = BoardDescriptor(
id: 'easyecg',
displayName: 'easyECG Breakout',
manufacturer: 'ProtoCentral',
transports: const TransportSupport(usb: true),
usbProfile: const UsbProfile(
baudRate: 57600,
),
channels: const [
ChannelSpec(
id: 'ecg',
label: 'ECG (filtered)',
sampleRateHz: 125,
unit: SignalUnit.adc,
kind: ChannelKind.ecg,
displayMin: -2048,
displayMax: 2047,
countsPerMv: _countsPerMv,
),
ChannelSpec(
id: 'ecg_unfiltered',
label: 'ECG (unfiltered)',
sampleRateHz: 125,
unit: SignalUnit.adc,
kind: ChannelKind.ecg,
displayMin: -2048,
displayMax: 2047,
optional: true,
countsPerMv: _countsPerMv,
),
],
packets: [
PacketSpec(
pktType: 2,
label: 'ECG/HR/Status',
expectedPayloadLength: 8,
decode: decodeEasyEcgPkt2,
),
],
metrics: const [
MetricSpec(
eventKey: 'heartRate',
label: 'Heart rate',
kind: MetricKind.heartRate,
unit: 'bpm',
zeroMeansNoData: true,
qualityEventKey: 'signalStatus',
),
MetricSpec(
eventKey: 'signalStatus',
label: 'Signal',
kind: MetricKind.signalStatus,
states: {
0: MetricState('OK', MetricSeverity.ok),
1: MetricState('Lead-off or mains pickup', MetricSeverity.warning),
2: MetricState('Amplifier saturated', MetricSeverity.error),
},
),
],
notes: 'ProtoCentral easyECG single-lead ECG breakout (Qwiic), streamed '
'through a host running the 04.OpenView Arduino example. signalStatus: '
'0 = OK, 1 = lead-off or mains pickup, 2 = amplifier saturated.',
);
Loading
Loading