The ConnectCore MP13 Development Kit assembles one MikroE mikroBUS™ socket that allows you to connect a variety of through-hole MikroE Click boards offering sensors, mini-displays, relays, and more. See the MikroE website for more information on the mikroBUS™ socket.
Device tree bindings and customization
Three communication buses are routed to the mikroBUS™ socket:
-
I2C2 bus
-
UART3 (2-wire)
-
SPI4 bus
Additionally, the following lines of the ConnectCore MP13 are connected to the mikroBUS™ socket:
-
MIKROBUS_RST: Connected to GPIOH 13 -
MIKROBUS_PWM: Connected to GPIOA 5 -
MIKROBUS_INT: Connected to GPIOF 3
See Universal Asynchronous Receiver/Transmitter (UART), Serial Peripheral Interface (SPI), and I2C for more information about these interfaces.
Each MikroE Click board requires a specific driver and device tree entry depending on the communication bus (I2C, SPI, UART) and its functionality.
For example, the Accel2 Click board uses an I2C accelerometer that requires CONFIG_IIO_ST_ACCEL_I2C_3AXIS to be enabled in the kernel configuration (driver support) and the following device tree entry inside the I2C bus:
&i2c2 {
...
accelerometer@1d {
compatible = "st,lis3dh-accel";
reg = <0x1d>;
vdd-supply = <®_3v3_board>;
};
...
};
Device tree overlays for MikroE Click boards
Digi Embedded Yocto has device tree overlays for the following MikroE Click boards:
You can find pre-compiled device tree overlays on the default Digi Embedded Yocto precompiled images, inside the linux_a partition.
Check Device tree overlays mechanism for instructions on loading device tree overlays.
Use the mikroBUS™ socket
How you use a Click board connected on the mikroBUS™ socket depends on the type of interface and its driver. The following example describes how to use the Accel2 Click board from user space.
Usage example: Accelerometer
The device tree support for the Accel2 Click is added via a device tree overlay. To load the overlay, use the following command in U-Boot:
=> setenv overlays ccmp13-dvk_mikroe-accel2-click.dtbo,${overlays}
=> boot
Check the kernel log to verify that the Accel2 Click module was detected. Message may vary based on your kernel version and MikroE Click board, so use a generic grep to identify it:
# dmesg | grep st-accel-i2c
[ 17.690044] st-accel-i2c 0-001d: supply vddio not found, using dummy regulator
[ 17.708199] st-accel-i2c 0-001d: mounting matrix not found: using identity...
To access the Accel2 Click module from user space, use the following commands (where N is the index of your device):
# cd /sys/bus/iio/devices/iio\:deviceN/
# grep "" in_accel_*_raw
in_accel_x_raw:-42
in_accel_y_raw:477
in_accel_z_raw:-952