Crate busmust_sys

Source

Structs§

BMBitrate
CAN channel bitrate configuration, used by super::api::BM_SetBitrate
BMCanMessage
Busmust CAN Message concrete type, usually used as payload of BMData. The total length of this structure is 72B, it supports both classic and FD CAN messages.
BMCanStatusInfo
CAN channel status detailed information, retrieved by calling super::api::BM_GetStatus, see ISO11898 for details.
BMCapability
Busmust Device capability flags, retrieved when enumerating devices using super::api::BM_Enumerate.
BMChannelInfo
Channel information, created when enumerating devices by super::api::BM_Enumerate and used when opening device by super::api::BM_OpenEx
BMData
Busmust data, abstract structure which holds concrete payload messages of various types (i.e. CAN messages).
BMDataHeader
Busmust data header, each BMData contains a header which indicates payload information.
BMIsoTPStatus
ISO-TP status report, used by ISO-TP operation callback function.
BMIsotpConfig
ISOTP Protocol (See ISO15765-2 for details) configuration.
BMIsotpFlowControlConfig
BMIsotpTimeoutConfig
BMMessageId
Busmust CAN Message ID. You could also use an u32, but please take care of memory alignments.
BMRxFilter
CAN channel RX filter item structure, used by super::api::BM_SetRxFilters The filter support masking ID, flags and payload according to its type, in order for a message to be accepted, all the fields are masked using AND logic: (flags & filter.flags_mask == filter.flags_value) AND (ID & filter.id_mask == filter.id_value) AND (payload & filter.payload_mask == filter.payload_value)
BMRxMessageCtrl
Busmust RX CAN Message control fields. The first few fields (until FDF) are bit compatible with BMTxMessageCtrl.
BMTxMessageCtrl
Busmust TX CAN Message control fields. The first few fields (until FDF) are bit compatible with BMRxMessageCtrl.
BMTxTask
CAN channel TX task item structure, used by super::api::BM_SetTxTasks Once the CAN device is armed with TX tasks, it will try to parse the TX task and send CAN messages automatically. The difference with a software triggered CAN message in BusMaster is that hardware triggered CAN messages are more precise in time and could reach a higher throughput.
BMTxTaskIncDataPattern
BMTxTaskIncIdPattern
BMTxTaskRndDataPattern
BMTxTaskRndIdPattern

Enums§

BMCanMode
CAN mode IDs, used by super::api::BM_SetCanMode to change the operation mode of CAN device.
BMDataType
Busmust data type flags, must be given in BMData.
BMIsotpMode
ISO-TP operation mode.
BMLogLevel
Busmust library log level, see super::api::BM_SetLogLevel for details.
BMMessageFlags
CAN Message type flags, used in BMCanMessage
BMRxFilterType
CAN RX filter type IDs, used in BMRxFilter
BMStatType
CAN runtime statistics item IDs, used in super::api::BM_GetStatus.
BMStatus
Busmust device & operation status, most APIs would return a status code to indicate the result of an operation
BMTerminalResistor
Terminal resistor values, used by super::api::BM_SetTerminalRegister to change the terminal resistor of CAN device.
BMTxTaskType
CAN TX task type IDs, used in BMTxTask.

Constants§

BM_DATA_HEADER_SIZE
Size (in bytes) of BM Data header, which contains type, routing, length and timestamp.
BM_DATA_MAX_SIZE
Size (in bytes) of BM Data, which contains a header and payload.
BM_DATA_PAYLOAD_MAX_SIZE
Size (in bytes) of BM Data payload, which contains a concrete message in CAN-FD | LIN | FLEXRAY | ... type.
BM_ERROR_DESC_MAX_SIZE
Size (in bytes) of an error description string.

Functions§

BM_Activate
Activate an opened channel, and thus goes on bus for the selected port and channels. At this point, the user can transmit and receive messages on the bus. Channel is default to be activated after BM_OpenEx is called.
BM_ClearBuffer
Clear TX&RX message buffer of an opened channel. This function is available since BM API 1.3, hardware status will not be changed when clearing buffer.
BM_Close
Close an opened channel.
BM_Deactivate
Deactivate an opened channel, and thus the selected channels goes off the bus and stay in BUSOFF state until re-activation. Any call to BM_Write or BM_Read will return BMStatus::BusOff immediately if the channel is deactivated.
BM_Enumerate
Enumerate all connected Busmust device.
BM_GetDataText
Translate data (i.e. CAN message) to string, this is a helper function to ease application programming.
BM_GetErrorText
Translate error code to string, this is a helper function to ease application programming.
BM_GetLogLevel
Get library log level.
BM_GetNotification
Get the platform/OS independent notification handle for the given channel, so that the application could wait for notifications later.
BM_GetStatus
Get current CAN status of the given channel.
BM_GetTimestamp
Get current local high precision device timestamp, in microseconds.
BM_Init
Initialize BM API library, this function shall be called before any other API calls and shall only be called once.
BM_OpenCan
Open the specified CAN device port.
BM_OpenEx
Open the specified device port using given configuration.
BM_Read
Read a message/event out of the given channel. This function is non-blocked, and thus will return BMStatus::ReceiveBufferEmpty if no message is received. Please use notifications to wait for RX events and then read message/event out of BM API internal RX buffer, otherwise you could also poll the device periodically.
BM_ReadCanMessage
Read CAN message out of the given channel. Note this function is a simple wrapper of BM_Read, see BM_Read for details.
BM_ReadIsotp
Read data block using ISO-TP protocol. This API enables rapid transmission using ISO-TP without app intervention.
BM_ReadMultiple
Read multiple messages/events out of the given channel.
BM_ReadMultipleCanMessage
Read multiple CAN messages out of the given channel. This function is non-blocked, and thus will return BMStatus::ReceiveBufferEmpty if not all messages are received. Please use notifications to wait for RX events and then read message/event out of BM API internal RX buffer, otherwise you could also poll the device periodically.
BM_Reset
Reset an opened channel. The configuration options will not lost when the channel is reset, so BM_Reset is basically identical to BM_Close and then BM_OpenEx.
BM_SetBitrate
Set bitrate option of the given channel.
BM_SetCanMode
Set CAN mode option of the given channel.
BM_SetLogLevel
Set library log level.
BM_SetRxFilters
Set RX filters option of the given channel.
BM_SetTerminalRegister
Set terminal resistor option of the given channel.
BM_SetTxTasks
Set TX tasks option of the given channel.
BM_UnInit
Un-initialize BM API library, this function shall be called after any other API calls and shall only be called once.
BM_WaitForNotifications
A platform/OS independent implementation to wait for single/multiple notification handles.
BM_Write
Write a message/event to the given channel.
BM_WriteCanMessage
Write CAN message to the given channel. Note this function is a simple wrapper to BM_Write, see BM_Write for details.
BM_WriteIsotp
Write data block using ISO-TP protocol. This API enables rapid transmission using ISO-TP without app intervention.
BM_WriteMultiple
Write multiple messages/events to the given channel. This function is allowed to be called from multiple threads since BM API 1.3.
BM_WriteMultipleCanMessage
Write multiple CAN messages to the given channel. This function is allowed to be called from multiple threads since BM API 1.3.

Unions§

BMMessageCtrl
Busmust CAN Message control fields.