WPILibC++  unspecified
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
Interrupts.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) FIRST 2016. 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 
22 HAL_InterruptHandle HAL_InitializeInterrupts(HAL_Bool watcher, int32_t* status);
23 void HAL_CleanInterrupts(HAL_InterruptHandle interruptHandle, int32_t* status);
24 
25 int64_t HAL_WaitForInterrupt(HAL_InterruptHandle interruptHandle,
26  double timeout, HAL_Bool ignorePrevious,
27  int32_t* status);
28 void HAL_EnableInterrupts(HAL_InterruptHandle interruptHandle, int32_t* status);
29 void HAL_DisableInterrupts(HAL_InterruptHandle interruptHandle,
30  int32_t* status);
31 double HAL_ReadInterruptRisingTimestamp(HAL_InterruptHandle interruptHandle,
32  int32_t* status);
33 double HAL_ReadInterruptFallingTimestamp(HAL_InterruptHandle interruptHandle,
34  int32_t* status);
35 void HAL_RequestInterrupts(HAL_InterruptHandle interruptHandle,
36  HAL_Handle digitalSourceHandle,
37  HAL_AnalogTriggerType analogTriggerType,
38  int32_t* status);
39 void HAL_AttachInterruptHandler(HAL_InterruptHandle interruptHandle,
40  HAL_InterruptHandlerFunction handler,
41  void* param, int32_t* status);
42 void HAL_AttachInterruptHandlerThreaded(HAL_InterruptHandle interruptHandle,
43  HAL_InterruptHandlerFunction handler,
44  void* param, int32_t* status);
45 void HAL_SetInterruptUpSourceEdge(HAL_InterruptHandle interruptHandle,
46  HAL_Bool risingEdge, HAL_Bool fallingEdge,
47  int32_t* status);
48 #ifdef __cplusplus
49 }
50 #endif