FatcatLab EVB

The FatcatLab EVB is a LEGO MINDSTORMS EV3 compatible cape for BeagleBone.

Input / Output Ports

By default, a sysfs device is created for each input and output port on the EVB. See the input ports and output ports driver descriptions for more information on how these work. There is a single module for input and output ports named evb_ports. This module has some module parameters.

Module Parameters
Name Description
disable_in_port Used to prevent the input port device from being loaded. This is useful if you want to use input port 1 for printing kernel messages this if you want while you are debugging the Linux kernel. You may also want to do to control the input port gpios directly.
disable_out_port Used to prevent the output port from being loaded. This leaves the pwm device and gpios used by the port free to be controlled directly or used by other drivers.

Input Ports

FatcatLab EVB has four input ports labeled 1, 2, 3 and 4. These ports are used with LEGO MINDSTORMS EV3 and NXT compatible sensors and other devices. Most sensors can be automatically detected when plugged in. Unlike the EV3, however, NXT analog sensors cannot be detected, so to use these sensors, the port has to be placed in nxt-analog mode manually.

General Info

Module evb_ports
Driver name evb-input-port
Connection types NXT/Analog, NXT/I2C, Other/I2C, EV3/Analog, EV3/UART, Other/UART
Connection prefix in
Number of modes 9

Modes

Name Description
auto [1] Automatically detect most sensors.
nxt-analog [2] Configures the port for NXT/Analog sensors
nxt-color [3] Configures the port for the LEGO NXT Color sensor
nxt-i2c Configure for I2C communications and load the nxt-i2c-host device.
other-i2c Configure for I2C communications but do not probe for NXT sensors.
ev3-analog Configures the port for EV3/Analog sensors
ev3-uart Configure for UART communications and load the ev3-uart-host device.
other-uart Configure for UART communications but do not load any device.
raw [4] Provide access to low level drivers.

Notes

[1]In auto mode, the port will attempt to automatically detect the type of sensor that was connected and load the appropriate driver. See the list of Supported Sensors to determine if a sensor can be automatically detected.
[2]This loads the generic NXT/Analog sensor nxt-analog driver. Use set_device to load the appropriate device/driver.
[3]NXT Color sensor driver has not been implemented yet, so right now, this mode does nothing.
[4]Exports gpios and analog/digital converter values to sysfs so that they can be controlled directly.

Input Port I2C Adapters

The ev3dev PRU firmware for FatcatLab EVB creates one I2C adapter for each input port. These are available at /dev/i2c-X where X is the number of the input port plus 2. The adapters can only be used when the port is set to nxt-i2c or other-i2c mode.

Output Ports

The FatcatLab EVB has four output ports labeled A, B, C and D. These ports are used with LEGO MINDSTORMS EV3, NXT and RCX compatible motors and other devices. EV3 motors can be automatically detected when plugged in. Other motors with position feedback (such as the NXT motor) are usually detected as an EV3 Large Motor. RCX motors and LEDs cannot be automatically detected and the mode of the output port must be manually set to use these types of devices.

General Info

Module evb_ports
Driver name evb-output-port
Connection types tacho-motor, dc-motor, led
Connection prefix out
Number of modes 5

Modes

Name Description
auto [5] Automatically detect motors when they are connected.
tacho-motor [6] Configure the port for NXT/EV3 motors.
dc-motor [7] Load the port for RCX/Power Functions motors.
led [8] Load the port for RCX/Power Functions LEDs.
raw [9] Provide access to low level drivers.

Notes

[5]Only the EV3/NXT large motors and the EV3 medium motor can be automatically detected. All other devices must be manually configured.
[6]Configures the port to use the tacho-motor Subsystem. The default driver is the EV3 Large Motor (lego-ev3-l-motor). You can change the driver using the set_device attribute.
[7]This can be use with MINDSTORMS RCX motors, Power Functions motors and any other “plain” DC motor. By “plain”, we mean the motor is just a motor without any feedback.
[8]This can be used with MINDSTORMS RCX LEDs, Power Functions LEDs or any other LED connected to pins 1 and 2 of the output port.
[9]Exports gpios, pwm and analog/digital converter values to sysfs so that they can be controlled directly.

Buttons / Joystick

The EVB has a directional joystick and a single button for user input. These are mapped to keyboard keys so that they provided the same input signals as the EV3.

Note

Simultaneous button presses are ignored.

Button map
Button/Direction Linux key code (value)
Back button press KEY_BACKSPACE (14)
Joystick button press KEY_ENTER (28)
Joystick up KEY_UP (103)
Joystick left KEY_ENTER (105)
Joystick right KEY_ENTER (106)
Joystick down KEY_DOWN (108)

Battery

  • This driver is used to get information about the FatcatLab EVB battery.
  • It uses the power_supply subsytem.
  • It registers a sysfs device node at /sys/class/power_supply/evb-battery/.
Sysfs Attributes
scope Always returns System.
voltage_now Returns the battery voltage in microvolts.

Sound

The snd-evb module provedes an ALSA driver for PCM playback and a Linux input device with sound capabilities (EV_SND) for producing tones.

The ALSA driver can be used with standard tools such as alsamixer and aplay. Tones can be produced by using the beep command, ioctls such as KDMKTONE (must run on local console or as root for ioctls) or by writing SND_* events to the event device (must be member of input group for this).