ISF  1.1
Intelligent Sensing Framework
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Include/isf_comm.h File Reference

isf_comm.h defines the common types for the Communications Service Family of the Intelligent Sensing Framework (ISF). More...

#include <isf.h>

Go to the source code of this file.

Data Structures

struct  comm_MessageBuffer_struct
 This structure defines a buffer to hold data read from or written to a device. More...
struct  comm_Command_struct
 This structure defines the command sent to a device. More...

Defines

#define COMM_SIZED_BUFFER(bufSize)   struct { uint16 size; uint8 buffer[(bufSize)]; }
 This macro is used for creating sized read/write buffers.
#define COMM_CMD_DEFN(cmdLen)   struct { uint16 nWrite; uint16 nRead; uint8 cmdWords[(cmdLen)]; }
 This macro is used for creating concretely sized typedefs compatible with type comm_Command_t.

Typedefs

typedef uint8 comm_Id_t
 This type is for a numeric channel identifier- index into an array of channels in the system.
typedef enum comm_State_vals comm_State_t
 This enum holds an enumerated value describing the state of a channel.
typedef uint16 comm_Address_t
 This type is for a channel address for both 7-bit and 10-bit addresses.
typedef uint32 comm_Flags_t
 This is a bit array of flags governing device read/write behavior.
typedef struct
comm_MessageBuffer_struct 
comm_MessageBuffer_t
 This structure defines a buffer to hold data read from or written to a device.
typedef struct comm_Command_struct comm_Command_t
 This structure defines the command sent to a device.

Enumerations

enum  comm_State_vals {
  COMM_STATE_NO_INIT = 0, COMM_STATE_INIT = 1, COMM_STATE_OK = 2, COMM_STATE_STOPPED = 3,
  COMM_STATE_LOCKED = 4, COMM_STATE_ERROR = 5, COMM_STATE_ARB_LOST = 6
}
 This enum defines the possible communications channel states. More...
enum  comm_Error_vals {
  COMM_ERROR_INIT = 1, COMM_ERROR_STOP = 2, COMM_ERROR_LOCK = 3, COMM_ERROR_TIME_OUT = 4,
  COMM_ERROR_NULL_PTR = 5, COMM_ERROR_NOEXIST = 6, COMM_ERROR_BUF_SIZE = 7, COMM_ERROR_NO_ACK = 8,
  COMM_ERROR_DEV_CLOSED = 9, COMM_ERROR_OTHER = 10
}
 This enum defines the possible communications channel error codes. More...

Detailed Description

isf_comm.h defines the common types for the Communications Service Family of the Intelligent Sensing Framework (ISF).

File: isf_comm.h

Copyright (c) 2012, Freescale Semiconductor, Inc.

This common types used by components in the ISF Communications Service Family, including the I2C and Device Messaging Components. Since the Device Messaging Component abstracts various communications interfaces (I2C, SPI, RGPIO), it is important to ensure that all abstracted components use common data types and function prototypes. These types and prototypes are defined in the header file rather than in the Device Messaging header file to avoid creating a circular dependency.

Definition in file isf_comm.h.


Define Documentation

#define COMM_CMD_DEFN (   cmdLen)    struct { uint16 nWrite; uint16 nRead; uint8 cmdWords[(cmdLen)]; }

This macro is used for creating concretely sized typedefs compatible with type comm_Command_t.

Definition at line 29 of file isf_comm.h.

#define COMM_SIZED_BUFFER (   bufSize)    struct { uint16 size; uint8 buffer[(bufSize)]; }

This macro is used for creating sized read/write buffers.

Definition at line 25 of file isf_comm.h.


Typedef Documentation

This type is for a channel address for both 7-bit and 10-bit addresses.

Definition at line 65 of file isf_comm.h.

This structure defines the command sent to a device.

This is a bit array of flags governing device read/write behavior.

Definition at line 68 of file isf_comm.h.

typedef uint8 comm_Id_t

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

Definition at line 59 of file isf_comm.h.

This structure defines a buffer to hold data read from or written to a device.

This enum holds an enumerated value describing the state of a channel.

Definition at line 62 of file isf_comm.h.


Enumeration Type Documentation

This enum defines the possible communications channel error codes.

Enumerator:
COMM_ERROR_INIT 

A channel initialization error has occurred.

COMM_ERROR_STOP 

A channel stop-related error has occurred.

COMM_ERROR_LOCK 

A channel lock-related error has occurred.

COMM_ERROR_TIME_OUT 

Channel has timed out.

COMM_ERROR_NULL_PTR 

A null pointer was provided as an argument.

COMM_ERROR_NOEXIST 

The referenced entity does not exist.

COMM_ERROR_BUF_SIZE 

The provided buffer is too small.

COMM_ERROR_NO_ACK 

An acknowledgement was not received.

COMM_ERROR_DEV_CLOSED 

Attempted read/write to a closed device.

COMM_ERROR_OTHER 

An unspecified channel error has occured.

Definition at line 44 of file isf_comm.h.

This enum defines the possible communications channel states.

Enumerator:
COMM_STATE_NO_INIT 

Channel has not been initialized.

COMM_STATE_INIT 

Channel is initialized, but not ready to use because channel is not started or configured.

COMM_STATE_OK 

Channel is ready to use without errors.

COMM_STATE_STOPPED 

Channel is currently stopped.

COMM_STATE_LOCKED 

Channel is locked (busy).

COMM_STATE_ERROR 

A null pointer was provided as an argument.

COMM_STATE_ARB_LOST 

Channel arbitration has been lost.

Definition at line 33 of file isf_comm.h.