Hosam-Eldin Mostafa 079abc9356 vendor: add closed-form RGB→PWM calculator for ALM tests
Pure-Python port of the Input Sheet RGB→PWM pipeline (color management
+ luminance management + temperature compensation) used by the ALM
firmware. Exposes compute_pwm(r, g, b, temp_c) returning both the
non-compensated and the temperature-compensated 16-bit PWM tuples.

Imported by tests/hardware/alm_helpers.py to predict expected PWM
values from RGB inputs in PWM-validation assertions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 18:59:31 +02:00
..
2026-04-28 23:47:17 +02:00

BabyLIN SDK placement (DEPRECATED)

The BabyLIN adapter is deprecated and retained for backward compatibility only. New deployments should target the MUM (Melexis Universal Master) adapter — see automated_lin_test/README.md and ../docs/16_mum_internals.md. This guide is kept so existing BabyLIN rigs can still be set up.

Place the SDK's Python wrapper and platform-specific libraries here so the test framework can import and use them.

Required files

  • BabyLIN_library.py
  • BabyLIN library/ (directory provided by the SDK containing platform-specific binaries)
    • Windows: BabyLIN library/Windows/x64/*.dll
    • Linux x86_64: BabyLIN library/Linux/x86_64/*.so
    • Raspberry Pi (ARM): BabyLIN library/Linux/armv7/*.so (or as provided by your SDK)
  • Optional: Example SDF file (e.g., Example.sdf)

Folder structure example:

vendor/
├─ BabyLIN_library.py
├─ Example.sdf
└─ BabyLIN library/
   ├─ Windows/
   │  └─ x64/
   │     ├─ BabyLIN.dll
   │     ├─ BabyLIN_FTDI.dll
   │     └─ ... (other DLLs from SDK)
   ├─ Linux/
   │  ├─ x86_64/
   │  │  └─ libBabyLIN.so
   │  └─ armv7/
   │     └─ libBabyLIN.so
   └─ ...

Notes:

  • Keep the directory names and casing exactly as the SDK expects (often referenced in BabyLIN_library.py).
  • Ensure your Python environment architecture matches the binaries (e.g., 64-bit Python with 64-bit DLLs).
  • On Linux/RPi, you may need to set LD_LIBRARY_PATH to include the directory with the shared libraries.

Configuration

Point your config to the SDF and schedule:

interface:
  type: babylin            # deprecated; emits a DeprecationWarning at runtime
  channel: 0
  sdf_path: ./vendor/Example.sdf
  schedule_nr: 0

Troubleshooting

  • ImportError: BabyLIN_library not found
    • Ensure vendor/BabyLIN_library.py exists or add the vendor folder to PYTHONPATH.
  • DLL/SO not found
    • On Windows, ensure the DLLs are in PATH or next to BabyLIN_library.py per SDK instructions.
    • On Linux/RPi, export LD_LIBRARY_PATH to the folder with the .so files.
  • Device not found
    • Check USB connection, drivers, and that no other tool holds the device open.