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
686 B
25 lines
686 B
#include <stdint.h>
|
|
#include <iostream>
|
|
#include <string>
|
|
|
|
class I2C_Driver
|
|
{
|
|
public:
|
|
I2C_Driver();
|
|
std::string readByte(const uint8_t& address, const uint8_t& reg);
|
|
uint16_t readWord(const uint8_t& address, const uint8_t& reg);
|
|
|
|
bool writeByte(const uint8_t& address, const uint8_t& reg, const uint8_t& data); // retuns 0 when a sucsessful transation ocures
|
|
bool writeWord(const uint8_t& address, const uint8_t& reg, const uint16_t& data); // retuns 0 when a sucsessful transation ocures
|
|
|
|
private:
|
|
/* unsigned char device_address;
|
|
unsigned char device_reg;
|
|
unsigned char send_buffer[100];
|
|
unsigned char recieve_buffer[100];
|
|
unsigned char blocks;
|
|
*/
|
|
};
|
|
|
|
|