Velocity Closed Loop Dynamic error correction

Dependencies:   mbed QEI PID DmTftLibraryEx

Committer:
GregCr
Date:
Mon Mar 13 15:12:05 2017 +0000
Revision:
0:9c0917bfde97
alpha release

Who changed what in which revision?

UserRevisionLine numberNew contents of line
GregCr 0:9c0917bfde97 1 /*
GregCr 0:9c0917bfde97 2 ______ _
GregCr 0:9c0917bfde97 3 / _____) _ | |
GregCr 0:9c0917bfde97 4 ( (____ _____ ____ _| |_ _____ ____| |__
GregCr 0:9c0917bfde97 5 \____ \| ___ | (_ _) ___ |/ ___) _ \
GregCr 0:9c0917bfde97 6 _____) ) ____| | | || |_| ____( (___| | | |
GregCr 0:9c0917bfde97 7 (______/|_____)_|_|_| \__)_____)\____)_| |_|
GregCr 0:9c0917bfde97 8 (C)2016 Semtech
GregCr 0:9c0917bfde97 9
GregCr 0:9c0917bfde97 10 Description: Display driver header
GregCr 0:9c0917bfde97 11
GregCr 0:9c0917bfde97 12 Maintainer: Gregory Cristian & Gilbert Menth
GregCr 0:9c0917bfde97 13 */
GregCr 0:9c0917bfde97 14
GregCr 0:9c0917bfde97 15 #ifndef TFT_DISPLAY_DRIVER_H
GregCr 0:9c0917bfde97 16 #define TFT_DISPLAY_DRIVER_H
GregCr 0:9c0917bfde97 17
GregCr 0:9c0917bfde97 18
GregCr 0:9c0917bfde97 19 #include "DmTftBase.h"
GregCr 0:9c0917bfde97 20
GregCr 0:9c0917bfde97 21
GregCr 0:9c0917bfde97 22 #define SCREEN_WIDTH 240
GregCr 0:9c0917bfde97 23 #define SCREEN_HEIGHT 320
GregCr 0:9c0917bfde97 24
GregCr 0:9c0917bfde97 25 #define TEXT_COLOR WHITE
GregCr 0:9c0917bfde97 26 #define BACK_COLOR BLACK
GregCr 0:9c0917bfde97 27 #define PAGE_COLOR CYAN
GregCr 0:9c0917bfde97 28 #define OBJECT_ERROR RED
GregCr 0:9c0917bfde97 29 #define BUTTON_BORDER BLUE
GregCr 0:9c0917bfde97 30 #define MENU_TEXT GREEN
GregCr 0:9c0917bfde97 31 #define TEXT_VALUE YELLOW
GregCr 0:9c0917bfde97 32 #define CIRCLE_FCOLOR GRAY1
GregCr 0:9c0917bfde97 33
GregCr 0:9c0917bfde97 34
GregCr 0:9c0917bfde97 35 typedef enum
GregCr 0:9c0917bfde97 36 {
GregCr 0:9c0917bfde97 37 GO_STATUS_NOERR,
GregCr 0:9c0917bfde97 38 GO_STATUS_BAD_COORD,
GregCr 0:9c0917bfde97 39 GO_STATUS_BAD_ARG,
GregCr 0:9c0917bfde97 40 GO_STATUS_BAD_CONTEXT,
GregCr 0:9c0917bfde97 41 }GraphObjectStatus_t;
GregCr 0:9c0917bfde97 42
GregCr 0:9c0917bfde97 43 typedef enum
GregCr 0:9c0917bfde97 44 {
GregCr 0:9c0917bfde97 45 GO_TEXT,
GregCr 0:9c0917bfde97 46 GO_RECTANGLE,
GregCr 0:9c0917bfde97 47 GO_CIRCLE,
GregCr 0:9c0917bfde97 48 GO_TRIANGLE,
GregCr 0:9c0917bfde97 49 GO_IMAGE,
GregCr 0:9c0917bfde97 50 GO_LINE,
GregCr 0:9c0917bfde97 51 }GraphObjectType_t;
GregCr 0:9c0917bfde97 52
GregCr 0:9c0917bfde97 53 typedef struct
GregCr 0:9c0917bfde97 54 {
GregCr 0:9c0917bfde97 55 uint8_t Id;
GregCr 0:9c0917bfde97 56 GraphObjectType_t Type;
GregCr 0:9c0917bfde97 57 uint16_t Xpos;
GregCr 0:9c0917bfde97 58 uint16_t Ypos;
GregCr 0:9c0917bfde97 59 uint16_t Height;
GregCr 0:9c0917bfde97 60 uint16_t Width;
GregCr 0:9c0917bfde97 61 uint16_t LineWidth;
GregCr 0:9c0917bfde97 62 uint16_t BackColor;
GregCr 0:9c0917bfde97 63 uint16_t FrontColor;
GregCr 0:9c0917bfde97 64 bool DoFill;
GregCr 0:9c0917bfde97 65 uint16_t FillColor;
GregCr 0:9c0917bfde97 66 uint8_t* Source;
GregCr 0:9c0917bfde97 67 bool TouchActive;
GregCr 0:9c0917bfde97 68 }GraphObject_t;
GregCr 0:9c0917bfde97 69
GregCr 0:9c0917bfde97 70
GregCr 0:9c0917bfde97 71 /*!
GregCr 0:9c0917bfde97 72 * \brief Initialses the hardware and variables associated with the display.
GregCr 0:9c0917bfde97 73 */
GregCr 0:9c0917bfde97 74 void DisplayDriverInit( void );
GregCr 0:9c0917bfde97 75
GregCr 0:9c0917bfde97 76 /*!
GregCr 0:9c0917bfde97 77 * \brief Calibrates the touch screen.
GregCr 0:9c0917bfde97 78 */
GregCr 0:9c0917bfde97 79 void DisplayDriverCalibrate( void );
GregCr 0:9c0917bfde97 80
GregCr 0:9c0917bfde97 81 /*!
GregCr 0:9c0917bfde97 82 * \brief Draws a graphical object.
GregCr 0:9c0917bfde97 83 *
GregCr 0:9c0917bfde97 84 * \param [in] *goObject Object to draw.
GregCr 0:9c0917bfde97 85 * \param [in] *source If object is a text : *source is the text to print
GregCr 0:9c0917bfde97 86 * If object is a image: *source is the image
GregCr 0:9c0917bfde97 87 * For the other type of goObject, *source is ignored
GregCr 0:9c0917bfde97 88 * \param [in] doFill Indicate if the goObject (only for GO_RECTANGLE,
GregCr 0:9c0917bfde97 89 * GO_CIRCLE & GO_TRIANGLE) should be filled or not.
GregCr 0:9c0917bfde97 90 * \param [in] activeTouch Indicate if the coordinates of the goObject can be
GregCr 0:9c0917bfde97 91 * used for touchscreen or not.
GregCr 0:9c0917bfde97 92 * \retval status GO_STATUS_NOERR if ok or,
GregCr 0:9c0917bfde97 93 * GO_STATUS_BAD_COORD if the object go out of screen
GregCr 0:9c0917bfde97 94 */
GregCr 0:9c0917bfde97 95 GraphObjectStatus_t GraphObjectDraw( GraphObject_t* goObject, uint8_t* source, \
GregCr 0:9c0917bfde97 96 bool doFill, bool activeTouch);
GregCr 0:9c0917bfde97 97
GregCr 0:9c0917bfde97 98 /*!
GregCr 0:9c0917bfde97 99 * \brief Clear a graphical object.
GregCr 0:9c0917bfde97 100 *
GregCr 0:9c0917bfde97 101 * \param [in] *goObject Object to clear.
GregCr 0:9c0917bfde97 102 * \param [in] doFill Indicate if the goObject (only for GO_RECTANGLE,
GregCr 0:9c0917bfde97 103 * GO_CIRCLE & GO_TRIANGLE) should be filled or not.
GregCr 0:9c0917bfde97 104 * \retval status GO_STATUS_NOERR if ok or,
GregCr 0:9c0917bfde97 105 * GO_STATUS_BAD_COORD if the object go out of screen
GregCr 0:9c0917bfde97 106 */
GregCr 0:9c0917bfde97 107 GraphObjectStatus_t GraphObjectClear( GraphObject_t* goObject, bool doFill );
GregCr 0:9c0917bfde97 108
GregCr 0:9c0917bfde97 109 /*!
GregCr 0:9c0917bfde97 110 * \brief Get the first object that have the touched coordinate (if activateTouch
GregCr 0:9c0917bfde97 111 * of the object is TRUE).
GregCr 0:9c0917bfde97 112 *
GregCr 0:9c0917bfde97 113 * \param [in] *objects Tab of grophical objects.
GregCr 0:9c0917bfde97 114 * \param [in] objectsCount Indicate the numbre of goObject in the tab.
GregCr 0:9c0917bfde97 115 * \param [out] touchedObject Put the ID of the first touched and activated
GregCr 0:9c0917bfde97 116 * object of the tab.
GregCr 0:9c0917bfde97 117 * \retval status GO_STATUS_NOERR if ok.
GregCr 0:9c0917bfde97 118 */
GregCr 0:9c0917bfde97 119 GraphObjectStatus_t GraphObjectTouched( GraphObject_t* objects, \
GregCr 0:9c0917bfde97 120 uint8_t objectsCount, \
GregCr 0:9c0917bfde97 121 uint8_t* touchedObject);
GregCr 0:9c0917bfde97 122
GregCr 0:9c0917bfde97 123 /*!
GregCr 0:9c0917bfde97 124 * \brief Draws a logo on the display.
GregCr 0:9c0917bfde97 125 *
GregCr 0:9c0917bfde97 126 * \param [in] *thisBmp The file to be printed onto the display.
GregCr 0:9c0917bfde97 127 * \param [in] xPos Position across the display in pixels for the top
GregCr 0:9c0917bfde97 128 * right corner of the logo starting at the left edge
GregCr 0:9c0917bfde97 129 * of display.
GregCr 0:9c0917bfde97 130 * \param [in] yPos Position across the display in pixels for the top
GregCr 0:9c0917bfde97 131 * right corner of the logo starting at the top of
GregCr 0:9c0917bfde97 132 * the display.
GregCr 0:9c0917bfde97 133 */
GregCr 0:9c0917bfde97 134 void DisplayDriverDrawLogo( uint8_t *thisBmp, uint8_t xPos, uint8_t yPos );
GregCr 0:9c0917bfde97 135
GregCr 0:9c0917bfde97 136 #endif //TFT_DISPLAY_DRIVER_H