Ken Van Hoeylandt d896657bf9
Device migrations, drivers and fixes (#571)
Device migrations:

- cyd-4848S040c
- guition-jc1060p470ciwy
- guition-jc2432w328c
- guition-jc3248w535c (known issue with display and touch, Shadowtrance will look into it)
- guition-jc8048w550c
- heltec-wifi-lora-32-v3
- lilygo-tdeck-max (excluding graphics)
- lilygo-tdisplay
- lilygo-tdisplay-s3
- lilygo-tdongle-s3
- lilygo-tlora-pager

Driver migrations:

- Implemented haptic driver interface in kernel
- AXS15231b
- BQ25896
- BQ27220
- CST328
- CST6xx
- DRV2605
- JD9165
- Custom LilyGO driver for T-Lora Pager
- SSD1306
- ST7701
- ST7735
- SY6970
- TCA8418

Fixes/improvements:

- Boot app: support for multiple power devices, improved UI
- lvgl_devices and related code: fixes for mapping
- Support for arrays in dts parser
2026-07-18 15:01:42 +02:00

71 lines
2.0 KiB
C

// SPDX-License-Identifier: Apache-2.0
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <tactility/device.h>
#include <tactility/error.h>
/**
* @brief API for haptic motor driver chips (e.g. ERM/LRA drivers with an onboard waveform
* library, such as the TI DRV260x family).
*/
struct HapticApi {
/**
* @brief Sets one slot of the effect sequence played by start_playback().
* @param[in] device the haptic device
* @param[in] slot sequence slot index, driver-defined range (e.g. [0,7] for DRV260x)
* @param[in] waveform waveform library index to play in this slot, 0 ends the sequence
* @retval ERROR_NONE when the operation was successful
*/
error_t (*set_waveform)(struct Device* device, uint8_t slot, uint8_t waveform);
/**
* @brief Selects the onboard waveform library to play effects from.
* @retval ERROR_NONE when the operation was successful
*/
error_t (*select_library)(struct Device* device, uint8_t library);
/**
* @brief Starts playback of the currently configured effect sequence.
* @retval ERROR_NONE when the operation was successful
*/
error_t (*start_playback)(struct Device* device);
/**
* @brief Stops playback.
* @retval ERROR_NONE when the operation was successful
*/
error_t (*stop_playback)(struct Device* device);
};
/**
* @brief Sets one slot of the effect sequence using the specified haptic device.
*/
error_t haptic_set_waveform(struct Device* device, uint8_t slot, uint8_t waveform);
/**
* @brief Selects the onboard waveform library using the specified haptic device.
*/
error_t haptic_select_library(struct Device* device, uint8_t library);
/**
* @brief Starts playback using the specified haptic device.
*/
error_t haptic_start_playback(struct Device* device);
/**
* @brief Stops playback using the specified haptic device.
*/
error_t haptic_stop_playback(struct Device* device);
extern const struct DeviceType HAPTIC_TYPE;
#ifdef __cplusplus
}
#endif