FreeCalypso > hg > fc-magnetite
comparison src/g23m-aci/aci/ati_fcmisc.c @ 668:4011858168a1
AT@LPG and AT@PWL implemented in aci3
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 28 May 2020 02:13:50 +0000 |
parents | cf1cfe12a54a |
children | def882d1b354 |
comparison
equal
deleted
inserted
replaced
667:36df58db1640 | 668:4011858168a1 |
---|---|
55 #include "ati_bat.h" | 55 #include "ati_bat.h" |
56 | 56 |
57 #endif /*FF_ATI_BAT*/ | 57 #endif /*FF_ATI_BAT*/ |
58 | 58 |
59 #include "main/sys_types.h" | 59 #include "main/sys_types.h" |
60 #include "fc-target.h" | |
61 #include "armio.h" | |
60 | 62 |
61 extern SYS_UWORD8 SIM_allow_speed_enhancement; | 63 extern SYS_UWORD8 SIM_allow_speed_enhancement; |
62 | 64 |
63 /* AT@SPENH - enable or disable SIM speed enhancement */ | 65 /* AT@SPENH - enable or disable SIM speed enhancement */ |
64 GLOBAL T_ATI_RSLT atAtSPENH ( char *cl, UBYTE srcId ) | 66 GLOBAL T_ATI_RSLT atAtSPENH ( char *cl, UBYTE srcId ) |
92 sprintf(g_sa, "%s%u", me, SIM_allow_speed_enhancement); | 94 sprintf(g_sa, "%s%u", me, SIM_allow_speed_enhancement); |
93 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | 95 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); |
94 return (ATI_CMPL); | 96 return (ATI_CMPL); |
95 } | 97 } |
96 | 98 |
99 #ifdef TARGET_HAS_LPG | |
100 /* AT@LPG - program LPG output */ | |
101 GLOBAL T_ATI_RSLT atAtLPG ( char *cl, UBYTE srcId ) | |
102 { | |
103 unsigned glob, period = 0, ontime = 0; | |
104 | |
105 TRACE_FUNCTION("atAtLPG()"); | |
106 | |
107 cl = parse(cl, "Ddd", &glob, &period, &ontime); | |
108 if (!cl) | |
109 return (ATI_FAIL); | |
110 if (glob > 3 || period > 7 || ontime > 7) | |
111 return (ATI_FAIL); | |
112 *(volatile SYS_UWORD8 *)0xFFFE7801 = 0x01; | |
113 *(volatile SYS_UWORD8 *)0xFFFE7800 = | |
114 (glob << 6) | (ontime << 3) | period; | |
115 return (ATI_CMPL); | |
116 } | |
117 | |
118 GLOBAL T_ATI_RSLT queatAtLPG (char *cl, UBYTE srcId) | |
119 { | |
120 char *me="@LPG: "; | |
121 SYS_UWORD8 regval; | |
122 unsigned glob, period, ontime; | |
123 | |
124 TRACE_FUNCTION("queatAtLPG()"); | |
125 | |
126 regval = *(volatile SYS_UWORD8 *)0xFFFE7800; | |
127 glob = (regval >> 6) & 3; | |
128 ontime = (regval >> 3) & 7; | |
129 period = regval & 7; | |
130 sprintf(g_sa, "%s%u,%u,%u", me, glob, period, ontime); | |
131 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
132 return (ATI_CMPL); | |
133 } | |
134 #endif /* TARGET_HAS_LPG */ | |
135 | |
136 #ifdef TARGET_HAS_PWL | |
137 /* AT@PWL - program PWL output */ | |
138 GLOBAL T_ATI_RSLT atAtPWL ( char *cl, UBYTE srcId ) | |
139 { | |
140 unsigned level; | |
141 | |
142 TRACE_FUNCTION("atAtPWL()"); | |
143 | |
144 cl = parse(cl, "D", &level); | |
145 if (!cl) | |
146 return (ATI_FAIL); | |
147 if (level > 255) | |
148 return (ATI_FAIL); | |
149 *(volatile SYS_UWORD8 *)0xFFFE8000 = level; | |
150 *(volatile SYS_UWORD8 *)0xFFFE8001 = 0x01; | |
151 return (ATI_CMPL); | |
152 } | |
153 | |
154 GLOBAL T_ATI_RSLT queatAtPWL (char *cl, UBYTE srcId) | |
155 { | |
156 char *me="@PWL: "; | |
157 SYS_UWORD8 regval; | |
158 | |
159 TRACE_FUNCTION("queatAtPWL()"); | |
160 | |
161 regval = *(volatile SYS_UWORD8 *)0xFFFE8000; | |
162 sprintf(g_sa, "%s%u", me, regval); | |
163 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
164 return (ATI_CMPL); | |
165 } | |
166 #endif /* TARGET_HAS_PWL */ | |
167 | |
97 #endif /* ATI_FCMISC_C */ | 168 #endif /* ATI_FCMISC_C */ |