WPILibC++  2018.4.1-20180927001728-1207-gd5d744a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Relay.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #pragma once
9 
10 #include <stdint.h>
11 
12 #include "hal/Types.h"
13 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
34 HAL_RelayHandle HAL_InitializeRelayPort(HAL_PortHandle portHandle, HAL_Bool fwd,
35  int32_t* status);
36 
42 void HAL_FreeRelayPort(HAL_RelayHandle relayPortHandle);
43 
50 HAL_Bool HAL_CheckRelayChannel(int32_t channel);
51 
58 void HAL_SetRelay(HAL_RelayHandle relayPortHandle, HAL_Bool on,
59  int32_t* status);
60 
67 HAL_Bool HAL_GetRelay(HAL_RelayHandle relayPortHandle, int32_t* status);
68 #ifdef __cplusplus
69 } // extern "C"
70 #endif
71 
HAL_RelayHandle HAL_InitializeRelayPort(HAL_PortHandle portHandle, HAL_Bool fwd, int32_t *status)
Initializes a relay.
HAL_Bool HAL_GetRelay(HAL_RelayHandle relayPortHandle, int32_t *status)
Gets the current state of the relay channel.
void HAL_FreeRelayPort(HAL_RelayHandle relayPortHandle)
Frees a relay port.
HAL_Bool HAL_CheckRelayChannel(int32_t channel)
Checks if a relay channel is valid.
void HAL_SetRelay(HAL_RelayHandle relayPortHandle, HAL_Bool on, int32_t *status)
Sets the state of a relay output.