# Copyright 2025 PostalPortal LLC and Netsyms Technologies LLC
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that
# the following conditions are met:
#   1. Redistributions of source code must retain
#      the above copyright notice, this list of conditions
#      and the following disclaimer.
#   2. Redistributions in binary form must reproduce
#      the above copyright notice, this list of conditions
#      and the following disclaimer in the documentation
#      and/or other materials provided with the distribution.
#   3. Neither the name of the copyright holder
#       nor the names of its contributors may be used
#       to endorse or promote products derived from
#       this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
# CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.


#
# Hardware configuration
#
SENSOR_TYPE = "US-100" # "PING" for Parallax PING))) or "US-100" for US-100
SENSOR_MAX_MM = 3000 # Maximum range sensor supports and is accurate within
SENSOR_MIN_MM = 100 # Minimum range below which sensor is not accurate
SENSOR_PIN = 17 # Analog pin for PING sensor
SENSOR_TX = 16 # Digital pin for US-100
SENSOR_RX = 17 # Digital pin for US-100
UART_ID = 0 # TX/RX: UART 0: 12/13, 16/17; UART 1: 4/5, 8/9
ZERO_RANGE_MM = 10 # +/- mm away from zero before a non-zero value is transmitted
SAMPLE_SIZE = 10 # Number of times to sample distance per reading, averaging the results
UNSTABLE_DELTA_MM = 50 # Max difference between largest and smallest samples (before averaging), larger than this will report as unstable
ZERO_BUTTON_PIN = 13 # Pin to read if hardware zero button is pressed
UNITS_BUTTON_PIN = 14 # Pin to read if hardware unit change button is pressed
FIRMWARE_VERSION = "1.0"

#
# USB configuration
#
VID = 0x1209 # USB Vendor ID
PID = 0xA002 # USB Product ID
MANU = "PostalPortal LLC" # USB manufacturer string
PROD = "PostalPoint Parcel Dimensioner" # USB product string
INTERFACE = "PostalPoint" # Interface string
USBHID_ENABLED = True # Disable USB, use serial output only (good for debugging)


#
# Display configuration
#
ENABLE_DISPLAY = True # Set to False to ignore display commands
DISPLAY_WIDTH = 128
DISPLAY_HEIGHT = 64
# Available pin combinations for I2C:
# I2C 0 – SDA: GP0/GP4/GP8/GP12/GP16/GP20
# I2C 0 – SCL: GP1/GP5/GP9/GP13/GP17/GP21
# I2C 1 – SDA: GP2/GP6/GP10/GP14/GP18/GP26
# I2C 1 – SCL: GP3/GP7/GP11/GP15/GP19/GP27
# Just don't conflict with the pin assignments for the sensor and buttons!
DISPLAY_SDA_PIN = 6
DISPLAY_SCL_PIN = 7
DISPLAY_I2C_CONTROLLER = 1
ENABLE_BUTTON_LEGEND = True # If true, will display onscreen labels for two buttons on the left side of the screen: top button zeros, bottom button changes units