logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

qp_comms_i2c.h (937B)


  1. // Copyright 2022 Nick Brassel (@tzarc)
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #ifdef QUANTUM_PAINTER_I2C_ENABLE
  5. # include <stdint.h>
  6. # include "gpio.h"
  7. # include "qp_internal.h"
  8. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  9. // Base I2C support
  10. typedef struct qp_comms_i2c_config_t {
  11. uint8_t chip_address;
  12. } qp_comms_i2c_config_t;
  13. bool qp_comms_i2c_init(painter_device_t device);
  14. bool qp_comms_i2c_start(painter_device_t device);
  15. uint32_t qp_comms_i2c_send_data(painter_device_t device, const void* data, uint32_t byte_count);
  16. void qp_comms_i2c_stop(painter_device_t device);
  17. extern const painter_comms_with_command_vtable_t i2c_comms_cmddata_vtable;
  18. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  19. #endif // QUANTUM_PAINTER_I2C_ENABLE