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
This commit is contained in:
committed by
GitHub
parent
3b5a401594
commit
d896657bf9
@@ -0,0 +1,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#include <tactility/bindings/bindings.h>
|
||||
#include <lilygo/drivers/tpager_encoder.h>
|
||||
|
||||
DEFINE_DEVICETREE(tpager_encoder, struct TpagerEncoderConfig)
|
||||
@@ -0,0 +1,59 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <tactility/drivers/gpio.h>
|
||||
#include <tactility/error.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
struct Device;
|
||||
struct DeviceType;
|
||||
|
||||
struct TpagerEncoderConfig {
|
||||
struct GpioPinSpec pin_a;
|
||||
struct GpioPinSpec pin_b;
|
||||
struct GpioPinSpec pin_enter;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief API for the T-Lora Pager encoder wheel driver.
|
||||
* Reports raw, unscaled pulses: pulses-per-detent scaling and enter-press debounce are UI
|
||||
* concerns layered on top by the consumer, not something this driver knows about.
|
||||
*/
|
||||
struct TpagerEncoderApi {
|
||||
/**
|
||||
* @brief Reads the accumulated pulse count since the last read, then resets it to zero.
|
||||
* @param[in] device the encoder device
|
||||
* @param[out] out_pulses accumulated quadrature pulses (positive/negative by direction)
|
||||
* @retval ERROR_NONE when the operation was successful
|
||||
*/
|
||||
error_t (*read_delta)(struct Device* device, int32_t* out_pulses);
|
||||
|
||||
/**
|
||||
* @brief Gets whether the enter button is currently pressed.
|
||||
* @param[in] device the encoder device
|
||||
* @param[out] out_pressed true when pressed
|
||||
* @retval ERROR_NONE when the operation was successful
|
||||
*/
|
||||
error_t (*get_button_pressed)(struct Device* device, bool* out_pressed);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Reads the accumulated pulse count using the specified encoder device.
|
||||
*/
|
||||
error_t tpager_encoder_read_delta(struct Device* device, int32_t* out_pulses);
|
||||
|
||||
/**
|
||||
* @brief Gets whether the enter button is currently pressed on the specified encoder device.
|
||||
*/
|
||||
error_t tpager_encoder_get_button_pressed(struct Device* device, bool* out_pressed);
|
||||
|
||||
extern const struct DeviceType TPAGER_ENCODER_TYPE;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,20 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
namespace tpager_encoder {
|
||||
|
||||
/**
|
||||
* @brief Initialize the encoder wheel as an LVGL input device, backed by the kernel
|
||||
* tpager_encoder driver.
|
||||
* @return LVGL input device pointer, or nullptr if the kernel device isn't found/started
|
||||
*/
|
||||
lv_indev_t* init();
|
||||
|
||||
/**
|
||||
* @brief Deinitialize the encoder wheel's LVGL input device.
|
||||
*/
|
||||
void deinit();
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user