ShiboSoftwareDev/am69-pi5

A 85×56 mm 10-layer AM69A single-board computer carrier integrates 8 GiB LPDDR4, 32 GB eMMC, Pi-style expansion and multimedia/USB/Ethernet connectors, multi-rail PMIC power, STM32 boot/power control, USB-C PD, SD/fan protection, and HDI-controlled high-speed routing.

Version
0.0.8-engineering-draft-20261107-dqs19
License
unset
Stars
0

Use with the tscircuit CLI

tsci is the tscircuit CLI. Install it with npm install -g tscircuit.

tsci clone ShiboSoftwareDev/am69-pi5  # download the package files into ./am69-pi5
tsci add ShiboSoftwareDev/am69-pi5    # add it to your project as @tsci/ShiboSoftwareDev.am69-pi5

In a cloned or new (tsci init) project: tsci dev starts a local preview, tsci build outputs Circuit JSON, and tsci push publishes to tscircuit.com.

firmware/boot-controller/policy.h

#ifndef AM69_EC_POLICY_H
#define AM69_EC_POLICY_H
#include <stdbool.h>
#include <stdint.h>

typedef enum { EC_OFF, EC_STRAPS, EC_STARTING, EC_ON, EC_DISCHARGE, EC_FAULT } EcState;
typedef enum { BOOT_EMMC, BOOT_USB, BOOT_SD } EcBoot;
typedef struct {
  bool carrier_enable, button_pressed, force_usb, sd_present, host_off;
  bool aon_ok, por_high;
} EcInputs;
typedef struct {
  EcState state;
  EcBoot boot;
  bool pi_board, run, runtime_bus, straps, key_irq, start_pending, reboot_pending;
  bool last_carrier, last_button, por_seen;
  uint8_t retries, fan_percent;
  uint32_t since, por_since, button_since, fan_command_at, off_at;
  bool fan_command_valid;
} EcPolicy;

void ec_init(EcPolicy *ec, bool pi_board, uint32_t now);
void ec_step(EcPolicy *ec, const EcInputs *in, uint32_t now);
bool ec_fan_command(EcPolicy *ec, unsigned duty, uint32_t now);
bool ec_off_command(EcPolicy *ec, bool reboot, uint32_t now);
uint16_t ec_mcu_boot_word(EcBoot boot);
uint8_t ec_main_boot_word(EcBoot boot);
#endif