| ISF 2.2 rev 5 Intelligent Sensing Framework for Kinetis with Processor Expert

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

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,
20 I2C_NUM_BUS
21 };
22 const i2c_Master_BusConfig_t gSys_I2cBusConfig[] = {
23 {
24 .timeout = 1000,
25 .defaultSpeed = 400,
26 }
27 };
28 const uint8 gSys_NumI2cBuses = I2C_INSTANCE_COUNT;
29 i2c_Master_busHandle_t i2c_master_busHandle[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 {
40 UART_BUS_0 = 0,
41 UART_NUM_BUS
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,
59 SPI_NUM_BUS
60 };
61
62
63 const uint8 gSys_NumSpiBuses = SPI_INSTANCE_COUNT;
64 spi_master_busHandle_t spi_busHandle[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 ******************************************************************************/
71 const sys_channelDescriptor_t gSys_ConfiguredChannelList[] = {
72 // COMM_CHANNEL_I2C1 = 0,
73 {
74 .protocolType = PROTOCOL_TYPE_I2C,
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.
93 uint32 get_ci_comm(void)
94 {
95 return (uint32)(COMM_CHANNEL_UART2);
96 }
97
98 const uint8 gSys_NumChannels = sizeof(gSys_ConfiguredChannelList)/sizeof(sys_channelDescriptor_t);
99
100
101
102
isf_i2c_master_types.h
isf_i2c_master_types.h defines the i2c master protocol adapter structure and types.
isf_sysconf_comms.h
This file defines the system configuration for the communication channel.
uint8
unsigned char uint8
Definition: isf_types.h:76
FSL_ISF_I2C1
#define FSL_ISF_I2C1
Device instance number.
Definition: ISF_I2C1.h:91
i2c_master_busHandle
i2c_Master_busHandle_t i2c_master_busHandle[I2C_INSTANCE_COUNT]
Definition: isf_sysconf_comms.c:29
i2c_Master_BusHandle_struct
This structure defines the data bus handle.
Definition: isf_i2c_master_types.h:23
i2c_Master_BusConfig_struct::timeout
isf_duration_t timeout
Definition: isf_i2c_master_types.h:18
I2C_BUS_0
Definition: isf_sysconf_comms.c:19
uart_BusHandle_struct
This structure defines the data bus handle.
Definition: isf_uart_types.h:28
gSys_NumChannels
const uint8 gSys_NumChannels
Definition: isf_sysconf_comms.c:98
SPI_NUM_BUS
Definition: isf_sysconf_comms.c:59
FSL_ISF_UART1
#define FSL_ISF_UART1
Definition: ISF_UART1.h:77
PROTOCOL_TYPE_UART
Definition: isf_sysconf_types.h:26
uart_lock
mutex_t uart_lock[UART_INSTANCE_COUNT]
Definition: isf_sysconf_comms.c:47
FSL_ISF_SPI1
#define FSL_ISF_SPI1
Device instance number.
Definition: ISF_SPI1.h:79
ISF_UART1_InitConfig0
const uart_user_config_t ISF_UART1_InitConfig0
UART configuration declaration.
Definition: ISF_UART1.c:61
sys_channelDescriptor_t::protocolType
sys_protocolType_t protocolType
Definition: isf_sysconf_types.h:35
i2c_Master_mutexHandler
mutex_t i2c_Master_mutexHandler[I2C_INSTANCE_COUNT]
Definition: isf_sysconf_comms.c:30
SPI_BUS_0
Definition: isf_sysconf_comms.c:58
gSys_NumSpiBuses
const uint8 gSys_NumSpiBuses
Definition: isf_sysconf_comms.c:63
uart_rdlock
mutex_t uart_rdlock[UART_INSTANCE_COUNT]
Definition: isf_sysconf_comms.c:48
PROTOCOL_TYPE_I2C
Definition: isf_sysconf_types.h:24
spi_lock
mutex_t spi_lock[SPI_INSTANCE_COUNT]
Definition: isf_sysconf_comms.c:65
Events.h
This is user's event module. Put your event handler code here.
PROTOCOL_TYPE_SPI
Definition: isf_sysconf_types.h:25
COMM_CHANNEL_UART2
Definition: isf_sysconf_comms.h:32
sys_channelDescriptor_t
This structure defines the channel descriptor.
Definition: isf_sysconf_types.h:33
gSys_ConfiguredChannelList
const sys_channelDescriptor_t gSys_ConfiguredChannelList[]
This data structure/variable holds the complete state of the rli magnetometer sensor embedded applica...
Definition: isf_sysconf_comms.c:71
gSys_NumUartBuses
const uint8 gSys_NumUartBuses
Definition: isf_sysconf_comms.c:45
isf.h
Main ISF header file. Contains code common to all ISF components.
spi_busHandle
spi_master_busHandle_t spi_busHandle[SPI_INSTANCE_COUNT]
Definition: isf_sysconf_comms.c:64
I2C_NUM_BUS
Definition: isf_sysconf_comms.c:20
isf_uart_types.h
isf_uart_types.h defines the uart protocol adapter structure and types.
gSys_NumI2cBuses
const uint8 gSys_NumI2cBuses
Definition: isf_sysconf_comms.c:28
isf_spi_master_types.h
isf_spi_master_types.h defines the spi protocol adapter structure and types.
gSys_I2cBusConfig
const i2c_Master_BusConfig_t gSys_I2cBusConfig[]
Definition: isf_sysconf_comms.c:22
spi_rdlock
mutex_t spi_rdlock[SPI_INSTANCE_COUNT]
Definition: isf_sysconf_comms.c:66
i2c_Master_BusConfig_struct
Definition: isf_i2c_master_types.h:17
UART_NUM_BUS
Definition: isf_sysconf_comms.c:41
UART_BUS_0
Definition: isf_sysconf_comms.c:40
uint32
unsigned long int uint32
Definition: isf_types.h:78
spi_mater_BusHandle_struct
This structure defines the data bus handle.
Definition: isf_spi_master_types.h:27
isf_sysconf_types.h
This file defines the configuration types and structures for the system communication channel...
uart_busHandle
uart_busHandle_t uart_busHandle[UART_INSTANCE_COUNT]
Definition: isf_sysconf_comms.c:46
get_ci_comm
uint32 get_ci_comm(void)
Definition: isf_sysconf_comms.c:93
- © Freescale Semiconductor, Inc. 2016. All Rights Reserved.