Pcan

Struct Pcan 

Source
pub struct Pcan {
Show 14 fields pub CAN_Initialize: Result<unsafe extern "C" fn(Channel: WORD, Btr0Btr1: WORD, HwType: BYTE, IOPort: DWORD, Interrupt: WORD) -> DWORD, Error>, pub CAN_InitializeFD: Result<unsafe extern "C" fn(Channel: WORD, BitrateFD: LPSTR) -> DWORD, Error>, pub CAN_Uninitialize: Result<unsafe extern "C" fn(Channel: WORD) -> DWORD, Error>, pub CAN_Reset: Result<unsafe extern "C" fn(Channel: WORD) -> DWORD, Error>, pub CAN_GetStatus: Result<unsafe extern "C" fn(Channel: WORD) -> DWORD, Error>, pub CAN_Read: Result<unsafe extern "C" fn(Channel: WORD, MessageBuffer: *mut TPEAKMsg, TimestampBuffer: *mut TPEAKTimestamp) -> DWORD, Error>, pub CAN_ReadFD: Result<unsafe extern "C" fn(Channel: WORD, MessageBuffer: *mut TPEAKMsgFD, TimestampBuffer: *mut UINT64) -> DWORD, Error>, pub CAN_Write: Result<unsafe extern "C" fn(Channel: WORD, MessageBuffer: *mut TPEAKMsg) -> DWORD, Error>, pub CAN_WriteFD: Result<unsafe extern "C" fn(Channel: WORD, MessageBuffer: *mut TPEAKMsgFD) -> DWORD, Error>, pub CAN_FilterMessages: Result<unsafe extern "C" fn(Channel: WORD, FromID: DWORD, ToID: DWORD, Mode: BYTE) -> DWORD, Error>, pub CAN_GetValue: Result<unsafe extern "C" fn(Channel: WORD, Parameter: BYTE, Buffer: *mut c_void, BufferLength: DWORD) -> DWORD, Error>, pub CAN_SetValue: Result<unsafe extern "C" fn(Channel: WORD, Parameter: BYTE, Buffer: *mut c_void, BufferLength: DWORD) -> DWORD, Error>, pub CAN_GetErrorText: Result<unsafe extern "C" fn(Error: DWORD, Language: WORD, Buffer: LPSTR) -> DWORD, Error>, pub CAN_LookUpChannel: Result<unsafe extern "C" fn(Parameters: LPSTR, FoundChannel: *mut WORD) -> DWORD, Error>, /* private fields */
}

Fields§

§CAN_Initialize: Result<unsafe extern "C" fn(Channel: WORD, Btr0Btr1: WORD, HwType: BYTE, IOPort: DWORD, Interrupt: WORD) -> DWORD, Error>§CAN_InitializeFD: Result<unsafe extern "C" fn(Channel: WORD, BitrateFD: LPSTR) -> DWORD, Error>§CAN_Uninitialize: Result<unsafe extern "C" fn(Channel: WORD) -> DWORD, Error>§CAN_Reset: Result<unsafe extern "C" fn(Channel: WORD) -> DWORD, Error>§CAN_GetStatus: Result<unsafe extern "C" fn(Channel: WORD) -> DWORD, Error>§CAN_Read: Result<unsafe extern "C" fn(Channel: WORD, MessageBuffer: *mut TPEAKMsg, TimestampBuffer: *mut TPEAKTimestamp) -> DWORD, Error>§CAN_ReadFD: Result<unsafe extern "C" fn(Channel: WORD, MessageBuffer: *mut TPEAKMsgFD, TimestampBuffer: *mut UINT64) -> DWORD, Error>§CAN_Write: Result<unsafe extern "C" fn(Channel: WORD, MessageBuffer: *mut TPEAKMsg) -> DWORD, Error>§CAN_WriteFD: Result<unsafe extern "C" fn(Channel: WORD, MessageBuffer: *mut TPEAKMsgFD) -> DWORD, Error>§CAN_FilterMessages: Result<unsafe extern "C" fn(Channel: WORD, FromID: DWORD, ToID: DWORD, Mode: BYTE) -> DWORD, Error>§CAN_GetValue: Result<unsafe extern "C" fn(Channel: WORD, Parameter: BYTE, Buffer: *mut c_void, BufferLength: DWORD) -> DWORD, Error>§CAN_SetValue: Result<unsafe extern "C" fn(Channel: WORD, Parameter: BYTE, Buffer: *mut c_void, BufferLength: DWORD) -> DWORD, Error>§CAN_GetErrorText: Result<unsafe extern "C" fn(Error: DWORD, Language: WORD, Buffer: LPSTR) -> DWORD, Error>§CAN_LookUpChannel: Result<unsafe extern "C" fn(Parameters: LPSTR, FoundChannel: *mut WORD) -> DWORD, Error>

Implementations§

Source§

impl Pcan

Source

pub unsafe fn new<P>(path: P) -> Result<Self, Error>
where P: AsRef<OsStr>,

Source

pub unsafe fn from_library<L>(library: L) -> Result<Self, Error>
where L: Into<Library>,

Source

pub unsafe fn CAN_Initialize( &self, Channel: WORD, Btr0Btr1: WORD, HwType: BYTE, IOPort: DWORD, Interrupt: WORD, ) -> DWORD

Initializes a PEAK Channel "The handle of a PEAK Channel" "The speed for the communication (BTR0BTR1 code)" "Non-PnP: The type of hardware and operation mode" "Non-PnP: The I/O address for the parallel port" "Non-PnP: Interrupt number of the parallel port" "A TPEAKStatus error code"
Source

pub unsafe fn CAN_InitializeFD(&self, Channel: WORD, BitrateFD: LPSTR) -> DWORD

f_clock=80000000,nom_brp=10,nom_tseg1=5,nom_tseg2=2,nom_sjw=1,data_brp=4,data_tseg1=7,data_tseg2=2,data_sjw=1 “A TPEAKStatus error code”

Source

pub unsafe fn CAN_Uninitialize(&self, Channel: WORD) -> DWORD

Uninitializes one or all PEAK Channels initialized by CAN_Initialize Giving the TPEAKHandle value "PEAK_NONEBUS", uninitialize all initialized channels "The handle of a PEAK Channel" "A TPEAKStatus error code"
Source

pub unsafe fn CAN_Reset(&self, Channel: WORD) -> DWORD

Resets the receive and transmit queues of the PEAK Channel A reset of the CAN controller is not performed. "The handle of a PEAK Channel" "A TPEAKStatus error code"
Source

pub unsafe fn CAN_GetStatus(&self, Channel: WORD) -> DWORD

Gets the current status of a PEAK Channel "The handle of a PEAK Channel" "A TPEAKStatus error code"
Source

pub unsafe fn CAN_Read( &self, Channel: WORD, MessageBuffer: *mut TPEAKMsg, TimestampBuffer: *mut TPEAKTimestamp, ) -> DWORD

Reads a CAN message from the receive queue of a PEAK Channel "The handle of a PEAK Channel" "A TPEAKMsg structure buffer to store the CAN message" "A TPEAKTimestamp structure buffer to get the reception time of the message. If this value is not desired, this parameter should be passed as NULL" "A TPEAKStatus error code"
Source

pub unsafe fn CAN_ReadFD( &self, Channel: WORD, MessageBuffer: *mut TPEAKMsgFD, TimestampBuffer: *mut UINT64, ) -> DWORD

Reads a CAN message from the receive queue of a FD capable PEAK Channel "The handle of a FD capable PEAK Channel" "A TPEAKMsgFD structure buffer to store the CAN message" "A TPEAKTimestampFD buffer to get the reception time of the message. If this value is not desired, this parameter should be passed as NULL" "A TPEAKStatus error code"
Source

pub unsafe fn CAN_Write( &self, Channel: WORD, MessageBuffer: *mut TPEAKMsg, ) -> DWORD

Transmits a CAN message "The handle of a PEAK Channel" "A TPEAKMsg buffer with the message to be sent" "A TPEAKStatus error code"
Source

pub unsafe fn CAN_WriteFD( &self, Channel: WORD, MessageBuffer: *mut TPEAKMsgFD, ) -> DWORD

Transmits a CAN message over a FD capable PEAK Channel "The handle of a FD capable PEAK Channel" "A TPEAKMsgFD buffer with the message to be sent" "A TPEAKStatus error code"
Source

pub unsafe fn CAN_FilterMessages( &self, Channel: WORD, FromID: DWORD, ToID: DWORD, Mode: BYTE, ) -> DWORD

Configures the reception filter. The message filter will be expanded with every call to this function. If it is desired to reset the filter, please use the CAN_SetValue function "The handle of a PEAK Channel" "The lowest CAN ID to be received" "The highest CAN ID to be received" "Message type, Standard (11-bit identifier) or Extended (29-bit identifier)" "A TPEAKStatus error code"
Source

pub unsafe fn CAN_GetValue( &self, Channel: WORD, Parameter: BYTE, Buffer: *mut c_void, BufferLength: DWORD, ) -> DWORD

Retrieves a PEAK Channel value Parameters can be present or not according with the kind of Hardware (PEAK Channel) being used. If a parameter is not available, a PEAK_ERROR_ILLPARAMTYPE error will be returned "The handle of a PEAK Channel" "The TPEAKParameter parameter to get" "Buffer for the parameter value" "Size in bytes of the buffer" "A TPEAKStatus error code"
Source

pub unsafe fn CAN_SetValue( &self, Channel: WORD, Parameter: BYTE, Buffer: *mut c_void, BufferLength: DWORD, ) -> DWORD

Configures or sets a PEAK Channel value Parameters can be present or not according with the kind of Hardware (PEAK Channel) being used. If a parameter is not available, a PEAK_ERROR_ILLPARAMTYPE error will be returned "The handle of a PEAK Channel" "The TPEAKParameter parameter to set" "Buffer with the value to be set" "Size in bytes of the buffer" "A TPEAKStatus error code"
Source

pub unsafe fn CAN_GetErrorText( &self, Error: DWORD, Language: WORD, Buffer: LPSTR, ) -> DWORD

Returns a descriptive text of a given TPEAKStatus error code, in any desired language The current languages available for translation are: Neutral (0x00), German (0x07), English (0x09), Spanish (0x0A), Italian (0x10) and French (0x0C) "A TPEAKStatus error code" "Indicates a 'Primary language ID'" "Buffer for a null terminated char array" "A TPEAKStatus error code"
Source

pub unsafe fn CAN_LookUpChannel( &self, Parameters: LPSTR, FoundChannel: *mut WORD, ) -> DWORD

Finds a PEAK-Basic channel that matches with the given parameters A comma separated string contained pairs of parameter-name/value to be matched within a PEAK-Basic channel Buffer for returning the PEAK-Basic channel, when found A TPEAKStatus error code

Auto Trait Implementations§

§

impl Freeze for Pcan

§

impl !RefUnwindSafe for Pcan

§

impl Send for Pcan

§

impl Sync for Pcan

§

impl Unpin for Pcan

§

impl !UnwindSafe for Pcan

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.