TNC (Terminal Node Controller)

Functions that provide a subset of the TNC functions. More...


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_ttncBufferPnt
 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).


Detailed Description

Functions that provide a subset of the TNC functions.

Define Documentation

#define TNC_BUFFER_SIZE   80

#define TNC_DWELL_TIME   3600

#define TNC_TIMESLOT   55

The UTC time in seconds to send an APRS packet.

Referenced by main().

#define TNC_TX_DELAY   45

The number of start flag bytes to send before the packet message. (300mS).

Referenced by tncTimeUpdate().


Enumeration Type Documentation

enum TNC_MODE

TNC state machine.

Enumerator:
TNC_TX_READY  Ready to accept a new message.
TNC_TX_SYNC  Send the sync pattern at the start of the message. This is typically 200-300mS.
TNC_TX_HEADER  Send the header that contains the callsign, path, and SSID information.
TNC_TX_DATA  Send the text message data.
TNC_TX_END  Send the end sequence.


Function Documentation

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

void tncInit (  ) 

bool_t tncIsFree (  ) 

Determine if the hardware if ready to transmit a 1200 baud packet.

Returns:
true if ready; otherwise false

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

void tncTimeUpdate (  ) 

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.

Parameters:
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().

Here is the call graph for this function:


Variable Documentation

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().

Audio tone NCO update step (phase).

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().

uint8_t tncBuffer[TNC_BUFFER_SIZE]

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().


Generated on Sun Oct 5 11:29:38 2008 for HF-APRS Beacon by  doxygen 1.5.7