Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 0:0dd8ec2326be, committed 2016-03-18
- Comitter:
- daz
- Date:
- Fri Mar 18 11:33:16 2016 +0000
- Commit message:
- Blinky project that makes use of direct register access.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Mar 18 11:33:16 2016 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+
+int main(){
+ volatile int i;
+
+ /* Enable RCC GPIOA clock */
+ *((uint32_t*)0x40023830) |= (1<<0);
+
+ /* Set PA5 as digital output */
+ *((uint32_t*)0x40020000) |= (1<<10);
+
+ while(1) {
+ /* PA5 on */
+ *((uint32_t*)0x40020014) |= (1<<5);
+
+ /* Delay */
+ for(i = 5000000; i; i--);
+
+ /* PA5 off */
+ *((uint32_t*)0x40020014) &= ~(1<<5);
+
+ /* Delay */
+ for(i = 5000000; i; i--);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Mar 18 11:33:16 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/c0f6e94411f5 \ No newline at end of file