From 9a16865b00e77bce7c1a10aeb971a1f189088e3c Mon Sep 17 00:00:00 2001 From: t-moe Date: Fri, 15 May 2015 11:35:12 +0200 Subject: [PATCH] Added doxgen comments to filesyste, checkbox, numupdown and screen module. And some minor changes to the other modules. --- common/app/screen_filetest.c | 1 + common/app/screen_filetest.h | 5 +- common/app/screen_guitest.h | 5 +- common/app/screen_main.h | 5 +- common/app/screen_pixytest.h | 5 +- common/filesystem/filesystem.c | 2 +- common/filesystem/filesystem.h | 138 +++++++++++++++++++++++++------- common/gui/button.h | 16 ++-- common/gui/checkbox.h | 50 ++++++++++-- common/gui/numupdown.c | 2 - common/gui/numupdown.h | 62 ++++++++++---- common/gui/screen.h | 59 ++++++++++---- common/lowlevel/ll_filesystem.h | 19 +++++ common/lowlevel/ll_system.h | 22 +++++ common/lowlevel/ll_tft.h | 19 ++++- common/lowlevel/ll_touch.h | 19 ++++- common/pixy/pixy.h | 15 +++- common/system/system.h | 6 +- common/tft/tft.h | 13 +-- common/touch/touch.h | 12 +-- 20 files changed, 371 insertions(+), 104 deletions(-) diff --git a/common/app/screen_filetest.c b/common/app/screen_filetest.c index f9aa9a0..535106d 100644 --- a/common/app/screen_filetest.c +++ b/common/app/screen_filetest.c @@ -70,6 +70,7 @@ static void enter(void* screen) { y+=14; } + filesystem_dir_close(dir); y+=14; diff --git a/common/app/screen_filetest.h b/common/app/screen_filetest.h index 3697153..eec7dbf 100644 --- a/common/app/screen_filetest.h +++ b/common/app/screen_filetest.h @@ -6,7 +6,7 @@ /*@{*/ /** - * @defgroup filetest Filetest + * @defgroup filetest Filetest (Screen) * The File-Test Screen tests the filesystem module. It read/writes from/to files and shows a bitmap */ /*@{*/ @@ -19,4 +19,5 @@ */ SCREEN_STRUCT* get_screen_filetest(); -/*@}@}*/ +/*@}*/ +/*@}*/ diff --git a/common/app/screen_guitest.h b/common/app/screen_guitest.h index abc72f9..82a9d49 100644 --- a/common/app/screen_guitest.h +++ b/common/app/screen_guitest.h @@ -7,7 +7,7 @@ /*@{*/ /** - * @defgroup guitest Guitest + * @defgroup guitest Guitest (Screen) * The Gui-Test Screen tests the gui and the tft module. */ /*@{*/ @@ -20,4 +20,5 @@ */ SCREEN_STRUCT* get_screen_guitest(); -/*@}@}*/ +/*@}*/ +/*@}*/ diff --git a/common/app/screen_main.h b/common/app/screen_main.h index 94bbdef..8cc9bff 100644 --- a/common/app/screen_main.h +++ b/common/app/screen_main.h @@ -18,7 +18,7 @@ /*@{*/ /** - * @defgroup main Main + * @defgroup main Main (Screen) * The Main Screen is the start-screen for the application */ /*@{*/ @@ -31,4 +31,5 @@ */ SCREEN_STRUCT* get_screen_main(); -/*@}@}*/ +/*@}*/ +/*@}*/ diff --git a/common/app/screen_pixytest.h b/common/app/screen_pixytest.h index a37d0da..b92df49 100644 --- a/common/app/screen_pixytest.h +++ b/common/app/screen_pixytest.h @@ -6,7 +6,7 @@ /*@{*/ /** - * @defgroup pixytest Pixytest + * @defgroup pixytest Pixytest (Screen) * The Pixy-Test Screen tests the pixy module. */ /*@{*/ @@ -18,4 +18,5 @@ */ SCREEN_STRUCT* get_screen_pixytest(); -/*@}@}*/ +/*@}*/ +/*@}*/ diff --git a/common/filesystem/filesystem.c b/common/filesystem/filesystem.c index 1cd803f..9d88b3b 100644 --- a/common/filesystem/filesystem.c +++ b/common/filesystem/filesystem.c @@ -10,7 +10,7 @@ DIRECTORY_STRUCT* filesystem_dir_open(const char* path) { } void filesystem_dir_close(DIRECTORY_STRUCT* dir) { - filesystem_dir_close(dir); + ll_filesystem_dir_close(dir); } FILE_HANDLE* filesystem_file_open(const char* filename) { diff --git a/common/filesystem/filesystem.h b/common/filesystem/filesystem.h index 164d76e..bb7b413 100644 --- a/common/filesystem/filesystem.h +++ b/common/filesystem/filesystem.h @@ -4,68 +4,144 @@ #include #include +/** + * @defgroup filesystem Filesystem + * The Filesystem Module provides access to files and directories of a the native filesystem. + */ +/*@{*/ + +/** + * File Attributes used by implementation + * See http://en.wikipedia.org/wiki/Design_of_the_FAT_file_system#attributes for detailed description + */ typedef enum { - F_DIR=1, - F_RDO=2, - F_HID=4, - F_SYS=8, - F_ARC=16 + F_RDO=0x01,//!< File is readonly. You cannot write to it + F_HID=0x02,//!< File is hidden + F_SYS=0x04,//!< File is a system file + F_DIR=0x10,//!< It's a directory and not a file + F_ARC=0x20 //!< File has the archive flag set (probably unused) } FILE_ATTRIBUTES; - +/** + * Structure which represents last modified date of a file / directory + */ typedef struct { - unsigned year : 7; //year from 1980 (0..127) - unsigned month: 4; //month (1..12) - unsigned day: 5; //day (1..31) + unsigned year : 7; //!< year from 1980 (0..127) + unsigned month: 4; //!< month (1..12) + unsigned day: 5; //!< day (1..31) } FILE_DATE_STRUCT; - +/** + * Structure which represents last modified time of a file / directory + */ typedef struct { - unsigned hour : 5; //hour (0..23) - unsigned min: 6; //minute (0..59 - unsigned sec: 5; //second/2 (0..29) + unsigned hour : 5; //!< hour (0..23) + unsigned min: 6; //!< minute (0..59 + unsigned sec: 5; //!< second/2 (0..29) } FILE_TIME_STRUCT; - +/** + * Structure which represents a file/directory entry. \sa DIRECTORY_STRUCT + */ typedef struct { - uint32_t fsize; /* File size */ - FILE_DATE_STRUCT fdate; /* Last modified date */ - FILE_TIME_STRUCT ftime; /* Last modified time */ - uint8_t fattrib; /* Attribute */ - char* fname; /* File name */ + uint32_t fsize; //!< File size in bytes. 0 for directories + FILE_DATE_STRUCT fdate; //!< Last modified date + FILE_TIME_STRUCT ftime; //!< Last modified time + uint8_t fattrib; //!< File/Directory Attributes + char* fname; //!< File/Directory name } FILE_STRUCT; +/** + * Structure which represents an open directory with all it's entries. \sa filesystem_dir_open + */ typedef struct { - const char* path; - uint16_t num_files; - FILE_STRUCT* files; + const char* path; //!< Directory path (absolute) + uint16_t num_files; //!< Number of files/directories in this directory + FILE_STRUCT* files; //!< An array with \ref num_files FILE_STRUCT entries } DIRECTORY_STRUCT; +/** + * Structure which represents an open file. \sa filesystem_file_open + */ typedef struct { - const char* fname; - uint32_t fpos; - uint32_t fsize; + const char* fname; //!< The absolute file name + uint32_t fpos; //!< The current byte-position in the file. \sa filesystem_file_seek + uint32_t fsize; //!< The total file size in bytes } FILE_HANDLE; +/** + * Enum to represent the success or error-code of the filesystem_file_* functions + */ typedef enum { - F_OK, - F_EOF, - F_EACCESS, - F_INVALIDPARAM, - F_DISKERROR + F_OK, //!< Everything ok + F_EOF, //!< The write/read operation tried to write/read past the end of the file. This is not a fatal error. + F_EACCESS, //!< The file can not be read/written due to access problems. This is a fatal error. + F_INVALIDPARAM,//!< You passed invalid parameters to the function + F_DISKERROR //!< A lowlevel disk-error occoured. This is a fatal error. } FILE_STATUS; - +/** + * Initializes the filesystem. + * Call this method before using any filesystem_* functions + * @return true on success + */ bool filesystem_init(); +/** + * Opens a directory and returns a structure which contains all files/subdirectories. \sa filesystem_dir_close() + * @param path The absolute path to the directory to open/read + * @return A Pointer to an initialized DIRECTORY_STRUCT on success, NULL on error + */ DIRECTORY_STRUCT* filesystem_dir_open(const char* path); + +/** + * Closes a previously opened directory. Free's all allocated resources. + * @param dir A Pointer to a DIRECTORY_STRUCT obtained by filesystem_dir_open(). + */ void filesystem_dir_close(DIRECTORY_STRUCT* dir); + +/** + * Opens a file for read/writing. \note Depending on the implementation you may only open one file at a time + * @param filename The absolute file path + * @return A Pointer to a FILE_HANDLE on success, NULL on error. + */ FILE_HANDLE* filesystem_file_open(const char* filename); + +/** + * Closes a file. + * @param handle The FILE_HANDLE obtained by filesystem_file_open() + */ void filesystem_file_close(FILE_HANDLE* handle); + +/** + * Set's the read/write position to a new position + * @param handle The FILE_HANDLE obtained by filesystem_file_open() + * @param offset The new read/write position in bytes (absolute). + * @return \ref F_OK on success, an error Code otherwise. + */ FILE_STATUS filesystem_file_seek(FILE_HANDLE* handle, uint32_t offset); + +/** + * Reads some bytes from an open file. + * @param handle The FILE_HANDLE obtained by filesystem_file_open() + * @param buf The Buffer to write the bytes to + * @param size The number of bytes to read + * @return \ref F_OK on success, \ref F_EOF if less than \p size bytes could be read, an error Code otherwise. + */ FILE_STATUS filesystem_file_read(FILE_HANDLE* handle, uint8_t* buf, uint32_t size); + +/** + * Writes some bytes to a open file. + * \note Depending on the implementation the file may not be shrinked or expanded. + * @param handle The FILE_HANDLE obtained by filesystem_file_open() + * @param buf The Buffer to take the bytes from + * @param size The number of bytes to write + * @return \ref F_OK on success, \ref F_EOF if less than \p size bytes could be written, an error Code otherwise. + */ FILE_STATUS filesystem_file_write(FILE_HANDLE* handle, uint8_t* buf, uint32_t size); +/*@}*/ + #endif /* FILESYSTEM_H */ diff --git a/common/gui/button.h b/common/gui/button.h index b0d0bac..85087eb 100644 --- a/common/gui/button.h +++ b/common/gui/button.h @@ -1,6 +1,8 @@ #ifndef BUTTON_H #define BUTTON_H +#include "touch.h" + /** * @defgroup gui Gui * The Gui Module @@ -11,14 +13,18 @@ * @defgroup button Button * The Button Gui-Element */ + +/*@}*/ + +/** + * @addtogroup button + */ /*@{*/ - -#include "touch.h" - /** * Prototype for Event Listeners (called when the button is pressed) + * \note You should NOT execute long running things in this callback nor should you update the gui. But you can call gui_screen_navigate() for instance. * @param button The pointer to the BUTTON_STRUCT where to corresponding Button was pressed */ typedef void (*BUTTON_CALLBACK)(void *button); @@ -30,7 +36,7 @@ typedef void (*BUTTON_CALLBACK)(void *button); typedef struct { TOUCH_AREA_STRUCT base; //!< Basic geometry of the button. You only need to set the x1, y1, x2, y2 members of this struct. uint16_t bgcolor; //!< The 16-bit background color of the button - BUTTON_CALLBACK callback; //!< Callback + BUTTON_CALLBACK callback; //!< Callback which is executed when the button is pressed uint16_t txtcolor; //!< The 16-bit text color uint8_t font; //!< The number of the font to use const char *text; //!< The label of the button @@ -79,6 +85,6 @@ typedef struct { -/*@}@}*/ +/*@}*/ #endif /* BUTTON_H */ diff --git a/common/gui/checkbox.h b/common/gui/checkbox.h index 7b1b8e2..807fdf1 100644 --- a/common/gui/checkbox.h +++ b/common/gui/checkbox.h @@ -1,6 +1,8 @@ #ifndef CHECKBOX_H #define CHECKBOX_H +#include "touch.h" + /** * @addtogroup gui */ @@ -10,24 +12,58 @@ * @defgroup checkbox Checkbox * The Checkbox Gui-Element */ +/*@}*/ + +/** + * @addtogroup checkbox + */ /*@{*/ +/** + * Prototype for Event Listeners (called when the checkbox state has changed) + * \note You should NOT execute long running things in this callback nor should you update the gui. But you can call gui_screen_navigate() for instance. + * @param checkbox The pointer to the CHECKBOX_STRUCT where to corresponding Checkbox has changed the state + * @param checked A boolean which indicates whether the checkbox is now checked or not. + */ +typedef void (*CHECKBOX_CALLBACK)(void *checkbox, bool checked); -typedef void (*CHECKBOX_CALLBACK)(void *checkbox, bool checked); //!< Function pointer used... +/** + * Structure to configure the Checkbox + */ typedef struct { - TOUCH_AREA_STRUCT base; - uint16_t fgcolor; - bool checked; - CHECKBOX_CALLBACK callback; //Callback + TOUCH_AREA_STRUCT base; //!< Basic geometry of the Checkbox. You only need to set the x1, y1, x2, y2 members of this struct. + uint16_t fgcolor; //!< The 16-bit color of the tickmark + bool checked; //!< A boolean which indicates whether or not the checkbox is currently checked. + CHECKBOX_CALLBACK callback; //!< Callback which is executed when the checkbox changes state } CHECKBOX_STRUCT; - +/** + * Adds a checkbox. Your Callback will be called from now on, if the checkbox changes state + * @param checkbox A Pointer to the preinitialized CHECKBOX_STRUCT + * @return true on success + */ bool gui_checkbox_add(CHECKBOX_STRUCT* checkbox); + +/** + * Removes the checkbox. You will no longer receive events for this checkbox. This function will not overdraw the region where the checkbox was located. + * @param checkbox A Pointer to the CHECKBOX_STRUCT + */ void gui_checkbox_remove(CHECKBOX_STRUCT* checkbox); + +/** + * Updates the checkbox. Call this function when you change the state of the checkbox through code. + * @param checkbox A Pointer to the CHECKBOX_STRUCT + */ void gui_checkbox_update(CHECKBOX_STRUCT* checkbox); + +/** + * Redraws the checkbox. Call this method if you have to redraw the entire screen or if you want to draw a checkbox on top of an image. + * @param checkbox A Pointer to the CHECKBOX_STRUCT + */ void gui_checkbox_redraw(CHECKBOX_STRUCT* checkbox); + #define CHECKBOX_WIN_FG_COLOR RGB(32,161,34) -/*@}@}*/ +/*@}*/ #endif /* CHECKBOX_H */ diff --git a/common/gui/numupdown.c b/common/gui/numupdown.c index a6c8024..974bede 100644 --- a/common/gui/numupdown.c +++ b/common/gui/numupdown.c @@ -101,8 +101,6 @@ void gui_numupdown_remove(NUMUPDOWN_STRUCT* numupdown) void gui_numupdown_update(NUMUPDOWN_STRUCT* numupdown) { - - uint8_t tw1 = calc_text_width(numupdown->max); uint8_t tw2 = calc_text_width(numupdown->min); if(tw2 > tw1) tw1 = tw2; diff --git a/common/gui/numupdown.h b/common/gui/numupdown.h index fd97667..5734787 100644 --- a/common/gui/numupdown.h +++ b/common/gui/numupdown.h @@ -1,6 +1,8 @@ #ifndef NUMUPDOWN_H #define NUMUPDOWN_H +#include "button.h" + /** * @addtogroup gui */ @@ -10,32 +12,62 @@ * @defgroup numupdown NummericUpDown * The NummericUpDown Gui Element */ +/*@}*/ + +/** + * @addtogroup numupdown + */ /*@{*/ +/** + * Prototype for Event Listeners (called when the NummericUpDown value has changed) + * \note You should NOT execute long running things in this callback nor should you update the gui. But you can call gui_screen_navigate() for instance. + * @param numupdown The pointer to the NUMUPDOWN_STRUCT where to corresponding NummericUpDown has changed it's value + * @param value The new value of the NummericUpDown + */ +typedef void (*NUMUPDOWN_CALLBACK)(void *numupdown, int16_t value); -#include "button.h" - -typedef void (*NUMUPDOWN_CALLBACK)(void *numupdown, int16_t value); //!< Function pointer used... +/** + * Structure to configure the NummericUpDown + */ typedef struct { - uint16_t x; - uint16_t y; - uint16_t fgcolor; - int16_t value; - int16_t min; - int16_t max; - NUMUPDOWN_CALLBACK callback; //Callback + uint16_t x; //!< The x-Coordinate of the Top-Left Starting Point. + uint16_t y; //!< The y-Coordinate of the Top-Left Starting Point. + uint16_t fgcolor; //!< The 16-bit color of the value-text + int16_t value; //!< The current/default value + int16_t min; //!< The minimum possible value (inclusive) + int16_t max; //!< The maximum possible value (inclusive) + NUMUPDOWN_CALLBACK callback; //!< Callback which is executed when the value changes - //Internally used: - BUTTON_STRUCT buttonUp; - BUTTON_STRUCT buttonDown; + BUTTON_STRUCT buttonUp; //!< For internal use, don't change, don't initialize + BUTTON_STRUCT buttonDown; //!< For internal use, don't change, don't initialize } NUMUPDOWN_STRUCT; - +/** + * Adds a NummericUpDown. Your Callback will be called from now on, if the numupdown's value changes + * @param numupdown A Pointer to the preinitialized NUMUPDOWN_STRUCT + * @return true on success + */ bool gui_numupdown_add(NUMUPDOWN_STRUCT* numupdown); + +/** + * Removes the NummericUpDown. You will no longer receive events for this numupdown. This function will not overdraw the region where the numupdown was located. + * @param numupdown A Pointer to the NUMUPDOWN_STRUCT + */ void gui_numupdown_remove(NUMUPDOWN_STRUCT* numupdown); + +/** + * Updates the NummericUpDown. Call this function when you change the value/min/max of the numupdown through code. + * @param numupdown A Pointer to the NUMUPDOWN_STRUCT + */ void gui_numupdown_update(NUMUPDOWN_STRUCT* numupdown); + +/** + * Redraws the NummericUpDown. Call this method if you have to redraw the entire screen or if you want to draw a numupdown on top of an image. + * @param numupdown A Pointer to the NUMUPDOWN_STRUCT + */ void gui_numupdown_redraw(NUMUPDOWN_STRUCT* numupdown); -/*@}@}*/ +/*@}*/ #endif /* NUMUPDOWN_H */ diff --git a/common/gui/screen.h b/common/gui/screen.h index a1e8a32..e57f54d 100644 --- a/common/gui/screen.h +++ b/common/gui/screen.h @@ -1,6 +1,9 @@ #ifndef SCREEN_H #define SCREEN_H +#include +#include + /** * @addtogroup gui */ @@ -8,38 +11,64 @@ /** * @defgroup screen Screen - * The Screen Submodule + * The Screen Submodule provides an api to navigate between different "screens" on the UI. + * The implemented screens of the application are documented in the \ref screens module. + */ +/*@}*/ + +/** + * @addtogroup screen */ /*@{*/ -#include -#include - -typedef void (*SCREEN_CALLBACK)(void* screen); //!< Function pointer used... +/** + * Prototype for Event Listeners (called when the screen is entered, left or should be updated) + * @param screen The pointer to the SCREEN_STRUCT where the event occurred + */ +typedef void (*SCREEN_CALLBACK)(void* screen); +/** + * Structure to configure the Screen + */ typedef struct SCREEN_S{ - SCREEN_CALLBACK on_enter; - SCREEN_CALLBACK on_leave; - SCREEN_CALLBACK on_update; - - - struct SCREEN_S* next; //Used internally. do not modify + SCREEN_CALLBACK on_enter; //!< The Callback which is called when the screen is entered. Add/Register all UI-Elements here + SCREEN_CALLBACK on_leave; //!< The Callback which is called when the screen is left. Remove/Unregister all UI-Elements here + SCREEN_CALLBACK on_update; //!< The Callback which is called repeatedly when the screen should be updated. Update/Redraw all UI-Elements here + struct SCREEN_S* next; //!< Used internally. do not modify, do not initialize } SCREEN_STRUCT; -//Navigate to the given string as soon as the app enters the main loop again. Method can be called from an interrupt + +/** + * Navigate to the given screen as soon as the app enters the main loop again (and gui_screen_update() is called) + * It's safe to call this method from an interrupt + * @param screen A Pointer to the preinitialized SCREEN_STRUCT + * @return true on success + */ bool gui_screen_navigate(SCREEN_STRUCT* screen); -//Navigate one screen back as soon as the app enters the main loop again. Method can be called from an interrupt +/** + * Navigate one screen back as soon as the app enters the main loop again. + * It's safe to call this method from an interrupt + * @return true on success + */ bool gui_screen_back(); -//Returns the current active screen + +/** + * Returns the currently active screen + * @return A Pointer to the active SCREEN_STRUCT + */ SCREEN_STRUCT* gui_screen_get_current(); //Updates/switches the screens. Call this from the app main loop, as fast as you can. +/** + * Updates the current screen. Switches the screen if gui_screen_navigate() or gui_screen_back() have been called since the last call to this method. + * This method should be called repeatedly from the main loop (e.g. app_process()) + */ void gui_screen_update(); -/*@}@}*/ +/*@}*/ #endif /* SCREEN_H */ diff --git a/common/lowlevel/ll_filesystem.h b/common/lowlevel/ll_filesystem.h index 6190598..8833b1f 100644 --- a/common/lowlevel/ll_filesystem.h +++ b/common/lowlevel/ll_filesystem.h @@ -1,5 +1,22 @@ #include "filesystem.h" +/** + * @addtogroup lowlevel + */ +/*@{*/ + +/** + * @defgroup ll_filesystem Filesystem (LowLevel) + * Low level functions for the \ref filesystem module + */ +/*@}*/ + +/** + * @addtogroup ll_filesystem + */ +/*@{*/ + + bool ll_filesystem_init(); DIRECTORY_STRUCT* ll_filesystem_dir_open(const char* path); @@ -9,3 +26,5 @@ void ll_filesystem_file_close(FILE_HANDLE* handle); FILE_STATUS ll_filesystem_file_seek(FILE_HANDLE* handle, uint32_t offset); FILE_STATUS ll_filesystem_file_read(FILE_HANDLE* handle, uint8_t* buf, uint32_t size); FILE_STATUS ll_filesystem_file_write(FILE_HANDLE* handle, uint8_t* buf, uint32_t size); + +/*@}*/ diff --git a/common/lowlevel/ll_system.h b/common/lowlevel/ll_system.h index b5aa6b0..be422fb 100644 --- a/common/lowlevel/ll_system.h +++ b/common/lowlevel/ll_system.h @@ -1,7 +1,29 @@ #include #include + +/** + * @defgroup lowlevel LowLevel + * The Low-Level platform abstraction layer + */ +/*@{*/ + +/** + * @defgroup ll_system System (LowLevel) + * Low level functions of the \ref system Module + */ + +/*@}*/ + +/** + * @addtogroup ll_system + */ +/*@{*/ + + bool ll_system_init(); void ll_system_delay(uint32_t msec); void ll_system_process(); void ll_system_toggle_led(); + +/*@}*/ diff --git a/common/lowlevel/ll_tft.h b/common/lowlevel/ll_tft.h index 11e3b1e..d7ac730 100644 --- a/common/lowlevel/ll_tft.h +++ b/common/lowlevel/ll_tft.h @@ -1,6 +1,23 @@ #include #include + +/** + * @addtogroup lowlevel + */ +/*@{*/ + +/** + * @defgroup ll_tft TFT (LowLevel) + * Low level functions for the \ref tft module + */ +/*@}*/ + +/** + * @addtogroup ll_tft + */ +/*@{*/ + // init functions bool ll_tft_init(); @@ -19,6 +36,6 @@ uint8_t ll_tft_font_height(uint8_t fontnum); uint8_t ll_tft_font_width(uint8_t fontnum); void ll_tft_draw_char(uint16_t x, uint16_t y, uint16_t color, uint16_t bgcolor, uint8_t font, char c); - +/*@}*/ diff --git a/common/lowlevel/ll_touch.h b/common/lowlevel/ll_touch.h index c573a8e..c61b42e 100644 --- a/common/lowlevel/ll_touch.h +++ b/common/lowlevel/ll_touch.h @@ -1,6 +1,23 @@ #include #include +/** + * @addtogroup lowlevel + */ +/*@{*/ + +/** + * @defgroup ll_touch Touch (LowLevel) + * Low level functions for the \ref touch module + */ +/*@}*/ + +/** + * @addtogroup ll_touch + */ +/*@{*/ + + bool ll_touch_init(); - +/*@}*/ diff --git a/common/pixy/pixy.h b/common/pixy/pixy.h index f723afb..18b7ea1 100644 --- a/common/pixy/pixy.h +++ b/common/pixy/pixy.h @@ -27,6 +27,13 @@ extern "C" { #endif + /** + * @defgroup pixy Pixy + * The Pixy Module + */ + /*@{*/ + + #define PIXY_MAX_SIGNATURE 7 // Pixy x-y position values @@ -164,7 +171,7 @@ extern "C" /** @brief Enable or disable pixy camera auto white balance. - @param enable 1: Enable white balance. + @param value 1: Enable white balance. 0: Disable white balance. @return 0 Success @return Negative Error @@ -220,7 +227,7 @@ extern "C" @return 0 Success @return Negative Error */ - int pixy_cam_set_exposure_compensation(uint8_t gain, uint16_t compensation); + int pixy_cam_set_exposure_compensation(uint8_t gain, uint16_t comp); /** @brief Get pixy camera exposure compensation. @@ -229,7 +236,7 @@ extern "C" @return 0 Success @return Negative Error */ - int pixy_cam_get_exposure_compensation(uint8_t * gain, uint16_t * compensation); + int pixy_cam_get_exposure_compensation(uint8_t * gain, uint16_t * comp); /** @brief Set pixy camera brightness. @@ -279,6 +286,8 @@ extern "C" */ int pixy_get_firmware_version(uint16_t * major, uint16_t * minor, uint16_t * build); + /*@}*/ + #ifdef __cplusplus } #endif diff --git a/common/system/system.h b/common/system/system.h index 31f7bc9..7c22a68 100644 --- a/common/system/system.h +++ b/common/system/system.h @@ -1,6 +1,9 @@ #ifndef SYSTEM_H #define SYSTEM_H +#include +#include + /** * @defgroup system System * The System Module provides access to delay functions, leds and provides a system init function @@ -8,9 +11,6 @@ /*@{*/ -#include -#include - /** * Initializes the system. Call this method at the start of your app_init() function and before using any system_* functions * @return true on success diff --git a/common/tft/tft.h b/common/tft/tft.h index 66df24b..e36244a 100644 --- a/common/tft/tft.h +++ b/common/tft/tft.h @@ -1,6 +1,9 @@ #ifndef TFT_H #define TFT_H +#include +#include + /** * @defgroup tft TFT * The TFT Modul provides access to the display @@ -13,9 +16,6 @@ /*@{*/ -#include -#include - /** * Creates a 16bit color from 8bit * 3 colors (r,g,b) * @return @@ -67,7 +67,7 @@ void tft_draw_line(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t * 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 + * @param color The 16-bit color to draw the pixel with */ void tft_draw_pixel(uint16_t x,uint16_t y,uint16_t color); @@ -78,7 +78,7 @@ void tft_draw_pixel(uint16_t x,uint16_t y,uint16_t color); * @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 + * @param color 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); @@ -88,7 +88,7 @@ void tft_draw_rectangle(uint16_t x1,uint16_t y1,uint16_t x2,uint16_t y2, uint16_ * @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 + * @param color 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); @@ -151,6 +151,7 @@ void tft_print_line(uint16_t x, uint16_t y, uint16_t color, uint16_t bgcolor, ui * @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) + * @param ... The arguments to format (like printf) */ void tft_print_formatted(uint16_t x, uint16_t y, uint16_t color, uint16_t bgcolor, uint8_t font, const char* format, ...); diff --git a/common/touch/touch.h b/common/touch/touch.h index da9e97d..6551ef4 100644 --- a/common/touch/touch.h +++ b/common/touch/touch.h @@ -1,6 +1,9 @@ #ifndef TOUCH_H #define TOUCH_H +#include +#include + /** * @defgroup touch Touch * The Touch module provides access to the touch controller, and executes a callback if a certain region is touched @@ -12,10 +15,6 @@ */ /*@{*/ - -#include -#include - /** Enum to describe the current Touch State. \sa touch_add_raw_event */ @@ -39,6 +38,7 @@ typedef enum { /** * Prototype for Event Listeners (called for every occurring, hooked action) + * \note You should NOT execute long running things in this callback nor should you update the gui. But you can call gui_screen_navigate() for instance. * @param touchArea The pointer to the TOUCH_AREA_STRUCT in which the event occurred * @param triggeredAction The Action which occurred */ @@ -53,8 +53,8 @@ typedef struct { uint16_t y1; //!< Top Left Y-Coordinate of Area uint16_t x2; //!< Bottom Right X-Coordinate of Area uint16_t y2; //!< Bottom Right Y-Coordinate of Area - TOUCH_CALLBACK callback; //!< Callback - uint8_t flags; //!< For internal Used, don't change, don't initialize + TOUCH_CALLBACK callback; //!< Callback which is executed when an event occurred in this Area. + uint8_t flags; //!< For internal use, don't change, don't initialize } TOUCH_AREA_STRUCT;