# StellarMate Pro Configuration

# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1
hdmi_enable_4k=1
gpu_mem=256
max_framebuffer_width=3840
max_framebuffer_height=2160

# uncomment to force a specific HDMI mode (this will force VGA)
hdmi_group:0=2
hdmi_mode:0=83

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

# Automatically load overlays for detected cameras
camera_auto_detect=1

# Automatically load overlays for detected DSI displays
display_auto_detect=1

# Enable DRM VC4 V3D driver
#dtoverlay=vc4-kms-v3d
#max_framebuffers=2
dtoverlay=vc4-fkms-v3d

# Run in 64-bit mode
arm_64bit=1

# Disable compensation for displays with overscan
disable_overscan=1

[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
#otg_mode=1

[all]

[pi4]
# Run as fast as firmware / board allows
arm_boost=1

[all]
enable_uart=1
start_x=1
uart_2ndstage=1

######################################
# Stellarmate PRO specific GPIO init #
######################################
# Disable Bluetooth
dtoverlay=disable-bt

# USB 2 dwc for umtp-responder
dtoverlay=dwc2

# Inputs:
gpio=6,18,19,24=ip,np

# Outputs, initial low:
gpio=7,17,21,23,25,26,27=op,dl

# I2C interface:
dtparam=i2c_arm=on,i2c_arm_baudrate=400000
dtparam=i2c_vc=on,i2c_vc_baudrate=100000

# SPI interface
dtparam=spi=on
#dtoverlay=mcp3008:spi0-0-present

# OneWire interface
#dtoverlay=w1-gpio,gpiopin=22
# This gpio overlay fixes issuse with spam messages received in the kernel log.
dtoverlay=w1-gpio-internal-pullup

# Enable MCP23008 I/O expander
# No need to enable it as it will interface with INDI SM Pro driver which uses I2C to communicate.
#dtoverlay=mcp23017,mcp23008,addr=0x20,noints

# PWM outputs (CH5, CH6)
dtoverlay=pwm,pin=12,func=4
dtoverlay=pwm,pin=13,func=4

# Enable GPS UART
dtoverlay=uart2,init_uart_baud=115200

# Enable Stepper UART
dtoverlay=uart3

# PPS signal
dtoverlay=pps-gpio,gpiopin=19

# Switch to external WiFi antenna.
dtparam=ant2

# Enable boot consol (UART)
enable_uart=1
