qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

qp_comms_i2c.h (937B)


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