10 #include "stm32f7xx_hal.h"
15 #define SET_LED_RED GPIOB->BSRR = GPIO_PIN_14
16 #define RESET_LED_RED GPIOB->BSRR = GPIO_PIN_14 << 16
18 #define SET_LED_BLUE GPIOB->BSRR = GPIO_PIN_7
19 #define RESET_LED_BLUE GPIOB->BSRR = GPIO_PIN_7 << 16
21 #define SET_LED_GREEN GPIOB->BSRR = GPIO_PIN_0
22 #define RESET_LED_GREEN GPIOB->BSRR = GPIO_PIN_0 << 16
34 void write_byte(uint8_t b
);
36 void write_dpin(uint8_t i
, bool b
);
37 bool read_dpin(uint8_t i
);
39 void write_apin(uint8_t i
, uint8_t a
);
40 uint8_t read_apin(uint8_t i
);
43 bool input_available();
48 #define read16() 256*read_byte() + read_byte()
50 #define debug(s, ...) ;
51 //#define debug(s, ...) {\
52 // sprintf(buf, "m" s "\n", ##__VA_ARGS__);\
53 // for(int _i = 0; _i<strlen(buf); _i++){\
54 // write_byte(buf[_i]);\
62 #define debug(s, ...) printf(s "\n", ##__VA_ARGS__);
64 #define debug(s, ...) ;
67 #define pdie(s) {perror(s); exit(1);}
68 #define die(s, ...) {fprintf(stderr, s "\n", ##__VA_ARGS__); exit(1);}