From db3de67c98b3bf3cc0f7126c9df16c8be442574e Mon Sep 17 00:00:00 2001 From: Neil Gershenfeld <gersh@cba.mit.edu> Date: Sun, 21 Jul 2024 14:46:20 -0400 Subject: [PATCH] wip --- python/pcb.py | 143 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) diff --git a/python/pcb.py b/python/pcb.py index 13bdc6d..5c034b3 100755 --- a/python/pcb.py +++ b/python/pcb.py @@ -6724,6 +6724,149 @@ class PicoW(part): self.pad.append(point(board_width/2+pad_offset,(0.5+i)*pad_pitch)) self.labels.append(self.text(self.pad[-1].x-label_offset,self.pad[-1].y,self.pad[-1].z,str(31+i))) +class XIAO_SAMD21(part): + # + # XIAO SAMD21 + # + def __init__(self,value=''): + self.value = value + self.pad = [point(0,0,0)] + self.labels = [] + padl = cube(-0.04,0.081,-0.070/2,0.070/2,0,0) + padr = cube(-0.081,0.04,-0.070/2,0.070/2,0,0) + pitch = 0.1 + dx = 0.035 + width = 0.685 + length = 0.798 + d = 0.015 + l = 0.004 # text + # + # pin 1 + # + self.shape = translate(padl,-width/2,3*pitch,0) + self.pad.append(point(-width/2,3*pitch,0)) + self.labels.append(self.text(self.pad[-1].x+dx,self.pad[-1].y,self.pad[-1].z,'D0')) + # + # pin 2 + # + self.shape = add(self.shape,translate(padl,-width/2,2*pitch,0)) + self.pad.append(point(-width/2,2*pitch,0)) + self.labels.append(self.text(self.pad[-1].x+dx,self.pad[-1].y,self.pad[-1].z,'D1')) + # + # pin 3 + # + self.shape = add(self.shape,translate(padl,-width/2,1*pitch,0)) + self.pad.append(point(-width/2,1*pitch,0)) + self.labels.append(self.text(self.pad[-1].x+dx,self.pad[-1].y,self.pad[-1].z,'D2')) + # + # pin 4 + # + self.shape = add(self.shape,translate(padl,-width/2,0*pitch,0)) + self.pad.append(point(-width/2,0*pitch,0)) + self.labels.append(self.text(self.pad[-1].x+dx,self.pad[-1].y,self.pad[-1].z,'D3')) + # + # pin 5 + # + self.shape = add(self.shape,translate(padl,-width/2,-1*pitch,0)) + self.pad.append(point(-width/2,-1*pitch,0)) + self.labels.append(self.text(self.pad[-1].x+dx,self.pad[-1].y,self.pad[-1].z,'SDA')) + # + # pin 6 + # + self.shape = add(self.shape,translate(padl,-width/2,-2*pitch,0)) + self.pad.append(point(-width/2,-2*pitch,0)) + self.labels.append(self.text(self.pad[-1].x+dx,self.pad[-1].y,self.pad[-1].z,'SCL')) + # + # pin 7 + # + self.shape = add(self.shape,translate(padl,-width/2,-3*pitch,0)) + self.pad.append(point(-width/2,-3*pitch,0)) + self.labels.append(self.text(self.pad[-1].x+dx,self.pad[-1].y,self.pad[-1].z,'TX')) + # + # pin 8 + # + self.shape = add(self.shape,translate(padr,width/2,-3*pitch,0)) + self.pad.append(point(width/2,-3*pitch,0)) + self.labels.append(self.text(self.pad[-1].x-dx,self.pad[-1].y,self.pad[-1].z,'RX')) + # + # pin 9 + # + self.shape = add(self.shape,translate(padr,width/2,-2*pitch,0)) + self.pad.append(point(width/2,-2*pitch,0)) + self.labels.append(self.text(self.pad[-1].x-dx,self.pad[-1].y,self.pad[-1].z,'SCK')) + # + # pin 10 + # + self.shape = add(self.shape,translate(padr,width/2,-1*pitch,0)) + self.pad.append(point(width/2,-1*pitch,0)) + self.labels.append(self.text(self.pad[-1].x-dx,self.pad[-1].y,self.pad[-1].z,'SDI')) + # + # pin 11 + # + self.shape = add(self.shape,translate(padr,width/2,0*pitch,0)) + self.pad.append(point(width/2,0*pitch,0)) + self.labels.append(self.text(self.pad[-1].x-dx,self.pad[-1].y,self.pad[-1].z,'SDO')) + # + # pin 12 + # + self.shape = add(self.shape,translate(padr,width/2,1*pitch,0)) + self.pad.append(point(width/2,1*pitch,0)) + self.labels.append(self.text(self.pad[-1].x-dx,self.pad[-1].y,self.pad[-1].z,'3V3')) + # + # pin 13 + # + self.shape = add(self.shape,translate(padr,width/2,2*pitch,0)) + self.pad.append(point(width/2,2*pitch,0)) + self.labels.append(self.text(self.pad[-1].x-dx,self.pad[-1].y,self.pad[-1].z,'G')) + # + # pin 14 + # + self.shape = add(self.shape,translate(padr,width/2,3*pitch,0)) + self.pad.append(point(width/2,3*pitch,0)) + self.labels.append(self.text(self.pad[-1].x-dx,self.pad[-1].y,self.pad[-1].z,'5V')) + # + # JTAG + # + dw = 0.047 + left = 0.27 + right = 0.265 + bottom = 0.050 + top = 0.20 + pad = cube(-dw/2,dw/2,-dw/2,dw/2,0,0) + # + self.shape = add(self.shape,translate(pad,-width/2+left+dw/2,-length/2+bottom+dw/2,0)) + self.pad.append(point(-width/2+left+dw/2,-length/2+bottom+dw/2)) + self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'')) + # + self.shape = add(self.shape,translate(pad,-width/2+left+dw/2,-length/2+top-dw/2,0)) + self.pad.append(point(-width/2+left+dw/2,-length/2+top-dw/2)) + self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'')) + # + self.shape = add(self.shape,translate(pad,width/2-right-dw/2,-length/2+bottom+dw/2,0)) + self.pad.append(point(width/2-right-dw/2,-length/2+bottom+dw/2)) + self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'')) + # + self.shape = add(self.shape,translate(pad,width/2-right-dw/2,-length/2+top-dw/2,0)) + self.pad.append(point(width/2-right-dw/2,-length/2+top-dw/2)) + self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'')) + # + # battery + # + dx = 0.042 + dy = 0.081 + left = 0.275 + right = 0.269 + top = 0.020 + pad = cube(-dx/2,dx/2,-dy/2,dy/2,0,0) + # + self.shape = add(self.shape,translate(pad,-width/2+left+dx/2,length/2-top-dy/2,0)) + self.pad.append(point(-width/2+left+dx/2,length/2-top-dy/2)) + self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'GND')) + # + self.shape = add(self.shape,translate(pad,width/2-right-dx/2,length/2-top-dy/2,0)) + self.pad.append(point(width/2-right-dx/2,length/2-top-dy/2)) + self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'VIN')) + class XIAO_ESP32S3(part): # # XIAO ESP32S3 -- GitLab