-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgt911.c
More file actions
681 lines (614 loc) · 18.1 KB
/
gt911.c
File metadata and controls
681 lines (614 loc) · 18.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
/**
******************************************************************************
* @file gt911.c
* @author MCD Application Team
* @brief This file provides a set of functions needed to manage the GT911
* devices.
******************************************************************************
* @attention
*
* Copyright (c) 2023 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "gt911.h"
/** @addtogroup BSP
* @{
*/
/** @addtogroup Component
* @{
*/
/** @defgroup GT911 GT911
* @{
*/
/* Private typedef -----------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/** @defgroup GT911_Exported_Variables GT911 Exported Variables
* @{
*/
/* Touch screen driver structure initialization */
GT911_TS_Drv_t GT911_TS_Driver =
{
GT911_Init,
GT911_DeInit,
GT911_GestureConfig,
GT911_ReadID,
GT911_GetState,
GT911_GetMultiTouchState,
GT911_GetGesture,
GT911_GetCapabilities,
GT911_EnableIT,
GT911_DisableIT,
GT911_ClearIT,
GT911_ITStatus
};
/**
* @}
*/
/** @defgroup GT911_Private_Function_Prototypes GT911 Private Function Prototypes
* @{
*/
#if (GT911_AUTO_CALIBRATION_ENABLED == 1U)
static int32_t GT911_TS_Calibration(GT911_Object_t *pObj);
static int32_t GT911_Delay(GT911_Object_t *pObj, uint32_t Delay);
#endif /* GT911_AUTO_CALIBRATION_ENABLED == 1 */
static int32_t GT911_DetectTouch(GT911_Object_t *pObj);
static int32_t ReadRegWrap(void *handle, uint16_t Reg, uint8_t *pData, uint16_t Length);
static int32_t WriteRegWrap(void *handle, uint16_t Reg, uint8_t *pData, uint16_t Length);
/**
* @}
*/
/** @defgroup GT911_Exported_Functions GT911 Exported Functions
* @{
*/
/**
* @brief Register IO bus to component object
* @param pObj Component object pointer
* @param pIO IO bus pointer
* @retval Component status
*/
int32_t GT911_RegisterBusIO(GT911_Object_t *pObj, GT911_IO_t *pIO)
{
int32_t ret;
if (pObj == NULL)
{
ret = GT911_ERROR;
}
else
{
pObj->IO.Init = pIO->Init;
pObj->IO.DeInit = pIO->DeInit;
pObj->IO.Address = pIO->Address;
pObj->IO.WriteReg = pIO->WriteReg;
pObj->IO.ReadReg = pIO->ReadReg;
pObj->IO.GetTick = pIO->GetTick;
pObj->Ctx.ReadReg = ReadRegWrap;
pObj->Ctx.WriteReg = WriteRegWrap;
pObj->Ctx.handle = pObj;
if (pObj->IO.Init != NULL)
{
ret = pObj->IO.Init();
}
else
{
ret = GT911_ERROR;
}
}
return ret;
}
/**
* @brief Get GT911 sensor capabilities
* @param pObj Component object pointer
* @param pCapabilities GT911 sensor capabilities pointer
* @retval Component status
*/
int32_t GT911_GetCapabilities(GT911_Object_t *pObj, GT911_Capabilities_t *pCapabilities)
{
/* Prevent unused argument(s) compilation warning */
(void)(pObj);
/* Store component's capabilities */
pCapabilities->MultiTouch = 1U;
pCapabilities->Gesture = 1U;
pCapabilities->MaxTouch = GT911_MAX_NB_TOUCH;
pCapabilities->MaxXl = GT911_MAX_X_LENGTH;
pCapabilities->MaxYl = GT911_MAX_Y_LENGTH;
return GT911_OK;
}
/**
* @brief Initialize the GT911 communication bus
* from MCU to GT911 : ie I2C channel initialization (if required).
* @param pObj Component object pointer
* @retval Component status
*/
int32_t GT911_Init(GT911_Object_t *pObj)
{
int32_t ret = GT911_OK;
if (pObj->IsInitialized == 0U)
{
/* Initialize IO BUS layer */
pObj->IO.Init();
#if (GT911_AUTO_CALIBRATION_ENABLED == 1U)
/* Hw Calibration sequence start : should be done once after each power up */
/* This is called internal calibration of the touch screen */
ret += GT911_TS_Calibration(pObj);
#endif /* (GT911_AUTO_CALIBRATION_ENABLED == 1) */
pObj->IsInitialized = 1U;
}
#if (GT911_AUTO_CALIBRATION_ENABLED == 1U)
if (ret == GT911_OK)
#endif /* (GT911_AUTO_CALIBRATION_ENABLED == 1) */
{
uint16_t ii;
uint8_t r_data;
uint8_t calc_chksum = 0U;
/* Calculate the CRC of the configuration registers */
for (ii = GT911_CONFIG_VERS_REG; ii < GT911_CONFIG_CHKSUM_REG; ii++)
{
if (pObj->IO.ReadReg(pObj->IO.Address, ii, &r_data, 1U) != 0U)
{
ret = GT911_ERROR; /* I2C reading failed */
break;
}
else
{
calc_chksum += r_data;
}
}
if (ret == GT911_OK)
{
calc_chksum = ((~calc_chksum) + 1U) & 0xffU;
if (pObj->IO.ReadReg(pObj->IO.Address, GT911_CONFIG_CHKSUM_REG, &r_data, 1U) != 0U)
{
ret = GT911_ERROR; /* I2C reading failed */
}
else
{
if (calc_chksum != r_data)
{
ret = GT911_ERROR; /* Wrong CheckSum */
}
}
}
}
if (ret != GT911_OK)
{
ret = GT911_ERROR;
}
return ret;
}
/**
* @brief De-Initialize the GT911 communication bus
* from MCU to GT911 : ie I2C channel initialization (if required).
* @param pObj Component object pointer
* @retval Component status
*/
int32_t GT911_DeInit(GT911_Object_t *pObj)
{
int32_t ret = GT911_OK;
if (pObj->IsInitialized == 1U)
{
pObj->IsInitialized = 0U;
}
return ret;
}
/**
* @brief Configure the GT911 gesture
* @param pObj Component object pointer
* @param pGestureInit Gesture init structure pointer
* @retval Component status
*/
int32_t GT911_GestureConfig(GT911_Object_t *pObj, GT911_Gesture_Init_t *pGestureInit)
{
int32_t ret;
uint8_t mode = GT911_GESTURE_EN;
uint8_t switch1_value = GT911_GESTURE_SWITCH1_VAL;
uint8_t switch2_value = GT911_GESTURE_SWITCH2_VAL;
uint8_t press_time = GT911_GESTURE_TIME_ABORT;
uint8_t adjust_value = GT911_GESTURE_ADJUST_VAL;
uint8_t control = (GT911_GESTURE_INVALID_TIM & pGestureInit->Gain);
if (gt911_distance_up_down(&pObj->Ctx, (uint8_t)pGestureInit->DistanceUpDown) != GT911_OK)
{
ret = GT911_ERROR;
}
else if (gt911_distance_left_right(&pObj->Ctx, (uint8_t)pGestureInit->DistanceLeftRight) != GT911_OK)
{
ret = GT911_ERROR;
}
else if (gt911_write_reg(&pObj->Ctx, GT911_GESTURE_PRESS_TIME, &press_time, 1U) != GT911_OK)
{
ret = GT911_ERROR;
}
else if (gt911_write_reg(&pObj->Ctx, GT911_GESTURE_SLOPE_ADJUST, &adjust_value, 1U) != GT911_OK)
{
ret = GT911_ERROR;
}
else if (gt911_write_reg(&pObj->Ctx, GT911_GESTURE_CTRL_REG, &control, 1U) != GT911_OK)
{
ret = GT911_ERROR;
}
else if (gt911_write_reg(&pObj->Ctx, GT911_GESTURE_SWITCH1_REG, &switch1_value, 1U) != GT911_OK)
{
ret = GT911_ERROR;
}
else if (gt911_write_reg(&pObj->Ctx, GT911_GESTURE_SWITCH2_REG, &switch2_value, 1U) != GT911_OK)
{
ret = GT911_ERROR;
}
else if (gt911_write_reg(&pObj->Ctx, GT911_GESTURE_REFRESH_REG, &pGestureInit->RefreshRate, 1U) != GT911_OK)
{
ret = GT911_ERROR;
}
else if (gt911_write_reg(&pObj->Ctx, GT911_GESTURE_TH_REG, &pGestureInit->GestureThreshold, 1U) != GT911_OK)
{
ret = GT911_ERROR;
}
else if (gt911_write_reg(&pObj->Ctx, GT911_COMMAND_CHK_REG, &mode, 1U) != GT911_OK)
{
ret = GT911_ERROR;
}
else if (gt911_write_reg(&pObj->Ctx, GT911_COMMAND_REG, &mode, 1U) != GT911_OK)
{
ret = GT911_ERROR;
}
else
{
ret = GT911_OK;
}
return ret;
}
/**
* @brief Read the GT911 device ID, pre initialize I2C in case of need to be
* able to read the GT911 device ID, and verify this is a GT911.
* @param pObj Component object pointer
* @param pId Device ID (two bytes) pointer
* @retval Component status
*/
int32_t GT911_ReadID(GT911_Object_t *pObj, uint32_t *pId)
{
return gt911_chip_id(&pObj->Ctx, (uint8_t *)pId);
}
/**
* @brief Get the touch screen X and Y positions values
* @param pObj Component object pointer
* @param pState Single Touch structure pointer
* @retval Component status
*/
int32_t GT911_GetState(GT911_Object_t *pObj, GT911_State_t *pState)
{
int32_t ret;
uint8_t data[6] = {0};
uint8_t value = 0U;
ret = GT911_DetectTouch(pObj);
if (ret >= 0L)
{
pState->TouchDetected = (uint32_t)GT911_DetectTouch(pObj);
}
else
{
return ret;
}
if (pState->TouchDetected > GT911_MAX_NB_TOUCH)
{
ret = GT911_ERROR;
}
else
{
if (pState->TouchDetected == 0U)
{} /* No Touch Detected */
else if (gt911_read_reg(&pObj->Ctx, GT911_P1_XL_REG, data, (uint16_t)sizeof(data)) != GT911_OK)
{
ret = GT911_ERROR;
}
else
{
/* Send back first ready X position to caller */
pState->TouchX = (((uint32_t)data[GT911_P1_XH_TP_BIT_POSITION] & GT911_P1_XH_TP_BIT_MASK) << 8U) | ((uint32_t)data[GT911_P1_XL_TP_BIT_POSITION] & GT911_P1_XL_TP_BIT_MASK);
/* Send back first ready Y position to caller */
pState->TouchY = (((uint32_t)data[GT911_P1_YH_TP_BIT_POSITION] & GT911_P1_YH_TP_BIT_MASK) << 8U) | ((uint32_t)data[GT911_P1_YL_TP_BIT_POSITION] & GT911_P1_YL_TP_BIT_MASK);
/* Acknowledge the reading of the Touch coordinates */
ret = gt911_write_reg(&pObj->Ctx, GT911_TD_STAT_REG, &value, 1U);
}
}
return ret;
}
/**
* @brief Get the touch screen Xn and Yn positions values in multi-touch mode
* @param pObj Component object pointer
* @param pState Multi Touch structure pointer
* @retval Component status
*/
int32_t GT911_GetMultiTouchState(GT911_Object_t *pObj, GT911_MultiTouch_State_t *pState)
{
int32_t ret;
uint32_t i;
uint8_t data[40] = {0};
uint8_t value = 0U;
ret = GT911_DetectTouch(pObj);
if (ret >= 0L)
{
pState->TouchDetected = (uint32_t)GT911_DetectTouch(pObj);
}
else
{
return ret;
}
if (pState->TouchDetected > GT911_MAX_NB_TOUCH)
{
ret = GT911_ERROR;
}
else if (gt911_read_reg(&pObj->Ctx, GT911_P1_XL_REG, data, (uint16_t)sizeof(data)) != GT911_OK)
{
ret = GT911_ERROR;
}
else
{
for (i = 0; i < pState->TouchDetected; i++)
{
/* Send back first ready X position to caller */
pState->TouchX[i] = (((uint32_t)data[(i * 8U) + GT911_P1_XH_TP_BIT_POSITION] & GT911_P1_XH_TP_BIT_MASK) << 8U) | ((uint32_t)data[(i * 8U)] & GT911_P1_XL_TP_BIT_MASK);
/* Send back first ready Y position to caller */
pState->TouchY[i] = (((uint32_t)data[(i * 8U) + GT911_P1_YH_TP_BIT_POSITION] & GT911_P1_YH_TP_BIT_MASK) << 8U) | ((uint32_t)data[(i * 8U) + GT911_P1_YL_TP_BIT_POSITION] & GT911_P1_YL_TP_BIT_MASK);
/* Send back first ready Weight to caller */
pState->TouchWeight[i] = ((uint32_t)data[(i * 8U) + GT911_P1_WEIGHT_BIT_POSITION] & GT911_P1_WEIGHT_BIT_MASK);
/* Send back first ready Area to caller */
pState->TouchTrackID[i] = ((uint32_t)data[(i * 8U) + GT911_P1_TID_BIT_POSITION] & GT911_P1_TID_BIT_MASK) >> GT911_P1_TID_BIT_POSITION;
}
for (i = pState->TouchDetected; i < GT911_MAX_NB_TOUCH; i++)
{
/* set 0 for non-touch point(s) */
pState->TouchX[i] = 0U;
pState->TouchY[i] = 0U;
pState->TouchWeight[i] = 0U;
pState->TouchTrackID[i] = 0U;
}
/* Acknowledge the reading of the Touch coordinates */
ret = gt911_write_reg(&pObj->Ctx, GT911_TD_STAT_REG, &value, 1U);
}
return ret;
}
/**
* @brief Get Gesture ID
* @param pObj Component object pointer
* @param pGestureId Gesture ID pointer
* @retval Component status
*/
int32_t GT911_GetGesture(GT911_Object_t *pObj, uint8_t *pGestureId)
{
return gt911_gest_id(&pObj->Ctx, pGestureId);
}
/**
* @brief Configure the GT911 device to generate IT on given INT pin
* connected to MCU as EXTI.
* @param pObj Component object pointer
* @retval Component status
*/
int32_t GT911_EnableIT(GT911_Object_t *pObj)
{
int32_t ret = GT911_OK;
uint8_t r_data;
if (pObj->Ctx.ReadReg(pObj->Ctx.handle, GT911_MSW1_REG, &r_data, 1U) == 0U)
{
if (gt911_m_sw1(&pObj->Ctx, ((pObj->Trigger & GT911_M_SW1_BIT_MASK) | (r_data & GT911_M_SW1_DATA_MASK))) != 0)
{
ret = GT911_ERROR;
}
}
else
{
ret = GT911_ERROR;
}
return ret;
}
/**
* @brief Set the GT911 Trigger
* @param pObj Component object pointer
* @param Trigger Interrupt trigger mode
* @retval Component status
*/
int32_t GT911_SetTriggerMode(GT911_Object_t *pObj, uint8_t Trigger)
{
pObj->Trigger = Trigger;
return GT911_OK;
}
/**
* @brief Get the GT911 Trigger
* @param pObj Component object pointer
* @param pTrigger pointer to Interrupt Trigger
* @retval Component status
*/
int32_t GT911_GetTriggerMode(GT911_Object_t *pObj, uint8_t *pTrigger)
{
*pTrigger = (uint8_t)pObj->Trigger;
return GT911_OK;
}
/**
* @brief Configure the GT911 device to stop generating IT on the given INT pin
* connected to MCU as EXTI.
* @param pObj Component object pointer
* @retval Component status
*/
int32_t GT911_DisableIT(GT911_Object_t *pObj)
{
/* Prevent unused argument(s) compilation warning */
(void)(pObj);
/* Always return GT911_OK as feature not applicable to GT911 */
return GT911_OK;
}
/**
* @brief Get IT status from GT911 interrupt status registers
* Should be called Following an EXTI coming to the MCU to know the detailed
* reason of the interrupt.
* @note : This feature is not applicable to GT911.
* @param pObj Component object pointer
* @retval TS interrupts status : always return GT911_OK here
*/
int32_t GT911_ITStatus(GT911_Object_t *pObj)
{
/* Prevent unused argument(s) compilation warning */
(void)(pObj);
/* Always return GT911_OK as feature not applicable to GT911 */
return GT911_OK;
}
/**
* @brief Clear IT status in GT911 interrupt status clear registers
* Should be called Following an EXTI coming to the MCU.
* @note : This feature is not applicable to GT911.
* @param pObj Component object pointer
* @retval Component status
*/
int32_t GT911_ClearIT(GT911_Object_t *pObj)
{
return gt911_clr_int(&pObj->Ctx);
}
/******************** Static functions ****************************************/
#if (GT911_AUTO_CALIBRATION_ENABLED == 1)
/**
* @brief This function provides accurate delay (in milliseconds)
* @param pObj Component object pointer
* @param Delay specifies the delay time length, in milliseconds
* @retval GT911_OK
*/
static int32_t GT911_Delay(GT911_Object_t *pObj, uint32_t Delay)
{
uint32_t tickstart;
tickstart = pObj->IO.GetTick();
while ((pObj->IO.GetTick() - tickstart) < Delay)
{
}
return GT911_OK;
}
/**
* @brief Start TouchScreen calibration phase
* @param pObj Component object pointer
* @retval Status GT911_OK or GT911_ERROR.
*/
static int32_t GT911_TS_Calibration(GT911_Object_t *pObj)
{
int32_t ret = GT911_OK;
uint32_t nbr_attempt;
uint8_t read_data;
uint8_t end_calibration = 0U;
/* Switch GT911 back to factory mode to calibrate */
if (gt911_dev_mode_w(&pObj->Ctx, GT911_DEV_MODE_FACTORY) != GT911_OK)
{
ret = GT911_ERROR;
}/* Read back the same register GT911_DEV_MODE_REG */
else if (gt911_dev_mode_r(&pObj->Ctx, &read_data) != GT911_OK)
{
ret = GT911_ERROR;
}
else
{
(void)GT911_Delay(pObj, 300U); /* Wait 300 ms */
if (read_data != GT911_DEV_MODE_FACTORY)
{
/* Return error to caller */
ret = GT911_ERROR;
}
else
{
/* Start calibration command */
read_data = 0x04U;
if (gt911_write_reg(&pObj->Ctx, GT911_TD_STAT_REG, &read_data, 1U) != GT911_OK)
{
ret = GT911_ERROR;
}
else
{
(void)GT911_Delay(pObj, 300); /* Wait 300 ms */
/* 100 attempts to wait switch from factory mode (calibration) to working mode */
for (nbr_attempt = 0; ((nbr_attempt < 100U) && (end_calibration == 0U)) ; nbr_attempt++)
{
if (gt911_dev_mode_r(&pObj->Ctx, &read_data) != GT911_OK)
{
ret = GT911_ERROR;
break;
}
if (read_data == GT911_DEV_MODE_WORKING)
{
/* Auto Switch to GT911_DEV_MODE_WORKING : means calibration have ended */
end_calibration = 1U; /* exit for loop */
}
(void)GT911_Delay(pObj, 200U); /* Wait 200 ms */
}
}
}
}
return ret;
}
#endif /* GT911_AUTO_CALIBRATION_ENABLED == 1 */
/**
* @brief Return if there is touches detected or not.
* Try to detect new touches and forget the old ones (reset internal global
* variables).
* @param pObj Component object pointer
* @retval Number of active touches detected (can be 0, 1~5) or GT911_ERROR
* in case of error
*/
static int32_t GT911_DetectTouch(GT911_Object_t *pObj)
{
int32_t ret;
uint8_t nb_touch;
/* Read register GT911_TD_STAT_REG to check number of touches detection */
if (gt911_td_status(&pObj->Ctx, &nb_touch) != GT911_OK)
{
ret = GT911_ERROR;
}
else
{
if (nb_touch > GT911_MAX_NB_TOUCH)
{
/* If invalid number of touch detected, set it to zero */
ret = 0L;
}
else
{
ret = (int32_t)nb_touch;
}
}
return ret;
}
/**
* @brief Function
* @param handle: Component object handle
* @param Reg The target register address to write
* @param pData The target register value to be written
* @param Length Buffer size to be read
* @retval Component status
*/
static int32_t ReadRegWrap(void *handle, uint16_t Reg, uint8_t *pData, uint16_t Length)
{
GT911_Object_t *pObj = (GT911_Object_t *)handle; /* Derogation MISRAC2012-Rule-11.5 */
return pObj->IO.ReadReg(pObj->IO.Address, Reg, pData, Length);
}
/**
* @brief Function
* @param handle: Component object handle
* @param Reg The target register address to write
* @param pData The target register value to be written
* @param Length Buffer size to be written
* @retval Component status
*/
static int32_t WriteRegWrap(void *handle, uint16_t Reg, uint8_t *pData, uint16_t Length)
{
GT911_Object_t *pObj = (GT911_Object_t *)handle; /* Derogation MISRAC2012-Rule-11.5 */
return pObj->IO.WriteReg(pObj->IO.Address, Reg, pData, Length);
}
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/