Lely core libraries
2.3.4
|
#include <lely/io2/can.h>
Go to the source code of this file.
Functions | |
int | io_ixxat_init (void) |
Loads the "vcinpl.dll" or "vcinpl2.dll" library and makes the IXXAT functions available for use. More... | |
void | io_ixxat_fini (void) |
Frees the "vcinpl.dll" or "vcinpl2.dll" library and terminates the availability of the IXXAT functions. More... | |
io_can_ctrl_t * | io_ixxat_ctrl_create_from_index (UINT32 dwIndex, UINT32 dwCanNo, int flags, int nominal, int data) |
Creates a new IXXAT CAN controller from a device index. More... | |
io_can_ctrl_t * | io_ixxat_ctrl_create_from_luid (const LUID *lpLuid, UINT32 dwCanNo, int flags, int nominal, int data) |
Creates a new IXXAT CAN controller from a locally unique identifier (LUID). More... | |
void | io_ixxat_ctrl_destroy (io_can_ctrl_t *ctrl) |
Destroys an IXXAT CAN controller. More... | |
HANDLE | io_ixxat_ctrl_get_handle (const io_can_ctrl_t *ctrl) |
Returns the native handle of the CAN controller. | |
io_can_chan_t * | io_ixxat_chan_create (io_ctx_t *ctx, ev_exec_t *exec, int rxtimeo, int txtimeo) |
Creates a new IXXAT CAN channel. More... | |
void | io_ixxat_chan_destroy (io_can_chan_t *chan) |
Destroys an IXXAT CAN channel. More... | |
HANDLE | io_ixxat_chan_get_handle (const io_can_chan_t *chan) |
Returns the native handle of the CAN channel, or NULL if the channel is closed. | |
int | io_ixxat_chan_open (io_can_chan_t *chan, const io_can_ctrl_t *ctrl, UINT16 wRxFifoSize, UINT16 wTxFifoSize) |
Opens a CAN channel. More... | |
int | io_ixxat_chan_assign (io_can_chan_t *chan, HANDLE hCanChn, UINT32 dwTscClkFreq, UINT32 dwTscDivisor) |
Assigns an existing handle to a CAN channel, and activates the channel if necessary. More... | |
HANDLE | io_ixxat_chan_release (io_can_chan_t *chan) |
Dissociates and returns the native handle from a CAN channel. More... | |
int | io_ixxat_chan_is_open (const io_can_chan_t *chan) |
Returns 1 is the CAN channel is open and 0 if not. More... | |
int | io_ixxat_chan_close (io_can_chan_t *chan) |
Closes a CAN channel. More... | |
This header file is part of the I/O library; it contains the IXXAT CAN bus declarations for Windows.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file ixxat.h.
int io_ixxat_init | ( | void | ) |
Loads the "vcinpl.dll" or "vcinpl2.dll" library and makes the IXXAT functions available for use.
This function is not thread-safe, but can be invoked multiple times, as long as it is matched by an equal number of calls to io_ixxat_fini().
void io_ixxat_fini | ( | void | ) |
Frees the "vcinpl.dll" or "vcinpl2.dll" library and terminates the availability of the IXXAT functions.
Note that this function MUST be invoked once for each call to io_ixxat_init(). Only the last invocation will free the library.
io_can_ctrl_t* io_ixxat_ctrl_create_from_index | ( | UINT32 | dwIndex, |
UINT32 | dwCanNo, | ||
int | flags, | ||
int | nominal, | ||
int | data | ||
) |
Creates a new IXXAT CAN controller from a device index.
dwIndex | the index of the device in the list of fieldbus adapters registered with the VCI server. |
dwCanNo | the number of the CAN connection of the control unit to be opened. |
flags | the flags specifying which CAN bus features MUST be enabled (any combination of IO_CAN_BUS_FLAG_ERR, IO_CAN_BUS_FLAG_FDF and IO_CAN_BUS_FLAG_BRS). |
nominal | the nominal bitrate. For the CAN FD protocol, this is the bit rate of the arbitration phase. |
data | the data bitrate. This bit rate is only defined for the CAN FD protocol; the value is ignored otherwise. |
io_can_ctrl_t* io_ixxat_ctrl_create_from_luid | ( | const LUID * | lpLuid, |
UINT32 | dwCanNo, | ||
int | flags, | ||
int | nominal, | ||
int | data | ||
) |
Creates a new IXXAT CAN controller from a locally unique identifier (LUID).
lpLuid | a pointer to the locally unique identifier of the VCI device. |
dwCanNo | the number of the CAN connection of the control unit to be opened. |
flags | the flags specifying which CAN bus features MUST be enabled (any combination of IO_CAN_BUS_FLAG_ERR, IO_CAN_BUS_FLAG_FDF and IO_CAN_BUS_FLAG_BRS). |
nominal | the nominal bitrate. For the CAN FD protocol, this is the bit rate of the arbitration phase. |
data | the data bitrate. This bit rate is only defined for the CAN FD protocol; the value is ignored otherwise. |
void io_ixxat_ctrl_destroy | ( | io_can_ctrl_t * | ctrl | ) |
Destroys an IXXAT CAN controller.
io_can_chan_t* io_ixxat_chan_create | ( | io_ctx_t * | ctx, |
ev_exec_t * | exec, | ||
int | rxtimeo, | ||
int | txtimeo | ||
) |
Creates a new IXXAT CAN channel.
ctx | a pointer to the I/O context with which the channel should be registered. |
exec | a pointer to the executor used to execute asynchronous tasks. These tasks including blocking read and write functions, the timeout of which can be specified with rxtimeo and txtimeo, respectively. |
rxtimeo | the timeout (in milliseconds) when waiting asynchronously for a CAN message to be read. If rxtimeo is 0, the default value LELY_IO_RX_TIMEOUT is used. If rxtimeo is negative, the read function will wait indefinitely. |
txtimeo | the timeout (in milliseconds) when waiting asynchronously for a CAN message to be written. If txtimeo is 0, the default value LELY_IO_TX_TIMEOUT is used. If txtimeo is negative, the write function will wait indefinitely. |
void io_ixxat_chan_destroy | ( | io_can_chan_t * | chan | ) |
Destroys an IXXAT CAN channel.
int io_ixxat_chan_open | ( | io_can_chan_t * | chan, |
const io_can_ctrl_t * | ctrl, | ||
UINT16 | wRxFifoSize, | ||
UINT16 | wTxFifoSize | ||
) |
Opens a CAN channel.
If the channel was already open, it is first closed as if by io_ixxat_chan_close().
chan | a pointer to an IXXAT CAN channel. |
ctrl | a pointer to an IXXAT CAN controller. |
wRxFifoSize | the size of the receive buffer (in number of frames). If wRxFifoSize is 0, the default value #LELY_IO_IXXAT_RX_FIFO_SIZE is used. |
wTxFifoSize | the size of the transmit buffer (in number of frames). If wTxFifoSize is 0, the default value #LELY_IO_IXXAT_TX_FIFO_SIZE is used. |
int io_ixxat_chan_assign | ( | io_can_chan_t * | chan, |
HANDLE | hCanChn, | ||
UINT32 | dwTscClkFreq, | ||
UINT32 | dwTscDivisor | ||
) |
Assigns an existing handle to a CAN channel, and activates the channel if necessary.
If the channel was already open, it is first closed as if by io_ixxat_chan_close().
chan | a pointer to an IXXAT CAN channel. |
hCanChn | a handle to a native CAN channel. |
dwTscClkFreq | the clock frequency of the time stamp counter (in Hz). |
dwTscDivisor | the divisor for the message time stamp counter. |
HANDLE io_ixxat_chan_release | ( | io_can_chan_t * | chan | ) |
Dissociates and returns the native handle from a CAN channel.
Any pending read or write operations are canceled as if by io_can_chan_cancel_read() and io_can_chan_cancel_write().
int io_ixxat_chan_is_open | ( | const io_can_chan_t * | chan | ) |
Returns 1 is the CAN channel is open and 0 if not.
This function is equivalent to io_ixxat_chan_get_handle(chan) != NULL
.
int io_ixxat_chan_close | ( | io_can_chan_t * | chan | ) |
Closes a CAN channel.
Any pending read or write operations are canceled as if by io_can_chan_cancel_read() and io_can_chan_cancel_write().