22 tDIO::tOutputEnable unsetOutputDirReg,
23 tDIO::tDO setOutputStateReg, tDIO::tDO unsetOutputStateReg,
75template <
typename Functor>
79 if (port ==
nullptr) {
89 std::scoped_lock lock(dioMutex);
91 tDIO::tOutputEnable enableOE = dSys->readOutputEnable(status);
92 enableOE.value |= mask;
93 auto disableOE = enableOE;
94 disableOE.value &= ~mask;
95 tDIO::tDO enableDO = dSys->readDO(status);
96 enableDO.value |= mask;
97 auto disableDO = enableDO;
98 disableDO.value &= ~mask;
100 DIOSetProxy dioData{enableOE, disableOE, enableDO, disableDO, dSys};
#define HAL_HANDLE_ERROR
Definition: Errors.h:92
HAL_Handle HAL_DigitalHandle
Definition: Types.h:31
::int32_t int32_t
Definition: Meta.h:57
Definition: format-inl.h:32
tDIO * UnsafeGetDigialSystem()
int32_t ComputeDigitalMask(HAL_DigitalHandle handle, int32_t *status)
wpi::mutex & UnsafeGetDIOMutex()
WPILib Hardware Abstraction Layer (HAL) namespace.
Definition: ChipObject.h:40
void UnsafeManipulateDIO(HAL_DigitalHandle handle, int32_t *status, Functor func)
Unsafe digital output set function This function can be used to perform fast and deterministically se...
Definition: UnsafeDIO.h:76
::std::mutex mutex
Definition: mutex.h:17
Proxy class for directly manipulating the DIO pins.
Definition: UnsafeDIO.h:20
DIOSetProxy(DIOSetProxy &&)=delete
void SetOutputFalse(int32_t *status)
Definition: UnsafeDIO.h:48
DIOSetProxy(tDIO::tOutputEnable setOutputDirReg, tDIO::tOutputEnable unsetOutputDirReg, tDIO::tDO setOutputStateReg, tDIO::tDO unsetOutputStateReg, tDIO *dio)
Definition: UnsafeDIO.h:21
void SetOutputTrue(int32_t *status)
Definition: UnsafeDIO.h:44
DIOSetProxy & operator=(DIOSetProxy &&)=delete
DIOSetProxy & operator=(const DIOSetProxy &)=delete
tDIO::tOutputEnable m_setOutputDirReg
Definition: UnsafeDIO.h:52
void SetInputMode(int32_t *status)
Definition: UnsafeDIO.h:40
void SetOutputMode(int32_t *status)
Definition: UnsafeDIO.h:36
tDIO * m_dio
Definition: UnsafeDIO.h:56
tDIO::tOutputEnable m_unsetOutputDirReg
Definition: UnsafeDIO.h:53
tDIO::tDO m_setOutputStateReg
Definition: UnsafeDIO.h:54
tDIO::tDO m_unsetOutputStateReg
Definition: UnsafeDIO.h:55
DIOSetProxy(const DIOSetProxy &)=delete