sarathikannan
Newbie level 2
Good Noon,
I need arm& c coding examples.where i can get it...please give me some links to download it
I need arm& c coding examples.where i can get it...please give me some links to download it
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 #include "stm32f4xx.h" //#include "stm32f4xx_gpio.h" void Delay(__IO uint32_t nCount); __IO uint32_t i; __IO uint32_t Del_val = 3000000; int main() { RCC->AHB1RSTR |= RCC_AHB1RSTR_GPIODRST; // Reset GPIOD to ensure reset values exist RCC->AHB1RSTR = 0; // Exit reset state RCC->AHB1ENR |= RCC_AHB1ENR_GPIODEN | RCC_AHB1ENR_GPIOAEN; // Enable GPIOD clock GPIOD->MODER |= GPIO_MODER_MODER12_0 | GPIO_MODER_MODER13_0 | // Enable output mode for D12-D15 GPIO_MODER_MODER14_0 | GPIO_MODER_MODER15_0; GPIOD->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR12_1 | GPIO_OSPEEDER_OSPEEDR13_1 | GPIO_OSPEEDER_OSPEEDR14_1 | GPIO_OSPEEDER_OSPEEDR15_1; GPIOA->PUPDR |= GPIO_PUPDR_PUPDR0_1; //GPIO_PUPDR_PUPDR0_1 ((uint32_t)0x00000002) = 10: Pull-down while(1) { if(GPIOA->IDR &= GPIO_IDR_IDR_0 != 0) { for(i = 0; i < 3; i++) { GPIOD->ODR ^= GPIO_BSRR_BS_15; // GPIOD->BSRRL = GPIO_BSRR_BS_12; Delay(Del_val); GPIOD->ODR ^= GPIO_BSRR_BS_14; Delay(Del_val); GPIOD->ODR ^= GPIO_BSRR_BS_13; Delay(Del_val); GPIOD->ODR ^= GPIO_BSRR_BS_12; } } } } void Delay(__IO uint32_t nCount) { while(nCount--) { } }