arduino-emulator
Loading...
Searching...
No Matches
HardwareI2C.h
1/*
2 HardwareI2C.h - Hardware I2C interface for Arduino
3 Copyright (c) 2016 Arduino LLC. All right reserved.
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18*/
19
20#pragma once
21
22#include <inttypes.h>
23#include "Stream.h"
24
25namespace arduino {
26
27class HardwareI2C : public Stream
28{
29 public:
30 virtual void begin() = 0;
31 virtual void begin(uint8_t address) = 0;
32 virtual void end() = 0;
33
34 virtual void setClock(uint32_t freq) = 0;
35
36 virtual void beginTransmission(uint8_t address) = 0;
37 virtual uint8_t endTransmission(bool stopBit) = 0;
38 virtual uint8_t endTransmission(void) = 0;
39
40 virtual size_t requestFrom(uint8_t address, size_t len, bool stopBit) = 0;
41 virtual size_t requestFrom(uint8_t address, size_t len) = 0;
42
43 virtual void onReceive(void(*)(int)) = 0;
44 virtual void onRequest(void(*)(void)) = 0;
45};
46
47}
48
Definition DMAPool.h:103
Definition HardwareI2C.h:28
Definition Stream.h:51
We provide the WiFi class to simulate the Arduino WIFI. In in Linux we can expect that networking is ...
Definition CanMsg.cpp:31