#
# DESCRIPTION:
# titxt.tcl is part of the binconvert package. binconvert is a package
# that reads & writes EEPROM memory files in multiple formats.
# It converts the data to & from a Tcl representation as a list of
# data segments, which is available for processing.
#
# titxt.tcl contains all the support procs for the form generated by TI's
#
###########################################################################
#
# This package documentation is auto-generated with
# Pycco: <https://pycco-docs.github.io/pycco/>
#
# Use "pycco *filename*" to re-generate HTML documentation in ./docs .
#
#--------------------------------------------------------------------------
## Procedures for TI Text Format
#
# For details on the TI Text format, see
# <http://manpages.ubuntu.com/manpages/trusty/man5/srec_ti_txt.5.html>
#
#--------------------------------------------------------------------------
# <a name="ProcessTitxtLine"></a>
### ProcessTitxtLine
# *ProcessTitxtLine* is the parser for the readline proc. Since TI-TXT is a
# very simple format, and since the line types do not have a common format,
................................................................................
# <a name="WriteTitxtFile"></a>
### WriteTitxtFile
# *WriteTitxtFile* iterates over the segments of the segment list.
#
proc ::binconvert::WriteTitxtFile {segmentList outchan} {
foreach {addr dataL} $segmentList {
# For each segment, write the address as an address line
# (e.g., @5C00).
puts $outchan [format "\@%X" $addr]
# The address is followed by the data in lines of 16 bytes,
# with any short line at the end. Each byte is represented by
# two hex digits, separated by a space.
set outS ""

#
# DESCRIPTION:
# titxt.tcl is part of the binconvert package. binconvert is a package
# that reads & writes EEPROM memory files in multiple formats.
# It converts the data to & from a Tcl representation as a list of
# data segments, which is available for processing.
#
# titxt.tcl contains all the support procs for the format generated by TI's
# Code Composer tools and used by TI's MSP430 programmer.
#
###########################################################################
#
# This package documentation is auto-generated with
# Pycco: <https://pycco-docs.github.io/pycco/>
#
# Use "pycco *filename*" to re-generate HTML documentation in ./docs .
#
#--------------------------------------------------------------------------
## Procedures for TI Text Format
#
# For details on the TI Text format, see
# <http://manpages.ubuntu.com/manpages/trusty/man5/srec_ti_txt.5.html> or# <http://www.ti.com/lit/ug/slau101q/slau101q.pdf#[{"num":96,"gen":0},{"name":"XYZ"},0,718,0]>
#
#--------------------------------------------------------------------------
# <a name="ProcessTitxtLine"></a>
### ProcessTitxtLine
# *ProcessTitxtLine* is the parser for the readline proc. Since TI-TXT is a
# very simple format, and since the line types do not have a common format,
................................................................................
# <a name="WriteTitxtFile"></a>
### WriteTitxtFile
# *WriteTitxtFile* iterates over the segments of the segment list.
#
proc ::binconvert::WriteTitxtFile {segmentList outchan} {
foreach {addr dataL} $segmentList {
# TI Text format can't express header or execution address segments. if {($addr eq "HEADER") || ($addr eq "STARTADDR")} { continue }
# For each data segment, write the address as an address line
# (e.g., @5C00).
puts $outchan [format "\@%X" $addr]
# The address is followed by the data in lines of 16 bytes,
# with any short line at the end. Each byte is represented by
# two hex digits, separated by a space.
set outS ""