unify pin naming scheme
This commit is contained in:
parent
9d708e4046
commit
3c3d83c057
|
@ -22,7 +22,7 @@
|
|||
#include <packet.h>
|
||||
#include <avr/wdt.h>
|
||||
|
||||
#define PWM_PIN 3
|
||||
#define MIC_PIN 3
|
||||
#define RESET_PIN A3
|
||||
#define SWITCH_PIN 2
|
||||
|
||||
|
@ -37,8 +37,8 @@ int msgptr = 0;
|
|||
|
||||
void setup() {
|
||||
// NOTE: if not using PWM out, it should be held low to avoid tx noise
|
||||
pinMode(PWM_PIN, OUTPUT);
|
||||
digitalWrite(PWM_PIN, LOW);
|
||||
pinMode(MIC_PIN, OUTPUT);
|
||||
digitalWrite(MIC_PIN, LOW);
|
||||
|
||||
// prep the switch
|
||||
pinMode(SWITCH_PIN, INPUT_PULLUP);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include <HamShield.h>
|
||||
|
||||
#define PWM_PIN 3
|
||||
#define MIC_PIN 3
|
||||
#define RESET_PIN A3
|
||||
#define SWITCH_PIN 2
|
||||
|
||||
|
@ -17,8 +17,8 @@ uint8_t pl_rx_buffer[32];
|
|||
|
||||
void setup() {
|
||||
// NOTE: if not using PWM out, it should be held low to avoid tx noise
|
||||
pinMode(PWM_PIN, OUTPUT);
|
||||
digitalWrite(PWM_PIN, LOW);
|
||||
pinMode(MIC_PIN, OUTPUT);
|
||||
digitalWrite(MIC_PIN, LOW);
|
||||
|
||||
// prep the switch
|
||||
pinMode(SWITCH_PIN, INPUT_PULLUP);
|
||||
|
|
|
@ -29,7 +29,7 @@ HamShield radio;
|
|||
#define LED_PIN 13
|
||||
#define RSSI_REPORT_RATE_MS 5000
|
||||
|
||||
#define PWM_PIN 3
|
||||
#define MIC_PIN 3
|
||||
#define RESET_PIN A3
|
||||
#define SWITCH_PIN 2
|
||||
|
||||
|
@ -43,8 +43,8 @@ unsigned long rssi_timeout;
|
|||
|
||||
void setup() {
|
||||
// NOTE: if not using PWM out, it should be held low to avoid tx noise
|
||||
pinMode(PWM_PIN, OUTPUT);
|
||||
digitalWrite(PWM_PIN, LOW);
|
||||
pinMode(MIC_PIN, OUTPUT);
|
||||
digitalWrite(MIC_PIN, LOW);
|
||||
|
||||
// prep the switch
|
||||
pinMode(SWITCH_PIN, INPUT_PULLUP);
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include <HamShield.h>
|
||||
#include <DDS.h>
|
||||
|
||||
#define PWM_PIN 3
|
||||
#define MIC_PIN 3
|
||||
#define RESET_PIN A3
|
||||
#define SWITCH_PIN 2
|
||||
|
||||
|
@ -26,8 +26,8 @@ DDS dds;
|
|||
|
||||
void setup() {
|
||||
// NOTE: if not using PWM out, it should be held low to avoid tx noise
|
||||
pinMode(PWM_PIN, OUTPUT);
|
||||
digitalWrite(PWM_PIN, LOW);
|
||||
pinMode(MIC_PIN, OUTPUT);
|
||||
digitalWrite(MIC_PIN, LOW);
|
||||
|
||||
// prep the switch
|
||||
pinMode(SWITCH_PIN, INPUT_PULLUP);
|
||||
|
|
|
@ -20,7 +20,7 @@ HamShield radio;
|
|||
|
||||
#define LED_PIN 13
|
||||
|
||||
#define PWM_PIN 3
|
||||
#define MIC_PIN 3
|
||||
#define RESET_PIN A3
|
||||
#define SWITCH_PIN 2
|
||||
|
||||
|
@ -28,8 +28,8 @@ uint32_t freq;
|
|||
|
||||
void setup() {
|
||||
// NOTE: if not using PWM out, it should be held low to avoid tx noise
|
||||
pinMode(PWM_PIN, OUTPUT);
|
||||
digitalWrite(PWM_PIN, LOW);
|
||||
pinMode(MIC_PIN, OUTPUT);
|
||||
digitalWrite(MIC_PIN, LOW);
|
||||
|
||||
// prep the switch
|
||||
pinMode(SWITCH_PIN, INPUT_PULLUP);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#define DDS_REFCLK_DEFAULT 9600
|
||||
#include <HamShield.h>
|
||||
|
||||
#define PWM_PIN 3
|
||||
#define MIC_PIN 3
|
||||
#define RESET_PIN A3
|
||||
#define SWITCH_PIN 2
|
||||
|
||||
|
@ -25,8 +25,8 @@ HamShield radio;
|
|||
// Run our start up things here
|
||||
void setup() {
|
||||
// NOTE: if not using PWM out, it should be held low to avoid tx noise
|
||||
pinMode(PWM_PIN, OUTPUT);
|
||||
digitalWrite(PWM_PIN, LOW);
|
||||
pinMode(MIC_PIN, OUTPUT);
|
||||
digitalWrite(MIC_PIN, LOW);
|
||||
|
||||
// prep the switch
|
||||
pinMode(SWITCH_PIN, INPUT_PULLUP);
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
#include <HamShield.h>
|
||||
|
||||
#define PWM_PIN 3
|
||||
#define MIC_PIN 3
|
||||
#define RESET_PIN A3
|
||||
#define SWITCH_PIN 2
|
||||
|
||||
|
@ -29,8 +29,8 @@ HamShield radio;
|
|||
|
||||
void setup() {
|
||||
// NOTE: if not using PWM out, it should be held low to avoid tx noise
|
||||
pinMode(PWM_PIN, OUTPUT);
|
||||
digitalWrite(PWM_PIN, LOW);
|
||||
pinMode(MIC_PIN, OUTPUT);
|
||||
digitalWrite(MIC_PIN, LOW);
|
||||
|
||||
// prep the switch
|
||||
pinMode(SWITCH_PIN, INPUT_PULLUP);
|
||||
|
@ -79,7 +79,7 @@ void loop() {
|
|||
radio.setModeTransmit();
|
||||
|
||||
// Generate a 600Hz tone for TRANSMITLENGTH time
|
||||
tone(PWM_PIN, 600, TRANSMITLENGTH);
|
||||
tone(MIC_PIN, 600, TRANSMITLENGTH);
|
||||
delay(TRANSMITLENGTH);
|
||||
|
||||
// Identify the transmitter
|
||||
|
|
|
@ -26,7 +26,7 @@ HamShield radio;
|
|||
#define LED_PIN 13
|
||||
#define RSSI_REPORT_RATE_MS 5000
|
||||
|
||||
#define PWM_PIN 3
|
||||
#define MIC_PIN 3
|
||||
#define RESET_PIN A3
|
||||
#define SWITCH_PIN 2
|
||||
|
||||
|
@ -39,8 +39,8 @@ unsigned long rssi_timeout;
|
|||
|
||||
void setup() {
|
||||
// NOTE: if not using PWM out, it should be held low to avoid tx noise
|
||||
pinMode(PWM_PIN, OUTPUT);
|
||||
digitalWrite(PWM_PIN, LOW);
|
||||
pinMode(MIC_PIN, OUTPUT);
|
||||
digitalWrite(MIC_PIN, LOW);
|
||||
|
||||
// prep the switch
|
||||
pinMode(SWITCH_PIN, INPUT_PULLUP);
|
||||
|
|
|
@ -35,14 +35,14 @@ DDS dds;
|
|||
AFSK afsk;
|
||||
KISS kiss(&Serial, &radio, &dds, &afsk);
|
||||
|
||||
#define PWM_PIN 3
|
||||
#define MIC_PIN 3
|
||||
#define RESET_PIN A3
|
||||
#define SWITCH_PIN 2
|
||||
|
||||
void setup() {
|
||||
// NOTE: if not using PWM out, it should be held low to avoid tx noise
|
||||
pinMode(PWM_PIN, OUTPUT);
|
||||
digitalWrite(PWM_PIN, LOW);
|
||||
pinMode(MIC_PIN, OUTPUT);
|
||||
digitalWrite(MIC_PIN, LOW);
|
||||
|
||||
// prep the switch
|
||||
pinMode(SWITCH_PIN, INPUT_PULLUP);
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#define DDS_REFCLK_DEFAULT 9600
|
||||
#include <HamShield.h>
|
||||
|
||||
#define PWM_PIN 3
|
||||
#define MIC_PIN 3
|
||||
#define RESET_PIN A3
|
||||
#define SWITCH_PIN 2
|
||||
|
||||
|
@ -48,8 +48,8 @@ uint8_t rx_idx;
|
|||
// Run our start up things here
|
||||
void setup() {
|
||||
// NOTE: if not using PWM out, it should be held low to avoid tx noise
|
||||
pinMode(PWM_PIN, OUTPUT);
|
||||
digitalWrite(PWM_PIN, LOW);
|
||||
pinMode(MIC_PIN, OUTPUT);
|
||||
digitalWrite(MIC_PIN, LOW);
|
||||
|
||||
// prep the switch
|
||||
pinMode(SWITCH_PIN, INPUT_PULLUP);
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
* 446MHz to receive the image output.
|
||||
*/
|
||||
|
||||
#define PWM_PIN 3
|
||||
#define MIC_PIN 3
|
||||
#define RESET_PIN A3
|
||||
#define SWITCH_PIN 2
|
||||
|
||||
|
@ -28,8 +28,8 @@ int16_t rssi;
|
|||
|
||||
void setup() {
|
||||
// NOTE: if not using PWM out, it should be held low to avoid tx noise
|
||||
pinMode(PWM_PIN, OUTPUT);
|
||||
digitalWrite(PWM_PIN, LOW);
|
||||
pinMode(MIC_PIN, OUTPUT);
|
||||
digitalWrite(MIC_PIN, LOW);
|
||||
|
||||
// prep the switch
|
||||
pinMode(SWITCH_PIN, INPUT_PULLUP);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include <HamShield.h>
|
||||
#include <DDS.h>
|
||||
|
||||
#define PWM_PIN 3
|
||||
#define MIC_PIN 3
|
||||
#define RESET_PIN A3
|
||||
#define SWITCH_PIN 2
|
||||
|
||||
|
@ -32,8 +32,8 @@ ddsAccumulator_t freqTable[3];
|
|||
|
||||
void setup() {
|
||||
// NOTE: if not using PWM out, it should be held low to avoid tx noise
|
||||
pinMode(PWM_PIN, OUTPUT);
|
||||
digitalWrite(PWM_PIN, LOW);
|
||||
pinMode(MIC_PIN, OUTPUT);
|
||||
digitalWrite(MIC_PIN, LOW);
|
||||
|
||||
// prep the switch
|
||||
pinMode(SWITCH_PIN, INPUT_PULLUP);
|
||||
|
|
|
@ -47,7 +47,7 @@ Debug Msg @<text>; 32 character debug message
|
|||
|
||||
#include "HamShield.h"
|
||||
|
||||
#define PWM_PIN 3
|
||||
#define MIC_PIN 3
|
||||
#define RESET_PIN A3
|
||||
#define SWITCH_PIN 2
|
||||
|
||||
|
@ -71,8 +71,8 @@ HamShield radio;
|
|||
|
||||
void setup() {
|
||||
// NOTE: if not using PWM out, it should be held low to avoid tx noise
|
||||
pinMode(PWM_PIN, OUTPUT);
|
||||
digitalWrite(PWM_PIN, LOW);
|
||||
pinMode(MIC_PIN, OUTPUT);
|
||||
digitalWrite(MIC_PIN, LOW);
|
||||
|
||||
// prep the switch
|
||||
pinMode(SWITCH_PIN, INPUT_PULLUP);
|
||||
|
|
|
@ -25,7 +25,7 @@ char CALLSIGN[] = "1ZZ9ZZ/B";
|
|||
#include <HamShield.h>
|
||||
#include <PCM.h>
|
||||
|
||||
#define PWM_PIN 3
|
||||
#define MIC_PIN 3
|
||||
#define RESET_PIN A3
|
||||
#define SWITCH_PIN 2
|
||||
|
||||
|
@ -90,8 +90,8 @@ const unsigned char dbm[] PROGMEM = {
|
|||
|
||||
void setup() {
|
||||
// NOTE: if not using PWM out, it should be held low to avoid tx noise
|
||||
pinMode(PWM_PIN, OUTPUT);
|
||||
digitalWrite(PWM_PIN, LOW);
|
||||
pinMode(MIC_PIN, OUTPUT);
|
||||
digitalWrite(MIC_PIN, LOW);
|
||||
|
||||
// prep the switch
|
||||
pinMode(SWITCH_PIN, INPUT_PULLUP);
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#include <HamShield.h>
|
||||
|
||||
#define PWM_PIN 3
|
||||
#define MIC_PIN 3
|
||||
#define RESET_PIN A3
|
||||
#define SWITCH_PIN 2
|
||||
|
||||
|
@ -230,8 +230,8 @@ const uint8_t spYELLOW[] PROGMEM = {0x69,0xBD,0x56,0x15,0xAC,0x67,0xE5,0x
|
|||
|
||||
void setup() {
|
||||
// NOTE: if not using PWM out, it should be held low to avoid tx noise
|
||||
pinMode(PWM_PIN, OUTPUT);
|
||||
digitalWrite(PWM_PIN, HIGH);
|
||||
pinMode(MIC_PIN, OUTPUT);
|
||||
digitalWrite(MIC_PIN, HIGH);
|
||||
|
||||
// prep the switch
|
||||
pinMode(SWITCH_PIN, INPUT_PULLUP);
|
||||
|
|
|
@ -125,11 +125,11 @@ const unsigned char AFSK_space[] PROGMEM = { 140, 228, 250, 166, 53, 0, 53, 166,
|
|||
* @see A1846S_ADDRESS_AD0_LOW
|
||||
* @see A1846S_ADDRESS_AD0_HIGH
|
||||
*/
|
||||
HamShield::HamShield(uint8_t cs_pin = nSEN, uint8_t clk_pin = CLK, uint8_t dat_pin = DAT, uint8_t pwm_pin = HAMSHIELD_PWM_PIN) {
|
||||
devAddr = cs_pin;
|
||||
hs_pwm_pin = pwm_pin;
|
||||
HamShield::HamShield(uint8_t ncs_pin = nSEN, uint8_t clk_pin = CLK, uint8_t dat_pin = DAT, uint8_t mic_pin = MIC) {
|
||||
devAddr = ncs_pin;
|
||||
hs_mic_pin = mic_pin;
|
||||
|
||||
HSsetPins(cs_pin, clk_pin, dat_pin);
|
||||
HSsetPins(ncs_pin, clk_pin, dat_pin);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1598,12 +1598,12 @@ void HamShield::morseOut(char buffer[HAMSHIELD_MORSE_BUFFER_SIZE]) {
|
|||
// We delay by 4 here, if we previously sent a symbol. Otherwise 7.
|
||||
// This could probably just be always 7 and go relatively unnoticed.
|
||||
if(prev == 0 || prev == ' '){
|
||||
//tone(hs_pwm_pin, 6000, morse_dot_millis * 7);
|
||||
HSnoTone(hs_pwm_pin);
|
||||
//tone(hs_mic_pin, 6000, morse_dot_millis * 7);
|
||||
HSnoTone(hs_mic_pin);
|
||||
HSdelay(morse_dot_millis*7);
|
||||
} else {
|
||||
//tone(hs_pwm_pin, 6000, morse_dot_millis * 4);
|
||||
HSnoTone(hs_pwm_pin);
|
||||
//tone(hs_mic_pin, 6000, morse_dot_millis * 4);
|
||||
HSnoTone(hs_mic_pin);
|
||||
HSdelay(morse_dot_millis*4);
|
||||
}
|
||||
continue;
|
||||
|
@ -1613,23 +1613,23 @@ void HamShield::morseOut(char buffer[HAMSHIELD_MORSE_BUFFER_SIZE]) {
|
|||
if(bits) { // If it is a valid character...
|
||||
do {
|
||||
if(bits & 1) {
|
||||
HStone(hs_pwm_pin, morse_freq);//, morse_dot_millis * 3);
|
||||
HStone(hs_mic_pin, morse_freq);//, morse_dot_millis * 3);
|
||||
HSdelay(morse_dot_millis*3);
|
||||
HSnoTone(hs_pwm_pin);
|
||||
HSnoTone(hs_mic_pin);
|
||||
} else {
|
||||
HStone(hs_pwm_pin, morse_freq);//, morse_dot_millis);
|
||||
HStone(hs_mic_pin, morse_freq);//, morse_dot_millis);
|
||||
HSdelay(morse_dot_millis);
|
||||
HSnoTone(hs_pwm_pin);
|
||||
HSnoTone(hs_mic_pin);
|
||||
}
|
||||
//tone(hs_pwm_pin, 6000, morse_dot_millis);
|
||||
HSnoTone(hs_pwm_pin);
|
||||
//tone(hs_mic_pin, 6000, morse_dot_millis);
|
||||
HSnoTone(hs_mic_pin);
|
||||
HSdelay(morse_dot_millis);
|
||||
bits >>= 1; // Shift into the next symbol
|
||||
} while(bits != 1); // Wait for 1 termination to be all we have left
|
||||
}
|
||||
// End of character
|
||||
//tone(hs_pwm_pin, 6000, morse_dot_millis * 3);
|
||||
HSnoTone(hs_pwm_pin);
|
||||
//tone(hs_mic_pin, 6000, morse_dot_millis * 3);
|
||||
HSnoTone(hs_mic_pin);
|
||||
HSdelay(morse_dot_millis * 3);
|
||||
}
|
||||
return;
|
||||
|
@ -1760,20 +1760,20 @@ void HamShield::SSTVTestPattern(int code) {
|
|||
/* wait for tone to complete */
|
||||
|
||||
void HamShield::toneWait(uint16_t freq, long timer) {
|
||||
HStone(hs_pwm_pin,freq);//,timer);
|
||||
HStone(hs_mic_pin,freq);//,timer);
|
||||
HSdelay(timer);
|
||||
HSnoTone(hs_pwm_pin);
|
||||
HSnoTone(hs_mic_pin);
|
||||
}
|
||||
|
||||
/* wait microseconds for tone to complete */
|
||||
|
||||
void HamShield::toneWaitU(uint16_t freq, long timer) {
|
||||
if(freq < 16383) {
|
||||
HStone(hs_pwm_pin,freq);
|
||||
HSdelayMicroseconds(timer); HSnoTone(hs_pwm_pin); return;
|
||||
HStone(hs_mic_pin,freq);
|
||||
HSdelayMicroseconds(timer); HSnoTone(hs_mic_pin); return;
|
||||
}
|
||||
HStone(hs_pwm_pin,freq);
|
||||
HSdelay(timer / 1000); HSnoTone(hs_pwm_pin); return;
|
||||
HStone(hs_mic_pin,freq);
|
||||
HSdelay(timer / 1000); HSnoTone(hs_mic_pin); return;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -220,7 +220,7 @@
|
|||
|
||||
class HamShield {
|
||||
public:
|
||||
HamShield(uint8_t cs_pin = nSEN, uint8_t clk_pin = CLK, uint8_t dat_pin = DAT, uint8_t pwm_pin = HAMSHIELD_PWM_PIN);
|
||||
HamShield(uint8_t ncs_pin = nCS, uint8_t clk_pin = CLK, uint8_t dat_pin = DAT, uint8_t mic_pin = MIC);
|
||||
|
||||
void initialize(); // defaults to 12.5kHz
|
||||
void initialize(bool narrowBand); // select 12.5kHz if true or 25kHz if false
|
||||
|
@ -496,7 +496,7 @@ class HamShield {
|
|||
|
||||
private:
|
||||
uint8_t devAddr;
|
||||
uint8_t hs_pwm_pin;
|
||||
uint8_t hs_mic_pin;
|
||||
uint16_t radio_i2c_buf[4];
|
||||
bool tx_active;
|
||||
bool rx_active;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "Arduino.h"
|
||||
//#include "I2Cdev.h"
|
||||
|
||||
uint8_t ncs_pin = nSEN;
|
||||
uint8_t ncs_pin = nCS;
|
||||
uint8_t clk_pin = CLK;
|
||||
uint8_t dat_pin = DAT;
|
||||
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
#include "stdint.h"
|
||||
|
||||
#include "Arduino.h"
|
||||
#define nSEN A1 //15 //
|
||||
#define nCS A1 //15 //
|
||||
#define CLK A5 //19 //
|
||||
#define DAT A4 //18 //
|
||||
#define HAMSHIELD_PWM_PIN 3 // Pin assignment for PWM output
|
||||
#define MIC 3 // Pin assignment for PWM output
|
||||
|
||||
|
||||
void HSsetPins(uint8_t ncs, uint8_t clk, uint8_t dat);
|
||||
|
|
Loading…
Reference in New Issue