Files
libpigpio/pigi2c.h
2025-08-05 22:33:23 +02:00

52 lines
1.1 KiB
C++

/*****************************************************************************
source::worx libPiGPio
Copyright © 2022 c.holzheuer
chris@sourceworx.org
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Uses:
pigpiod_if2 by joan2937, pigpio @ abyz.me.uk
https://abyz.me.uk/rpi/pigpio
sigslot by 2017 Pierre-Antoine Lacaze
https://github.com/palacaze/sigslot
***************************************************************************/
#ifndef PIGI2C_H
#define PIGI2C_H
#include <libpigpio.h>
#include <pigi2c.h>
using namespace pigpio;
struct LIBPIGPIO_EXPORT pigI2C
{
i2c_addr_t addr = 0;
i2c_bus_t bus = 1;
uint32_t handle = 0;
pigI2C();
explicit pigI2C( i2c_addr_t, i2c_bus_t = 1 );
virtual ~pigI2C();
void init( i2c_addr_t, i2c_bus_t = 1 );
int i2c_write_device( char* buf, unsigned count );
//void dump();
};
#endif // PIGI2C_H