12#ifndef ZEPHYR_INCLUDE_DRIVERS_HAPTICS_CS40L5X_H_
13#define ZEPHYR_INCLUDE_DRIVERS_HAPTICS_CS40L5X_H_
Main header file for GPIO driver API.
Main header file for I2C (Inter-Integrated Circuit) driver API.
Main header file for SPI (Serial Peripheral Interface) driver API.
int cs40l5x_logger_get(const struct device *const dev, enum cs40l5x_logger_source source, enum cs40l5x_logger_source_type type, uint32_t *const value)
Get runtime haptics logging data for the specified logger source.
int cs40l5x_select_output(const struct device *const dev, const enum cs40l5x_bank bank, const uint8_t index)
Select haptic effect triggered via haptics_start_output().
int cs40l5x_calibrate(const struct device *const dev)
Run calibration to derive ReDC and F0 values and apply results for click compensation.
cs40l5x_bank
Wavetable sources for haptic effects.
Definition cs40l5x.h:53
cs40l5x_logger
Options for runtime haptics logging.
Definition cs40l5x.h:75
int cs40l5x_set_gain(const struct device *const dev, const uint8_t gain)
Configure gain for haptic effects triggered via haptics_start_output().
cs40l5x_attenuation
Attenuation options for triggered haptic effects.
Definition cs40l5x.h:38
cs40l5x_logger_source_type
Type specification for runtime haptics logging sources.
Definition cs40l5x.h:94
int cs40l5x_configure_trigger(const struct device *const dev, const struct gpio_dt_spec *const gpio, const enum cs40l5x_bank bank, const uint8_t index, const enum cs40l5x_attenuation attenuation, const enum cs40l5x_trigger_edge edge)
Configure edge-triggered haptic effect.
int cs40l5x_upload_pcm(const struct device *const dev, const enum cs40l5x_custom_index index, const uint16_t redc, const uint16_t f0, const int8_t *const samples, const uint16_t num_samples)
Upload PCM effect to the specified index.
cs40l5x_trigger_edge
Options for edge-triggered haptics effects.
Definition cs40l5x.h:119
cs40l5x_logger_source
Options for runtime haptics logging sources.
Definition cs40l5x.h:84
cs40l5x_custom_index
Custom haptics source indices (0 or 1).
Definition cs40l5x.h:65
int cs40l5x_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 cs40l5x_upload_pwle(const struct device *const dev, const enum cs40l5x_custom_index index, const struct cs40l5x_pwle_section *const sections, const uint8_t num_sections)
Upload PWLE effect to the specified index.
@ CS40L5X_NO_BANK
Reserved for driver error handling.
Definition cs40l5x.h:57
@ CS40L5X_ROM_BANK
Playback from the pre-programmed ROM library.
Definition cs40l5x.h:54
@ CS40L5X_CUSTOM_BANK
Playback from custom haptics source programmed at runtime.
Definition cs40l5x.h:55
@ CS40L5X_BUZ_BANK
Playback from buzz source programmed at runtime.
Definition cs40l5x.h:56
@ CS40L5X_LOGGER_ENABLE
Enable runtime logging for the device.
Definition cs40l5x.h:77
@ CS40L5X_LOGGER_DISABLE
Disable runtime logging for the device.
Definition cs40l5x.h:76
@ CS40L5X_ATTENUATION_2DB
Configure haptic effect with 2 dB attenuation.
Definition cs40l5x.h:44
@ CS40L5X_ATTENUATION_6DB
Configure haptic effect with 6 dB attenuation.
Definition cs40l5x.h:40
@ CS40L5X_ATTENUATION_5DB
Configure haptic effect with 5 dB attenuation.
Definition cs40l5x.h:41
@ CS40L5X_ATTENUATION_4DB
Configure haptic effect with 4 dB attenuation.
Definition cs40l5x.h:42
@ CS40L5X_ATTENUATION_7DB
Configure haptic effect with 7 dB attenuation.
Definition cs40l5x.h:39
@ CS40L5X_ATTENUATION_1DB
Configure haptic effect with 1 dB attenuation.
Definition cs40l5x.h:45
@ CS40L5X_ATTENUATION_0DB
Configure haptic effect with no attenuation.
Definition cs40l5x.h:46
@ CS40L5X_ATTENUATION_3DB
Configure haptic effect with 3 dB attenuation.
Definition cs40l5x.h:43
@ CS40L5X_LOGGER_MAX
Maximum value sampled for a logger source.
Definition cs40l5x.h:96
@ CS40L5X_LOGGER_MEAN
Mean value sampled for a logger source.
Definition cs40l5x.h:97
@ CS40L5X_LOGGER_MIN
Minimum value sampled for a logger source.
Definition cs40l5x.h:95
@ CS40L5X_RISING_EDGE
Configure a rising-edge haptic effect.
Definition cs40l5x.h:120
@ CS40L5X_FALLING_EDGE
Configure a falling-edge haptic effect.
Definition cs40l5x.h:121
@ CS40L5X_LOGGER_BEMF
Back EMF (SVC) in signed Q0.23 format (full scale is 24 V).
Definition cs40l5x.h:85
@ CS40L5X_LOGGER_VMON
Output voltage in signed Q0.23 format (full scale is 24 V).
Definition cs40l5x.h:87
@ CS40L5X_LOGGER_VBST
Boost voltage in unsigned Q0.24 format (full scale is 14 V).
Definition cs40l5x.h:86
@ CS40L5X_CUSTOM_0
Custom haptics source at index 0.
Definition cs40l5x.h:66
@ CS40L5X_CUSTOM_1
Custom haptics source at index 1.
Definition cs40l5x.h:67
@ CS40L5X_NUM_CUSTOM_EFFECTS
Maximum number of custom haptics effects.
Definition cs40l5x.h:68
Main header file for haptics driver API.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
__INT8_TYPE__ int8_t
Definition stdint.h:72
PWLE section definition.
Definition cs40l5x.h:104
uint16_t frequency
Section frequency in unsigned Q10.2 format.
Definition cs40l5x.h:108
uint8_t flags
Section flags in unsigned Q4.0 format.
Definition cs40l5x.h:112
uint16_t level
Section level in unsigned Q0.11 format.
Definition cs40l5x.h:110
uint16_t duration
Section duration in unsigned Q14.2 format (time) or Q16.0 format (half-cycles).
Definition cs40l5x.h:106
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
Container for GPIO pin information specified in devicetree.
Definition gpio.h:296