Skip to content

Commit

Permalink
BLE, RevF Update; updat examples in 08-Earpieces
Browse files Browse the repository at this point in the history
  • Loading branch information
chipaudette committed May 16, 2024
1 parent 56fc92d commit 2bfea5c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ const int audio_block_samples = 128; //do not make bigger than audio_block_S
AudioSettings_F32 audio_settings(sample_rate_Hz, audio_block_samples);

// define classes to control the Tympan and the AIC_Shield
Tympan myTympan(TympanRev::E, audio_settings); //choose TympanRev::D or TympanRev::E
EarpieceShield earpieceShield(TympanRev::E, AICShieldRev::A); //Note that EarpieceShield is defined in the Tympan_Libarary in AICShield.h
Tympan myTympan(TympanRev::F, audio_settings); //do TympanRev::D or E or F
EarpieceShield earpieceShield(TympanRev::F, AICShieldRev::A); //Note that EarpieceShield is defined in the Tympan_Libarary in AICShield.h

// define audio classes
AudioInputI2SQuad_F32 i2s_in(audio_settings); //Digital audio *from* the Tympan AIC.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ const int audio_block_samples = 128; //do not make bigger than audio_block_S
AudioSettings_F32 audio_settings(sample_rate_Hz, audio_block_samples);

// define classes to control the Tympan and the AIC_Shield
Tympan myTympan(TympanRev::E, audio_settings); //choose TympanRev::D or TympanRev::E
EarpieceShield earpieceShield(TympanRev::E, AICShieldRev::A); //Note that EarpieceShield is defined in the Tympan_Libarary in AICShield.h
Tympan myTympan(TympanRev::F, audio_settings); //do TympanRev::D or E or F
EarpieceShield earpieceShield(TympanRev::F, AICShieldRev::A); //Note that EarpieceShield is defined in the Tympan_Libarary in AICShield.h

// Instantiate the audio classes
AudioInputI2SQuad_F32 i2s_in(audio_settings); //Bring audio in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ AudioSettings_F32 audio_settings(sample_rate_Hz, audio_block_samples);


// Create the audio library objects that we'll use
Tympan myTympan(TympanRev::E, audio_settings); //use TympanRev::D or TympanRev::E
EarpieceShield earpieceShield(TympanRev::E, AICShieldRev::A); //Note that EarpieceShield is defined in the Tympan_Libarary in AICShield.h
Tympan myTympan(TympanRev::F, audio_settings); //do TympanRev::D or E or F
EarpieceShield earpieceShield(TympanRev::F, AICShieldRev::A); //Note that EarpieceShield is defined in the Tympan_Libarary in AICShield.h
AudioSynthWaveform_F32 sineWave(audio_settings); //from the Tympan_Library
AudioOutputI2SQuad_F32 audioOutput(audio_settings); //from the Tympan_Library

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ const int audio_block_samples = 32; //do not make bigger than AUDIO_BLOCK_SA
AudioSettings_F32 audio_settings(sample_rate_Hz, audio_block_samples);

//create audio library objects for handling the audio
Tympan myTympan(TympanRev::E, audio_settings); //do TympanRev::D or TympanRev::E
EarpieceShield earpieceShield(TympanRev::E, AICShieldRev::A); //in the Tympan_Library, EarpieceShield is defined in AICShield.h
Tympan myTympan(TympanRev::F, audio_settings); //do TympanRev::D or E or F
EarpieceShield earpieceShield(TympanRev::F, AICShieldRev::A); //in the Tympan_Library, EarpieceShield is defined in AICShield.h

//Create all the audio classes and make all of the audio connections
#include "AudioConnections.h"

// Create classes for controlling the system
#include "SerialManager.h"
#include "State.h"
BLE ble(&myTympan); //create bluetooth BLE
SerialManager serialManager(&ble); //create the serial manager for real-time control (via USB or App)
BLE& ble = myTympan.getBLE(); //myTympan owns the ble object, but we have a reference to it here
SerialManager serialManager(&ble); //create the serial manager for real-time control (via USB or App)
State myState(&audio_settings, &myTympan, &serialManager); //keeping one's state is useful for the App's GUI


Expand Down Expand Up @@ -153,10 +153,9 @@ void setup() {
earpieceShield.setHPFonADC(true, hardware_cutoff_Hz, audio_settings.sample_rate_Hz); //set to false to disable

//setup BLE
while (Serial1.available()) Serial1.read(); //clear the incoming Serial1 (BT) buffer
ble.setupBLE(myTympan.getBTFirmwareRev()); //this uses the default firmware assumption. You can override!

//Set the cutoff frequency for the highpassfilter
myTympan.setupBLE(); //Assumes the default Bluetooth firmware. You can override!

//Set the cutoff frequency for the highpassfilter
setHighpassFilters_Hz(myState.cutoff_Hz); //function defined near the bottom of this file
printHighpassCutoff();

Expand Down

0 comments on commit 2bfea5c

Please sign in to comment.