Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f7db1d561 | ||
|
|
d8d97789d7 | ||
|
|
d232424bb4 | ||
|
|
6538ae7db3 |
@@ -1,5 +1,5 @@
|
|||||||
name=HamShield
|
name=HamShield
|
||||||
version=1.0.3
|
version=1.0.5
|
||||||
author=Morgan Redfield <morgan@enhancedradio.com>, Casey Halverson <casey@enhancedradio.com>
|
author=Morgan Redfield <morgan@enhancedradio.com>, Casey Halverson <casey@enhancedradio.com>
|
||||||
maintainer=Morgan Redfield <morgan@enhancedradio.com>
|
maintainer=Morgan Redfield <morgan@enhancedradio.com>
|
||||||
sentence=A library for use with HamShield by Enhanced Radio Devices.
|
sentence=A library for use with HamShield by Enhanced Radio Devices.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// HamShield library collection
|
// HamShield library collection
|
||||||
// Based on Programming Manual rev. 2.0, 5/19/2011 (RM-MPU-6000A-00)
|
// Based on Programming Manual rev. 2.0, 5/19/2011 (RM-MPU-6000A-00)
|
||||||
// 11/22/2013 by Morgan Redfield <redfieldm@gmail.com>
|
// 11/22/2013 by Morgan Redfield <redfieldm@gmail.com>
|
||||||
// 04/26/2015 various changes Casey Halverson <spaceneedle@gmail.com>
|
// 04/26/2015 various changes Casey Halverson <spaceneedle@gmail.com>
|
||||||
@@ -105,11 +105,11 @@ const uint16_t asciiMorseProgmem[] PROGMEM = {
|
|||||||
};
|
};
|
||||||
#endif // MORSE_TABLE_PROGMEM
|
#endif // MORSE_TABLE_PROGMEM
|
||||||
|
|
||||||
/* 2200 Hz */
|
/* 2200 Hz -- This lookup table should be deprecated */
|
||||||
|
|
||||||
const unsigned char AFSK_mark[] PROGMEM = { 154, 249, 91, 11, 205, 216, 25, 68, 251, 146, 0, 147, 250, 68, 24, 218, 203, 13, 88, 254, 128, 1, 167, 242, 52, 37, 231, 186, 5, 108, 255, 108, 5, 186, 231, 37, 52, 242, 167, 1, 128, 254, 88, 13, 203, 218, 24, 69, 250, 147, 0, 147, 250, 69, 24, 218, 203, 13, 88, 255, 127, 2, 165, 245, 48 };
|
const unsigned char AFSK_mark[] PROGMEM = { 154, 249, 91, 11, 205, 216, 25, 68, 251, 146, 0, 147, 250, 68, 24, 218, 203, 13, 88, 254, 128, 1, 167, 242, 52, 37, 231, 186, 5, 108, 255, 108, 5, 186, 231, 37, 52, 242, 167, 1, 128, 254, 88, 13, 203, 218, 24, 69, 250, 147, 0, 147, 250, 69, 24, 218, 203, 13, 88, 255, 127, 2, 165, 245, 48 };
|
||||||
|
|
||||||
/* 1200 Hz */
|
/* 1200 Hz -- This lookup table should be deprecated */
|
||||||
|
|
||||||
const unsigned char AFSK_space[] PROGMEM = { 140, 228, 250, 166, 53, 0, 53, 166, 249, 230, 128, 24, 7, 88, 203, 255, 203, 88, 7, 24, 128, 230, 249, 167, 53, 0, 53, 167, 249, 230, 128, 24, 6, 88, 202, 255, 202, 88, 6, 24, 127, 231, 249, 167, 52, 0, 52, 167, 248, 231, 127, 25, 6, 89, 202, 255, 202, 89, 6, 25, 127, 231, 248, 167, 53, 0, 54, 165, 251, 227, 133, 14};
|
const unsigned char AFSK_space[] PROGMEM = { 140, 228, 250, 166, 53, 0, 53, 166, 249, 230, 128, 24, 7, 88, 203, 255, 203, 88, 7, 24, 128, 230, 249, 167, 53, 0, 53, 167, 249, 230, 128, 24, 6, 88, 202, 255, 202, 88, 6, 24, 127, 231, 249, 167, 52, 0, 52, 167, 248, 231, 127, 25, 6, 89, 202, 255, 202, 89, 6, 25, 127, 231, 248, 167, 53, 0, 54, 165, 251, 227, 133, 14};
|
||||||
|
|
||||||
@@ -672,6 +672,35 @@ uint16_t HamShield::getPABiasVoltage(){
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
// Subaudio settings
|
// Subaudio settings
|
||||||
|
|
||||||
|
|
||||||
|
// recommended function for placing CTCSS tone on channel -- schedule remainder for deprecation
|
||||||
|
|
||||||
|
|
||||||
|
// ctcss freq encoder
|
||||||
|
void HamShield::setCtcssEncoder(float freq) {
|
||||||
|
int dfreq = freq * 100; // Convert float into whole number (ctcss freq * 100)
|
||||||
|
setCtcssFreq(dfreq); // program CTCSS frequency buffer
|
||||||
|
HSwriteBitW(devAddr, A1846S_CTCSS_FREQ_PRG, 10, 1); // program CTCSS frequency buffer into CTCSS encoder (step 1)
|
||||||
|
HSwriteBitW(devAddr, A1846S_CTCSS_FREQ_PRG, 9, 1); // program CTCSS frequency buffer into CTCSS encoder (step 2)
|
||||||
|
}
|
||||||
|
|
||||||
|
// recommended function for detecting (and requiring) CTCSS to be on channel before audio is unmuted -- schedule remainder for deprecation
|
||||||
|
|
||||||
|
// ctcss freq decoder
|
||||||
|
void HamShield::setCtcssDecoder(float freq) {
|
||||||
|
int dfreq = freq * 100; // Convert float into whole number (ctcss freq * 100)
|
||||||
|
setCtcssFreq(dfreq); // program CTCSS frequency buffer
|
||||||
|
HSwriteBitW(devAddr, A1846S_CTCSS_FREQ_PRG, 10, 1); // program CTCSS frequency buffer into CTCSS encoder (step 1)
|
||||||
|
HSwriteBitW(devAddr, A1846S_CTCSS_FREQ_PRG, 9, 1); // program CTCSS frequency buffer into CTCSS encoder (step 2)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// TX and RX code
|
// TX and RX code
|
||||||
/*
|
/*
|
||||||
Set code mode:
|
Set code mode:
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// Based on Programming Manual rev. 2.0, 5/19/2011 (RM-MPU-6000A-00)
|
// Based on Programming Manual rev. 2.0, 5/19/2011 (RM-MPU-6000A-00)
|
||||||
// 11/22/2013 by Morgan Redfield <redfieldm@gmail.com>
|
// 11/22/2013 by Morgan Redfield <redfieldm@gmail.com>
|
||||||
// 04/26/2015 various changes Casey Halverson <spaceneedle@gmail.com>
|
// 04/26/2015 various changes Casey Halverson <spaceneedle@gmail.com>
|
||||||
|
// 05/08/2017 CTCSS code added
|
||||||
|
|
||||||
|
|
||||||
#ifndef _HAMSHIELD_H_
|
#ifndef _HAMSHIELD_H_
|
||||||
@@ -47,6 +47,7 @@
|
|||||||
#define A1846S_CTCSS_FREQ_REG 0x4A // ctcss_freq<15:0>
|
#define A1846S_CTCSS_FREQ_REG 0x4A // ctcss_freq<15:0>
|
||||||
#define A1846S_CDCSS_CODE_HI_REG 0x4B // cdcss_code<23:16>
|
#define A1846S_CDCSS_CODE_HI_REG 0x4B // cdcss_code<23:16>
|
||||||
#define A1846S_CDCSS_CODE_LO_REG 0x4C // cdccs_code<15:0>
|
#define A1846S_CDCSS_CODE_LO_REG 0x4C // cdccs_code<15:0>
|
||||||
|
#define A1846S_CTCSS_FREQ_PRG 0x4e // copies CTCSS value from A1846S_CTCSS_FREQ_REG into CTCSS encoder
|
||||||
#define A1846S_SQ_OUT_SEL_REG 0x54 // see sq
|
#define A1846S_SQ_OUT_SEL_REG 0x54 // see sq
|
||||||
#define A1846S_EMPH_FILTER_REG 0x58
|
#define A1846S_EMPH_FILTER_REG 0x58
|
||||||
#define A1846S_FLAG_REG 0x5C // holds flags for different statuses
|
#define A1846S_FLAG_REG 0x5C // holds flags for different statuses
|
||||||
@@ -311,6 +312,15 @@ class HamShield {
|
|||||||
|
|
||||||
// Subaudio settings
|
// Subaudio settings
|
||||||
|
|
||||||
|
// Recommended user function for setting and receiving CTCSS does
|
||||||
|
// TODO: set others to private and/or deprecate
|
||||||
|
|
||||||
|
void setCtcssEncoder(float freq); // generate sub audio tone on channel when transmitting
|
||||||
|
void setCtcssDecoder(float freq); // unmute audio on tone present when receiving channel
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Ctcss/cdcss mode sel
|
// Ctcss/cdcss mode sel
|
||||||
// x00=disable,
|
// x00=disable,
|
||||||
// 001=inner ctcss en,
|
// 001=inner ctcss en,
|
||||||
|
|||||||
Reference in New Issue
Block a user