Simple single-color 8x8x8 LED Cube with AVRs
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

serial.h 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * POSIX compatible serial port library
  3. * Uses 8 databits, no parity, 1 stop bit, no handshaking
  4. * By: Thomas Buck <taucher.bodensee@gmail.com>
  5. * Visit: www.xythobuz.org
  6. *
  7. * serial.h
  8. *
  9. * Copyright 2012 Thomas Buck <xythobuz@me.com>
  10. *
  11. * This file is part of LED-Cube.
  12. *
  13. * LED-Cube is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU General Public License as published by
  15. * the Free Software Foundation, either version 3 of the License, or
  16. * (at your option) any later version.
  17. *
  18. * LED-Cube is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU General Public License
  24. * along with LED-Cube. If not, see <http://www.gnu.org/licenses/>.
  25. */
  26. // Use POSIX Baud constants (B2400, B9600...)
  27. #define BAUD B38400
  28. // Open pseudo terminal. Return name of slave on success, NULL on error.
  29. char *serialOpen(void);
  30. // Write to port. Returns number of characters sent, -1 on error
  31. ssize_t serialWrite(char *data, size_t length);
  32. // Read from port. Return number of characters read, 0 if none available, -1 on error
  33. ssize_t serialRead(char *data, size_t length);
  34. // Close the serial Port
  35. void serialClose(void);