20#ifndef STM32H7xx_HAL_PSSI_H
21#define STM32H7xx_HAL_PSSI_H
53 uint32_t ControlSignal;
54 uint32_t ClockPolarity;
55 uint32_t DataEnablePolarity;
56 uint32_t ReadyPolarity;
66 HAL_PSSI_STATE_RESET = 0x00U,
67 HAL_PSSI_STATE_READY = 0x01U,
68 HAL_PSSI_STATE_BUSY = 0x02U,
69 HAL_PSSI_STATE_BUSY_TX = 0x03U,
70 HAL_PSSI_STATE_BUSY_RX = 0x04U,
71 HAL_PSSI_STATE_TIMEOUT = 0x05U,
72 HAL_PSSI_STATE_ERROR = 0x06U,
73 HAL_PSSI_STATE_ABORT = 0x07U,
75} HAL_PSSI_StateTypeDef;
80typedef struct __PSSI_HandleTypeDef
83 PSSI_InitTypeDef Init;
90 void (* TxCpltCallback)(
struct __PSSI_HandleTypeDef *hpssi);
91 void (* RxCpltCallback)(
struct __PSSI_HandleTypeDef *hpssi);
92 void (* ErrorCallback)(
struct __PSSI_HandleTypeDef *hpssi);
93 void (* AbortCpltCallback)(
struct __PSSI_HandleTypeDef *hpssi);
95 void (* MspInitCallback)(
struct __PSSI_HandleTypeDef *hpssi);
96 void (* MspDeInitCallback)(
struct __PSSI_HandleTypeDef *hpssi);
99 __IO HAL_PSSI_StateTypeDef State;
100 __IO uint32_t ErrorCode;
108typedef void (*pPSSI_CallbackTypeDef)(PSSI_HandleTypeDef *hpssi);
115 HAL_PSSI_TX_COMPLETE_CB_ID = 0x00U,
116 HAL_PSSI_RX_COMPLETE_CB_ID = 0x01U,
117 HAL_PSSI_ERROR_CB_ID = 0x03U,
118 HAL_PSSI_ABORT_CB_ID = 0x04U,
120 HAL_PSSI_MSPINIT_CB_ID = 0x05U,
121 HAL_PSSI_MSPDEINIT_CB_ID = 0x06U
123} HAL_PSSI_CallbackIDTypeDef;
140#define HAL_PSSI_ERROR_NONE 0x00000000U
141#define HAL_PSSI_ERROR_NOT_SUPPORTED 0x00000001U
142#define HAL_PSSI_ERROR_UNDER_RUN 0x00000002U
143#define HAL_PSSI_ERROR_OVER_RUN 0x00000004U
144#define HAL_PSSI_ERROR_DMA 0x00000008U
145#define HAL_PSSI_ERROR_TIMEOUT 0x00000010U
146#define HAL_PSSI_ERROR_INVALID_CALLBACK 0x00000020U
158#define HAL_PSSI_8BITS 0x00000000U
159#define HAL_PSSI_16BITS 0x00000001U
160#define HAL_PSSI_32BITS 0x00000002U
170#define HAL_PSSI_8LINES 0x00000000U
171#define HAL_PSSI_16LINES PSSI_CR_EDM
179#define HAL_PSSI_UNIDIRECTIONAL 0x00000000U
180#define HAL_PSSI_BIDIRECTIONAL 0x00000001U
189#define HAL_PSSI_DE_RDY_DISABLE (0x0U << PSSI_CR_DERDYCFG_Pos)
190#define HAL_PSSI_RDY_ENABLE (0x1U << PSSI_CR_DERDYCFG_Pos)
191#define HAL_PSSI_DE_ENABLE (0x2U << PSSI_CR_DERDYCFG_Pos)
192#define HAL_PSSI_DE_RDY_ALT_ENABLE (0x3U << PSSI_CR_DERDYCFG_Pos)
193#define HAL_PSSI_MAP_RDY_BIDIR_ENABLE (0x4U << PSSI_CR_DERDYCFG_Pos)
194#define HAL_PSSI_RDY_MAP_ENABLE (0x5U << PSSI_CR_DERDYCFG_Pos)
195#define HAL_PSSI_DE_MAP_ENABLE (0x6U << PSSI_CR_DERDYCFG_Pos)
196#define HAL_PSSI_MAP_DE_BIDIR_ENABLE (0x7U << PSSI_CR_DERDYCFG_Pos)
207#define HAL_PSSI_DEPOL_ACTIVE_LOW 0x0U
208#define HAL_PSSI_DEPOL_ACTIVE_HIGH PSSI_CR_DEPOL
216#define HAL_PSSI_RDYPOL_ACTIVE_LOW 0x0U
217#define HAL_PSSI_RDYPOL_ACTIVE_HIGH PSSI_CR_RDYPOL
226#define HAL_PSSI_FALLING_EDGE 0x0U
227#define HAL_PSSI_RISING_EDGE 0x1U
240#define PSSI_MAX_NBYTE_SIZE 0x10000U
241#define PSSI_TIMEOUT_TRANSMIT 0x0000FFFFU
243#define PSSI_CR_OUTEN_INPUT 0x00000000U
244#define PSSI_CR_OUTEN_OUTPUT PSSI_CR_OUTEN
246#define PSSI_CR_DMA_ENABLE PSSI_CR_DMAEN
247#define PSSI_CR_DMA_DISABLE (~PSSI_CR_DMAEN)
249#define PSSI_CR_16BITS PSSI_CR_EDM
250#define PSSI_CR_8BITS (~PSSI_CR_EDM)
252#define PSSI_FLAG_RTT1B PSSI_SR_RTT1B
253#define PSSI_FLAG_RTT4B PSSI_SR_RTT4B
266#define PSSI_FLAG_OVR_RIS PSSI_RIS_OVR_RIS
267#define PSSI_FLAG_MASK PSSI_RIS_OVR_RIS_Msk
268#define PSSI_FLAG_OVR_MIS PSSI_MIS_OVR_MIS
289#define HAL_PSSI_RESET_HANDLE_STATE(__HANDLE__) do{ \
290 (__HANDLE__)->State = HAL_PSSI_STATE_RESET;\
291 (__HANDLE__)->MspInitCallback = NULL; \
292 (__HANDLE__)->MspDeInitCallback = NULL; \
301#define HAL_PSSI_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= PSSI_CR_ENABLE)
307#define HAL_PSSI_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= (~PSSI_CR_ENABLE))
320#define HAL_PSSI_GET_STATUS(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR & (__FLAG__))
333#define HAL_PSSI_GET_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->RIS & (__FLAG__))
343#define HAL_PSSI_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ICR = (__FLAG__))
353#define HAL_PSSI_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER |= (__INTERRUPT__))
363#define HAL_PSSI_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER &= ~(__INTERRUPT__))
373#define HAL_PSSI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER & (__INTERRUPT__))
382#define IS_PSSI_CONTROL_SIGNAL(__CONTROL__) (((__CONTROL__) == HAL_PSSI_DE_RDY_DISABLE ) || \
383 ((__CONTROL__) == HAL_PSSI_RDY_ENABLE ) || \
384 ((__CONTROL__) == HAL_PSSI_DE_ENABLE ) || \
385 ((__CONTROL__) == HAL_PSSI_DE_RDY_ALT_ENABLE ) || \
386 ((__CONTROL__) == HAL_PSSI_MAP_RDY_BIDIR_ENABLE ) || \
387 ((__CONTROL__) == HAL_PSSI_RDY_MAP_ENABLE ) || \
388 ((__CONTROL__) == HAL_PSSI_DE_MAP_ENABLE ) || \
389 ((__CONTROL__) == HAL_PSSI_MAP_DE_BIDIR_ENABLE ))
399#define IS_PSSI_BUSWIDTH(__BUSWIDTH__) (((__BUSWIDTH__) == HAL_PSSI_8LINES ) || \
400 ((__BUSWIDTH__) == HAL_PSSI_16LINES ))
409#define IS_PSSI_CLOCK_POLARITY(__CLOCKPOL__) (((__CLOCKPOL__) == HAL_PSSI_FALLING_EDGE ) || \
410 ((__CLOCKPOL__) == HAL_PSSI_RISING_EDGE ))
419#define IS_PSSI_DE_POLARITY(__DEPOL__) (((__DEPOL__) == HAL_PSSI_DEPOL_ACTIVE_LOW ) || \
420 ((__DEPOL__) == HAL_PSSI_DEPOL_ACTIVE_HIGH ))
428#define IS_PSSI_RDY_POLARITY(__RDYPOL__) (((__RDYPOL__) == HAL_PSSI_RDYPOL_ACTIVE_LOW ) || \
429 ((__RDYPOL__) == HAL_PSSI_RDYPOL_ACTIVE_HIGH ))
447void HAL_PSSI_MspInit(PSSI_HandleTypeDef *hpssi);
448void HAL_PSSI_MspDeInit(PSSI_HandleTypeDef *hpssi);
451HAL_StatusTypeDef HAL_PSSI_RegisterCallback(PSSI_HandleTypeDef *hpssi, HAL_PSSI_CallbackIDTypeDef CallbackID,
452 pPSSI_CallbackTypeDef pCallback);
453HAL_StatusTypeDef HAL_PSSI_UnRegisterCallback(PSSI_HandleTypeDef *hpssi, HAL_PSSI_CallbackIDTypeDef CallbackID);
466HAL_StatusTypeDef HAL_PSSI_Transmit(PSSI_HandleTypeDef *hpssi, uint8_t *pData, uint32_t Size, uint32_t Timeout);
467HAL_StatusTypeDef HAL_PSSI_Receive(PSSI_HandleTypeDef *hpssi, uint8_t *pData, uint32_t Size, uint32_t Timeout);
468HAL_StatusTypeDef HAL_PSSI_Transmit_DMA(PSSI_HandleTypeDef *hpssi, uint32_t *pData, uint32_t Size);
469HAL_StatusTypeDef HAL_PSSI_Receive_DMA(PSSI_HandleTypeDef *hpssi, uint32_t *pData, uint32_t Size);
481HAL_PSSI_StateTypeDef HAL_PSSI_GetState(PSSI_HandleTypeDef *hpssi);
482uint32_t HAL_PSSI_GetError(PSSI_HandleTypeDef *hpssi);
492void HAL_PSSI_IRQHandler(PSSI_HandleTypeDef *hpssi);
493void HAL_PSSI_TxCpltCallback(PSSI_HandleTypeDef *hpssi);
494void HAL_PSSI_RxCpltCallback(PSSI_HandleTypeDef *hpssi);
495void HAL_PSSI_ErrorCallback(PSSI_HandleTypeDef *hpssi);
496void HAL_PSSI_AbortCpltCallback(PSSI_HandleTypeDef *hpssi);
#define __IO
Definition: core_cm4.h:239
This file contains HAL common defines, enumeration, macros and structures definitions.
HAL_StatusTypeDef
HAL Status structures definition.
Definition: stm32h7xx_hal_def.h:47
HAL_LockTypeDef
HAL Lock structures definition.
Definition: stm32h7xx_hal_def.h:58
PSSI.
Definition: stm32h723xx.h:580
DMA handle Structure definition.
Definition: stm32h7xx_hal_dma.h:138