diff options
author | Andrew Hannam <andrewh@inmarket.com.au> | 2012-11-25 22:44:25 -0800 |
---|---|---|
committer | Andrew Hannam <andrewh@inmarket.com.au> | 2012-11-25 22:44:25 -0800 |
commit | 6cc2bc280cc7dc4cb546d94219210d65c15df2e1 (patch) | |
tree | 54b4ded1928d9f03d74b74aefe333cc93f047ba9 /include | |
parent | d1836d49fee08eaa08a837e9f6176f3d41fbb735 (diff) | |
parent | ac5267af6af5508d4391fddb3d27c8d45879950a (diff) | |
download | uGFX-6cc2bc280cc7dc4cb546d94219210d65c15df2e1.tar.gz uGFX-6cc2bc280cc7dc4cb546d94219210d65c15df2e1.tar.bz2 uGFX-6cc2bc280cc7dc4cb546d94219210d65c15df2e1.zip |
Merge pull request #8 from Tectu/master
Merge Tectu Changes
Diffstat (limited to 'include')
-rw-r--r-- | include/gtimer.h | 84 | ||||
-rw-r--r-- | include/gwin.h | 45 |
2 files changed, 49 insertions, 80 deletions
diff --git a/include/gtimer.h b/include/gtimer.h index 2946e0ea..76c52583 100644 --- a/include/gtimer.h +++ b/include/gtimer.h @@ -21,7 +21,7 @@ * @file gtimer.h
* @brief GTIMER GFX User Timer subsystem header file.
*
- * @addtogroup GEVENT
+ * @addtogroup GTIMER
* @{
*/
#ifndef _GTIMER_H
@@ -69,7 +69,9 @@ // A callback function (executed in a thread context)
typedef void (*GTimerFunction)(void *param);
-// A GTimer structure.
+/**
+ * @brief A GTimer structure
+ */
typedef struct GTimer_t {
GTimerFunction fn;
void *param;
@@ -78,7 +80,7 @@ typedef struct GTimer_t { uint16_t flags;
struct GTimer_t *next;
struct GTimer_t *prev;
- } GTimer;
+} GTimer;
/*===========================================================================*/
/* External declarations. */
@@ -88,85 +90,10 @@ typedef struct GTimer_t { extern "C" {
#endif
-/**
- * @brief Initialise a timer.
- *
- * @param[in] pt pointer to a GTimer structure
- *
- * @api
- */
void gtimerInit(GTimer *pt);
-
-/**
- * @brief Set a timer going or alter its properties if it is already going.
- *
- * @param[in] pt Pointer to a GTimer structure
- * @param[in] fn The callback function
- * @param[in] param The parameter to pass to the callback function
- * @param[in] periodic Is the timer a periodic timer? FALSE is a once-only timer.
- * @param[in] millisec The timer period. The following special values are allowed:
- * TIME_IMMEDIATE causes the callback function to be called asap.
- * A periodic timer with this value will fire once only.
- * TIME_INFINITE never timeout (unless triggered by gtimerJab or gtimerJabI)
- *
- * @note If the timer is already active its properties are updated with the new parameters.
- * The current period will be immediately canceled (without the callback function being
- * called) and the timer will be restart with the new timer properties.
- * @note The callback function should be careful not to over-run the thread stack.
- * Define a new value for the macro GTIME_THREAD_STACK_SIZE if you want to
- * change the default size.
- * @note The callback function should return as quickly as possible as all
- * timer callbacks are performed by a single thread. If a callback function
- * takes too long it could affect the timer response for other timers.
- * @note A timer callback function is not a replacement for a dedicated thread if the
- * function wants to perform computationally expensive stuff.
- * @note As the callback function is called on GTIMER's thread, the function must make sure it uses
- * appropriate synchronisation controls such as semaphores or mutexes around any data
- * structures it shares with other threads such as the main application thread.
- *
- * @api
- */
void gtimerStart(GTimer *pt, GTimerFunction fn, void *param, bool_t periodic, systime_t millisec);
-
-/**
- * @brief Stop a timer (periodic or otherwise)
- *
- * @param[in] pt Pointer to a GTimer structure
- *
- * @note If the timer is not active this does nothing.
- *
- * @api
- */
void gtimerStop(GTimer *pt);
-
-/**
- * @brief Jab a timer causing the current period to immediate expire
- * @details The callback function will be called as soon as possible.
- *
- * @pre Use from a normal thread context.
- *
- * @param[in] pt Pointer to a GTimer structure
- *
- * @note If the timer is not active this does nothing.
- * @note Repeated Jabs before the callback function actually happens are ignored.
- *
- * @api
- */
void gtimerJab(GTimer *pt);
-
-/**
- * @brief Jab a timer causing the current period to immediate expire
- * @details The callback function will be called as soon as possible.
- *
- * @pre Use from an interrupt routine context.
- *
- * @param[in] pt Pointer to a GTimer structure
- *
- * @note If the timer is not active this does nothing.
- * @note Repeated Jabs before the callback function actually happens are ignored.
- *
- * @api
- */
void gtimerJabI(GTimer *pt);
#ifdef __cplusplus
@@ -177,3 +104,4 @@ void gtimerJabI(GTimer *pt); #endif /* _GTIMER_H */
/** @} */
+
diff --git a/include/gwin.h b/include/gwin.h index b1c644a6..24eba20c 100644 --- a/include/gwin.h +++ b/include/gwin.h @@ -171,14 +171,55 @@ extern "C" { GHandle gwinCreateWindow(GWindowObject *gw, coord_t x, coord_t y, coord_t width, coord_t height);
void gwinDestroyWindow(GHandle gh);
-/* Status Functions */
+/**
+ * @brief Get the X coordinate of the window
+ * @details Returns the X coordinate of the origin of the window.
+ * The coordinate is relative to the physical screen zero point.
+ *
+ * @param[in] gh The window
+ */
#define gwinGetScreenX(gh) ((gh)->x)
+
+/**
+ * @brief Get the Y coordinate of the window
+ * @details Returns the Y coordinate of the origin of the window.
+ * The coordinate is relative to the physical screen zero point.
+ *
+ * @param[in] gh The window
+ */
#define gwinGetScreenY(gh) ((gh)->y)
+
+/**
+ * @brief Get the width of the window
+ *
+ * @param[in] gh The window
+ */
#define gwinGetWidth(gh) ((gh)->width)
+
+/**
+ * @brief Get the height of the window
+ *
+ * @param[in] gh The window
+ */
#define gwinGetHeight(gh) ((gh)->height)
-/* Set up for drawing */
+/**
+ * @brief Set foreground color
+ * @details Set the color which will be used to draw
+ *
+ * @param[in] gh The window
+ * @param[in] clr The color to be set
+ */
#define gwinSetColor(gh, clr) (gh)->color = (clr)
+
+/**
+ * @brief Set background color
+ * @details Set the color which will be used as background
+ * @note gwinClear() must be called to set the background color
+ *
+ * @param[in] gh The window
+ * @param[in] bgclr The background color
+ */
#define gwinSetBgColor(gh, bgclr) (gh)->bgcolor = (bgclr)
/* Set up for text */
|