printer_receive.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // SPDX-License-Identifier: BSD-2-Clause
  2. // Copyright (c) 2024 KBEmbedded
  3. #ifndef PRINTER_RECEIVE_H
  4. #define PRINTER_RECEIVE_H
  5. #pragma once
  6. /**
  7. * Start a printer instance in receive mode
  8. *
  9. * Allows devices to send image data to the flipper
  10. *
  11. * @note Once printer_receive_start() is called, some printer instance settings
  12. * can no longer be modified, e.g. the Game Boy Link pinout.
  13. *
  14. * @param printer_handle Printer instance handle
  15. */
  16. void printer_receive_start(void *printer_handle);
  17. /**
  18. * Mark a received print as printed/completed
  19. *
  20. * Once a print command is actually received, the printer instance callback
  21. * is called with the print reason. The printer instance will continually
  22. * report that it is in the printing state until this function is called.
  23. * At which time, the image is considered printed, and this updated status
  24. * is returned on the next status check.
  25. *
  26. * @warning Once this function is called, the struct gb_image pointer given to the
  27. * printer instance callback should be considered no longer valid! It is advised
  28. * complete operations on the struct gb_image (or copy its contents to another
  29. * buffer) before calling this function.
  30. *
  31. * @param printer_handle Printer instance handle
  32. */
  33. void printer_receive_print_complete(void *printer_handle);
  34. #endif // PRINTER_RECEIVE_H