-
Notifications
You must be signed in to change notification settings - Fork 176
Allow custom numbering scheme in PadArray and QFN scripts #371
Conversation
Code Climate has analyzed commit daa4e69 and detected 0 issues on this pull request. View more on Code Climate. |
I recommend checking for duplicates and in case of (consecutive) numbers for gaps. If such occurs, a warning is the minimum. |
That sounds like a good idea. Probably a warning is the best approach, as there might be some packages which reuse pin numbers. |
Using an array to get the pin numbers into the array function feels a bit non pythonic. My guess is that it must work with generator functions. I will get back to you when i am not as tired as today. (If it takes more than a few weeks then ping me.) |
pad_numbers = [self.initialPin] * self.pincount | ||
elif type(self.increment) == int: | ||
pad_numbers = range(self.initialPin, self.initialPin + (self.pincount * self.increment), self.increment) | ||
elif callable(self.increment): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use this as an entry point for custom pin-number generator functions
When you say generator functions I believe you don't just mean to use a python generator (i.e. yield), but actually define pin-number generator functions for the most common uses cases and use the total pin number as the function's input. And I guess these functions can be plugged to callable(self.increment) (see comment). Does this sound right? |
1f5f73c
to
ff6e1b3
Compare
With the latest changes, the definiton for DMR4000 will be: Texas_X2SON-4-1EP_1.1x1.4mm_P0.5mm_EP0.8x0.6mm:
device_type: 'X2SON'
library: Package_SON
manufacturer: 'Texas'
#part_number: 'mpn'
size_source: 'http://www.ti.com/lit/ds/symlink/drv5032.pdf#page=28'
ipc_class: 'qfn' #'qfn' | 'qfn_pull_back'
#ipc_density: 'least' #overwrite global value for this device. (if used, pad values are closer to TI's suggested fp)
body_size_x:
minimum: 1.05
maximum: 1.15
body_size_y:
minimum: 1.35
maximum: 1.45
overall_height:
maximum: 0.4
lead_width:
minimum: 0.17
maximum: 0.27
lead_len:
minimum: 0.15
maximum: 0.25
EP_size_x:
nominal: 0.8
tolerance: 0.05
EP_size_y:
nominal: 0.6
tolerance: 0.05
# EP_paste_coverage: 0.65
EP_num_paste_pads: 1 #[2, 2]
EP_pin_number: 5
pitch: 0.5
num_pins_x: 2
num_pins_y: 0
#include_suffix_in_3dpath: 'False'
#include_pad_size: 'fp_name_only' # 'both' | 'none' (default)
###### Custom pad numbering #####
pad_numbers:
generator: 'ccw_dual'
axis: 'x'
###############################
thermal_vias:
count: 1
drill: 0.2
# min_annular_ring: 0.15
paste_via_clearance: 0.1
EP_num_paste_pads: 1 # [2, 2]
EP_paste_coverage: 0.75
grid: [1, 1]
paste_avoid_via: False |
@pointhi this looks good to me have you any input? |
@poeschlr I'm okay with this |
Custom pin numbers for the exposed pad can be passed through the keyword argument EP_pin_number. If not defined the EP number is pincount+1.
Adds the ability to define custom pin numbers per side on a QFN package, as some packages use a non-standard numbering scheme. This commit adds python iterators to use for incrementing the pin numbers. To use the generators the key `pad_numbers` must be present on the package.
ff6e1b3
to
daa4e69
Compare
@pointhi When you merge this I will make a PR for the definition neeeded for KiCad/kicad-footprints#1553. |
As @pointhi gave the ok i assume i am ok with merging this. Thanks |
Custom pin numbers for the pad array can be passed to PadArray
as a list through the keyword argument
pad_numbers
.This bypasses the increment functionality.
Additonally, add the ability to define custom pin numbers per side on a QFN
package, as some packages use a non-standard numbering scheme.
This is needed for KiCad/kicad-footprints#1553 and it seems that there is also related issues (#323, #280)
As an example, here is the definition from the pull request mentioned above using the changes I suggest. Notice the
EP_pin_number
for the exposed pad andpad_numbers_{top,right,left,bottom}
And the resulting footprint:
Edit: Add related issue