ISF  2.2 rev 5
Intelligent Sensing Framework for Kinetis with Processor Expert
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) 2015, 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_dspi_hal.h"
17 #include "fsl_dspi_master_driver.h"
18 
19 
21  isf_duration_t timeout; /*!< The bus timeout value to use.*/
22  dspi_device_t device; /*!< The configuration information.*/
23  dspi_master_user_config_t userConfig; /*!< The user configuration information.*/
25 
26 /*! @brief This structure defines the data bus handle. */
28 {
29  dspi_master_state_t master; /*!< The pointer to the spi_master. */
30  uint32_t instance; /*!< The spi current instance.*/
31  spi_master_busConfig_t busConfig; /*!< The current bus configuration.*/
32  uint8 id; /*!< The unique ID associated with the bus handle. */
33  uint8 busState; /*!< The bus sate.*/
35 /*! @brief This structure defines the spi slave command format. */
36 typedef struct spi_mater_SlaveCmd
37 {
38 
39  uint32 size; /*!< The tranfer size.*/
40  uint8 *pReadBuffer; /*!< The handle the readbuffer.*/
41  uint8 *pWriteBuffer; /*!< The handle the writecommand.*/
43 /* Function pointer for the slave information*/
44 typedef isf_status_t (*fnslaveinit_t) (void);
45 typedef isf_status_t (*fnwritepreProcessing_t) (void *cmdOut, uint32 offset, uint32 size, void *writebuffer);
46 typedef isf_status_t (*fnwritepostProcossing_t) (void*cmd );
47 typedef isf_status_t (*fnreadpreProcessing_t) (void *cmdout, uint32 offset, uint32 size);
48 typedef isf_status_t (*fnreadpostProcossing_t) (void *cmd, void *dataOut);
49 
50 /*! @brief This structure defines the slave specific spi information. */
51 typedef struct spi_mater_slaveInfo
52 {
53  fnslaveinit_t slaveinit; /*!< The slave specific initialisation.*/
54  fnwritepreProcessing_t writepreProcess; /*!< The slave specific pre-processing before write operation. */
55  fnwritepostProcossing_t writepostProcess; /*!< The slave specific post-processing after write operation. */
56  fnreadpreProcessing_t readpreProcess; /*!< The slave specific pre-processing before read operation. */
57  fnreadpostProcossing_t readpostProcess; /*!< The slave specific post-processing after read operation. */
59 
60 typedef struct
61 {
62  spi_master_slaveInfo_t *pSlaveInfo; /*!< The slave specific info for Comm Specific device info */
63  spi_master_busConfig_t busConfig; /*!< The slave specific info for Bus initialization */
65 #endif /* ISF_SPI_MASTER_TYPES_H_ */
66 
67 
68 
69 
70 
71 
72 
dspi_master_user_config_t userConfig
struct spi_master_BusConfig_struct spi_master_busConfig_t
unsigned char uint8
Definition: isf_types.h:76
This structure defines the slave specific spi information.
spi_master_busConfig_t busConfig
The isf_types.h file contains the ISF data type definitions and some of the globally used macros...
fnreadpreProcessing_t readpreProcess
isf_status_t(* fnwritepreProcessing_t)(void *cmdOut, uint32 offset, uint32 size, void *writebuffer)
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.
isf_status_t(* fnwritepostProcossing_t)(void *cmd)
uint32 isf_duration_t
ISF time duration in microseconds.
Definition: isf.h:84
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.
isf_status_t(* fnreadpreProcessing_t)(void *cmdout, uint32 offset, uint32 size)
fnwritepostProcossing_t writepostProcess
spi_master_busConfig_t busConfig
int32 isf_status_t
ISF return status type.
Definition: isf.h:76
struct spi_mater_BusHandle_struct spi_master_busHandle_t
This structure defines the data bus handle.
isf_status_t(* fnreadpostProcossing_t)(void *cmd, void *dataOut)
unsigned long int uint32
Definition: isf_types.h:78
This structure defines the data bus handle.
isf_status_t(* fnslaveinit_t)(void)