mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-08-18 16:05:05 +00:00
* 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>
57 lines
1.4 KiB
C
57 lines
1.4 KiB
C
// SPDX-License-Identifier: Apache-2.0
|
||
#pragma once
|
||
|
||
#include <stdint.h>
|
||
#include <tactility/device.h>
|
||
#include <tactility/error.h>
|
||
|
||
#ifdef __cplusplus
|
||
extern "C" {
|
||
#endif
|
||
|
||
struct RtcDateTime {
|
||
uint16_t year; // 2000–2199
|
||
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
|
||
};
|
||
|
||
/**
|
||
* @brief API for RTC (real-time clock) drivers.
|
||
*/
|
||
struct RtcApi {
|
||
/**
|
||
* @brief Reads the current date and time from the RTC.
|
||
* @param[in] device the RTC device
|
||
* @param[out] dt pointer to store the current date and time
|
||
* @return ERROR_NONE on success
|
||
*/
|
||
error_t (*get_time)(struct Device* device, struct RtcDateTime* dt);
|
||
|
||
/**
|
||
* @brief Writes the date and time to the RTC.
|
||
* @param[in] device the RTC device
|
||
* @param[in] dt the date and time to write
|
||
* @return ERROR_NONE on success
|
||
*/
|
||
error_t (*set_time)(struct Device* device, const struct RtcDateTime* dt);
|
||
};
|
||
|
||
/**
|
||
* @brief Reads the current date and time using the specified RTC device.
|
||
*/
|
||
error_t rtc_get_time(struct Device* device, struct RtcDateTime* dt);
|
||
|
||
/**
|
||
* @brief Writes the date and time using the specified RTC device.
|
||
*/
|
||
error_t rtc_set_time(struct Device* device, const struct RtcDateTime* dt);
|
||
|
||
extern const struct DeviceType RTC_TYPE;
|
||
|
||
#ifdef __cplusplus
|
||
}
|
||
#endif
|