Lei YU | ab1327c | 2019-11-04 16:53:39 +0800 | [diff] [blame^] | 1 | #include "i2c.hpp" |
| 2 | |
| 3 | namespace i2c |
| 4 | { |
| 5 | |
| 6 | void I2CDevice::read(uint8_t& data) |
| 7 | { |
| 8 | // TODO |
| 9 | (void)data; |
| 10 | } |
| 11 | |
| 12 | void I2CDevice::read(uint8_t addr, uint8_t& data) |
| 13 | { |
| 14 | // TODO |
| 15 | (void)addr; |
| 16 | (void)data; |
| 17 | } |
| 18 | |
| 19 | void I2CDevice::read(uint8_t addr, uint16_t& data) |
| 20 | { |
| 21 | // TODO |
| 22 | (void)addr; |
| 23 | (void)data; |
| 24 | } |
| 25 | |
| 26 | void I2CDevice::read(uint8_t addr, uint8_t& size, uint8_t* data) |
| 27 | { |
| 28 | // TODO |
| 29 | (void)addr; |
| 30 | (void)size; |
| 31 | (void)data; |
| 32 | } |
| 33 | |
| 34 | void I2CDevice::write(uint8_t data) |
| 35 | { |
| 36 | // TODO |
| 37 | (void)data; |
| 38 | } |
| 39 | |
| 40 | void I2CDevice::write(uint8_t addr, uint8_t data) |
| 41 | { |
| 42 | // TODO |
| 43 | (void)addr; |
| 44 | (void)data; |
| 45 | } |
| 46 | |
| 47 | void I2CDevice::write(uint8_t addr, uint16_t data) |
| 48 | { |
| 49 | // TODO |
| 50 | (void)addr; |
| 51 | (void)data; |
| 52 | } |
| 53 | |
| 54 | void I2CDevice::write(uint8_t addr, uint8_t size, const uint8_t* data) |
| 55 | { |
| 56 | // TODO |
| 57 | (void)addr; |
| 58 | (void)size; |
| 59 | (void)data; |
| 60 | } |
| 61 | |
| 62 | std::unique_ptr<I2CInterface> I2CDevice::create(uint8_t busId, uint8_t devAddr) |
| 63 | { |
| 64 | std::unique_ptr<I2CDevice> dev(new I2CDevice(busId, devAddr)); |
| 65 | return dev; |
| 66 | } |
| 67 | |
| 68 | std::unique_ptr<I2CInterface> create(uint8_t busId, uint8_t devAddr) |
| 69 | { |
| 70 | return I2CDevice::create(busId, devAddr); |
| 71 | } |
| 72 | |
| 73 | } // namespace i2c |