#include #include #include #include #include "bus.h" #ifdef __linux__ #define PIN_DATA 2 #define PIN_CLK 3 #define PIN_ACK 4 int data[3]={0}; #include "io.h" int main() { bus_t bus; pthread_t thread; FILE* file = NULL; setup_io(); bus_init_recv(&bus, PIN_DATA, PIN_CLK, PIN_ACK); init_read_pin(PIN_DATA, PIN_CLK, PIN_ACK); pthread_create(&thread, NULL, bus_recv_thread, &bus); while(1) { uint32_t c; char buffer[16]; bus_read(&bus, &c, 4); printf("%ld' s %ld ms %'d us \n", c/1000000, c%1000000/1000, c%1000); } } #endif