|
Zephyr Project API 4.4.99
A Scalable Open Source RTOS
|
Public API for CS40L26 haptic driver. More...
#include <zephyr/kernel.h>Go to the source code of this file.
Enumerations | |
| enum | cs40l26_bank { CS40L26_ROM_BANK , CS40L26_BUZ_BANK , CS40L26_NO_BANK } |
| Wavetable sources for effects. More... | |
Functions | |
| int | cs40l26_calibrate (const struct device *const dev) |
| Run calibration to derive ReDC and F0 values and apply results for click compensation. | |
| int | cs40l26_configure_buzz (const struct device *const dev, const uint32_t frequency, const uint8_t level, const uint32_t duration) |
| Configure ROM buzz for haptic playback. | |
| int | cs40l26_select_output (const struct device *const dev, const enum cs40l26_bank bank, const uint16_t index) |
| Select haptic effect triggered via haptics_start_output(). | |
| int | cs40l26_set_gain (const struct device *const dev, const uint8_t gain) |
| Configure gain for haptic effects triggered via haptics_start_output(). | |
Public API for CS40L26 haptic driver.
| enum cs40l26_bank |
Wavetable sources for effects.
Provide to cs40l26_select_output().
| Enumerator | |
|---|---|
| CS40L26_ROM_BANK | Playback from the pre-programmed ROM library. |
| CS40L26_BUZ_BANK | Playback from buzz source programmed at runtime. |
| CS40L26_NO_BANK | Reserved for driver error handling. |
| int cs40l26_calibrate | ( | const struct device *const | dev | ) |
Run calibration to derive ReDC and F0 values and apply results for click compensation.
| [in] | dev | Pointer to the device structure for haptic device instance |
| 0 | if success |
| <0 | if failed |
| int cs40l26_configure_buzz | ( | const struct device *const | dev, |
| const uint32_t | frequency, | ||
| const uint8_t | level, | ||
| const uint32_t | duration ) |
Configure ROM buzz for haptic playback.
With large amplitudes and insufficient power, it's possible to reach the current limit.
| [in] | dev | Pointer to the device structure for haptic device instance |
| [in] | frequency | Frequency of haptic effect in Hz (default: 0xA5) |
| [in] | level | Amplitude of haptic effect, where UINT8_MAX is 100% (default: 0x40) |
| [in] | duration | Playback duration in units of 4 milliseconds |
| 0 | if success |
| <0 | if failed |
| int cs40l26_select_output | ( | const struct device *const | dev, |
| const enum cs40l26_bank | bank, | ||
| const uint16_t | index ) |
Select haptic effect triggered via haptics_start_output().
| [in] | dev | Pointer to the device structure for haptic device instance |
| [in] | bank | Refer to cs40l26_bank |
| [in] | index | Wavetable index for desired haptic effect |
| 0 | if successful |
| <0 | if failed |
Configure gain for haptic effects triggered via haptics_start_output().
| [in] | dev | Pointer to the device structure for haptic device instance |
| [in] | gain | Gain setting (valid values between 0 and 100) |
| 0 | if successful |
| <0 | if failed |