Merge branch 'main' into MQTT

This commit is contained in:
RobinVdB8
2023-11-23 09:55:50 +01:00
19 changed files with 10505 additions and 2667 deletions

View File

@@ -100,10 +100,9 @@ void lcd_task(void);
* @param[in] x_pos X-position
* @param[in] y_pos Y-position
* @param[in] color Color in which the text will be displayed, see preset colors in defines above
* @param[in] bg_color Background color for the text
* @param[in] font Font size, see defines above in file
*/
void lcd_display_text(uint8_t* text, uint16_t x_pos, uint16_t y_pos, uint32_t color, uint32_t bg_color, sFONT *font);
void lcd_display_text(const char* text, uint16_t x_pos, uint16_t y_pos, uint32_t color, sFONT *font);
/**
* @brief Draw BMP image on screen
@@ -144,13 +143,25 @@ void lcd_draw_bmp_img(uint8_t* bmp_buff, uint32_t x_pos, uint32_t y_pos);
void lcd_draw_img_from_fs(const char* name, uint32_t x_pos, uint32_t y_pos);
/**
* @brief Clear LCD screen
* Clears the whole LCD screen to the desired color
* @brief Clear LCD text
* Clears the text drawn on the LCD screen
*
*@param[in] color Color to which the LCD should be cleared
*/
void lcd_clear_text(void);
void lcd_clear(uint32_t color);
/**
* @brief Clear images
* Clears the images drawn on the LCD screen
*
*/
void lcd_clear_images(void);
/**
* @brief LCD stop all GIFs
* Stops all playing GIFs on lcd screen
*
*/
void lcd_stop_all_gifs(void);
/**
* @brief Draw GIF image on screen from memory

78
project/Core/Inc/tftp.h Normal file
View File

@@ -0,0 +1,78 @@
/**
* @file tftp.h
* @brief tftp server
* @author Sander S.
*/
#ifndef PROJECT_TFTP_H
#define PROJECT_TFTP_H
#include <tftp_server.h>
#ifndef TESTING
#include "lcd_api.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "llfs.h"
#include "log.h"
#define TFTP_READ 0
#ifndef UNUSED
#define UNUSED(x) (void)(x)
#endif
typedef struct tftp_custom_file_s {
char* data;
size_t len;
char* name;
size_t offset;
} tftp_custom_file_t;
/**
* @brief Initialize the TFTP server
*/
void tftp_server_init(void);
/**
* @brief Uninitialize the TFTP server
*/
void tftp_server_deinit(void);
/**
* @brief Custom fseek function
*
* @param handle The custom file handle
* @param offset The offset
* @param whence The whence
*/
void tftp_custom_fseek(tftp_custom_file_t* handle, size_t offset, int whence);
/**
* @brief Custom fread function
*
* @param buf The buffer to read from
* @param bytes The amount of bytes to read
* @param handle The custom file handle
* @return The amount of bytes read
*/
size_t tftp_custom_fread(void* buf, size_t bytes, tftp_custom_file_t* handle);
/**
* @brief Custom fwrite function
*
* @param buf The buffer to write to
* @param bytes The amount of bytes to write
* @param handle The custom file handle
* @return The amount of bytes written
*/
size_t tftp_custom_fwrite(const void* buf, size_t bytes, tftp_custom_file_t* handle);
#ifdef __cplusplus
}
#endif
#endif // PROJECT_TFTP_H