mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
Add AddressableLED simulation support
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define HAL_kAddressableLEDMaxLength 5460
|
||||
|
||||
struct HAL_AddressableLEDData {
|
||||
uint8_t b;
|
||||
uint8_t g;
|
||||
|
||||
@@ -151,6 +151,13 @@ int32_t HAL_GetNumPDPChannels(void);
|
||||
* @return the number of Duty Cycle inputs
|
||||
*/
|
||||
int32_t HAL_GetNumDutyCycles(void);
|
||||
|
||||
/**
|
||||
* Gets the number of addressable LED generators in the current system.
|
||||
*
|
||||
* @return the number of Addressable LED generators
|
||||
*/
|
||||
int32_t HAL_GetNumAddressableLEDs(void);
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
65
hal/src/main/native/include/mockdata/AddressableLEDData.h
Normal file
65
hal/src/main/native/include/mockdata/AddressableLEDData.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "NotifyListener.h"
|
||||
#include "hal/AddressableLEDTypes.h"
|
||||
#include "hal/Types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void HALSIM_ResetAddressableLEDData(int32_t index);
|
||||
|
||||
int32_t HALSIM_RegisterAddressableLEDInitializedCallback(
|
||||
int32_t index, HAL_NotifyCallback callback, void* param,
|
||||
HAL_Bool initialNotify);
|
||||
void HALSIM_CancelAddressableLEDInitializedCallback(int32_t index, int32_t uid);
|
||||
HAL_Bool HALSIM_GetAddressableLEDInitialized(int32_t index);
|
||||
void HALSIM_SetAddressableLEDInitialized(int32_t index, HAL_Bool initialized);
|
||||
|
||||
int32_t HALSIM_RegisterAddressableLEDOutputPortCallback(
|
||||
int32_t index, HAL_NotifyCallback callback, void* param,
|
||||
HAL_Bool initialNotify);
|
||||
void HALSIM_CancelAddressableLEDOutputPortCallback(int32_t index, int32_t uid);
|
||||
int32_t HALSIM_GetAddressableLEDOutputPort(int32_t index);
|
||||
void HALSIM_SetAddressableLEDOutputPort(int32_t index, int32_t outputPort);
|
||||
|
||||
int32_t HALSIM_RegisterAddressableLEDLengthCallback(int32_t index,
|
||||
HAL_NotifyCallback callback,
|
||||
void* param,
|
||||
HAL_Bool initialNotify);
|
||||
void HALSIM_CancelAddressableLEDLengthCallback(int32_t index, int32_t uid);
|
||||
int32_t HALSIM_GetAddressableLEDLength(int32_t index);
|
||||
void HALSIM_SetAddressableLEDLength(int32_t index, int32_t length);
|
||||
|
||||
int32_t HALSIM_RegisterAddressableLEDRunningCallback(
|
||||
int32_t index, HAL_NotifyCallback callback, void* param,
|
||||
HAL_Bool initialNotify);
|
||||
void HALSIM_CancelAddressableLEDRunningCallback(int32_t index, int32_t uid);
|
||||
HAL_Bool HALSIM_GetAddressableLEDRunning(int32_t index);
|
||||
void HALSIM_SetAddressableLEDRunning(int32_t index, HAL_Bool running);
|
||||
|
||||
int32_t HALSIM_RegisterAddressableLEDDataCallback(
|
||||
int32_t index, HAL_ConstBufferCallback callback, void* param);
|
||||
void HALSIM_CancelAddressableLEDDataCallback(int32_t index, int32_t uid);
|
||||
int32_t HALSIM_GetAddressableLEDData(int32_t index,
|
||||
struct HAL_AddressableLEDData* data);
|
||||
void HALSIM_SetAddressableLEDData(int32_t index,
|
||||
const struct HAL_AddressableLEDData* data,
|
||||
int32_t length);
|
||||
|
||||
void HALSIM_RegisterAddressableLEDAllCallbacks(int32_t index,
|
||||
HAL_NotifyCallback callback,
|
||||
void* param,
|
||||
HAL_Bool initialNotify);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
Reference in New Issue
Block a user