this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add missing python bindings

alice d76b0a7c dff0fee6

+136
+136
src/api/python.c
··· 1127 1127 return false; 1128 1128 } 1129 1129 1130 + static bool py_fft(int argc, py_Ref argv) 1131 + { 1132 + int startFreq, endFreq = -1; 1133 + PY_CHECK_ARG_TYPE(0, tp_int); 1134 + if (argc > 1) PY_CHECK_ARG_TYPE(1, tp_int); 1135 + 1136 + tic_core* core = get_core(); 1137 + tic_mem* tic = (tic_mem*)core; 1138 + 1139 + startFreq = py_toint(py_arg(0)); 1140 + if (argc > 1) endFreq = py_toint(py_arg(1)); 1141 + 1142 + double result = tic_api_fft(tic, startFreq, endFreq); 1143 + py_newfloat(py_retval(), result); 1144 + return true; 1145 + } 1146 + 1147 + static bool py_ffts(int argc, py_Ref argv) 1148 + { 1149 + int startFreq, endFreq = -1; 1150 + PY_CHECK_ARG_TYPE(0, tp_int); 1151 + if (argc > 1) PY_CHECK_ARG_TYPE(1, tp_int); 1152 + 1153 + tic_core* core = get_core(); 1154 + tic_mem* tic = (tic_mem*)core; 1155 + 1156 + startFreq = py_toint(py_arg(0)); 1157 + if (argc > 1) endFreq = py_toint(py_arg(1)); 1158 + 1159 + double result = tic_api_ffts(tic, startFreq, endFreq); 1160 + py_newfloat(py_retval(), result); 1161 + return true; 1162 + } 1163 + 1164 + static bool py_fftr(int argc, py_Ref argv) 1165 + { 1166 + int startFreq, endFreq = -1; 1167 + PY_CHECK_ARG_TYPE(0, tp_int); 1168 + if (argc > 1) PY_CHECK_ARG_TYPE(1, tp_int); 1169 + 1170 + tic_core* core = get_core(); 1171 + tic_mem* tic = (tic_mem*)core; 1172 + 1173 + startFreq = py_toint(py_arg(0)); 1174 + if (argc > 1) endFreq = py_toint(py_arg(1)); 1175 + 1176 + double result = tic_api_fftr(tic, startFreq, endFreq); 1177 + py_newfloat(py_retval(), result); 1178 + return true; 1179 + } 1180 + 1181 + static bool py_fftrs(int argc, py_Ref argv) 1182 + { 1183 + int startFreq, endFreq = -1; 1184 + PY_CHECK_ARG_TYPE(0, tp_int); 1185 + if (argc > 1) PY_CHECK_ARG_TYPE(1, tp_int); 1186 + 1187 + tic_core* core = get_core(); 1188 + tic_mem* tic = (tic_mem*)core; 1189 + 1190 + startFreq = py_toint(py_arg(0)); 1191 + if (argc > 1) endFreq = py_toint(py_arg(1)); 1192 + 1193 + double result = tic_api_fftrs(tic, startFreq, endFreq); 1194 + py_newfloat(py_retval(), result); 1195 + return true; 1196 + } 1197 + 1198 + static bool py_vqt(int argc, py_Ref argv) 1199 + { 1200 + int bin; 1201 + PY_CHECK_ARG_TYPE(0, tp_int); 1202 + 1203 + tic_core* core = get_core(); 1204 + tic_mem* tic = (tic_mem*)core; 1205 + 1206 + bin = py_toint(py_arg(0)); 1207 + 1208 + double result = tic_api_vqt(tic, bin); 1209 + py_newfloat(py_retval(), result); 1210 + return true; 1211 + } 1212 + 1213 + static bool py_vqts(int argc, py_Ref argv) 1214 + { 1215 + int bin; 1216 + PY_CHECK_ARG_TYPE(0, tp_int); 1217 + 1218 + tic_core* core = get_core(); 1219 + tic_mem* tic = (tic_mem*)core; 1220 + 1221 + bin = py_toint(py_arg(0)); 1222 + 1223 + double result = tic_api_vqts(tic, bin); 1224 + py_newfloat(py_retval(), result); 1225 + return true; 1226 + } 1227 + 1228 + static bool py_vqtr(int argc, py_Ref argv) 1229 + { 1230 + int bin; 1231 + PY_CHECK_ARG_TYPE(0, tp_int); 1232 + 1233 + tic_core* core = get_core(); 1234 + tic_mem* tic = (tic_mem*)core; 1235 + 1236 + bin = py_toint(py_arg(0)); 1237 + 1238 + double result = tic_api_vqtr(tic, bin); 1239 + py_newfloat(py_retval(), result); 1240 + return true; 1241 + } 1242 + 1243 + static bool py_vqtrs(int argc, py_Ref argv) 1244 + { 1245 + int bin; 1246 + PY_CHECK_ARG_TYPE(0, tp_int); 1247 + 1248 + tic_core* core = get_core(); 1249 + tic_mem* tic = (tic_mem*)core; 1250 + 1251 + bin = py_toint(py_arg(0)); 1252 + 1253 + double result = tic_api_vqtrs(tic, bin); 1254 + py_newfloat(py_retval(), result); 1255 + return true; 1256 + } 1257 + 1130 1258 static bool bind_pkpy_v2() 1131 1259 { 1132 1260 py_GlobalRef mod = py_getmodule("__main__"); ··· 1177 1305 py_bind(mod, "trib(x1: float, y1: float, x2: float, y2: float, x3: float, y3: float, color: int)", py_trib); 1178 1306 py_bind(mod, "tstamp() -> int", py_tstamp); 1179 1307 py_bind(mod, "vbank(bank: int=None) -> int", py_vbank); 1308 + py_bind(mod, "fft(startFreq: int, endFreq: int=-1) -> float", py_fft); 1309 + py_bind(mod, "ffts(startFreq: int, endFreq: int=-1) -> float", py_ffts); 1310 + py_bind(mod, "fftr(startFreq: int, endFreq: int=-1) -> float", py_fftr); 1311 + py_bind(mod, "fftrs(startFreq: int, endFreq: int=-1) -> float", py_fftrs); 1312 + py_bind(mod, "vqt(bin: int) -> float", py_vqt); 1313 + py_bind(mod, "vqts(bin: int) -> float", py_vqts); 1314 + py_bind(mod, "vqtr(bin: int) -> float", py_vqtr); 1315 + py_bind(mod, "vqtrs(bin: int) -> float", py_vqtrs); 1180 1316 return true; 1181 1317 } 1182 1318