WPILibC++  unspecified
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
CAN.h
1 /*----------------------------------------------------------------------------*/
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 "FRC_NetworkCommunication/CANSessionMux.h"
13 
14 void canTxSend(uint32_t arbID, uint8_t length,
15  int32_t period = CAN_SEND_PERIOD_NO_REPEAT);
16 
17 void canTxPackInt8(uint32_t arbID, uint8_t offset, uint8_t value);
18 void canTxPackInt16(uint32_t arbID, uint8_t offset, uint16_t value);
19 void canTxPackInt32(uint32_t arbID, uint8_t offset, uint32_t value);
20 void canTxPackFXP16(uint32_t arbID, uint8_t offset, double value);
21 void canTxPackFXP32(uint32_t arbID, uint8_t offset, double value);
22 
23 uint8_t canTxUnpackInt8(uint32_t arbID, uint8_t offset);
24 uint32_t canTxUnpackInt32(uint32_t arbID, uint8_t offset);
25 uint16_t canTxUnpackInt16(uint32_t arbID, uint8_t offset);
26 double canTxUnpackFXP16(uint32_t arbID, uint8_t offset);
27 double canTxUnpackFXP32(uint32_t arbID, uint8_t offset);
28 
29 bool canRxReceive(uint32_t arbID);
30 
31 uint8_t canRxUnpackInt8(uint32_t arbID, uint8_t offset);
32 uint16_t canRxUnpackInt16(uint32_t arbID, uint8_t offset);
33 uint32_t canRxUnpackInt32(uint32_t arbID, uint8_t offset);
34 double canRxUnpackFXP16(uint32_t arbID, uint8_t offset);
35 double canRxUnpackFXP32(uint32_t arbID, uint8_t offset);