@@ -514,6 +514,7 @@ typedef struct
514
514
__IO uint32_t RXCRCR ;
515
515
__IO uint32_t TXCRCR ;
516
516
__IO uint32_t I2SCFGR ;
517
+ __IO uint32_t I2SPR ;
517
518
} SPI_TypeDef ;
518
519
519
520
/**
@@ -5283,6 +5284,10 @@ typedef struct
5283
5284
/* Serial Peripheral Interface */
5284
5285
/* */
5285
5286
/******************************************************************************/
5287
+ /*
5288
+ * @brief Specific device feature definitions (not present on all devices in the STM32F1 serie)
5289
+ */
5290
+ #define SPI_I2S_SUPPORT /*!< I2S support */
5286
5291
#define SPI_CRC_ERROR_WORKAROUND_FEATURE
5287
5292
5288
5293
/******************* Bit definition for SPI_CR1 register ********************/
@@ -5401,10 +5406,52 @@ typedef struct
5401
5406
#define SPI_TXCRCR_TXCRC SPI_TXCRCR_TXCRC_Msk /*!< Tx CRC Register */
5402
5407
5403
5408
/****************** Bit definition for SPI_I2SCFGR register *****************/
5409
+ #define SPI_I2SCFGR_CHLEN_Pos (0U)
5410
+ #define SPI_I2SCFGR_CHLEN_Msk (0x1UL << SPI_I2SCFGR_CHLEN_Pos) /*!< 0x00000001 */
5411
+ #define SPI_I2SCFGR_CHLEN SPI_I2SCFGR_CHLEN_Msk /*!< Channel length (number of bits per audio channel) */
5412
+
5413
+ #define SPI_I2SCFGR_DATLEN_Pos (1U)
5414
+ #define SPI_I2SCFGR_DATLEN_Msk (0x3UL << SPI_I2SCFGR_DATLEN_Pos) /*!< 0x00000006 */
5415
+ #define SPI_I2SCFGR_DATLEN SPI_I2SCFGR_DATLEN_Msk /*!< DATLEN[1:0] bits (Data length to be transferred) */
5416
+ #define SPI_I2SCFGR_DATLEN_0 (0x1UL << SPI_I2SCFGR_DATLEN_Pos) /*!< 0x00000002 */
5417
+ #define SPI_I2SCFGR_DATLEN_1 (0x2UL << SPI_I2SCFGR_DATLEN_Pos) /*!< 0x00000004 */
5418
+
5419
+ #define SPI_I2SCFGR_CKPOL_Pos (3U)
5420
+ #define SPI_I2SCFGR_CKPOL_Msk (0x1UL << SPI_I2SCFGR_CKPOL_Pos) /*!< 0x00000008 */
5421
+ #define SPI_I2SCFGR_CKPOL SPI_I2SCFGR_CKPOL_Msk /*!< steady state clock polarity */
5422
+
5423
+ #define SPI_I2SCFGR_I2SSTD_Pos (4U)
5424
+ #define SPI_I2SCFGR_I2SSTD_Msk (0x3UL << SPI_I2SCFGR_I2SSTD_Pos) /*!< 0x00000030 */
5425
+ #define SPI_I2SCFGR_I2SSTD SPI_I2SCFGR_I2SSTD_Msk /*!< I2SSTD[1:0] bits (I2S standard selection) */
5426
+ #define SPI_I2SCFGR_I2SSTD_0 (0x1UL << SPI_I2SCFGR_I2SSTD_Pos) /*!< 0x00000010 */
5427
+ #define SPI_I2SCFGR_I2SSTD_1 (0x2UL << SPI_I2SCFGR_I2SSTD_Pos) /*!< 0x00000020 */
5428
+
5429
+ #define SPI_I2SCFGR_PCMSYNC_Pos (7U)
5430
+ #define SPI_I2SCFGR_PCMSYNC_Msk (0x1UL << SPI_I2SCFGR_PCMSYNC_Pos) /*!< 0x00000080 */
5431
+ #define SPI_I2SCFGR_PCMSYNC SPI_I2SCFGR_PCMSYNC_Msk /*!< PCM frame synchronization */
5432
+
5433
+ #define SPI_I2SCFGR_I2SCFG_Pos (8U)
5434
+ #define SPI_I2SCFGR_I2SCFG_Msk (0x3UL << SPI_I2SCFGR_I2SCFG_Pos) /*!< 0x00000300 */
5435
+ #define SPI_I2SCFGR_I2SCFG SPI_I2SCFGR_I2SCFG_Msk /*!< I2SCFG[1:0] bits (I2S configuration mode) */
5436
+ #define SPI_I2SCFGR_I2SCFG_0 (0x1UL << SPI_I2SCFGR_I2SCFG_Pos) /*!< 0x00000100 */
5437
+ #define SPI_I2SCFGR_I2SCFG_1 (0x2UL << SPI_I2SCFGR_I2SCFG_Pos) /*!< 0x00000200 */
5438
+
5439
+ #define SPI_I2SCFGR_I2SE_Pos (10U)
5440
+ #define SPI_I2SCFGR_I2SE_Msk (0x1UL << SPI_I2SCFGR_I2SE_Pos) /*!< 0x00000400 */
5441
+ #define SPI_I2SCFGR_I2SE SPI_I2SCFGR_I2SE_Msk /*!< I2S Enable */
5404
5442
#define SPI_I2SCFGR_I2SMOD_Pos (11U)
5405
5443
#define SPI_I2SCFGR_I2SMOD_Msk (0x1UL << SPI_I2SCFGR_I2SMOD_Pos) /*!< 0x00000800 */
5406
5444
#define SPI_I2SCFGR_I2SMOD SPI_I2SCFGR_I2SMOD_Msk /*!< I2S mode selection */
5407
-
5445
+ /****************** Bit definition for SPI_I2SPR register *******************/
5446
+ #define SPI_I2SPR_I2SDIV_Pos (0U)
5447
+ #define SPI_I2SPR_I2SDIV_Msk (0xFFUL << SPI_I2SPR_I2SDIV_Pos) /*!< 0x000000FF */
5448
+ #define SPI_I2SPR_I2SDIV SPI_I2SPR_I2SDIV_Msk /*!< I2S Linear prescaler */
5449
+ #define SPI_I2SPR_ODD_Pos (8U)
5450
+ #define SPI_I2SPR_ODD_Msk (0x1UL << SPI_I2SPR_ODD_Pos) /*!< 0x00000100 */
5451
+ #define SPI_I2SPR_ODD SPI_I2SPR_ODD_Msk /*!< Odd factor for the prescaler */
5452
+ #define SPI_I2SPR_MCKOE_Pos (9U)
5453
+ #define SPI_I2SPR_MCKOE_Msk (0x1UL << SPI_I2SPR_MCKOE_Pos) /*!< 0x00000200 */
5454
+ #define SPI_I2SPR_MCKOE SPI_I2SPR_MCKOE_Msk /*!< Master Clock Output Enable */
5408
5455
5409
5456
/******************************************************************************/
5410
5457
/* */
@@ -6153,6 +6200,10 @@ typedef struct
6153
6200
/******************************* SMBUS Instances ******************************/
6154
6201
#define IS_SMBUS_ALL_INSTANCE IS_I2C_ALL_INSTANCE
6155
6202
6203
+ /******************************** I2S Instances *******************************/
6204
+ #define IS_I2S_ALL_INSTANCE (INSTANCE ) (((INSTANCE) == SPI2) || \
6205
+ ((INSTANCE) == SPI3))
6206
+
6156
6207
/****************************** IWDG Instances ********************************/
6157
6208
#define IS_IWDG_ALL_INSTANCE (INSTANCE ) ((INSTANCE) == IWDG)
6158
6209
@@ -6253,8 +6304,6 @@ typedef struct
6253
6304
((INSTANCE) == TIM4) || \
6254
6305
((INSTANCE) == TIM5))
6255
6306
6256
- #define IS_TIM_SYNCHRO_INSTANCE (INSTANCE ) IS_TIM_MASTER_INSTANCE(INSTANCE)
6257
-
6258
6307
#define IS_TIM_DMABURST_INSTANCE (INSTANCE )\
6259
6308
(((INSTANCE) == TIM2) || \
6260
6309
((INSTANCE) == TIM3) || \
0 commit comments