ISF  2.1
Intelligent Sensing Framework for Kinetis with Processor Expert
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
isf_comm.h
Go to the documentation of this file.
1 /*!
2 ********************************************************************************
3 * File: isf_comm.h
4 *
5 * Copyright (c) 2012, Freescale Semiconductor, Inc.
6 *
7 *******************************************************************************/
8 /*!
9 * @file isf_comm.h
10 * @brief \b isf_comm.h defines the common types for the Communications Service Family of the Intelligent Sensing Framework (ISF).
11 * @details This common types used by components in the ISF
12 * Communications Service Family, including the I2C and Device Messaging
13 * Components. Since the Device Messaging Component abstracts various
14 * communications interfaces (I2C, SPI, RGPIO), it is important to ensure that
15 * all abstracted components use common data types and function prototypes.
16 * These types and prototypes are defined in the header file rather than in the Device
17 * Messaging header file to avoid creating a circular dependency.
18 */
19 #ifndef COMM_H
20 #define COMM_H
21 
22 #include <isf.h>
23 
24 /*! @brief This enum defines the possible communications channel states. */
26  COMM_STATE_NO_INIT = 0, /*!< Channel has not been initialized. */
27  COMM_STATE_INIT = 1, /*!< Channel is initialized, but not ready to use because channel is not started or configured.*/
28  COMM_STATE_OK = 2, /*!< Channel is ready to use without errors. */
29  COMM_STATE_STOPPED = 3, /*!< Channel is currently stopped. */
30  COMM_STATE_ERROR = 5, /*!< A null pointer was provided as an argument. */
31  COMM_STATE_ARB_LOST = 6 /*!< Channel arbitration has been lost. */
32 };
33 
34 /*! @brief This enum defines the possible communications channel error codes. */
36  COMM_ERROR_INIT = 1, /*!< A channel initialization error has occurred. */
37  COMM_ERROR_STOP = 2, /*!< A channel stop-related error has occurred. */
38  COMM_ERROR_LOCK = 3, /*!< A channel lock-related error has occurred. */
39  COMM_ERROR_TIME_OUT = 4, /*!< Channel has timed out. */
40  COMM_ERROR_NULL_PTR = 5, /*!< A null pointer was provided as an argument. */
41  COMM_ERROR_NOEXIST = 6, /*!< The referenced entity does not exist. */
42  COMM_ERROR_BUF_SIZE = 7, /*!< The provided buffer is too small. */
43  COMM_ERROR_NO_ACK = 8, /*!< An acknowledgement was not received. */
44  COMM_ERROR_DEV_CLOSED = 9, /*!< Attempted read/write to a closed device. */
45  COMM_ERROR_OTHER = 10 /*!< An unspecified channel error has occured. */
46 };
47 
48 /*! @brief This type is for a numeric channel identifier- index into an array of channels
49  * in the system. */
50 typedef uint32 comm_Id_t;
51 
52 /*! @brief This enum holds an enumerated value describing the state of a channel. */
54 
55 /*! @brief This type is for a channel address for both 7-bit and 10-bit addresses. */
57 
58 /*! @brief This is a bit array of flags governing device read/write behavior. */
60 
61 #endif /* COMM_H */
62 
comm_State_vals
This enum defines the possible communications channel states.
Definition: isf_comm.h:25
unsigned char uint8
This defines uint8 as unsigned char.
Definition: isf_types.h:18
uint32 comm_Id_t
This type is for a numeric channel identifier- index into an array of channels in the system...
Definition: isf_comm.h:50
unsigned long uint32
This defines uint32 as unsigned long.
Definition: isf_types.h:36
comm_Error_vals
This enum defines the possible communications channel error codes.
Definition: isf_comm.h:35
uint8 comm_Flags_t
This is a bit array of flags governing device read/write behavior.
Definition: isf_comm.h:59
uint32 comm_Address_t
This type is for a channel address for both 7-bit and 10-bit addresses.
Definition: isf_comm.h:56
Main ISF header file. Contains code common to all ISF components.
enum comm_State_vals comm_State_t
This enum holds an enumerated value describing the state of a channel.
Definition: isf_comm.h:53