Mercurial > lcfOS
comparison python/c3/examples/burn.c3 @ 271:cf7d5fb7d9c8
Reorganization
author | Windel Bouwman |
---|---|
date | Tue, 20 Aug 2013 18:56:02 +0200 |
parents | python/stm32f4/burn.c3@225f444019b1 |
children |
comparison
equal
deleted
inserted
replaced
270:cdc76d183bcc | 271:cf7d5fb7d9c8 |
---|---|
1 /* | |
2 | |
3 This file blinks a LED on the STM32F4 discovery board. | |
4 | |
5 the board has 4 leds on PD12, PD13, PD14 and PD15 | |
6 | |
7 */ | |
8 | |
9 package burn; | |
10 | |
11 import stm32f4xx; | |
12 | |
13 /* | |
14 function void init() | |
15 { | |
16 } | |
17 */ | |
18 | |
19 function void main() | |
20 { | |
21 //init(); | |
22 var RCC_Type RCC; | |
23 RCC = cast<RCC_Type>(0x40023800); | |
24 | |
25 // Enable the clock to port D: | |
26 RCC->AHB1ENR = RCC->AHB1ENR | (1 << 3); | |
27 // Memory mapped control registers: | |
28 var GPIO_Type GPIOD; | |
29 GPIOD = cast<GPIO_Type>(0x40020C00); | |
30 | |
31 var int pin; | |
32 pin = 15; | |
33 // PD13 == output (01) | |
34 GPIOD->MODER = (1 << (pin << 1)); | |
35 GPIOD->ODR = (1 << pin); | |
36 | |
37 while(true) {} | |
38 } | |
39 |