ISF  2.1
Intelligent Sensing Framework for Kinetis with Processor Expert
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
isf_devmsg.h File Reference

isf_devmsg.h defines the API definitions and types for the Intelligent Sensing (ISF) Device Messaging (DM) component. More...

#include <isf.h>
#include <isf_comm.h>
#include "isf_protocol_adapter.h"
Include dependency graph for isf_devmsg.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dm_ChannelDescriptor_struct
 This structure is a declaration of a channel descriptor type. More...
 
struct  dm_DeviceDescriptor_struct
 This structure defines a handle for the device. More...
 

Macros

#define INVALID_OFFSET   (-1)
 This macro defines the invalid offset for the read and write functions. More...
 

Typedefs

typedef comm_Id_t dm_ChannelId_t
 This typedef is a numeric channel identifier index into an array of channels in the system. More...
 
typedef void * dm_ChannelConfig_ptr
 This structure defines the user-specified parameters for channel configuration. More...
 
typedef struct
dm_ChannelDescriptor_struct 
dm_ChannelDescriptor_t
 This structure is a declaration of a channel descriptor type. More...
 
typedef struct
dm_DeviceDescriptor_struct 
dm_DeviceDescriptor_t
 This structure defines a handle for the device. More...
 

Functions

dm_ChannelDescriptor_tdm_channel_get_descriptor (dm_DeviceDescriptor_t *apDeviceDescriptor)
 This function retrieves the channel descriptor from a device handle. More...
 
Initialization Routines
isf_status_t dm_channel_init (dm_ChannelId_t aChannelId, dm_ChannelDescriptor_t *apChannelDescriptor)
 This function initializes a channel. More...
 
isf_status_t dm_channel_configure (dm_ChannelDescriptor_t *apChannelDescriptor, dm_ChannelConfig_ptr apChannelConfig)
 This function reconfigures an already initialized channel. More...
 
Queries and Status
comm_State_t dm_channel_get_state (dm_ChannelDescriptor_t *apChannelDescriptor)
 This function returns the channel state. More...
 
isf_status_t dm_channel_get_config (dm_ChannelDescriptor_t *apChannelDescriptor, dm_ChannelConfig_ptr apChannelConfig)
 This function returns the current channel configuration. More...
 
Device Control Routines
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. More...
 
isf_status_t dm_device_close (dm_DeviceDescriptor_t *apDeviceDescriptor)
 This function closes a device. More...
 
Channel Control Routines
isf_status_t dm_channel_start (dm_ChannelDescriptor_t *apChannelDescriptor)
 This function starts a channel. More...
 
isf_status_t dm_channel_stop (dm_ChannelDescriptor_t *apChannelDescriptor, isf_duration_t aTimeout)
 This function stops a channel. More...
 
isf_status_t dm_channel_acquire_lock (dm_ChannelDescriptor_t *apChannelDescriptor, isf_duration_t aTimeout)
 This function locks the channel for exclusive access. More...
 
isf_status_t dm_channel_release_lock (dm_ChannelDescriptor_t *apChannelDescriptor)
 This function releases exclusive channel access. More...
 
Device Operation Routines
isf_status_t dm_device_read (dm_DeviceDescriptor_t *apDeviceDescriptor, int32 aOffset, uint8 *apReadBuffer, uint32 aBuffsize, uint32 aNbyteRead)
 This function reads from a device. More...
 
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. More...
 
isf_status_t dm_device_write (dm_DeviceDescriptor_t *apDeviceDescriptor, int32 aOffset, uint8 *apWriteBuffer, uint32 aBuffsize, uint32 aNbyteWrite)
 This function writes to a device. More...
 
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. More...
 

Detailed Description

isf_devmsg.h defines the API definitions and types for the Intelligent Sensing (ISF) Device Messaging (DM) component.

File: isf_devmsg.h

Copyright (c) 2012-2014, Freescale Semiconductor, Inc.

Definition in file isf_devmsg.h.

Macro Definition Documentation

#define INVALID_OFFSET   (-1)

This macro defines the invalid offset for the read and write functions.

Definition at line 67 of file isf_devmsg.h.

Referenced by i2c_master_adapter_read(), and i2c_master_adapter_write().

Typedef Documentation

typedef void* dm_ChannelConfig_ptr

This structure defines the user-specified parameters for channel configuration.

This type allows the device messaging APIs to handle a protocol-specific configuration pointer opaquely until it is passed to the specific protocol functions that use the data.

Definition at line 42 of file isf_devmsg.h.

This structure is a declaration of a channel descriptor type.

The channel descriptor contains the bus and protocol information required by the device messaging functions to safely use a channel for communications. The members are ordered to maintain natural alignment without inserting padding bytes.

This typedef is a numeric channel identifier index into an array of channels in the system.

Definition at line 33 of file isf_devmsg.h.

This structure defines a handle for the device.

The device handle contains the information required by the device messaging functions to address and communicate with a slave device.

Function Documentation

isf_status_t dm_channel_acquire_lock ( dm_ChannelDescriptor_t apChannelDescriptor,
isf_duration_t  aTimeout 
)

This function locks the channel for exclusive access.

dm_channel_acquire_lock() serializes multi-client access. Each channel user must acquire a lock prior to sending device messages. While holding the channel lock, no other clients may perform any channel operations. Therefore, it is important to release the lock with dm_channel_release_lock() as soon as practical.

Parameters
[in]apChannelDescriptorThe handle of the channel to be started.
[in]aTimeoutThe time to wait for the lock before returning without the lock. The timeout parameter may be set to zero to wait for calls that fail to return without acquiring the lock, or wait as long as necessary for the lock to be acquired.
Returns
dm_channel_acquire_lock() returns a value of type isf_status_t indicating whether the operation was successful or unsuccessful.
Return values
ISF_SUCCESSis returned when the channel lock is acquired.
COMM_ERROR_INITis returned when the channel handle refers to a non-initialized channel.
COMM_ERROR_TIME_OUTis returned when the request could not be fulfilled in the specified timeout period.
COMM_ERROR_NULL_PTRis returned when a NULL pointer argument was passed into the function.
Constraints:
The following constraints must be observed when using this function:
  • The actual time spent in the call may be longer than the specified timeout due to the granularity of the timer used.
  • A valid device handle should be passed into the function.
  • apChannelDescriptor must be valid. A valid channel descriptor is created when dm_channel_init() returns successfully.
Reentrant: Yes
Link Libraries:
None

Definition at line 174 of file isf_device_messaging.c.

References dm_ChannelDescriptor_struct::busHandle, COMM_ERROR_INIT, COMM_ERROR_NULL_PTR, protocol_t::fnAcquireLock, and dm_ChannelDescriptor_struct::pProtocol.

Referenced by fsl_fxas21002_i2cspi_3D_gyro_Configure(), fsl_fxls8471_i2cspi_3D_accel_Configure(), fsl_fxos8700_i2cspi_6D_AccMag_Configure(), fsl_mag3110_i2c_3D_mag_Configure(), fsl_mma865x_i2c_3D_accel_Configure(), and fsl_mpl3115_i2c_1D_press_Configure().

Here is the caller graph for this function:

isf_status_t dm_channel_configure ( dm_ChannelDescriptor_t apChannelDescriptor,
dm_ChannelConfig_ptr  apChannelConfig 
)

This function reconfigures an already initialized channel.

A channel may be reconfigured after initialization. Calls to dm_channel_configure() after initialization will override any previous configuration values and must be made while the channel state is COMM_STATE_STOPPED. The typical usage involves retrieving the current configuration using dm_channel_get_config(), making modifications to the returned configuration, and then calling dm_channel_configure() with the updated configuration. The channel is implicitly locked during the configuration.

Parameters
[in]apChannelDescriptorThe handle of the channel to be configured.
[in]apChannelConfigThe channel configuration used during initialization.
Returns
dm_channel_configure() returns a value of type isf_status_t indicating whether the operation was successful or unsuccessful.
Return values
ISF_SUCCESSis returned when the channel was reconfigured successfully.
COMM_ERROR_STOPis returned when the channel was not STOPPED.
COMM_ERROR_NULL_PTRis returned when a NULL pointer argument was passed into the function.
COMM_ERROR_TIME_OUTis returned when the request could not be fulfilled in the specified timeout period.
Constraints:
The following constraints must be observed when using this function:
  • apChannelDescriptor must be valid. A valid channel descriptor is created when the dm_channel_init() function call is successfully returned.
Reentrant: Yes
Link Libraries:
None

Definition at line 80 of file isf_device_messaging.c.

References dm_ChannelDescriptor_struct::busHandle, COMM_ERROR_INIT, COMM_ERROR_NULL_PTR, protocol_t::fnConfigure, and dm_ChannelDescriptor_struct::pProtocol.

Referenced by fsl_fxls8471_i2cspi_3D_accel_Initialize().

Here is the caller graph for this function:

isf_status_t dm_channel_get_config ( dm_ChannelDescriptor_t apChannelDescriptor,
dm_ChannelConfig_ptr  apChannelConfig 
)

This function returns the current channel configuration.

A channel may be queried for the current configuration.

Parameters
[in]apChannelDescriptorThe handle of the channel to be configured.
[out]apChannelConfigThe address of a channel configuration to be filled.
Returns
dm_channel_get_config() returns a value of type isf_status_t indicating whether the operation was successful or unsuccessful.
Return values
ISF_SUCCESSis returned when the channel configuration is retrieved successfully.
COMM_ERROR_NULL_PTRis returned when a NULL pointer argument was passed into the function.
COMM_ERROR_INITis returned when the channel handle refers to a non-initialized channel.
Constraints:
The following constraints must be observed when using this function:
  • apChannelDescriptor must be valid. A valid channel descriptor is created when the dm_channel_init() function call returns successfully.
Reentrant: Yes
Link Libraries:
None

Definition at line 118 of file isf_device_messaging.c.

References dm_ChannelDescriptor_struct::busHandle, COMM_ERROR_INIT, COMM_ERROR_NULL_PTR, protocol_t::fnGetConfig, and dm_ChannelDescriptor_struct::pProtocol.

dm_ChannelDescriptor_t* dm_channel_get_descriptor ( dm_DeviceDescriptor_t apDeviceDescriptor)

This function retrieves the channel descriptor from a device handle.

dm_channel_get_descriptor() returns the channel descriptor associated with the channel on which the device resides.

Parameters
[in]apDeviceDescriptorHandle of device connected on the channel of interest.
Returns
dm_channel_get_descriptor() returns a value of type dm_ChannelDescriptor_t which is pointer to an object.
Return values
NULLis returned when the specified device handle is invalid.
Constraints:
None
Constraints:
The following constraints must be observed when using this function:
  • apDeviceDescriptor must be valid. A valid device handle is created when the dm_device_open() returns successfully.
Reentrant: Yes
Link Libraries:
isf_core.lib

Definition at line 214 of file isf_device_messaging.c.

References dm_DeviceDescriptor_struct::pChannelDescriptor.

comm_State_t dm_channel_get_state ( dm_ChannelDescriptor_t apChannelDescriptor)

This function returns the channel state.

A channel may be queried for its current state.

Parameters
[in]apChannelDescriptorThe handle of the channel to be queried.
Returns
dm_channel_get_state() returns a value of type comm_State_t indicating the current state of the channel.
Return values
COMM_ERROR_NULL_PTRis returned when a NULL pointer argument was passed into the function.
Constraints:
The following constraints must be observed when using this function:
  • apChannelDescriptor must be valid. A valid channel descriptor is created when dm_channel_init() function call returns successfully.
Reentrant: Yes
Link Libraries:
None

Definition at line 100 of file isf_device_messaging.c.

References dm_ChannelDescriptor_struct::busHandle, COMM_ERROR_INIT, COMM_ERROR_NULL_PTR, protocol_t::fnGetState, and dm_ChannelDescriptor_struct::pProtocol.

Referenced by ci_init(), fsl_fxas21002_i2cspi_3D_gyro_Initialize(), fsl_fxls8471_i2cspi_3D_accel_Initialize(), fsl_fxos8700_i2cspi_6D_AccMag_Initialize(), fsl_mag3110_i2c_3D_mag_Initialize(), fsl_mma865x_i2c_3D_accel_Initialize(), and fsl_mpl3115_i2c_1D_press_Initialize().

Here is the caller graph for this function:

isf_status_t dm_channel_init ( dm_ChannelId_t  aChannelId,
dm_ChannelDescriptor_t apChannelDescriptor 
)

This function initializes a channel.

A channel must be initialized prior to use. Initialization creates the channel and initializes the data structures required to manage the channel. The channel is implicitly locked during the initialization.

Parameters
[in]aChannelIdThe ID of the channel to initialize. This is an index into the array of known channels that can be used.
[out]apChannelDescriptorThe address of the channel descriptor structure to be initialized.
Returns
dm_channel_init() returns a value of type isf_status_t indicating whether the operation was successful or unsuccessful.
Return values
ISF_SUCCESSis returned when the channel initialized successfully and the apChannelDescriptor structure reference has been populated with initialized channel data.
COMM_ERROR_NOEXISTis returned when the supplied channel identifier does not exist.
COMM_ERROR_NULL_PTRis returned when a NULL pointer argument was passed into the function.
COMM_ERROR_INITis returned when the channel could not be initialized.
Reentrant: Yes
Link Libraries:
None

Definition at line 48 of file isf_device_messaging.c.

References dm_ChannelDescriptor_struct::busHandle, COMM_ERROR_NOEXIST, COMM_ERROR_NULL_PTR, COMM_STATE_INIT, protocol_t::fnConfigure, protocol_t::fnGetState, protocol_t::fnInit, gSys_NumChannels, sys_channelDescriptor_t::pConfig, dm_ChannelDescriptor_struct::pProtocol, sys_channelDescriptor_t::protocolInstanceId, and sys_channelDescriptor_t::protocolType.

Referenced by ci_init(), fsl_fxas21002_i2cspi_3D_gyro_Initialize(), fsl_fxls8471_i2cspi_3D_accel_Initialize(), fsl_fxos8700_i2cspi_6D_AccMag_Initialize(), fsl_mag3110_i2c_3D_mag_Initialize(), fsl_mma865x_i2c_3D_accel_Initialize(), fsl_mpl3115_i2c_1D_press_Initialize(), and isf_rli_init().

Here is the caller graph for this function:

isf_status_t dm_channel_release_lock ( dm_ChannelDescriptor_t apChannelDescriptor)

This function releases exclusive channel access.

dm_channel_release_lock() is used to relinquish exclusive access on a paricular channel. It is the inverse of dm_channel_acquire_lock().

Parameters
[in]apChannelDescriptorThe handle of the channel to unlock.
Returns
dm_channel_release_lock() returns a value of type isf_status_t indicating whether the operation was successful or unsuccessful.
Return values
ISF_SUCCESSis returned when the channel released successfully.
COMM_ERROR_INITis returned when the channel handle refers to a non-initialized channel.
COMM_ERROR_LOCKis returned when no lock was held on the specified channel.
COMM_ERROR_NULL_PTRis returned when a NULL pointer argument was passed into the function.
Reentrant: Yes
Link Libraries:
None

Definition at line 191 of file isf_device_messaging.c.

References dm_ChannelDescriptor_struct::busHandle, COMM_ERROR_INIT, COMM_ERROR_NULL_PTR, protocol_t::fnReleaseLock, and dm_ChannelDescriptor_struct::pProtocol.

Referenced by fsl_fxas21002_i2cspi_3D_gyro_Configure(), fsl_fxls8471_i2cspi_3D_accel_Configure(), fsl_fxos8700_i2cspi_6D_AccMag_Configure(), fsl_mag3110_i2c_3D_mag_Configure(), fsl_mma865x_i2c_3D_accel_Configure(), and fsl_mpl3115_i2c_1D_press_Configure().

Here is the caller graph for this function:

isf_status_t dm_channel_start ( dm_ChannelDescriptor_t apChannelDescriptor)

This function starts a channel.

dm_channel_start() enables communications with an initialized channel. This call enables the hardware peripherals associated with the channel. The channel is implicitly locked during the start operation.

Parameters
[in]apChannelDescriptorThe handle of the channel to be started.
Returns
dm_channel_start() returns a value of type isf_status_t indicating whether the operation was successful or unsuccessful.
Return values
ISF_SUCCESSis returned when the channel was started successfully.
COMM_ERROR_INITis returned when the channel handle refers to a non-initialized channel.
COMM_ERROR_NULL_PTRis returned when a NULL pointer argument was passed into the function.
COMM_ERROR_TIME_OUTis returned when the request could not be fulfilled in the specified timeout period.
Constraints:
The following constraints must be observed when using this function:
  • apDeviceDescriptor must be valid. A valid device handle is created when the dm_device_open() function call returns successfully.
Reentrant: Yes
Link Libraries:
None

Definition at line 137 of file isf_device_messaging.c.

References dm_ChannelDescriptor_struct::busHandle, COMM_ERROR_INIT, COMM_ERROR_NULL_PTR, protocol_t::fnStart, and dm_ChannelDescriptor_struct::pProtocol.

Referenced by ci_init(), fsl_fxas21002_i2cspi_3D_gyro_Initialize(), fsl_fxls8471_i2cspi_3D_accel_Initialize(), fsl_fxos8700_i2cspi_6D_AccMag_Initialize(), fsl_mag3110_i2c_3D_mag_Initialize(), fsl_mma865x_i2c_3D_accel_Initialize(), fsl_mpl3115_i2c_1D_press_Initialize(), and isf_rli_init().

Here is the caller graph for this function:

isf_status_t dm_channel_stop ( dm_ChannelDescriptor_t apChannelDescriptor,
isf_duration_t  aTimeout 
)

This function stops a channel.

dm_channel_stop() disables an initialized channel and stops communications with the channel. This call disables the hardware peripherals associated with the channel. The channel is implicitly locked during the stop operation.

Parameters
[in]apChannelDescriptorThe handle of the channel to be stopped.
[in]aTimeoutThe time to wait for the channel to stop before returning a failure. The timeout parameter may be set to zero to never return without stopping the channel, i.e. wait as long as required for the channel to stop.
Returns
dm_channel_stop() returns a value of type isf_status_t indicating whether the operation was successful or unsuccessful.
Return values
ISF_SUCCESSis returned when the channel is successfully stopped.
COMM_ERROR_INITis returned when the channel handle refers to a non-initialized channel.
COMM_ERROR_NULL_PTRis returned when a NULL pointer argument was passed into the function.
COMM_ERROR_TIME_OUTis returned when the request could not be fulfilled in the specified timeout period.
Reentrant: Yes
Link Libraries:
None

Definition at line 155 of file isf_device_messaging.c.

References dm_ChannelDescriptor_struct::busHandle, COMM_ERROR_INIT, COMM_ERROR_NULL_PTR, protocol_t::fnStop, and dm_ChannelDescriptor_struct::pProtocol.

isf_status_t dm_device_close ( dm_DeviceDescriptor_t apDeviceDescriptor)

This function closes a device.

The dm_device_close() function is used when no further communication with the device is needed. A closed device should not be passed to dm_device_read() or dm_device_write(). The channel is implicitly locked during the close operation.

Parameters
[in]apDeviceDescriptorThe address of the DeviceHandle to be closed.
Returns
dm_device_open() returns a value of type isf_status_t indicating whether the operation was successful or unsuccessful.
Return values
ISF_SUCCESSis returned when the device changes to closed.
COMM_ERROR_NULL_PTRis returned when a NULL pointer argument was passed into the function.
Constraints:
The following constraints must be observed when using this function:
  • apDeviceDescriptor must be valid. A valid device handle is created when the dm_device_open() function call returns successfully.
Reentrant: Yes
Link Libraries:
None

Definition at line 252 of file isf_device_messaging.c.

References COMM_ERROR_NULL_PTR, protocol_t::fnDisEndPoint, dm_DeviceDescriptor_struct::pChannelDescriptor, dm_DeviceDescriptor_struct::pEndpointHandle, and dm_ChannelDescriptor_struct::pProtocol.

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.

The dm_device_open() function may be used to get a handle to a device at a known channel address. The channel is implicity locked during the open.

Parameters
[in]apChannelDescriptorThe handle of the channel to be opened.
[in]apDeviceThe known information of a device.
[out]apDeviceDescriptorThe address of a DeviceHandle to be filled. dm_device_open() fills the provided device handle structure with valid data when a device is found at the specified address.
Returns
dm_channel_configure() returns a value of type isf_status_t indicating the success or failure of the function call.
Return values
ISF_SUCCESSis returned when the device is located and a valid handle is returned.
COMM_ERROR_NOEXISTis returned when a device does not exist at the specified address.
COMM_ERROR_INITis returned when the channel handle refers to a non-initialized channel.
COMM_ERROR_STOPis returned when the channel has not been started.
COMM_ERROR_NULL_PTRis returned when a NULL pointer argument was passed into the function.
COMM_ERROR_TIME_OUTis returned when the request could not be fulfilled in the specified timeout period.
Constraints:
The following constraints must be observed when using this function:
  • apChannelDescriptor must be valid. A valid channel descriptor is created when the dm_channel_init() function call returns successfully.
Reentrant: Yes
Link Libraries:
None

Definition at line 227 of file isf_device_messaging.c.

References dm_ChannelDescriptor_struct::busHandle, COMM_ERROR_INIT, COMM_ERROR_NULL_PTR, protocol_t::fnGetEndPointAt, ISF_SUCCESS, dm_DeviceDescriptor_struct::pChannelDescriptor, dm_DeviceDescriptor_struct::pEndpointHandle, and dm_ChannelDescriptor_struct::pProtocol.

Referenced by ci_init(), fsl_fxas21002_i2cspi_3D_gyro_Initialize(), fsl_fxls8471_i2cspi_3D_accel_Initialize(), fsl_fxos8700_i2cspi_6D_AccMag_Initialize(), fsl_mag3110_i2c_3D_mag_Initialize(), fsl_mma865x_i2c_3D_accel_Initialize(), fsl_mpl3115_i2c_1D_press_Initialize(), and isf_rli_open().

Here is the caller graph for this function:

isf_status_t dm_device_read ( dm_DeviceDescriptor_t apDeviceDescriptor,
int32  aOffset,
uint8 apReadBuffer,
uint32  aBuffsize,
uint32  aNbyteRead 
)

This function reads from a device.

dm_device_read() reads data from the specified device. The supplied command is sent to the device triggering the device to return some data. Any data returned by the device is read and placed in the provided read buffer. Note that if the command sent does not trigger the device to return data, the dm_device_read() simply returns 0 bytes read. The device is implicitly locked during the read.

Parameters
[in]apDeviceDescriptorThe handle to the device from which to read.
[in]aOffsetThe offset/sub address from which the read is performed.
[in]apReadBufferThe Buffer address where any returned data is placed.
[in]aBuffsizeThe size of the buffer.
[in]aNbyteReadThe number of bytes to read.
Returns
dm_device_read() returns a value of type isf_status_t indicating whether the operation was successful or unsuccessful.
Return values
ISF_SUCCESSis returned when data from the device was read successfully.
COMM_ERROR_INITis returned when the channel handle refers to a non-initialized channel.
COMM_ERROR_BUF_SIZEis returned when the provided buffer is too small to hold all the data or the number of bytes read is zero.
COMM_ERROR_NO_ACKis returned when no acknowledgement was received from the device.
COMM_ERROR_NULL_PTRis returned when a NULL pointer argument was passed into the function.
COMM_ERROR_TIME_OUTis returned when the request could not be fulfilled in the specified timeout period.
COMM_ERROR_LOCKis returned when a lock could not be acquired properly.
COMM_ERROR_DEV_CLOSEDis returned when the read is invoked on a closed device.
Reentrant: Yes
Link Libraries:
None

Definition at line 271 of file isf_device_messaging.c.

References dm_device_readx().

Referenced by fsl_fxas21002_i2cspi_3D_gyro_Configure(), fsl_fxas21002_i2cspi_3D_gyro_PeriodicCallback(), fsl_fxos8700_i2cspi_6D_AccMag_Configure(), fsl_fxos8700_i2cspi_6D_AccMag_PeriodicCallback(), fsl_mag3110_i2c_3D_mag_Configure(), fsl_mag3110_i2c_3D_mag_PeriodicCallback(), fxls8471_CheckId(), fxls8471_GetData(), isf_rli_read(), mag3110_CheckId(), mag3110_GetData(), mag3110_SetConfig(), mma865x_CheckId(), mma865x_GetData(), mpl3115_CheckId(), mpl3115_GetData(), mpl3115_ReadRegisters(), and task_ci().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

dm_device_readx() reads data from the specified device. The supplied command is sent to the device which may trigger the device to return some data. Any data returned by the device is read and placed in the provided read buffer. dm_device_readx() modifies the basic behavior of the read command by passing a set of bit flags to the underlying protocol interface. To successfully use the extended behavior, it is necessary to understand the underlying protocol being used and to pass the appropriate flag values. The device is implicitly locked during the extension read.

Parameters
[in]apDeviceDescriptorThe handle to the device from which to read.
[in]aOffsetThe offset/sub address from which the read is performed.
[in]apReadBufferThe Buffer address where any returned data is placed.
[in]aBuffsizeThe size of the buffer.
[in]aNbyteReadThe number of bytes to read.
[in]aFlagsA set of bit flags controlling the behavior of the write.
Returns
dm_device_readx() returns a value of type isf_status_t indicating whether the operation was successful or unsuccessful.
Return values
ISF_SUCCESSis returned when the device was read successfully.
COMM_ERROR_INITis returned when the channel handle refers to a non-initialized channel.
COMM_ERROR_BUF_SIZEThe provided buffer is too small to hold all the data or the number of bytes to read is zero.
COMM_ERROR_NO_ACKis returned when no acknowledgement was received from the device.
COMM_ERROR_NULL_PTRis returned when a NULL pointer argument was passed into the function.
COMM_ERROR_TIME_OUTis returned when the request could not be fulfilled in the specified timeout period.
COMM_ERROR_LOCKis returned when a lock could not be acquired properly.
COMM_ERROR_DEV_CLOSEDis returned when the read is invoked on a closed device.
Constraints:
The following constraints must be observed when using this function:
  • apDeviceDescriptor must be valid. A valid device handle is created when the dm_device_open() returns successfully.
Reentrant: Yes
Link Libraries:
None

Definition at line 284 of file isf_device_messaging.c.

References COMM_ERROR_DEV_CLOSED, COMM_ERROR_INIT, COMM_ERROR_NULL_PTR, protocol_t::fnRead, dm_DeviceDescriptor_struct::pChannelDescriptor, dm_DeviceDescriptor_struct::pEndpointHandle, and dm_ChannelDescriptor_struct::pProtocol.

Referenced by dm_device_read().

Here is the caller graph for this function:

isf_status_t dm_device_write ( dm_DeviceDescriptor_t apDeviceDescriptor,
int32  aOffset,
uint8 apWriteBuffer,
uint32  aBuffsize,
uint32  aNbyteWrite 
)

This function writes to a device.

dm_device_write() writes data to the specified device. The device is implicitly locked during the write.

Parameters
[in]apDeviceDescriptorThe handle of the device to which to write.
[in]aOffsetThe offset/sub address to which the write is performed.
[in]apWriteBufferThe Buffer address where any write data is placed.
[in]aBuffsizeThe size of the buffer.
[in]aNbyteWriteThe number of bytes to write.
Returns
dm_device_write() returns a value of type isf_status_t indicating whether the operation was successful or unsuccessful.
Return values
ISF_SUCCESSis returned when the device was written successfully.
COMM_ERROR_INITis returned when the channel handle refers to a non-initialized channel.
COMM_ERROR_STOPis returned when the write is invoked on a stopped channel.
COMM_ERROR_NO_ACKis returned when no acknowledgement was received from the device.
COMM_ERROR_NULL_PTRis returned when a NULL pointer argument was passed into the function.
COMM_ERROR_TIME_OUTis returned when the request could not be fulfilled in the specified timeout period.
COMM_ERROR_LOCKis returned when a lock could not be acquired properly.
COMM_ERROR_DEV_CLOSEDis returned when the write is invoked on a closed device.
Constraints:
The following constraints must be observed when using this function:
  • apDeviceDescriptor must be valid. A valid device handle is created when the dm_device_open() returns successfully.
Reentrant: Yes
Link Libraries:
None

Definition at line 309 of file isf_device_messaging.c.

References dm_device_writex().

Referenced by ci_send_packet(), fsl_fxas21002_i2cspi_3D_gyro_Configure(), fsl_fxos8700_i2cspi_6D_AccMag_Configure(), fxls8471_Reset(), fxls8471_SetConfig(), isf_rli_write(), mag3110_SetConfig(), mma865x_Reset(), mma865x_SetConfig(), mpl3115_Reset(), and mpl3115_SetConfig().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

dm_device_writex() writes data to the specified device. This function modifies the basic behaviour of the write command by passing a set of bit flags to the underlying protocol interface. To successfully use the extended behavior, it is necessary to understand the underlying protocol used and to pass the appropriate flag values. As an example, if it is known that the underlying device is an I2C bus, it is possible to set the appropriate flag values to explicitly control the RepeatedStart behavior at the conclusion of the dm_device_write() call. The device is implicitly locked during the extension write.

Parameters
[in]apDeviceDescriptorThe handle of the device to which to write.
[in]aOffsetThe offset/sub address to which the write is performed.
[in]apWriteBufferThe Buffer address where any write data is placed.
[in]aBuffsizeThe size of the buffer.
[in]aNbyteWriteThe number of bytes to write..
[in]aFlagsA set of bit flags controlling the behavior of the write.
Returns
dm_device_writex() returns a value of type isf_status_t indicating whether the operation was successful or unsuccessful.
Return values
ISF_SUCCESSis returned when the data was successfully written to the device.
COMM_ERROR_INITis returned when the channel handle refers to a non-initialized channel.
COMM_ERROR_NO_ACKis returned when no acknowledgement was received from the device.
COMM_ERROR_NULL_PTRis returned when a NULL pointer argument was passed into the function.
COMM_ERROR_TIME_OUTis returned when the request could not be fulfilled in the specified timeout period.
COMM_ERROR_LOCKis returned when a lock could not be acquired properly.
COMM_ERROR_DEV_CLOSEDis returned when the write is invoked on a closed device.
Constraints:
The following constraints must be observed when using this function:
  • apDeviceDescriptor must be valid. A valid device handle is created when the dm_device_open() function returns successfully.
Reentrant: Yes
Link Libraries:
isf_core.lib

Definition at line 324 of file isf_device_messaging.c.

References COMM_ERROR_DEV_CLOSED, COMM_ERROR_INIT, COMM_ERROR_NULL_PTR, protocol_t::fnWrite, dm_DeviceDescriptor_struct::pChannelDescriptor, dm_DeviceDescriptor_struct::pEndpointHandle, and dm_ChannelDescriptor_struct::pProtocol.

Referenced by dm_device_write().

Here is the caller graph for this function: