RTEMS 6.1-rc1
emios.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
11/*
12 * Copyright (C) 2009, 2011 embedded brains GmbH & Co. KG
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 */
35
36#ifndef LIBCPU_POWERPC_MPC55XX_EMIOS_H
37#define LIBCPU_POWERPC_MPC55XX_EMIOS_H
38
39#include <mpc55xx/regs.h>
40
41#ifdef __cplusplus
42extern "C" {
43#endif /* __cplusplus */
44
45#ifdef MPC55XX_HAS_EMIOS
46
53#define MPC55XX_EMIOS_MODE_GPIO_INPUT 0U
54#define MPC55XX_EMIOS_MODE_GPIO_OUTPUT 1U
55#define MPC55XX_EMIOS_MODE_SAIC 2U
56#define MPC55XX_EMIOS_MODE_SAOC 3U
57#define MPC55XX_EMIOS_MODE_IPWM 4U
58#define MPC55XX_EMIOS_MODE_IPM 5U
59#define MPC55XX_EMIOS_MODE_DAOC_SECOND 6U
60#define MPC55XX_EMIOS_MODE_DAOC_BOTH 7U
61#define MPC55XX_EMIOS_MODE_PEA_ACCU_CONT 8U
62#define MPC55XX_EMIOS_MODE_PEA_ACCU_SINGLE 9U
63#define MPC55XX_EMIOS_MODE_PEA_COUNT_CONT 10U
64#define MPC55XX_EMIOS_MODE_PEA_COUNT_SINGLE 11U
65#define MPC55XX_EMIOS_MODE_QDEC_COUNT_DIR 12U
66#define MPC55XX_EMIOS_MODE_QDEC_PHASE 13U
67#define MPC55XX_EMIOS_MODE_WPTA 14U
68#define MPC55XX_EMIOS_MODE_RESERVED_15 15U
69#define MPC55XX_EMIOS_MODE_MC_UP_INT_CLK 16U
70#define MPC55XX_EMIOS_MODE_MC_UP_EXT_CLK 17U
71#define MPC55XX_EMIOS_MODE_RESERVED_18 18U
72#define MPC55XX_EMIOS_MODE_RESERVED_19 19U
73#define MPC55XX_EMIOS_MODE_MC_UP_DOWN_INT_CLK 20U
74#define MPC55XX_EMIOS_MODE_MC_UP_DOWN_EXT_CLK 21U
75#define MPC55XX_EMIOS_MODE_MC_UP_DOWN_CHANGE_INT_CLK 22U
76#define MPC55XX_EMIOS_MODE_MC_UP_DOWN_CHANGE_EXT_CLK 23U
77#define MPC55XX_EMIOS_MODE_OPWFM_B_IMMEDIATE 24U
78#define MPC55XX_EMIOS_MODE_OPWFM_B_NEXT_PERIOD 25U
79#define MPC55XX_EMIOS_MODE_OPWFM_AB_IMMEDIATE 26U
80#define MPC55XX_EMIOS_MODE_OPWFM_AB_NEXT_PERIOD 27U
81#define MPC55XX_EMIOS_MODE_OPWMC_TRAIL_TRAIL 28U
82#define MPC55XX_EMIOS_MODE_OPWMC_TRAIL_LEAD 29U
83#define MPC55XX_EMIOS_MODE_OPWMC_BOTH_TRAIL 30U
84#define MPC55XX_EMIOS_MODE_OPWMC_BOTH_LEAD 31U
85#define MPC55XX_EMIOS_MODE_OPWM_B_IMMEDIATE 32U
86#define MPC55XX_EMIOS_MODE_OPWM_B_NEXT_PERIOD 33U
87#define MPC55XX_EMIOS_MODE_OPWM_AB_IMMEDIATE 34U
88#define MPC55XX_EMIOS_MODE_OPWM_AB_NEXT_PERIOD 35U
89#define MPC55XX_EMIOS_MODE_RESERVED_36 36U
90#define MPC55XX_EMIOS_MODE_RESERVED_37 37U
91#define MPC55XX_EMIOS_MODE_RESERVED_38 38U
92#define MPC55XX_EMIOS_MODE_RESERVED_39 39U
93#define MPC55XX_EMIOS_MODE_RESERVED_40 40U
94#define MPC55XX_EMIOS_MODE_RESERVED_41 41U
95#define MPC55XX_EMIOS_MODE_RESERVED_42 42U
96#define MPC55XX_EMIOS_MODE_RESERVED_43 43U
97#define MPC55XX_EMIOS_MODE_RESERVED_44 44U
98#define MPC55XX_EMIOS_MODE_RESERVED_45 45U
99#define MPC55XX_EMIOS_MODE_RESERVED_46 46U
100#define MPC55XX_EMIOS_MODE_RESERVED_47 47U
101#define MPC55XX_EMIOS_MODE_RESERVED_48 48U
102#define MPC55XX_EMIOS_MODE_RESERVED_49 49U
103#define MPC55XX_EMIOS_MODE_RESERVED_50 50U
104#define MPC55XX_EMIOS_MODE_RESERVED_51 51U
105#define MPC55XX_EMIOS_MODE_RESERVED_52 52U
106#define MPC55XX_EMIOS_MODE_RESERVED_53 53U
107#define MPC55XX_EMIOS_MODE_RESERVED_54 54U
108#define MPC55XX_EMIOS_MODE_RESERVED_55 55U
109#define MPC55XX_EMIOS_MODE_RESERVED_56 56U
110#define MPC55XX_EMIOS_MODE_RESERVED_57 57U
111#define MPC55XX_EMIOS_MODE_RESERVED_58 58U
112#define MPC55XX_EMIOS_MODE_RESERVED_59 59U
113#define MPC55XX_EMIOS_MODE_RESERVED_60 60U
114#define MPC55XX_EMIOS_MODE_RESERVED_61 61U
115#define MPC55XX_EMIOS_MODE_RESERVED_62 62U
116#define MPC55XX_EMIOS_MODE_RESERVED_63 63U
117#define MPC55XX_EMIOS_MODE_RESERVED_64 64U
118#define MPC55XX_EMIOS_MODE_RESERVED_65 65U
119#define MPC55XX_EMIOS_MODE_RESERVED_66 66U
120#define MPC55XX_EMIOS_MODE_RESERVED_67 67U
121#define MPC55XX_EMIOS_MODE_RESERVED_68 68U
122#define MPC55XX_EMIOS_MODE_RESERVED_69 69U
123#define MPC55XX_EMIOS_MODE_RESERVED_70 70U
124#define MPC55XX_EMIOS_MODE_RESERVED_71 71U
125#define MPC55XX_EMIOS_MODE_RESERVED_72 72U
126#define MPC55XX_EMIOS_MODE_RESERVED_73 73U
127#define MPC55XX_EMIOS_MODE_RESERVED_74 74U
128#define MPC55XX_EMIOS_MODE_RESERVED_75 75U
129#define MPC55XX_EMIOS_MODE_RESERVED_76 76U
130#define MPC55XX_EMIOS_MODE_RESERVED_77 77U
131#define MPC55XX_EMIOS_MODE_RESERVED_78 78U
132#define MPC55XX_EMIOS_MODE_RESERVED_79 79U
133#define MPC55XX_EMIOS_MODE_MCB_UP_INT_CLK 80U
134#define MPC55XX_EMIOS_MODE_MCB_UP_EXT_CLK 81U
135#define MPC55XX_EMIOS_MODE_RESERVED_82 82U
136#define MPC55XX_EMIOS_MODE_RESERVED_83 83U
137#define MPC55XX_EMIOS_MODE_MCB_UP_DOWN_ONE_INT_CLK 84U
138#define MPC55XX_EMIOS_MODE_MCB_UP_DOWN_ONE_EXT_CLK 85U
139#define MPC55XX_EMIOS_MODE_MCB_UP_DOWN_BOTH_INT_CLK 86U
140#define MPC55XX_EMIOS_MODE_MCB_UP_DOWN_BOTH_EXT_CLK 87U
141#define MPC55XX_EMIOS_MODE_OPWFMB_B 88U
142#define MPC55XX_EMIOS_MODE_RESERVED_89 89U
143#define MPC55XX_EMIOS_MODE_OPWFMB_AB 90U
144#define MPC55XX_EMIOS_MODE_RESERVED_91 91U
145#define MPC55XX_EMIOS_MODE_OPWMCB_TRAIL_TRAIL 92U
146#define MPC55XX_EMIOS_MODE_OPWMCB_TRAIL_LEAD 93U
147#define MPC55XX_EMIOS_MODE_OPWMCB_BOTH_TRAIL 94U
148#define MPC55XX_EMIOS_MODE_OPWMCB_BOTH_LEAD 95U
149#define MPC55XX_EMIOS_MODE_OPWMB_SECOND 96U
150#define MPC55XX_EMIOS_MODE_RESERVED_97 97U
151#define MPC55XX_EMIOS_MODE_OPWMB_BOTH 98U
152#define MPC55XX_EMIOS_MODE_RESERVED_99 99U
153#define MPC55XX_EMIOS_MODE_RESERVED_100 100U
154#define MPC55XX_EMIOS_MODE_RESERVED_101 101U
155#define MPC55XX_EMIOS_MODE_RESERVED_102 102U
156#define MPC55XX_EMIOS_MODE_RESERVED_103 103U
157#define MPC55XX_EMIOS_MODE_RESERVED_104 104U
158#define MPC55XX_EMIOS_MODE_RESERVED_105 105U
159#define MPC55XX_EMIOS_MODE_RESERVED_106 106U
160#define MPC55XX_EMIOS_MODE_RESERVED_107 107U
161#define MPC55XX_EMIOS_MODE_RESERVED_108 108U
162#define MPC55XX_EMIOS_MODE_RESERVED_109 109U
163#define MPC55XX_EMIOS_MODE_RESERVED_110 110U
164#define MPC55XX_EMIOS_MODE_RESERVED_111 111U
165#define MPC55XX_EMIOS_MODE_RESERVED_112 112U
166#define MPC55XX_EMIOS_MODE_RESERVED_113 113U
167#define MPC55XX_EMIOS_MODE_RESERVED_114 114U
168#define MPC55XX_EMIOS_MODE_RESERVED_115 115U
169#define MPC55XX_EMIOS_MODE_RESERVED_116 116U
170#define MPC55XX_EMIOS_MODE_RESERVED_117 117U
171#define MPC55XX_EMIOS_MODE_RESERVED_118 118U
172#define MPC55XX_EMIOS_MODE_RESERVED_119 119U
173#define MPC55XX_EMIOS_MODE_RESERVED_120 120U
174#define MPC55XX_EMIOS_MODE_RESERVED_121 121U
175#define MPC55XX_EMIOS_MODE_RESERVED_122 122U
176#define MPC55XX_EMIOS_MODE_RESERVED_123 123U
177#define MPC55XX_EMIOS_MODE_RESERVED_124 124U
178#define MPC55XX_EMIOS_MODE_RESERVED_125 125U
179#define MPC55XX_EMIOS_MODE_RESERVED_126 126U
180#define MPC55XX_EMIOS_MODE_RESERVED_127 127U
181
184#if MPC55XX_CHIP_FAMILY == 566 || MPC55XX_CHIP_FAMILY == 567
185 #define MPC55XX_EMIOS_CHANNEL_NUMBER 32U
186#else
187 #define MPC55XX_EMIOS_CHANNEL_NUMBER 24U
188#endif
189
190#define MPC55XX_EMIOS_VALUE_MAX 0x00ffffffU
191
192#define MPC55XX_EMIOS_IS_CHANNEL_VALID( c) \
193 ((unsigned) (c) < MPC55XX_EMIOS_CHANNEL_NUMBER)
194
195#define MPC55XX_EMIOS_IS_CHANNEL_INVALID( c) \
196 (!MPC55XX_EMIOS_IS_CHANNEL_VALID( c))
197
198void mpc55xx_emios_initialize( unsigned prescaler);
199
200unsigned mpc55xx_emios_global_prescaler( void);
201
202void mpc55xx_emios_set_global_prescaler( unsigned prescaler);
203
204#endif /* MPC55XX_HAS_EMIOS */
205
206#ifdef __cplusplus
207}
208#endif /* __cplusplus */
209
210#endif /* LIBCPU_POWERPC_MPC55XX_EMIOS_H */
Register definitions for the MPC55xx and MPC56xx microcontroller family.