Velocity Closed Loop Dynamic error correction

Dependencies:   mbed QEI PID DmTftLibraryEx

Committer:
lex9296
Date:
Thu Jan 20 08:15:44 2022 +0000
Revision:
21:ab8027016a2c
Parent:
20:626b92b70bf7
Child:
23:b9d23a2f390e
Publish - 20 Gennaio 2022

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 demo menus and manage touch sensor, 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 MENU_H
mverdy 20:626b92b70bf7 16 #define MENU_H
mverdy 20:626b92b70bf7 17
mverdy 20:626b92b70bf7 18
mverdy 20:626b92b70bf7 19 #include "DisplayDriver.h"
mverdy 20:626b92b70bf7 20 #include "DmTouchCalibration.h"
mverdy 20:626b92b70bf7 21
mverdy 20:626b92b70bf7 22
mverdy 20:626b92b70bf7 23 /*!
mverdy 20:626b92b70bf7 24 * \brief TFT calibration structure.
mverdy 20:626b92b70bf7 25 */
mverdy 20:626b92b70bf7 26 typedef struct
mverdy 20:626b92b70bf7 27 {
mverdy 20:626b92b70bf7 28 bool ScreenCalibrated;
mverdy 20:626b92b70bf7 29 CalibrationMatrix Calibration;
mverdy 20:626b92b70bf7 30 }MenuSettings_t;
mverdy 20:626b92b70bf7 31
mverdy 20:626b92b70bf7 32 /*!
mverdy 20:626b92b70bf7 33 * \brief Available pages in menu.
mverdy 20:626b92b70bf7 34 */
mverdy 20:626b92b70bf7 35 enum MenuPages
mverdy 20:626b92b70bf7 36 {
mverdy 20:626b92b70bf7 37 START_PAGE = 0,
mverdy 20:626b92b70bf7 38 PAGE_PING_PONG,
mverdy 20:626b92b70bf7 39 PAGE_PER,
mverdy 20:626b92b70bf7 40 PAGE_RANGING_MASTER,
mverdy 20:626b92b70bf7 41 PAGE_RANGING_SLAVE,
mverdy 20:626b92b70bf7 42 PAGE_RANGING_PARAM,
mverdy 20:626b92b70bf7 43 PAGE_RADIO_PARAM,
mverdy 20:626b92b70bf7 44 PAGE_RADIO_PARAM_FREQ,
mverdy 20:626b92b70bf7 45 PAGE_UTILITIES,
mverdy 20:626b92b70bf7 46 PAGE_RADIO_TEST,
mverdy 20:626b92b70bf7 47 PAGE_SLEEP_MODE,
mverdy 20:626b92b70bf7 48 PAGE_STBY_RC_MODE,
mverdy 20:626b92b70bf7 49 PAGE_STBY_XOSC_MODE,
mverdy 20:626b92b70bf7 50 PAGE_TX_CW,
mverdy 20:626b92b70bf7 51 PAGE_CONT_MODULATION
mverdy 20:626b92b70bf7 52 };
mverdy 20:626b92b70bf7 53
mverdy 20:626b92b70bf7 54
mverdy 20:626b92b70bf7 55 /*!
mverdy 20:626b92b70bf7 56 * \brief Common var to manage TFT calibration.
mverdy 20:626b92b70bf7 57 */
mverdy 20:626b92b70bf7 58 extern MenuSettings_t MenuSettings;
mverdy 20:626b92b70bf7 59
mverdy 20:626b92b70bf7 60
mverdy 20:626b92b70bf7 61 /*!
mverdy 20:626b92b70bf7 62 * \brief Init menu settings.
mverdy 20:626b92b70bf7 63 */
mverdy 20:626b92b70bf7 64 void MenuInit( void );
mverdy 20:626b92b70bf7 65
lex9296 21:ab8027016a2c 66 // LA: New Master Menu
lex9296 21:ab8027016a2c 67 // ===============
lex9296 21:ab8027016a2c 68 //
lex9296 21:ab8027016a2c 69 void StabilusMenu (void); // LA: Prototype ...
lex9296 21:ab8027016a2c 70 void StabilusMainPage (uint8_t graphObjectTouched); //
lex9296 21:ab8027016a2c 71
mverdy 20:626b92b70bf7 72 /*!
mverdy 20:626b92b70bf7 73 * \brief Permanently display Handler for touch sensor.
mverdy 20:626b92b70bf7 74 *
mverdy 20:626b92b70bf7 75 * \param [in] refresh Flag indicates refresh display required (touch)
mverdy 20:626b92b70bf7 76 *
mverdy 20:626b92b70bf7 77 * \retval CurrentPage The updated current page
mverdy 20:626b92b70bf7 78 */
mverdy 20:626b92b70bf7 79 uint8_t MenuHandler( bool refresh );
mverdy 20:626b92b70bf7 80
mverdy 20:626b92b70bf7 81 /*!
mverdy 20:626b92b70bf7 82 * \brief Update or refresh the activated menu page.
mverdy 20:626b92b70bf7 83 *
mverdy 20:626b92b70bf7 84 * \param [in] page Page to display
mverdy 20:626b92b70bf7 85 */
mverdy 20:626b92b70bf7 86 void MenuSetPage( uint8_t page );
mverdy 20:626b92b70bf7 87
mverdy 20:626b92b70bf7 88 /*!
mverdy 20:626b92b70bf7 89 * \brief Writes 3 lines on display, with current radio parameters.
mverdy 20:626b92b70bf7 90 *
mverdy 20:626b92b70bf7 91 * \param [in] page Current page to choose what to display.
mverdy 20:626b92b70bf7 92 */
mverdy 20:626b92b70bf7 93 void DisplayCurrentRadioParams( uint8_t page );
mverdy 20:626b92b70bf7 94
mverdy 20:626b92b70bf7 95 /*!
mverdy 20:626b92b70bf7 96 * \brief Return text with current frame type.
mverdy 20:626b92b70bf7 97 *
mverdy 20:626b92b70bf7 98 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 99 */
mverdy 20:626b92b70bf7 100 char* GetMenuRadioFrameType( void );
mverdy 20:626b92b70bf7 101
mverdy 20:626b92b70bf7 102 /*!
mverdy 20:626b92b70bf7 103 * \brief Return text with current Radio Modulation Parameters1.
mverdy 20:626b92b70bf7 104 *
mverdy 20:626b92b70bf7 105 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 106 */
mverdy 20:626b92b70bf7 107 char* GetRadioModulationParameters1( void );
mverdy 20:626b92b70bf7 108
mverdy 20:626b92b70bf7 109 /*!
mverdy 20:626b92b70bf7 110 * \brief Return text with current Radio Modulatio nParameters2.
mverdy 20:626b92b70bf7 111 *
mverdy 20:626b92b70bf7 112 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 113 */
mverdy 20:626b92b70bf7 114 char* GetRadioModulationParameters2( void );
mverdy 20:626b92b70bf7 115
mverdy 20:626b92b70bf7 116 /*!
mverdy 20:626b92b70bf7 117 * \brief Return text with current Radio Modulation Parameters3.
mverdy 20:626b92b70bf7 118 *
mverdy 20:626b92b70bf7 119 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 120 */
mverdy 20:626b92b70bf7 121 char* GetRadioModulationParameters3( void );
mverdy 20:626b92b70bf7 122
mverdy 20:626b92b70bf7 123 /*!
mverdy 20:626b92b70bf7 124 * \brief Return text with current Radio Frequency.
mverdy 20:626b92b70bf7 125 *
mverdy 20:626b92b70bf7 126 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 127 */
mverdy 20:626b92b70bf7 128 char* GetRadioFrequency( void );
mverdy 20:626b92b70bf7 129 /*!
mverdy 20:626b92b70bf7 130 * \brief Update the radio frequency displayed on the screen.
mverdy 20:626b92b70bf7 131 *
mverdy 20:626b92b70bf7 132 * \param [in] freq freq in Hz
mverdy 20:626b92b70bf7 133 */
mverdy 20:626b92b70bf7 134 void UpdateRadioFrequency( unsigned long freq );
mverdy 20:626b92b70bf7 135
mverdy 20:626b92b70bf7 136 /*!
mverdy 20:626b92b70bf7 137 * \brief Return text with current Radio Frequency [GHz] format #.###.
mverdy 20:626b92b70bf7 138 *
mverdy 20:626b92b70bf7 139 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 140 */
mverdy 20:626b92b70bf7 141 char* GetRadioFrequencyGHz( void );
mverdy 20:626b92b70bf7 142
mverdy 20:626b92b70bf7 143 /*!
mverdy 20:626b92b70bf7 144 * \brief Return text with current Radio Freq Base.
mverdy 20:626b92b70bf7 145 *
mverdy 20:626b92b70bf7 146 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 147 */
mverdy 20:626b92b70bf7 148 char* GetRadioFreqBase( void );
mverdy 20:626b92b70bf7 149
mverdy 20:626b92b70bf7 150 /*!
mverdy 20:626b92b70bf7 151 * \brief Return text with Radio preset Frequency 1.
mverdy 20:626b92b70bf7 152 *
mverdy 20:626b92b70bf7 153 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 154 */
mverdy 20:626b92b70bf7 155 char* GetRadioFreqBasePS1( void );
mverdy 20:626b92b70bf7 156
mverdy 20:626b92b70bf7 157 /*!
mverdy 20:626b92b70bf7 158 * \brief Return text with Radio preset Frequency 2.
mverdy 20:626b92b70bf7 159 *
mverdy 20:626b92b70bf7 160 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 161 */
mverdy 20:626b92b70bf7 162 char* GetRadioFreqBasePS2( void );
mverdy 20:626b92b70bf7 163
mverdy 20:626b92b70bf7 164 /*!
mverdy 20:626b92b70bf7 165 * \brief Return text with Radio preset Frequency 3.
mverdy 20:626b92b70bf7 166 *
mverdy 20:626b92b70bf7 167 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 168 */
mverdy 20:626b92b70bf7 169 char* GetRadioFreqBasePS3( void );
mverdy 20:626b92b70bf7 170
mverdy 20:626b92b70bf7 171 /*!
mverdy 20:626b92b70bf7 172 * \brief Return text with current Radio Tx Power.
mverdy 20:626b92b70bf7 173 *
mverdy 20:626b92b70bf7 174 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 175 */
mverdy 20:626b92b70bf7 176 char* GetRadioTxPower( void );
mverdy 20:626b92b70bf7 177
mverdy 20:626b92b70bf7 178 /*!
mverdy 20:626b92b70bf7 179 * \brief Return text with current Radio Payload Length.
mverdy 20:626b92b70bf7 180 *
mverdy 20:626b92b70bf7 181 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 182 */
mverdy 20:626b92b70bf7 183 char* GetRadioPayloadLength( void );
mverdy 20:626b92b70bf7 184
mverdy 20:626b92b70bf7 185 /*!
mverdy 20:626b92b70bf7 186 * \brief Return text with Max Num Packet.
mverdy 20:626b92b70bf7 187 *
mverdy 20:626b92b70bf7 188 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 189 */
mverdy 20:626b92b70bf7 190 char* GetMenuDemoMaxNumPacket( void );
mverdy 20:626b92b70bf7 191
mverdy 20:626b92b70bf7 192 /*!
mverdy 20:626b92b70bf7 193 * \brief Return text with current Demo Num Sent Packet.
mverdy 20:626b92b70bf7 194 *
mverdy 20:626b92b70bf7 195 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 196 */
mverdy 20:626b92b70bf7 197 char* GetMenuDemoNumSentPacket( void );
mverdy 20:626b92b70bf7 198
mverdy 20:626b92b70bf7 199 /*!
mverdy 20:626b92b70bf7 200 * \brief Return text with current Rx frame Ok count.
mverdy 20:626b92b70bf7 201 *
mverdy 20:626b92b70bf7 202 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 203 */
mverdy 20:626b92b70bf7 204 char* GetMenuDemoRxOk( void );
mverdy 20:626b92b70bf7 205
mverdy 20:626b92b70bf7 206 /*!
mverdy 20:626b92b70bf7 207 * \brief Return text with current Rx frame Ko count.
mverdy 20:626b92b70bf7 208 *
mverdy 20:626b92b70bf7 209 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 210 */
mverdy 20:626b92b70bf7 211 char* GetMenuDemoRxKo( void );
mverdy 20:626b92b70bf7 212
mverdy 20:626b92b70bf7 213 /*!
mverdy 20:626b92b70bf7 214 * \brief Return text with current Rx frame Ok (on slave side) count.
mverdy 20:626b92b70bf7 215 *
mverdy 20:626b92b70bf7 216 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 217 */
mverdy 20:626b92b70bf7 218 char* GetMenuDemoRxOkSlave( void );
mverdy 20:626b92b70bf7 219
mverdy 20:626b92b70bf7 220 /*!
mverdy 20:626b92b70bf7 221 * \brief Return text with current Rx frame Ko (on slave side) count.
mverdy 20:626b92b70bf7 222 *
mverdy 20:626b92b70bf7 223 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 224 */
mverdy 20:626b92b70bf7 225 char* GetMenuDemoRxKoSlave( void );
mverdy 20:626b92b70bf7 226
mverdy 20:626b92b70bf7 227 /*!
mverdy 20:626b92b70bf7 228 * \brief Return text with current Result PerCent1, format ###.##.
mverdy 20:626b92b70bf7 229 *
mverdy 20:626b92b70bf7 230 * \param [in] value value to compute in [%]
mverdy 20:626b92b70bf7 231 * \param [in] reference reference value for % computation
mverdy 20:626b92b70bf7 232 *
mverdy 20:626b92b70bf7 233 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 234 */
mverdy 20:626b92b70bf7 235 char* GetMenuDemoResultPerCent1( uint32_t value, uint32_t reference );
mverdy 20:626b92b70bf7 236
mverdy 20:626b92b70bf7 237 /*!
mverdy 20:626b92b70bf7 238 * \brief Return text with current Result PerCent2, format ###.##.
mverdy 20:626b92b70bf7 239 *
mverdy 20:626b92b70bf7 240 * \param [in] value value to compute in [%]
mverdy 20:626b92b70bf7 241 * \param [in] reference reference value for % computation
mverdy 20:626b92b70bf7 242 *
mverdy 20:626b92b70bf7 243 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 244 */
mverdy 20:626b92b70bf7 245 char* GetMenuDemoResultPerCent2( uint32_t value, uint32_t reference );
mverdy 20:626b92b70bf7 246
mverdy 20:626b92b70bf7 247 /*!
mverdy 20:626b92b70bf7 248 * \brief Return text with current Rssi.
mverdy 20:626b92b70bf7 249 *
mverdy 20:626b92b70bf7 250 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 251 */
mverdy 20:626b92b70bf7 252 char* GetMenuDemoRssi( void );
mverdy 20:626b92b70bf7 253
mverdy 20:626b92b70bf7 254 /*!
mverdy 20:626b92b70bf7 255 * \brief Return text with current Snr.
mverdy 20:626b92b70bf7 256 *
mverdy 20:626b92b70bf7 257 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 258 */
mverdy 20:626b92b70bf7 259 char* GetMenuDemoSnr( void );
mverdy 20:626b92b70bf7 260
mverdy 20:626b92b70bf7 261 /*!
mverdy 20:626b92b70bf7 262 * \brief Return text with current Antenna Setting.
mverdy 20:626b92b70bf7 263 *
mverdy 20:626b92b70bf7 264 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 265 */
mverdy 20:626b92b70bf7 266 char* GetAntennaSetting( void );
mverdy 20:626b92b70bf7 267
mverdy 20:626b92b70bf7 268 /*!
mverdy 20:626b92b70bf7 269 * \brief Return text with Total Packet for the test.
mverdy 20:626b92b70bf7 270 *
mverdy 20:626b92b70bf7 271 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 272 */
mverdy 20:626b92b70bf7 273 char* GetTotalPackets( void );
mverdy 20:626b92b70bf7 274
mverdy 20:626b92b70bf7 275 /*!
mverdy 20:626b92b70bf7 276 * \brief Return text with current GPS Time.
mverdy 20:626b92b70bf7 277 *
mverdy 20:626b92b70bf7 278 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 279 */
mverdy 20:626b92b70bf7 280 char* GetGpsTime( void );
mverdy 20:626b92b70bf7 281
mverdy 20:626b92b70bf7 282 /*!
mverdy 20:626b92b70bf7 283 * \brief Return text with current GPS Position.
mverdy 20:626b92b70bf7 284 *
mverdy 20:626b92b70bf7 285 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 286 */
mverdy 20:626b92b70bf7 287 char* GetGpsPos( void );
mverdy 20:626b92b70bf7 288
mverdy 20:626b92b70bf7 289 /*!
mverdy 20:626b92b70bf7 290 * \brief Return text with current Proximity Value.
mverdy 20:626b92b70bf7 291 *
mverdy 20:626b92b70bf7 292 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 293 */
mverdy 20:626b92b70bf7 294 char* GetProximityValue( void );
mverdy 20:626b92b70bf7 295
mverdy 20:626b92b70bf7 296 /*!
mverdy 20:626b92b70bf7 297 * \brief Return text with current Radio Power Mode Value.
mverdy 20:626b92b70bf7 298 *
mverdy 20:626b92b70bf7 299 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 300 */
mverdy 20:626b92b70bf7 301 char* GetMenuDemoRadioPowerMode( void );
mverdy 20:626b92b70bf7 302
mverdy 20:626b92b70bf7 303 /*!
mverdy 20:626b92b70bf7 304 * \brief Return text with current Frequency Error Value.
mverdy 20:626b92b70bf7 305 *
mverdy 20:626b92b70bf7 306 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 307 */
mverdy 20:626b92b70bf7 308 char* GetFrequencyError( void );
mverdy 20:626b92b70bf7 309
mverdy 20:626b92b70bf7 310 /*!
mverdy 20:626b92b70bf7 311 * \brief Return text with current Ranging Channels Successfully Done Value.
mverdy 20:626b92b70bf7 312 *
mverdy 20:626b92b70bf7 313 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 314 */
mverdy 20:626b92b70bf7 315 char* GetRngChannelsOk( void );
mverdy 20:626b92b70bf7 316
mverdy 20:626b92b70bf7 317 /*!
mverdy 20:626b92b70bf7 318 * \brief Return text with current Ranging Request Count Value.
mverdy 20:626b92b70bf7 319 *
mverdy 20:626b92b70bf7 320 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 321 */
mverdy 20:626b92b70bf7 322 char* GetRangingRequestCount( void );
mverdy 20:626b92b70bf7 323
mverdy 20:626b92b70bf7 324 /*!
mverdy 20:626b92b70bf7 325 * \brief Return text with current Ranging Address Value.
mverdy 20:626b92b70bf7 326 *
mverdy 20:626b92b70bf7 327 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 328 */
mverdy 20:626b92b70bf7 329 char* GetRangingAddress( void );
mverdy 20:626b92b70bf7 330
mverdy 20:626b92b70bf7 331 /*!
mverdy 20:626b92b70bf7 332 * \brief Return text with current Ranging Antenna Value.
mverdy 20:626b92b70bf7 333 *
mverdy 20:626b92b70bf7 334 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 335 */
mverdy 20:626b92b70bf7 336 char* GetRangingAntenna( void );
mverdy 20:626b92b70bf7 337
mverdy 20:626b92b70bf7 338 /*!
mverdy 20:626b92b70bf7 339 * \brief Return text with current Ranging Distance Unit.
mverdy 20:626b92b70bf7 340 *
mverdy 20:626b92b70bf7 341 * \retval text Pointer on text to display
mverdy 20:626b92b70bf7 342 */
mverdy 20:626b92b70bf7 343 char* GetRangingUnit( void );
mverdy 20:626b92b70bf7 344
mverdy 20:626b92b70bf7 345 #endif // MENU_H
mverdy 20:626b92b70bf7 346