ISF  2.1
Intelligent Sensing Framework for Kinetis with Processor Expert
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
isf_sysconf_comms.c
Go to the documentation of this file.
1 /**
2  * @file isf_sysconf_comms.c
3  * @brief System Communications channel configuration
4  * @version 0.0
5  * @date 2012-08-01
6  *
7  * Copyright (c) 2012, Freescale, Inc.
8  */
9 #include <isf_user_config.h>
10 #include <isf_sysconf_types.h>
11 #include <isf_sysconf_comms.h>
12 #include "mutex.h"
13 /******************************************************************************
14  * I2C CHANNEL CONFIGURATION
15  ******************************************************************************/
16 
17 #include "isf_i2c_master_types.h"
18 //I2C Bus configuration information
19 enum {
20  I2C_BUS_0 = 0,
22 };
23 
24 
25 
27  {
28  .timeout = 1000,
29  .defaultSpeed = 400,
30  }
31 };
32 
33 // Number of the I2C Buses of same type
35 // Bus information structure for each bus, each field in the structure are updated dynamically, so no need to assign any value
38 
39 
40 // Include the uart related configuration parameter.
41 /******************************************************************************
42  * UART configuration
43  ******************************************************************************/
44 #include "isf_uart_types.h"
45 
46 //I2C Bus configuration information
47 enum {
50 };
51 
52 // i
54  {
55  .timeout = 0,
56  .config.baudRate = 115200,
57  .config.parityMode = kUartParityDisabled,
58  .config.stopBitCount = kUartOneStopBit,
59  .config.bitCountPerChar = kUart8BitsPerChar,
60  }
61 };
62 // Number of the UART Buses of same type
65 MUTEX_STRUCT uart_lock[UART_NUM_BUS];
66 MUTEX_STRUCT uart_rdlock[UART_NUM_BUS];
67 
68 
69 
70 
71 
72 
73 // Include the uart related configuration parameter.
74 /******************************************************************************
75  * SPI configuration
76  ******************************************************************************/
77 #include "isf_spi_master_types.h"
78 
79 //I2C Bus configuration information
80 enum {
81  SPI_BUS_0 = 0,
83 };
84 
85 // i
87  {
88  .timeout = 0,
89  .config.busFrequencyKHz = 500,
90  .config.polarity = kSpiClockPolarity_ActiveHigh,
91  .config.phase = kSpiClockPhase_FirstEdge,
92  .config.direction = kSpiMsbFirst,
93  }
94 };
95 // Number of the SPI Buses of same type
100 
101 /******************************************************************************
102  * CHANNELIST CONFIGURATION FOR THE SYSTEM
103  ******************************************************************************/
104 
106  // COMM_CHANNEL_I2C_CH1 = 0,
107  {
109  .protocolInstanceId = I2C_BUS_0,
110  .pConfig = &gSys_I2cBusConfig[I2C_BUS_0]
111  },
112  // COMM_CHANNEL_UART_CH1 = 1,
113  {
114  .protocolType = PROTOCOL_TYPE_UART,
115  .protocolInstanceId = UART_BUS_0,
116  .pConfig = &gSys_UartBusConfig[UART_BUS_0]
117  },
118  // COMM_CHANNEL_SPI_CH1 = 2,
119  {
120  .protocolType = PROTOCOL_TYPE_SPI,
121  .protocolInstanceId = SPI_BUS_0,
122  .pConfig = &gSys_SpiMasterBusConfig[SPI_BUS_0]
123  },
124 
125 };
126 
127 // CI used UART by default now.
129 {
130  return (uint32)(COMM_CHANNEL_UART_CH1);
131 }
132 
134 
135 
136 
isf_i2c_master_types.h defines the i2c master protocol adapter structure and types.
This file defines the system configuration for the communication channel.
unsigned char uint8
This defines uint8 as unsigned char.
Definition: isf_types.h:18
This structure defines the data bus handle.
const uint8 gSys_NumUARTBuses
isf_duration_t timeout
This structure defines the data bus handle.
The isf_user_config.h file contains the user configurable settings to either include or exclude an IS...
const uint8 gSys_NumChannels
unsigned long uint32
This defines uint32 as unsigned long.
Definition: isf_types.h:36
MUTEX_STRUCT spi_master_rdlock[SPI_NUM_BUS]
MUTEX_STRUCT uart_lock[UART_NUM_BUS]
MUTEX_STRUCT spi_master_lock[SPI_NUM_BUS]
uart_busHandle_t uart_busHandle[UART_NUM_BUS]
spi_master_busHandle_t spi_master_busHandle[SPI_NUM_BUS]
sys_protocolType_t protocolType
const uint8 gSys_NumSpiBuses
i2c_Master_busHandle_t i2c_master_busHandle[I2C_NUM_BUS]
const spi_master_busConfig_t gSys_SpiMasterBusConfig[]
This structure defines the channel descriptor.
const sys_channelDescriptor_t gSys_ConfiguredChannelList[]
isf_uart_types.h defines the uart protocol adapter structure and types.
const uart_BusConfig_t gSys_UartBusConfig[]
const uint8 gSys_NumI2cBuses
MUTEX_STRUCT uart_rdlock[UART_NUM_BUS]
isf_spi_master_types.h defines the spi protocol adapter structure and types.
const i2c_Master_BusConfig_t gSys_I2cBusConfig[]
This structure defines the data bus handle.
This file defines the configuration types and structures for the system communication channel...
MUTEX_STRUCT i2c_Master_mutexHandler[I2C_NUM_BUS]
uint32 get_ci_comm(void)