Input mapping
Lynx allows mapping its logic inputs to physical inputs on a particular device. This ensures high modifiability of the system used HW.
The mentioned variables are located in the folder /io
.
Input parameter list
Parameter | Description | Input type |
---|---|---|
in_acc | Input mapped as throttle 1 signal | Analog input |
in_acc_2 | Input mapped as throttle 2 signal | Analog input ID for 2 chanel throttle Digital input ID for endstop switch |
in_cadence | Input mapped as PAS cadence | Digital input ID |
in_clutch | Input mapped as clutch | Analog input ID |
in_cruise | Input mapped as cruise activation signal | Digital input |
in_dbrake | Input mapped as dynamic brake signal | Analog input ID |
in_light | Input mapped as light activation signal | Digital input |
in_maplock | Input mapped as second map set activation signal | Digital input |
in_mapswitch | Input mapped as map change activation signal | Digital input |
in_reverse | Input mapped as reverse activation signal | Digital input |
in_sbrake | Input mapped as static brake activation signal | Digital input |
in_speed | Input mapped as external speed sensor | Analog input ID for SX,SL,SC Digital input ID for AX, AM |
in_torque | Input mapped as torque | Analog input ID |
in_lock | Input mapped as lock. | Digital input |
IN_seatswitch | Input mapped as Seat switch | Digital input |
Parameters value
The input parameters are arrays of two values. The first value is the Physical input ID, and the second value is the Input options.
Physical input ID
Physical input ID is the ID of the physical input on the device. It is used to map the logic input to the physical input. Here is list of possible physical input IDs: Input ID documentation
Input options
Input options consist of two parts: 4 MSB bits Active state option and 4 LSB bits device address.
Device address
Addressing is not implemented yet, always use the address of your device - 0.
Active state
Active state option is only used for digital inputs.
Using this option, you can specify which GDIN state is evaluated as True. By default (active state 0), the input is evaluated true when the GDIN value is other than 0.
When evaluated as True | When evaluated as True | Input option - DEC | Input option - BIN |
---|---|---|---|
GDIN value is NOT 0 | connected to any voltage or GND | 0 | 0b0000 0000 |
GDIN value is NOT 1 | NOT connected to +3V | 16 | 0b0001 0000 |
GDIN value is NOT 2 | NOT connected to +5V | 32 | 0b0010 0000 |
GDIN value is NOT 3 | NOT connected to +10V | 48 | 0b0011 0000 |
GDIN value is NOT -1 | NOT connected to GND* | 112 | 0b0111 0000 |
GDIN value is 0 | NOT connected to any voltage or GND | 128 | 0b1000 0000 |
GDIN value is 1 | connected to +3V | 144 | 0b1001 0000 |
GDIN value is 2 | connected to +5V | 160 | 0b1010 0000 |
GDIN value is 3 | connected to +10V | 176 | 0b1011 0000 |
GDIN value is -1 | connected to GND* | 240 | 0b1111 0000 |
* works only the internal pull-up is activated
Special input values
Value | Description |
---|---|
3,14 | Bafang display - lights on |
5,14 | Bafang display - walk mode on |