WPILibC++  2018.4.1-20180729133221-1141-g00c2cd7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Interrupts.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/AnalogTrigger.h"
13 #include "hal/Types.h"
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 typedef void (*HAL_InterruptHandlerFunction)(uint32_t interruptAssertedMask,
20  void* param);
21 
28 HAL_InterruptHandle HAL_InitializeInterrupts(HAL_Bool watcher, int32_t* status);
29 
37 void* HAL_CleanInterrupts(HAL_InterruptHandle interruptHandle, int32_t* status);
38 
48 int64_t HAL_WaitForInterrupt(HAL_InterruptHandle interruptHandle,
49  double timeout, HAL_Bool ignorePrevious,
50  int32_t* status);
51 
61 void HAL_EnableInterrupts(HAL_InterruptHandle interruptHandle, int32_t* status);
62 
68 void HAL_DisableInterrupts(HAL_InterruptHandle interruptHandle,
69  int32_t* status);
70 
79 double HAL_ReadInterruptRisingTimestamp(HAL_InterruptHandle interruptHandle,
80  int32_t* status);
81 
90 double HAL_ReadInterruptFallingTimestamp(HAL_InterruptHandle interruptHandle,
91  int32_t* status);
92 
101 void HAL_RequestInterrupts(HAL_InterruptHandle interruptHandle,
102  HAL_Handle digitalSourceHandle,
103  HAL_AnalogTriggerType analogTriggerType,
104  int32_t* status);
105 
116 void HAL_AttachInterruptHandler(HAL_InterruptHandle interruptHandle,
117  HAL_InterruptHandlerFunction handler,
118  void* param, int32_t* status);
119 
130 void HAL_AttachInterruptHandlerThreaded(HAL_InterruptHandle interruptHandle,
131  HAL_InterruptHandlerFunction handler,
132  void* param, int32_t* status);
133 
143 void HAL_SetInterruptUpSourceEdge(HAL_InterruptHandle interruptHandle,
144  HAL_Bool risingEdge, HAL_Bool fallingEdge,
145  int32_t* status);
146 #ifdef __cplusplus
147 } // extern "C"
148 #endif