STM32F30xx Standard Peripheral Library
Variable types
Specific variable types are already defined with a fixed type and size. These types are
defined in the file stm32f30x.h
typedef enum {
RESET = 0,
SET = !RESET
}
FlagStatus, ITStatus;
typedef enum {
DISABLE = 0,
ENABLE = !DISABLE
}
FunctionalState;
typedef enum {
ERROR = 0,
SUCCESS = !ERROR
}
ErrorStatus;
Peripherals
Pointers to peripherals are used to access the peripheral control registers. They point to
data structures that represent the mapping of the peripheral control registers.
Peripheral registers structure
stm32f30x.h contains the definition of all peripheral register structures. The example below
illustrates the SPI register structure declaration:
"/*------------------ Serial Peripheral Interface ---------------*/
typedef struct
{
__IO uint16_t CR1;
I2S mode), Address offset: 0x00 */
uint16_t
*/
__IO uint16_t CR2;
offset: 0x04 */
uint16_t
*/
__IO uint16_t SR;
0x08
uint16_t
*/
__IO uint16_t DR;
0x0C
uint16_t
*/
__IO uint16_t CRCPR;
used in I2S mode), Address offset: 0x10 */
uint16_t
*/
__IO uint16_t RXCRCR;
mode),Address offset: 0x14 */
uint16_t
16/584
RESERVED0;/*!< Reserved, 0x02
RESERVED1;/*!< Reserved, 0x06
*/
RESERVED2;/*!< Reserved, 0x0A
*/
RESERVED3;/*!< Reserved, 0x0E
RESERVED4;/*!< Reserved, 0x12
RESERVED5;/*!< Reserved, 0x16 */
DocID023800 Rev 1
/*!< SPI control register 1 (not used in
/*!< SPI control register 2, Address
/*!< SPI status register, Address offset:
/*!< SPI data register,Address offset:
/*!< SPI CRC polynomial register (not
/*!< SPI RX CRC register (not used in I2S
UM1581
Need help?
Do you have a question about the STM32F31xx and is the answer not in the manual?