AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
Loading...
Searching...
No Matches
UsbCanUp.h
1/****************************************************************************
2
3 (c) SYS TEC electronic AG, D-08468 Heinsdorfergrund, Am Windrad 2
4 www.systec-electronic.com
5
6 Project: USB-CANmodule
7
8 Description: Additional header file for the USBCAN32.DLL
9 Functions for User port at GW-002
10
11 -------------------------------------------------------------------------
12
13 $RCSfile:$
14
15 $Author: R.Dietzsch $
16
17 $Revision: 1.1 $ $Date: 2003/03/18 $
18 Version: 2.18 Date: 27.04.2004
19
20 $State: $
21
22 Build Environment:
23 MSVC 5.0 and MSVC 6.0
24
25 -------------------------------------------------------------------------
26
27 Revision History:
28
29 2002/03/18 r.d.: First implementation
30
31****************************************************************************/
32
33// clang-format off
35
36// Protection against mutliple including
37#ifndef __USBCANUP_H__
38#define __USBCANUP_H__
39
40
41#ifndef __USBCAN32_H__
42
43 #error 'ERROR: file "usbcan32.h" not included!'
44
45#endif
46
47
48// allow access to functions for C++ applications as well
49#ifdef __cplusplus
50extern "C"
51{
52#endif
53
54
55//---------------------------------------------------------------------------
56// const defines
57//---------------------------------------------------------------------------
58
59
60//---------------------------------------------------------------------------
61// function prototypes
62//---------------------------------------------------------------------------
63
64//---------------------------------------------------------------------------
65//
66// Function: UcanConfigUserPort()
67//
68// Description: Configures the special User port of USB-CANmodule at the GW-002
69// for output or input.
70//
71// Parameters: UcanHandle_p = [in] USB-CAN-Handle
72// Handle, which is returned by the function UcanInitHardware()
73// bOutputEnable_p = [in] 8 bit configuration of user port
74// Each bit belongs to one pin of User port.
75// If the bit contains a 0 then the pin of User port is an input pin.
76// Otherwise it is an output pin.
77//
78// Returns: result of the function
79// USBCAN_SUCCESSFUL
80// USBCAN_ERR_ILLHANDLE
81// USBCAN_ERR_MAXINSTANCES
82// USBCAN_ERR_ILLHW
83// USBCAN_ERR_IOFAILED
84// USBCAN_ERR_DATA
85// USBCAN_ERR_ABORT
86// USBCAN_ERR_DISCONNECT
87// USBCAN_ERR_BUSY
88// USBCAN_ERR_TIMEOUT
89// USBCAN_ERRCMD_...
90//
91//---------------------------------------------------------------------------
92
93UCANRET PUBLIC UcanConfigUserPort (tUcanHandle UcanHandle_p, BYTE bOutputEnable_p);
94
95
96//---------------------------------------------------------------------------
97//
98// Function: UcanWriteUserPort()
99//
100// Description: Writes a value to special User port of USB-CANmodule at the GW-002.
101//
102// Parameters: UcanHandle_p = [in] USB-CAN-Handle
103// Handle, which is returned by the function UcanInitHardware()
104// bOutValue_p = [in] 8 bit value to write to special User port.
105// Each bit belongs to one pin of User port.
106//
107// Returns: result of the function
108// USBCAN_SUCCESSFUL
109// USBCAN_ERR_ILLHANDLE
110// USBCAN_ERR_MAXINSTANCES
111// USBCAN_ERR_ILLHW
112// USBCAN_ERR_IOFAILED
113// USBCAN_ERR_DATA
114// USBCAN_ERR_ABORT
115// USBCAN_ERR_DISCONNECT
116// USBCAN_ERR_BUSY
117// USBCAN_ERR_TIMEOUT
118// USBCAN_ERRCMD_...
119
120//---------------------------------------------------------------------------
121
122UCANRET PUBLIC UcanWriteUserPort (tUcanHandle UcanHandle_p, BYTE bOutValue_p);
123
124
125//---------------------------------------------------------------------------
126//
127// Function: UcanReadUserPort()
128//
129// Description: Reads a value from special User port of USB-CANmodule at the GW-002.
130//
131//
132// Parameters: UcanHandle_p = [in] USB-CAN-Handle
133// Handle, which is returned by the function UcanInitHardware()
134// pbInValue_p = [out] pointer 8 bit variable which receives the read value
135// Each bit belongs to one pin of User port.
136// This parameter can not be NULL.
137//
138// pbLastOutEn_p = [out] pointer to receive output enable configuratiuon
139// Each bit belongs to one pin of User port.
140// This parameter can be NULL.
141// pbLastOutVal_p = [out] pointer to receive output data configuratiuon
142// Each bit belongs to one pin of User port.
143// This parameter can be NULL.
144//
145// Returns: result of the function
146// USBCAN_SUCCESSFUL
147// USBCAN_ERR_ILLHANDLE
148// USBCAN_ERR_MAXINSTANCES
149// USBCAN_ERR_ILLHW
150// USBCAN_ERR_ILLPARAM
151// USBCAN_ERR_IOFAILED
152// USBCAN_ERR_DATA
153// USBCAN_ERR_ABORT
154// USBCAN_ERR_DISCONNECT
155// USBCAN_ERR_BUSY
156// USBCAN_ERR_TIMEOUT
157// USBCAN_ERRCMD_...
158//
159//---------------------------------------------------------------------------
160
161UCANRET PUBLIC UcanReadUserPort (tUcanHandle UcanHandle_p, BYTE* pbValue_p);
162UCANRET PUBLIC UcanReadUserPortEx (tUcanHandle UcanHandle_p, BYTE* pbInValue_p, BYTE* pbLastOutEn_p, BYTE* pbLastOutVal_p);
163
164
165#ifdef __cplusplus
166} // von extern "C"
167#endif
168
169
170#endif // __USBCANUP_H__
171
173// clang-format on