LambLisp 01 Red Fox Alpha
From AI to Actuator
Loading...
Searching...
No Matches

Public Attributes

const char * name
void(* pin_mode )(int, int)
void(* digital_write )(int, int)
int(* digital_read )(int)
void(* analog_write )(int, int)
int(* analog_read )(int)
void(* tone_on )(int, unsigned int)
void(* tone_off )(int)
int(* pin_mode_get )(int)
int(* pin_duty_get )(int)
int(* pin_tone_get )(int)
int(* npins )(void)

Detailed Description

Until now the null backend WAS the implementation: pinMode() and friends were defined directly here, so adding a libgpiod backend would have been two definitions of the same symbol. The public Arduino names now dispatch through a table and each backend fills one in.

SELECTION IS AT RUNTIME, NOT COMPILE TIME, and deliberately: the same aarch64 binary runs on a Jetson with a 40-pin header and on a headless x86 box with gpiochips that are NOT header pins. Which backend is correct is a property of the MACHINE, not of the build, so it is decided by probing the machine – and it falls back to null rather than driving something at random.