ISF  2.2 rev 5
Intelligent Sensing Framework for Kinetis with Processor Expert
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  *
6  * Copyright (c) 2015, Freescale, Inc.
7  */
8 #include <isf_sysconf_types.h>
9 #include <isf_sysconf_comms.h>
10 #include "isf.h"
11 #include "Events.h"
12 /******************************************************************************
13  * I2C CHANNEL CONFIGURATION
14  ******************************************************************************/
15 
16 #include "isf_i2c_master_types.h"
17 //I2C Bus configuration information
18 enum {
19  I2C_BUS_0 = 0,
21 };
23  {
24  .timeout = 1000,
25  .defaultSpeed = 400,
26  }
27 };
28 const uint8 gSys_NumI2cBuses = I2C_INSTANCE_COUNT;
30 mutex_t i2c_Master_mutexHandler[I2C_INSTANCE_COUNT];
31 
32 // Include the uart related configuration parameter.
33 /******************************************************************************
34  * UART configuration
35  ******************************************************************************/
36 #include "isf_uart_types.h"
37 
38 //I2C Bus configuration information
39 enum {
42 };
43 
44 
45 const uint8 gSys_NumUartBuses = UART_INSTANCE_COUNT;
46 uart_busHandle_t uart_busHandle[UART_INSTANCE_COUNT];
47 mutex_t uart_lock[UART_INSTANCE_COUNT];
48 mutex_t uart_rdlock[UART_INSTANCE_COUNT];
49 
50 // Include the uart related configuration parameter.
51 /******************************************************************************
52  * SPI configuration
53  ******************************************************************************/
54 #include "isf_spi_master_types.h"
55 
56 //I2C Bus configuration information
57 enum {
58  SPI_BUS_0 = 0,
60 };
61 
62 
63 const uint8 gSys_NumSpiBuses = SPI_INSTANCE_COUNT;
65 mutex_t spi_lock[SPI_INSTANCE_COUNT];
66 mutex_t spi_rdlock[SPI_INSTANCE_COUNT];
67 
68 /******************************************************************************
69  * CHANNELIST CONFIGURATION FOR THE SYSTEM
70  ******************************************************************************/
72  // COMM_CHANNEL_I2C1 = 0,
73  {
75  .protocolInstanceId = FSL_ISF_I2C1,
76  .pConfig = &gSys_I2cBusConfig[I2C_BUS_0]
77  },
78  // COMM_CHANNEL_SPI1 = 1,
79  {
80  .protocolType = PROTOCOL_TYPE_SPI,
81  .protocolInstanceId = FSL_ISF_SPI1,
82  .pConfig = NULL
83  },
84  // COMM_CHANNEL_UART2 = 2,
85  {
86  .protocolType = PROTOCOL_TYPE_UART,
87  .protocolInstanceId = FSL_ISF_UART1,
88  .pConfig = &ISF_UART1_InitConfig0
89  },
90 };
91 
92 // CI used UART by default now.
94 {
95  return (uint32)(COMM_CHANNEL_UART2);
96 }
97 
99 
100 
101 
102 
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
Definition: isf_types.h:76
#define FSL_ISF_I2C1
Device instance number.
Definition: ISF_I2C1.h:91
i2c_Master_busHandle_t i2c_master_busHandle[I2C_INSTANCE_COUNT]
This structure defines the data bus handle.
This structure defines the data bus handle.
const uint8 gSys_NumChannels
#define FSL_ISF_UART1
Definition: ISF_UART1.h:77
mutex_t uart_lock[UART_INSTANCE_COUNT]
#define FSL_ISF_SPI1
Device instance number.
Definition: ISF_SPI1.h:79
const uart_user_config_t ISF_UART1_InitConfig0
UART configuration declaration.
Definition: ISF_UART1.c:61
sys_protocolType_t protocolType
mutex_t i2c_Master_mutexHandler[I2C_INSTANCE_COUNT]
const uint8 gSys_NumSpiBuses
mutex_t uart_rdlock[UART_INSTANCE_COUNT]
mutex_t spi_lock[SPI_INSTANCE_COUNT]
This is user's event module. Put your event handler code here.
This structure defines the channel descriptor.
const sys_channelDescriptor_t gSys_ConfiguredChannelList[]
This data structure/variable holds the complete state of the rli magnetometer sensor embedded applica...
const uint8 gSys_NumUartBuses
Main ISF header file. Contains code common to all ISF components.
spi_master_busHandle_t spi_busHandle[SPI_INSTANCE_COUNT]
isf_uart_types.h defines the uart protocol adapter structure and types.
const uint8 gSys_NumI2cBuses
isf_spi_master_types.h defines the spi protocol adapter structure and types.
const i2c_Master_BusConfig_t gSys_I2cBusConfig[]
mutex_t spi_rdlock[SPI_INSTANCE_COUNT]
unsigned long int uint32
Definition: isf_types.h:78
This structure defines the data bus handle.
This file defines the configuration types and structures for the system communication channel...
uart_busHandle_t uart_busHandle[UART_INSTANCE_COUNT]
uint32 get_ci_comm(void)