stm32l4xx_hal_pcd_ex.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  1. /**
  2. ******************************************************************************
  3. * @file stm32l4xx_hal_pcd_ex.c
  4. * @author MCD Application Team
  5. * @brief PCD Extended HAL module driver.
  6. * This file provides firmware functions to manage the following
  7. * functionalities of the USB Peripheral Controller:
  8. * + Extended features functions
  9. *
  10. ******************************************************************************
  11. * @attention
  12. *
  13. * Copyright (c) 2017 STMicroelectronics.
  14. * All rights reserved.
  15. *
  16. * This software is licensed under terms that can be found in the LICENSE file
  17. * in the root directory of this software component.
  18. * If no LICENSE file comes with this software, it is provided AS-IS.
  19. *
  20. ******************************************************************************
  21. */
  22. /* Includes ------------------------------------------------------------------*/
  23. #include "stm32l4xx_hal.h"
  24. /** @addtogroup STM32L4xx_HAL_Driver
  25. * @{
  26. */
  27. /** @defgroup PCDEx PCDEx
  28. * @brief PCD Extended HAL module driver
  29. * @{
  30. */
  31. #ifdef HAL_PCD_MODULE_ENABLED
  32. #if defined (USB) || defined (USB_OTG_FS)
  33. /* Private types -------------------------------------------------------------*/
  34. /* Private variables ---------------------------------------------------------*/
  35. /* Private constants ---------------------------------------------------------*/
  36. /* Private macros ------------------------------------------------------------*/
  37. /* Private functions ---------------------------------------------------------*/
  38. /* Exported functions --------------------------------------------------------*/
  39. /** @defgroup PCDEx_Exported_Functions PCDEx Exported Functions
  40. * @{
  41. */
  42. /** @defgroup PCDEx_Exported_Functions_Group1 Peripheral Control functions
  43. * @brief PCDEx control functions
  44. *
  45. @verbatim
  46. ===============================================================================
  47. ##### Extended features functions #####
  48. ===============================================================================
  49. [..] This section provides functions allowing to:
  50. (+) Update FIFO configuration
  51. @endverbatim
  52. * @{
  53. */
  54. #if defined (USB_OTG_FS)
  55. /**
  56. * @brief Set Tx FIFO
  57. * @param hpcd PCD handle
  58. * @param fifo The number of Tx fifo
  59. * @param size Fifo size
  60. * @retval HAL status
  61. */
  62. HAL_StatusTypeDef HAL_PCDEx_SetTxFiFo(PCD_HandleTypeDef *hpcd, uint8_t fifo, uint16_t size)
  63. {
  64. uint8_t i;
  65. uint32_t Tx_Offset;
  66. /* TXn min size = 16 words. (n : Transmit FIFO index)
  67. When a TxFIFO is not used, the Configuration should be as follows:
  68. case 1 : n > m and Txn is not used (n,m : Transmit FIFO indexes)
  69. --> Txm can use the space allocated for Txn.
  70. case2 : n < m and Txn is not used (n,m : Transmit FIFO indexes)
  71. --> Txn should be configured with the minimum space of 16 words
  72. The FIFO is used optimally when used TxFIFOs are allocated in the top
  73. of the FIFO.Ex: use EP1 and EP2 as IN instead of EP1 and EP3 as IN ones.
  74. When DMA is used 3n * FIFO locations should be reserved for internal DMA registers */
  75. Tx_Offset = hpcd->Instance->GRXFSIZ;
  76. if (fifo == 0U)
  77. {
  78. hpcd->Instance->DIEPTXF0_HNPTXFSIZ = ((uint32_t)size << 16) | Tx_Offset;
  79. }
  80. else
  81. {
  82. Tx_Offset += (hpcd->Instance->DIEPTXF0_HNPTXFSIZ) >> 16;
  83. for (i = 0U; i < (fifo - 1U); i++)
  84. {
  85. Tx_Offset += (hpcd->Instance->DIEPTXF[i] >> 16);
  86. }
  87. /* Multiply Tx_Size by 2 to get higher performance */
  88. hpcd->Instance->DIEPTXF[fifo - 1U] = ((uint32_t)size << 16) | Tx_Offset;
  89. }
  90. return HAL_OK;
  91. }
  92. /**
  93. * @brief Set Rx FIFO
  94. * @param hpcd PCD handle
  95. * @param size Size of Rx fifo
  96. * @retval HAL status
  97. */
  98. HAL_StatusTypeDef HAL_PCDEx_SetRxFiFo(PCD_HandleTypeDef *hpcd, uint16_t size)
  99. {
  100. hpcd->Instance->GRXFSIZ = size;
  101. return HAL_OK;
  102. }
  103. /**
  104. * @brief Activate LPM feature.
  105. * @param hpcd PCD handle
  106. * @retval HAL status
  107. */
  108. HAL_StatusTypeDef HAL_PCDEx_ActivateLPM(PCD_HandleTypeDef *hpcd)
  109. {
  110. USB_OTG_GlobalTypeDef *USBx = hpcd->Instance;
  111. hpcd->lpm_active = 1U;
  112. hpcd->LPM_State = LPM_L0;
  113. USBx->GINTMSK |= USB_OTG_GINTMSK_LPMINTM;
  114. USBx->GLPMCFG |= (USB_OTG_GLPMCFG_LPMEN | USB_OTG_GLPMCFG_LPMACK | USB_OTG_GLPMCFG_ENBESL);
  115. return HAL_OK;
  116. }
  117. /**
  118. * @brief Deactivate LPM feature.
  119. * @param hpcd PCD handle
  120. * @retval HAL status
  121. */
  122. HAL_StatusTypeDef HAL_PCDEx_DeActivateLPM(PCD_HandleTypeDef *hpcd)
  123. {
  124. USB_OTG_GlobalTypeDef *USBx = hpcd->Instance;
  125. hpcd->lpm_active = 0U;
  126. USBx->GINTMSK &= ~USB_OTG_GINTMSK_LPMINTM;
  127. USBx->GLPMCFG &= ~(USB_OTG_GLPMCFG_LPMEN | USB_OTG_GLPMCFG_LPMACK | USB_OTG_GLPMCFG_ENBESL);
  128. return HAL_OK;
  129. }
  130. /**
  131. * @brief Handle BatteryCharging Process.
  132. * @param hpcd PCD handle
  133. * @retval HAL status
  134. */
  135. void HAL_PCDEx_BCD_VBUSDetect(PCD_HandleTypeDef *hpcd)
  136. {
  137. USB_OTG_GlobalTypeDef *USBx = hpcd->Instance;
  138. uint32_t tickstart = HAL_GetTick();
  139. /* Enable DCD : Data Contact Detect */
  140. USBx->GCCFG |= USB_OTG_GCCFG_DCDEN;
  141. /* Wait for Min DCD Timeout */
  142. HAL_Delay(300U);
  143. /* Check Detect flag */
  144. if ((USBx->GCCFG & USB_OTG_GCCFG_DCDET) == USB_OTG_GCCFG_DCDET)
  145. {
  146. #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U)
  147. hpcd->BCDCallback(hpcd, PCD_BCD_CONTACT_DETECTION);
  148. #else
  149. HAL_PCDEx_BCD_Callback(hpcd, PCD_BCD_CONTACT_DETECTION);
  150. #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */
  151. }
  152. /* Primary detection: checks if connected to Standard Downstream Port
  153. (without charging capability) */
  154. USBx->GCCFG &= ~ USB_OTG_GCCFG_DCDEN;
  155. HAL_Delay(50U);
  156. USBx->GCCFG |= USB_OTG_GCCFG_PDEN;
  157. HAL_Delay(50U);
  158. if ((USBx->GCCFG & USB_OTG_GCCFG_PDET) == 0U)
  159. {
  160. /* Case of Standard Downstream Port */
  161. #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U)
  162. hpcd->BCDCallback(hpcd, PCD_BCD_STD_DOWNSTREAM_PORT);
  163. #else
  164. HAL_PCDEx_BCD_Callback(hpcd, PCD_BCD_STD_DOWNSTREAM_PORT);
  165. #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */
  166. }
  167. else
  168. {
  169. /* start secondary detection to check connection to Charging Downstream
  170. Port or Dedicated Charging Port */
  171. USBx->GCCFG &= ~ USB_OTG_GCCFG_PDEN;
  172. HAL_Delay(50U);
  173. USBx->GCCFG |= USB_OTG_GCCFG_SDEN;
  174. HAL_Delay(50U);
  175. if ((USBx->GCCFG & USB_OTG_GCCFG_SDET) == USB_OTG_GCCFG_SDET)
  176. {
  177. /* case Dedicated Charging Port */
  178. #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U)
  179. hpcd->BCDCallback(hpcd, PCD_BCD_DEDICATED_CHARGING_PORT);
  180. #else
  181. HAL_PCDEx_BCD_Callback(hpcd, PCD_BCD_DEDICATED_CHARGING_PORT);
  182. #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */
  183. }
  184. else
  185. {
  186. /* case Charging Downstream Port */
  187. #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U)
  188. hpcd->BCDCallback(hpcd, PCD_BCD_CHARGING_DOWNSTREAM_PORT);
  189. #else
  190. HAL_PCDEx_BCD_Callback(hpcd, PCD_BCD_CHARGING_DOWNSTREAM_PORT);
  191. #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */
  192. }
  193. }
  194. /* Battery Charging capability discovery finished */
  195. (void)HAL_PCDEx_DeActivateBCD(hpcd);
  196. /* Check for the Timeout, else start USB Device */
  197. if ((HAL_GetTick() - tickstart) > 1000U)
  198. {
  199. #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U)
  200. hpcd->BCDCallback(hpcd, PCD_BCD_ERROR);
  201. #else
  202. HAL_PCDEx_BCD_Callback(hpcd, PCD_BCD_ERROR);
  203. #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */
  204. }
  205. else
  206. {
  207. #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U)
  208. hpcd->BCDCallback(hpcd, PCD_BCD_DISCOVERY_COMPLETED);
  209. #else
  210. HAL_PCDEx_BCD_Callback(hpcd, PCD_BCD_DISCOVERY_COMPLETED);
  211. #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */
  212. }
  213. }
  214. /**
  215. * @brief Activate BatteryCharging feature.
  216. * @param hpcd PCD handle
  217. * @retval HAL status
  218. */
  219. HAL_StatusTypeDef HAL_PCDEx_ActivateBCD(PCD_HandleTypeDef *hpcd)
  220. {
  221. USB_OTG_GlobalTypeDef *USBx = hpcd->Instance;
  222. USBx->GCCFG &= ~(USB_OTG_GCCFG_PDEN);
  223. USBx->GCCFG &= ~(USB_OTG_GCCFG_SDEN);
  224. /* Power Down USB transceiver */
  225. USBx->GCCFG &= ~(USB_OTG_GCCFG_PWRDWN);
  226. /* Enable Battery charging */
  227. USBx->GCCFG |= USB_OTG_GCCFG_BCDEN;
  228. hpcd->battery_charging_active = 1U;
  229. return HAL_OK;
  230. }
  231. /**
  232. * @brief Deactivate BatteryCharging feature.
  233. * @param hpcd PCD handle
  234. * @retval HAL status
  235. */
  236. HAL_StatusTypeDef HAL_PCDEx_DeActivateBCD(PCD_HandleTypeDef *hpcd)
  237. {
  238. USB_OTG_GlobalTypeDef *USBx = hpcd->Instance;
  239. USBx->GCCFG &= ~(USB_OTG_GCCFG_SDEN);
  240. USBx->GCCFG &= ~(USB_OTG_GCCFG_PDEN);
  241. /* Disable Battery charging */
  242. USBx->GCCFG &= ~(USB_OTG_GCCFG_BCDEN);
  243. hpcd->battery_charging_active = 0U;
  244. return HAL_OK;
  245. }
  246. #endif /* defined (USB_OTG_FS) */
  247. #if defined (USB)
  248. /**
  249. * @brief Configure PMA for EP
  250. * @param hpcd Device instance
  251. * @param ep_addr endpoint address
  252. * @param ep_kind endpoint Kind
  253. * USB_SNG_BUF: Single Buffer used
  254. * USB_DBL_BUF: Double Buffer used
  255. * @param pmaadress: EP address in The PMA: In case of single buffer endpoint
  256. * this parameter is 16-bit value providing the address
  257. * in PMA allocated to endpoint.
  258. * In case of double buffer endpoint this parameter
  259. * is a 32-bit value providing the endpoint buffer 0 address
  260. * in the LSB part of 32-bit value and endpoint buffer 1 address
  261. * in the MSB part of 32-bit value.
  262. * @retval HAL status
  263. */
  264. HAL_StatusTypeDef HAL_PCDEx_PMAConfig(PCD_HandleTypeDef *hpcd, uint16_t ep_addr,
  265. uint16_t ep_kind, uint32_t pmaadress)
  266. {
  267. PCD_EPTypeDef *ep;
  268. /* initialize ep structure*/
  269. if ((0x80U & ep_addr) == 0x80U)
  270. {
  271. ep = &hpcd->IN_ep[ep_addr & EP_ADDR_MSK];
  272. }
  273. else
  274. {
  275. ep = &hpcd->OUT_ep[ep_addr];
  276. }
  277. /* Here we check if the endpoint is single or double Buffer*/
  278. if (ep_kind == PCD_SNG_BUF)
  279. {
  280. /* Single Buffer */
  281. ep->doublebuffer = 0U;
  282. /* Configure the PMA */
  283. ep->pmaadress = (uint16_t)pmaadress;
  284. }
  285. #if (USE_USB_DOUBLE_BUFFER == 1U)
  286. else /* USB_DBL_BUF */
  287. {
  288. /* Double Buffer Endpoint */
  289. ep->doublebuffer = 1U;
  290. /* Configure the PMA */
  291. ep->pmaaddr0 = (uint16_t)(pmaadress & 0xFFFFU);
  292. ep->pmaaddr1 = (uint16_t)((pmaadress & 0xFFFF0000U) >> 16);
  293. }
  294. #endif /* (USE_USB_DOUBLE_BUFFER == 1U) */
  295. return HAL_OK;
  296. }
  297. /**
  298. * @brief Activate BatteryCharging feature.
  299. * @param hpcd PCD handle
  300. * @retval HAL status
  301. */
  302. HAL_StatusTypeDef HAL_PCDEx_ActivateBCD(PCD_HandleTypeDef *hpcd)
  303. {
  304. USB_TypeDef *USBx = hpcd->Instance;
  305. hpcd->battery_charging_active = 1U;
  306. /* Enable BCD feature */
  307. USBx->BCDR |= USB_BCDR_BCDEN;
  308. /* Enable DCD : Data Contact Detect */
  309. USBx->BCDR &= ~(USB_BCDR_PDEN);
  310. USBx->BCDR &= ~(USB_BCDR_SDEN);
  311. USBx->BCDR |= USB_BCDR_DCDEN;
  312. return HAL_OK;
  313. }
  314. /**
  315. * @brief Deactivate BatteryCharging feature.
  316. * @param hpcd PCD handle
  317. * @retval HAL status
  318. */
  319. HAL_StatusTypeDef HAL_PCDEx_DeActivateBCD(PCD_HandleTypeDef *hpcd)
  320. {
  321. USB_TypeDef *USBx = hpcd->Instance;
  322. hpcd->battery_charging_active = 0U;
  323. /* Disable BCD feature */
  324. USBx->BCDR &= ~(USB_BCDR_BCDEN);
  325. return HAL_OK;
  326. }
  327. /**
  328. * @brief Handle BatteryCharging Process.
  329. * @param hpcd PCD handle
  330. * @retval HAL status
  331. */
  332. void HAL_PCDEx_BCD_VBUSDetect(PCD_HandleTypeDef *hpcd)
  333. {
  334. USB_TypeDef *USBx = hpcd->Instance;
  335. uint32_t tickstart = HAL_GetTick();
  336. /* Wait for Min DCD Timeout */
  337. HAL_Delay(300U);
  338. /* Data Pin Contact ? Check Detect flag */
  339. if ((USBx->BCDR & USB_BCDR_DCDET) == USB_BCDR_DCDET)
  340. {
  341. #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U)
  342. hpcd->BCDCallback(hpcd, PCD_BCD_CONTACT_DETECTION);
  343. #else
  344. HAL_PCDEx_BCD_Callback(hpcd, PCD_BCD_CONTACT_DETECTION);
  345. #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */
  346. }
  347. /* Primary detection: checks if connected to Standard Downstream Port
  348. (without charging capability) */
  349. USBx->BCDR &= ~(USB_BCDR_DCDEN);
  350. HAL_Delay(50U);
  351. USBx->BCDR |= (USB_BCDR_PDEN);
  352. HAL_Delay(50U);
  353. /* If Charger detect ? */
  354. if ((USBx->BCDR & USB_BCDR_PDET) == USB_BCDR_PDET)
  355. {
  356. /* Start secondary detection to check connection to Charging Downstream
  357. Port or Dedicated Charging Port */
  358. USBx->BCDR &= ~(USB_BCDR_PDEN);
  359. HAL_Delay(50U);
  360. USBx->BCDR |= (USB_BCDR_SDEN);
  361. HAL_Delay(50U);
  362. /* If CDP ? */
  363. if ((USBx->BCDR & USB_BCDR_SDET) == USB_BCDR_SDET)
  364. {
  365. /* Dedicated Downstream Port DCP */
  366. #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U)
  367. hpcd->BCDCallback(hpcd, PCD_BCD_DEDICATED_CHARGING_PORT);
  368. #else
  369. HAL_PCDEx_BCD_Callback(hpcd, PCD_BCD_DEDICATED_CHARGING_PORT);
  370. #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */
  371. }
  372. else
  373. {
  374. /* Charging Downstream Port CDP */
  375. #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U)
  376. hpcd->BCDCallback(hpcd, PCD_BCD_CHARGING_DOWNSTREAM_PORT);
  377. #else
  378. HAL_PCDEx_BCD_Callback(hpcd, PCD_BCD_CHARGING_DOWNSTREAM_PORT);
  379. #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */
  380. }
  381. }
  382. else /* NO */
  383. {
  384. /* Standard Downstream Port */
  385. #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U)
  386. hpcd->BCDCallback(hpcd, PCD_BCD_STD_DOWNSTREAM_PORT);
  387. #else
  388. HAL_PCDEx_BCD_Callback(hpcd, PCD_BCD_STD_DOWNSTREAM_PORT);
  389. #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */
  390. }
  391. /* Battery Charging capability discovery finished Start Enumeration */
  392. (void)HAL_PCDEx_DeActivateBCD(hpcd);
  393. /* Check for the Timeout, else start USB Device */
  394. if ((HAL_GetTick() - tickstart) > 1000U)
  395. {
  396. #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U)
  397. hpcd->BCDCallback(hpcd, PCD_BCD_ERROR);
  398. #else
  399. HAL_PCDEx_BCD_Callback(hpcd, PCD_BCD_ERROR);
  400. #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */
  401. }
  402. else
  403. {
  404. #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U)
  405. hpcd->BCDCallback(hpcd, PCD_BCD_DISCOVERY_COMPLETED);
  406. #else
  407. HAL_PCDEx_BCD_Callback(hpcd, PCD_BCD_DISCOVERY_COMPLETED);
  408. #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */
  409. }
  410. }
  411. /**
  412. * @brief Activate LPM feature.
  413. * @param hpcd PCD handle
  414. * @retval HAL status
  415. */
  416. HAL_StatusTypeDef HAL_PCDEx_ActivateLPM(PCD_HandleTypeDef *hpcd)
  417. {
  418. USB_TypeDef *USBx = hpcd->Instance;
  419. hpcd->lpm_active = 1U;
  420. hpcd->LPM_State = LPM_L0;
  421. USBx->LPMCSR |= USB_LPMCSR_LMPEN;
  422. USBx->LPMCSR |= USB_LPMCSR_LPMACK;
  423. return HAL_OK;
  424. }
  425. /**
  426. * @brief Deactivate LPM feature.
  427. * @param hpcd PCD handle
  428. * @retval HAL status
  429. */
  430. HAL_StatusTypeDef HAL_PCDEx_DeActivateLPM(PCD_HandleTypeDef *hpcd)
  431. {
  432. USB_TypeDef *USBx = hpcd->Instance;
  433. hpcd->lpm_active = 0U;
  434. USBx->LPMCSR &= ~(USB_LPMCSR_LMPEN);
  435. USBx->LPMCSR &= ~(USB_LPMCSR_LPMACK);
  436. return HAL_OK;
  437. }
  438. #endif /* defined (USB) */
  439. /**
  440. * @brief Send LPM message to user layer callback.
  441. * @param hpcd PCD handle
  442. * @param msg LPM message
  443. * @retval HAL status
  444. */
  445. __weak void HAL_PCDEx_LPM_Callback(PCD_HandleTypeDef *hpcd, PCD_LPM_MsgTypeDef msg)
  446. {
  447. /* Prevent unused argument(s) compilation warning */
  448. UNUSED(hpcd);
  449. UNUSED(msg);
  450. /* NOTE : This function should not be modified, when the callback is needed,
  451. the HAL_PCDEx_LPM_Callback could be implemented in the user file
  452. */
  453. }
  454. /**
  455. * @brief Send BatteryCharging message to user layer callback.
  456. * @param hpcd PCD handle
  457. * @param msg LPM message
  458. * @retval HAL status
  459. */
  460. __weak void HAL_PCDEx_BCD_Callback(PCD_HandleTypeDef *hpcd, PCD_BCD_MsgTypeDef msg)
  461. {
  462. /* Prevent unused argument(s) compilation warning */
  463. UNUSED(hpcd);
  464. UNUSED(msg);
  465. /* NOTE : This function should not be modified, when the callback is needed,
  466. the HAL_PCDEx_BCD_Callback could be implemented in the user file
  467. */
  468. }
  469. /**
  470. * @}
  471. */
  472. /**
  473. * @}
  474. */
  475. #endif /* defined (USB) || defined (USB_OTG_FS) */
  476. #endif /* HAL_PCD_MODULE_ENABLED */
  477. /**
  478. * @}
  479. */
  480. /**
  481. * @}
  482. */