20#ifndef STM32H7xx_LL_SPI_H
21#define STM32H7xx_LL_SPI_H
34#if defined(SPI1) || defined(SPI2) || defined(SPI3) || defined(SPI4) || defined(SPI5) || defined(SPI6)
55#if defined(USE_FULL_LL_DRIVER) || defined(__rtems__)
66 uint32_t TransferDirection;
84 uint32_t ClockPolarity;
119 uint32_t CRCCalculation;
152#define LL_SPI_SR_RXP (SPI_SR_RXP)
153#define LL_SPI_SR_TXP (SPI_SR_TXP)
154#define LL_SPI_SR_DXP (SPI_SR_DXP)
155#define LL_SPI_SR_EOT (SPI_SR_EOT)
156#define LL_SPI_SR_TXTF (SPI_SR_TXTF)
157#define LL_SPI_SR_UDR (SPI_SR_UDR)
158#define LL_SPI_SR_CRCE (SPI_SR_CRCE)
159#define LL_SPI_SR_MODF (SPI_SR_MODF)
160#define LL_SPI_SR_OVR (SPI_SR_OVR)
161#define LL_SPI_SR_TIFRE (SPI_SR_TIFRE)
162#define LL_SPI_SR_TSERF (SPI_SR_TSERF)
163#define LL_SPI_SR_SUSP (SPI_SR_SUSP)
164#define LL_SPI_SR_TXC (SPI_SR_TXC)
165#define LL_SPI_SR_RXWNE (SPI_SR_RXWNE)
175#define LL_SPI_IER_RXPIE (SPI_IER_RXPIE)
176#define LL_SPI_IER_TXPIE (SPI_IER_TXPIE)
177#define LL_SPI_IER_DXPIE (SPI_IER_DXPIE)
178#define LL_SPI_IER_EOTIE (SPI_IER_EOTIE)
179#define LL_SPI_IER_TXTFIE (SPI_IER_TXTFIE)
180#define LL_SPI_IER_UDRIE (SPI_IER_UDRIE)
181#define LL_SPI_IER_OVRIE (SPI_IER_OVRIE)
182#define LL_SPI_IER_CRCEIE (SPI_IER_CRCEIE)
183#define LL_SPI_IER_TIFREIE (SPI_IER_TIFREIE)
184#define LL_SPI_IER_MODFIE (SPI_IER_MODFIE)
185#define LL_SPI_IER_TSERFIE (SPI_IER_TSERFIE)
194#define LL_SPI_MODE_MASTER (SPI_CFG2_MASTER)
195#define LL_SPI_MODE_SLAVE (0x00000000UL)
204#define LL_SPI_SS_LEVEL_HIGH (SPI_CR1_SSI)
205#define LL_SPI_SS_LEVEL_LOW (0x00000000UL)
214#define LL_SPI_SS_IDLENESS_00CYCLE (0x00000000UL)
215#define LL_SPI_SS_IDLENESS_01CYCLE (SPI_CFG2_MSSI_0)
216#define LL_SPI_SS_IDLENESS_02CYCLE (SPI_CFG2_MSSI_1)
217#define LL_SPI_SS_IDLENESS_03CYCLE (SPI_CFG2_MSSI_0 | SPI_CFG2_MSSI_1)
218#define LL_SPI_SS_IDLENESS_04CYCLE (SPI_CFG2_MSSI_2)
219#define LL_SPI_SS_IDLENESS_05CYCLE (SPI_CFG2_MSSI_2 | SPI_CFG2_MSSI_0)
220#define LL_SPI_SS_IDLENESS_06CYCLE (SPI_CFG2_MSSI_2 | SPI_CFG2_MSSI_1)
221#define LL_SPI_SS_IDLENESS_07CYCLE (SPI_CFG2_MSSI_2 | SPI_CFG2_MSSI_1 | SPI_CFG2_MSSI_0)
222#define LL_SPI_SS_IDLENESS_08CYCLE (SPI_CFG2_MSSI_3)
223#define LL_SPI_SS_IDLENESS_09CYCLE (SPI_CFG2_MSSI_3 | SPI_CFG2_MSSI_0)
224#define LL_SPI_SS_IDLENESS_10CYCLE (SPI_CFG2_MSSI_3 | SPI_CFG2_MSSI_1)
225#define LL_SPI_SS_IDLENESS_11CYCLE (SPI_CFG2_MSSI_3 | SPI_CFG2_MSSI_1 | SPI_CFG2_MSSI_0)
226#define LL_SPI_SS_IDLENESS_12CYCLE (SPI_CFG2_MSSI_3 | SPI_CFG2_MSSI_2)
227#define LL_SPI_SS_IDLENESS_13CYCLE (SPI_CFG2_MSSI_3 | SPI_CFG2_MSSI_2 | SPI_CFG2_MSSI_0)
228#define LL_SPI_SS_IDLENESS_14CYCLE (SPI_CFG2_MSSI_3 | SPI_CFG2_MSSI_2 | SPI_CFG2_MSSI_1)
229#define LL_SPI_SS_IDLENESS_15CYCLE (SPI_CFG2_MSSI_3\
230 | SPI_CFG2_MSSI_2 | SPI_CFG2_MSSI_1 | SPI_CFG2_MSSI_0)
239#define LL_SPI_ID_IDLENESS_00CYCLE (0x00000000UL)
240#define LL_SPI_ID_IDLENESS_01CYCLE (SPI_CFG2_MIDI_0)
241#define LL_SPI_ID_IDLENESS_02CYCLE (SPI_CFG2_MIDI_1)
242#define LL_SPI_ID_IDLENESS_03CYCLE (SPI_CFG2_MIDI_0 | SPI_CFG2_MIDI_1)
243#define LL_SPI_ID_IDLENESS_04CYCLE (SPI_CFG2_MIDI_2)
244#define LL_SPI_ID_IDLENESS_05CYCLE (SPI_CFG2_MIDI_2 | SPI_CFG2_MIDI_0)
245#define LL_SPI_ID_IDLENESS_06CYCLE (SPI_CFG2_MIDI_2 | SPI_CFG2_MIDI_1)
246#define LL_SPI_ID_IDLENESS_07CYCLE (SPI_CFG2_MIDI_2 | SPI_CFG2_MIDI_1 | SPI_CFG2_MIDI_0)
247#define LL_SPI_ID_IDLENESS_08CYCLE (SPI_CFG2_MIDI_3)
248#define LL_SPI_ID_IDLENESS_09CYCLE (SPI_CFG2_MIDI_3 | SPI_CFG2_MIDI_0)
249#define LL_SPI_ID_IDLENESS_10CYCLE (SPI_CFG2_MIDI_3 | SPI_CFG2_MIDI_1)
250#define LL_SPI_ID_IDLENESS_11CYCLE (SPI_CFG2_MIDI_3 | SPI_CFG2_MIDI_1 | SPI_CFG2_MIDI_0)
251#define LL_SPI_ID_IDLENESS_12CYCLE (SPI_CFG2_MIDI_3 | SPI_CFG2_MIDI_2)
252#define LL_SPI_ID_IDLENESS_13CYCLE (SPI_CFG2_MIDI_3 | SPI_CFG2_MIDI_2 | SPI_CFG2_MIDI_0)
253#define LL_SPI_ID_IDLENESS_14CYCLE (SPI_CFG2_MIDI_3 | SPI_CFG2_MIDI_2 | SPI_CFG2_MIDI_1)
254#define LL_SPI_ID_IDLENESS_15CYCLE (SPI_CFG2_MIDI_3\
255 | SPI_CFG2_MIDI_2 | SPI_CFG2_MIDI_1 | SPI_CFG2_MIDI_0)
264#define LL_SPI_TXCRCINIT_ALL_ZERO_PATTERN (0x00000000UL)
265#define LL_SPI_TXCRCINIT_ALL_ONES_PATTERN (SPI_CR1_TCRCINI)
274#define LL_SPI_RXCRCINIT_ALL_ZERO_PATTERN (0x00000000UL)
275#define LL_SPI_RXCRCINIT_ALL_ONES_PATTERN (SPI_CR1_RCRCINI)
284#define LL_SPI_UDR_CONFIG_REGISTER_PATTERN (0x00000000UL)
285#define LL_SPI_UDR_CONFIG_LAST_RECEIVED (SPI_CFG1_UDRCFG_0)
286#define LL_SPI_UDR_CONFIG_LAST_TRANSMITTED (SPI_CFG1_UDRCFG_1)
295#define LL_SPI_UDR_DETECT_BEGIN_DATA_FRAME (0x00000000UL)
296#define LL_SPI_UDR_DETECT_END_DATA_FRAME (SPI_CFG1_UDRDET_0)
297#define LL_SPI_UDR_DETECT_BEGIN_ACTIVE_NSS (SPI_CFG1_UDRDET_1)
306#define LL_SPI_PROTOCOL_MOTOROLA (0x00000000UL)
307#define LL_SPI_PROTOCOL_TI (SPI_CFG2_SP_0)
316#define LL_SPI_PHASE_1EDGE (0x00000000UL)
317#define LL_SPI_PHASE_2EDGE (SPI_CFG2_CPHA)
326#define LL_SPI_POLARITY_LOW (0x00000000UL)
327#define LL_SPI_POLARITY_HIGH (SPI_CFG2_CPOL)
336#define LL_SPI_NSS_POLARITY_LOW (0x00000000UL)
337#define LL_SPI_NSS_POLARITY_HIGH (SPI_CFG2_SSIOP)
346#define LL_SPI_BAUDRATEPRESCALER_DIV2 (0x00000000UL)
347#define LL_SPI_BAUDRATEPRESCALER_DIV4 (SPI_CFG1_MBR_0)
348#define LL_SPI_BAUDRATEPRESCALER_DIV8 (SPI_CFG1_MBR_1)
349#define LL_SPI_BAUDRATEPRESCALER_DIV16 (SPI_CFG1_MBR_1 | SPI_CFG1_MBR_0)
350#define LL_SPI_BAUDRATEPRESCALER_DIV32 (SPI_CFG1_MBR_2)
351#define LL_SPI_BAUDRATEPRESCALER_DIV64 (SPI_CFG1_MBR_2 | SPI_CFG1_MBR_0)
352#define LL_SPI_BAUDRATEPRESCALER_DIV128 (SPI_CFG1_MBR_2 | SPI_CFG1_MBR_1)
353#define LL_SPI_BAUDRATEPRESCALER_DIV256 (SPI_CFG1_MBR_2 | SPI_CFG1_MBR_1 | SPI_CFG1_MBR_0)
362#define LL_SPI_LSB_FIRST (SPI_CFG2_LSBFRST)
363#define LL_SPI_MSB_FIRST (0x00000000UL)
372#define LL_SPI_FULL_DUPLEX (0x00000000UL)
373#define LL_SPI_SIMPLEX_TX (SPI_CFG2_COMM_0)
374#define LL_SPI_SIMPLEX_RX (SPI_CFG2_COMM_1)
375#define LL_SPI_HALF_DUPLEX_RX (SPI_CFG2_COMM_0|SPI_CFG2_COMM_1)
376#define LL_SPI_HALF_DUPLEX_TX (SPI_CFG2_COMM_0|SPI_CFG2_COMM_1|SPI_CR1_HDDIR)
385#define LL_SPI_DATAWIDTH_4BIT (SPI_CFG1_DSIZE_0 | SPI_CFG1_DSIZE_1)
386#define LL_SPI_DATAWIDTH_5BIT (SPI_CFG1_DSIZE_2)
387#define LL_SPI_DATAWIDTH_6BIT (SPI_CFG1_DSIZE_2 | SPI_CFG1_DSIZE_0)
388#define LL_SPI_DATAWIDTH_7BIT (SPI_CFG1_DSIZE_2 | SPI_CFG1_DSIZE_1)
389#define LL_SPI_DATAWIDTH_8BIT (SPI_CFG1_DSIZE_2 | SPI_CFG1_DSIZE_1 | SPI_CFG1_DSIZE_0)
390#define LL_SPI_DATAWIDTH_9BIT (SPI_CFG1_DSIZE_3)
391#define LL_SPI_DATAWIDTH_10BIT (SPI_CFG1_DSIZE_3 | SPI_CFG1_DSIZE_0)
392#define LL_SPI_DATAWIDTH_11BIT (SPI_CFG1_DSIZE_3 | SPI_CFG1_DSIZE_1)
393#define LL_SPI_DATAWIDTH_12BIT (SPI_CFG1_DSIZE_3 | SPI_CFG1_DSIZE_1 | SPI_CFG1_DSIZE_0)
394#define LL_SPI_DATAWIDTH_13BIT (SPI_CFG1_DSIZE_3 | SPI_CFG1_DSIZE_2)
395#define LL_SPI_DATAWIDTH_14BIT (SPI_CFG1_DSIZE_3 | SPI_CFG1_DSIZE_2 | SPI_CFG1_DSIZE_0)
396#define LL_SPI_DATAWIDTH_15BIT (SPI_CFG1_DSIZE_3 | SPI_CFG1_DSIZE_2 | SPI_CFG1_DSIZE_1)
397#define LL_SPI_DATAWIDTH_16BIT (SPI_CFG1_DSIZE_3\
398 | SPI_CFG1_DSIZE_2 | SPI_CFG1_DSIZE_1 | SPI_CFG1_DSIZE_0)
399#define LL_SPI_DATAWIDTH_17BIT (SPI_CFG1_DSIZE_4)
400#define LL_SPI_DATAWIDTH_18BIT (SPI_CFG1_DSIZE_4 | SPI_CFG1_DSIZE_0)
401#define LL_SPI_DATAWIDTH_19BIT (SPI_CFG1_DSIZE_4 | SPI_CFG1_DSIZE_1)
402#define LL_SPI_DATAWIDTH_20BIT (SPI_CFG1_DSIZE_4 | SPI_CFG1_DSIZE_0 | SPI_CFG1_DSIZE_1)
403#define LL_SPI_DATAWIDTH_21BIT (SPI_CFG1_DSIZE_4 | SPI_CFG1_DSIZE_2)
404#define LL_SPI_DATAWIDTH_22BIT (SPI_CFG1_DSIZE_4 | SPI_CFG1_DSIZE_2 | SPI_CFG1_DSIZE_0)
405#define LL_SPI_DATAWIDTH_23BIT (SPI_CFG1_DSIZE_4 | SPI_CFG1_DSIZE_2 | SPI_CFG1_DSIZE_1)
406#define LL_SPI_DATAWIDTH_24BIT (SPI_CFG1_DSIZE_4\
407 | SPI_CFG1_DSIZE_2 | SPI_CFG1_DSIZE_1 | SPI_CFG1_DSIZE_0)
408#define LL_SPI_DATAWIDTH_25BIT (SPI_CFG1_DSIZE_4 | SPI_CFG1_DSIZE_3)
409#define LL_SPI_DATAWIDTH_26BIT (SPI_CFG1_DSIZE_4 | SPI_CFG1_DSIZE_3 | SPI_CFG1_DSIZE_0)
410#define LL_SPI_DATAWIDTH_27BIT (SPI_CFG1_DSIZE_4 | SPI_CFG1_DSIZE_3 | SPI_CFG1_DSIZE_1)
411#define LL_SPI_DATAWIDTH_28BIT (SPI_CFG1_DSIZE_4\
412 | SPI_CFG1_DSIZE_3 | SPI_CFG1_DSIZE_1 | SPI_CFG1_DSIZE_0)
413#define LL_SPI_DATAWIDTH_29BIT (SPI_CFG1_DSIZE_4 | SPI_CFG1_DSIZE_3 | SPI_CFG1_DSIZE_2)
414#define LL_SPI_DATAWIDTH_30BIT (SPI_CFG1_DSIZE_4\
415 | SPI_CFG1_DSIZE_3 | SPI_CFG1_DSIZE_2 | SPI_CFG1_DSIZE_0)
416#define LL_SPI_DATAWIDTH_31BIT (SPI_CFG1_DSIZE_4\
417 | SPI_CFG1_DSIZE_3 | SPI_CFG1_DSIZE_2 | SPI_CFG1_DSIZE_1)
418#define LL_SPI_DATAWIDTH_32BIT (SPI_CFG1_DSIZE_4 | SPI_CFG1_DSIZE_3\
419 | SPI_CFG1_DSIZE_2 | SPI_CFG1_DSIZE_1 | SPI_CFG1_DSIZE_0)
428#define LL_SPI_FIFO_TH_01DATA (0x00000000UL)
429#define LL_SPI_FIFO_TH_02DATA (SPI_CFG1_FTHLV_0)
430#define LL_SPI_FIFO_TH_03DATA (SPI_CFG1_FTHLV_1)
431#define LL_SPI_FIFO_TH_04DATA (SPI_CFG1_FTHLV_0 | SPI_CFG1_FTHLV_1)
432#define LL_SPI_FIFO_TH_05DATA (SPI_CFG1_FTHLV_2)
433#define LL_SPI_FIFO_TH_06DATA (SPI_CFG1_FTHLV_2 | SPI_CFG1_FTHLV_0)
434#define LL_SPI_FIFO_TH_07DATA (SPI_CFG1_FTHLV_2 | SPI_CFG1_FTHLV_1)
435#define LL_SPI_FIFO_TH_08DATA (SPI_CFG1_FTHLV_2 | SPI_CFG1_FTHLV_1 | SPI_CFG1_FTHLV_0)
436#define LL_SPI_FIFO_TH_09DATA (SPI_CFG1_FTHLV_3)
437#define LL_SPI_FIFO_TH_10DATA (SPI_CFG1_FTHLV_3 | SPI_CFG1_FTHLV_0)
438#define LL_SPI_FIFO_TH_11DATA (SPI_CFG1_FTHLV_3 | SPI_CFG1_FTHLV_1)
439#define LL_SPI_FIFO_TH_12DATA (SPI_CFG1_FTHLV_3 | SPI_CFG1_FTHLV_1 | SPI_CFG1_FTHLV_0)
440#define LL_SPI_FIFO_TH_13DATA (SPI_CFG1_FTHLV_3 | SPI_CFG1_FTHLV_2)
441#define LL_SPI_FIFO_TH_14DATA (SPI_CFG1_FTHLV_3 | SPI_CFG1_FTHLV_2 | SPI_CFG1_FTHLV_0)
442#define LL_SPI_FIFO_TH_15DATA (SPI_CFG1_FTHLV_3 | SPI_CFG1_FTHLV_2 | SPI_CFG1_FTHLV_1)
443#define LL_SPI_FIFO_TH_16DATA (SPI_CFG1_FTHLV_3\
444 | SPI_CFG1_FTHLV_2 | SPI_CFG1_FTHLV_1 | SPI_CFG1_FTHLV_0)
449#if defined(USE_FULL_LL_DRIVER) || defined(__rtems__)
455#define LL_SPI_CRCCALCULATION_DISABLE (0x00000000UL)
456#define LL_SPI_CRCCALCULATION_ENABLE (SPI_CFG1_CRCEN)
466#define LL_SPI_CRC_4BIT (SPI_CFG1_CRCSIZE_0 | SPI_CFG1_CRCSIZE_1)
467#define LL_SPI_CRC_5BIT (SPI_CFG1_CRCSIZE_2)
468#define LL_SPI_CRC_6BIT (SPI_CFG1_CRCSIZE_2 | SPI_CFG1_CRCSIZE_0)
469#define LL_SPI_CRC_7BIT (SPI_CFG1_CRCSIZE_2 | SPI_CFG1_CRCSIZE_1)
470#define LL_SPI_CRC_8BIT (SPI_CFG1_CRCSIZE_2 | SPI_CFG1_CRCSIZE_1 | SPI_CFG1_CRCSIZE_0)
471#define LL_SPI_CRC_9BIT (SPI_CFG1_CRCSIZE_3)
472#define LL_SPI_CRC_10BIT (SPI_CFG1_CRCSIZE_3 | SPI_CFG1_CRCSIZE_0)
473#define LL_SPI_CRC_11BIT (SPI_CFG1_CRCSIZE_3 | SPI_CFG1_CRCSIZE_1)
474#define LL_SPI_CRC_12BIT (SPI_CFG1_CRCSIZE_3 | SPI_CFG1_CRCSIZE_1 | SPI_CFG1_CRCSIZE_0)
475#define LL_SPI_CRC_13BIT (SPI_CFG1_CRCSIZE_3 | SPI_CFG1_CRCSIZE_2)
476#define LL_SPI_CRC_14BIT (SPI_CFG1_CRCSIZE_3 | SPI_CFG1_CRCSIZE_2 | SPI_CFG1_CRCSIZE_0)
477#define LL_SPI_CRC_15BIT (SPI_CFG1_CRCSIZE_3 | SPI_CFG1_CRCSIZE_2 | SPI_CFG1_CRCSIZE_1)
478#define LL_SPI_CRC_16BIT (SPI_CFG1_CRCSIZE_3\
479 | SPI_CFG1_CRCSIZE_2 | SPI_CFG1_CRCSIZE_1 | SPI_CFG1_CRCSIZE_0)
480#define LL_SPI_CRC_17BIT (SPI_CFG1_CRCSIZE_4)
481#define LL_SPI_CRC_18BIT (SPI_CFG1_CRCSIZE_4 | SPI_CFG1_CRCSIZE_0)
482#define LL_SPI_CRC_19BIT (SPI_CFG1_CRCSIZE_4 | SPI_CFG1_CRCSIZE_1)
483#define LL_SPI_CRC_20BIT (SPI_CFG1_CRCSIZE_4 | SPI_CFG1_CRCSIZE_0 | SPI_CFG1_CRCSIZE_1)
484#define LL_SPI_CRC_21BIT (SPI_CFG1_CRCSIZE_4 | SPI_CFG1_CRCSIZE_2)
485#define LL_SPI_CRC_22BIT (SPI_CFG1_CRCSIZE_4 | SPI_CFG1_CRCSIZE_2 | SPI_CFG1_CRCSIZE_0)
486#define LL_SPI_CRC_23BIT (SPI_CFG1_CRCSIZE_4 | SPI_CFG1_CRCSIZE_2 | SPI_CFG1_CRCSIZE_1)
487#define LL_SPI_CRC_24BIT (SPI_CFG1_CRCSIZE_4\
488 | SPI_CFG1_CRCSIZE_2 | SPI_CFG1_CRCSIZE_1 | SPI_CFG1_CRCSIZE_0)
489#define LL_SPI_CRC_25BIT (SPI_CFG1_CRCSIZE_4 | SPI_CFG1_CRCSIZE_3)
490#define LL_SPI_CRC_26BIT (SPI_CFG1_CRCSIZE_4 | SPI_CFG1_CRCSIZE_3 | SPI_CFG1_CRCSIZE_0)
491#define LL_SPI_CRC_27BIT (SPI_CFG1_CRCSIZE_4 | SPI_CFG1_CRCSIZE_3 | SPI_CFG1_CRCSIZE_1)
492#define LL_SPI_CRC_28BIT (SPI_CFG1_CRCSIZE_4\
493 | SPI_CFG1_CRCSIZE_3 | SPI_CFG1_CRCSIZE_1 | SPI_CFG1_CRCSIZE_0)
494#define LL_SPI_CRC_29BIT (SPI_CFG1_CRCSIZE_4 | SPI_CFG1_CRCSIZE_3 | SPI_CFG1_CRCSIZE_2)
495#define LL_SPI_CRC_30BIT (SPI_CFG1_CRCSIZE_4\
496 | SPI_CFG1_CRCSIZE_3 | SPI_CFG1_CRCSIZE_2 | SPI_CFG1_CRCSIZE_0)
497#define LL_SPI_CRC_31BIT (SPI_CFG1_CRCSIZE_4\
498 | SPI_CFG1_CRCSIZE_3 | SPI_CFG1_CRCSIZE_2 | SPI_CFG1_CRCSIZE_1)
499#define LL_SPI_CRC_32BIT (SPI_CFG1_CRCSIZE_4 | SPI_CFG1_CRCSIZE_3\
500 | SPI_CFG1_CRCSIZE_2 | SPI_CFG1_CRCSIZE_1 | SPI_CFG1_CRCSIZE_0)
509#define LL_SPI_NSS_SOFT (SPI_CFG2_SSM)
510#define LL_SPI_NSS_HARD_INPUT (0x00000000UL)
511#define LL_SPI_NSS_HARD_OUTPUT (SPI_CFG2_SSOE)
520#define LL_SPI_RX_FIFO_0PACKET (0x00000000UL)
521#define LL_SPI_RX_FIFO_1PACKET (SPI_SR_RXPLVL_0)
522#define LL_SPI_RX_FIFO_2PACKET (SPI_SR_RXPLVL_1)
523#define LL_SPI_RX_FIFO_3PACKET (SPI_SR_RXPLVL_1 | SPI_SR_RXPLVL_0)
550#define LL_SPI_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
558#define LL_SPI_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
586__STATIC_INLINE
void LL_SPI_Enable(
SPI_TypeDef *SPIx)
598__STATIC_INLINE
void LL_SPI_Disable(
SPI_TypeDef *SPIx)
609__STATIC_INLINE uint32_t LL_SPI_IsEnabled(
SPI_TypeDef *SPIx)
621__STATIC_INLINE
void LL_SPI_EnableIOSwap(
SPI_TypeDef *SPIx)
633__STATIC_INLINE
void LL_SPI_DisableIOSwap(
SPI_TypeDef *SPIx)
644__STATIC_INLINE uint32_t LL_SPI_IsEnabledIOSwap(
SPI_TypeDef *SPIx)
656__STATIC_INLINE
void LL_SPI_EnableGPIOControl(
SPI_TypeDef *SPIx)
668__STATIC_INLINE
void LL_SPI_DisableGPIOControl(
SPI_TypeDef *SPIx)
679__STATIC_INLINE uint32_t LL_SPI_IsEnabledGPIOControl(
SPI_TypeDef *SPIx)
694__STATIC_INLINE
void LL_SPI_SetMode(
SPI_TypeDef *SPIx, uint32_t Mode)
707__STATIC_INLINE uint32_t LL_SPI_GetMode(
SPI_TypeDef *SPIx)
735__STATIC_INLINE
void LL_SPI_SetMasterSSIdleness(
SPI_TypeDef *SPIx, uint32_t MasterSSIdleness)
762__STATIC_INLINE uint32_t LL_SPI_GetMasterSSIdleness(
SPI_TypeDef *SPIx)
790__STATIC_INLINE
void LL_SPI_SetInterDataIdleness(
SPI_TypeDef *SPIx, uint32_t MasterInterDataIdleness)
817__STATIC_INLINE uint32_t LL_SPI_GetInterDataIdleness(
SPI_TypeDef *SPIx)
830__STATIC_INLINE
void LL_SPI_SetTransferSize(
SPI_TypeDef *SPIx, uint32_t Count)
842__STATIC_INLINE uint32_t LL_SPI_GetTransferSize(
SPI_TypeDef *SPIx)
855__STATIC_INLINE
void LL_SPI_SetReloadSize(
SPI_TypeDef *SPIx, uint32_t Count)
867__STATIC_INLINE uint32_t LL_SPI_GetReloadSize(
SPI_TypeDef *SPIx)
869 return (uint32_t)(READ_BIT(SPIx->
CR2,
SPI_CR2_TSER) >> SPI_CR2_TSER_Pos);
880__STATIC_INLINE
void LL_SPI_EnableIOLock(
SPI_TypeDef *SPIx)
891__STATIC_INLINE uint32_t LL_SPI_IsEnabledIOLock(
SPI_TypeDef *SPIx)
905__STATIC_INLINE
void LL_SPI_SetTxCRCInitPattern(
SPI_TypeDef *SPIx, uint32_t TXCRCInitAll)
918__STATIC_INLINE uint32_t LL_SPI_GetTxCRCInitPattern(
SPI_TypeDef *SPIx)
932__STATIC_INLINE
void LL_SPI_SetRxCRCInitPattern(
SPI_TypeDef *SPIx, uint32_t RXCRCInitAll)
945__STATIC_INLINE uint32_t LL_SPI_GetRxCRCInitPattern(
SPI_TypeDef *SPIx)
960__STATIC_INLINE
void LL_SPI_SetInternalSSLevel(
SPI_TypeDef *SPIx, uint32_t SSLevel)
973__STATIC_INLINE uint32_t LL_SPI_GetInternalSSLevel(
SPI_TypeDef *SPIx)
984__STATIC_INLINE
void LL_SPI_EnableFullSizeCRC(
SPI_TypeDef *SPIx)
995__STATIC_INLINE
void LL_SPI_DisableFullSizeCRC(
SPI_TypeDef *SPIx)
1006__STATIC_INLINE uint32_t LL_SPI_IsEnabledFullSizeCRC(
SPI_TypeDef *SPIx)
1017__STATIC_INLINE
void LL_SPI_SuspendMasterTransfer(
SPI_TypeDef *SPIx)
1028__STATIC_INLINE
void LL_SPI_StartMasterTransfer(
SPI_TypeDef *SPIx)
1039__STATIC_INLINE uint32_t LL_SPI_IsActiveMasterTransfer(
SPI_TypeDef *SPIx)
1050__STATIC_INLINE
void LL_SPI_EnableMasterRxAutoSuspend(
SPI_TypeDef *SPIx)
1061__STATIC_INLINE
void LL_SPI_DisableMasterRxAutoSuspend(
SPI_TypeDef *SPIx)
1072__STATIC_INLINE uint32_t LL_SPI_IsEnabledMasterRxAutoSuspend(
SPI_TypeDef *SPIx)
1088__STATIC_INLINE
void LL_SPI_SetUDRConfiguration(
SPI_TypeDef *SPIx, uint32_t UDRConfig)
1102__STATIC_INLINE uint32_t LL_SPI_GetUDRConfiguration(
SPI_TypeDef *SPIx)
1118__STATIC_INLINE
void LL_SPI_SetUDRDetection(
SPI_TypeDef *SPIx, uint32_t UDRDetection)
1132__STATIC_INLINE uint32_t LL_SPI_GetUDRDetection(
SPI_TypeDef *SPIx)
1147__STATIC_INLINE
void LL_SPI_SetStandard(
SPI_TypeDef *SPIx, uint32_t Standard)
1160__STATIC_INLINE uint32_t LL_SPI_GetStandard(
SPI_TypeDef *SPIx)
1176__STATIC_INLINE
void LL_SPI_SetClockPhase(
SPI_TypeDef *SPIx, uint32_t ClockPhase)
1189__STATIC_INLINE uint32_t LL_SPI_GetClockPhase(
SPI_TypeDef *SPIx)
1205__STATIC_INLINE
void LL_SPI_SetClockPolarity(
SPI_TypeDef *SPIx, uint32_t ClockPolarity)
1218__STATIC_INLINE uint32_t LL_SPI_GetClockPolarity(
SPI_TypeDef *SPIx)
1234__STATIC_INLINE
void LL_SPI_SetNSSPolarity(
SPI_TypeDef *SPIx, uint32_t NSSPolarity)
1247__STATIC_INLINE uint32_t LL_SPI_GetNSSPolarity(
SPI_TypeDef *SPIx)
1269__STATIC_INLINE
void LL_SPI_SetBaudRatePrescaler(
SPI_TypeDef *SPIx, uint32_t Baudrate)
1288__STATIC_INLINE uint32_t LL_SPI_GetBaudRatePrescaler(
SPI_TypeDef *SPIx)
1304__STATIC_INLINE
void LL_SPI_SetTransferBitOrder(
SPI_TypeDef *SPIx, uint32_t BitOrder)
1317__STATIC_INLINE uint32_t LL_SPI_GetTransferBitOrder(
SPI_TypeDef *SPIx)
1337__STATIC_INLINE
void LL_SPI_SetTransferDirection(
SPI_TypeDef *SPIx, uint32_t TransferDirection)
1355__STATIC_INLINE uint32_t LL_SPI_GetTransferDirection(
SPI_TypeDef *SPIx)
1359 return (Hddir | Comm);
1372__STATIC_INLINE
void LL_SPI_SetHalfDuplexDirection(
SPI_TypeDef *SPIx, uint32_t HalfDuplexDirection)
1386__STATIC_INLINE uint32_t LL_SPI_GetHalfDuplexDirection(
SPI_TypeDef *SPIx)
1428__STATIC_INLINE
void LL_SPI_SetDataWidth(
SPI_TypeDef *SPIx, uint32_t DataWidth)
1468__STATIC_INLINE uint32_t LL_SPI_GetDataWidth(
SPI_TypeDef *SPIx)
1497__STATIC_INLINE
void LL_SPI_SetFIFOThreshold(
SPI_TypeDef *SPIx, uint32_t Threshold)
1524__STATIC_INLINE uint32_t LL_SPI_GetFIFOThreshold(
SPI_TypeDef *SPIx)
1536__STATIC_INLINE
void LL_SPI_EnableCRC(
SPI_TypeDef *SPIx)
1547__STATIC_INLINE
void LL_SPI_DisableCRC(
SPI_TypeDef *SPIx)
1558__STATIC_INLINE uint32_t LL_SPI_IsEnabledCRC(
SPI_TypeDef *SPIx)
1600__STATIC_INLINE
void LL_SPI_SetCRCWidth(
SPI_TypeDef *SPIx, uint32_t CRCLength)
1640__STATIC_INLINE uint32_t LL_SPI_GetCRCWidth(
SPI_TypeDef *SPIx)
1658__STATIC_INLINE
void LL_SPI_SetNSSMode(
SPI_TypeDef *SPIx, uint32_t NSS)
1673__STATIC_INLINE uint32_t LL_SPI_GetNSSMode(
SPI_TypeDef *SPIx)
1686__STATIC_INLINE
void LL_SPI_EnableNSSPulseMgt(
SPI_TypeDef *SPIx)
1699__STATIC_INLINE
void LL_SPI_DisableNSSPulseMgt(
SPI_TypeDef *SPIx)
1710__STATIC_INLINE uint32_t LL_SPI_IsEnabledNSSPulse(
SPI_TypeDef *SPIx)
1730__STATIC_INLINE uint32_t LL_SPI_IsActiveFlag_RXP(
SPI_TypeDef *SPIx)
1741__STATIC_INLINE uint32_t LL_SPI_IsActiveFlag_TXP(
SPI_TypeDef *SPIx)
1752__STATIC_INLINE uint32_t LL_SPI_IsActiveFlag_DXP(
SPI_TypeDef *SPIx)
1763__STATIC_INLINE uint32_t LL_SPI_IsActiveFlag_EOT(
SPI_TypeDef *SPIx)
1774__STATIC_INLINE uint32_t LL_SPI_IsActiveFlag_TXTF(
SPI_TypeDef *SPIx)
1785__STATIC_INLINE uint32_t LL_SPI_IsActiveFlag_UDR(
SPI_TypeDef *SPIx)
1796__STATIC_INLINE uint32_t LL_SPI_IsActiveFlag_CRCERR(
SPI_TypeDef *SPIx)
1807__STATIC_INLINE uint32_t LL_SPI_IsActiveFlag_MODF(
SPI_TypeDef *SPIx)
1809 return ((READ_BIT(SPIx->
SR, SPI_SR_MODF) == (SPI_SR_MODF)) ? 1UL : 0UL);
1818__STATIC_INLINE uint32_t LL_SPI_IsActiveFlag_OVR(
SPI_TypeDef *SPIx)
1829__STATIC_INLINE uint32_t LL_SPI_IsActiveFlag_FRE(
SPI_TypeDef *SPIx)
1840__STATIC_INLINE uint32_t LL_SPI_IsActiveFlag_TSER(
SPI_TypeDef *SPIx)
1851__STATIC_INLINE uint32_t LL_SPI_IsActiveFlag_SUSP(
SPI_TypeDef *SPIx)
1862__STATIC_INLINE uint32_t LL_SPI_IsActiveFlag_TXC(
SPI_TypeDef *SPIx)
1873__STATIC_INLINE uint32_t LL_SPI_IsActiveFlag_RXWNE(
SPI_TypeDef *SPIx)
1884__STATIC_INLINE uint32_t LL_SPI_GetRemainingDataFrames(
SPI_TypeDef *SPIx)
1886 return (uint32_t)(READ_BIT(SPIx->
SR,
SPI_SR_CTSIZE) >> SPI_SR_CTSIZE_Pos);
1899__STATIC_INLINE uint32_t LL_SPI_GetRxFIFOPackingLevel(
SPI_TypeDef *SPIx)
1910__STATIC_INLINE
void LL_SPI_ClearFlag_EOT(
SPI_TypeDef *SPIx)
1921__STATIC_INLINE
void LL_SPI_ClearFlag_TXTF(
SPI_TypeDef *SPIx)
1932__STATIC_INLINE
void LL_SPI_ClearFlag_UDR(
SPI_TypeDef *SPIx)
1943__STATIC_INLINE
void LL_SPI_ClearFlag_OVR(
SPI_TypeDef *SPIx)
1954__STATIC_INLINE
void LL_SPI_ClearFlag_CRCERR(
SPI_TypeDef *SPIx)
1965__STATIC_INLINE
void LL_SPI_ClearFlag_MODF(
SPI_TypeDef *SPIx)
1976__STATIC_INLINE
void LL_SPI_ClearFlag_FRE(
SPI_TypeDef *SPIx)
1987__STATIC_INLINE
void LL_SPI_ClearFlag_TSER(
SPI_TypeDef *SPIx)
1998__STATIC_INLINE
void LL_SPI_ClearFlag_SUSP(
SPI_TypeDef *SPIx)
2018__STATIC_INLINE
void LL_SPI_EnableIT_RXP(
SPI_TypeDef *SPIx)
2029__STATIC_INLINE
void LL_SPI_EnableIT_TXP(
SPI_TypeDef *SPIx)
2040__STATIC_INLINE
void LL_SPI_EnableIT_DXP(
SPI_TypeDef *SPIx)
2051__STATIC_INLINE
void LL_SPI_EnableIT_EOT(
SPI_TypeDef *SPIx)
2062__STATIC_INLINE
void LL_SPI_EnableIT_TXTF(
SPI_TypeDef *SPIx)
2073__STATIC_INLINE
void LL_SPI_EnableIT_UDR(
SPI_TypeDef *SPIx)
2084__STATIC_INLINE
void LL_SPI_EnableIT_OVR(
SPI_TypeDef *SPIx)
2095__STATIC_INLINE
void LL_SPI_EnableIT_CRCERR(
SPI_TypeDef *SPIx)
2106__STATIC_INLINE
void LL_SPI_EnableIT_FRE(
SPI_TypeDef *SPIx)
2117__STATIC_INLINE
void LL_SPI_EnableIT_MODF(
SPI_TypeDef *SPIx)
2128__STATIC_INLINE
void LL_SPI_EnableIT_TSER(
SPI_TypeDef *SPIx)
2139__STATIC_INLINE
void LL_SPI_DisableIT_RXP(
SPI_TypeDef *SPIx)
2150__STATIC_INLINE
void LL_SPI_DisableIT_TXP(
SPI_TypeDef *SPIx)
2161__STATIC_INLINE
void LL_SPI_DisableIT_DXP(
SPI_TypeDef *SPIx)
2172__STATIC_INLINE
void LL_SPI_DisableIT_EOT(
SPI_TypeDef *SPIx)
2183__STATIC_INLINE
void LL_SPI_DisableIT_TXTF(
SPI_TypeDef *SPIx)
2194__STATIC_INLINE
void LL_SPI_DisableIT_UDR(
SPI_TypeDef *SPIx)
2205__STATIC_INLINE
void LL_SPI_DisableIT_OVR(
SPI_TypeDef *SPIx)
2216__STATIC_INLINE
void LL_SPI_DisableIT_CRCERR(
SPI_TypeDef *SPIx)
2227__STATIC_INLINE
void LL_SPI_DisableIT_FRE(
SPI_TypeDef *SPIx)
2238__STATIC_INLINE
void LL_SPI_DisableIT_MODF(
SPI_TypeDef *SPIx)
2249__STATIC_INLINE
void LL_SPI_DisableIT_TSER(
SPI_TypeDef *SPIx)
2260__STATIC_INLINE uint32_t LL_SPI_IsEnabledIT_RXP(
SPI_TypeDef *SPIx)
2271__STATIC_INLINE uint32_t LL_SPI_IsEnabledIT_TXP(
SPI_TypeDef *SPIx)
2282__STATIC_INLINE uint32_t LL_SPI_IsEnabledIT_DXP(
SPI_TypeDef *SPIx)
2293__STATIC_INLINE uint32_t LL_SPI_IsEnabledIT_EOT(
SPI_TypeDef *SPIx)
2304__STATIC_INLINE uint32_t LL_SPI_IsEnabledIT_TXTF(
SPI_TypeDef *SPIx)
2315__STATIC_INLINE uint32_t LL_SPI_IsEnabledIT_UDR(
SPI_TypeDef *SPIx)
2326__STATIC_INLINE uint32_t LL_SPI_IsEnabledIT_OVR(
SPI_TypeDef *SPIx)
2337__STATIC_INLINE uint32_t LL_SPI_IsEnabledIT_CRCERR(
SPI_TypeDef *SPIx)
2348__STATIC_INLINE uint32_t LL_SPI_IsEnabledIT_FRE(
SPI_TypeDef *SPIx)
2359__STATIC_INLINE uint32_t LL_SPI_IsEnabledIT_MODF(
SPI_TypeDef *SPIx)
2370__STATIC_INLINE uint32_t LL_SPI_IsEnabledIT_TSER(
SPI_TypeDef *SPIx)
2390__STATIC_INLINE
void LL_SPI_EnableDMAReq_RX(
SPI_TypeDef *SPIx)
2401__STATIC_INLINE
void LL_SPI_DisableDMAReq_RX(
SPI_TypeDef *SPIx)
2412__STATIC_INLINE uint32_t LL_SPI_IsEnabledDMAReq_RX(
SPI_TypeDef *SPIx)
2423__STATIC_INLINE
void LL_SPI_EnableDMAReq_TX(
SPI_TypeDef *SPIx)
2434__STATIC_INLINE
void LL_SPI_DisableDMAReq_TX(
SPI_TypeDef *SPIx)
2445__STATIC_INLINE uint32_t LL_SPI_IsEnabledDMAReq_TX(
SPI_TypeDef *SPIx)
2455__STATIC_INLINE uint32_t LL_SPI_DMA_GetTxRegAddr(
SPI_TypeDef *SPIx)
2457 return (uint32_t) &(SPIx->
TXDR);
2466__STATIC_INLINE uint32_t LL_SPI_DMA_GetRxRegAddr(
SPI_TypeDef *SPIx)
2468 return (uint32_t) &(SPIx->
RXDR);
2485__STATIC_INLINE uint8_t LL_SPI_ReceiveData8(
SPI_TypeDef *SPIx)
2487 return (*((
__IO uint8_t *)&SPIx->
RXDR));
2496__STATIC_INLINE uint16_t LL_SPI_ReceiveData16(
SPI_TypeDef *SPIx)
2498#if defined (__GNUC__)
2499 __IO uint16_t *spirxdr = (
__IO uint16_t *)(&(SPIx->
RXDR));
2502 return (*((
__IO uint16_t *)&SPIx->
RXDR));
2512__STATIC_INLINE uint32_t LL_SPI_ReceiveData32(
SPI_TypeDef *SPIx)
2514 return (*((
__IO uint32_t *)&SPIx->
RXDR));
2524__STATIC_INLINE
void LL_SPI_TransmitData8(
SPI_TypeDef *SPIx, uint8_t TxData)
2526 *((
__IO uint8_t *)&SPIx->
TXDR) = TxData;
2536__STATIC_INLINE
void LL_SPI_TransmitData16(
SPI_TypeDef *SPIx, uint16_t TxData)
2538#if defined (__GNUC__)
2539 __IO uint16_t *spitxdr = ((
__IO uint16_t *)&SPIx->
TXDR);
2542 *((
__IO uint16_t *)&SPIx->
TXDR) = TxData;
2553__STATIC_INLINE
void LL_SPI_TransmitData32(
SPI_TypeDef *SPIx, uint32_t TxData)
2555 *((
__IO uint32_t *)&SPIx->
TXDR) = TxData;
2565__STATIC_INLINE
void LL_SPI_SetCRCPolynomial(
SPI_TypeDef *SPIx, uint32_t CRCPoly)
2567 WRITE_REG(SPIx->
CRCPOLY, CRCPoly);
2576__STATIC_INLINE uint32_t LL_SPI_GetCRCPolynomial(
SPI_TypeDef *SPIx)
2578 return (uint32_t)(READ_REG(SPIx->
CRCPOLY));
2588__STATIC_INLINE
void LL_SPI_SetUDRPattern(
SPI_TypeDef *SPIx, uint32_t Pattern)
2590 WRITE_REG(SPIx->
UDRDR, Pattern);
2599__STATIC_INLINE uint32_t LL_SPI_GetUDRPattern(
SPI_TypeDef *SPIx)
2601 return (uint32_t)(READ_REG(SPIx->
UDRDR));
2610__STATIC_INLINE uint32_t LL_SPI_GetRxCRC(
SPI_TypeDef *SPIx)
2612 return (uint32_t)(READ_REG(SPIx->
RXCRC));
2621__STATIC_INLINE uint32_t LL_SPI_GetTxCRC(
SPI_TypeDef *SPIx)
2623 return (uint32_t)(READ_REG(SPIx->
TXCRC));
2630#if defined(USE_FULL_LL_DRIVER) || defined(__rtems__)
2637ErrorStatus LL_SPI_Init(
SPI_TypeDef *SPIx, LL_SPI_InitTypeDef *SPI_InitStruct);
2638void LL_SPI_StructInit(LL_SPI_InitTypeDef *SPI_InitStruct);
2661#if defined(USE_FULL_LL_DRIVER) || defined(__rtems__)
2686 uint32_t DataFormat;
2693 uint32_t MCLKOutput;
2709 uint32_t ClockPolarity;
2715} LL_I2S_InitTypeDef;
2732#define LL_I2S_DATAFORMAT_16B (0x00000000UL)
2733#define LL_I2S_DATAFORMAT_16B_EXTENDED (SPI_I2SCFGR_CHLEN)
2734#define LL_I2S_DATAFORMAT_24B (SPI_I2SCFGR_CHLEN | SPI_I2SCFGR_DATLEN_0)
2735#define LL_I2S_DATAFORMAT_24B_LEFT_ALIGNED (SPI_I2SCFGR_CHLEN | SPI_I2SCFGR_DATLEN_0 | SPI_I2SCFGR_DATFMT)
2736#define LL_I2S_DATAFORMAT_32B (SPI_I2SCFGR_CHLEN | SPI_I2SCFGR_DATLEN_1)
2745#define LL_I2S_SLAVE_VARIABLE_CH_LENGTH (0x00000000UL)
2746#define LL_I2S_SLAVE_FIXED_CH_LENGTH (SPI_I2SCFGR_FIXCH)
2755#define LL_I2S_POLARITY_LOW (0x00000000UL)
2756#define LL_I2S_POLARITY_HIGH (SPI_I2SCFGR_CKPOL)
2765#define LL_I2S_STANDARD_PHILIPS (0x00000000UL)
2766#define LL_I2S_STANDARD_MSB (SPI_I2SCFGR_I2SSTD_0)
2767#define LL_I2S_STANDARD_LSB (SPI_I2SCFGR_I2SSTD_1)
2768#define LL_I2S_STANDARD_PCM_SHORT (SPI_I2SCFGR_I2SSTD_0 | SPI_I2SCFGR_I2SSTD_1)
2769#define LL_I2S_STANDARD_PCM_LONG (SPI_I2SCFGR_I2SSTD_0 | SPI_I2SCFGR_I2SSTD_1 | SPI_I2SCFGR_PCMSYNC)
2778#define LL_I2S_MODE_SLAVE_TX (0x00000000UL)
2779#define LL_I2S_MODE_SLAVE_RX (SPI_I2SCFGR_I2SCFG_0)
2780#define LL_I2S_MODE_SLAVE_FULL_DUPLEX (SPI_I2SCFGR_I2SCFG_2)
2781#define LL_I2S_MODE_MASTER_TX (SPI_I2SCFGR_I2SCFG_1)
2782#define LL_I2S_MODE_MASTER_RX (SPI_I2SCFGR_I2SCFG_1 | SPI_I2SCFGR_I2SCFG_0)
2783#define LL_I2S_MODE_MASTER_FULL_DUPLEX (SPI_I2SCFGR_I2SCFG_2 | SPI_I2SCFGR_I2SCFG_0)
2792#define LL_I2S_PRESCALER_PARITY_EVEN (0x00000000UL)
2793#define LL_I2S_PRESCALER_PARITY_ODD (0x00000001UL)
2802#define LL_I2S_FIFO_TH_01DATA (LL_SPI_FIFO_TH_01DATA)
2803#define LL_I2S_FIFO_TH_02DATA (LL_SPI_FIFO_TH_02DATA)
2804#define LL_I2S_FIFO_TH_03DATA (LL_SPI_FIFO_TH_03DATA)
2805#define LL_I2S_FIFO_TH_04DATA (LL_SPI_FIFO_TH_04DATA)
2806#define LL_I2S_FIFO_TH_05DATA (LL_SPI_FIFO_TH_05DATA)
2807#define LL_I2S_FIFO_TH_06DATA (LL_SPI_FIFO_TH_06DATA)
2808#define LL_I2S_FIFO_TH_07DATA (LL_SPI_FIFO_TH_07DATA)
2809#define LL_I2S_FIFO_TH_08DATA (LL_SPI_FIFO_TH_08DATA)
2818#define LL_I2S_LSB_FIRST (LL_SPI_LSB_FIRST)
2819#define LL_I2S_MSB_FIRST (LL_SPI_MSB_FIRST)
2824#if defined(USE_FULL_LL_DRIVER) || defined(__rtems__)
2830#define LL_I2S_MCLK_OUTPUT_DISABLE (0x00000000UL)
2831#define LL_I2S_MCLK_OUTPUT_ENABLE (SPI_I2SCFGR_MCKOE)
2841#define LL_I2S_AUDIOFREQ_192K 192000UL
2842#define LL_I2S_AUDIOFREQ_96K 96000UL
2843#define LL_I2S_AUDIOFREQ_48K 48000UL
2844#define LL_I2S_AUDIOFREQ_44K 44100UL
2845#define LL_I2S_AUDIOFREQ_32K 32000UL
2846#define LL_I2S_AUDIOFREQ_22K 22050UL
2847#define LL_I2S_AUDIOFREQ_16K 16000UL
2848#define LL_I2S_AUDIOFREQ_11K 11025UL
2849#define LL_I2S_AUDIOFREQ_8K 8000UL
2850#define LL_I2S_AUDIOFREQ_DEFAULT 0UL
2878#define LL_I2S_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
2886#define LL_I2S_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
2922__STATIC_INLINE
void LL_I2S_SetDataFormat(
SPI_TypeDef *SPIx, uint32_t DataLength)
2940__STATIC_INLINE uint32_t LL_I2S_GetDataFormat(
SPI_TypeDef *SPIx)
2955__STATIC_INLINE
void LL_I2S_SetChannelLengthType(
SPI_TypeDef *SPIx, uint32_t ChannelLengthType)
2969__STATIC_INLINE uint32_t LL_I2S_GetChannelLengthType(
SPI_TypeDef *SPIx)
2980__STATIC_INLINE
void LL_I2S_EnableWordSelectInversion(
SPI_TypeDef *SPIx)
2991__STATIC_INLINE
void LL_I2S_DisableWordSelectInversion(
SPI_TypeDef *SPIx)
3002__STATIC_INLINE uint32_t LL_I2S_IsEnabledWordSelectInversion(
SPI_TypeDef *SPIx)
3016__STATIC_INLINE
void LL_I2S_SetClockPolarity(
SPI_TypeDef *SPIx, uint32_t ClockPolarity)
3029__STATIC_INLINE uint32_t LL_I2S_GetClockPolarity(
SPI_TypeDef *SPIx)
3047__STATIC_INLINE
void LL_I2S_SetStandard(
SPI_TypeDef *SPIx, uint32_t Standard)
3064__STATIC_INLINE uint32_t LL_I2S_GetStandard(
SPI_TypeDef *SPIx)
3082__STATIC_INLINE
void LL_I2S_SetTransferMode(
SPI_TypeDef *SPIx, uint32_t Standard)
3099__STATIC_INLINE uint32_t LL_I2S_GetTransferMode(
SPI_TypeDef *SPIx)
3111__STATIC_INLINE
void LL_I2S_Enable(
SPI_TypeDef *SPIx)
3124__STATIC_INLINE
void LL_I2S_Disable(
SPI_TypeDef *SPIx)
3137__STATIC_INLINE
void LL_I2S_EnableIOSwap(
SPI_TypeDef *SPIx)
3139 LL_SPI_EnableIOSwap(SPIx);
3149__STATIC_INLINE
void LL_I2S_DisableIOSwap(
SPI_TypeDef *SPIx)
3151 LL_SPI_DisableIOSwap(SPIx);
3160__STATIC_INLINE uint32_t LL_I2S_IsEnabledIOSwap(
SPI_TypeDef *SPIx)
3162 return LL_SPI_IsEnabledIOSwap(SPIx);
3172__STATIC_INLINE
void LL_I2S_EnableGPIOControl(
SPI_TypeDef *SPIx)
3174 LL_SPI_EnableGPIOControl(SPIx);
3184__STATIC_INLINE
void LL_I2S_DisableGPIOControl(
SPI_TypeDef *SPIx)
3186 LL_SPI_DisableGPIOControl(SPIx);
3195__STATIC_INLINE uint32_t LL_I2S_IsEnabledGPIOControl(
SPI_TypeDef *SPIx)
3197 return LL_SPI_IsEnabledGPIOControl(SPIx);
3208__STATIC_INLINE
void LL_I2S_EnableIOLock(
SPI_TypeDef *SPIx)
3210 LL_SPI_EnableIOLock(SPIx);
3219__STATIC_INLINE uint32_t LL_I2S_IsEnabledIOLock(
SPI_TypeDef *SPIx)
3221 return LL_SPI_IsEnabledIOLock(SPIx);
3234__STATIC_INLINE
void LL_I2S_SetTransferBitOrder(
SPI_TypeDef *SPIx, uint32_t BitOrder)
3236 LL_SPI_SetTransferBitOrder(SPIx, BitOrder);
3246__STATIC_INLINE uint32_t LL_I2S_GetTransferBitOrder(
SPI_TypeDef *SPIx)
3248 return LL_SPI_GetTransferBitOrder(SPIx);
3257__STATIC_INLINE
void LL_I2S_StartTransfer(
SPI_TypeDef *SPIx)
3259 LL_SPI_StartMasterTransfer(SPIx);
3268__STATIC_INLINE uint32_t LL_I2S_IsActiveTransfer(
SPI_TypeDef *SPIx)
3270 return LL_SPI_IsActiveMasterTransfer(SPIx);
3289__STATIC_INLINE
void LL_I2S_SetFIFOThreshold(
SPI_TypeDef *SPIx, uint32_t Threshold)
3291 LL_SPI_SetFIFOThreshold(SPIx, Threshold);
3308__STATIC_INLINE uint32_t LL_I2S_GetFIFOThreshold(
SPI_TypeDef *SPIx)
3310 return LL_SPI_GetFIFOThreshold(SPIx);
3321__STATIC_INLINE
void LL_I2S_SetPrescalerLinear(
SPI_TypeDef *SPIx, uint32_t PrescalerLinear)
3332__STATIC_INLINE uint32_t LL_I2S_GetPrescalerLinear(
SPI_TypeDef *SPIx)
3346__STATIC_INLINE
void LL_I2S_SetPrescalerParity(
SPI_TypeDef *SPIx, uint32_t PrescalerParity)
3359__STATIC_INLINE uint32_t LL_I2S_GetPrescalerParity(
SPI_TypeDef *SPIx)
3370__STATIC_INLINE
void LL_I2S_EnableMasterClock(
SPI_TypeDef *SPIx)
3381__STATIC_INLINE
void LL_I2S_DisableMasterClock(
SPI_TypeDef *SPIx)
3392__STATIC_INLINE uint32_t LL_I2S_IsEnabledMasterClock(
SPI_TypeDef *SPIx)
3413__STATIC_INLINE uint32_t LL_I2S_IsActiveFlag_RXP(
SPI_TypeDef *SPIx)
3415 return LL_SPI_IsActiveFlag_RXP(SPIx);
3424__STATIC_INLINE uint32_t LL_I2S_IsActiveFlag_TXP(
SPI_TypeDef *SPIx)
3426 return LL_SPI_IsActiveFlag_TXP(SPIx);
3435__STATIC_INLINE uint32_t LL_I2S_IsActiveFlag_UDR(
SPI_TypeDef *SPIx)
3437 return LL_SPI_IsActiveFlag_UDR(SPIx);
3446__STATIC_INLINE uint32_t LL_I2S_IsActiveFlag_OVR(
SPI_TypeDef *SPIx)
3448 return LL_SPI_IsActiveFlag_OVR(SPIx);
3457__STATIC_INLINE uint32_t LL_I2S_IsActiveFlag_FRE(
SPI_TypeDef *SPIx)
3459 return LL_SPI_IsActiveFlag_FRE(SPIx);
3468__STATIC_INLINE
void LL_I2S_ClearFlag_UDR(
SPI_TypeDef *SPIx)
3470 LL_SPI_ClearFlag_UDR(SPIx);
3479__STATIC_INLINE
void LL_I2S_ClearFlag_OVR(
SPI_TypeDef *SPIx)
3481 LL_SPI_ClearFlag_OVR(SPIx);
3490__STATIC_INLINE
void LL_I2S_ClearFlag_FRE(
SPI_TypeDef *SPIx)
3492 LL_SPI_ClearFlag_FRE(SPIx);
3510__STATIC_INLINE
void LL_I2S_EnableIT_RXP(
SPI_TypeDef *SPIx)
3512 LL_SPI_EnableIT_RXP(SPIx);
3521__STATIC_INLINE
void LL_I2S_EnableIT_TXP(
SPI_TypeDef *SPIx)
3523 LL_SPI_EnableIT_TXP(SPIx);
3532__STATIC_INLINE
void LL_I2S_EnableIT_UDR(
SPI_TypeDef *SPIx)
3534 LL_SPI_EnableIT_UDR(SPIx);
3543__STATIC_INLINE
void LL_I2S_EnableIT_OVR(
SPI_TypeDef *SPIx)
3545 LL_SPI_EnableIT_OVR(SPIx);
3554__STATIC_INLINE
void LL_I2S_EnableIT_FRE(
SPI_TypeDef *SPIx)
3556 LL_SPI_EnableIT_FRE(SPIx);
3565__STATIC_INLINE
void LL_I2S_DisableIT_RXP(
SPI_TypeDef *SPIx)
3567 LL_SPI_DisableIT_RXP(SPIx);
3576__STATIC_INLINE
void LL_I2S_DisableIT_TXP(
SPI_TypeDef *SPIx)
3578 LL_SPI_DisableIT_TXP(SPIx);
3587__STATIC_INLINE
void LL_I2S_DisableIT_UDR(
SPI_TypeDef *SPIx)
3589 LL_SPI_DisableIT_UDR(SPIx);
3598__STATIC_INLINE
void LL_I2S_DisableIT_OVR(
SPI_TypeDef *SPIx)
3600 LL_SPI_DisableIT_OVR(SPIx);
3609__STATIC_INLINE
void LL_I2S_DisableIT_FRE(
SPI_TypeDef *SPIx)
3611 LL_SPI_DisableIT_FRE(SPIx);
3620__STATIC_INLINE uint32_t LL_I2S_IsEnabledIT_RXP(
SPI_TypeDef *SPIx)
3622 return LL_SPI_IsEnabledIT_RXP(SPIx);
3631__STATIC_INLINE uint32_t LL_I2S_IsEnabledIT_TXP(
SPI_TypeDef *SPIx)
3633 return LL_SPI_IsEnabledIT_TXP(SPIx);
3642__STATIC_INLINE uint32_t LL_I2S_IsEnabledIT_UDR(
SPI_TypeDef *SPIx)
3644 return LL_SPI_IsEnabledIT_UDR(SPIx);
3653__STATIC_INLINE uint32_t LL_I2S_IsEnabledIT_OVR(
SPI_TypeDef *SPIx)
3655 return LL_SPI_IsEnabledIT_OVR(SPIx);
3664__STATIC_INLINE uint32_t LL_I2S_IsEnabledIT_FRE(
SPI_TypeDef *SPIx)
3666 return LL_SPI_IsEnabledIT_FRE(SPIx);
3684__STATIC_INLINE
void LL_I2S_EnableDMAReq_RX(
SPI_TypeDef *SPIx)
3686 LL_SPI_EnableDMAReq_RX(SPIx);
3695__STATIC_INLINE
void LL_I2S_DisableDMAReq_RX(
SPI_TypeDef *SPIx)
3697 LL_SPI_DisableDMAReq_RX(SPIx);
3706__STATIC_INLINE uint32_t LL_I2S_IsEnabledDMAReq_RX(
SPI_TypeDef *SPIx)
3708 return LL_SPI_IsEnabledDMAReq_RX(SPIx);
3717__STATIC_INLINE
void LL_I2S_EnableDMAReq_TX(
SPI_TypeDef *SPIx)
3719 LL_SPI_EnableDMAReq_TX(SPIx);
3728__STATIC_INLINE
void LL_I2S_DisableDMAReq_TX(
SPI_TypeDef *SPIx)
3730 LL_SPI_DisableDMAReq_TX(SPIx);
3739__STATIC_INLINE uint32_t LL_I2S_IsEnabledDMAReq_TX(
SPI_TypeDef *SPIx)
3741 return LL_SPI_IsEnabledDMAReq_TX(SPIx);
3759__STATIC_INLINE uint16_t LL_I2S_ReceiveData16(
SPI_TypeDef *SPIx)
3761 return LL_SPI_ReceiveData16(SPIx);
3770__STATIC_INLINE uint32_t LL_I2S_ReceiveData32(
SPI_TypeDef *SPIx)
3772 return LL_SPI_ReceiveData32(SPIx);
3782__STATIC_INLINE
void LL_I2S_TransmitData16(
SPI_TypeDef *SPIx, uint16_t TxData)
3784 LL_SPI_TransmitData16(SPIx, TxData);
3794__STATIC_INLINE
void LL_I2S_TransmitData32(
SPI_TypeDef *SPIx, uint32_t TxData)
3796 LL_SPI_TransmitData32(SPIx, TxData);
3805#if defined(USE_FULL_LL_DRIVER) || defined(__rtems__)
3812ErrorStatus LL_I2S_Init(
SPI_TypeDef *SPIx, LL_I2S_InitTypeDef *I2S_InitStruct);
3813void LL_I2S_StructInit(LL_I2S_InitTypeDef *I2S_InitStruct);
3814void LL_I2S_ConfigPrescaler(
SPI_TypeDef *SPIx, uint32_t PrescalerLinear, uint32_t PrescalerParity);
#define __IO
Definition: core_cm4.h:239
#define SPI_IER_TIFREIE
Definition: stm32h723xx.h:18392
#define SPI_SR_RXPLVL
Definition: stm32h723xx.h:18442
#define SPI_IFCR_EOTC
Definition: stm32h723xx.h:18455
#define SPI_CR1_CSTART
Definition: stm32h723xx.h:18212
#define SPI_IFCR_UDRC
Definition: stm32h723xx.h:18461
#define SPI_SR_UDR
Definition: stm32h723xx.h:18418
#define SPI_SR_TXC
Definition: stm32h723xx.h:18439
#define SPI_IER_TSERFIE
Definition: stm32h723xx.h:18398
#define SPI_CFG2_COMM
Definition: stm32h723xx.h:18324
#define SPI_I2SCFGR_DATFMT
Definition: stm32h723xx.h:18548
#define SPI_CFG1_CRCEN
Definition: stm32h723xx.h:18292
#define SPI_CFG2_CPHA
Definition: stm32h723xx.h:18343
#define SPI_IER_CRCEIE
Definition: stm32h723xx.h:18389
#define SPI_I2SCFGR_I2SDIV
Definition: stm32h723xx.h:18551
#define SPI_SR_SUSP
Definition: stm32h723xx.h:18436
#define SPI_IER_UDRIE
Definition: stm32h723xx.h:18383
#define SPI_IFCR_MODFC
Definition: stm32h723xx.h:18473
#define SPI_I2SCFGR_ODD
Definition: stm32h723xx.h:18554
#define SPI_IER_TXPIE
Definition: stm32h723xx.h:18371
#define SPI_IFCR_TXTFC
Definition: stm32h723xx.h:18458
#define SPI_CFG1_MBR
Definition: stm32h723xx.h:18296
#define SPI_SR_CRCE
Definition: stm32h723xx.h:18424
#define SPI_SR_TSERF
Definition: stm32h723xx.h:18433
#define SPI_CFG1_FTHLV
Definition: stm32h723xx.h:18255
#define SPI_I2SCFGR_CKPOL
Definition: stm32h723xx.h:18539
#define SPI_CR1_SSI
Definition: stm32h723xx.h:18221
#define SPI_IER_DXPIE
Definition: stm32h723xx.h:18374
#define SPI_CFG2_SP
Definition: stm32h723xx.h:18330
#define SPI_IFCR_SUSPC
Definition: stm32h723xx.h:18479
#define SPI_I2SCFGR_PCMSYNC
Definition: stm32h723xx.h:18528
#define SPI_CR2_TSER
Definition: stm32h723xx.h:18238
#define SPI_CFG2_IOSWP
Definition: stm32h723xx.h:18320
#define SPI_IER_OVRIE
Definition: stm32h723xx.h:18386
#define SPI_IER_MODFIE
Definition: stm32h723xx.h:18395
#define SPI_SR_CTSIZE
Definition: stm32h723xx.h:18450
#define SPI_CR1_HDDIR
Definition: stm32h723xx.h:18218
#define SPI_SR_DXP
Definition: stm32h723xx.h:18409
#define SPI_I2SCFGR_I2SSTD
Definition: stm32h723xx.h:18523
#define SPI_CFG2_MSSI
Definition: stm32h723xx.h:18304
#define SPI_IER_RXPIE
Definition: stm32h723xx.h:18368
#define SPI_CR1_IOLOCK
Definition: stm32h723xx.h:18233
#define SPI_SR_RXP
Definition: stm32h723xx.h:18403
#define SPI_I2SCFGR_CHLEN
Definition: stm32h723xx.h:18536
#define SPI_CFG2_SSOE
Definition: stm32h723xx.h:18356
#define SPI_SR_TXP
Definition: stm32h723xx.h:18406
#define SPI_CFG2_SSIOP
Definition: stm32h723xx.h:18353
#define SPI_CFG1_RXDMAEN
Definition: stm32h723xx.h:18276
#define SPI_IFCR_CRCEC
Definition: stm32h723xx.h:18467
#define SPI_SR_OVR
Definition: stm32h723xx.h:18421
#define SPI_CR1_CRC33_17
Definition: stm32h723xx.h:18224
#define SPI_CR1_RCRCINI
Definition: stm32h723xx.h:18227
#define SPI_CR1_TCRCINI
Definition: stm32h723xx.h:18230
#define SPI_CFG2_LSBFRST
Definition: stm32h723xx.h:18340
#define SPI_SR_RXWNE
Definition: stm32h723xx.h:18447
#define SPI_CFG2_MIDI
Definition: stm32h723xx.h:18312
#define SPI_CFG1_DSIZE
Definition: stm32h723xx.h:18246
#define SPI_CFG1_UDRDET
Definition: stm32h723xx.h:18270
#define SPI_CFG2_SSOM
Definition: stm32h723xx.h:18359
#define SPI_I2SCFGR_WSINV
Definition: stm32h723xx.h:18545
#define SPI_SR_TXTF
Definition: stm32h723xx.h:18415
#define SPI_CR1_CSUSP
Definition: stm32h723xx.h:18215
#define SPI_CFG1_TXDMAEN
Definition: stm32h723xx.h:18279
#define SPI_CR1_SPE
Definition: stm32h723xx.h:18206
#define SPI_I2SCFGR_DATLEN
Definition: stm32h723xx.h:18531
#define SPI_I2SCFGR_MCKOE
Definition: stm32h723xx.h:18557
#define SPI_IFCR_TSERFC
Definition: stm32h723xx.h:18476
#define SPI_CFG2_SSM
Definition: stm32h723xx.h:18349
#define SPI_IER_EOTIE
Definition: stm32h723xx.h:18377
#define SPI_IFCR_TIFREC
Definition: stm32h723xx.h:18470
#define SPI_SR_EOT
Definition: stm32h723xx.h:18412
#define SPI_CFG1_CRCSIZE
Definition: stm32h723xx.h:18283
#define SPI_CFG2_MASTER
Definition: stm32h723xx.h:18337
#define SPI_CR1_MASRX
Definition: stm32h723xx.h:18209
#define SPI_I2SCFGR_I2SMOD
Definition: stm32h723xx.h:18514
#define SPI_I2SCFGR_I2SCFG
Definition: stm32h723xx.h:18517
#define SPI_CFG2_AFCNTR
Definition: stm32h723xx.h:18363
#define SPI_IER_TXTFIE
Definition: stm32h723xx.h:18380
#define SPI_SR_TIFRE
Definition: stm32h723xx.h:18427
#define SPI_CR2_TSIZE
Definition: stm32h723xx.h:18241
#define SPI_I2SCFGR_FIXCH
Definition: stm32h723xx.h:18542
#define SPI_CFG2_CPOL
Definition: stm32h723xx.h:18346
#define SPI_CFG1_UDRCFG
Definition: stm32h723xx.h:18263
#define SPI_IFCR_OVRC
Definition: stm32h723xx.h:18464
CMSIS STM32H7xx Device Peripheral Access Layer Header File.
Serial Peripheral Interface.
Definition: stm32h723xx.h:1479
__IO uint32_t RXDR
Definition: stm32h723xx.h:1490
__IO uint32_t CRCPOLY
Definition: stm32h723xx.h:1492
__IO uint32_t UDRDR
Definition: stm32h723xx.h:1495
__IO uint32_t CFG1
Definition: stm32h723xx.h:1482
__IO uint32_t SR
Definition: stm32h723xx.h:1485
__IO uint32_t CR2
Definition: stm32h723xx.h:1481
__IO uint32_t I2SCFGR
Definition: stm32h723xx.h:1496
__IO uint32_t TXDR
Definition: stm32h723xx.h:1488
__IO uint32_t CR1
Definition: stm32h723xx.h:1480
__IO uint32_t TXCRC
Definition: stm32h723xx.h:1493
__IO uint32_t RXCRC
Definition: stm32h723xx.h:1494
__IO uint32_t CFG2
Definition: stm32h723xx.h:1483
__IO uint32_t IFCR
Definition: stm32h723xx.h:1486
__IO uint32_t IER
Definition: stm32h723xx.h:1484