You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Codex.md
+28-28Lines changed: 28 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,35 +92,35 @@ Hardware/runtime support for RPi4 behavior boxes, including strict head-fixed GP
92
92
-`BehavBox.event_timestamp(event)`
93
93
-`interact_list` entries now reuse the same detection timestamp used for queue event creation.
94
94
95
-
## Head-Fixed GPIO Mapping
96
-
-`user_configurable`: 4
97
-
-`treadmill_1_input`: 13
98
-
-`treadmill_2_input`: 16
99
-
-`reward_left`: 19
100
-
-`reward_right`: 20
101
-
-`reward_center`: 21
102
-
-`pump4`: 7
103
-
-`airpuff`: 8
104
-
-`vacuum`: 25
105
-
-`cue_led_1`: 22
106
-
-`cue_led_2`: 18
107
-
-`cue_led_3`: 17
108
-
-`cue_led_4`: 14
109
-
-`lick_1`: 26
110
-
-`lick_2`: 27
111
-
-`lick_3`: 15
112
-
- Reserved / unused for BehavBox: 5, 6, 11, 12
113
-
- Legacy sound-board GPIO pins remain present on some hardware drawings, but the
114
-
supported runtime no longer owns them. Sound playback now uses the direct USB
115
-
audio subsystem under `box_runtime/audio/`.
116
-
- Supported user-expansion path:
117
-
-`BehavBox.configure_user_output(label=...)` reserves GPIO4 as a user-controlled digital output.
118
-
-`BehavBox.configure_user_input(label=..., pull_up=..., active_state=...)` reserves GPIO4 as a user-controlled digital input.
119
-
- GPIO4 may only be configured once per `BehavBox` instance.
95
+
## Profile-Aware GPIO Mapping
96
+
- Active GPIO mapping is loaded from `unified_GPIO_pin_arrangement_v4.csv`, not a hard-coded dict.
97
+
- Canonical profile key: `box_profile`
98
+
- fallback: `input_profile` if `box_profile` is absent
99
+
- Dedicated trigger lines:
100
+
-`trigger_in`: GPIO23
101
+
-`trigger_out`: GPIO24
102
+
- Generic user-configurable line:
103
+
- GPIO4, claimed later as input or output if requested
104
+
- Head-fixed inputs:
105
+
-`ir_lick_left/right/center`: GPIO5/6/12
106
+
-`lick_left/right/center`: GPIO26/27/15
107
+
-`treadmill_1/2`: GPIO13/16
108
+
- Freely-moving inputs:
109
+
-`poke_left/right/center`: GPIO5/6/12
110
+
-`poke_extra1/2`: GPIO13/16
111
+
- Shared outputs:
112
+
-`reward_left/right/center`: GPIO19/20/21
113
+
-`reward_4`: GPIO7
114
+
-`vacuum`: GPIO25
115
+
-`cue_led_1..6`: GPIO22/18/17/14/10/11
116
+
-`trigger_out`: GPIO24
117
+
- Profile-specific GPIO8:
118
+
-`head_fixed`: `airpuff`
119
+
-`freely_moving`: `reward_5`
120
+
- User-facing manual-control surfaces show canonical names plus board aliases (for example `reward_left (pump1)`).
120
121
- Reserved-pin guard:
121
-
-`box_runtime/behavior/gpio_backend.py` raises `ReservedPinError` if active runtime code tries to claim GPIO11 through the supported GPIO device classes.
122
-
- GPIO11 is reserved because it is the pin used by the IRIG timecode sender output.
123
-
- This protects IRIG timecode sender use of GPIO11 from future BehavBox edits, but archived `old/` scripts are not covered unless they import through `gpio_backend.py`.
122
+
-`box_runtime/behavior/gpio_backend.py` raises `ReservedPinError` for GPIO9.
123
+
- GPIO9 is reserved for the IRIG sender output and should not be claimed by active BehavBox runtime code.
0 commit comments