Velocity Closed Loop Dynamic error correction

Dependencies:   mbed QEI PID DmTftLibraryEx

Committer:
lex9296
Date:
Fri Apr 15 07:01:02 2022 +0000
Revision:
39:be7055a0e9a4
Parent:
34:0522cebfe489
Retroazione di velocita e correzione

Who changed what in which revision?

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