| ISF 2.1 Intelligent Sensing Framework for Kinetis with Processor Expert

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
isf_protocol_adapter.h
Go to the documentation of this file.
1 /*!
2 ********************************************************************************
3 * File: isf_protocol_adapter.h
4 *
5 * Copyright (c) 2014, Freescale Semiconductor, Inc.
6 *
7 *******************************************************************************/
8 /*!
9 * @file isf_protocol_adapter.h
10 * @brief \b isf_protocol_adapter.h defines the general interface definition for the protocol adapter.
11 */
12 #ifndef ISF_PROTOCOL_ADAPTER_H_
13 #define ISF_PROTOCOL_ADAPTER_H_
14 #include "isf_types.h"
15 #include "isf_comm.h"
16 /**
17 * @brief This is the function pointer signature for bus initialization.
18 */
19 typedef isf_status_t (*fnInit_t) (comm_Id_t aBusId, void *apBusHandle);
20 /**
21 * @brief This is the function pointer signature for getting the state of the bus.
22 */
23 typedef comm_State_t (*fnGetState_t) (void *apBusHandle);
24 /**
25 * @brief This is the function pointer signature for getting the configuration of the bus.
26 */
27 typedef isf_status_t (*fnGetConfig_t) (void *apBusHandle, void *apBusConfig);
28 /**
29 * @brief This is the function pointer signature for setting the configuration of the bus.
30 */
31 typedef isf_status_t (*fnConfigure_t) (void *apBusHandle, void *apBusConfig);
32 /**
33 * @brief This is the function pointer signature for starting the bus.
34 */
35 typedef isf_status_t (*fnStart_t) (void *apBusHandle);
36 /**
37 * @brief This is the function pointer signature for stopping the bus.
38 */
39 typedef isf_status_t (*fnStop_t) (void *apBusHandle, isf_duration_t aTimeout);
40 /**
41 * @brief This is the function pointer signature for getting the Endpoint handle.
42 */
43 typedef isf_status_t (*fnConnectToEndpoint_t) (void *apBusHandle, void *apDevice , void **apEndpointHandle);
44 /**
45 * @brief This is the function pointer signature for closing the Endpoint.
46 */
47 typedef isf_status_t (*fnDisconnectEndpoint_t) (void *apEndpointHandle);
48
49 /**
50 * @brief This is the function pointer signature for acquiring the lock for a particular bus.
51 */
52 typedef isf_status_t (*fnAcquireLock_t)(void *apBusHandle, isf_duration_t aTimeout);
53 /**
54 * @brief This is the function pointer signature for releasing the lock for a particular bus.
55 */
56 typedef isf_status_t (*fnReleaseLock_t)(void *apBusHandle);
57 /**
58 * @brief This is the function pointer signature for reading the data from a specified device.
59 */
60 typedef isf_status_t (*fnRead_t) (void *apEndpointHandle, int32 offset, void *apReadBuffer, uint32 buffsize, uint32 nBytesRead, comm_Flags_t aFlags);
61 /**
62 * @brief This is the the function pointer signature for writing the data to a specified device.
63 */
64 typedef isf_status_t (*fnWrite_t) (void *apEndpointHandle, int32 offset, uint8* pWriteBuffer, uint32 buffsize, uint32 nBytesWrite, comm_Flags_t aFlags);
65 /**
66 * @brief This structure contains protocol-specific function pointers and properties.
67 */
68 typedef struct {
69 fnInit_t fnInit; /*!< Initialize a channel. */
70 fnGetState_t fnGetState; /*!< Get the state of a channel. */
71 fnGetConfig_t fnGetConfig; /*!< Get the current channel configuration. */
72 fnConfigure_t fnConfigure; /*!< Reconfigure an already initialized channel. */
73 fnStart_t fnStart; /*!< Start a channel. */
74 fnStop_t fnStop; /*!< Stop a channel. */
75 fnConnectToEndpoint_t fnGetEndPointAt; /*!< Get the handle to a slave device at a known address.*/
76 fnDisconnectEndpoint_t fnDisEndPoint; /*!< Get the handle to a slave device at a known address.*/
77 fnAcquireLock_t fnAcquireLock; /*!< Lock the channel for exclusive access. */
78 fnReleaseLock_t fnReleaseLock; /*!< Release exclusive access. */
79 fnRead_t fnRead; /*!< Read from a device. */
80 fnWrite_t fnWrite; /*!< Write to a device. */
81 } protocol_t;
82
83 /*! @brief This structure is a declaration of a BusHandle type.
84 *
85 */
86 typedef struct busHandle_struct {
87 void *pHandle; /*!< Protocol specific BusHandle. */
88 uint8 nLock; /*!< The lock count associated with the bus. */
89 void *pLock; /*!< The pointer to the lock. */
90 uint8 nRdLock; /*!< The lock count associated with the Read. */
91 void *pRdLock; /*!< The pointer to the Read lock. */
92 } busHandle_t;
93
94 #endif /* ISF_PROTOCOL_ADAPTER_H_ */
95
uint8
unsigned char uint8
This defines uint8 as unsigned char.
Definition: isf_types.h:18
protocol_t::fnGetState
fnGetState_t fnGetState
Definition: isf_protocol_adapter.h:70
fnWrite_t
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.
Definition: isf_protocol_adapter.h:64
protocol_t
This structure contains protocol-specific function pointers and properties.
Definition: isf_protocol_adapter.h:68
comm_Id_t
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
fnDisconnectEndpoint_t
isf_status_t(* fnDisconnectEndpoint_t)(void *apEndpointHandle)
This is the function pointer signature for closing the Endpoint.
Definition: isf_protocol_adapter.h:47
fnStart_t
isf_status_t(* fnStart_t)(void *apBusHandle)
This is the function pointer signature for starting the bus.
Definition: isf_protocol_adapter.h:35
fnConnectToEndpoint_t
isf_status_t(* fnConnectToEndpoint_t)(void *apBusHandle, void *apDevice, void **apEndpointHandle)
This is the function pointer signature for getting the Endpoint handle.
Definition: isf_protocol_adapter.h:43
busHandle_struct::nLock
uint8 nLock
Definition: isf_protocol_adapter.h:88
busHandle_struct::nRdLock
uint8 nRdLock
Definition: isf_protocol_adapter.h:90
fnGetState_t
comm_State_t(* fnGetState_t)(void *apBusHandle)
This is the function pointer signature for getting the state of the bus.
Definition: isf_protocol_adapter.h:23
uint32
unsigned long uint32
This defines uint32 as unsigned long.
Definition: isf_types.h:36
protocol_t::fnInit
fnInit_t fnInit
Definition: isf_protocol_adapter.h:69
busHandle_struct::pLock
void * pLock
Definition: isf_protocol_adapter.h:89
busHandle_t
struct busHandle_struct busHandle_t
This structure is a declaration of a BusHandle type.
protocol_t::fnStart
fnStart_t fnStart
Definition: isf_protocol_adapter.h:73
isf_types.h
The isf_types.h file contains the ISF data type definitions and some of the globally used macros...
fnInit_t
isf_status_t(* fnInit_t)(comm_Id_t aBusId, void *apBusHandle)
This is the function pointer signature for bus initialization.
Definition: isf_protocol_adapter.h:19
fnStop_t
isf_status_t(* fnStop_t)(void *apBusHandle, isf_duration_t aTimeout)
This is the function pointer signature for stopping the bus.
Definition: isf_protocol_adapter.h:39
fnReleaseLock_t
isf_status_t(* fnReleaseLock_t)(void *apBusHandle)
This is the function pointer signature for releasing the lock for a particular bus.
Definition: isf_protocol_adapter.h:56
busHandle_struct
This structure is a declaration of a BusHandle type.
Definition: isf_protocol_adapter.h:86
protocol_t::fnGetConfig
fnGetConfig_t fnGetConfig
Definition: isf_protocol_adapter.h:71
comm_Flags_t
uint8 comm_Flags_t
This is a bit array of flags governing device read/write behavior.
Definition: isf_comm.h:59
protocol_t::fnReleaseLock
fnReleaseLock_t fnReleaseLock
Definition: isf_protocol_adapter.h:78
isf_duration_t
uint32 isf_duration_t
ISF time duration in microseconds.
Definition: isf.h:59
int32
long int32
This defines int32 as long.
Definition: isf_types.h:32
protocol_t::fnWrite
fnWrite_t fnWrite
Definition: isf_protocol_adapter.h:80
protocol_t::fnConfigure
fnConfigure_t fnConfigure
Definition: isf_protocol_adapter.h:72
fnConfigure_t
isf_status_t(* fnConfigure_t)(void *apBusHandle, void *apBusConfig)
This is the function pointer signature for setting the configuration of the bus.
Definition: isf_protocol_adapter.h:31
protocol_t::fnGetEndPointAt
fnConnectToEndpoint_t fnGetEndPointAt
Definition: isf_protocol_adapter.h:75
busHandle_struct::pRdLock
void * pRdLock
Definition: isf_protocol_adapter.h:91
fnRead_t
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.
Definition: isf_protocol_adapter.h:60
protocol_t::fnStop
fnStop_t fnStop
Definition: isf_protocol_adapter.h:74
protocol_t::fnDisEndPoint
fnDisconnectEndpoint_t fnDisEndPoint
Definition: isf_protocol_adapter.h:76
isf_status_t
int32 isf_status_t
ISF return status type.
Definition: isf.h:51
isf_comm.h
isf_comm.h defines the common types for the Communications Service Family of the Intelligent Sensing ...
busHandle_struct::pHandle
void * pHandle
Definition: isf_protocol_adapter.h:87
comm_State_t
enum comm_State_vals comm_State_t
This enum holds an enumerated value describing the state of a channel.
Definition: isf_comm.h:53
protocol_t::fnRead
fnRead_t fnRead
Definition: isf_protocol_adapter.h:79
protocol_t::fnAcquireLock
fnAcquireLock_t fnAcquireLock
Definition: isf_protocol_adapter.h:77
fnAcquireLock_t
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.
Definition: isf_protocol_adapter.h:52
fnGetConfig_t
isf_status_t(* fnGetConfig_t)(void *apBusHandle, void *apBusConfig)
This is the function pointer signature for getting the configuration of the bus.
Definition: isf_protocol_adapter.h:27
- © Freescale Semiconductor, Inc. 2015. All Rights Reserved.