ISF  2.1
Intelligent Sensing Framework for Kinetis with Processor Expert
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
isf_spi_master_types.h
Go to the documentation of this file.
1 /*!
2 ********************************************************************************
3 * File: isf_spi_master_types.h
4 *
5 * Copyright (c) 2014, Freescale Semiconductor, Inc.
6 *
7 *******************************************************************************/
8 /*!
9 * @file isf_spi_master_types.h
10 * @brief \b isf_spi_master_types.h defines the spi protocol adapter structure and types.
11 */
12 #ifndef ISF_SPI_MASTER_TYPES_H_
13 #define ISF_SPI_MASTER_TYPES_H_
14 #include "isf_types.h"
15 #include "isf.h"
16 #include "fsl_spi_master_driver.h"
18  isf_duration_t timeout; /*!< The bus timeout value to use.*/
19  spi_user_config_t config; /*!< The configuration information.*/
21 
22 /*! @brief This structure defines the data bus handle. */
24 {
25  spi_handle_t spiHandle; /*!< The spi current handle.*/
26  spi_master_busConfig_t busConfig; /*!< The current bus configuration.*/
27  uint8 id; /*!< The unique ID associated with the bus handle. */
28  uint8 busState; /*!< The bus sate.*/
30 /*! @brief This structure defines the spi slave command format. */
31 typedef struct spi_mater_SlaveCmd
32 {
33 
34  uint32 size; /*!< The tranfer size.*/
35  uint8 *pReadBuffer; /*!< The handle the readbuffer.*/
36  uint8 *pWriteBuffer; /*!< The handle the writecommand.*/
38 /* Function pointer for the slave information*/
39 typedef isf_status_t (*fnslaveinit_t) (void);
40 typedef isf_status_t (*fnwritepreProcessing_t) (void *cmdOut, uint32 offset, uint32 size, void *writebuffer);
41 typedef isf_status_t (*fnwritepostProcossing_t) (void*cmd );
42 typedef isf_status_t (*fnreadpreProcessing_t) (void *cmdout, uint32 offset, uint32 size);
43 typedef isf_status_t (*fnreadpostProcossing_t) (void *cmd, void *dataOut);
44 
45 /*! @brief This structure defines the slave specific spi information. */
46 typedef struct spi_mater_slaveInfo
47 {
48  fnslaveinit_t slaveinit; /*!< The slave specific initialisation.*/
49  fnwritepreProcessing_t writepreProcess; /*!< The slave specific pre-processing before write operation. */
50  fnwritepostProcossing_t writepostProcess; /*!< The slave specific post-processing after write operation. */
51  fnreadpreProcessing_t readpreProcess; /*!< The slave specific pre-processing before read operation. */
52  fnreadpostProcossing_t readpostProcess; /*!< The slave specific post-processing after read operation. */
54 
55 typedef struct
56 {
57  spi_master_busConfig_t busConfig; /*!< The slave specific info for Bus initialization */
58  spi_master_slaveInfo_t *pSlaveInfo; /*!< The slave specific info for Comm Specific device info */
60 #endif /* ISF_SPI_MASTER_TYPES_H_ */
61 
62 
63 
64 
struct spi_master_BusConfig_struct spi_master_busConfig_t
unsigned char uint8
This defines uint8 as unsigned char.
Definition: isf_types.h:18
isf_status_t(* fnreadpostProcossing_t)(void *cmd, void *dataOut)
isf_status_t(* fnwritepreProcessing_t)(void *cmdOut, uint32 offset, uint32 size, void *writebuffer)
isf_status_t(* fnwritepostProcossing_t)(void *cmd)
fsl_spi_master_driver.h defines structures and types for the spi master driver.
This structure defines the slave specific spi information.
unsigned long uint32
This defines uint32 as unsigned long.
Definition: isf_types.h:36
spi_master_busConfig_t busConfig
isf_status_t(* fnslaveinit_t)(void)
The isf_types.h file contains the ISF data type definitions and some of the globally used macros...
isf_status_t(* fnreadpreProcessing_t)(void *cmdout, uint32 offset, uint32 size)
fnreadpreProcessing_t readpreProcess
spi_master_slaveInfo_t * pSlaveInfo
fnreadpostProcossing_t readpostProcess
This structure defines the spi slave command format.
struct spi_mater_slaveInfo spi_master_slaveInfo_t
This structure defines the slave specific spi information.
uint32 isf_duration_t
ISF time duration in microseconds.
Definition: isf.h:59
fnwritepreProcessing_t writepreProcess
Main ISF header file. Contains code common to all ISF components.
struct spi_mater_SlaveCmd spi_mater_slaveCmd_t
This structure defines the spi slave command format.
fnwritepostProcossing_t writepostProcess
spi_master_busConfig_t busConfig
int32 isf_status_t
ISF return status type.
Definition: isf.h:51
struct spi_mater_BusHandle_struct spi_master_busHandle_t
This structure defines the data bus handle.
This structure defines the data bus handle.
Information about a device on the SPI bus.