Skip to content

Commit ebe6c25

Browse files
authored
restore support for pieeg (#729)
* restore support for pieeg Signed-off-by: Andrey Parfenov <a1994ndrey@gmail.com> Author: Nick Gamb <nickgamb@gmail.com> Date: Sun Jun 30 02:40:04 2024 +0200
1 parent a0b554d commit ebe6c25

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+10429
-5
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ option (BUILD_BLUETOOTH "BUILD_BLUETOOTH" OFF)
2424
option (BUILD_BLE "BUILD_BLE" OFF)
2525
option (BUILD_ONNX "BUILD_ONNX" OFF)
2626
option (BUILD_TESTS "BUILD_TESTS" OFF)
27+
option (BUILD_PERIPHERY "BUILD_PERIPHERY" OFF)
2728

2829
include (${CMAKE_CURRENT_SOURCE_DIR}/cmake/macros.cmake)
2930
configure_msvc_runtime ()

csharp_package/brainflow/brainflow/board_controller_library.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ public enum BoardIds
114114
FREEEEG128_BOARD = 52,
115115
AAVAA_V3_BOARD = 53,
116116
EXPLORE_PLUS_8_CHAN_BOARD = 54,
117-
EXPLORE_PLUS_32_CHAN_BOARD = 55
117+
EXPLORE_PLUS_32_CHAN_BOARD = 55,
118+
PIEEG_BOARD = 56
118119
};
119120

120121

docs/SupportedBoards.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,3 +1268,40 @@ Available :ref:`presets-label`:
12681268
- :code:`BrainFlowPresets.DEFAULT_PRESET`, it contains accelerometer, gyroscope and magnetometer data
12691269
- :code:`BrainFlowPresets.AUXILIARY_PRESET`, it contains PPG data
12701270
- :code:`BrainFlowPresets.ANCILLARY_PRESET`, it contains EDA and temperature data
1271+
1272+
PiEEG
1273+
------
1274+
1275+
PiEEG Board
1276+
~~~~~~~~~~~
1277+
1278+
PiEEG (Measure EEG with RaspberryPi) – Brain-computer interface (EEG, EMG, and ECG bio-signals) is an open-source Raspberry Pi shield that measures biosignals such as those used in electroencephalography (EEG), electromyography (EMG), and electrocardiography (ECG). It integrates seamlessly with BrainFlow's API, allowing for easy data streaming, processing, and analysis.
1279+
1280+
.. image:: https://live.staticflickr.com/65535/53823500137_3bf2e27dbf_z.jpg
1281+
:width: 640px
1282+
:height: 384px
1283+
1284+
`PiEEG Website <https://pieeg.com/>`_
1285+
1286+
To create such a board, you need to specify the following board ID and fields of the BrainFlowInputParams object:
1287+
1288+
- :code:`BoardIds.PIEEG_BOARD`
1289+
- :code:`serial_port`(optional), e.g., COM3, /dev/spidev0.0, etc.
1290+
1291+
Initialization Example:
1292+
1293+
.. code-block:: python
1294+
from brainflow.board_shim import BoardShim, BrainFlowInputParams, BoardIds
1295+
params = BrainFlowInputParams()
1296+
params.serial_port = "/dev/spidev0.0"
1297+
board = BoardShim(BoardIds.PIEEG_BOARD, params)
1298+
board.prepare_session()
1299+
board.start_stream()
1300+
1301+
Supported platforms:
1302+
1303+
- Raspberry Pi
1304+
1305+
**Note**: Ensure that you have the necessary permissions to access the serial port on your operating system. For Unix-like systems, you may need to configure permissions for the serial port or run with sudo.
1306+
1307+
**To use this board you need to compile BrainFlow from the source code right on your Raspbery Pi device with flag --build-periphery(build.py) or with -DBUILD_PERIPHERY=ON(CMake) and install desired bindings using local libraries.**

java_package/brainflow/src/main/java/brainflow/BoardIds.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ public enum BoardIds
6464
FREEEEG128_BOARD (52),
6565
AAVAA_V3_BOARD(53),
6666
EXPLORE_PLUS_8_CHAN_BOARD(54),
67-
EXPLORE_PLUS_32_CHAN_BOARD(55);
67+
EXPLORE_PLUS_32_CHAN_BOARD(55),
68+
PIEEG_BOARD(56);
6869

6970
private final int board_id;
7071
private static final Map<Integer, BoardIds> bi_map = new HashMap<Integer, BoardIds> ();

julia_package/brainflow/src/board_shim.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export BrainFlowInputParams
6060
AAVAA_V3_BOARD = 53
6161
EXPLORE_PLUS_8_CHAN_BOARD = 54
6262
EXPLORE_PLUS_32_CHAN_BOARD = 55
63+
PIEEG_BOARD = 56
6364

6465
end
6566

matlab_package/brainflow/BoardIds.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,6 @@
5858
AAVAA_V3_BOARD(53)
5959
EXPLORE_PLUS_8_CHAN_BOARD(54)
6060
EXPLORE_PLUS_32_CHAN_BOARD(55)
61+
PIEEG_BOARD(56)
6162
end
6263
end

nodejs_package/brainflow/brainflow.types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ export enum BoardIds {
6767
NTL_WIFI_BOARD = 50,
6868
ANT_NEURO_EE_511_BOARD = 51,
6969
EXPLORE_PLUS_8_CHAN_BOARD = 54,
70-
EXPLORE_PLUS_32_CHAN_BOARD = 55
70+
EXPLORE_PLUS_32_CHAN_BOARD = 55,
71+
PIEEG_BOARD = 56
7172
}
7273

7374
export enum IpProtocolTypes {

python_package/brainflow/board_shim.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class BoardIds(enum.IntEnum):
7373
AAVAA_V3_BOARD = 53 #:
7474
EXPLORE_PLUS_8_CHAN_BOARD = 54 #:
7575
EXPLORE_PLUS_32_CHAN_BOARD = 55 #:
76+
PIEEG_BOARD = 56 #:
7677

7778

7879
class IpProtocolTypes(enum.IntEnum):

src/board_controller/board_controller.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include "muse_bled.h"
5050
#include "notion_osc.h"
5151
#include "ntl_wifi.h"
52+
#include "pieeg_board.h"
5253
#include "playback_file_board.h"
5354
#include "streaming_board.h"
5455
#include "synthetic_board.h"
@@ -277,6 +278,9 @@ int prepare_session (int board_id, const char *json_brainflow_input_params)
277278
case BoardIds::EXPLORE_PLUS_32_CHAN_BOARD:
278279
board = std::shared_ptr<Board> (new Explore (board_id, params));
279280
break;
281+
case BoardIds::PIEEG_BOARD:
282+
board = std::shared_ptr<Board> (new PIEEGBoard (board_id, params));
283+
break;
280284
default:
281285
return (int)BrainFlowExitCodes::UNSUPPORTED_BOARD_ERROR;
282286
}

src/board_controller/brainflow_boards.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ BrainFlowBoards::BrainFlowBoards()
7171
{"50", json::object()},
7272
{"51", json::object()},
7373
{"52", json::object()},
74-
{"53", json::object()}
74+
{"53", json::object()},
75+
{"54", json::object()},
76+
{"55", json::object()},
77+
{"56", json::object()}
7578
}
7679
}};
7780

@@ -1082,6 +1085,16 @@ BrainFlowBoards::BrainFlowBoards()
10821085
{"battery_channel", 2},
10831086
{"other_channels", {3}}
10841087
};
1088+
brainflow_boards_json["boards"]["56"]["default"] = {
1089+
{"name", "PIEEG"},
1090+
{"sampling_rate", 250},
1091+
{"package_num_channel", 0},
1092+
{"timestamp_channel", 9},
1093+
{"marker_channel", 10},
1094+
{"num_rows", 11},
1095+
{"eeg_channels", {1, 2, 3, 4, 5, 6, 7, 8}},
1096+
{"eeg_names", "Fp1,Fp2,C3,C4,P7,P8,O1,O2"}
1097+
};
10851098
}
10861099

10871100
BrainFlowBoards boards_struct;

0 commit comments

Comments
 (0)