add external libraries and update stm version
[mTask.git] / int / nucleo-f767-blinky / src / interface.c
index 2f7fb57..96077b0 100644 (file)
@@ -32,6 +32,7 @@
 //Globals
 #ifdef STM32F767xx
 volatile char uartf = 0;
+char buf[128];
 #else
 struct timeval tv1;
 int sock_fd = -1;
@@ -78,7 +79,7 @@ long millis() {
 
 bool input_available(){
 #ifdef STM32F767xx
-       return false;
+       return true;
 #else
        struct timeval tv;
        fd_set fds;
@@ -112,6 +113,55 @@ void write_byte(uint8_t b)
 #endif
 }
 
+void write_dpin(uint8_t i, bool b)
+{
+#ifdef STM32F767xx
+#else
+       debug("dwrite %d: %d\n", i, b);
+#endif
+}
+
+bool read_dpin(uint8_t i)
+{
+#ifdef STM32F767xx
+       return false;
+#else
+       debug("dread %d\n", i);
+       return false;
+#endif
+}
+
+void write_apin(uint8_t i, uint8_t a)
+{
+#ifdef STM32F767xx
+       if(i == 1){
+               SET_LED_RED;
+               RESET_LED_BLUE;
+               RESET_LED_GREEN;
+       } else if(i == 2){
+               RESET_LED_RED;
+               SET_LED_BLUE;
+               RESET_LED_GREEN;
+       } else if(i == 3){
+               RESET_LED_RED;
+               RESET_LED_BLUE;
+               SET_LED_GREEN;
+       }
+#else
+       debug("awrite %d: %d\n", i, a);
+#endif
+}
+
+uint8_t read_apin(uint8_t i)
+{
+#ifdef STM32F767xx
+       return 0;
+#else
+       debug("aread %d\n", i);
+       return 0;
+#endif
+}
+
 void delay(long ms)
 {
 #ifdef STM32F767xx