stm32l4xx_hal_pssi.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  1. /**
  2. ******************************************************************************
  3. * @file stm32l4xx_hal_pssi.h
  4. * @author MCD Application Team
  5. * @brief Header file of PSSI HAL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * Copyright (c) 2019 STMicroelectronics.
  10. * All rights reserved.
  11. *
  12. * This software is licensed under terms that can be found in the LICENSE file
  13. * in the root directory of this software component.
  14. * If no LICENSE file comes with this software, it is provided AS-IS.
  15. *
  16. ******************************************************************************
  17. */
  18. /* Define to prevent recursive inclusion -------------------------------------*/
  19. #ifndef STM32L4xx_HAL_PSSI_H
  20. #define STM32L4xx_HAL_PSSI_H
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. /* Includes ------------------------------------------------------------------*/
  25. #include "stm32l4xx_hal_def.h"
  26. /** @addtogroup STM32L4xx_HAL_Driver
  27. * @{
  28. */
  29. #if defined(PSSI)
  30. #ifndef USE_HAL_PSSI_REGISTER_CALLBACKS
  31. /* For backward compatibility, if USE_HAL_PSSI_REGISTER_CALLBACKS not defined, define it to 1*/
  32. #define USE_HAL_PSSI_REGISTER_CALLBACKS 0U
  33. #endif /* USE_HAL_PSSI_REGISTER_CALLBACKS */
  34. /** @addtogroup PSSI PSSI
  35. * @brief PSSI HAL module driver
  36. * @{
  37. */
  38. /* Exported types ------------------------------------------------------------*/
  39. /** @defgroup PSSI_Exported_Types PSSI Exported Types
  40. * @{
  41. */
  42. /**
  43. * @brief PSSI Init structure definition
  44. */
  45. typedef struct
  46. {
  47. uint32_t DataWidth; /* !< Configures the data width.
  48. This parameter can be a value of @ref PSSI_DATA_WIDTH. */
  49. uint32_t BusWidth; /* !< Configures the parallel bus width.
  50. This parameter can be a value of @ref PSSI_BUS_WIDTH. */
  51. uint32_t ControlSignal; /* !< Configures Data enable and Data ready.
  52. This parameter can be a value of @ref ControlSignal_Configuration. */
  53. uint32_t ClockPolarity; /* !< Configures the PSSI Input Clock polarity.
  54. This parameter can be a value of @ref Clock_Polarity. */
  55. uint32_t DataEnablePolarity; /* !< Configures the PSSI Data Enable polarity.
  56. This parameter can be a value of @ref Data_Enable_Polarity. */
  57. uint32_t ReadyPolarity; /* !< Configures the PSSI Ready polarity.
  58. This parameter can be a value of @ref Ready_Polarity. */
  59. } PSSI_InitTypeDef;
  60. /**
  61. * @brief HAL PSSI State structures definition
  62. */
  63. typedef enum
  64. {
  65. HAL_PSSI_STATE_RESET = 0x00U, /* !< PSSI not yet initialized or disabled */
  66. HAL_PSSI_STATE_READY = 0x01U, /* !< Peripheral initialized and ready for use */
  67. HAL_PSSI_STATE_BUSY = 0x02U, /* !< An internal process is ongoing */
  68. HAL_PSSI_STATE_BUSY_TX = 0x03U, /* !< Transmit process is ongoing */
  69. HAL_PSSI_STATE_BUSY_RX = 0x04U, /* !< Receive process is ongoing */
  70. HAL_PSSI_STATE_TIMEOUT = 0x05U, /* !< Timeout state */
  71. HAL_PSSI_STATE_ERROR = 0x06U, /* !< PSSI state error */
  72. HAL_PSSI_STATE_ABORT = 0x07U, /* !< PSSI process is aborted */
  73. } HAL_PSSI_StateTypeDef;
  74. /**
  75. * @brief PSSI handle Structure definition
  76. */
  77. #if (USE_HAL_PSSI_REGISTER_CALLBACKS == 1)
  78. typedef struct __PSSI_HandleTypeDef
  79. #else
  80. typedef struct
  81. #endif /* USE_HAL_PSSI_REGISTER_CALLBACKS */
  82. {
  83. PSSI_TypeDef *Instance; /*!< PSSI register base address. */
  84. PSSI_InitTypeDef Init; /*!< PSSI Initialization Structure. */
  85. uint32_t *pBuffPtr; /*!< PSSI Data buffer. */
  86. uint32_t XferCount; /*!< PSSI transfer count */
  87. uint32_t XferSize; /*!< PSSI transfer size */
  88. #if defined(HAL_DMA_MODULE_ENABLED)
  89. DMA_HandleTypeDef *hdmatx; /*!< PSSI Tx DMA Handle parameters */
  90. DMA_HandleTypeDef *hdmarx; /*!< PSSI Rx DMA Handle parameters */
  91. #endif /*HAL_DMA_MODULE_ENABLED*/
  92. #if (USE_HAL_PSSI_REGISTER_CALLBACKS == 1)
  93. void (* TxCpltCallback)(struct __PSSI_HandleTypeDef *hpssi); /*!< PSSI transfer complete callback. */
  94. void (* RxCpltCallback)(struct __PSSI_HandleTypeDef *hpssi); /*!< PSSI transfer complete callback. */
  95. void (* ErrorCallback)(struct __PSSI_HandleTypeDef *hpssi); /*!< PSSI transfer complete callback. */
  96. void (* AbortCpltCallback)(struct __PSSI_HandleTypeDef *hpssi); /*!< PSSI transfer error callback. */
  97. void (* MspInitCallback)(struct __PSSI_HandleTypeDef *hpssi); /*!< PSSI Msp Init callback. */
  98. void (* MspDeInitCallback)(struct __PSSI_HandleTypeDef *hpssi); /*!< PSSI Msp DeInit callback. */
  99. #endif /* USE_HAL_PSSI_REGISTER_CALLBACKS */
  100. HAL_LockTypeDef Lock; /*!< PSSI lock. */
  101. __IO HAL_PSSI_StateTypeDef State; /*!< PSSI transfer state. */
  102. __IO uint32_t ErrorCode; /*!< PSSI error code. */
  103. } PSSI_HandleTypeDef;
  104. #if (USE_HAL_PSSI_REGISTER_CALLBACKS == 1)
  105. /**
  106. * @brief HAL PSSI Callback pointer definition
  107. */
  108. typedef void (*pPSSI_CallbackTypeDef)(PSSI_HandleTypeDef *hpssi); /*!< Pointer to a PSSI common callback function */
  109. /**
  110. * @brief HAL PSSI Callback ID enumeration definition
  111. */
  112. typedef enum
  113. {
  114. HAL_PSSI_TX_COMPLETE_CB_ID = 0x00U, /*!< PSSI Tx Transfer completed callback ID */
  115. HAL_PSSI_RX_COMPLETE_CB_ID = 0x01U, /*!< PSSI Rx Transfer completed callback ID */
  116. HAL_PSSI_ERROR_CB_ID = 0x03U, /*!< PSSI Error callback ID */
  117. HAL_PSSI_ABORT_CB_ID = 0x04U, /*!< PSSI Abort callback ID */
  118. HAL_PSSI_MSPINIT_CB_ID = 0x05U, /*!< PSSI Msp Init callback ID */
  119. HAL_PSSI_MSPDEINIT_CB_ID = 0x06U /*!< PSSI Msp DeInit callback ID */
  120. } HAL_PSSI_CallbackIDTypeDef;
  121. #endif /* USE_HAL_PSSI_REGISTER_CALLBACKS */
  122. /**
  123. * @}
  124. */
  125. /* Exported constants --------------------------------------------------------*/
  126. /** @defgroup PSSI_Exported_Constants PSSI Exported Constants
  127. * @{
  128. */
  129. /** @defgroup PSSI_Error_Code PSSI Error Code
  130. * @{
  131. */
  132. #define HAL_PSSI_ERROR_NONE 0x00000000U /*!< No error */
  133. #define HAL_PSSI_ERROR_NOT_SUPPORTED 0x00000001U /*!< Not supported operation */
  134. #define HAL_PSSI_ERROR_UNDER_RUN 0x00000002U /*!< FIFO Under-run error */
  135. #define HAL_PSSI_ERROR_OVER_RUN 0x00000004U /*!< FIFO Over-run error */
  136. #define HAL_PSSI_ERROR_DMA 0x00000008U /*!< Dma error */
  137. #define HAL_PSSI_ERROR_TIMEOUT 0x00000010U /*!< Timeout error */
  138. #if (USE_HAL_PSSI_REGISTER_CALLBACKS == 1)
  139. #define HAL_PSSI_ERROR_INVALID_CALLBACK 0x00000020U /*!< Invalid callback error */
  140. #endif /* USE_HAL_PSSI_REGISTER_CALLBACKS */
  141. /**
  142. * @}
  143. */
  144. /** @defgroup PSSI_DATA_WIDTH PSSI Data Width
  145. * @{
  146. */
  147. #define HAL_PSSI_8BITS 0x00000000U /*!< 8 Bits */
  148. #define HAL_PSSI_16BITS 0x00000001U /*!< 16 Bits */
  149. #define HAL_PSSI_32BITS 0x00000002U /*!< 32 Bits */
  150. /**
  151. * @}
  152. */
  153. /** @defgroup PSSI_BUS_WIDTH PSSI Bus Width
  154. * @{
  155. */
  156. #define HAL_PSSI_8LINES 0x00000000U /*!< 8 data lines */
  157. #define HAL_PSSI_16LINES PSSI_CR_EDM /*!< 16 data lines */
  158. /**
  159. * @}
  160. */
  161. /** @defgroup PSSI_MODE PSSI mode
  162. * @{
  163. */
  164. #define HAL_PSSI_UNIDIRECTIONAL 0x00000000U /*!< Uni-directional mode */
  165. #define HAL_PSSI_BIDIRECTIONAL 0x00000001U /*!< Bi-directional mode */
  166. /**
  167. * @}
  168. */
  169. /** @defgroup ControlSignal_Configuration ControlSignal Configuration
  170. * @{
  171. */
  172. #define HAL_PSSI_DE_RDY_DISABLE (0x0U << PSSI_CR_DERDYCFG_Pos) /*!< Neither DE nor RDY are enabled */
  173. #define HAL_PSSI_RDY_ENABLE (0x1U << PSSI_CR_DERDYCFG_Pos) /*!< Only RDY enabled */
  174. #define HAL_PSSI_DE_ENABLE (0x2U << PSSI_CR_DERDYCFG_Pos) /*!< Only DE enabled */
  175. #define HAL_PSSI_DE_RDY_ALT_ENABLE (0x3U << PSSI_CR_DERDYCFG_Pos) /*!< Both RDY and DE alternate functions enabled */
  176. #define HAL_PSSI_MAP_RDY_BIDIR_ENABLE (0x4U << PSSI_CR_DERDYCFG_Pos) /*!< Bi-directional on RDY pin */
  177. #define HAL_PSSI_RDY_MAP_ENABLE (0x5U << PSSI_CR_DERDYCFG_Pos) /*!< Only RDY enabled, mapped to DE pin */
  178. #define HAL_PSSI_DE_MAP_ENABLE (0x6U << PSSI_CR_DERDYCFG_Pos) /*!< Only DE enabled, mapped to RDY pin */
  179. #define HAL_PSSI_MAP_DE_BIDIR_ENABLE (0x7U << PSSI_CR_DERDYCFG_Pos) /*!< Bi-directional on DE pin */
  180. /**
  181. * @}
  182. */
  183. /** @defgroup Data_Enable_Polarity Data Enable Polarity
  184. * @{
  185. */
  186. #define HAL_PSSI_DEPOL_ACTIVE_LOW 0x0U /*!< Active Low */
  187. #define HAL_PSSI_DEPOL_ACTIVE_HIGH PSSI_CR_DEPOL /*!< Active High */
  188. /**
  189. * @}
  190. */
  191. /** @defgroup Ready_Polarity Ready Polarity
  192. * @{
  193. */
  194. #define HAL_PSSI_RDYPOL_ACTIVE_LOW 0x0U /*!< Active Low */
  195. #define HAL_PSSI_RDYPOL_ACTIVE_HIGH PSSI_CR_RDYPOL /*!< Active High */
  196. /**
  197. * @}
  198. */
  199. /** @defgroup Clock_Polarity Clock Polarity
  200. * @{
  201. */
  202. #define HAL_PSSI_FALLING_EDGE 0x0U /*!< Fallling Edge */
  203. #define HAL_PSSI_RISING_EDGE 0x1U /*!< Rising Edge */
  204. /**
  205. * @}
  206. */
  207. /** @defgroup PSSI_DEFINITION PSSI definitions
  208. * @{
  209. */
  210. #define PSSI_MAX_NBYTE_SIZE 0x10000U /* 64 KB */
  211. #define PSSI_TIMEOUT_TRANSMIT 0x0000FFFFU /*!< Timeout Value */
  212. #define PSSI_CR_OUTEN_INPUT 0x00000000U /*!< Input Mode */
  213. #define PSSI_CR_OUTEN_OUTPUT PSSI_CR_OUTEN /*!< Output Mode */
  214. #define PSSI_CR_DMA_ENABLE PSSI_CR_DMAEN /*!< DMA Mode Enable */
  215. #define PSSI_CR_DMA_DISABLE (~PSSI_CR_DMAEN) /*!< DMA Mode Disable*/
  216. #define PSSI_CR_16BITS PSSI_CR_EDM /*!< 16 Lines Mode */
  217. #define PSSI_CR_8BITS (~PSSI_CR_EDM) /*!< 8 Lines Mode */
  218. #define PSSI_FLAG_RTT1B PSSI_SR_RTT1B /*!< 1 Byte Fifo Flag */
  219. #define PSSI_FLAG_RTT4B PSSI_SR_RTT4B /*!< 4 Bytes Fifo Flag*/
  220. /**
  221. * @}
  222. */
  223. /** @defgroup PSSI_Interrupts PSSI Interrupts
  224. * @{
  225. */
  226. #define PSSI_FLAG_OVR_RIS PSSI_RIS_OVR_RIS /*!< Overrun, Underrun errors flag */
  227. #define PSSI_FLAG_MASK PSSI_RIS_OVR_RIS_Msk /*!< Overrun, Underrun errors Mask */
  228. #define PSSI_FLAG_OVR_MIS PSSI_MIS_OVR_MIS /*!< Overrun, Underrun masked errors flag */
  229. /**
  230. * @}
  231. */
  232. /**
  233. * @}
  234. */
  235. /* Exported macros ------------------------------------------------------------*/
  236. /** @defgroup PSSI_Exported_Macros PSSI Exported Macros
  237. * @{
  238. */
  239. /** @brief Reset PSSI handle state
  240. * @param __HANDLE__ specifies the PSSI handle.
  241. * @retval None
  242. */
  243. #if (USE_HAL_PSSI_REGISTER_CALLBACKS == 1)
  244. #define HAL_PSSI_RESET_HANDLE_STATE(__HANDLE__) do{ \
  245. (__HANDLE__)->State = HAL_PSSI_STATE_RESET;\
  246. (__HANDLE__)->MspInitCallback = NULL; \
  247. (__HANDLE__)->MspDeInitCallback = NULL; \
  248. }while(0)
  249. #else
  250. #define HAL_PSSI_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_PSSI_STATE_RESET)
  251. #endif /* USE_HAL_PSSI_REGISTER_CALLBACKS */
  252. /**
  253. * @brief Enable the PSSI.
  254. * @param __HANDLE__ PSSI handle
  255. * @retval None.
  256. */
  257. #define HAL_PSSI_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= PSSI_CR_ENABLE)
  258. /**
  259. * @brief Disable the PSSI.
  260. * @param __HANDLE__ PSSI handle
  261. * @retval None.
  262. */
  263. #define HAL_PSSI_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= (~PSSI_CR_ENABLE))
  264. /* PSSI pripheral STATUS */
  265. /**
  266. * @brief Get the PSSI pending flags.
  267. * @param __HANDLE__ PSSI handle
  268. * @param __FLAG__ flag to check.
  269. * This parameter can be any combination of the following values:
  270. * @arg PSSI_FLAG_RTT1B: FIFO is ready to transfer one byte
  271. * @arg PSSI_FLAG_RTT4B: FIFO is ready to transfer four bytes
  272. * @retval The state of FLAG.
  273. */
  274. #define HAL_PSSI_GET_STATUS(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR & (__FLAG__))
  275. /* Interrupt & Flag management */
  276. /**
  277. * @brief Get the PSSI pending flags.
  278. * @param __HANDLE__ PSSI handle
  279. * @param __FLAG__ flag to check.
  280. * This parameter can be any combination of the following values:
  281. * @arg PSSI_FLAG_OVR_RIS: Data Buffer overrun/underrun error flag
  282. * @retval The state of FLAG.
  283. */
  284. #define HAL_PSSI_GET_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->RIS & (__FLAG__))
  285. /**
  286. * @brief Clear the PSSI pending flags.
  287. * @param __HANDLE__ PSSI handle
  288. * @param __FLAG__ specifies the flag to clear.
  289. * This parameter can be any combination of the following values:
  290. * @arg PSSI_FLAG_OVR_RIS: Data Buffer overrun/underrun error flag
  291. * @retval None
  292. */
  293. #define HAL_PSSI_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ICR = (__FLAG__))
  294. /**
  295. * @brief Enable the specified PSSI interrupts.
  296. * @param __HANDLE__ PSSI handle
  297. * @param __INTERRUPT__ specifies the PSSI interrupt sources to be enabled.
  298. * This parameter can be any combination of the following values:
  299. * @arg PSSI_FLAG_OVR_RIS: Configuration error mask
  300. * @retval None
  301. */
  302. #define HAL_PSSI_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER |= (__INTERRUPT__))
  303. /**
  304. * @brief Disable the specified PSSI interrupts.
  305. * @param __HANDLE__ PSSI handle
  306. * @param __INTERRUPT__ specifies the PSSI interrupt sources to be disabled.
  307. * This parameter can be any combination of the following values:
  308. * @arg PSSI_IT_OVR_IE: Configuration error mask
  309. * @retval None
  310. */
  311. #define HAL_PSSI_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER &= ~(__INTERRUPT__))
  312. /**
  313. * @brief Check whether the specified PSSI interrupt source is enabled or not.
  314. * @param __HANDLE__ PSSI handle
  315. * @param __INTERRUPT__ specifies the PSSI interrupt source to check.
  316. * This parameter can be one of the following values:
  317. * @arg PSSI_IT_OVR_IE: Data Buffer overrun/underrun error interrupt mask
  318. * @retval The state of INTERRUPT source.
  319. */
  320. #define HAL_PSSI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER & (__INTERRUPT__))
  321. /**
  322. * @brief Check whether the PSSI Control signal is valid.
  323. * @param __CONTROL__ Control signals configuration
  324. * @retval Valid or not.
  325. */
  326. #define IS_PSSI_CONTROL_SIGNAL(__CONTROL__) (((__CONTROL__) == HAL_PSSI_DE_RDY_DISABLE ) || \
  327. ((__CONTROL__) == HAL_PSSI_RDY_ENABLE ) || \
  328. ((__CONTROL__) == HAL_PSSI_DE_ENABLE ) || \
  329. ((__CONTROL__) == HAL_PSSI_DE_RDY_ALT_ENABLE ) || \
  330. ((__CONTROL__) == HAL_PSSI_MAP_RDY_BIDIR_ENABLE ) || \
  331. ((__CONTROL__) == HAL_PSSI_RDY_MAP_ENABLE ) || \
  332. ((__CONTROL__) == HAL_PSSI_DE_MAP_ENABLE ) || \
  333. ((__CONTROL__) == HAL_PSSI_MAP_DE_BIDIR_ENABLE ))
  334. /**
  335. * @brief Check whether the PSSI Bus Width is valid.
  336. * @param __BUSWIDTH__ PSSI Bush width
  337. * @retval Valid or not.
  338. */
  339. #define IS_PSSI_BUSWIDTH(__BUSWIDTH__) (((__BUSWIDTH__) == HAL_PSSI_8LINES ) || \
  340. ((__BUSWIDTH__) == HAL_PSSI_16LINES ))
  341. /**
  342. * @brief Check whether the PSSI Clock Polarity is valid.
  343. * @param __CLOCKPOL__ PSSI Clock Polarity
  344. * @retval Valid or not.
  345. */
  346. #define IS_PSSI_CLOCK_POLARITY(__CLOCKPOL__) (((__CLOCKPOL__) == HAL_PSSI_FALLING_EDGE ) || \
  347. ((__CLOCKPOL__) == HAL_PSSI_RISING_EDGE ))
  348. /**
  349. * @brief Check whether the PSSI Data Enable Polarity is valid.
  350. * @param __DEPOL__ PSSI DE Polarity
  351. * @retval Valid or not.
  352. */
  353. #define IS_PSSI_DE_POLARITY(__DEPOL__) (((__DEPOL__) == HAL_PSSI_DEPOL_ACTIVE_LOW ) || \
  354. ((__DEPOL__) == HAL_PSSI_DEPOL_ACTIVE_HIGH ))
  355. /**
  356. * @brief Check whether the PSSI Ready Polarity is valid.
  357. * @param __RDYPOL__ PSSI RDY Polarity
  358. * @retval Valid or not.
  359. */
  360. #define IS_PSSI_RDY_POLARITY(__RDYPOL__) (((__RDYPOL__) == HAL_PSSI_RDYPOL_ACTIVE_LOW ) || \
  361. ((__RDYPOL__) == HAL_PSSI_RDYPOL_ACTIVE_HIGH ))
  362. /**
  363. * @}
  364. */
  365. /* Exported functions --------------------------------------------------------*/
  366. /** @addtogroup PSSI_Exported_Functions PSSI Exported Functions
  367. * @{
  368. */
  369. /** @addtogroup PSSI_Exported_Functions_Group1 Initialization and de-initialization functions
  370. * @{
  371. */
  372. /* Initialization and de-initialization functions *******************************/
  373. HAL_StatusTypeDef HAL_PSSI_Init(PSSI_HandleTypeDef *hpssi);
  374. HAL_StatusTypeDef HAL_PSSI_DeInit(PSSI_HandleTypeDef *hpssi);
  375. void HAL_PSSI_MspInit(PSSI_HandleTypeDef *hpssi);
  376. void HAL_PSSI_MspDeInit(PSSI_HandleTypeDef *hpssi);
  377. /* Callbacks Register/UnRegister functions ***********************************/
  378. #if (USE_HAL_PSSI_REGISTER_CALLBACKS == 1)
  379. HAL_StatusTypeDef HAL_PSSI_RegisterCallback(PSSI_HandleTypeDef *hpssi, HAL_PSSI_CallbackIDTypeDef CallbackID,
  380. pPSSI_CallbackTypeDef pCallback);
  381. HAL_StatusTypeDef HAL_PSSI_UnRegisterCallback(PSSI_HandleTypeDef *hpssi, HAL_PSSI_CallbackIDTypeDef CallbackID);
  382. #endif /* USE_HAL_PSSI_REGISTER_CALLBACKS */
  383. /**
  384. * @}
  385. */
  386. /** @addtogroup PSSI_Exported_Functions_Group2 Input and Output operation functions
  387. * @{
  388. */
  389. /* IO operation functions *******************************************************/
  390. HAL_StatusTypeDef HAL_PSSI_Transmit(PSSI_HandleTypeDef *hpssi, uint8_t *pData, uint32_t Size, uint32_t Timeout);
  391. HAL_StatusTypeDef HAL_PSSI_Receive(PSSI_HandleTypeDef *hpssi, uint8_t *pData, uint32_t Size, uint32_t Timeout);
  392. #if defined(HAL_DMA_MODULE_ENABLED)
  393. HAL_StatusTypeDef HAL_PSSI_Transmit_DMA(PSSI_HandleTypeDef *hpssi, uint32_t *pData, uint32_t Size);
  394. HAL_StatusTypeDef HAL_PSSI_Receive_DMA(PSSI_HandleTypeDef *hpssi, uint32_t *pData, uint32_t Size);
  395. HAL_StatusTypeDef HAL_PSSI_Abort_DMA(PSSI_HandleTypeDef *hpssi);
  396. #endif /*HAL_DMA_MODULE_ENABLED*/
  397. /**
  398. * @}
  399. */
  400. /** @addtogroup PSSI_Exported_Functions_Group3 Peripheral State and Error functions
  401. * @{
  402. */
  403. /* Peripheral State functions ***************************************************/
  404. HAL_PSSI_StateTypeDef HAL_PSSI_GetState(const PSSI_HandleTypeDef *hpssi);
  405. uint32_t HAL_PSSI_GetError(const PSSI_HandleTypeDef *hpssi);
  406. /**
  407. * @}
  408. */
  409. /** @addtogroup PSSI_IRQ_Handler_and_Callbacks IRQ Handler and Callbacks
  410. * @{
  411. */
  412. void HAL_PSSI_IRQHandler(PSSI_HandleTypeDef *hpssi);
  413. void HAL_PSSI_TxCpltCallback(PSSI_HandleTypeDef *hpssi);
  414. void HAL_PSSI_RxCpltCallback(PSSI_HandleTypeDef *hpssi);
  415. void HAL_PSSI_ErrorCallback(PSSI_HandleTypeDef *hpssi);
  416. void HAL_PSSI_AbortCpltCallback(PSSI_HandleTypeDef *hpssi);
  417. /**
  418. * @}
  419. */
  420. /**
  421. * @}
  422. */
  423. /* Private constants ---------------------------------------------------------*/
  424. /* Private macros ------------------------------------------------------------*/
  425. /**
  426. * @}
  427. */
  428. #endif /* PSSI */
  429. /**
  430. * @}
  431. */
  432. #ifdef __cplusplus
  433. }
  434. #endif
  435. #endif /* STM32L4xx_HAL_PSSI_H */