Skip to content

Commit 8fb5bef

Browse files
committed
Update hal for 2027
1 parent ddb4c5a commit 8fb5bef

26 files changed

+68
-388
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#pragma once
2+
3+
#include <pybind11/pybind11.h>
4+
5+
#include "hal/DriverStationTypes.h"
6+
7+
namespace pybind11 {
8+
9+
template <>
10+
struct format_descriptor<HAL_JoystickPOV> {
11+
static constexpr const char c = 'B';
12+
static constexpr const char value[2] = {c, '\0'};
13+
static std::string format() { return std::string(1, c); }
14+
};
15+
16+
}

subprojects/robotpy-hal/pyproject.toml

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ scan_headers_ignore = [
4343
"hal/DMA.h",
4444
"hal/Errors.h",
4545
"hal/HAL.h",
46+
"hal/IMU.h",
47+
"hal/IMUTypes.h",
48+
"hal/SystemServer.h",
4649
"hal/UsageReporting.h",
4750
"hal/Types.h",
4851
"hal/Value.h",
@@ -58,6 +61,8 @@ scan_headers_ignore = [
5861
"hal/handles/LimitedHandleResource.h",
5962
"hal/handles/UnlimitedHandleResource.h",
6063

64+
"hal/proto/*",
65+
6166
"hal/roborio/HMB.h",
6267
"hal/roborio/InterruptManager.h",
6368

@@ -68,30 +73,28 @@ scan_headers_ignore = [
6873
"hal/simulation/SimCallbackRegistry.h",
6974
"hal/simulation/SimDataValue.h",
7075

76+
# TODO: might want this in the future
77+
"mrc/*",
78+
79+
"src/ds_types_fmt.h",
7180
"sim_cb.h",
7281
"sim_value_cb.h",
7382
]
7483

7584
[tool.semiwrap.extension_modules."hal._wpiHal"]
7685
name = "wpihal"
7786
wraps = ["robotpy-native-wpihal"]
78-
depends = ["wpiutil"]
87+
depends = ["wpiutil", "ntcore"]
7988

8089
[tool.semiwrap.extension_modules."hal._wpiHal".headers]
8190
# hal
82-
Accelerometer = "hal/Accelerometer.h"
8391
AddressableLED = "hal/AddressableLED.h"
8492
AddressableLEDTypes = "hal/AddressableLEDTypes.h"
85-
AnalogAccumulator = "hal/AnalogAccumulator.h"
86-
AnalogGyro = "hal/AnalogGyro.h"
8793
AnalogInput = "hal/AnalogInput.h"
88-
AnalogOutput = "hal/AnalogOutput.h"
89-
AnalogTrigger = "hal/AnalogTrigger.h"
9094
CAN = "hal/CAN.h"
9195
CANAPI = "hal/CANAPI.h"
9296
CANAPITypes = "hal/CANAPITypes.h"
9397
CTREPCM = "hal/CTREPCM.h"
94-
# ChipObject = "hal/ChipObject.h"
9598
Constants = "hal/Constants.h"
9699
Counter = "hal/Counter.h"
97100
DIO = "hal/DIO.h"
@@ -102,32 +105,26 @@ DutyCycle = "hal/DutyCycle.h"
102105
Encoder = "hal/Encoder.h"
103106
# Errors = "hal/Errors.h"
104107
Extensions = "hal/Extensions.h"
105-
FRCUsageReporting = "hal/FRCUsageReporting.h"
106108
# HAL = "hal/HAL.h"
107109
HALBase = "hal/HALBase.h"
108110
I2C = "hal/I2C.h"
109111
I2CTypes = "hal/I2CTypes.h"
110-
Interrupts = "hal/Interrupts.h"
111-
LEDs = "hal/LEDs.h"
112+
# IMU = "hal/IMU.h"
113+
# IMUTypes = "hal/IMUTypes.h"
112114
Main = "hal/Main.h"
113115
Notifier = "hal/Notifier.h"
114116
PWM = "hal/PWM.h"
115117
Ports = "hal/Ports.h"
116118
Power = "hal/Power.h"
117119
PowerDistribution = "hal/PowerDistribution.h"
118120
REVPH = "hal/REVPH.h"
119-
Relay = "hal/Relay.h"
120-
SPI = "hal/SPI.h"
121-
SPITypes = "hal/SPITypes.h"
122121
SerialPort = "hal/SerialPort.h"
123122
SimDevice = "hal/SimDevice.h"
124123
Threads = "hal/Threads.h"
125124
# Types = "hal/Types.h"
126125
# Value = "hal/Value.h"
127126

128127
# hal/cpp
129-
SerialHelper = { header="hal/cpp/SerialHelper.h", enable_if="platform_machine == 'roborio'" }
130-
# UnsafeDIO = "hal/cpp/UnsafeDIO.h"
131128
# fpga_clock = "hal/cpp/fpga_clock.h"
132129

133130
# hal/handles
@@ -139,24 +136,16 @@ HandlesInternal = "hal/handles/HandlesInternal.h"
139136
# LimitedHandleResource = "hal/handles/LimitedHandleResource.h"
140137
# UnlimitedHandleResource = "hal/handles/UnlimitedHandleResource.h"
141138

142-
# hal/roborio
143-
# HMB = "hal/roborio/HMB.h"
144-
# InterruptManager = "hal/roborio/InterruptManager.h"
145-
146139

147140
[tool.semiwrap.extension_modules."hal.simulation._simulation"]
148141
name = "hal_simulation"
149142
wraps = ["robotpy-native-wpihal"]
150-
depends = ["wpiutil"]
143+
depends = ["wpiutil", "ntcore"]
151144
yaml_path = "semiwrap/simulation"
152145

153146
[tool.semiwrap.extension_modules."hal.simulation._simulation".headers]
154-
AccelerometerData = "hal/simulation/AccelerometerData.h"
155147
AddressableLEDData = "hal/simulation/AddressableLEDData.h"
156-
AnalogGyroData = "hal/simulation/AnalogGyroData.h"
157148
AnalogInData = "hal/simulation/AnalogInData.h"
158-
AnalogOutData = "hal/simulation/AnalogOutData.h"
159-
AnalogTriggerData = "hal/simulation/AnalogTriggerData.h"
160149
CTREPCMData = "hal/simulation/CTREPCMData.h"
161150
# CanData = "hal/simulation/CanData.h"
162151
DIOData = "hal/simulation/DIOData.h"
@@ -171,11 +160,8 @@ NotifierData = "hal/simulation/NotifierData.h"
171160
PWMData = "hal/simulation/PWMData.h"
172161
PowerDistributionData = "hal/simulation/PowerDistributionData.h"
173162
REVPHData = "hal/simulation/REVPHData.h"
174-
RelayData = "hal/simulation/RelayData.h"
175163
Reset = "hal/simulation/Reset.h"
176164
RoboRioData = "hal/simulation/RoboRioData.h"
177-
SPIAccelerometerData = "hal/simulation/SPIAccelerometerData.h"
178-
# SPIData = "hal/simulation/SPIData.h"
179165
# SimCallbackRegistry = "hal/simulation/SimCallbackRegistry.h"
180166
# SimDataValue = "hal/simulation/SimDataValue.h"
181167
SimDeviceData = "hal/simulation/SimDeviceData.h"

subprojects/robotpy-hal/semiwrap/Accelerometer.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

subprojects/robotpy-hal/semiwrap/AnalogGyro.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

subprojects/robotpy-hal/semiwrap/AnalogOutput.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

subprojects/robotpy-hal/semiwrap/AnalogTrigger.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

subprojects/robotpy-hal/semiwrap/CAN.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ strip_prefixes:
55

66
functions:
77
HAL_CAN_SendMessage:
8-
buffers:
9-
- { type: IN, src: data, len: dataSize }
108
HAL_CAN_ReceiveMessage:
11-
buffers:
12-
- { type: OUT, src: data, len: dataSize, minsz: 8 }
139
HAL_CAN_OpenStreamSession:
1410
HAL_CAN_CloseStreamSession:
1511
HAL_CAN_ReadStreamSession:
@@ -18,7 +14,6 @@ functions:
1814
classes:
1915
HAL_CANStreamMessage:
2016
attributes:
21-
messageID:
17+
messageId:
2218
timeStamp:
23-
data:
24-
dataSize:
19+
message:

subprojects/robotpy-hal/semiwrap/CANAPI.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,9 @@ functions:
88
HAL_InitializeCAN:
99
HAL_CleanCAN:
1010
HAL_WriteCANPacket:
11-
buffers:
12-
- { type: IN, src: data, len: length }
1311
HAL_WriteCANPacketRepeating:
14-
buffers:
15-
- { type: IN, src: data, len: length }
1612
HAL_WriteCANRTRFrame:
1713
HAL_StopCANPacketRepeating:
1814
HAL_ReadCANPacketNew:
19-
buffers:
20-
- { type: OUT, src: data, len: length, minsz: 8 }
2115
HAL_ReadCANPacketLatest:
22-
buffers:
23-
- { type: OUT, src: data, len: length, minsz: 8 }
2416
HAL_ReadCANPacketTimeout:
25-
buffers:
26-
- { type: OUT, src: data, len: length, minsz: 8 }

subprojects/robotpy-hal/semiwrap/CANAPITypes.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,14 @@ enums:
77
HAL_CANDeviceType:
88
value_prefix: HAL_CAN_Dev
99
HAL_CANManufacturer:
10-
value_prefix: HAL_CAN_Man
10+
value_prefix: HAL_CAN_Man
11+
classes:
12+
HAL_CANMessage:
13+
attributes:
14+
flags:
15+
dataSize:
16+
data:
17+
HAL_CANReceiveMessage:
18+
attributes:
19+
timeStamp:
20+
message:

subprojects/robotpy-hal/semiwrap/DriverStationTypes.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22
strip_prefixes:
33
- HAL_
44

5+
extra_includes:
6+
- src/ds_types_fmt.h
7+
58
enums:
69
HAL_AllianceStationID:
710
value_prefix: HAL_AllianceStationID
11+
HAL_JoystickPOV:
12+
value_prefix: HAL_JoystickPOV
813
HAL_MatchType:
914
value_prefix: HAL_kMatchType
1015
classes:

0 commit comments

Comments
 (0)