Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
lib/TS_DISCO_F746NG/TS_DISCO_F746NG.h@0:14f16771fe40, 2015-11-05 (annotated)
- Committer:
- agemio
- Date:
- Thu Nov 05 12:53:31 2015 +0000
- Revision:
- 0:14f16771fe40
first commit;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| agemio | 0:14f16771fe40 | 1 | /* Copyright (c) 2010-2011 mbed.org, MIT License |
| agemio | 0:14f16771fe40 | 2 | * |
| agemio | 0:14f16771fe40 | 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
| agemio | 0:14f16771fe40 | 4 | * and associated documentation files (the "Software"), to deal in the Software without |
| agemio | 0:14f16771fe40 | 5 | * restriction, including without limitation the rights to use, copy, modify, merge, publish, |
| agemio | 0:14f16771fe40 | 6 | * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the |
| agemio | 0:14f16771fe40 | 7 | * Software is furnished to do so, subject to the following conditions: |
| agemio | 0:14f16771fe40 | 8 | * |
| agemio | 0:14f16771fe40 | 9 | * The above copyright notice and this permission notice shall be included in all copies or |
| agemio | 0:14f16771fe40 | 10 | * substantial portions of the Software. |
| agemio | 0:14f16771fe40 | 11 | * |
| agemio | 0:14f16771fe40 | 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
| agemio | 0:14f16771fe40 | 13 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| agemio | 0:14f16771fe40 | 14 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
| agemio | 0:14f16771fe40 | 15 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| agemio | 0:14f16771fe40 | 16 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| agemio | 0:14f16771fe40 | 17 | */ |
| agemio | 0:14f16771fe40 | 18 | |
| agemio | 0:14f16771fe40 | 19 | #ifndef __TS_DISCO_F746NG_H |
| agemio | 0:14f16771fe40 | 20 | #define __TS_DISCO_F746NG_H |
| agemio | 0:14f16771fe40 | 21 | |
| agemio | 0:14f16771fe40 | 22 | #ifdef TARGET_DISCO_F746NG |
| agemio | 0:14f16771fe40 | 23 | |
| agemio | 0:14f16771fe40 | 24 | #include "mbed.h" |
| agemio | 0:14f16771fe40 | 25 | #include "stm32746g_discovery_ts.h" |
| agemio | 0:14f16771fe40 | 26 | |
| agemio | 0:14f16771fe40 | 27 | |
| agemio | 0:14f16771fe40 | 28 | class TS_DISCO_F746NG |
| agemio | 0:14f16771fe40 | 29 | { |
| agemio | 0:14f16771fe40 | 30 | |
| agemio | 0:14f16771fe40 | 31 | public: |
| agemio | 0:14f16771fe40 | 32 | //! Constructor |
| agemio | 0:14f16771fe40 | 33 | TS_DISCO_F746NG(); |
| agemio | 0:14f16771fe40 | 34 | |
| agemio | 0:14f16771fe40 | 35 | //! Destructor |
| agemio | 0:14f16771fe40 | 36 | ~TS_DISCO_F746NG(); |
| agemio | 0:14f16771fe40 | 37 | |
| agemio | 0:14f16771fe40 | 38 | /** |
| agemio | 0:14f16771fe40 | 39 | * @brief Initializes and configures the touch screen functionalities and |
| agemio | 0:14f16771fe40 | 40 | * configures all necessary hardware resources (GPIOs, I2C, clocks..);. |
| agemio | 0:14f16771fe40 | 41 | * @param ts_SizeX: Maximum X size of the TS area on LCD |
| agemio | 0:14f16771fe40 | 42 | * @param ts_SizeY: Maximum Y size of the TS area on LCD |
| agemio | 0:14f16771fe40 | 43 | * @retval TS_OK if all initializations are OK. Other value if error. |
| agemio | 0:14f16771fe40 | 44 | */ |
| agemio | 0:14f16771fe40 | 45 | uint8_t Init(uint16_t ts_SizeX, uint16_t ts_SizeY); |
| agemio | 0:14f16771fe40 | 46 | |
| agemio | 0:14f16771fe40 | 47 | /** |
| agemio | 0:14f16771fe40 | 48 | * @brief DeInitializes the TouchScreen. |
| agemio | 0:14f16771fe40 | 49 | * @retval TS state |
| agemio | 0:14f16771fe40 | 50 | */ |
| agemio | 0:14f16771fe40 | 51 | uint8_t DeInit(void); |
| agemio | 0:14f16771fe40 | 52 | |
| agemio | 0:14f16771fe40 | 53 | /** |
| agemio | 0:14f16771fe40 | 54 | * @brief Configures and enables the touch screen interrupts. |
| agemio | 0:14f16771fe40 | 55 | * @retval TS_OK if all initializations are OK. Other value if error. |
| agemio | 0:14f16771fe40 | 56 | */ |
| agemio | 0:14f16771fe40 | 57 | uint8_t ITConfig(void); |
| agemio | 0:14f16771fe40 | 58 | |
| agemio | 0:14f16771fe40 | 59 | /** |
| agemio | 0:14f16771fe40 | 60 | * @brief Gets the touch screen interrupt status. |
| agemio | 0:14f16771fe40 | 61 | * @retval TS_OK if all initializations are OK. Other value if error. |
| agemio | 0:14f16771fe40 | 62 | */ |
| agemio | 0:14f16771fe40 | 63 | uint8_t ITGetStatus(void); |
| agemio | 0:14f16771fe40 | 64 | |
| agemio | 0:14f16771fe40 | 65 | /** |
| agemio | 0:14f16771fe40 | 66 | * @brief Returns status and positions of the touch screen. |
| agemio | 0:14f16771fe40 | 67 | * @param TS_State: Pointer to touch screen current state structure |
| agemio | 0:14f16771fe40 | 68 | * @retval TS_OK if all initializations are OK. Other value if error. |
| agemio | 0:14f16771fe40 | 69 | */ |
| agemio | 0:14f16771fe40 | 70 | uint8_t GetState(TS_StateTypeDef *TS_State); |
| agemio | 0:14f16771fe40 | 71 | |
| agemio | 0:14f16771fe40 | 72 | /** |
| agemio | 0:14f16771fe40 | 73 | * @brief Update gesture Id following a touch detected. |
| agemio | 0:14f16771fe40 | 74 | * @param TS_State: Pointer to touch screen current state structure |
| agemio | 0:14f16771fe40 | 75 | * @retval TS_OK if all initializations are OK. Other value if error. |
| agemio | 0:14f16771fe40 | 76 | */ |
| agemio | 0:14f16771fe40 | 77 | uint8_t Get_GestureId(TS_StateTypeDef *TS_State); |
| agemio | 0:14f16771fe40 | 78 | |
| agemio | 0:14f16771fe40 | 79 | /** |
| agemio | 0:14f16771fe40 | 80 | * @brief Clears all touch screen interrupts. |
| agemio | 0:14f16771fe40 | 81 | */ |
| agemio | 0:14f16771fe40 | 82 | void ITClear(void); |
| agemio | 0:14f16771fe40 | 83 | |
| agemio | 0:14f16771fe40 | 84 | /** |
| agemio | 0:14f16771fe40 | 85 | * @brief Function used to reset all touch data before a new acquisition |
| agemio | 0:14f16771fe40 | 86 | * of touch information. |
| agemio | 0:14f16771fe40 | 87 | * @param TS_State: Pointer to touch screen current state structure |
| agemio | 0:14f16771fe40 | 88 | * @retval TS_OK if OK, TE_ERROR if problem found. |
| agemio | 0:14f16771fe40 | 89 | */ |
| agemio | 0:14f16771fe40 | 90 | uint8_t ResetTouchData(TS_StateTypeDef *TS_State); |
| agemio | 0:14f16771fe40 | 91 | |
| agemio | 0:14f16771fe40 | 92 | private: |
| agemio | 0:14f16771fe40 | 93 | |
| agemio | 0:14f16771fe40 | 94 | }; |
| agemio | 0:14f16771fe40 | 95 | |
| agemio | 0:14f16771fe40 | 96 | #else |
| agemio | 0:14f16771fe40 | 97 | #error "This class must be used with DISCO_F746NG board only." |
| agemio | 0:14f16771fe40 | 98 | #endif // TARGET_DISCO_F746NG |
| agemio | 0:14f16771fe40 | 99 | |
| agemio | 0:14f16771fe40 | 100 | #endif |
