Files
scanengine-3/hardware/pybbd202/apt_constants.py
Thomas Ales 67aabde4b6 Phase 1c: prune remaining dead functions, unused imports, quarantine Genesis
- uc480_camera: drop never-called _capture_paused/get_framerate (the
  hardware question _capture_paused encoded is now in KNOWN_ISSUES.md)
- t3r_protocol: drop read_reg/write_reg/decode_reg/Reg (commands never
  wired into the driver)
- bbd20x: drop _update0x0212 (never dispatched) and 8 of 9 unused
  trigger convenience wrappers; apt_constants: drop TriggerBitsStepper
  (servo-only rig)
- ruff --fix: 35 unused imports across all apps; drop unused T3R_BAUD
- genesis_core.py: quarantine warning header; docs/genesis_verification.md
  bench checklist for the 7 divergences vs tools/genesis_laser_gui.py

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-28 10:08:48 -05:00

50 lines
1.3 KiB
Python
Executable File

'''
APT Constants and Registries
Thomas Ales | Feb 2026
'''
from enum import IntFlag
class StatusBits(IntFlag):
MOT_SB_CWHARDLIMIT = 0x01
MOT_SB_CCWHARDLIMIT = 0x02
MOT_SB_INMOTIONCW = 0x10
MOT_SB_INMOTIONCCW = 0x20
MOT_SB_HOMING = 0x200
MOT_SB_HOMED = 0x400
MOT_SB_TRACKING = 0x1000
MOT_SB_SETTLED = 0x2000
MOT_SB_POSITIONERROR = 0x4000
MOT_SB_INSTRERROR = 0x8000
MOT_SB_INTERLOCK = 0x10000
MOT_SB_OVERTEMP = 0x20000
MOT_SB_BUSVOLTFAULT = 0x40000
MOT_SB_COMMUTATIONERROR = 0x80000
MOT_SB_DIGIP1 = 0x100000
MOT_SB_OVERLOAD = 0x1000000
MOT_SB_POWEROK = 0x10000000
MOT_SB_ERROR = 0x40000000
MOT_SB_ENABLED = 0x80000000
# combined masks for checking various
# states
MOT_ANY_MOVE = MOT_SB_INMOTIONCW | MOT_SB_INMOTIONCCW
MOT_ANY_ERR = (MOT_SB_OVERTEMP | MOT_SB_BUSVOLTFAULT |
MOT_SB_COMMUTATIONERROR | MOT_SB_OVERLOAD |
MOT_SB_ERROR | MOT_SB_INSTRERROR)
class TriggerBitsServo(IntFlag):
TRIGIN_HIGH = 0x01
TRIGIN_RELMOVE = 0x02
TRIGIN_ABSMOVE = 0x04
TRIGIN_HOMEMOVE = 0x08
TRIGOUT_HIGH = 0x10
TRIGOUT_INMOTION = 0x20
TRIGOUT_MOTIONCOMPLETE = 0x40
TRIGOUT_MAXVELOCITY = 0x80
TRIGOUT_MAXV = TRIGOUT_HIGH | TRIGOUT_MAXVELOCITY