document everything except InternalDisplay and IoT

This commit is contained in:
Siwat Sirichai 2024-01-01 02:39:51 +07:00
parent 4031b7555a
commit 789afc04dc
8 changed files with 398 additions and 74 deletions

View file

@ -36,6 +36,7 @@ bool ESPMegaDisplay::recieveSerialCommand()
/**
* @brief Processes the received serial command.
* @note This function interacts directly with the rx_buffer.
*/
void ESPMegaDisplay::processSerialCommand()
{
@ -62,6 +63,7 @@ void ESPMegaDisplay::processSerialCommand()
/**
* @brief Processes the touch event payload.
* @note This function interacts directly with the rx_buffer.
*/
void ESPMegaDisplay::processTouchPayload()
{
@ -83,6 +85,7 @@ void ESPMegaDisplay::processTouchPayload()
/**
* @brief Processes the page report event payload.
* @note This function interacts directly with the rx_buffer.
*/
void ESPMegaDisplay::processPageReportPayload()
{
@ -161,6 +164,8 @@ void ESPMegaDisplay::setString(const char *component, const char *value)
/**
* @brief Gets the value of a number component from the display.
* @warning This function is blocking.
* @warning If the display does not respond or is not connected, this function will block for up to DISPLAY_FETCH_RETRY_COUNT * DISPLAY_FETCH_TIMEOUT milliseconds.
* @param component The component name.
* @return The value of the number component.
*/
@ -219,6 +224,8 @@ uint32_t ESPMegaDisplay::getNumber(const char *component)
/**
* @brief Gets the value of a string component from the display.
* @warning This function is blocking.
* @warning If the display does not respond or is not connected, this function will block for up to DISPLAY_FETCH_RETRY_COUNT * DISPLAY_FETCH_TIMEOUT milliseconds.
* @param component The component name.
* @return The value of the string component.
* @note The returned char array must be freed after use.
@ -275,6 +282,15 @@ const char *ESPMegaDisplay::getString(const char *component)
return value;
}
/**
* @brief Gets the value of a number component from the display and stores it in a buffer.
* @warning This function is blocking.
* @warning If the display does not respond or is not connected, this function will block for up to DISPLAY_FETCH_RETRY_COUNT * DISPLAY_FETCH_TIMEOUT milliseconds.
* @param component The component name.
* @param buffer The buffer to store the value.
* @param buffer_size The size of the buffer.
* @return True if the value is successfully stored in the buffer, false otherwise.
*/
bool ESPMegaDisplay::getStringToBuffer(const char *component, char *buffer, uint8_t buffer_size)
{
// We might be in the middle of a serial command