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 
23 extern bool g_usb_cdc_open;
24 
25 
26 int comWrite(int serialNum, const unsigned char *buf, int size, uint32_t ledPin );
27 int comRead(int serialNum, unsigned char *buf, int size, uint32_t ledPin);
28 int comRxUsed(int serialNum);
29 
30 void callback_cdc_set_config(uint8_t port, usb_cdc_line_coding_t * cfg);
31 void callback_cdc_disable(void);
32 void callback_cdc_set_dtr(uint8_t port, bool b_enable);
33 
37 
38 void log_uINS_data(cISLogger &logger, is_comm_instance_t &comm);
39 
40 void com_bridge_smart_forward(uint32_t srcPort, uint32_t ledPin);
41 void com_bridge_forward(uint32_t srcPort, uint8_t *buf, int len);
43 void communications_init(void);
44 
45 /*CAN Message*/
46 typedef struct PACKED
47 {
48  uint8_t startByte;
49  uint32_t address;
50  uint8_t dlc; //Data Length
52  uint8_t endByte;
53 
55 
56 typedef struct PACKED
57 {
58  uint32_t marker;
60  uint32_t size;
62 
63 
64 #endif // __COMMUNICATIONS_H_
uint8_t dlc
uint32_t address
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_stop_all(is_comm_instance_t &comm)
struct PACKED is_can_message
uint8_t startByte
void com_bridge_forward(uint32_t srcPort, uint8_t *buf, int len)
void uINS_stream_enable_PPD(is_comm_instance_t &comm)
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
protocol_type_t ptype
uint32_t marker
void com_bridge_smart_forward(uint32_t srcPort, uint32_t ledPin)
void uINS_stream_enable_std(is_comm_instance_t &comm)
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)
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 Sat Sep 19 2020 03:19:04