serial.h 898 B

1234567891011121314151617181920212223242526
  1. #ifndef MY_SERIAL_H
  2. #define MY_SERIAL_H
  3. #include <stdbool.h>
  4. // /////////////////////////////////////////////////////////////////
  5. // Need Soft Serial defines in config.h
  6. // /////////////////////////////////////////////////////////////////
  7. // ex.
  8. // /* Configuration of lower interface with the lower layer(hardware) of serial.c */
  9. // #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6
  10. //
  11. // /* Configuration of upper interface with the upper layer of serial.c */
  12. // #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
  13. // #define SERIAL_MASTER_BUFFER_LENGTH 1
  14. // Buffers for master - slave communication
  15. extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH];
  16. extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH];
  17. void serial_master_init(void);
  18. void serial_slave_init(void);
  19. int serial_update_buffers(void);
  20. bool serial_slave_data_corrupt(void);
  21. #endif