Skip to content
Draft
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
4 changes: 3 additions & 1 deletion include/openearable_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ enum sensor_id {
ID_PULSOX=5,
ID_OPTTEMP=6,
ID_BONE_CONDUCTION=7,
ID_MICRO_INNER=8,
ID_MICRO_OUTER=9,
};

struct battery_data {
Expand Down Expand Up @@ -145,4 +147,4 @@ struct audio_rx_data {
size_t size;
};

#endif
#endif
5 changes: 4 additions & 1 deletion prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ CONFIG_SFLOAT=y

#CONFIG_RESET_ON_FATAL_ERROR=y

CONFIG_STREAM_BIDIRECTIONAL=y
CONFIG_STREAM_BIDIRECTIONAL=n
CONFIG_MIC_BLE_STREAM=y
CONFIG_BT_ASCS_MAX_ASE_SRC_COUNT=0
CONFIG_BT_PAC_SRC_NOTIFIABLE=n

# CONFIG_NRFX_PDM=y

Expand Down
5 changes: 4 additions & 1 deletion prj_fota.conf
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ CONFIG_SFLOAT=y

#CONFIG_RESET_ON_FATAL_ERROR=y

CONFIG_STREAM_BIDIRECTIONAL=y
CONFIG_STREAM_BIDIRECTIONAL=n
CONFIG_MIC_BLE_STREAM=y
CONFIG_BT_ASCS_MAX_ASE_SRC_COUNT=0
CONFIG_BT_PAC_SRC_NOTIFIABLE=n

# CONFIG_NRFX_PDM=y

Expand Down
53 changes: 51 additions & 2 deletions src/ParseInfo/DefaultSensors.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "../SensorManager/Temp.h"
#include "../SensorManager/BoneConduction.h"
#include "../SensorManager/Microphone.h"
#include "../SensorManager/MicrophoneBle.h"


// ============= Microphones =============
Expand All @@ -27,6 +28,24 @@ SensorComponentGroup microGroups[MICRO_GROUP_COUNT] = {
{ .name = "MICROPHONE", .componentCount = MICRO_CHANNEL_COUNT, .components = microComponenents },
};

#define MICRO_BLE_CHANNEL_COUNT 1
SensorComponent microBleInnerComponents[MICRO_BLE_CHANNEL_COUNT] = {
{ .name = "INNER", .unit = "ADC", .parseType = PARSE_TYPE_INT16 },
};

SensorComponent microBleOuterComponents[MICRO_BLE_CHANNEL_COUNT] = {
{ .name = "OUTER", .unit = "ADC", .parseType = PARSE_TYPE_INT16 },
};

#define MICRO_BLE_GROUP_COUNT 1
SensorComponentGroup microBleInnerGroups[MICRO_BLE_GROUP_COUNT] = {
{ .name = "INNER_MICROPHONE", .componentCount = MICRO_BLE_CHANNEL_COUNT, .components = microBleInnerComponents },
};

SensorComponentGroup microBleOuterGroups[MICRO_BLE_GROUP_COUNT] = {
{ .name = "OUTER_MICROPHONE", .componentCount = MICRO_BLE_CHANNEL_COUNT, .components = microBleOuterComponents },
};

// ============= IMU =============

#define IMU_ACC_COUNT 3
Expand Down Expand Up @@ -118,7 +137,7 @@ SensorComponentGroup baroGroups[BARO_GROUP_COUNT] = {

// ============= Sensors =============

#define SENSOR_COUNT 6
#define SENSOR_COUNT 8
SensorScheme defaultSensors[SENSOR_COUNT] = {
{
.name = "9-Axis IMU",
Expand Down Expand Up @@ -150,6 +169,36 @@ SensorScheme defaultSensors[SENSOR_COUNT] = {
},
},
},
{
.name = "Inner Microphone",
.id = ID_MICRO_INNER,
.groupCount = MICRO_BLE_GROUP_COUNT,
.groups = microBleInnerGroups,
.configOptions = {
.availableOptions = DATA_STREAMING | FREQUENCIES_DEFINED,
.frequencyOptions = {
.frequencyCount = sizeof(MicrophoneBle::sample_rates.reg_vals),
.defaultFrequencyIndex = 0,
.maxBleFrequencyIndex = 0,
.frequencies = MicrophoneBle::sample_rates.sample_rates,
},
},
},
{
.name = "Outer Microphone",
.id = ID_MICRO_OUTER,
.groupCount = MICRO_BLE_GROUP_COUNT,
.groups = microBleOuterGroups,
.configOptions = {
.availableOptions = DATA_STREAMING | FREQUENCIES_DEFINED,
.frequencyOptions = {
.frequencyCount = sizeof(MicrophoneBle::sample_rates.reg_vals),
.defaultFrequencyIndex = 0,
.maxBleFrequencyIndex = 0,
.frequencies = MicrophoneBle::sample_rates.sample_rates,
},
},
},
{
.name = "Pulse Oximeter",
.id = ID_PPG,
Expand Down Expand Up @@ -214,7 +263,7 @@ SensorScheme defaultSensors[SENSOR_COUNT] = {

ParseInfoScheme defaultSensorIds = {
.sensorCount = SENSOR_COUNT,
.sensorIds = (uint8_t[]){ ID_IMU, ID_PPG, ID_OPTTEMP, ID_TEMP_BARO, ID_BONE_CONDUCTION, ID_MICRO },
.sensorIds = (uint8_t[]){ ID_IMU, ID_PPG, ID_OPTTEMP, ID_TEMP_BARO, ID_BONE_CONDUCTION, ID_MICRO, ID_MICRO_INNER, ID_MICRO_OUTER },
};

#endif // _DEFAULT_SENSORS_H
2 changes: 2 additions & 0 deletions src/SensorManager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ target_sources(app PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/BoneConduction.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Microphone.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Microphone.c
${CMAKE_CURRENT_SOURCE_DIR}/MicrophoneBle.cpp
${CMAKE_CURRENT_SOURCE_DIR}/MicBleStreamer.cpp
)
Loading
Loading