Skip to content

Commit

Permalink
Merge branch 'release/2.1.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
dspverden committed Dec 14, 2020
2 parents 66e6e78 + d5d8fa6 commit 7a5b51a
Show file tree
Hide file tree
Showing 43 changed files with 4,656 additions and 4,498 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ ADDONS/AddOnL mit SPDIF
fp-info-cache
SOURCES/build-sigma2aurora-Desktop_Qt_5_12_5_clang_64bit-Debug
RELEASES
OEM
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified PARTSLIST/AddOns BOM.xlsx
Binary file not shown.
21 changes: 17 additions & 4 deletions SOURCES/WEBAPP/ESP32/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The ESPAsyncWebServer library requires the AsyncTCP library to work. Follow the
1. Download the AsyncTCP library from https://github.com/me-no-dev/AsyncTCP/archive/master.zip.
2. Unzip the .zip folder and you should get `AsyncTCP-master` folder.
3. Rename your folder from `AsyncTCP-master` to `AsyncTCP`.
4. Move the `AsyncTCPfolder` to your Arduino IDE installation libraries folder.
4. Move the `AsyncTCP` folder to your Arduino IDE installation libraries folder.


## Installing the Arduino ESP32 Filesystem Uploader
Expand Down Expand Up @@ -60,10 +60,11 @@ You should have a similar folder structure: `<home_dir>/Arduino-<version>/tools/

## Installing ESP32 boards

Open ArduinoID `File > Preferences` dialog, and add following URL to Additional Cards setting:
- https://dl.espressif.com/dl/package_esp32_index.son
1. Open ArduinoID `File > Preferences` dialog, and add following URL to Additional Cards setting:
- https://dl.espressif.com/dl/package_esp32_index.json

Then open `Tools > Card Types > Manage Cards` and select `ESP32 dev module`.
2. Open `Tools > Card Types > Manage Cards` and install `ESP32 dev module`.
3. Select `Tools > Card Types > ESP32 Arduino > ESP32 Dev Module` as card.

Ensure Python2 is in your PATH (as `python`).

Expand All @@ -73,3 +74,15 @@ Ensure Python2 is in your PATH (as `python`).
1. Open the file `aurora.ino` in your ArduinoIDE and click on Upload.
2. After uploading the code, you need to upload the data files.
3. Go to `Tools > ESP32 Data` Sketch Upload and wait for the files to be uploaded.


## espmake32

This is work in progres. **Only if** you are using [espmake32](https://github.com/plerup/makeEspArduino), you need to download the last libraries manually. **Else, skip this!**
You'll find them here:

1. [ArduinoJson](https://github.com/bblanchon/ArduinoJson/releases/download/v6.13.0/ArduinoJson-v6.13.0.zip)
2. [u8g2](https://github.com/olikraus/u8g2/archive/master.zip), which does not offer proper releases. Let's hope master doesn't break anything.
3. [IRremote](https://github.com/z3t0/Arduino-IRremote/archive/master.zip). However, while [this PR from dspverden](https://github.com/z3t0/Arduino-IRremote/pull/689) isn't merged, you'll probably prefer [dspverden's branch](https://github.com/dspverden/Arduino-IRremote/archive/master.zip).

I did not yet test much of this.
170 changes: 170 additions & 0 deletions SOURCES/WEBAPP/ESP32/aurora/AK4458.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
#include <Arduino.h>
#include <Wire.h>

#include "plugin.h"
#include "hwconfig.h"
#include "AK4458.h"

//==============================================================================
/*!
*/
void AK4458_REGWRITE( byte reg, byte val )
{
Wire.beginTransmission( AK4458_I2C_ADDR );
Wire.write( reg );
Wire.write( val );
Wire.endTransmission( true );
}

//==============================================================================
/*! Configure AK4458 DAC
*/
void configDAC( void )
{
/* Control 1 (Address: 0x00)
* bit[0] : RSTN: Internal Timing Reset : 0 Reset
* bit[3:1] : DIF2-0: Audio Data Interface Modes : 110 Mode 18
* bit[7] : ACKS: Master Clock Frequency Auto Setting Mode Enable : 0 Manual Setting Mode
*/
AK4458_REGWRITE( AK4458_CONTROL1, 0b00001100 );

/* Control 2 (Address: 0x01)
* bit[0] : SMUTE Soft Mute Enable : 0 Normal Operation
* bit[2:1] : DEM11-0 DAC1 De-emphasis Response : 01 Off
* bit[4:3] : DFS1-0 Sampling Speed Control : 00 Normal Speed
* bit[5] : SD Short delay Filter Enable : 1 Short delay filter
*/
AK4458_REGWRITE( AK4458_CONTROL2, 0b00100010 );

/* Control 3 (Address: 0x02)
* bit[0] : SLOW Slow Roll-off Filter Enable : 0 Sharp roll-off filter
* bit[1] : SELLR1 Data selection of DAC1 L & R, when MONO mode : 0 Default
* bit[2] : DZFB Inverting Enable of DZF : 0 DZF pin goes “H” at Zero Detection
* bit[3] : MONO1 DAC1 enters monaural output mode : 0 Stereo mode
* bit[4] : DCKBPolarity of DCLK (DSD Only) : 0 DSD data is output from DCLK falling edge
* bit[5] : DCKS Master Clock Frequency Select at DSD mode : 0 512fs
* bit[7] : DP DSD/PCM Mode Select : 0 PCM Mode
*/
AK4458_REGWRITE( AK4458_CONTROL3, 0b00000000 );

AK4458_REGWRITE( AK4458_L1CHATT, 0xFF );
AK4458_REGWRITE( AK4458_R1CHATT, 0xFF );

/* Control 4 (Address: 0x05)
* bit[0] : SSLOW Digital Filter Bypass Mode Enable : 0 Enable digital filter selected by SD and SLOW bits
* bit[1] : DFS2 Sampling Speed Control : 0 Normal Speed
* bit[3] : SELLR2 Data selection of DAC2 L & R, when MONO mode : 0 Default
* bit[4] : INVL1 AOUTL1 Output Phase Inverting Bit : 0 Normal
* bit[5] : INVR1 AOUTR1 Output Phase Inverting Bit : 0 Normal
* bit[6] : INVL2 AOUTL2 Output Phase Inverting Bit : 0 Normal
* bit[7] : INVR2 AOUTR2 Output Phase Inverting Bit : 0 Normal
*/
AK4458_REGWRITE( AK4458_CONTROL4, 0b00000000 );

/* DSD1 (Address: 0x06)
*/
AK4458_REGWRITE( AK4458_DSD1, 0b00000000 );

/* Control 5 (Address: 0x07)
* bit[0] : SYNCE SYNCModeEnable : 1 SYNC Mode Enable
* bit[7:4] : L3-4,R3-4 Zero Detect Flag Enable Bit for the DZF pin : 0 Disable
*/
AK4458_REGWRITE( AK4458_CONTROL5, 0b00000011 );

/* Sound Control (Address: 0x08)
* bit[1:0] : SC1-0 Sound Control : 00 Mode 1
* bit[7:4] : L1-2,R1-2 Zero Detect Flag Enable Bit for the DZF pin : 0 Disable
*/
AK4458_REGWRITE( AK4458_SOUNDCONTROL, 0b00000000 );

/* DSD1 (Address: 0x09)
*/
AK4458_REGWRITE( AK4458_DSD2, 0b00000000 );

/* Control 6 (Address: 0x0A)
* bit[1:0] : DEM21-0 DAC2 De-emphasis Response : 01 Off
* bit[2] : PW1 Power management for DAC1 : 1 On
* bit[3] : PW2 Power management for DAC2 : 1 On
* bit[5:4] : SDS2-1 DAC1-4 Data Select : 00 Normal Operation
* bit[7:6] : TDM Mode Select : 10 TDM256
*/
AK4458_REGWRITE( AK4458_CONTROL6, 0b10001101 );

/* Control 7 (Address: 0x0B)
* bit[1] : DCHAIN Daisy Chain Mode Enable : 0 Daisy Chain Mode Disable
* bit[2] : PW3 Power management for DAC3 : 1 On
* bit[3] : PW4 Power management for DAC4 : 1 On
* bit[4] : SDS0 DAC1-4 Data Select : 0 Normal Operation
* bit[7:6] : ATS1-0 DAC Digital attenuator transition time setting : 00 Mode 0 4080/fs
*/
AK4458_REGWRITE( AK4458_CONTROL7, 0b00001100 );

/* Control 8 (Address: 0x0C)
* bit[0:2] : FIR2-0: FIR Filter Control : 000 Default
* bit[4] : INVL3 AOUTL3 Output Phase Inverting Bit : 0 Normal
* bit[5] : INVR3 AOUTR3 Output Phase Inverting Bit : 0 Normal
* bit[6] : INVL4 AOUTL4 Output Phase Inverting Bit : 0 Normal
* bit[7] : INVR4 AOUTR4 Output Phase Inverting Bit : 0 Normal
*/
AK4458_REGWRITE( AK4458_CONTROL8, 0b00000000 );

/* Control 9 (Address: 0x0D)
* bit[2] : SELLR3 Data selection of DAC3 L & R, when MONO mode : 0 Default
* bit[3] : SELLR4 Data selection of DAC4 L & R, when MONO mode : 0 Default
* bit[5] : MONO2 DAC2 enters monaural output mode : 0 Stereo mode
* bit[6] : MONO3 DAC3 enters monaural output mode : 0 Stereo mode
* bit[7] : MONO4 DAC4 enters monaural output mode : 0 Stereo mode
*/
AK4458_REGWRITE( AK4458_CONTROL9, 0b00000000 );

/* Control 10 (Address: 0x0E)
* bit[5:4] : DEM31-0 DAC3 De-emphasis Response : 01 Off
* bit[7:6] : DEM41-0 DAC4 De-emphasis Response : 01 Off
*/
AK4458_REGWRITE( AK4458_CONTROL10, 0b01010000 );

AK4458_REGWRITE( AK4458_L2CHATT, 0xFF );
AK4458_REGWRITE( AK4458_R2CHATT, 0xFF );
AK4458_REGWRITE( AK4458_L3CHATT, 0xFF );
AK4458_REGWRITE( AK4458_R3CHATT, 0xFF );
AK4458_REGWRITE( AK4458_L4CHATT, 0xFF );
AK4458_REGWRITE( AK4458_R4CHATT, 0xFF );

// Release Reset by rewriting Control1
/* Control 1 (Address: 0x00)
* bit[0] : RSTN: Internal Timing Reset : 1 Normal Operation
* bit[3:1] : DIF2-0: Audio Data Interface Modes : 110 Mode 18
* bit[7] : ACKS: Master Clock Frequency Auto Setting Mode Enable : 0 Manual Setting Mode
*/
//AK4458_REGWRITE( AK4458_CONTROL1, 0b00001101 );
}

//==============================================================================
/*! Set DAC into reset.
*/
void resetDAC( bool rst )
{
if( rst )
AK4458_REGWRITE( AK4458_CONTROL1, 0b00001100 );
else
AK4458_REGWRITE( AK4458_CONTROL1, 0b00001101 );
}

//==============================================================================
/*! Mute DAC
*/
void softMuteDAC( void )
{
AK4458_REGWRITE( AK4458_CONTROL2, 0b00100011 );
delay( 500 );
}

//==============================================================================
/*! Unmute DAC
*/
void softUnmuteDAC( void )
{
delay( 250 );
AK4458_REGWRITE( AK4458_CONTROL2, 0b00100010 );
}

19 changes: 19 additions & 0 deletions SOURCES/WEBAPP/ESP32/aurora/AK4458.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,24 @@
#define AK4458_L4CHATT (0x13)
#define AK4458_R4CHATT (0x14)

/*!
*/
void AK4458_REGWRITE( byte reg, byte val );

/*! Configure AK4458 DAC
*/
void configDAC( void );

/*! Set DAC into reset.
*/
void resetDAC( bool rst );

/*! Mute DAC
*/
void softMuteDAC( void );

/*! Unmute DAC
*/
void softUnmuteDAC( void );

#endif /* AK4458_H_ */
88 changes: 88 additions & 0 deletions SOURCES/WEBAPP/ESP32/aurora/AK5558.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#include <Arduino.h>
#include <Wire.h>

#include "plugin.h"
#include "hwconfig.h"
#include "AK5558.h"

//==============================================================================
/*!
*/
void AK5558_REGWRITE( byte reg, byte val)
{
Wire.beginTransmission( AK5558_I2C_ADDR );
Wire.write( reg );
Wire.write( val );
Wire.endTransmission( true );
}

//==============================================================================
/*! Configure AK5558 ADC
*/
void configADC( void )
{
/* Power Management1 (Address: 0x01)
* bit[0] : RSTN: Internal Timing Reset : 0 Reset
* bit[2:1] : MONO2-1: Channel Summation mode Select : 00 Not- Summation mode (default)
*/
AK5558_REGWRITE( AK5558_POWERMANAGEMENT2, 0b00000000 );

/* Control 1 (Address: 0x02)
* bit[0] : HPFE: High Pass Filter Enable : 1 High Pass Filter ON (default)
* bit[2:1] : DIF1-0: Audio Data Interface Mode Select : 10 32bit MSB
* bit[6:3] : CKS3-0: Sampling Speed Mode and MCLK Frequency Select :0110 Normal Speed, 512fs
*/
AK5558_REGWRITE( AK5558_CONTROL1, 0b00110101 );

/* Control 2 (Address: 0x03)
* bit[6:5] : TDM1-0: TDMModesSelect : 10 TDM256
*/
AK5558_REGWRITE( AK5558_CONTROL2, 0b01000000 );

/* Control 3 (Address: 0x04)
* bit[0] : SLOW: Slow Roll-off Filter Select : 0: Sharp Roll-off (default)
* bit[1] : SD: Short Delay Select : 0: Normal Delay (default)
* bit[7] : DSD Mode Select : 0: PCM mode (default)
*/
AK5558_REGWRITE( AK5558_CONTROL3, 0b00000000 );

/* DSD (Address: 0x05)
* bit[0:1] : DSDSEL1-0:Select the Frequency of DCLK : 00: 64fs (default)
* bit[2] : DCKB: Polarity of DCLK : 0: DSD data is output from DCLK Falling Edge (default)
* bit[3] : PMOD: DSD Phase Modulation Mode : 0: Not Phase Modulation Mode (default)
* bit[5] : DCKS: Master Clock Frequency Select at DSD Mode : 0: 512fs (default)
*/
AK5558_REGWRITE( AK5558_DSD, 0b00000000 );

/* Power Management1 (Address: 0x01)
* bit[0] : RSTN: Internal Timing Reset : 1 Normal operation
* bit[2:1] : MONO2-1: Channel Summation mode Select : 00 Not- Summation mode (default)
*/
AK5558_REGWRITE( AK5558_POWERMANAGEMENT2, 0b00000001 );
}

//==============================================================================
/*! Change the channel summation of AK5558 ADC
*/
void changeChannelSummationADC( void )
{
AK5558_REGWRITE( AK5558_POWERMANAGEMENT2, 0b00000000 );
delay(100);

// Normal operation
if( Settings.adcsum == 0 )
AK5558_REGWRITE( AK5558_POWERMANAGEMENT2, 0b00000001 );
// 8-to-4 mode
else if( Settings.adcsum == 1 )
AK5558_REGWRITE( AK5558_POWERMANAGEMENT2, 0b00000101 );
// 8-to-2 mode
else if( Settings.adcsum == 2 )
AK5558_REGWRITE( AK5558_POWERMANAGEMENT2, 0b00000011 );
// 8-to-1 mode
else if( Settings.adcsum == 3 )
AK5558_REGWRITE( AK5558_POWERMANAGEMENT2, 0b00000111 );
// fallback to normal operation
else
AK5558_REGWRITE( AK5558_POWERMANAGEMENT2, 0b00000001 );
}

8 changes: 8 additions & 0 deletions SOURCES/WEBAPP/ESP32/aurora/AK5558.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,12 @@
#define AK5558_TEST1 (0x06)
#define AK5558_TEST2 (0x07)

/*! Configure AK5558 ADC
*/
void configADC( void );

/*! Change the channel summation of AK5558 ADC
*/
void changeChannelSummationADC( void );

#endif /* AK5558_H_ */
Loading

0 comments on commit 7a5b51a

Please sign in to comment.