ic_pal_mapping.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 - 2018 NXP
3  * All rights reserved.
4  *
5  * THIS SOFTWARE IS PROVIDED BY NXP "AS IS" AND ANY EXPRESSED OR
6  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
7  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
8  * IN NO EVENT SHALL NXP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
9  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
10  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
11  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
12  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
13  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
14  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
15  * THE POSSIBILITY OF SUCH DAMAGE.
16  */
27 #ifndef IC_PAL_MAPPING_H
28 #define IC_PAL_MAPPING_H
29 
30 #include "ic_pal_cfg.h"
31 
32 /* Include peripheral drivers */
33 #if defined(IC_PAL_OVER_FTM)
34  #include "ftm_ic_driver.h"
35  #include "ftm_mc_driver.h"
36 
37  /* The maximum of channel in each instance */
38  #define IC_PAL_NUM_OF_CHANNEL_MAX FEATURE_FTM_CHANNEL_COUNT
39  /* The maximum of counter */
40  #define MAX_COUNTER_VALUE FTM_FEATURE_CNT_MAX_VALUE_U32
41  /* The number of instances are available */
42  #define NUMBER_OF_IC_PAL_INSTANCES NO_OF_FTM_INSTS_FOR_IC
43  /* The maximum of instance in FTM */
44  #define IC_PAL_INSTANCE_MAX FTM_INSTANCE_COUNT
45 #endif /* End of definition for IC_PAL_OVER_FTM */
46 
47 #if defined(IC_PAL_OVER_EMIOS)
48  #include "emios_mc_driver.h"
49  #include "emios_ic_driver.h"
50 
51  /* The maximum of channel in each instance */
52  #define IC_PAL_NUM_OF_CHANNEL_MAX eMIOS_UC_COUNT
53  /* The maximum of counter */
54  #define MAX_COUNTER_VALUE (0xFFFFU)
55  /* The number of instances are available */
56  #define NUMBER_OF_IC_PAL_INSTANCES NO_OF_EMIOS_INSTS_FOR_IC
57  /* The maximum of instance in eMIOS */
58  #define IC_PAL_INSTANCE_MAX eMIOS_INSTANCE_COUNT
59 #endif /* End of definition for IC_PAL_OVER_EMIOS */
60 
61 #if defined(IC_PAL_OVER_ETIMER)
62 
63  #include "etimer_driver.h"
64 
65  /* The maximum of channel in each instance */
66  #define IC_PAL_NUM_OF_CHANNEL_MAX ETIMER_CH_COUNT
67  /* The number of instances are available */
68  #define NUMBER_OF_IC_PAL_INSTANCES NO_OF_ETIMER_INSTS_FOR_IC
69  /* The maximum of instance in ETIMER */
70  #define IC_PAL_INSTANCE_MAX ETIMER_INSTANCE_COUNT
71 #endif /* End of definition for IC_PAL_OVER_ETIMER */
72 
79 typedef enum{
80 #if defined(FTM_INSTANCE_COUNT)
81  IC_INST_TYPE_FTM = 0U,
82 #endif /* defined(FTM_INSTANCE_COUNT) */
83 
84 #if defined(eMIOS_INSTANCE_COUNT)
85  IC_INST_TYPE_EMIOS = 1U,
86 #endif /* defined(eMIOS_INSTANCE_COUNT) */
87 
88 #if defined(ETIMER_INSTANCE_COUNT)
89  IC_INST_TYPE_ETIMER = 2U
90 #endif /* defined(ETIMER_INSTANCE_COUNT) */
92 
93 
100 typedef struct{
102  uint32_t instIdx;
103 } ic_instance_t;
104 
105 #endif /* IC_PAL_MAPPING_H */
Structure storing PAL instance information.
ic_inst_type_t
Enumeration with the types of peripherals supported by IC PAL.
ic_inst_type_t instType
uint32_t instIdx