Skip to content

Commit aaa651b

Browse files
Add NTL Wifi Board (#634)
* Add NTL Wifi Board Signed-off-by: Andrey Parfenov <a1994ndrey@gmail.com> Co-authored-by: Andrey Parfenov <a1994ndrey@gmail.com>
1 parent f495392 commit aaa651b

File tree

12 files changed

+195
-0
lines changed

12 files changed

+195
-0
lines changed

csharp_package/brainflow/brainflow/board_controller_library.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ public enum BoardIds
109109
EMOTIBIT_BOARD = 47,
110110
GALEA_BOARD_V4 = 48,
111111
GALEA_SERIAL_BOARD_V4 = 49,
112+
NTL_WIFI_BOARD = 50,
112113
ANT_NEURO_EE_511_BOARD = 51
113114
};
114115

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public enum BoardIds
5959
EMOTIBIT_BOARD (47),
6060
GALEA_BOARD_V4 (48),
6161
GALEA_SERIAL_BOARD_V4 (49),
62+
NTL_WIFI_BOARD (50),
6263
ANT_NEURO_EE_511_BOARD (51);
6364

6465
private final int board_id;

julia_package/brainflow/src/board_shim.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export BrainFlowInputParams
5454
EMOTIBIT_BOARD = 47
5555
GALEA_BOARD_V4 = 48
5656
GALEA_SERIAL_BOARD_V4 = 49
57+
NTL_WIFI_BOARD = 50
5758
ANT_NEURO_EE_511_BOARD = 51
5859

5960
end

matlab_package/brainflow/BoardIds.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
EMOTIBIT_BOARD(47)
5353
GALEA_BOARD_V4(48)
5454
GALEA_SERIAL_BOARD_V4(49)
55+
NTL_WIFI_BOARD(50)
5556
ANT_NEURO_EE_511_BOARD(51)
5657
end
5758
end

python_package/brainflow/board_shim.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ class BoardIds(enum.IntEnum):
6868
EMOTIBIT_BOARD = 47 #:
6969
GALEA_BOARD_V4 = 48 #:
7070
GALEA_SERIAL_BOARD_V4 = 49 #:
71+
NTL_WIFI_BOARD = 50 #:
7172
ANT_NEURO_EE_511_BOARD = 51 #:
7273

7374

rust_package/brainflow/src/ffi/constants.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ pub enum BoardIds {
8888
EmotibitBoard = 47,
8989
GaleaBoardV4 = 48,
9090
GaleaSerialBoardV4 = 49,
91+
NtlWifiBoard = 50,
9192
}
9293
#[repr(i32)]
9394
#[derive(FromPrimitive, ToPrimitive, Debug, Copy, Clone, Hash, PartialEq, Eq)]

src/board_controller/board_controller.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include "muse.h"
4848
#include "muse_bled.h"
4949
#include "notion_osc.h"
50+
#include "ntl_wifi.h"
5051
#include "playback_file_board.h"
5152
#include "streaming_board.h"
5253
#include "synthetic_board.h"
@@ -260,6 +261,9 @@ int prepare_session (int board_id, const char *json_brainflow_input_params)
260261
board = std::shared_ptr<Board> (
261262
new AntNeuroBoard ((int)BoardIds::ANT_NEURO_EE_511_BOARD, params));
262263
break;
264+
case BoardIds::NTL_WIFI_BOARD:
265+
board = std::shared_ptr<Board> (new NtlWifi (params));
266+
break;
263267
default:
264268
return (int)BrainFlowExitCodes::UNSUPPORTED_BOARD_ERROR;
265269
}

src/board_controller/brainflow_boards.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ BrainFlowBoards::BrainFlowBoards()
6868
{"47", json::object()},
6969
{"48", json::object()},
7070
{"49", json::object()},
71+
{"50", json::object()},
7172
{"51", json::object()}
7273
}
7374
}};
@@ -946,6 +947,24 @@ BrainFlowBoards::BrainFlowBoards()
946947
{"other_channels", {15, 16}},
947948
{"temperature_channels", {4}}
948949
};
950+
brainflow_boards_json["boards"]["50"]["default"] =
951+
{
952+
{"name", "NtlWifi"},
953+
{"sampling_rate", 250},
954+
{"package_num_channel", 0},
955+
{"timestamp_channel", 23},
956+
{"marker_channel", 24},
957+
{"num_rows", 25},
958+
{"eeg_channels", {1, 2, 3, 4, 5, 6, 7, 8}},
959+
{"eeg_names", "Fp1,Fp2,C3,C4,P7,P8,O1,O2"},
960+
{"emg_channels", {1, 2, 3, 4, 5, 6, 7, 8}},
961+
{"ecg_channels", {1, 2, 3, 4, 5, 6, 7, 8}},
962+
{"eog_channels", {1, 2, 3, 4, 5, 6, 7, 8}},
963+
{"accel_channels", {9, 10, 11}},
964+
{"analog_channels", {19, 20, 21}},
965+
{"other_channels", {12, 13, 14, 15, 16, 17, 18}},
966+
{"battery_channel", 22}
967+
};
949968
brainflow_boards_json["boards"]["51"]["default"] =
950969
{
951970
{"name", "AntNeuroEE511"},

src/board_controller/build.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ SET (BOARD_CONTROLLER_SRC
8282
${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/muse/muse.cpp
8383
${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/brainalive/brainalive.cpp
8484
${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/emotibit/emotibit.cpp
85+
${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/ntl/ntl_wifi.cpp
8586
)
8687

8788
include (${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/ant_neuro/build.cmake)
@@ -136,6 +137,7 @@ target_include_directories (
136137
${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/brainalive/inc
137138
${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/mentalab/inc
138139
${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/emotibit/inc
140+
${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/ntl/inc
139141
)
140142

141143
target_compile_definitions(${BOARD_CONTROLLER_NAME} PRIVATE NOMINMAX BRAINFLOW_VERSION=${BRAINFLOW_VERSION})
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#pragma once
2+
3+
#include <math.h>
4+
5+
#include "openbci_wifi_shield_board.h"
6+
7+
#define ADS1299_Vref 4.5
8+
#define ADS1299_gain 24.0
9+
10+
class NtlWifi : public OpenBCIWifiShieldBoard
11+
{
12+
double eeg_scale = (double)(ADS1299_Vref / float ((pow (2, 23) - 1)) / ADS1299_gain * 1000000.);
13+
double accel_scale = (double)(0.002 / (pow (2, 4)));
14+
15+
protected:
16+
void read_thread ();
17+
18+
public:
19+
// package num, 8 eeg channels, 3 accel channels
20+
NtlWifi (struct BrainFlowInputParams params)
21+
: OpenBCIWifiShieldBoard (params, (int)BoardIds::NTL_WIFI_BOARD)
22+
{
23+
}
24+
25+
int prepare_session ();
26+
};

0 commit comments

Comments
 (0)