Skip to content

Commit

Permalink
hw v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
turbyho committed Apr 6, 2017
1 parent c18d457 commit bb494ec
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 26 deletions.
10 changes: 4 additions & 6 deletions examples/Dabduino_example_1/DABDUINO_example_1.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
#include "DABDUINO.h"

#define _DAB_SERIAL_PORT Serial1
#define _DAB_RESET_PIN 2
#define _DAB_DAC_MUTE_PIN 3
#define _DAB_DAC_FLT_PIN 4
#define _DAB_DAC_DEMP_PIN 5
#define _DAB_SPI_CS_PIN 6
#define _DAB_RESET_PIN 7
#define _DAB_DAC_MUTE_PIN 9
#define _DAB_SPI_CS_PIN 10

DABDUINO dab = DABDUINO(_DAB_SERIAL_PORT, _DAB_RESET_PIN, _DAB_DAC_MUTE_PIN, _DAB_DAC_FLT_PIN, _DAB_DAC_DEMP_PIN, _DAB_SPI_CS_PIN);
DABDUINO dab = DABDUINO(_DAB_SERIAL_PORT, _DAB_RESET_PIN, _DAB_DAC_MUTE_PIN, _DAB_SPI_CS_PIN);

// DAB variables
char dabText[DAB_MAX_TEXT_LENGTH];
Expand Down
10 changes: 4 additions & 6 deletions examples/Dabduino_example_2/DABDUINO_example_2.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
#include "DABDUINO.h"

#define _DAB_SERIAL_PORT Serial1
#define _DAB_RESET_PIN 2
#define _DAB_DAC_MUTE_PIN 3
#define _DAB_DAC_FLT_PIN 4
#define _DAB_DAC_DEMP_PIN 5
#define _DAB_SPI_CS_PIN 6
#define _DAB_RESET_PIN 7
#define _DAB_DAC_MUTE_PIN 9
#define _DAB_SPI_CS_PIN 10

DABDUINO dab = DABDUINO(_DAB_SERIAL_PORT, _DAB_RESET_PIN, _DAB_DAC_MUTE_PIN, _DAB_DAC_FLT_PIN, _DAB_DAC_DEMP_PIN, _DAB_SPI_CS_PIN);
DABDUINO dab = DABDUINO(_DAB_SERIAL_PORT, _DAB_RESET_PIN, _DAB_DAC_MUTE_PIN, _DAB_SPI_CS_PIN);

// DAB variables
char dabText[DAB_MAX_TEXT_LENGTH];
Expand Down
12 changes: 1 addition & 11 deletions src/DABDUINO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@

#include "DABDUINO.h"

DABDUINO::DABDUINO(HardwareSerial& serial, int8_t RESET_PIN, int8_t DAC_MUTE_PIN, int8_t DAC_FLT_PIN, int8_t DAC_DEMP_PIN, int8_t SPI_CS_PIN) : _s(serial) {
DABDUINO::DABDUINO(HardwareSerial& serial, int8_t RESET_PIN, int8_t DAC_MUTE_PIN, int8_t SPI_CS_PIN) : _s(serial) {

_Serial = &serial;
resetPin = RESET_PIN;
dacMutePin = DAC_MUTE_PIN;
dacFltPin = DAC_FLT_PIN;
dacDempPin = DAC_DEMP_PIN;
spiCsPin = SPI_CS_PIN;

}
Expand Down Expand Up @@ -122,14 +120,6 @@ void DABDUINO::init() {
pinMode(dacMutePin, OUTPUT);
digitalWrite(dacMutePin, HIGH);

// DAC FLT
pinMode(dacFltPin, OUTPUT);
digitalWrite(dacFltPin, HIGH);

// DAC DEMP
pinMode(dacDempPin, OUTPUT);
digitalWrite(dacDempPin, LOW);

// SPI CS
pinMode(spiCsPin, OUTPUT);
digitalWrite(spiCsPin, LOW);
Expand Down
4 changes: 1 addition & 3 deletions src/DABDUINO.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class DABDUINO
{
public:

DABDUINO (HardwareSerial& serial, int8_t RESET_PIN, int8_t DAC_MUTE_PIN, int8_t DAC_FLT_PIN, int8_t DAC_DEMP_PIN, int8_t SPI_CS_PIN);
DABDUINO (HardwareSerial& serial, int8_t RESET_PIN, int8_t DAC_MUTE_PIN, int8_t SPI_CS_PIN);
Stream& _s;

unsigned char charToAscii(byte byte0, byte byte1);
Expand Down Expand Up @@ -123,8 +123,6 @@ class DABDUINO
HardwareSerial *_Serial;
int8_t resetPin;
int8_t dacMutePin;
int8_t dacFltPin;
int8_t dacDempPin;
int8_t spiCsPin;
};

0 comments on commit bb494ec

Please sign in to comment.