2016-05-25 20:23:37 -07:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
|
|
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
|
|
|
|
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
|
|
|
|
/* the project. */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
2014-05-02 17:54:01 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
2016-07-07 21:43:55 -07:00
|
|
|
#include "HAL/AnalogTrigger.h"
|
2016-07-12 10:45:14 -07:00
|
|
|
#include "HAL/Types.h"
|
2016-06-20 23:22:49 -07:00
|
|
|
|
2016-07-12 21:53:06 -07:00
|
|
|
#ifdef __cplusplus
|
2016-05-20 17:30:37 -07:00
|
|
|
extern "C" {
|
2016-07-12 21:53:06 -07:00
|
|
|
#endif
|
2016-09-05 07:31:51 -07:00
|
|
|
typedef void (*HAL_InterruptHandlerFunction)(uint32_t interruptAssertedMask,
|
|
|
|
|
void* param);
|
2014-05-02 17:54:01 -04:00
|
|
|
|
2016-07-12 10:45:14 -07:00
|
|
|
HAL_InterruptHandle HAL_InitializeInterrupts(HAL_Bool watcher, int32_t* status);
|
2016-08-12 13:45:28 -07:00
|
|
|
void HAL_CleanInterrupts(HAL_InterruptHandle interruptHandle, int32_t* status);
|
2014-05-02 17:54:01 -04:00
|
|
|
|
2016-08-12 13:45:28 -07:00
|
|
|
int64_t HAL_WaitForInterrupt(HAL_InterruptHandle interruptHandle,
|
2016-07-12 10:45:14 -07:00
|
|
|
double timeout, HAL_Bool ignorePrevious,
|
|
|
|
|
int32_t* status);
|
2016-08-12 13:45:28 -07:00
|
|
|
void HAL_EnableInterrupts(HAL_InterruptHandle interruptHandle, int32_t* status);
|
|
|
|
|
void HAL_DisableInterrupts(HAL_InterruptHandle interruptHandle,
|
2016-07-09 00:24:26 -07:00
|
|
|
int32_t* status);
|
2016-08-12 13:45:28 -07:00
|
|
|
double HAL_ReadInterruptRisingTimestamp(HAL_InterruptHandle interruptHandle,
|
2016-07-09 01:12:37 -07:00
|
|
|
int32_t* status);
|
2016-08-12 13:45:28 -07:00
|
|
|
double HAL_ReadInterruptFallingTimestamp(HAL_InterruptHandle interruptHandle,
|
2016-07-09 01:12:37 -07:00
|
|
|
int32_t* status);
|
2016-08-12 13:45:28 -07:00
|
|
|
void HAL_RequestInterrupts(HAL_InterruptHandle interruptHandle,
|
2016-07-09 00:24:26 -07:00
|
|
|
HAL_Handle digitalSourceHandle,
|
|
|
|
|
HAL_AnalogTriggerType analogTriggerType,
|
|
|
|
|
int32_t* status);
|
2016-08-12 13:45:28 -07:00
|
|
|
void HAL_AttachInterruptHandler(HAL_InterruptHandle interruptHandle,
|
2016-09-05 07:31:51 -07:00
|
|
|
HAL_InterruptHandlerFunction handler,
|
|
|
|
|
void* param, int32_t* status);
|
2016-08-12 13:45:28 -07:00
|
|
|
void HAL_SetInterruptUpSourceEdge(HAL_InterruptHandle interruptHandle,
|
2016-07-12 10:45:14 -07:00
|
|
|
HAL_Bool risingEdge, HAL_Bool fallingEdge,
|
2016-07-09 00:24:26 -07:00
|
|
|
int32_t* status);
|
2016-07-12 21:53:06 -07:00
|
|
|
#ifdef __cplusplus
|
2014-05-02 17:54:01 -04:00
|
|
|
}
|
2016-07-12 21:53:06 -07:00
|
|
|
#endif
|