Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

hocarm

🎯
Focusing
View GitHub Profile
View Blink_Light_4.c
View Blink_Light_3.c
View Blink_Light_5.c
View RCC.c
RCC_APB1PeriphClockCmd(uint32_t RCC_APB1PERIPH , FunctionalState NewState);
RCC_APB2PeriphClockCmd(uint32_t RCC_APB2PERIPH , FunctionalState NewState);
RCC_AHBPeriphClockCmd(uint32_t RCC_AHBPERIPH , FunctionalState NewState);
View RCC_GPIOAB.c
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB , ENABLE);
View PC9_Config.c
// see stm32f10x_gpio.h
GPIO_InitTypeDef GPIO_InitStructure;
GPIO_StructInit (& GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_Init(GPIOC , &GPIO_InitStructure);
View GPIO_WriteBit.c
GPIO_WriteBit(GPIOC , GPIO_Pin_9 , x); // x is Bit_SET or Bit_RESET
View GPIO_Init.c
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_Init(GPIOA , &GPIO_InitStructure);
View GPIO_ReadInput.c
GPIO_ReadInputDataBit(GPIOA , GPIO_Pin_0);
View GPIO_TypeDef_v.c
typedef struct
{
volatile uint32_t CRL;
volatile uint32_t CRH;
volatile uint32_t IDR;
volatile uint32_t ODR;
volatile uint32_t BSRR;
volatile uint32_t BRR;
volatile uint32_t LCKR;
} GPIO_TypeDef;