Compare commits

...

2 Commits

Author SHA1 Message Date
7cd8d821f6 WIP> TactilityC: Extend symbols by <cstdio>, LVGL grid
Handle TODOs before submitting PR!
2025-09-24 20:56:32 +02:00
49c2f80503 TactilityC: Fix radio specific exports, touch up radio HAL 2025-09-24 20:39:12 +02:00
3 changed files with 109 additions and 8 deletions

View File

@ -87,14 +87,14 @@ void tt_hal_radio_free(RadioHandle handle);
* @param[in] handle the radio driver handle * @param[in] handle the radio driver handle
* @return the name of the radio * @return the name of the radio
*/ */
const char* const tt_hal_radio_get_name(RadioHandle handle); const char* tt_hal_radio_get_name(RadioHandle handle);
/** /**
* Get the description for the radio driver object. * Get the description for the radio driver object.
* @param[in] handle the radio driver handle * @param[in] handle the radio driver handle
* @return the description for the radio * @return the description for the radio
*/ */
const char* const tt_hal_radio_get_desc(RadioHandle handle); const char* tt_hal_radio_get_desc(RadioHandle handle);
/** /**
@ -200,14 +200,14 @@ RadioTxId tt_hal_radio_transmit(RadioHandle handle, RadioTxPacket packet, RadioT
* @param[in] callback function to call on reception of a packet * @param[in] callback function to call on reception of a packet
* @return the identifier for the subscription * @return the identifier for the subscription
*/ */
RadioRxSubscriptionId radio_subscribe_receive(RadioHandle handle, RadioOnReceiveCallback callback); RadioRxSubscriptionId tt_hal_radio_subscribe_receive(RadioHandle handle, RadioOnReceiveCallback callback);
/** /**
* Unsubscribe for any received packet that the radio driver object receives. * Unsubscribe for any received packet that the radio driver object receives.
* @param[in] handle the radio driver handle * @param[in] handle the radio driver handle
* @param[in] id the identifier for the subscription * @param[in] id the identifier for the subscription
*/ */
void radio_unsubscribe_receive(RadioHandle handle, RadioRxSubscriptionId id); void tt_hal_radio_unsubscribe_receive(RadioHandle handle, RadioRxSubscriptionId id);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -46,12 +46,12 @@ extern "C" {
delete wrapper; delete wrapper;
} }
const char* const tt_hal_radio_get_name(RadioHandle handle) { const char* tt_hal_radio_get_name(RadioHandle handle) {
auto wrapper = static_cast<DeviceWrapper*>(handle); auto wrapper = static_cast<DeviceWrapper*>(handle);
return wrapper->name.c_str(); return wrapper->name.c_str();
} }
const char* const tt_hal_radio_get_desc(RadioHandle handle) { const char* tt_hal_radio_get_desc(RadioHandle handle) {
auto wrapper = static_cast<DeviceWrapper*>(handle); auto wrapper = static_cast<DeviceWrapper*>(handle);
return wrapper->description.c_str(); return wrapper->description.c_str();
} }
@ -128,7 +128,7 @@ extern "C" {
}); });
} }
RadioRxSubscriptionId radio_subscribe_receive(RadioHandle handle, RadioOnReceiveCallback callback) { RadioRxSubscriptionId tt_hal_radio_subscribe_receive(RadioHandle handle, RadioOnReceiveCallback callback) {
auto wrapper = static_cast<DeviceWrapper*>(handle); auto wrapper = static_cast<DeviceWrapper*>(handle);
return wrapper->device->subscribeRx([callback](tt::hal::Device::Id id, const tt::hal::radio::RxPacket& ttPacket) { return wrapper->device->subscribeRx([callback](tt::hal::Device::Id id, const tt::hal::radio::RxPacket& ttPacket) {
if (callback) { if (callback) {
@ -143,7 +143,7 @@ extern "C" {
}); });
} }
void radio_unsubscribe_receive(RadioHandle handle, RadioRxSubscriptionId id) { void tt_hal_radio_unsubscribe_receive(RadioHandle handle, RadioRxSubscriptionId id) {
auto wrapper = static_cast<DeviceWrapper*>(handle); auto wrapper = static_cast<DeviceWrapper*>(handle);
wrapper->device->unsubscribeRx(id); wrapper->device->unsubscribeRx(id);
} }

View File

@ -10,6 +10,7 @@
#include "tt_hal_display.h" #include "tt_hal_display.h"
#include "tt_hal_i2c.h" #include "tt_hal_i2c.h"
#include "tt_hal_touch.h" #include "tt_hal_touch.h"
#include "tt_hal_radio.h"
#include "tt_kernel.h" #include "tt_kernel.h"
#include "tt_lvgl.h" #include "tt_lvgl.h"
#include "tt_lvgl_keyboard.h" #include "tt_lvgl_keyboard.h"
@ -30,6 +31,7 @@
#include <esp_log.h> #include <esp_log.h>
#include <esp_http_client.h> #include <esp_http_client.h>
#include <cassert> #include <cassert>
#include <cstdio>
#include <lvgl.h> #include <lvgl.h>
@ -108,6 +110,52 @@ const esp_elfsym elf_symbols[] {
ESP_ELFSYM_EXPORT(isxdigit), ESP_ELFSYM_EXPORT(isxdigit),
ESP_ELFSYM_EXPORT(tolower), ESP_ELFSYM_EXPORT(tolower),
ESP_ELFSYM_EXPORT(toupper), ESP_ELFSYM_EXPORT(toupper),
// <cstdio> - TODO: a clanker made this, properly vet this list!
ESP_ELFSYM_EXPORT(remove),
ESP_ELFSYM_EXPORT(rename),
ESP_ELFSYM_EXPORT(tmpfile),
ESP_ELFSYM_EXPORT(fclose),
ESP_ELFSYM_EXPORT(fflush),
ESP_ELFSYM_EXPORT(fopen),
ESP_ELFSYM_EXPORT(freopen),
ESP_ELFSYM_EXPORT(setbuf),
ESP_ELFSYM_EXPORT(setvbuf),
ESP_ELFSYM_EXPORT(fprintf),
ESP_ELFSYM_EXPORT(fscanf),
ESP_ELFSYM_EXPORT(printf),
ESP_ELFSYM_EXPORT(scanf),
ESP_ELFSYM_EXPORT(snprintf),
ESP_ELFSYM_EXPORT(sprintf),
ESP_ELFSYM_EXPORT(sscanf),
ESP_ELFSYM_EXPORT(vfprintf),
ESP_ELFSYM_EXPORT(vfscanf),
ESP_ELFSYM_EXPORT(vprintf),
ESP_ELFSYM_EXPORT(vscanf),
ESP_ELFSYM_EXPORT(vsnprintf),
ESP_ELFSYM_EXPORT(vsprintf),
ESP_ELFSYM_EXPORT(vsscanf),
ESP_ELFSYM_EXPORT(fgetc),
ESP_ELFSYM_EXPORT(fgets),
ESP_ELFSYM_EXPORT(fputc),
ESP_ELFSYM_EXPORT(fputs),
ESP_ELFSYM_EXPORT(getc),
ESP_ELFSYM_EXPORT(getchar),
ESP_ELFSYM_EXPORT(gets),
ESP_ELFSYM_EXPORT(putc),
ESP_ELFSYM_EXPORT(putchar),
ESP_ELFSYM_EXPORT(puts),
ESP_ELFSYM_EXPORT(ungetc),
ESP_ELFSYM_EXPORT(fread),
ESP_ELFSYM_EXPORT(fwrite),
ESP_ELFSYM_EXPORT(fgetpos),
ESP_ELFSYM_EXPORT(fseek),
ESP_ELFSYM_EXPORT(fsetpos),
ESP_ELFSYM_EXPORT(ftell),
ESP_ELFSYM_EXPORT(rewind),
ESP_ELFSYM_EXPORT(clearerr),
ESP_ELFSYM_EXPORT(feof),
ESP_ELFSYM_EXPORT(ferror),
ESP_ELFSYM_EXPORT(perror),
// ESP-IDF // ESP-IDF
ESP_ELFSYM_EXPORT(esp_log), ESP_ELFSYM_EXPORT(esp_log),
ESP_ELFSYM_EXPORT(esp_log_write), ESP_ELFSYM_EXPORT(esp_log_write),
@ -220,6 +268,23 @@ const esp_elfsym elf_symbols[] {
ESP_ELFSYM_EXPORT(tt_hal_touch_driver_supported), ESP_ELFSYM_EXPORT(tt_hal_touch_driver_supported),
ESP_ELFSYM_EXPORT(tt_hal_touch_driver_alloc), ESP_ELFSYM_EXPORT(tt_hal_touch_driver_alloc),
ESP_ELFSYM_EXPORT(tt_hal_touch_driver_free), ESP_ELFSYM_EXPORT(tt_hal_touch_driver_free),
ESP_ELFSYM_EXPORT(tt_hal_radio_alloc),
ESP_ELFSYM_EXPORT(tt_hal_radio_free),
ESP_ELFSYM_EXPORT(tt_hal_radio_get_name),
ESP_ELFSYM_EXPORT(tt_hal_radio_get_desc),
ESP_ELFSYM_EXPORT(tt_hal_radio_get_state),
ESP_ELFSYM_EXPORT(tt_hal_radio_set_modulation),
ESP_ELFSYM_EXPORT(tt_hal_radio_get_modulation),
ESP_ELFSYM_EXPORT(tt_hal_radio_set_parameter),
ESP_ELFSYM_EXPORT(tt_hal_radio_get_parameter),
ESP_ELFSYM_EXPORT(tt_hal_radio_get_parameter_unit_str),
ESP_ELFSYM_EXPORT(tt_hal_radio_can_transmit),
ESP_ELFSYM_EXPORT(tt_hal_radio_can_receive),
ESP_ELFSYM_EXPORT(tt_hal_radio_start),
ESP_ELFSYM_EXPORT(tt_hal_radio_stop),
ESP_ELFSYM_EXPORT(tt_hal_radio_transmit),
ESP_ELFSYM_EXPORT(tt_hal_radio_subscribe_receive),
ESP_ELFSYM_EXPORT(tt_hal_radio_unsubscribe_receive),
ESP_ELFSYM_EXPORT(tt_hal_touch_driver_get_touched_points), ESP_ELFSYM_EXPORT(tt_hal_touch_driver_get_touched_points),
ESP_ELFSYM_EXPORT(tt_kernel_delay_millis), ESP_ELFSYM_EXPORT(tt_kernel_delay_millis),
ESP_ELFSYM_EXPORT(tt_kernel_delay_micros), ESP_ELFSYM_EXPORT(tt_kernel_delay_micros),
@ -480,6 +545,42 @@ const esp_elfsym elf_symbols[] {
// lv_pct // lv_pct
ESP_ELFSYM_EXPORT(lv_pct), ESP_ELFSYM_EXPORT(lv_pct),
ESP_ELFSYM_EXPORT(lv_pct_to_px), ESP_ELFSYM_EXPORT(lv_pct_to_px),
// grids - TODO: This slopmachine generated list should be properly integrated
ESP_ELFSYM_EXPORT(lv_grid_init),
ESP_ELFSYM_EXPORT(lv_obj_set_grid_dsc_array),
ESP_ELFSYM_EXPORT(lv_obj_set_grid_align),
ESP_ELFSYM_EXPORT(lv_obj_set_grid_cell),
ESP_ELFSYM_EXPORT(lv_grid_fr),
ESP_ELFSYM_EXPORT(lv_style_set_grid_row_dsc_array),
ESP_ELFSYM_EXPORT(lv_style_set_grid_column_dsc_array),
ESP_ELFSYM_EXPORT(lv_style_set_grid_row_align),
ESP_ELFSYM_EXPORT(lv_style_set_grid_column_align),
ESP_ELFSYM_EXPORT(lv_style_set_grid_cell_column_pos),
ESP_ELFSYM_EXPORT(lv_style_set_grid_cell_column_span),
ESP_ELFSYM_EXPORT(lv_style_set_grid_cell_row_pos),
ESP_ELFSYM_EXPORT(lv_style_set_grid_cell_row_span),
ESP_ELFSYM_EXPORT(lv_style_set_grid_cell_x_align),
ESP_ELFSYM_EXPORT(lv_style_set_grid_cell_y_align),
ESP_ELFSYM_EXPORT(lv_obj_set_style_grid_row_dsc_array),
ESP_ELFSYM_EXPORT(lv_obj_set_style_grid_column_dsc_array),
ESP_ELFSYM_EXPORT(lv_obj_set_style_grid_row_align),
ESP_ELFSYM_EXPORT(lv_obj_set_style_grid_column_align),
ESP_ELFSYM_EXPORT(lv_obj_set_style_grid_cell_column_pos),
ESP_ELFSYM_EXPORT(lv_obj_set_style_grid_cell_column_span),
ESP_ELFSYM_EXPORT(lv_obj_set_style_grid_cell_row_pos),
ESP_ELFSYM_EXPORT(lv_obj_set_style_grid_cell_row_span),
ESP_ELFSYM_EXPORT(lv_obj_set_style_grid_cell_x_align),
ESP_ELFSYM_EXPORT(lv_obj_set_style_grid_cell_y_align),
ESP_ELFSYM_EXPORT(lv_obj_get_style_grid_row_dsc_array),
ESP_ELFSYM_EXPORT(lv_obj_get_style_grid_column_dsc_array),
ESP_ELFSYM_EXPORT(lv_obj_get_style_grid_row_align),
ESP_ELFSYM_EXPORT(lv_obj_get_style_grid_column_align),
ESP_ELFSYM_EXPORT(lv_obj_get_style_grid_cell_column_pos),
ESP_ELFSYM_EXPORT(lv_obj_get_style_grid_cell_column_span),
ESP_ELFSYM_EXPORT(lv_obj_get_style_grid_cell_row_pos),
ESP_ELFSYM_EXPORT(lv_obj_get_style_grid_cell_row_span),
ESP_ELFSYM_EXPORT(lv_obj_get_style_grid_cell_x_align),
ESP_ELFSYM_EXPORT(lv_obj_get_style_grid_cell_y_align),
// delimiter // delimiter
ESP_ELFSYM_END ESP_ELFSYM_END
}; };