54 if (apChannelDescriptor == NULL) {
59 apChannelDescriptor->
pProtocol = &PROTOCOL[protocolType];
61 ret = fnInit(instanceId, &apChannelDescriptor->
busHandle);
64 const void * pConfig = gSys_ConfiguredChannelList[aChannelId].
pConfig;
66 ret = fnConfigure(&apChannelDescriptor->
busHandle, (
void*)pConfig);
82 if (apChannelDescriptor == NULL) {
85 if (apChannelDescriptor->
pProtocol == NULL) {
89 return(fnConfigure(&apChannelDescriptor->
busHandle, apChannelConfig));
102 if (apChannelDescriptor == NULL) {
105 if (apChannelDescriptor->
pProtocol == NULL) {
109 return(fnGetState(&apChannelDescriptor->
busHandle));
120 if (apChannelDescriptor == NULL) {
123 if (apChannelDescriptor->
pProtocol == NULL) {
127 return(fnGetConfig(&apChannelDescriptor->
busHandle, apChannelConfig));
139 if (apChannelDescriptor == NULL) {
142 if (apChannelDescriptor->
pProtocol == NULL) {
146 return(fnStart(&apChannelDescriptor->
busHandle));
157 if (apChannelDescriptor == NULL) {
160 if (apChannelDescriptor->
pProtocol == NULL) {
164 return(fnStop(&apChannelDescriptor->
busHandle,aTimeout));
176 if (apChannelDescriptor == NULL) {
179 if (apChannelDescriptor->
pProtocol == NULL) {
183 return(fnAcquireLock(&apChannelDescriptor->
busHandle,aTimeout));
193 if (apChannelDescriptor == NULL) {
196 if (apChannelDescriptor->
pProtocol == NULL) {
200 return(fnReleaseLock(&apChannelDescriptor->
busHandle));
216 if (apDeviceDescriptor == NULL) {
229 if ((apChannelDescriptor == NULL) || (apDeviceDescriptor == NULL)) {
232 if (apChannelDescriptor->
pProtocol == NULL) {
254 if (apDeviceDescriptor == NULL) {
275 return(
dm_device_readx(apDeviceDescriptor, aOffset, apReadBuffer, aBuffsize, aNbyteRead, flags));
287 if (apDeviceDescriptor == NULL) {
292 if (pChannelDescriptor == NULL) {
295 if (pChannelDescriptor->
pProtocol == NULL) {
299 return(fnRead(apDeviceDescriptor->
pEndpointHandle, aOffset, apReadBuffer, aBuffsize, aNbyteRead, aFlags));
313 return(
dm_device_writex(apDeviceDescriptor, aOffset, apWriteBuffer, aBuffsize, aNbyteWrite, flags));
326 if (apDeviceDescriptor == NULL) {
331 if (pChannelDescriptor == NULL) {
334 if (pChannelDescriptor->
pProtocol == NULL) {
338 return(fnWrite(apDeviceDescriptor->
pEndpointHandle, aOffset, apWriteBuffer, aBuffsize, aNbyteWrite, aFlags));
unsigned char uint8
This defines uint8 as unsigned char.
void * dm_ChannelConfig_ptr
This structure defines the user-specified parameters for channel configuration.
isf_status_t dm_channel_configure(dm_ChannelDescriptor_t *apChannelDescriptor, dm_ChannelConfig_ptr apChannelConfig)
This function reconfigures an already initialized channel.
sys_protocolType_t
This enumerator indexes protocol-specific functions and properties.
isf_status_t dm_channel_start(dm_ChannelDescriptor_t *apChannelDescriptor)
This function starts a channel.
isf_status_t(* fnWrite_t)(void *apEndpointHandle, int32 offset, uint8 *pWriteBuffer, uint32 buffsize, uint32 nBytesWrite, comm_Flags_t aFlags)
This is the the function pointer signature for writing the data to a specified device.
This structure contains protocol-specific function pointers and properties.
isf_status_t dm_device_writex(dm_DeviceDescriptor_t *apDeviceDescriptor, int32 aOffset, uint8 *apWriteBuffer, uint32 aBuffsize, uint32 aNbyteWrite, comm_Flags_t aFlags)
This function writes data to a device with extended write behavior.
const sys_channelDescriptor_t gSys_ConfiguredChannelList[]
uint32 comm_Id_t
This type is for a numeric channel identifier- index into an array of channels in the system...
isf_status_t dm_device_close(dm_DeviceDescriptor_t *apDeviceDescriptor)
This function closes a device.
isf_status_t(* fnDisconnectEndpoint_t)(void *apEndpointHandle)
This is the function pointer signature for closing the Endpoint.
isf_status_t(* fnStart_t)(void *apBusHandle)
This is the function pointer signature for starting the bus.
isf_status_t(* fnConnectToEndpoint_t)(void *apBusHandle, void *apDevice, void **apEndpointHandle)
This is the function pointer signature for getting the Endpoint handle.
dm_ChannelDescriptor_t * pChannelDescriptor
comm_State_t(* fnGetState_t)(void *apBusHandle)
This is the function pointer signature for getting the state of the bus.
isf_status_t dm_channel_get_config(dm_ChannelDescriptor_t *apChannelDescriptor, dm_ChannelConfig_ptr apChannelConfig)
This function returns the current channel configuration.
unsigned long uint32
This defines uint32 as unsigned long.
const uint8 gSys_NumChannels
const protocol_t PROTOCOL[]
Lookup table to find protocol-specific functions and properties. Indexed by sys_protocolType_t.
const protocol_t * pProtocol
isf_status_t dm_device_readx(dm_DeviceDescriptor_t *apDeviceDescriptor, int32 aOffset, uint8 *apReadBuffer, uint32 aBuffsize, uint32 aNbyteRead, comm_Flags_t aFlags)
This function reads from a device with extended behavior.
isf_status_t(* fnInit_t)(comm_Id_t aBusId, void *apBusHandle)
This is the function pointer signature for bus initialization.
isf_status_t(* fnStop_t)(void *apBusHandle, isf_duration_t aTimeout)
This is the function pointer signature for stopping the bus.
isf_status_t(* fnReleaseLock_t)(void *apBusHandle)
This is the function pointer signature for releasing the lock for a particular bus.
isf_protocol_adapter.h defines the general interface definition for the protocol adapter.
sys_protocolType_t protocolType
isf_status_t dm_channel_release_lock(dm_ChannelDescriptor_t *apChannelDescriptor)
This function releases exclusive channel access.
isf_status_t dm_channel_acquire_lock(dm_ChannelDescriptor_t *apChannelDescriptor, isf_duration_t aTimeout)
This function locks the channel for exclusive access.
isf_status_t dm_channel_stop(dm_ChannelDescriptor_t *apChannelDescriptor, isf_duration_t aTimeout)
This function stops a channel.
comm_Id_t protocolInstanceId
fnGetConfig_t fnGetConfig
isf_status_t dm_device_read(dm_DeviceDescriptor_t *apDeviceDescriptor, int32 aOffset, uint8 *apReadBuffer, uint32 aBuffsize, uint32 aNbyteRead)
This function reads from a device.
uint8 comm_Flags_t
This is a bit array of flags governing device read/write behavior.
fnReleaseLock_t fnReleaseLock
This structure defines the channel descriptor.
uint32 isf_duration_t
ISF time duration in microseconds.
long int32
This defines int32 as long.
isf_status_t dm_device_open(dm_ChannelDescriptor_t *apChannelDescriptor, void *apDevice, dm_DeviceDescriptor_t *apDeviceDescriptor)
This function creates a device handle for a device at a specified channel address.
fnConfigure_t fnConfigure
isf_status_t(* fnConfigure_t)(void *apBusHandle, void *apBusConfig)
This is the function pointer signature for setting the configuration of the bus.
dm_ChannelDescriptor_t * dm_channel_get_descriptor(dm_DeviceDescriptor_t *apDeviceDescriptor)
This function retrieves the channel descriptor from a device handle.
fnConnectToEndpoint_t fnGetEndPointAt
isf_status_t dm_channel_init(dm_ChannelId_t aChannelId, dm_ChannelDescriptor_t *apChannelDescriptor)
This function initializes a channel.
isf_status_t(* fnRead_t)(void *apEndpointHandle, int32 offset, void *apReadBuffer, uint32 buffsize, uint32 nBytesRead, comm_Flags_t aFlags)
This is the function pointer signature for reading the data from a specified device.
isf_status_t dm_device_write(dm_DeviceDescriptor_t *apDeviceDescriptor, int32 aOffset, uint8 *apWriteBuffer, uint32 aBuffsize, uint32 aNbyteWrite)
This function writes to a device.
fnDisconnectEndpoint_t fnDisEndPoint
int32 isf_status_t
ISF return status type.
enum comm_State_vals comm_State_t
This enum holds an enumerated value describing the state of a channel.
comm_State_t dm_channel_get_state(dm_ChannelDescriptor_t *apChannelDescriptor)
This function returns the channel state.
This structure defines a handle for the device.
isf_devmsg.h defines the API definitions and types for the Intelligent Sensing (ISF) Device Messaging...
This file defines the configuration types and structures for the system communication channel...
fnAcquireLock_t fnAcquireLock
This structure is a declaration of a channel descriptor type.
comm_Id_t dm_ChannelId_t
This typedef is a numeric channel identifier index into an array of channels in the system...
isf_status_t(* fnAcquireLock_t)(void *apBusHandle, isf_duration_t aTimeout)
This is the function pointer signature for acquiring the lock for a particular bus.
isf_status_t(* fnGetConfig_t)(void *apBusHandle, void *apBusConfig)
This is the function pointer signature for getting the configuration of the bus.