Added doxyfile (doxygen) for the common folder. Started with doxygen comments for app and tft module.
This commit is contained in:
@@ -1,2 +1,30 @@
|
|||||||
|
/**
|
||||||
|
* @defgroup app Application
|
||||||
|
* The App Module contains the effective, platform independent application.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @addtogroup app
|
||||||
|
*/
|
||||||
|
/*@{*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts/Initializes the app
|
||||||
|
* This function should be called at the top of the main function of your platform
|
||||||
|
*/
|
||||||
void app_init();
|
void app_init();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Executes one cycle of the app
|
||||||
|
* Call this function repeatedly from a loop inside the main function
|
||||||
|
*/
|
||||||
void app_process();
|
void app_process();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @defgroup screens Screens
|
||||||
|
* The Screens of the application. \sa Screen
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*@}*/
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
static BUTTON_STRUCT b_back;
|
static BUTTON_STRUCT b_back;
|
||||||
|
|
||||||
|
|
||||||
static void b_back_cb(void* button) {
|
static void b_back_cb(void* button) {
|
||||||
gui_screen_back();
|
gui_screen_back();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,22 @@
|
|||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @addtogroup screens
|
||||||
|
*/
|
||||||
|
/*@{*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @defgroup filetest Filetest
|
||||||
|
* The File-Test Screen tests the filesystem module. It read/writes from/to files and shows a bitmap
|
||||||
|
*/
|
||||||
|
/*@{*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a pointer to the filetest screen
|
||||||
|
* \sa gui_screen_navigate
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
SCREEN_STRUCT* get_screen_filetest();
|
SCREEN_STRUCT* get_screen_filetest();
|
||||||
|
|
||||||
|
/*@}@}*/
|
||||||
|
|||||||
@@ -1,3 +1,23 @@
|
|||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @addtogroup screens
|
||||||
|
*/
|
||||||
|
/*@{*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @defgroup guitest Guitest
|
||||||
|
* The Gui-Test Screen tests the gui and the tft module.
|
||||||
|
*/
|
||||||
|
/*@{*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a pointer to the guitest screen
|
||||||
|
* \sa gui_screen_navigate
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
SCREEN_STRUCT* get_screen_guitest();
|
SCREEN_STRUCT* get_screen_guitest();
|
||||||
|
|
||||||
|
/*@}@}*/
|
||||||
|
|||||||
@@ -1,3 +1,22 @@
|
|||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @addtogroup screens
|
||||||
|
*/
|
||||||
|
/*@{*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @defgroup main Main
|
||||||
|
* The Main Screen is the start-screen for the application
|
||||||
|
*/
|
||||||
|
/*@{*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a pointer to the main screen
|
||||||
|
* \sa gui_screen_navigate
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
SCREEN_STRUCT* get_screen_main();
|
SCREEN_STRUCT* get_screen_main();
|
||||||
|
|
||||||
|
/*@}@}*/
|
||||||
|
|||||||
@@ -1,3 +1,21 @@
|
|||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @addtogroup screens
|
||||||
|
*/
|
||||||
|
/*@{*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @defgroup pixytest Pixytest
|
||||||
|
* The Pixy-Test Screen tests the pixy module.
|
||||||
|
*/
|
||||||
|
/*@{*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a pointer to the pixytest screen
|
||||||
|
* \sa gui_screen_navigate
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
SCREEN_STRUCT* get_screen_pixytest();
|
SCREEN_STRUCT* get_screen_pixytest();
|
||||||
|
|
||||||
|
/*@}@}*/
|
||||||
|
|||||||
129
common/tft/tft.h
129
common/tft/tft.h
@@ -1,29 +1,152 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* @defgroup tft TFT
|
||||||
|
* The TFT Modul provides access to the display
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @addtogroup tft
|
||||||
|
*/
|
||||||
|
/*@{*/
|
||||||
|
|
||||||
|
|
||||||
#include<stdbool.h>
|
#include<stdbool.h>
|
||||||
#include<stdint.h>
|
#include<stdint.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a 16bit color from 8bit * 3 colors (r,g,b)
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
#define RGB(r,g,b) ((((r) & 0xF8) << 8) | (((g) & 0xFC) << 3) | (((b) & 0xF8) >> 3))
|
#define RGB(r,g,b) ((((r) & 0xF8) << 8) | (((g) & 0xFC) << 3) | (((b) & 0xF8) >> 3))
|
||||||
|
|
||||||
#define RED RGB(255,0,0)
|
#define RED RGB(255,0,0)
|
||||||
#define GREEN RGB(0,255,0)
|
#define GREEN RGB(0,255,0)
|
||||||
#define BLUE RGB(0,0,255)
|
#define BLUE RGB(0,0,255)
|
||||||
#define WHITE RGB(255,255,255)
|
#define WHITE RGB(255,255,255)
|
||||||
#define BLACK RGB(0,0,0)
|
#define BLACK RGB(0,0,0)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a 16bit color from a 24bit hex rgb color code
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
#define HEX(h) (RGB(((h)>>16),((h)>>8),(h)))
|
#define HEX(h) (RGB(((h)>>16),((h)>>8),(h)))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transparent color
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
#define TRANSPARENT ((uint16_t)0x80C2)
|
#define TRANSPARENT ((uint16_t)0x80C2)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes the display
|
||||||
|
* @return true on success
|
||||||
|
*/
|
||||||
bool tft_init();
|
bool tft_init();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears the entire display with the given color. Overpaints everything which was there before.
|
||||||
|
* @param color The 16-bit color to clear the display with.
|
||||||
|
*/
|
||||||
void tft_clear(uint16_t color);
|
void tft_clear(uint16_t color);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draws a line onto the display. The pixels specified by start/end point are inclusive!
|
||||||
|
* @param x1 The x-Coordinate of the start-point
|
||||||
|
* @param y1 The y-Coordinate of the start-point
|
||||||
|
* @param x2 The x-Coordinate of the end-point
|
||||||
|
* @param y2 The y-Coordinate of the end-point
|
||||||
|
* @param color The 16-bit color to draw the line with
|
||||||
|
*/
|
||||||
void tft_draw_line(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color);
|
void tft_draw_line(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draws a pixel onto the display.
|
||||||
|
* @param x The x-Coordinate of the pixel
|
||||||
|
* @param y The y-Coordinate of the pixel
|
||||||
|
* @param The 16-bit color to draw the pixel with
|
||||||
|
*/
|
||||||
void tft_draw_pixel(uint16_t x,uint16_t y,uint16_t color);
|
void tft_draw_pixel(uint16_t x,uint16_t y,uint16_t color);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draws the outline of a rectangle onto the display. The outline is one pixel wide and goes through the specified start and endpoint.
|
||||||
|
* @param x1 The x-Coordinate of the start-point
|
||||||
|
* @param y1 The y-Coordinate of the start-point
|
||||||
|
* @param x2 The x-Coordinate of the end-point
|
||||||
|
* @param y2 The y-Coordinate of the end-point
|
||||||
|
* @param The 16-bit color to draw the pixel with
|
||||||
|
*/
|
||||||
void tft_draw_rectangle(uint16_t x1,uint16_t y1,uint16_t x2,uint16_t y2, uint16_t color);
|
void tft_draw_rectangle(uint16_t x1,uint16_t y1,uint16_t x2,uint16_t y2, uint16_t color);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draws a filled rectangle onto the display. The start,end points are inclusive
|
||||||
|
* @param x1 The x-Coordinate of the start-point
|
||||||
|
* @param y1 The y-Coordinate of the start-point
|
||||||
|
* @param x2 The x-Coordinate of the end-point
|
||||||
|
* @param y2 The y-Coordinate of the end-point
|
||||||
|
* @param The 16-bit color to draw the pixel with
|
||||||
|
*/
|
||||||
void tft_fill_rectangle(uint16_t x1,uint16_t y1,uint16_t x2,uint16_t y2, uint16_t color);
|
void tft_fill_rectangle(uint16_t x1,uint16_t y1,uint16_t x2,uint16_t y2, uint16_t color);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draws a bitmap onto the display without scaling/cropping. The bitmap must be provided as an array of 16-bit colors
|
||||||
|
* @param x The x-coordinate of the top-left corner to draw the bitmap at
|
||||||
|
* @param y The y-coordinate of the top-left corner to draw the bitmap at
|
||||||
|
* @param width The width of the bitmap in pixels
|
||||||
|
* @param height The height of the bitmap in pixels
|
||||||
|
* @param dat A pointer to a uint16_t array containing the colors for each pixel. Starting in the topleft and going from left to right, line by line.
|
||||||
|
*/
|
||||||
void tft_draw_bitmap_unscaled(uint16_t x, uint16_t y, uint16_t width, uint16_t height, const uint16_t* dat);
|
void tft_draw_bitmap_unscaled(uint16_t x, uint16_t y, uint16_t width, uint16_t height, const uint16_t* dat);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draws the outline of a circle onto the display
|
||||||
|
* @param x The x-Coordinate of the center point
|
||||||
|
* @param y The y-Coordinate of the center point
|
||||||
|
* @param r The Radius in Pixels
|
||||||
|
* @param color The 16-Bit color to draw the circle with
|
||||||
|
*/
|
||||||
void tft_draw_circle(uint16_t x, uint16_t y, uint16_t r, uint16_t color);
|
void tft_draw_circle(uint16_t x, uint16_t y, uint16_t r, uint16_t color);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Queries the number of available fonts
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
uint8_t tft_num_fonts();
|
uint8_t tft_num_fonts();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the height of a font
|
||||||
|
* @param fontnum The number of the font, from 0 .. (num_fonts -1)
|
||||||
|
* @return The height in pixel
|
||||||
|
*/
|
||||||
uint8_t tft_font_height(uint8_t fontnum);
|
uint8_t tft_font_height(uint8_t fontnum);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the width of a font
|
||||||
|
* @param fontnum The number of the font, from 0 .. (num_fonts -1)
|
||||||
|
* @return The width in pixel
|
||||||
|
*/
|
||||||
uint8_t tft_font_width(uint8_t fontnum);
|
uint8_t tft_font_width(uint8_t fontnum);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prints a unformatted/preformatted string onto the display
|
||||||
|
* @param x The x-Coordinate of the Top-Left corner where the text should be drawn
|
||||||
|
* @param y The y-Coordinate of the Top-Left corner where the text should be drawn
|
||||||
|
* @param color The 16-bit foreground color of the text
|
||||||
|
* @param bgcolor The 16-bit background color of the text. You may pass TRANSPARENT as Color
|
||||||
|
* @param font The Fontnum to use for drawing
|
||||||
|
* @param text The text to draw
|
||||||
|
*/
|
||||||
void tft_print_line(uint16_t x, uint16_t y, uint16_t color, uint16_t bgcolor, uint8_t font, const char* text);
|
void tft_print_line(uint16_t x, uint16_t y, uint16_t color, uint16_t bgcolor, uint8_t font, const char* text);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prints a formatted text (like printf) onto the display
|
||||||
|
* @param x The x-Coordinate of the Top-Left corner where the text should be drawn
|
||||||
|
* @param y The y-Coordinate of the Top-Left corner where the text should be drawn
|
||||||
|
* @param color The 16-bit foreground color of the text
|
||||||
|
* @param bgcolor The 16-bit background color of the text. You may pass TRANSPARENT as Color
|
||||||
|
* @param font The Fontnum to use for drawing
|
||||||
|
* @param format The format string (like printf)
|
||||||
|
*/
|
||||||
void tft_print_formatted(uint16_t x, uint16_t y, uint16_t color, uint16_t bgcolor, uint8_t font, const char* format, ...);
|
void tft_print_formatted(uint16_t x, uint16_t y, uint16_t color, uint16_t bgcolor, uint8_t font, const char* format, ...);
|
||||||
|
|
||||||
|
/*@}*/
|
||||||
|
|||||||
1
doc/.gitignore
vendored
1
doc/.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
*.*~
|
*.*~
|
||||||
|
html/
|
||||||
|
|||||||
Reference in New Issue
Block a user