parent
cf29b4b4c6
commit
2d39a5595d
@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
"files.associations": {
|
|
||||||
"array": "cpp",
|
|
||||||
"atomic": "cpp",
|
|
||||||
"*.tcc": "cpp",
|
|
||||||
"cctype": "cpp",
|
|
||||||
"clocale": "cpp",
|
|
||||||
"cmath": "cpp",
|
|
||||||
"cstdarg": "cpp",
|
|
||||||
"cstddef": "cpp",
|
|
||||||
"cstdint": "cpp",
|
|
||||||
"cstdio": "cpp",
|
|
||||||
"cstdlib": "cpp",
|
|
||||||
"cwchar": "cpp",
|
|
||||||
"cwctype": "cpp",
|
|
||||||
"deque": "cpp",
|
|
||||||
"unordered_map": "cpp",
|
|
||||||
"vector": "cpp",
|
|
||||||
"exception": "cpp",
|
|
||||||
"algorithm": "cpp",
|
|
||||||
"functional": "cpp",
|
|
||||||
"iterator": "cpp",
|
|
||||||
"memory": "cpp",
|
|
||||||
"memory_resource": "cpp",
|
|
||||||
"numeric": "cpp",
|
|
||||||
"optional": "cpp",
|
|
||||||
"random": "cpp",
|
|
||||||
"string": "cpp",
|
|
||||||
"string_view": "cpp",
|
|
||||||
"system_error": "cpp",
|
|
||||||
"tuple": "cpp",
|
|
||||||
"type_traits": "cpp",
|
|
||||||
"utility": "cpp",
|
|
||||||
"fstream": "cpp",
|
|
||||||
"initializer_list": "cpp",
|
|
||||||
"iosfwd": "cpp",
|
|
||||||
"iostream": "cpp",
|
|
||||||
"istream": "cpp",
|
|
||||||
"limits": "cpp",
|
|
||||||
"new": "cpp",
|
|
||||||
"ostream": "cpp",
|
|
||||||
"sstream": "cpp",
|
|
||||||
"stdexcept": "cpp",
|
|
||||||
"streambuf": "cpp",
|
|
||||||
"typeinfo": "cpp"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,47 +0,0 @@
|
|||||||
#ifndef _I2CDUMMY_HPP_
|
|
||||||
#define _I2CDUMMY_HPP_
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
struct I2CDummy : I2C<I2CDummy>
|
|
||||||
{
|
|
||||||
uint8_t readByteImpl(const uint8_t& address, const uint8_t& reg)
|
|
||||||
{
|
|
||||||
std::cout << "readByte for address: " << +address << " and reg: " << +reg << std::endl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint16_t readWordImpl(const uint8_t& address, const uint8_t& reg)
|
|
||||||
{
|
|
||||||
std::cout << "readWord for address: " << +address << " and reg: " << +reg << std::endl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t writeByteImpl(const uint8_t& address, const uint8_t& data)
|
|
||||||
{
|
|
||||||
std::cout << "writeByte for address: " << +address << " and data: " << +data << std::endl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t writeWordImpl(const uint8_t& address, const uint8_t& reg, const uint8_t& data)
|
|
||||||
{
|
|
||||||
std::cout << "readByte for address: " << +address << " , reg: " << +reg << " and data: " << + data << std::endl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void writeBufferImpl(const uint8_t& address, const uint8_t* buffer, uint8_t len)
|
|
||||||
{
|
|
||||||
std::cout << "I2C writeBuffer to address: " << +address << std::endl;
|
|
||||||
for(uint8_t i = 0; i < len; i++) {
|
|
||||||
std::cout << +buffer[i] << std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void readBufferImpl(const uint8_t& address, const uint8_t* buffer, uint8_t len)
|
|
||||||
{
|
|
||||||
std::cout << "I2C readBuffer" << std::endl;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif // _I2CDUMMY_HPP_
|
|
@ -1,15 +0,0 @@
|
|||||||
#ifndef __PINPC_HPP__
|
|
||||||
#define __PINPC_HPP__
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
struct Pin_PC : Pin<Pin_PC>
|
|
||||||
{
|
|
||||||
void writeImpl(bool logic)
|
|
||||||
{
|
|
||||||
std::cout << "PC pin set to " << logic << std::endl;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif // __PINPC_HPP__
|
|
@ -1,28 +0,0 @@
|
|||||||
#ifndef _SPIDUMMY_HPP_
|
|
||||||
#define _SPIDUMMY_HPP_
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
//#include "../../interfaces/spi.hpp"
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
struct SPI_dummy : SPI<SPI_dummy>
|
|
||||||
{
|
|
||||||
uint8_t trx_u8Impl(const uint8_t& data)
|
|
||||||
{
|
|
||||||
std::cout << "spi trx: tx " << data << " rx: " << +0 << std::endl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void txImpl(const uint8_t& data)
|
|
||||||
{
|
|
||||||
std::cout << "spi tx: " << +data << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t rxImpl()
|
|
||||||
{
|
|
||||||
std::cout << "spi rx: " << +1 << std::endl;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // _SPIDUMMY_HPP_
|
|
@ -1,15 +0,0 @@
|
|||||||
#ifndef __PINRASPBERRY_HPP__
|
|
||||||
#define __PINRASPBERRY_HPP__
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
struct Pin_Raspberry : Pin<Pin_Raspberry>
|
|
||||||
{
|
|
||||||
void writeImpl(bool logic)
|
|
||||||
{
|
|
||||||
std::cout << "Raspberry pin set to " << logic << std::endl;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif // __PINRASPBERRY_HPP__
|
|
@ -1,12 +0,0 @@
|
|||||||
#include "driver.hpp"
|
|
||||||
|
|
||||||
Driver::Driver(i2c_write_buffer_t& i2cWB) : i2cWriteBuffer(i2cWB)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Driver::doSomething()
|
|
||||||
{
|
|
||||||
uint8_t a[] = {1,2,3,4};
|
|
||||||
i2cWriteBuffer(0x00,a,sizeof(a));
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
#ifndef _DRIVER_HPP_
|
|
||||||
#define _DRIVER_HPP_
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
struct Driver
|
|
||||||
{
|
|
||||||
typedef void (i2c_write_buffer_t) (const uint8_t& , const uint8_t* , uint8_t );
|
|
||||||
Driver(i2c_write_buffer_t& i2cWB) : i2cWriteBuffer(i2cWB)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void doSomething();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
i2c_write_buffer_t& i2cWriteBuffer;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // _DRIVER_HPP_
|
|
Loading…
Reference in new issue