Basic test to see if it is possible to access the low level hardware in the online compiler. It seems that it is possible. Would need much more work to get it running.

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
skyscraper
Date:
Wed Sep 12 18:22:01 2018 +0000
Commit message:
Quick test to see if it is possible to access the hardware in the embed online compiler. Seems so but havent tried running it!

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	Wed Sep 12 18:22:01 2018 +0000
@@ -0,0 +1,21 @@
+
+#include "stm32f4xx_hal.h"
+
+/*
+Use TIM2 as encoder Encoder pins on PA0 and PA1
+*/
+
+int main() {
+    
+    
+    RCC->APB1ENR |= (1U << 0U) ; // Enable TIM2 module
+    RCC->AHB1ENR |= (1U << 0U); //  enable GPIOA module
+   
+    /* TODO:
+       set up the above pins as Alternate function AF1 TIMER2
+       Setup TIM2 as quadrature encoder
+       
+          or quadrature encoder setup on F401 but with a different syntax
+          See https://github.com/kwikius/quantracker/blob/master/ground/tracker/v1/azimuth_encoder.cpp
+    */
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Sep 12 18:22:01 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e95d10626187
\ No newline at end of file