-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
2,804 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
using unsafe HAL_BufferCallback = delegate* unmanaged[Cdecl]<byte*, void*, byte*, uint, void>; | ||
using unsafe HAL_NotifyCallback = delegate* unmanaged[Cdecl]<byte*, void*, WPIHal.HalValue*, void>; | ||
|
||
namespace WPIHal.Natives.Simulation; | ||
|
||
public static unsafe partial class HalAccelerometerData | ||
{ | ||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_ResetAccelerometerData")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void ResetAccelerometerData(int index); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_RegisterAccelerometerActiveCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial int RegisterAccelerometerActiveCallback(int index, HAL_NotifyCallback callback, void* param, [MarshalAs(UnmanagedType.I4)] bool initialNotify); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_CancelAccelerometerActiveCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void CancelAccelerometerActiveCallback(int index, int uid); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_GetAccelerometerActive")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
[return: MarshalAs(UnmanagedType.I4)] | ||
public static partial bool GetAccelerometerActive(int index); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_SetAccelerometerActive")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void SetAccelerometerActive(int index, [MarshalAs(UnmanagedType.I4)] bool active); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_RegisterAccelerometerRangeCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial int RegisterAccelerometerRangeCallback(int index, HAL_NotifyCallback callback, void* param, [MarshalAs(UnmanagedType.I4)] bool initialNotify); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_CancelAccelerometerRangeCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void CancelAccelerometerRangeCallback(int index, int uid); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_GetAccelerometerRange")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial HalAccelerometer.Range GetAccelerometerRange(int index); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_SetAccelerometerRange")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void SetAccelerometerRange(int index, HalAccelerometer.Range range); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_RegisterAccelerometerXCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial int RegisterAccelerometerXCallback(int index, HAL_NotifyCallback callback, void* param, [MarshalAs(UnmanagedType.I4)] bool initialNotify); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_CancelAccelerometerXCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void CancelAccelerometerXCallback(int index, int uid); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_GetAccelerometerX")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial double GetAccelerometerX(int index); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_SetAccelerometerX")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void SetAccelerometerX(int index, double x); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_RegisterAccelerometerYCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial int RegisterAccelerometerYCallback(int index, HAL_NotifyCallback callback, void* param, [MarshalAs(UnmanagedType.I4)] bool initialNotify); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_CancelAccelerometerYCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void CancelAccelerometerYCallback(int index, int uid); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_GetAccelerometerY")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial double GetAccelerometerY(int index); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_SetAccelerometerY")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void SetAccelerometerY(int index, double y); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_RegisterAccelerometerZCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial int RegisterAccelerometerZCallback(int index, HAL_NotifyCallback callback, void* param, [MarshalAs(UnmanagedType.I4)] bool initialNotify); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_CancelAccelerometerZCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void CancelAccelerometerZCallback(int index, int uid); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_GetAccelerometerZ")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial double GetAccelerometerZ(int index); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_SetAccelerometerZ")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void SetAccelerometerZ(int index, double z); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_RegisterAccelerometerAllCallbacks")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void RegisterAccelerometerAllCallbacks(int index, HAL_NotifyCallback callback, void* param, [MarshalAs(UnmanagedType.I4)] bool initialNotify); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
using unsafe HAL_BufferCallback = delegate* unmanaged[Cdecl]<byte*, void*, byte*, uint, void>; | ||
using unsafe HAL_ConstBufferCallback = delegate* unmanaged[Cdecl]<byte*, void*, byte*, uint, void>; | ||
using unsafe HAL_NotifyCallback = delegate* unmanaged[Cdecl]<byte*, void*, WPIHal.HalValue*, void>; | ||
|
||
namespace WPIHal.Natives.Simulation; | ||
|
||
public static unsafe partial class HalAddressableLEDData | ||
{ | ||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_FindAddressableLEDForChannel")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial int FindAddressableLEDForChannel(int channel); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_ResetAddressableLEDData")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void ResetAddressableLEDData(int index); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_RegisterAddressableLEDInitializedCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial int RegisterAddressableLEDInitializedCallback(int index, HAL_NotifyCallback callback, void* param, [MarshalAs(UnmanagedType.I4)] bool initialNotify); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_CancelAddressableLEDInitializedCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void CancelAddressableLEDInitializedCallback(int index, int uid); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_GetAddressableLEDInitialized")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
[return: MarshalAs(UnmanagedType.I4)] | ||
public static partial bool GetAddressableLEDInitialized(int index); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_SetAddressableLEDInitialized")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void SetAddressableLEDInitialized(int index, [MarshalAs(UnmanagedType.I4)] bool initialized); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_RegisterAddressableLEDOutputPortCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial int RegisterAddressableLEDOutputPortCallback(int index, HAL_NotifyCallback callback, void* param, [MarshalAs(UnmanagedType.I4)] bool initialNotify); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_CancelAddressableLEDOutputPortCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void CancelAddressableLEDOutputPortCallback(int index, int uid); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_GetAddressableLEDOutputPort")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial int GetAddressableLEDOutputPort(int index); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_SetAddressableLEDOutputPort")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void SetAddressableLEDOutputPort(int index, int outputPort); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_RegisterAddressableLEDLengthCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial int RegisterAddressableLEDLengthCallback(int index, HAL_NotifyCallback callback, void* param, [MarshalAs(UnmanagedType.I4)] bool initialNotify); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_CancelAddressableLEDLengthCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void CancelAddressableLEDLengthCallback(int index, int uid); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_GetAddressableLEDLength")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial int GetAddressableLEDLength(int index); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_SetAddressableLEDLength")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void SetAddressableLEDLength(int index, int length); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_RegisterAddressableLEDRunningCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial int RegisterAddressableLEDRunningCallback(int index, HAL_NotifyCallback callback, void* param, [MarshalAs(UnmanagedType.I4)] bool initialNotify); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_CancelAddressableLEDRunningCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void CancelAddressableLEDRunningCallback(int index, int uid); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_GetAddressableLEDRunning")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
[return: MarshalAs(UnmanagedType.I4)] | ||
public static partial bool GetAddressableLEDRunning(int index); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_SetAddressableLEDRunning")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void SetAddressableLEDRunning(int index, [MarshalAs(UnmanagedType.I4)] bool running); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_RegisterAddressableLEDDataCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial int RegisterAddressableLEDDataCallback(int index, HAL_ConstBufferCallback callback, void* param); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_CancelAddressableLEDDataCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void CancelAddressableLEDDataCallback(int index, int uid); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_GetAddressableLEDData")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial int GetAddressableLEDData(int index, HalAddressableLED.LedData* data); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_SetAddressableLEDData")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void SetAddressableLEDData(int index, HalAddressableLED.LedData* data, int length); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_RegisterAddressableLEDAllCallbacks")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void RegisterAddressableLEDAllCallbacks(int index, HAL_NotifyCallback callback, void* param, [MarshalAs(UnmanagedType.I4)] bool initialNotify); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
using unsafe HAL_BufferCallback = delegate* unmanaged[Cdecl]<byte*, void*, byte*, uint, void>; | ||
using unsafe HAL_NotifyCallback = delegate* unmanaged[Cdecl]<byte*, void*, WPIHal.HalValue*, void>; | ||
|
||
namespace WPIHal.Natives.Simulation; | ||
|
||
public static unsafe partial class HalAnalogGyroData | ||
{ | ||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_ResetAnalogGyroData")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void ResetAnalogGyroData(int index); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_RegisterAnalogGyroAngleCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial int RegisterAnalogGyroAngleCallback(int index, HAL_NotifyCallback callback, void* param, [MarshalAs(UnmanagedType.I4)] bool initialNotify); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_CancelAnalogGyroAngleCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void CancelAnalogGyroAngleCallback(int index, int uid); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_GetAnalogGyroAngle")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial double GetAnalogGyroAngle(int index); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_SetAnalogGyroAngle")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void SetAnalogGyroAngle(int index, double angle); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_RegisterAnalogGyroRateCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial int RegisterAnalogGyroRateCallback(int index, HAL_NotifyCallback callback, void* param, [MarshalAs(UnmanagedType.I4)] bool initialNotify); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_CancelAnalogGyroRateCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void CancelAnalogGyroRateCallback(int index, int uid); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_GetAnalogGyroRate")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial double GetAnalogGyroRate(int index); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_SetAnalogGyroRate")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void SetAnalogGyroRate(int index, double rate); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_RegisterAnalogGyroInitializedCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial int RegisterAnalogGyroInitializedCallback(int index, HAL_NotifyCallback callback, void* param, [MarshalAs(UnmanagedType.I4)] bool initialNotify); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_CancelAnalogGyroInitializedCallback")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void CancelAnalogGyroInitializedCallback(int index, int uid); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_GetAnalogGyroInitialized")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
[return: MarshalAs(UnmanagedType.I4)] | ||
public static partial bool GetAnalogGyroInitialized(int index); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_SetAnalogGyroInitialized")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void SetAnalogGyroInitialized(int index, [MarshalAs(UnmanagedType.I4)] bool initialized); | ||
|
||
[LibraryImport("wpiHal", EntryPoint = "HALSIM_RegisterAnalogGyroAllCallbacks")] | ||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] | ||
public static partial void RegisterAnalogGyroAllCallbacks(int index, HAL_NotifyCallback callback, void* param, [MarshalAs(UnmanagedType.I4)] bool initialNotify); | ||
|
||
} |
Oops, something went wrong.