Skip to content

Commit 3b01fde

Browse files
committed
x
1 parent df5345b commit 3b01fde

11 files changed

Lines changed: 75 additions & 40 deletions

alt_arduinocore_api/api/ArduinoAPI.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <zephyr/drivers/gpio.h>
1313

1414
#include "api/HardwareSerial.h"
15-
#include "common_types.h"
1615

1716
#define lowByte(w) ((uint8_t) ((w) & 0xff))
1817
#define highByte(w) ((uint8_t) ((w) >> 8))

alt_arduinocore_api/idl/proto/arduino_opts.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,6 @@ extend google.protobuf.ServiceOptions {
3535
string service_impl_class_name = 50214;
3636
string api_member_name = 50215;
3737
repeated string base_services = 50216;
38+
string ifc_header_name = 50217;
39+
repeated string extra_includes = 50218;
3840
}

alt_arduinocore_api/idl/proto/client.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import "google/protobuf/empty.proto";
1313
import "google/protobuf/wrappers.proto";
1414

1515
service Client {
16+
option (arduino.extra_includes) = "api/IPAddress.h";
17+
1618
rpc ConnectAddress(google.protobuf.Empty) returns (google.protobuf.Empty) {
1719
option (arduino.cpp_decl) = "int connect(IPAddress ip, uint16_t port)";
1820
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) 2026 TOKITA Hiroshi
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
syntax = "proto3";
8+
9+
package arduino.idl;
10+
11+
enum PinStatus {
12+
LOW = 0;
13+
HIGH = 1;
14+
CHANGE = 2;
15+
FALLING = 3;
16+
RISING = 4;
17+
}
18+
19+
enum PinMode {
20+
INPUT = 0;
21+
OUTPUT = 1;
22+
INPUT_PULLUP = 2;
23+
INPUT_PULLDOWN = 3;
24+
OUTPUT_OPENDRAIN = 4;
25+
}
26+
27+
enum BitOrder {
28+
LSBFIRST = 0;
29+
MSBFIRST = 1;
30+
}
31+
32+
enum IPType {
33+
IPv4 = 0;
34+
IPv6 = 1;
35+
}

alt_arduinocore_api/idl/proto/hardware_can.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ enum CanBitRate {
2121
}
2222

2323
service HardwareCAN {
24+
option (arduino.extra_includes) = "api/HardwareCAN.h";
25+
2426
rpc Begin(google.protobuf.Empty) returns (google.protobuf.BoolValue) {
2527
option (arduino.cpp_decl) = "bool begin(CanBitRate const can_bitrate)";
2628
}

alt_arduinocore_api/idl/proto/hardware_i2c.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import "google/protobuf/empty.proto";
77
import "google/protobuf/wrappers.proto";
88

99
service HardwareI2C {
10+
option (arduino.ifc_header_name) = "hardware_i2c_ifc.hpp";
11+
1012
rpc Begin(google.protobuf.Empty) returns (google.protobuf.Empty) {
1113
option (arduino.cpp_decl) = "void begin()";
1214
}

alt_arduinocore_api/idl/proto/hardware_spi.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ enum SPIBusMode {
2525
}
2626

2727
service HardwareSPI {
28+
option (arduino.extra_includes) = "api/HardwareSPI.h";
29+
2830
rpc Transfer(google.protobuf.UInt32Value) returns (google.protobuf.UInt32Value) {
2931
option (arduino.cpp_decl) = "uint8_t transfer(uint8_t data)";
3032
}

alt_arduinocore_api/idl/proto/pluggable_usb_module.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import "google/protobuf/empty.proto";
1313
import "google/protobuf/wrappers.proto";
1414

1515
service PluggableUSBModule {
16+
option (arduino.extra_includes) = "api/PluggableUSB.h";
17+
1618
rpc Setup(google.protobuf.Empty) returns (google.protobuf.BoolValue) {
1719
option (arduino.cpp_decl) = "bool setup(USBSetup& setup)";
1820
}

alt_arduinocore_api/idl/proto/printable.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import "google/protobuf/empty.proto";
1313
import "google/protobuf/wrappers.proto";
1414

1515
service Printable {
16+
option (arduino.extra_includes) = "api/Print.h";
17+
1618
rpc PrintTo(google.protobuf.Empty) returns (google.protobuf.UInt64Value) {
1719
option (arduino.cpp_decl) = "size_t printTo(Print& p) const";
1820
}

alt_arduinocore_api/idl/proto/udp.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import "google/protobuf/empty.proto";
1313
import "google/protobuf/wrappers.proto";
1414

1515
service UDP {
16+
option (arduino.extra_includes) = "api/IPAddress.h";
17+
1618
rpc Begin(google.protobuf.UInt32Value) returns (google.protobuf.UInt32Value) {
1719
option (arduino.cpp_decl) = "uint8_t begin(uint16_t port)";
1820
}

0 commit comments

Comments
 (0)