10 #include "stm32f7xx_hal.h"
16 extern volatile char uartf
;
25 void write_byte(uint8_t b
);
27 void write_dpin(uint8_t i
, bool b
);
28 bool read_dpin(uint8_t i
);
30 void write_apin(uint8_t i
, uint8_t a
);
31 uint8_t read_apin(uint8_t i
);
34 bool input_available();
39 #define read16() 256*read_byte() + read_byte()
41 #define debug(s, ...) {\
42 sprintf(buf, "m" s "\r\n", ##__VA_ARGS__);\
43 HAL_UART_Transmit(&huart3, (uint8_t*)buf, strlen(buf), 1000);\
50 #define debug(s, ...) printf(s "\n", ##__VA_ARGS__);
52 #define debug(s, ...) ;
55 #define pdie(s) {perror(s); exit(1);}
56 #define die(s, ...) {fprintf(stderr, s "\n", ##__VA_ARGS__); exit(1);}