「eagleで基板引き」では適当にemacs-lispでeagleの外でコマンド列を作って,それを流し込むことでライブラリ作成などの手間を省いていた…が,ULPスクリプトというのが備わっているらしい.
というわけで,ULPスクリプトでexStickのライブラリを書いてみた.
string cmd = "", tmp; cmd += "set grid mm;"; cmd += "pad round;"; int i, j, k, l, m; real x, y; j = k = 0; for(i = 0; i < 26; i++){ if ( (i % 2) == 1){ x = 0; }else{ x = 2.54; } y = (i / 2) * 2.54; if ((i == 0) || (i == 1) || (i == 10) || (i == 11)){ sprintf(tmp, "pad 0 round 1 1.5 'GND%d' (-%f %f);", j, x, y); cmd += tmp; j++; }else{ sprintf(tmp, "pad 0 round 1 1.5 'FPGA_EX_IO%d' (-%f %f);", k, x, y); cmd += tmp; k++; } } l = m = 0; for(i = 0; i < 26; i++){ if ( (i % 2) == 1){ x = 2.54 * 5; }else{ x = 2.54 * 5 + 2.54; } y = (i / 2) * 2.54; if ((i == 0) || (i == 1) || (i == 14) || (i == 15) || (i == 25)){ sprintf(tmp, "pad 0 round 1 1.5 'GND%d' (-%f %f);", j, x, y); cmd += tmp; j++; }else if ((i == 6) || (i == 7) || (i == 8) || (i == 9)){ sprintf(tmp, "pad 0 1 1.5 'VCC%d' (-%f %f);", l, x, y); cmd += tmp; l++; }else if ((i == 10) || (i == 11) || (i == 12) || (i == 13)){ sprintf(tmp, "pad 0 1 1.5 'USER_VCC%d' (-%f %f);", m, x, y); cmd += tmp; m++; }else if (i == 16){ sprintf(tmp, "pad 0 1 1.5 'FPGA_CSO' (-%f %f);", x, y); cmd += tmp; }else if (i == 18){ sprintf(tmp, "pad 0 1 1.5 'FPGA_CCLK' (-%f %f);", x, y); cmd += tmp; }else if (i == 20){ sprintf(tmp, "pad 0 1 1.5 'FPGA_DIN' (-%f %f);", x, y); cmd += tmp; }else if (i == 22){ sprintf(tmp, "pad 0 1 1.5 'FPGA_MOSI' (-%f %f);", x, y); cmd += tmp; }else if (i == 24){ sprintf(tmp, "pad 0 1 1.5 'FPGA_PROG' (-%f %f);", x, y); cmd += tmp; }else{ sprintf(tmp, "pad 0 1 1.5 'FPGA_EX_IO%d' (-%f %f);", k, x, y); cmd += tmp; k++; } } cmd += "pad 0 1 1.5 'FPGA_EX_IO30' (-13.97 43.18);"; cmd += "pad 0 1 1.5 'FPGA_EX_IO31' (-11.43 43.18);"; cmd += "pad 0 1 1.5 'FPGA_EX_IO32' (-8.89 43.18);"; cmd += "pad 0 1 1.5 'FPGA_EX_IO33' (-6.35 43.18);"; cmd += "pad 0 1 1.5 'GND9' (-3.81 43.18);"; cmd += "pad 0 1 1.5 'VCC4' (-1.27 43.18);"; cmd += "pad 0 1 1.5 'FPGA_EX_IO34' (-13.97 45.72);"; cmd += "pad 0 1 1.5 'FPGA_EX_IO35' (-11.43 45.72);"; cmd += "pad 0 1 1.5 'FPGA_EX_IO36' (-8.89 45.72);"; cmd += "pad 0 1 1.5 'FPGA_EX_IO37' (-6.35 45.72);"; cmd += "pad 0 1 1.5 'GND10' (-3.81 45.72);"; cmd += "pad 0 1 1.5 'VCC5' (-1.27 45.72);"; cmd += "wire (2.38 47.18) (-17.62 47.18) (-17.62 -53.01) (2.38 -53.01) (2.38 47.18);"; cmd += "wire (0.38 -37.91) (0.38 -59.41) (-15.62 -59.41) (-15.62 -37.91) (0.38 -37.91);"; cmd += "hole 2.5 (-7.62 -34.51);"; exit(cmd);
こんな感じ.
EAGLE Help: Editor Commands
とか
Hello! My Name Is 404│学校法人青森山田学園 青森大学
とかを参考にしました.
コメント