CS40L5x Haptic Driver

Browse source code on GitHub

Overview

CS40L5x is a family (CS40L50/51/52/53) of haptics drivers designed for trackpads, tablets, and automotive applications.

This sample demonstrates ROM features available on CS40L5x haptics drivers, including ROM effects, custom PCM/PWLE effects, edge-triggered haptic effects, buzz effects, and runtime haptics logging. A custom shell interface is provided that exposes a subset of the CS40L5x API; basic demonstrations of other API calls are provided in main().

Building and Running

Build the application for the Nucleo F401RE board, and connect a CS40L5x haptic driver on the bus I2C1 at the address 0x34. Connect three host GPIO pins to CS40L5x pins 11, 12, and 13 for edge-triggered effects.

west build -b nucleo_f401re samples/drivers/haptics/cs40l5x

For flashing the application, refer to the Flashing section of the Nucleo F401RE board documentation.

*** Booting Zephyr OS build v4.3.0-rc1-387-gbf4e58c2f208 ***
[00:00:00.085,000] <inf> cs40l5x_34.0: upload    | RTH 0 -> PCM
[00:00:00.105,000] <inf> cs40l5x_34.0: upload    | RTH 1 -> PWLE
[00:00:00.113,000] <inf> cs40l5x_34.0: configure | BUZ 0 -> 240 Hz, 10%, 0 ms
[00:00:00.118,000] <inf> cs40l5x_34.0: configure | gpio@40020000 13 -> ROM 17 (-3 dB)

See also

Haptics