blob: af2fd7b9c2056490fa0dd82dcd0891279e3b3ab7 [file] [log] [blame]
Brian Silvermanf7f267a2017-02-04 16:16:08 -08001/*----------------------------------------------------------------------------*/
2/* Copyright (c) FIRST 2016-2017. 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
16extern "C" {
17#endif
18
19typedef void (*HAL_InterruptHandlerFunction)(uint32_t interruptAssertedMask,
20 void* param);
21
22HAL_InterruptHandle HAL_InitializeInterrupts(HAL_Bool watcher, int32_t* status);
23void HAL_CleanInterrupts(HAL_InterruptHandle interruptHandle, int32_t* status);
24
25int64_t HAL_WaitForInterrupt(HAL_InterruptHandle interruptHandle,
26 double timeout, HAL_Bool ignorePrevious,
27 int32_t* status);
28void HAL_EnableInterrupts(HAL_InterruptHandle interruptHandle, int32_t* status);
29void HAL_DisableInterrupts(HAL_InterruptHandle interruptHandle,
30 int32_t* status);
31double HAL_ReadInterruptRisingTimestamp(HAL_InterruptHandle interruptHandle,
32 int32_t* status);
33double HAL_ReadInterruptFallingTimestamp(HAL_InterruptHandle interruptHandle,
34 int32_t* status);
35void HAL_RequestInterrupts(HAL_InterruptHandle interruptHandle,
36 HAL_Handle digitalSourceHandle,
37 HAL_AnalogTriggerType analogTriggerType,
38 int32_t* status);
39void HAL_AttachInterruptHandler(HAL_InterruptHandle interruptHandle,
40 HAL_InterruptHandlerFunction handler,
41 void* param, int32_t* status);
42void HAL_AttachInterruptHandlerThreaded(HAL_InterruptHandle interruptHandle,
43 HAL_InterruptHandlerFunction handler,
44 void* param, int32_t* status);
45void HAL_SetInterruptUpSourceEdge(HAL_InterruptHandle interruptHandle,
46 HAL_Bool risingEdge, HAL_Bool fallingEdge,
47 int32_t* status);
48#ifdef __cplusplus
49}
50#endif