shibosoftwaredev/f1c100s-linux-nema17-stepper-controller
A four-layer NEMA 17 motor-controller PCB combining an Allwinner F1C100S Linux computer, USB‑PD/buck power system, W5500 Ethernet, STM32 real-time motion control, DRV8825 stepper driver, protection/temperature/current telemetry, USB interfaces, and local LED/buzzer diagnostics.
- Version
- 0.4.56
- License
- unset
- Stars
- 0
firmware/stm32/limit.h
#pragma once
#include <stdbool.h>
#include <stdint.h>
enum { CURRENT_LIMIT_MAX_MA=396, CURRENT_LIMIT_SETTLE_MS=3 };
/* Nominal, not calibrated: 9.1k/2k, 0.30 ohm, driver sense gain 5. */
uint16_t limit_code(uint16_t ma, uint16_t vdda_mv);
uint16_t limit_nominal_ma(uint16_t code, uint16_t vdda_mv);
bool limit_readback_ok(const uint8_t bytes[3], uint16_t code);