@csllc/swee-file
v1.0.2
Published
Defines a read/write interface for a configuration file format
Downloads
19
Keywords
Readme
SWEE File Reader/Writer
This package parses and writes the 'SWEE' file format used by Control Solutions.
Refer to the test/ folder for examples.
SWEE File Format
# Each line begins with an alphanumeric 'line type' token followed by ': '. The
# line type determines how the rest of the line will be interpreted. Each line is
# terminated by CR, or CR/LF. Blank lines, and anything that follows the comment
# character (#) on a line is ignored. Whitespace at the beginning or end of line
# is ignored. All numbers are hexadecimal unless otherwise indicated. Decimal
# values are preceded by ".", ASCII values are indicated by enclosing in "".
#
# line types are:
#
#
# info used for information that might be useful for programmers. Ignored
# during factory test programming of board. Format should be JSON
# compliant.
#
# data Data lines begin with an address. The address is either an 8 or 16
# bit value, and always at the start of a line. The address is identified
# by a trailing ":" followed by white space. Address is stored in big
# endian format (MSB, LSB). Unspecified leading bytes of address are
# assume 0x00. For compatibility with original
# SWEE format, if the first data line does not contain an address, the rest
# of the file is treated as sequential data bytes separated by white space
# or CR or CR/LF, starting at address 0x00 (or 0x0300 for CANBus controllers).
# Data bytes are single bytes separated by one or more whitespace characters.
# If a data entry is not provided for every ee byte on a board, then
# unspecified values should be treated as "don't care" and should not be
# changed when this file is loaded.
#
# comment see above
#
#
# Locations 0x00f3, 0x00f4, and 0x00f5 below shall contain the EE file identifier,
# and contain the SWEE part number from Agile that corresponds to this default file,
# as well as a bit flag to indicate this is a customer generated file. This identifier
# is used for programming apps to select the proper EE file for the factory default
# operation if selected by the user. Encoding is as follows:
#
# 0x00f4 High byte of SWEE number converted to hex
# 0x00f5 Low byte of SWEE number converted to hex
# 0x00f3 ASCII representation of SWEE rev. High bit is set to indicate
# the customer generated the default file and factory default function
# from programming app should not attempt to load CS default file
#