communications.h
Go to the documentation of this file.
1 /*
2 MIT LICENSE
3 
4 Copyright 2014-2019 Inertial Sense, Inc. - http://inertialsense.com
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
7 
8 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9 
10 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT, IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11 */
12 
13 #ifndef __COMMUNICATIONS_H_
14 #define __COMMUNICATIONS_H_
15 
16 #include <asf.h>
17 #include "globals.h"
18 #include "spiTouINS.h"
19 #include "../../../src/ISLogger.h"
20 #include "../hw-libs/communications/CAN_comm.h"
21 
22 
24 extern bool g_usb_cdc_open;
25 
26 typedef void(*pfnHandleUinsData)(p_data_hdr_t &dataHdr, uDatasets &data);
27 typedef void(*pfnHandleHostData)(is_comm_instance_t *comm, protocol_type_t ptype, uint32_t srcPort);
28 
29 int comWrite(int serialNum, const unsigned char *buf, int size, uint32_t ledPin );
30 int comRead(int serialNum, unsigned char *buf, int size, uint32_t ledPin);
31 int comRxUsed(int serialNum);
32 
33 void callback_cdc_set_config(uint8_t port, usb_cdc_line_coding_t * cfg);
34 void callback_cdc_disable(void);
35 void callback_cdc_set_dtr(uint8_t port, bool b_enable);
36 
37 void uINS_stream_stop_all(void);
38 void uINS_stream_enable_std(void);
39 void uINS_stream_enable_PPD(void);
40 
41 void log_uINS_data(cISLogger &logger, is_comm_instance_t &comm);
42 
43 void com_bridge_smart_forward(uint32_t srcPort, uint32_t ledPin);
44 void com_bridge_forward(uint32_t srcPort, uint8_t *buf, int len);
48 void communications_init(void);
49 
50 /*CAN Message*/
51 typedef struct PACKED
52 {
53  uint8_t startByte;
54  uint32_t address;
55  uint8_t dlc; //Data Length
57  uint8_t endByte;
58 
60 
61 typedef struct PACKED
62 {
63  uint32_t marker;
65  uint32_t size;
67 
68 
69 #endif // __COMMUNICATIONS_H_
uint8_t dlc
uint32_t address
void(* pfnHandleUinsData)(p_data_hdr_t &dataHdr, uDatasets &data)
void(* pfnHandleHostData)(is_comm_instance_t *comm, protocol_type_t ptype, uint32_t srcPort)
int comWrite(int serialNum, const unsigned char *buf, int size, uint32_t ledPin)
void step_com_bridge(is_comm_instance_t &comm)
is_can_payload payload
struct PACKED is_evb_log_stream
int comRead(int serialNum, unsigned char *buf, int size, uint32_t ledPin)
void uINS_stream_enable_PPD(void)
void uINS_stream_enable_std(void)
struct PACKED is_can_message
uint8_t startByte
void com_bridge_forward(uint32_t srcPort, uint8_t *buf, int len)
void uINS_stream_stop_all(void)
int comRxUsed(int serialNum)
void callback_cdc_set_dtr(uint8_t port, bool b_enable)
bool g_usb_cdc_open
void communications_init(void)
uint8_t endByte
USBInterfaceDescriptor data
protocol_type_t ptype
uint32_t marker
void comunications_set_host_data_callback(pfnHandleHostData pfn)
void com_bridge_smart_forward(uint32_t srcPort, uint32_t ledPin)
void comunications_set_uins_data_callback(pfnHandleUinsData pfn)
protocol_type_t
Definition: ISComm.h:75
void callback_cdc_disable(void)
Autogenerated API include file for the Atmel Software Framework (ASF)
void log_uINS_data(cISLogger &logger, is_comm_instance_t &comm)
is_comm_instance_t g_commTx
void callback_cdc_set_config(uint8_t port, usb_cdc_line_coding_t *cfg)
Line Coding structure.
uint32_t size


inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:17:57