CART
  • Cart is empty.

    ItemQuantityPrice

    Total: $0

Control single pin and delay test


Control single pin #14 on GPIOD with delay in 1ms.

Toolkit:STM Development System

Location:/bipom/devtools/STM32/examples/delay

Code Example


int main(void)
{
	delayMs(250);
	
	tprintf("\n\rMini-Max/STM32F1");
	tprintf("\n\rDelay Function Test REV 1.01");

	GPIO_InitTypeDef  GPIO_InitStructure;
  	//

    RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD, ENABLE);
    /*!< Configure SD Card power pin */
	GPIO_InitStructure.GPIO_Pin = GPIO_Pin_14;
  	GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz;
  	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
  	GPIO_Init(GPIOD, &GPIO_InitStructure);
  	
  	for (;;)
  	{
  		delayMs(1);
		GPIO_ResetBits(GPIOD, GPIO_Pin_14);
		delayMs(1);
		GPIO_SetBits(GPIOD, GPIO_Pin_14);
	}
}