Tab5 camera + other stuff (#558)
* Tab5 camera + other stuff Tab5 camera driver - SC2356 Custom SliderBox widget - slider with plus and minus buttons + value label and snapping Rtc Time service + rtc api Sdk release - only include drivers built for that specific target, eg: sc2356 driver is mipi / p4 only. No more hardcoded manual sdk cmakelists New function to find device by compatible string match. no more static cast bool wildness when trying to match a single device (like M5Stack PaperS3 for example) * feedback + fixes Fixed external app user data path. fix(gui): block app teardown until onHide() completes, preventing ELF unload racing a still-running app added camera device type and api * drain the snake sssem --------- Co-authored-by: Ken Van Hoeylandt <git@kenvanhoeylandt.net>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <tactility/drivers/rtc.h>
|
||||
#include <tactility/error.h>
|
||||
|
||||
struct Device;
|
||||
@@ -15,30 +16,21 @@ struct Rx8130ceConfig {
|
||||
uint8_t address;
|
||||
};
|
||||
|
||||
struct Rx8130ceDateTime {
|
||||
uint16_t year; // 2000–2099
|
||||
uint8_t month; // 1–12
|
||||
uint8_t day; // 1–31
|
||||
uint8_t hour; // 0–23
|
||||
uint8_t minute; // 0–59
|
||||
uint8_t second; // 0–59
|
||||
};
|
||||
|
||||
/**
|
||||
* Read the current date and time from the RTC.
|
||||
* @param[in] device rx8130ce device
|
||||
* @param[out] dt Pointer to Rx8130ceDateTime to populate
|
||||
* @param[out] dt Pointer to RtcDateTime to populate
|
||||
* @return ERROR_NONE on success, ERROR_INVALID_STATE if VLF is set (clock data unreliable)
|
||||
*/
|
||||
error_t rx8130ce_get_datetime(struct Device* device, struct Rx8130ceDateTime* dt);
|
||||
error_t rx8130ce_get_datetime(struct Device* device, struct RtcDateTime* dt);
|
||||
|
||||
/**
|
||||
* Write the date and time to the RTC.
|
||||
* @param[in] device rx8130ce device
|
||||
* @param[in] dt Pointer to Rx8130ceDateTime to write (year must be 2000–2099)
|
||||
* @param[in] dt Pointer to RtcDateTime to write (year must be 2000–2099)
|
||||
* @return ERROR_NONE on success, ERROR_INVALID_ARGUMENT if any field is out of range
|
||||
*/
|
||||
error_t rx8130ce_set_datetime(struct Device* device, const struct Rx8130ceDateTime* dt);
|
||||
error_t rx8130ce_set_datetime(struct Device* device, const struct RtcDateTime* dt);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -21,13 +21,11 @@ static error_t stop() {
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
extern const ModuleSymbol rx8130ce_module_symbols[];
|
||||
|
||||
Module rx8130ce_module = {
|
||||
.name = "rx8130ce",
|
||||
.start = start,
|
||||
.stop = stop,
|
||||
.symbols = rx8130ce_module_symbols,
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
};
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ static error_t stop(Device* device) {
|
||||
|
||||
extern "C" {
|
||||
|
||||
error_t rx8130ce_get_datetime(Device* device, Rx8130ceDateTime* dt) {
|
||||
error_t rx8130ce_get_datetime(Device* device, RtcDateTime* dt) {
|
||||
auto* i2c_controller = device_get_parent(device);
|
||||
auto address = GET_CONFIG(device)->address;
|
||||
|
||||
@@ -107,7 +107,7 @@ error_t rx8130ce_get_datetime(Device* device, Rx8130ceDateTime* dt) {
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
error_t rx8130ce_set_datetime(Device* device, const Rx8130ceDateTime* dt) {
|
||||
error_t rx8130ce_set_datetime(Device* device, const RtcDateTime* dt) {
|
||||
if (dt->month < 1 || dt->month > 12 ||
|
||||
dt->day < 1 || dt->day > 31 ||
|
||||
dt->hour > 23 || dt->minute > 59 || dt->second > 59) {
|
||||
@@ -151,13 +151,18 @@ error_t rx8130ce_set_datetime(Device* device, const Rx8130ceDateTime* dt) {
|
||||
return error;
|
||||
}
|
||||
|
||||
RtcApi rx8130ce_rtc_api = {
|
||||
.get_time = rx8130ce_get_datetime,
|
||||
.set_time = rx8130ce_set_datetime
|
||||
};
|
||||
|
||||
Driver rx8130ce_driver = {
|
||||
.name = "rx8130ce",
|
||||
.compatible = (const char*[]) { "epson,rx8130ce", nullptr },
|
||||
.start_device = start,
|
||||
.stop_device = stop,
|
||||
.api = nullptr,
|
||||
.device_type = nullptr,
|
||||
.api = &rx8130ce_rtc_api,
|
||||
.device_type = &RTC_TYPE,
|
||||
.owner = &rx8130ce_module,
|
||||
.internal = nullptr
|
||||
};
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#include <drivers/rx8130ce.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
const struct ModuleSymbol rx8130ce_module_symbols[] = {
|
||||
DEFINE_MODULE_SYMBOL(rx8130ce_get_datetime),
|
||||
DEFINE_MODULE_SYMBOL(rx8130ce_set_datetime),
|
||||
MODULE_SYMBOL_TERMINATOR
|
||||
};
|
||||
Reference in New Issue
Block a user