# 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

# Run in 64-bit mode
arm_64bit=1

# Disable compensation for displays with overscan
disable_overscan=1

[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 #
######################################
# 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=spi0-1cs,cs0_pin=8

# 1-Wire
dtoverlay=w1-gpio-internal-pullup

# PWM outputs (CH5, CH6)
dtoverlay=pwm-2chan,pin=12,func=4,pin2=13,func2=4

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

# Switch to external WiFi antenna.
dtparam=ant2

# Enable boot consol (UART)
#enable_uart=1

# CM4 Specific overlayhs
[cm4]
# Disable Bluetooth
dtoverlay=disable-bt
# GPS UART
dtoverlay=uart2,init_uart_baud=115200
# Stepper UART 
dtoverlay=uart3
# 1-Wire
#dtoverlay=w1-gpio-internal-pullup
# I2C0 interface (Pin80, 82 -> GPIO44, 45):
dtparam=i2c_vc=on,i2c_vc_baudrate=100000


[cm5]
# GPS UART
dtoverlay=uart2-pi5,init_uart_baud=115200
# Stepper UART
dtoverlay=uart1-pi5
# 1-Wire
#dtoverlay=w1-gpio-pullup-pi5
# I2C0 interface (Pin80, 82 -> GPIO38, 39):
dtparam=i2c_csi_dsi0=on
# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
max_framebuffers=2
# 1080p
video=HDMI-A-1:1920x1080M@60D
