Defines | |
#define | TNC_TX_DELAY 45 |
The number of start flag bytes to send before the packet message. (300mS). | |
#define | TNC_TIMESLOT 55 |
The UTC time in seconds to send an APRS packet. | |
#define | TNC_BUFFER_SIZE 80 |
#define | TNC_DWELL_TIME 3600 |
Enumerations | |
enum | TNC_MODE { TNC_TX_READY, TNC_TX_SYNC, TNC_TX_HEADER, TNC_TX_DATA, TNC_TX_END } |
TNC state machine. More... | |
Functions | |
void | tncInit () |
bool_t | tncIsFree () |
Determine if the hardware if ready to transmit a 1200 baud packet. | |
void | tncTimeUpdate () |
void | tncTxByte (uint8_t value) |
Write value to the TNC buffer. | |
void | tncNMEATime () |
Generate the GPS NMEA standard UTC time stamp. | |
void | tncNMEAFix () |
Generate the GPS NMEA standard latitude/longitude fix. | |
void | tncStatusPacket () |
Generate the plain text status packet. | |
void | tncGPGGAPacket () |
Generate the GPS NMEA-0183 $GPGGA packet. | |
void | tncGPRMCPacket () |
Generate the GPS NMEA-0183 $GPRMC packet. | |
void | tncTxPacket (TNC_PACKET_TYPE tncPacketType) |
Prepare an AX.25 data packet. | |
Variables | |
uint8_t | TNC_AX25_HEADER [30] |
uint8_t | tncLastBit |
uint8_t | tncPacketType |
TNC_MODE | tncMode |
Current mode of the 1200 bps state machine. | |
uint8_t | tncBitCount |
Counter for each bit (0 - 7) that we are going to transmit. | |
uint8_t | tncShift |
A shift register that holds the data byte as we bit shift it for transmit. | |
uint8_t | tncIndex |
Index into the APRS header and data array for each byte as we transmit it. | |
uint8_t | tncLength |
The number of bytes in the message portion of the AX.25 message. | |
uint8_t | tncBitStuff |
A copy of the last 5 bits we've transmitted to determine if we need to bit stuff on the next bit. | |
uint8_t * | tncBufferPnt |
Pointer to TNC buffer as we save each byte during message preparation. | |
uint8_t | tncBuffer [TNC_BUFFER_SIZE] |
Buffer to hold the message portion of the AX.25 packet as we prepare it. | |
uint16_t | tncTestCount |
uint16_t | timeNCO |
16-bit NCO where the upper 8-bits are used to index into the frequency generation table. | |
uint16_t | timeNCOFreq |
Audio tone NCO update step (phase). | |
uint8_t | timeLowRateCount |
Counter used to deciminate down from the 104uS to 833uS interrupt rate. (9600 to 1200 baud). |
#define TNC_BUFFER_SIZE 80 |
#define TNC_DWELL_TIME 3600 |
#define TNC_TIMESLOT 55 |
#define TNC_TX_DELAY 45 |
The number of start flag bytes to send before the packet message. (300mS).
Referenced by tncTimeUpdate().
enum TNC_MODE |
TNC state machine.
void tncGPGGAPacket | ( | ) |
Generate the GPS NMEA-0183 $GPGGA packet.
Data is written through the tncTxByte callback function.
References GPS_NO_FIX, gpsGetFixType(), gpsNMEAChecksum(), gpsPosition, tncBuffer, tncLength, tncNMEAFix(), tncNMEATime(), and tncTxByte().
Referenced by tncTxPacket().
void tncGPRMCPacket | ( | ) |
Generate the GPS NMEA-0183 $GPRMC packet.
Data is written through the tncTxByte callback function.
References GPS_NO_FIX, gpsGetFixType(), gpsNMEAChecksum(), gpsPosition, tncBuffer, tncLength, tncNMEAFix(), tncNMEATime(), and tncTxByte().
Referenced by tncTxPacket().
void tncInit | ( | ) |
References timeLowRateCount, timeNCO, timeNCOFreq, TNC_BOOT_MESSAGE, TNC_TX_READY, tncLastBit, tncMode, tncPacketType, and tncTestCount.
Referenced by main().
bool_t tncIsFree | ( | ) |
Determine if the hardware if ready to transmit a 1200 baud packet.
References TNC_TX_READY, and tncMode.
Referenced by psk31TxPacket().
void tncNMEAFix | ( | ) |
Generate the GPS NMEA standard latitude/longitude fix.
Data is written through the tncTxByte callback function.
References gpsPosition, and tncTxByte().
Referenced by tncGPGGAPacket(), and tncGPRMCPacket().
void tncNMEATime | ( | ) |
Generate the GPS NMEA standard UTC time stamp.
Data is written through the tncTxByte callback function.
References gpsPosition, and tncTxByte().
Referenced by tncGPGGAPacket(), and tncGPRMCPacket().
void tncStatusPacket | ( | ) |
Generate the plain text status packet.
Data is written through the tncTxByte callback function.
References GPS_2D_FIX, GPS_3D_FIX, GPS_NO_FIX, gpsGetFixType(), gpsPosition, lm92GetTemp(), timeHours, timeMinutes, timeSeconds, and tncTxByte().
Referenced by tncTxPacket().
void tncTimeUpdate | ( | ) |
References DDS_MODE_POWERDOWN, ddsPTT(), ddsSetFTW(), ddsSetMode(), freqTable, logSetDisableFlag(), sysPAOutput(), timeLowRateCount, timeNCO, timeNCOFreq, TNC_AX25_HEADER, TNC_TX_DATA, TNC_TX_DELAY, TNC_TX_END, TNC_TX_HEADER, TNC_TX_READY, TNC_TX_SYNC, tncBitCount, tncBitStuff, tncBuffer, tncIndex, tncLastBit, tncLength, tncMode, and tncShift.
Referenced by timeUpdate().
void tncTxByte | ( | uint8_t | value | ) |
Write value to the TNC buffer.
Maintain the pointer and length to the buffer. The pointer tncBufferPnt and tncLength must be set before calling this function for the first time.
value | to save to telemetry buffer |
References tncBufferPnt, and tncLength.
Referenced by tncGPGGAPacket(), tncGPRMCPacket(), tncNMEAFix(), tncNMEATime(), tncStatusPacket(), and tncTxPacket().
void tncTxPacket | ( | TNC_PACKET_TYPE | tncPacketType | ) |
Prepare an AX.25 data packet.
Each time this method is called, it automatically rotates through 1 of 4 messages.
References DDS_MODE_APRS, ddsPTT(), ddsSetAmplitude(), ddsSetMode(), logSetDisableFlag(), psk31IsFree(), sysCRC16(), sysPAOutput(), TIME_MODE_APRS, timeSetMode(), TNC_AX25_HEADER, TNC_BOOT_MESSAGE, TNC_GGA, TNC_RMC, TNC_STATUS, TNC_TX_READY, TNC_TX_SYNC, tncBitCount, tncBuffer, tncBufferPnt, tncGPGGAPacket(), tncGPRMCPacket(), tncIndex, tncLastBit, tncLength, tncMode, tncShift, tncStatusPacket(), and tncTxByte().
Referenced by main().
Counter used to deciminate down from the 104uS to 833uS interrupt rate. (9600 to 1200 baud).
Referenced by tncInit(), and tncTimeUpdate().
16-bit NCO where the upper 8-bits are used to index into the frequency generation table.
Referenced by tncInit(), and tncTimeUpdate().
Initial value:
{ 'A' << 1, 'P' << 1, 'R' << 1, 'S' << 1, ' ' << 1, ' ' << 1, 0x60, 'K' << 1, 'D' << 1, '7' << 1, 'L' << 1, 'M' << 1, 'O' << 1, 0x76, 'G' << 1, 'A' << 1, 'T' << 1, 'E' << 1, ' ' << 1, ' ' << 1, 0x60, 'W' << 1, 'I' << 1, 'D' << 1, 'E' << 1, '3' << 1, ' ' << 1, 0x67, 0x03, 0xf0 }
Referenced by tncTimeUpdate(), and tncTxPacket().
Counter for each bit (0 - 7) that we are going to transmit.
Referenced by tncTimeUpdate(), and tncTxPacket().
A copy of the last 5 bits we've transmitted to determine if we need to bit stuff on the next bit.
Referenced by tncTimeUpdate().
Buffer to hold the message portion of the AX.25 packet as we prepare it.
Referenced by tncGPGGAPacket(), tncGPRMCPacket(), tncTimeUpdate(), and tncTxPacket().
Pointer to TNC buffer as we save each byte during message preparation.
Referenced by tncTxByte(), and tncTxPacket().
Index into the APRS header and data array for each byte as we transmit it.
Referenced by tncTimeUpdate(), and tncTxPacket().
Referenced by tncInit(), tncTimeUpdate(), and tncTxPacket().
The number of bytes in the message portion of the AX.25 message.
Referenced by tncGPGGAPacket(), tncGPRMCPacket(), tncTimeUpdate(), tncTxByte(), and tncTxPacket().
Current mode of the 1200 bps state machine.
Referenced by tncInit(), tncIsFree(), tncTimeUpdate(), and tncTxPacket().
Referenced by tncInit().
A shift register that holds the data byte as we bit shift it for transmit.
Referenced by tncTimeUpdate(), and tncTxPacket().
Referenced by tncInit().