You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
1.1 KiB

  1. // Copyright 2021 Nick Brassel (@tzarc)
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include <stdbool.h>
  5. #include <stdlib.h>
  6. #include "qp_internal.h"
  7. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  8. // Base comms APIs
  9. bool qp_comms_init(painter_device_t device);
  10. bool qp_comms_start(painter_device_t device);
  11. void qp_comms_stop(painter_device_t device);
  12. uint32_t qp_comms_send(painter_device_t device, const void* data, uint32_t byte_count);
  13. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  14. // Comms APIs that use a D/C pin
  15. void qp_comms_command(painter_device_t device, uint8_t cmd);
  16. void qp_comms_command_databyte(painter_device_t device, uint8_t cmd, uint8_t data);
  17. uint32_t qp_comms_command_databuf(painter_device_t device, uint8_t cmd, const void* data, uint32_t byte_count);
  18. void qp_comms_bulk_command_sequence(painter_device_t device, const uint8_t* sequence, size_t sequence_len);