Untitled1
*
#ifndef STM32F103_H
#define STM32F103_H
typedef volatile unsigned char Uint8
;
typedef volatile unsigned short Uint16
;
typedef volatile unsigned long Uint32
;
#define PWR_RTCDBP ((u32)0x1<<8)
#define PWR_PVD_2V2 ((u32)0x0<<5)
#define PWR_PVD_2V3 ((u32)0x1<<5)
#define PWR_PVD_2V4 ((u32)0x2<<5)
#define PWR_PVD_2V5 ((u32)0x3<<5)
#define PWR_PVD_2V6 ((u32)0x4<<5)
#define PWR_PVD_2V7 ((u32)0x5<<5)
#define PWR_PVD_2V8 ((u32)0x6<<5)
#define PWR_PVD_2V9 ((u32)0x7<<5)
#define PWR_PVDE ((u32)0x1<<4)
#define PWR_CSBF ((u32)0x1<<3)
#define PWR_CWUF ((u32)0x1<<2)
#define PWR_PDDS ((u32)0x1<<1)
#define PWR_LPDS ((u32)0x1<<0)
#define PWR_EWUP ((u32)0x1<<8)
struct PWR_CR_BITS
{
Uint32 NC
:23;
Uint32 DBP
:1;
Uint32 PLS
:3;
Uint32 PVDE
:1;
Uint32 CSBF
:1;
Uint32 CWUF
:1;
Uint32 PDDS
:1;
Uint32 LPDS
:1;
};
union PWR_CR_REG
{
Uint32 all
;
struct PWR_CR_BITS bit
;
Page
1 of
33
Untitled1
*
};
struct PWR_CRF_BITS
{
Uint32 NC
:23;
Uint32 EWUP
:1;
Uint32 NC1
:5;
Uint32 PVDO
:1;
Uint32 SBF
:1;
Uint32 WUF
:1;
};
union PWR_CRF_REG
{
Uint32 all
;
struct PWR_CRF_BITS bit
;
};
struct PWR_REGS
{
union PWR_CR_REG cr
;
union PWR_CRF_REG crf
;
};
#define RCC_PLLRDY ((u32)0x1<<25)
#define RCC_PLLON ((u32)0x1<<24)
#define RCC_CSSON ((u32)0x1<<19)
#define RCC_CR_HSEBYP ((u32)0x1<<18)
#define RCC_HSERDY ((u32)0x1<<17)
#define RCC_HSEON ((u32)0x1<<16)
#define RCC_HSION ((u32)0x1<<1)
#define RCC_USBPRE ((u32)0x1<<22)
#define RCC_PLL_2 ((u32)0x0<<18)
#define RCC_PLL_3 ((u32)0x1<<18)
#define RCC_PLL_4 ((u32)0x2<<18)
#define RCC_PLL_5 ((u32)0x3<<18)
#define RCC_PLL_6 ((u32)0x4<<18)
#define RCC_PLL_7 ((u32)0x5<<18)
#define RCC_PLL_8 ((u32)0x6<<18)
#define RCC_PLL_9 ((u32)0x7<<18)
#define RCC_PLL_10 ((u32)0x8<<18)
#define RCC_PLL_11 ((u32)0x9<<18)
#define RCC_PLL_12 ((u32)0x10<<18)
#define RCC_PLL_13 ((u32)0x11<<18)
#define RCC_PLL_14 ((u32)0x12<<18)
#define RCC_PLL_15 ((u32)0x13<<18)
#define RCC_PLL_16 ((u32)0x14<<18)
#define RCC_PLLSource_HSE_DIV2 ((u32)0x1<<17)
#define RCC_PLLSource_HSI_DIV2 ((u32)0x1<<16)
#define RCC_PLLSource_HSE_DIV1 ((u32)0x1<<16)
Page
2 of
33
Untitled1
*
#define RCC_ADCPRE_PCLK2_DIV2 ((u32)0x0<<14)
#define RCC_ADCPRE_PCLK2_DIV4 ((u32)0x1<<14)
#define RCC_ADCPRE_PCLK2_DIV6 ((u32)0x2<<14)
#define RCC_ADCPRE_PCLK2_DIV8 ((u32)0x3<<14)
#define RCC_APB2_HCLK_DIV1 ((u32)0x0<<11)
#define RCC_APB2_HCLK_DIV2 ((u32)0x4<<11)
#define RCC_APB2_HCLK_DIV4 ((u32)0x5<<11)
#define RCC_APB2_HCLK_DIV8 ((u32)0x6<<11)
#define RCC_APB2_HCLK_DIV16 ((u32)0x7<<11)
#define RCC_APB1_HCLK_DIV1 ((u32)0x0<<8)
#define RCC_APB1_HCLK_DIV2 ((u32)0x4<<8)
#define RCC_APB1_HCLK_DIV4 ((u32)0x5<<8)
#define RCC_APB1_HCLK_DIV8 ((u32)0x6<<8)
#define RCC_APB1_HCLK_DIV16 ((u32)0x7<<8)
#define RCC_AHB_SYSCLK_DIV1 ((u32)0x0<<4)
#define RCC_AHB_SYSCLK_DIV2 ((u32)0x8<<4)
#define RCC_AHB_SYSCLK_DIV4 ((u32)0x9<<4)
#define RCC_AHB_SYSCLK_DIV8 ((u32)0xA<<4)
#define RCC_AHB_SYSCLK_DIV16 ((u32)0xB<<4)
#define RCC_AHB_SYSCLK_DIV64 ((u32)0xC<<4)
#define RCC_AHB_SYSCLK_DIV128 ((u32)0xD<<4)
#define RCC_AHB_SYSCLK_DIV256 ((u32)0xE<<4)
#define RCC_AHB_SYSCLK_DIV512 ((u32)0xF<<4)
#define RCC_SWS_SYSCLK_HSI ((u32)0x0<<2)
#define RCC_SWS_SYSCLK_HSE ((u32)0x1<<2)
#define RCC_SWS_SYSCLK_PLL ((u32)0x2<<2)
#define RCC_SW_SYSCLK_HSI ((u32)0x0<<0)
#define RCC_SW_SYSCLK_HSE ((u32)0x1<<0)
#define RCC_SW_SYSCLK_PLL ((u32)0x2<<0)
#define RCC_CSSCF ((u32)0x1<<23)
#define RCC_PLLRDYFC ((u32)0x1<<20)
#define RCC_HSERDYC ((u32)0x1<<19)
#define RCC_HSIRDYC ((u32)0x1<<18)
#define RCC_LSERDYC ((u32)0x1<<17)
#define RCC_LSIRDYC ((u32)0x1<<16)
#define RCC_PLLRDYIE ((u32)0x1<<12)
#define RCC_HSERDYIE ((u32)0x1<<11)
#define RCC_HSIRDYIE ((u32)0x1<<10)
#define RCC_LSERDYIE ((u32)0x1<<9)
#define RCC_LSIRDYIE ((u32)0x1<<8)
#define RCC_CSSF ((u32)0x1<<7)
#define RCC_PLLRDYF ((u32)0x1<<4)
Page
3 of
33
Untitled1
*
#define RCC_HSERDYF ((u32)0x1<<3)
#define RCC_HSIRDYF ((u32)0x1<<2)
#define RCC_LSERDYF ((u32)0x1<<1)
#define RCC_LSIRDYF ((u32)0x1<<0)
#define RCC_USART1RST ((u32)0x1<<14)
#define RCC_SPI1RST ((u32)0x1<<12)
#define RCC_TIM1RST ((u32)0x1<<11)
#define RCC_ADC2RST ((u32)0x1<<10)
#define RCC_ADC1RST ((u32)0x1<<9)
#define RCC_IOPERST ((u32)0x1<<6)
#define RCC_IOPDRST ((u32)0x1<<5)
#define RCC_IOPCRST ((u32)0x1<<4)
#define RCC_IOPBRST ((u32)0x1<<3)
#define RCC_IOPARST ((u32)0x1<<2)
#define RCC_AFIORST ((u32)0x1<<0)
#define RCC_PWRRST ((u32)0x1<<28)
#define RCC_BKPRST ((u32)0x1<<27)
#define RCC_CANRST ((u32)0x1<<25)
#define RCC_USBRST ((u32)0x1<<23)
#define RCC_I2C2RST ((u32)0x1<<22)
#define RCC_I2C1RST ((u32)0x1<<21)
#define RCC_USART3RST ((u32)0x1<<18)
#define RCC_USART2RST ((u32)0x1<<17)
#define RCC_SPI2RST ((u32)0x1<<14)
#define RCC_WWDGRST ((u32)0x1<<11)
#define RCC_TIM4RST ((u32)0x1<<2)
#define RCC_TIM3RST ((u32)0x1<<1)
#define RCC_TIM2RST ((u32)0x1<<0)
Page
4 of
33
Untitled1
*
#define RCC_FLITFEN ((u32)0x1<<4)
#define RCC_SRAMEN ((u32)0x1<<2)
#define RCC_DMAEN ((u32)0x1<<0)
#define RCC_USART1EN ((u32)0x1<<14)
#define RCC_SPI1EN ((u32)0x1<<12)
#define RCC_TIM1EN ((u32)0x1<<11)
#define RCC_ADC2EN ((u32)0x1<<10)
#define RCC_ADC1EN ((u32)0x1<<9)
#define RCC_IOPEEN ((u32)0x1<<6)
#define RCC_IOPDEN ((u32)0x1<<5)
#define RCC_IOPCEN ((u32)0x1<<4)
#define RCC_IOPBEN ((u32)0x1<<3)
#define RCC_IOPAEN ((u32)0x1<<2)
#define RCC_AFIOEN ((u32)0x1<<0)
#define RCC_PWREN ((u32)0x1<<28)
#define RCC_BKPEN ((u32)0x1<<27)
#define RCC_CANEN ((u32)0x1<<25)
#define RCC_USBEN ((u32)0x1<<23)
#define RCC_I2C2EN ((u32)0x1<<22)
#define RCC_I2C1EN ((u32)0x1<<21)
#define RCC_USART3EN ((u32)0x1<<18)
#define RCC_USART2EN ((u32)0x1<<17)
#define RCC_SPI2EN ((u32)0x1<<14)
#define RCC_WWDGEN ((u32)0x1<<11)
#define RCC_TIM4EN ((u32)0x1<<2)
#define RCC_TIM3EN ((u32)0x1<<1)
#define RCC_TIM2EN ((u32)0x1<<0)
Page
5 of
33
Untitled1
*
#define RCC_BDRST ((u32)0x1<<16)
#define RCC_RTCEN ((u32)0x1<<15)
#define RCC_RTCSEL_NONE ((u32)0x0<<8)
#define RCC_RTCSEL_LSE ((u32)0x1<<8)
#define RCC_RTCSEL_LSI ((u32)0x2<<8)
#define RCC_RTCSEL_HSE_DIV128 ((u32)0x3<<8)
#define RCC_LSEBYP ((u32)0x1<<2)
#define RCC_LSERDY ((u32)0x1<<1)
#define RCC_LSEON ((u32)0x1<<0)
#define RCC_LSION ((u32)0x1<<0)
struct RCC_CR_BITS
{
Uint32 Reserved0
:23;
Uint32 PLLRDY
:1;
Uint32 PLLON
:1;
Uint32 Reserved1
:4;
Uint32 CSSON
:1;
Uint32 HSEBYP
:1;
Uint32 HSERDY
:1;
Uint32 HSEON
:1;
Uint32 HSICAL
:8;
Uint32 HSITRIM
:5;
Uint32 Reserved2
:1;
Uint32 HSIRDY
:1;
Uint32 HSION
:1;
};
union RCC_CR_REG
{
Uint32 all
;
struct RCC_CR_BITS bit
;
};
struct RCC_CRFGR_BITS
{
Uint32 Reserved0
:5;
Uint32 MCO
:3;
Uint32 Reserved1
:1;
Uint32 USRPRE
:1;
Uint32 PLLMUL
:4;
Uint32 PLLXTPRE
:1;
Uint32 PLLSRC
:1;
Uint32 ADCPRE
:1;
Uint32 PPRE2
:2;
Uint32 PPRE1
:2;
Uint32 HPRE
:3;
Uint32 SWS
:2;
Uint32 SW
:2;
};
union RCC_CRFGR_REG
{
Uint32 all
;
struct RCC_CRFGR_BITS bit
;
};
Page
6 of
33
Untitled1
*
struct RCC_CIR_BITS
{
Uint32 Reserved0
:5;
Uint32 CSSC
:1;
Uint32 Reserved1
:2;
Uint32 PLLRDYC
:1;
Uint32 HSERDYC
:1;
Uint32 HSIRDYC
:1;
Uint32 LSERDYC
:1;
Uint32 LSIRDYC
:1;
Uint32 Reserved2
:2;
Uint32 PLLRDYIE
:1;
Uint32 HSERDYIE
:1;
Uint32 HSIRDYIE
:1;
Uint32 LSERDYIE
:1;
Uint32 LSIRDYIE
:1;
Uint32 CSSF
:1;
Uint32 Reserved3
:2;
Uint32 PLLRDYF
:1;
Uint32 HSERDYF
:1;
Uint32 HSIRDYF
:1;
Uint32 LSERDYF
:1;
Uint32 LSIRDYF
:1;
};
union RCC_CIR_REG
{
Uint32 all
;
struct RCC_CIR_BITS bit
;
};
struct RCC_APB2RSTR_BITS
{
Uint32 Reserved0
:17;
Uint32 USART1RST
:1;
Uint32 Reserved1
:1;
Uint32 SPI1RST
:1;
Uint32 TIM1RST
:1;
Uint32 ADC2RST
:1;
Uint32 ADC1RST
:1;
Uint32 Reserved2
:2;
Uint32 IOPERST
:1;
Uint32 IOPDRST
:1;
Uint32 IOPCRST
:1;
Uint32 IOPBRST
:1;
Uint32 IOPARST
:1;
Uint32 Reserved3
:1;
Uint32 AFIORST
:1;
};
union RCC_APB2RSTR_REG
{
Uint32 all
;
struct RCC_APB2RSTR_BITS bit
;
};
struct RCC_APB1RSTR_BITS
{
Uint32 Reserved0
:3;
Uint32 PWRRST
:1;
Uint32 BKPRST
:1;
Uint32 Reserved1
:1;
Uint32 CANRST
:1;
Uint32 Reserved2
:1;
Uint32 USBRST
:1;
Uint32 I2C2RST
:1;
Uint32 I2C1RST
:1;
Uint32 Reserved3
:2;
Uint32 USART3RST
:1;
Uint32 USART2RST
:1;
Uint32 Reserved4
:2;
Uint32 SPI2RST
:1;
Uint32 Reserved5
:2;
Uint32 WWDGRST
:1;
Uint32 Reserved6
:8;
Uint32 TIM4RST
:1;
Uint32 TIM3RST
:1;
Uint32 TIM2RST
:1;
};
union RCC_APB1RSTR_REG
{
Uint32 all
;
struct RCC_APB1RSTR_BITS bit
;
};
struct RCC_AHBENR_BITS
{
Uint32 Reserved0
:27;
Uint32 FLITFEN
:1;
Uint32 Reserved1
:1;
Uint32 SRAMEN
:1;
Uint32 Reserved2
:1;
Page
7 of
33
Untitled1
*
Uint32 DMAEN
:1;
};
union RCC_AHBENR_REG
{
Uint32 all
;
struct RCC_AHBENR_BITS bit
;
};
struct RCC_APB2ENR_BITS
{
Uint32 Reserved0
:17;
Uint32 USART1EN
:1;
Uint32 Reserved1
:1;
Uint32 SPI1EN
:1;
Uint32 TIM1EN
:1;
Uint32 ADC2EN
:1;
Uint32 ADC1EN
:1;
Uint32 Reserved2
:2;
Uint32 IOPEEN
:1;
Uint32 IOPDEN
:1;
Uint32 IOPCEN
:1;
Uint32 IOPBEN
:1;
Uint32 IOPAEN
:1;
Uint32 Reserved3
:1;
Uint32 AFIOEN
:1;
};
union RCC_APB2ENR_REG
{
Uint32 all
;
struct RCC_APB2ENR_BITS bit
;
};
struct RCC_APB1ENR_BITS
{
Uint32 Reserved0
:3;
Uint32 PWREN
:1;
Uint32 BKPEN
:1;
Uint32 Reserved1
:1;
Uint32 CANEN
:1;
Uint32 Reserved2
:1;
Uint32 USBEN
:1;
Uint32 I2C2EN
:1;
Uint32 I2C1EN
:1;
Uint32 Reserved3
:1;
Uint32 USART3EN
:1;
Uint32 USART2EN
:1;
Uint32 Reserved4
:1;
Uint32 SPI2EN
:1;
Uint32 Reserved5
:1;
Uint32 WWDGEN
:1;
Uint32 Reserved6
:1;
Uint32 TIM4EN
:1;
Uint32 TIM3EN
:1;
Uint32 TIM2EN
:1;
};
union RCC_APB1ENR_REG
{
Uint32 all
;
struct RCC_APB1ENR_BITS bit
;
};
struct RCC_BDCR_BITS
{
Uint32 Reserved0
:15;
Uint32 BDRST
:1;
Uint32 RTCEN
:1;
Uint32 Reserved1
:5;
Uint32 RTCSEL
:2;
Uint32 Reserved2
:1;
Uint32 LSEBYP
:1;
Uint32 LSERDY
:1;
Uint32 LSEON
:1;
};
union RCC_BDCR_REG
{
Uint32 all
;
struct RCC_BDCR_BITS bit
;
};
struct RCC_CSR_BITS
{
Uint32 LPWRRSTF
:1;
Uint32 WWDGRSTF
:1;
Uint32 IWDGRSTF
:1;
Uint32 SFTRSTF
:1;
Uint32 PORRSTF
:1;
Uint32 PINRSTF
:1;
Uint32 Reserved0
:1;
Uint32 RMVF
:1;
Page
8 of
33
Untitled1
*
Uint32 Reserved1
:22;
Uint32 LSIRDY
:1;
Uint32 LSION
:1;
};
union RCC_CSR_REG
{
Uint32 all
;
struct RCC_BDCR_BITS bit
;
};
struct RCC_REGS
{
union RCC_CR_REG cr
;
union RCC_CRFGR_REG crfgr
;
union RCC_CIR_REG cir
;
union RCC_APB2RSTR_REG apb2rstr
;
union RCC_APB1RSTR_REG apb1rstr
;
union RCC_AHBENR_REG ahbenr
;
union RCC_APB2ENR_REG apb2enr
;
union RCC_APB1ENR_REG apb1enr
;
union RCC_BDCR_REG bdcr
;
union RCC_CSR_REG csr
;
};
struct GPIO_CRL_BITS
{
Uint32 MODE0
:2;
Uint32 CNF0
:2;
Uint32 MODE1
:2;
Uint32 CNF1
:2;
Uint32 MODE2
:2;
Uint32 CNF2
:2;
Uint32 MODE3
:2;
Uint32 CNF3
:2;
Uint32 MODE4
:2;
Uint32 CNF4
:2;
Uint32 MODE5
:2;
Uint32 CNF5
:2;
Uint32 MODE6
:2;
Uint32 CNF6
:2;
Uint32 MODE7
:2;
Uint32 CNF7
:2;
};
union GPIO_CRL_REG
{
Uint32 all
;
struct GPIO_CRL_BITS bit
;
};
Page
9 of
33
Untitled1
*
struct GPIO_CRH_BITS
{
Uint32 MODE8
:2;
Uint32 CNF8
:2;
Uint32 MODE9
:2;
Uint32 CNF9
:2;
Uint32 MODE10
:2;
Uint32 CNF10
:2;
Uint32 MODE11
:2;
Uint32 CNF11
:2;
Uint32 MODE12
:2;
Uint32 CNF12
:2;
Uint32 MODE13
:2;
Uint32 CNF13
:2;
Uint32 MODE14
:2;
Uint32 CNF14
:2;
Uint32 MODE15
:2;
Uint32 CNF15
:2;
};
union GPIO_CRH_REG
{
Uint32 all
;
struct GPIO_CRH_BITS bit
;
};
struct GPIO_IDR_BITS
{
Uint32 Reserved0
:16;
Uint32 IDR15
:1;
Uint32 IDR14
:1;
Uint32 IDR13
:1;
Uint32 IDR12
:1;
Uint32 IDR11
:1;
Uint32 IDR10
:1;
Uint32 IDR9
:1;
Uint32 IDR8
:1;
Uint32 IDR7
:1;
Uint32 IDR6
:1;
Uint32 IDR5
:1;
Uint32 IDR4
:1;
Uint32 IDR3
:1;
Uint32 IDR2
:1;
Uint32 IDR1
:1;
Uint32 IDR0
:1;
};
union GPIO_IDR_REG
{
Uint32 all
;
struct GPIO_IDR_BITS bit
;
};
struct GPIO_ODR_BITS
{
Uint32 Reserved0
:16;
Uint32 ODR15
:1;
Uint32 ODR14
:1;
Uint32 ODR13
:1;
Uint32 ODR12
:1;
Uint32 ODR11
:1;
Uint32 ODR10
:1;
Uint32 ODR9
:1;
Uint32 ODR8
:1;
Uint32 ODR7
:1;
Uint32 ODR6
:1;
Uint32 ODR5
:1;
Uint32 ODR4
:1;
Uint32 ODR3
:1;
Uint32 ODR2
:1;
Uint32 ODR1
:1;
Uint32 ODR0
:1;
};
union GPIO_ODR_REG
{
Uint32 all
;
struct GPIO_ODR_BITS bit
;
};
Page
10 of
33
Untitled1
*
struct GPIO_BSRR_BITS
{
Uint32 BR15
:1;
Uint32 BR14
:1;
Uint32 BR13
:1;
Uint32 BR12
:1;
Uint32 BR11
:1;
Uint32 BR10
:1;
Uint32 BR9
:1;
Uint32 BR8
:1;
Uint32 BR7
:1;
Uint32 BR6
:1;
Uint32 BR5
:1;
Uint32 BR4
:1;
Uint32 BR3
:1;
Uint32 BR2
:1;
Uint32 BR1
:1;
Uint32 BR0
:1;
Uint32 BS15
:1;
Uint32 BS14
:1;
Uint32 BS13
:1;
Uint32 BS12
:1;
Uint32 BS11
:1;
Uint32 BS10
:1;
Uint32 BS9
:1;
Uint32 BS8
:1;
Uint32 BS7
:1;
Uint32 BS6
:1;
Uint32 BS5
:1;
Uint32 BS4
:1;
Uint32 BS3
:1;
Uint32 BS2
:1;
Uint32 BS1
:1;
Uint32 BS0
:1;
};
union GPIO_BSRR_REG
{
Uint32 all
;
struct GPIO_BSRR_BITS bit
;
};
struct GPIO_BRR_BITS
{
Uint32 Reserved
:16;
Uint32 BR15
:1;
Uint32 BR14
:1;
Uint32 BR13
:1;
Uint32 BR12
:1;
Uint32 BR11
:1;
Uint32 BR10
:1;
Uint32 BR9
:1;
Uint32 BR8
:1;
Uint32 BR7
:1;
Uint32 BR6
:1;
Uint32 BR5
:1;
Uint32 BR4
:1;
Uint32 BR3
:1;
Uint32 BR2
:1;
Uint32 BR1
:1;
Uint32 BR0
:1;
};
union GPIO_BRR_REG
{
Uint32 all
;
struct GPIO_BRR_BITS bit
;
};
struct GPIO_LCKR_BITS
{
Uint32 Reserved
:15;
Uint32 LCKK
:1;
Uint32 LCK15
:1;
Uint32 LCK14
:1;
Uint32 LCK13
:1;
Uint32 LCK12
:1;
Uint32 LCK11
:1;
Uint32 LCK10
:1;
Page
11 of
33
Untitled1
*
Uint32 LCK9
:1;
Uint32 LCK8
:1;
Uint32 LCK7
:1;
Uint32 LCK6
:1;
Uint32 LCK5
:1;
Uint32 LCK4
:1;
Uint32 LCK3
:1;
Uint32 LCK2
:1;
Uint32 LCK1
:1;
Uint32 LCK0
:1;
};
union GPIO_LCKR_REG
{
Uint32 all
;
struct GPIO_LCKR_BITS bit
;
};
struct GPIO_REGS
{
union GPIO_CRL_REG crl
;
union GPIO_CRH_REG crh
;
union GPIO_IDR_REG idr
;
union GPIO_ODR_REG odr
;
union GPIO_BSRR_REG bsrr
;
union GPIO_BRR_REG brr
;
union GPIO_LCKR_REG lckr
;
};
struct AFIO_EVCR_BITS
{
Uint32 Reserved0
:24;
Uint32 EVOE
:1;
Uint32 PORT
:3;
Uint32 PIN
:4;
};
union AFIO_EVCR_REG
{
Uint32 all
;
struct AFIO_EVCR_BITS bit
;
};
Page
12 of
33
Untitled1
*
struct AFIO_MAPR_BITS
{
Uint32 Reserved0
:5;
Uint32 SWJ_CFG
:3;
Uint32 Reserved1
:8;
Uint32 PD01_REMAP
:1;
Uint32 CAN_REMAP
:2;
Uint32 TIM4_REMAP
:1;
Uint32 TIM3_REMAP
:2;
Uint32 TIM2_REMAP
:2;
Uint32 TIM1_REMAP
:2;
Uint32 USART3_REMAP
:2;
Uint32 USART2_REMAP
:1;
Uint32 USART1_REMAP
:1;
Uint32 I2C1_REMAP
:1;
Uint32 SPI1_REMAP
:1;
};
union AFIO_MAPR_REG
{
Uint32 all
;
struct AFIO_MAPR_BITS bit
;
};
struct AFIO_EXTICR_BITS
{
Uint32 Reserved0
:16;
Uint32 EXTI3
:4;
Uint32 EXTI2
:1;
Uint32 EXTI1
:1;
Uint32 EXTI0
:1;
};
union AFIO_EXTICR_REG
{
Uint32 all
;
struct AFIO_EXTICR_BITS bit
;
};
struct AFIO_EXTICR1_BITS
{
Uint32 Reserved0
:16;
Uint32 EXTI3
:4;
Uint32 EXTI2
:1;
Uint32 EXTI1
:1;
Uint32 EXTI0
:1;
};
Page
13 of
33
Untitled1
*
union AFIO_EXTICR1_REG
{
Uint32 all
;
struct AFIO_EXTICR1_BITS bit
;
};
struct AFIO_EXTICR2_BITS
{
Uint32 Reserved0
:16;
Uint32 EXTI7
:4;
Uint32 EXTI6
:1;
Uint32 EXTI5
:1;
Uint32 EXTI4
:1;
};
union AFIO_EXTICR2_REG
{
Uint32 all
;
struct AFIO_EXTICR2_BITS bit
;
};
struct AFIO_EXTICR3_BITS
{
Uint32 Reserved0
:16;
Uint32 EXTI11
:4;
Uint32 EXTI10
:1;
Uint32 EXTI9
:1;
Uint32 EXTI8
:1;
};
union AFIO_EXTICR3_REG
{
Uint32 all
;
struct AFIO_EXTICR3_BITS bit
;
};
struct AFIO_EXTICR4_BITS
{
Uint32 Reserved0
:16;
Uint32 EXTI15
:4;
Uint32 EXTI14
:1;
Uint32 EXTI13
:1;
Uint32 EXTI12
:1;
};
union AFIO_EXTICR4_REG
{
Uint32 all
;
struct AFIO_EXTICR4_BITS bit
;
};
struct AFIO_REGS
{
union AFIO_EVCR_REG evcr
;
union AFIO_MAPR_REG mapr
;
union AFIO_EXTICR_REG exticr
[4] ;
};
struct EXTI_IMR_BITS
{
Uint32 Reserved0
:13;
Uint32 MR18
:1;
Page
14 of
33
Untitled1
*
Uint32 MR17
:1;
Uint32 MR16
:1;
Uint32 MR15
:1;
Uint32 MR14
:1;
Uint32 MR13
:1;
Uint32 MR12
:1;
Uint32 MR11
:1;
Uint32 MR10
:1;
Uint32 MR9
:1;
Uint32 MR8
:1;
Uint32 MR7
:1;
Uint32 MR6
:1;
Uint32 MR5
:1;
Uint32 MR4
:1;
Uint32 MR3
:1;
Uint32 MR2
:1;
Uint32 MR1
:1;
Uint32 MR0
:1;
};
union EXTI_IMR_REG
{
Uint32 all
;
struct EXTI_IMR_BITS bit
;
};
struct EXTI_EMR_BITS
{
Uint32 Reserved0
:13;
Uint32 MR18
:1;
Uint32 MR17
:1;
Uint32 MR16
:1;
Uint32 MR15
:1;
Uint32 MR14
:1;
Uint32 MR13
:1;
Uint32 MR12
:1;
Uint32 MR11
:1;
Uint32 MR10
:1;
Uint32 MR9
:1;
Uint32 MR8
:1;
Uint32 MR7
:1;
Uint32 MR6
:1;
Uint32 MR5
:1;
Uint32 MR4
:1;
Uint32 MR3
:1;
Uint32 MR2
:1;
Uint32 MR1
:1;
Uint32 MR0
:1;
};
union EXTI_EMR_REG
{
Uint32 all
;
struct EXTI_EMR_BITS bit
;
};
struct EXTI_RTSR_BITS
{
Uint32 Reserved0
:13;
Uint32 TR18
:1;
Uint32 TR17
:1;
Uint32 TR16
:1;
Uint32 TR15
:1;
Uint32 TR14
:1;
Uint32 TR13
:1;
Uint32 TR12
:1;
Uint32 TR11
:1;
Uint32 TR10
:1;
Uint32 TR9
:1;
Uint32 TR8
:1;
Uint32 TR7
:1;
Uint32 TR6
:1;
Uint32 TR5
:1;
Uint32 TR4
:1;
Uint32 TR3
:1;
Uint32 TR2
:1;
Uint32 TR1
:1;
Uint32 TR0
:1;
};
Page
15 of
33
Untitled1
*
union EXTI_RTSR_REG
{
Uint32 all
;
struct EXTI_RTSR_BITS bit
;
};
struct EXTI_FTSR_BITS
{
Uint32 Reserved0
:13;
Uint32 TR18
:1;
Uint32 TR17
:1;
Uint32 TR16
:1;
Uint32 TR15
:1;
Uint32 TR14
:1;
Uint32 TR13
:1;
Uint32 TR12
:1;
Uint32 TR11
:1;
Uint32 TR10
:1;
Uint32 TR9
:1;
Uint32 TR8
:1;
Uint32 TR7
:1;
Uint32 TR6
:1;
Uint32 TR5
:1;
Uint32 TR4
:1;
Uint32 TR3
:1;
Uint32 TR2
:1;
Uint32 TR1
:1;
Uint32 TR0
:1;
};
union EXTI_FTSR_REG
{
Uint32 all
;
struct EXTI_FTSR_BITS bit
;
};
struct EXTI_SWIER_BITS
{
Uint32 Reserved0
:13;
Uint32 SWIER18
:1;
Uint32 SWIER17
:1;
Uint32 SWIER16
:1;
Uint32 SWIER15
:1;
Uint32 SWIER14
:1;
Uint32 SWIER13
:1;
Uint32 SWIER12
:1;
Uint32 SWIER11
:1;
Uint32 SWIER10
:1;
Uint32 SWIER9
:1;
Uint32 SWIER8
:1;
Uint32 SWIER7
:1;
Uint32 SWIER6
:1;
Uint32 SWIER5
:1;
Uint32 SWIER4
:1;
Uint32 SWIER3
:1;
Uint32 SWIER2
:1;
Uint32 SWIER1
:1;
Uint32 SWIER0
:1;
};
union EXTI_SWIER_REG
{
Uint32 all
;
struct EXTI_SWIER_BITS bit
;
};
struct EXTI_PR_BITS
{
Uint32 Reserved0
:13;
Uint32 PR18
:1;
Page
16 of
33
Untitled1
*
Uint32 PR17
:1;
Uint32 PR16
:1;
Uint32 PR15
:1;
Uint32 PR14
:1;
Uint32 PR13
:1;
Uint32 PR12
:1;
Uint32 PR11
:1;
Uint32 PR10
:1;
Uint32 PR9
:1;
Uint32 PR8
:1;
Uint32 PR7
:1;
Uint32 PR6
:1;
Uint32 PR5
:1;
Uint32 PR4
:1;
Uint32 PR3
:1;
Uint32 PR2
:1;
Uint32 PR1
:1;
Uint32 PR0
:1;
};
union EXTI_PR_REG
{
Uint32 all
;
struct EXTI_PR_BITS bit
;
};
struct EXTI_REGS
{
union EXTI_IMR_REG imr
;
union EXTI_EMR_REG emr
;
union EXTI_RTSR_REG rtsr
;
union EXTI_FTSR_REG ftsr
;
union EXTI_SWIER_REG swier
;
union EXTI_PR_REG pr
;
};
struct DMA_ISR_BITS
{
Uint32 Reserved0
:4;
Uint32 TEIF7
:1;
Uint32 HTIF7
:1;
Uint32 TCIF7
:1;
Uint32 GIF7
:1;
Uint32 TEIF6
:1;
Uint32 HTIF6
:1;
Uint32 TCIF6
:1;
Uint32 GIF6
:1;
Uint32 TEIF5
:1;
Uint32 HTIF5
:1;
Uint32 TCIF5
:1;
Uint32 GIF5
:1;
Uint32 TEIF4
:1;
Uint32 HTIF4
:1;
Uint32 TCIF4
:1;
Uint32 GIF4
:1;
Uint32 TEIF3
:1;
Uint32 HTIF3
:1;
Uint32 TCIF3
:1;
Uint32 GIF3
:1;
Uint32 TEIF2
:1;
Uint32 HTIF2
:1;
Uint32 TCIF2
:1;
Uint32 GIF2
:1;
Uint32 TEIF1
:1;
Uint32 HTIF1
:1;
Uint32 TCIF1
:1;
Uint32 GIF1
:1;
};
union DMA_ISR_REG
{
Uint32 all
;
struct DMA_ISR_BITS bit
;
};
Page
17 of
33
Untitled1
*
struct DMA_IFCR_BITS
{
Uint32 Reserved0
:4;
Uint32 CTEIF7
:1;
Uint32 CHTIF7
:1;
Uint32 CTCIF7
:1;
Uint32 CGIF7
:1;
Uint32 CTEIF6
:1;
Uint32 CHTIF6
:1;
Uint32 CTCIF6
:1;
Uint32 CGIF6
:1;
Uint32 CTEIF5
:1;
Uint32 CHTIF5
:1;
Uint32 CTCIF5
:1;
Uint32 CGIF5
:1;
Uint32 CTEIF4
:1;
Uint32 CHTIF4
:1;
Uint32 CTCIF4
:1;
Uint32 CGIF4
:1;
Uint32 CTEIF3
:1;
Uint32 CHTIF3
:1;
Uint32 CTCIF3
:1;
Uint32 CGIF3
:1;
Uint32 CTEIF2
:1;
Uint32 CHTIF2
:1;
Uint32 CTCIF2
:1;
Uint32 CGIF2
:1;
Uint32 CTEIF1
:1;
Uint32 CHTIF1
:1;
Uint32 CTCIF1
:1;
Uint32 CGIF1
:1;
};
union DMA_IFCR_REG
{
Uint32 all
;
struct DMA_IFCR_BITS bit
;
};
struct DMA_CCR_BITS
{
Uint32 Reserved0
:17;
Uint32 MEM2MEM
:1;
Uint32 PL
:2;
Uint32 MSIZE
:2;
Uint32 PSIZE
:2;
Uint32 MINC
:1;
Uint32 PINC
:1;
Uint32 CIRC
:1;
Uint32 DIR
:1;
Uint32 TEIE
:1;
Uint32 HTIE
:1;
Uint32 TCIE
:1;
Uint32 EN
:1;
};
union DMA_CCR_REG
{
Uint32 all
;
struct DMA_CCR_BITS bit
;
};
struct DMA_CNDTR_BITS
{
Uint32 Reserved0
:16;
Uint32 NDT
:16;
};
union DMA_CNDTR_REG
{
Page
18 of
33
Untitled1
*
Uint32 all
;
struct DMA_CNDTR_BITS bit
;
};
struct DMA_CPAR_BITS
{
Uint32 CPAR
:32;
};
union DMA_CPAR_REG
{
Uint32 all
;
struct DMA_CPAR_BITS bit
;
};
struct DMA_CMAR_BITS
{
Uint32 CMAR
:32;
};
union DMA_CMAR_REG
{
Uint32 all
;
struct DMA_CMAR_BITS bit
;
};
struct DMA_REGS
{
union DMA_ISR_REG isr
;
union DMA_IFCR_REG ifcr
;
};
struct DMA_CHANNEL_REGS
{
union DMA_CCR_REG ccr
;
union DMA_CNDTR_REG cndtr
;
union DMA_CPAR_REG cpar
;
union DMA_CMAR_REG cmar
;
};
struct RTC_CRH_BITS
{
Uint16 Reserved0
:13;
Uint16 OWIE
:1;
Uint16 ALRIE
:1;
Uint16 SECIE
:1;
};
union RTC_CRH_REG
{
Uint16 all
;
struct RTC_CRH_BITS bit
;
};
struct RTC_CRL_BITS
{
Uint16 Reserved0
:10;
Uint16 RTOFF
:1;
Uint16 CNF
:1;
Uint16 RSF
:1;
Uint16 OWF
:1;
Uint16 ALRF
:1;
Uint16 SECF
:1;
};
union RTC_CRL_REG
{
Uint16 all
;
struct RTC_CRL_BITS bit
;
};
Page
19 of
33
Untitled1
*
struct RTC_PRLH_BITS
{
Uint16 Reserved0
:12;
Uint16 PRLH
:4;
};
union RTC_PRLH_REG
{
Uint16 all
;
struct RTC_PRLH_BITS bit
;
};
struct RTC_PRLL_BITS
{
Uint16 PRLL
:16;
};
union RTC_PRLL_REG
{
Uint16 all
;
struct RTC_PRLL_BITS bit
;
};
struct RTC_DIVH_BITS
{
Uint16 Reserved0
:12;
Uint16 DIVH
:4;
};
union RTC_DIVH_REG
{
Uint16 all
;
struct RTC_DIVH_BITS bit
;
};
struct RTC_DIVL_BITS
{
Uint16 DIVL
:16;
};
union RTC_DIVL_REG
{
Uint16 all
;
struct RTC_DIVL_BITS bit
;
};
struct RTC_CNTH_BITS
{
Uint16 CNTH
:16;
};
union RTC_CNTH_REG
{
Uint16 all
;
struct RTC_CNTH_BITS bit
;
};
struct RTC_CNTL_BITS
{
Uint16 CNTL
:16;
};
union RTC_CNTL_REG
{
Uint16 all
;
struct RTC_CNTL_BITS bit
;
};
struct RTC_ALRH_BITS
{
Uint16 ALRH
:16;
};
Page
20 of
33
Untitled1
*
union RTC_ALRH_REG
{
Uint16 all
;
struct RTC_ALRH_BITS bit
;
};
struct RTC_ALRL_BITS
{
Uint16 ALRL
:16;
};
union RTC_ALRL_REG
{
Uint16 all
;
struct RTC_ALRL_BITS bit
;
};
struct RTC_REGS
{
union RTC_CRH_REG crh
;
u16 Reserved0
;
union RTC_CRL_REG crl
;
u16 Reserved1
;
union RTC_PRLH_REG prlh
;
u16 Reserved2
;
union RTC_PRLL_REG prll
;
u16 Reserved3
;
union RTC_DIVH_REG divh
;
u16 Reserved4
;
union RTC_DIVL_REG divl
;
u16 Reserved5
;
union RTC_CNTH_REG cnth
;
u16 Reserved6
;
union RTC_CNTL_REG cntl
;
u16 Reserved7
;
union RTC_ALRH_REG alrh
;
u16 Reserved8
;
union RTC_ALRL_REG alrl
;
u16 Reserved9
;
};
struct BKP_DR_BITS
{
Uint16 DR
:16;
};
union BKP_DR_REG
{
Uint16 all
;
struct BKP_DR_BITS bit
;
};
struct BKP_RTCCR_BITS
{
Uint16 Reserved0
:6;
Uint16 ASOS
:1;
Uint16 ASOE
:1;
Uint16 CCO
:1;
Uint16 CAL
:7;
};
union BKP_RTCCR_REG
{
Uint16 all
;
struct BKP_RTCCR_BITS bit
;
};
struct BKP_CR_BITS
{
Uint16 Reserved0
:14;
Uint16 TPAL
:1;
Page
21 of
33
Untitled1
*
Uint16 TPE
:1;
};
union BKP_CR_REG
{
Uint16 all
;
struct BKP_CR_BITS bit
;
};
struct BKP_CSR_BITS
{
Uint16 Reserved0
:6;
Uint16 TIFL
:1;
Uint16 TEF
:1;
Uint16 Reserved1
:5;
Uint16 TPIE
:1;
Uint16 CTI
:1;
Uint16 CTE
:1;
};
union BKP_CSR_REG
{
Uint16 all
;
struct BKP_CSR_BITS bit
;
};
struct BKP_REGS
{
u32 Reserved0
;
union BKP_DR_REG dr1
;
u16 Reserved1
;
union BKP_DR_REG dr2
;
u16 Reserved2
;
union BKP_DR_REG dr3
;
u16 Reserved3
;
union BKP_DR_REG dr4
;
u16 Reserved4
;
union BKP_DR_REG dr5
;
u16 Reserved5
;
union BKP_DR_REG dr6
;
u16 Reserved6
;
union BKP_DR_REG dr7
;
u16 Reserved7
;
union BKP_DR_REG dr8
;
u16 Reserved8
;
union BKP_DR_REG dr9
;
u16 Reserved9
;
union BKP_DR_REG dr10
;
u16 Reserved10
;
union BKP_RTCCR_REG rtccr
;
u16 Reserved11
;
union BKP_CR_REG cr
;
u16 Reserved12
;
union BKP_CSR_REG csr
;
u16 Reserved13
;
};
struct IWDG_KR_BITS
{
Uint32 Reserved0
:16;
Uint32 KEY
:16;
};
union IWDG_KR_REG
{
Uint32 all
;
struct IWDG_KR_BITS bit
;
};
Page
22 of
33
Untitled1
*
struct IWDG_PR_BITS
{
Uint32 Reserved0
:29;
Uint32 PR
:3;
};
union IWDG_PR_REG
{
Uint32 all
;
struct IWDG_PR_BITS bit
;
};
struct IWDG_RLR_BITS
{
Uint32 Reserved0
:20;
Uint32 RLR
:12;
};
union IWDG_RLR_REG
{
Uint32 all
;
struct IWDG_RLR_BITS bit
;
};
struct IWDG_SR_BITS
{
Uint32 Reserved0
:30;
Uint32 RVU
:1;
Uint32 PVU
:1;
};
union IWDG_SR_REG
{
Uint32 all
;
struct IWDG_SR_BITS bit
;
};
struct IWDG_REGS
{
union IWDG_KR_REG kr
;
union IWDG_PR_REG pr
;
union IWDG_RLR_REG rlr
;
union IWDG_SR_REG sr
;
};
struct WWDG_CR_BITS
{
Uint32 Reserved0
:24;
Uint32 WDGA
:1;
Uint32 T
:6;
};
union WWDG_CR_REG
{
Uint32 all
;
struct WWDG_CR_BITS bit
;
};
struct WWDG_CFR_BITS
{
Uint32 Reserved0
:22;
Uint32 EWI
:1;
Uint32 WDGTB
:2;
Uint32 W
:7;
};
union WWDG_CFR_REG
{
Page
23 of
33
Untitled1
*
Uint32 all
;
struct WWDG_CFR_BITS bit
;
};
struct WWDG_SR_BITS
{
Uint32 Reserved0
:31;
Uint32 EWIF
:1;
};
union WWDG_SR_REG
{
Uint32 all
;
struct WWDG_SR_BITS bit
;
};
struct WWDG_REGS
{
union WWDG_CR_REG cr
;
union WWDG_CFR_REG cfr
;
union WWDG_SR_REG sr
;
};
struct TIM1_CR1_BITS
{
Uint16 Reserved0
:6;
Uint16 CKD
:2;
Uint16 ARPE
:1;
Uint16 CMS
:1;
Uint16 DIR
:1;
Uint16 OPM
:1;
Uint16 URS
:1;
Uint16 UDIS
:1;
Uint16 CEN
:1;
};
union TIM1_CR1_REG
{
Uint16 all
;
struct TIM1_CR1_BITS bit
;
};
struct TIM1_CR2_BITS
{
Uint16 Reserved0
:1;
Uint16 OIS4
:1;
Uint16 OIS3N
:1;
Uint16 OIS3
:1;
Uint16 OIS2N
:1;
Uint16 OIS2
:1;
Uint16 OIS1N
:1;
Uint16 OIS1
:1;
Uint16 TI1S
:1;
Uint16 MMS
:3;
Uint16 CCDS
:1;
Uint16 CCUS
:1;
Uint16 Reserved1
:1;
Uint16 CEN
:1;
};
union TIM1_CR2_REG
{
Uint16 all
;
struct TIM1_CR2_BITS bit
;
};
struct TIM1_SMCR_BITS
{
Uint16 ETP
:1;
Page
24 of
33
Untitled1
*
Uint16 CEC
:1;
Uint16 ETPS
:2;
Uint16 ETF
:4;
Uint16 MSM
:1;
Uint16 TS
:3;
Uint16 Reserved1
:1;
Uint16 SMS
:3;
};
union TIM1_SMCR_REG
{
Uint16 all
;
struct TIM1_SMCR_BITS bit
;
};
struct TIM1_DIER_BITS
{
Uint16 Reserved0
:1;
Uint16 TDE
:1;
Uint16 COMDE
:1;
Uint16 CC4DE
:1;
Uint16 CC3DE
:1;
Uint16 CC2DE
:1;
Uint16 CC1DE
:1;
Uint16 UDE
:1;
Uint16 BIE
:1;
Uint16 TIE
:1;
Uint16 CCMIE
:1;
Uint16 CC4IE
:1;
Uint16 CC3IE
:1;
Uint16 CC2IE
:1;
Uint16 CC1IE
:1;
Uint16 UIE
:1;
};
union TIM1_DIER_REG
{
Uint16 all
;
struct TIM1_DIER_BITS bit
;
};
struct TIM1_SR_BITS
{
Uint16 Reserved0
:3;
Uint16 CC4OF
:1;
Uint16 CC3OF
:1;
Uint16 CC2OF
:1;
Uint16 CC1OF
:1;
Uint16 Reserved1
:1;
Uint16 BIF
:1;
Uint16 TIF
:1;
Uint16 COMIF
:1;
Uint16 CC4IF
:1;
Uint16 CC3IF
:1;
Uint16 CC2IF
:1;
Uint16 CC1IF
:1;
Uint16 UIF
:1;
};
union TIM1_SR_REG
{
Uint16 all
;
struct TIM1_SR_BITS bit
;
};
struct TIM1_EGR_BITS
{
Uint16 Reserved0
:8;
Uint16 BG
:1;
Uint16 TG
:1;
Uint16 COMG
:1;
Uint16 CC4G
:1;
Uint16 CC3G
:1;
Uint16 CC2G
:1;
Uint16 CC1G
:1;
Uint16 UG
:1;
};
union TIM1_EGR_REG
{
Uint16 all
;
Page
25 of
33
Untitled1
*
struct TIM1_EGR_BITS bit
;
};
struct TIM1_CCMR1_OU_BITS
{
Uint16 OC2CE
:1;
Uint16 OC2M
:3;
Uint16 OC2PE
:1;
Uint16 CC2FE
:1;
Uint16 CC2S
:2;
Uint16 COC1CE
:1;
Uint16 OC1M
:3;
Uint16 OC1PE
:1;
Uint16 OC1FE
:1;
Uint16 CC1S
:2;
};
struct TIM1_CCMR1_IN_BITS
{
Uint16 ICF2
:4;
Uint16 IC2PSC
:2;
Uint16 CC2S
:2;
Uint16 IC1F
:4;
Uint16 C1PSC
:2;
Uint16 CC1S
:2;
};
union TIM1_CCMR1_REG
{
Uint16 all
;
struct TIM1_CCMR1_OU_BITS ou_bit
;
struct TIM1_CCMR1_IN_BITS in_bit
;
};
struct TIM1_CCMR2_OU_BITS
{
Uint16 OC4CE
:1;
Uint16 OC4M
:3;
Uint16 OC4PE
:1;
Uint16 OC4FE
:1;
Uint16 CC4S
:2;
Uint16 OC3CE
:1;
Uint16 OC3M
:3;
Uint16 OC3PE
:1;
Uint16 OC3FE
:1;
Uint16 CC3S
:2;
};
struct TIM1_CCMR2_IN_BITS
{
Uint16 IC4F
:4;
Uint16 IC4PSC
:2;
Uint16 CC4S
:2;
Uint16 IC3F
:4;
Uint16 IC3PSC
:2;
Uint16 CC3S
:2;
};
union TIM1_CCMR2_REG
{
Uint16 all
;
struct TIM1_CCMR2_OU_BITS ou_bit
;
struct TIM1_CCMR2_IN_BITS in_bit
;
};
struct TIM1_CCER_BITS
{
Uint16 Reserved0
:2;
Uint16 CC4P
:1;
Uint16 CC4E
:1;
Uint16 CC3NP
:1;
Uint16 CC3NE
:1;
Uint16 CC3P
:1;
Uint16 CC3E
:1;
Uint16 CC2NP
:1;
Uint16 CC2NE
:1;
Uint16 CC2P
:1;
Uint16 CC2E
:1;
Uint16 CC1NP
:1;
Uint16 CC1NE
:1;
Page
26 of
33
Untitled1
*
Uint16 CC1P
:1;
Uint16 CC1E
:1;
};
union TIM1_CCER_REG
{
Uint16 all
;
struct TIM1_CCER_BITS bit
;
};
struct TIM1_CNT_BITS
{
Uint16 CNT
:16;
};
union TIM1_CNT_REG
{
Uint16 all
;
struct TIM1_CNT_BITS bit
;
};
struct TIM1_PSC_BITS
{
Uint16 PSC
:16;
};
union TIM1_PSC_REG
{
Uint16 all
;
struct TIM1_PSC_BITS bit
;
};
struct TIM1_ARR_BITS
{
Uint16 ARR
:16;
};
union TIM1_ARR_REG
{
Uint16 all
;
struct TIM1_ARR_BITS bit
;
};
struct TIM1_RCR_BITS
{
Uint16 Reserved0
:8;
Uint16 RCR
:8;
};
union TIM1_RCR_REG
{
Uint16 all
;
struct TIM1_RCR_BITS bit
;
};
struct TIM1_CCR_BITS
{
Uint16 CCR
:16;
};
union TIM1_CCR_REG
{
Uint16 all
;
struct TIM1_CCR_BITS bit
;
};
struct TIM1_BDTR_BITS
{
Uint16 MOE
:1;
Uint16 AOE
:1;
Uint16 BKP
:1;
Uint16 BKE
:1;
Uint16 OSSR
:1;
Page
27 of
33
Untitled1
*
Uint16 OSSI
:1;
Uint16 LOCK
:2;
Uint16 DTG
:8;
};
union TIM1_BDTR_REG
{
Uint16 all
;
struct TIM1_BDTR_BITS bit
;
};
struct TIM1_DCR_BITS
{
Uint16 Reserved0
:3;
Uint16 DBL
:5;
Uint16 Reserved1
:3;
Uint16 DBA
:8;
};
union TIM1_DCR_REG
{
Uint16 all
;
struct TIM1_DCR_BITS bit
;
};
struct TIM1_DMAR_BITS
{
Uint16 DMAB
:16;
};
union TIM1_DMAR_REG
{
Uint16 all
;
struct TIM1_DMAR_BITS bit
;
};
struct TIM1_REGS
{
union TIM1_CR1_REG cr1
;
u16 Reserved0
;
union TIM1_CR2_REG cr2
;
u16 Reserved1
;
union TIM1_SMCR_REG smcr
;
u16 Reserved2
;
union TIM1_DIER_REG dier
;
u16 Reserved3
;
union TIM1_SR_REG sr
;
u16 Reserved4
;
union TIM1_EGR_REG egr
;
u16 Reserved5
;
union TIM1_CCMR1_REG ccmr1
;
u16 Reserved6
;
union TIM1_CCMR2_REG ccmr2
;
u16 Reserved7
;
union TIM1_CCER_REG ccer
;
u16 Reserved8
;
union TIM1_CNT_REG cnt
;
u16 Reserved9
;
union TIM1_PSC_REG psc
;
u16 Reserved10
;
union TIM1_ARR_REG arr
;
u16 Reserved11
;
union TIM1_RCR_REG rcr
;
u16 Reserved12
;
union TIM1_CCR_REG ccr1
;
u16 Reserved13
;
union TIM1_CCR_REG ccr2
;
u16 Reserved14
;
union TIM1_CCR_REG ccr3
;
u16 Reserved15
;
union TIM1_CCR_REG ccr4
;
u16 Reserved16
;
union TIM1_BDTR_REG bdtr
;
u16 Reserved17
;
union TIM1_DCR_REG dcr
;
u16 Reserved18
;
union TIM1_DMAR_REG dmar
;
u16 Reserved19
;
};
Page
28 of
33
Untitled1
*
struct TIM_CR1_BITS
{
Uint16 Reserved0
:6;
Uint16 CKD
:2;
Uint16 ARPE
:1;
Uint16 CMS
:1;
Uint16 DIR
:1;
Uint16 OPM
:1;
Uint16 URS
:1;
Uint16 UDIS
:1;
Uint16 CEN
:1;
};
union TIM_CR1_REG
{
Uint16 all
;
struct TIM_CR1_BITS bit
;
};
struct TIM_CR2_BITS
{
Uint16 Reserved0
:1;
Uint16 TI1S
:1;
Uint16 MMS
:3;
Uint16 CCDS
:1;
Uint16 Reserved1
:1;
};
union TIM_CR2_REG
{
Uint16 all
;
struct TIM_CR2_BITS bit
;
};
struct TIM_SMCR_BITS
{
Uint16 ETP
:1;
Uint16 CEC
:1;
Uint16 ETPS
:2;
Uint16 ETF
:4;
Uint16 MSM
:1;
Uint16 TS
:3;
Uint16 Reserved1
:1;
Uint16 SMS
:3;
};
union TIM_SMCR_REG
{
Uint16 all
;
struct TIM_SMCR_BITS bit
;
};
struct TIM_DIER_BITS
{
Uint16 Reserved0
:1;
Uint16 TDE
:1;
Uint16 Reserved1
:1;
Uint16 CC4DE
:1;
Uint16 CC3DE
:1;
Uint16 CC2DE
:1;
Uint16 CC1DE
:1;
Uint16 UDE
:1;
Uint16 Reserved2
:1;
Uint16 TIE
:1;
Uint16 Reserved3
:1;
Uint16 CC4IE
:1;
Uint16 CC3IE
:1;
Uint16 CC2IE
:1;
Uint16 CC1IE
:1;
Uint16 UIE
:1;
};
union TIM_DIER_REG
{
Uint16 all
;
Page
29 of
33
Untitled1
*
struct TIM_DIER_BITS bit
;
};
struct TIM_SR_BITS
{
Uint16 Reserved0
:3;
Uint16 CC4OF
:1;
Uint16 CC3OF
:1;
Uint16 CC2OF
:1;
Uint16 CC1OF
:1;
Uint16 Reserved1
:2;
Uint16 TIF
:1;
Uint16 Reserved2
:1;
Uint16 CC4IF
:1;
Uint16 CC3IF
:1;
Uint16 CC2IF
:1;
Uint16 CC1IF
:1;
Uint16 UIF
:1;
};
union TIM_SR_REG
{
Uint16 all
;
struct TIM_SR_BITS bit
;
};
struct TIM_EGR_BITS
{
Uint16 Reserved0
:9;
Uint16 TG
:1;
Uint16 Reserved1
:1;
Uint16 CC4G
:1;
Uint16 CC3G
:1;
Uint16 CC2G
:1;
Uint16 CC1G
:1;
Uint16 UG
:1;
};
union TIM_EGR_REG
{
Uint16 all
;
struct TIM_EGR_BITS bit
;
};
struct TIM_CCMR1_OU_BITS
{
Uint16 OC2CE
:1;
Uint16 OC2M
:3;
Uint16 OC2PE
:1;
Uint16 CC2FE
:1;
Uint16 CC2S
:2;
Uint16 COC1CE
:1;
Uint16 OC1M
:3;
Uint16 OC1PE
:1;
Uint16 OC1FE
:1;
Uint16 CC1S
:2;
};
struct TIM_CCMR1_IN_BITS
{
Uint16 ICF2
:4;
Uint16 IC2PSC
:2;
Uint16 CC2S
:2;
Uint16 IC1F
:4;
Uint16 C1PSC
:2;
Uint16 CC1S
:2;
};
union TIM_CCMR1_REG
{
Uint16 all
;
struct TIM_CCMR1_OU_BITS ou_bit
;
struct TIM_CCMR1_IN_BITS in_bit
;
};
struct TIM_CCMR2_OU_BITS
{
Uint16 OC4CE
:1;
Page
30 of
33
Untitled1
*
Uint16 OC4M
:3;
Uint16 OC4PE
:1;
Uint16 OC4FE
:1;
Uint16 CC4S
:2;
Uint16 OC3CE
:1;
Uint16 OC3M
:3;
Uint16 OC3PE
:1;
Uint16 OC3FE
:1;
Uint16 CC3S
:2;
};
struct TIM_CCMR2_IN_BITS
{
Uint16 IC4F
:4;
Uint16 IC4PSC
:2;
Uint16 CC4S
:2;
Uint16 IC3F
:4;
Uint16 IC3PSC
:2;
Uint16 CC3S
:2;
};
union TIM_CCMR2_REG
{
Uint16 all
;
struct TIM_CCMR2_OU_BITS ou_bit
;
struct TIM_CCMR2_IN_BITS in_bit
;
};
struct TIM_CCER_BITS
{
Uint16 Reserved0
:2;
Uint16 CC4P
:1;
Uint16 CC4E
:1;
Uint16 Reserved1
:2;
Uint16 CC3P
:1;
Uint16 CC3E
:1;
Uint16 Reserved2
:2;
Uint16 CC2P
:1;
Uint16 CC2E
:1;
Uint16 Reserved3
:2;
Uint16 CC1P
:1;
Uint16 CC1E
:1;
};
union TIM_CCER_REG
{
Uint16 all
;
struct TIM_CCER_BITS bit
;
};
struct TIM_CNT_BITS
{
Uint16 CNT
:16;
};
union TIM_CNT_REG
{
Uint16 all
;
struct TIM_CNT_BITS bit
;
};
struct TIM_PSC_BITS
{
Uint16 PSC
:16;
};
union TIM_PSC_REG
{
Uint16 all
;
struct TIM_PSC_BITS bit
;
};
struct TIM_ARR_BITS
{
Uint16 ARR
:16;
};
Page
31 of
33
Untitled1
*
union TIM_ARR_REG
{
Uint16 all
;
struct TIM_ARR_BITS bit
;
};
struct TIM_CCR_BITS
{
Uint16 CCR
:16;
};
union TIM_CCR_REG
{
Uint16 all
;
struct TIM_CCR_BITS bit
;
};
struct TIM_DCR_BITS
{
Uint16 Reserved0
:3;
Uint16 DBL
:5;
Uint16 Reserved1
:3;
Uint16 DBA
:8;
};
union TIM_DCR_REG
{
Uint16 all
;
struct TIM_DCR_BITS bit
;
};
struct TIM_DMAR_BITS
{
Uint16 DMAB
:16;
};
union TIM_DMAR_REG
{
Uint16 all
;
struct TIM_DMAR_BITS bit
;
};
struct TIM_REGS
{
union TIM_CR1_REG cr1
;
u16 Reserved0
;
union TIM_CR2_REG cr2
;
u16 Reserved1
;
union TIM_SMCR_REG smcr
;
u16 Reserved2
;
union TIM_DIER_REG dier
;
u16 Reserved3
;
union TIM_SR_REG sr
;
u16 Reserved4
;
union TIM_EGR_REG egr
;
u16 Reserved5
;
union TIM_CCMR1_REG ccmr1
;
u16 Reserved6
;
union TIM_CCMR2_REG ccmr2
;
u16 Reserved7
;
union TIM_CCER_REG ccer
;
u16 Reserved8
;
union TIM_CNT_REG cnt
;
u16 Reserved9
;
union TIM_PSC_REG psc
;
u16 Reserved10
;
union TIM_ARR_REG arr
;
u16 Reserved11
[3] ;
union TIM_CCR_REG ccr1
;
u16 Reserved12
;
union TIM_CCR_REG ccr2
;
u16 Reserved13
;
union TIM_CCR_REG ccr3
;
u16 Reserved14
;
union TIM_CCR_REG ccr4
;
u16 Reserved15
[3] ;
union TIM_DCR_REG dcr
;
u16 Reserved16
;
union TIM_DMAR_REG dmar
;
u16 Reserved17
;
};
Page
32 of
33
Untitled1
*
Page
33 of
33