WPILibC++  2018.4.1-20180924001740-1197-g467c9fd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
SPIData.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2017-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 #ifndef __FRC_ROBORIO__
11 
12 #include "NotifyListener.h"
13 #include "hal/HAL.h"
14 
15 typedef void (*HAL_SpiReadAutoReceiveBufferCallback)(const char* name,
16  void* param,
17  unsigned char* buffer,
18  int32_t numToRead,
19  int32_t* outputCount);
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 void HALSIM_ResetSPIData(int32_t index);
26 
27 int32_t HALSIM_RegisterSPIInitializedCallback(int32_t index,
28  HAL_NotifyCallback callback,
29  void* param,
30  HAL_Bool initialNotify);
31 void HALSIM_CancelSPIInitializedCallback(int32_t index, int32_t uid);
32 HAL_Bool HALSIM_GetSPIInitialized(int32_t index);
33 void HALSIM_SetSPIInitialized(int32_t index, HAL_Bool initialized);
34 
35 int32_t HALSIM_RegisterSPIReadCallback(int32_t index,
36  HAL_BufferCallback callback,
37  void* param);
38 void HALSIM_CancelSPIReadCallback(int32_t index, int32_t uid);
39 
40 int32_t HALSIM_RegisterSPIWriteCallback(int32_t index,
41  HAL_ConstBufferCallback callback,
42  void* param);
43 void HALSIM_CancelSPIWriteCallback(int32_t index, int32_t uid);
44 
45 int32_t HALSIM_RegisterSPIReadAutoReceivedDataCallback(
46  int32_t index, HAL_SpiReadAutoReceiveBufferCallback callback, void* param);
47 void HALSIM_CancelSPIReadAutoReceivedDataCallback(int32_t index, int32_t uid);
48 
49 #ifdef __cplusplus
50 } // extern "C"
51 #endif
52 
53 #endif