Skip to content

Commit

Permalink
Handle SOP08 notations and handle SOT93 (TO-218) packages
Browse files Browse the repository at this point in the history
  • Loading branch information
macbre committed Oct 9, 2017
1 parent 5622e21 commit 7867192
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Elecena/Utils/PackageInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public static function getPackage($desc) {
// DIP 6 -> DIP-6
$desc = preg_replace('#(\b(DIP))\s([1-9]\d?)#', '$1-$3', $desc);

// SOP08 -> SOP8
$desc = preg_replace('#([A-Z]{3,})0(\d)#', '$1$2', $desc);

$groups = [
'TO-?(1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|201|202|203|204|205|206|206-?AA|207|208|208A|210|211|212|213AA|214|217|218|221|222|223|224|225|226|227|228|229|230|231|232|233|234|235|239|241|242|248|249|254|255|257|258|259|264|268|276)',
// https://en.wikipedia.org/wiki/TO-92
Expand Down Expand Up @@ -99,6 +102,8 @@ public static function getPackage($desc) {
'(SC-?73)|(TO-?261AA)|(SM-?8)',
// https://en.wikipedia.org/wiki/Small-outline_transistor#SOT89-3
'SOT?-89-?(3|4|5)?',
// SOT-93 is a through-hole mount package between TO-220 and TO-247 (TO-218 / SOT-93) / http://www.psitechnologies.com/products/to218.php
'SOT-?93',
// http://www.ferret.com.au/c/richardson-electronics/100v-mosfet-modules-in-sp3-sp4-sp6-packages-n679793 / mosfet modules
'SP(1|3|4|6|6-P)',
// Clipwatt
Expand Down Expand Up @@ -247,6 +252,10 @@ public static function getPackage($desc) {
'TO-3P' => 'TO-247',
'SOT429' => 'TO-247',

// SOT-93 is a through-hole mount package between TO-220 and TO-247 in terms of package size | TO-218 / SOT-93
// @see http://www.psitechnologies.com/products/to218.php
'SOT93' => 'TO-218',

// SOT416: SC-75 / SOT-523
'SOT523' => 'SOT416',
'SC75' => 'SOT416',
Expand Down
6 changes: 6 additions & 0 deletions tests/PackageInfoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ public function getPackageProvider() {
[ 'Pamięć; EEPROM; I2C; 128x8bit; 1,7÷5,5V; 400kHz; TSSOP8', 'TSSOP8' ],
[ 'Nadajnik-odbiornik linii; RS232 / V.28; 4,5÷5,5VDC; SSOP20', 'SSOP20' ],

[ '24C16N-10SI 2,7 Atm SOP08', 'SOP8' ],

[ 'Odbiornik linii; RS232; L.odb:4; 4,5÷5,5VDC; SO14; 0÷75°C', 'SO14' ],
[ 'Nadajnik-odbiornik linii; RS232,full duplex; 4,5÷5,5VDC; SO16', 'SO16' ],
[ 'Odbiornik linii; RS422,RS423; L.odb:4; 4,5÷5,5VDC; SO16; -40÷85°C', 'SO16' ],
Expand Down Expand Up @@ -133,6 +135,9 @@ public function getPackageProvider() {
[ 'RF Amplifier IC, 21 dB Gain / 4.5 dB Noise, DC to 4 GHz, 5 V supply, SOT-89-4', 'SOT89-3' ],
[ 'IC LDO 0.2A LOW DROPOUT SOT-89-5', 'SOT89-5' ],

[ '2SK956 Tranzystor N-MOSFET 800V 9A 150W 1R5 SOT93', 'TO-218' ],
[ 'Transistor NPN TO-218 60 V 15 A 90 W', 'TO-218' ],

[ 'BSP52E6327 INFIN 0205 SOT223', 'SOT223' ],
[ 'PNP high-voltage low VCEsat Breakthrough In Small Signal (BISS) transistor in a SOT223 (SC-73) medium power', 'SOT223' ],
[ 'Tranzystor NPN 350 V 100 mA 70 MHz HFE 40 TO-261AA BSP19AT1G 3-Pin', 'SOT223' ],
Expand Down Expand Up @@ -169,6 +174,7 @@ public function getPackageProvider() {
[ 'Transoptor 4N37 z tranzystorem 1-kanałowy DC DIP 6 Vishay', 'DIP6' ],
[ 'IC VREF SERIES PREC 5V 8-CERDIP', 'CERDIP8' ],
[ 'IC FPS POWER SWITCH 650V 8-MDIP', 'MDIP8' ],
[ '24C128-10PI-2,7 Atm PDIP08', 'PDIP8' ],
[ 'LNK6769V IC LINKSWITCH 39W 54W 12-EDIP', 'EDIP12' ],
[ 'TODX283 PRODUCENT / MANUFACTURER: TOSHIBA OBUDOWA / PACKAGE: DIP-10 OPTOELECTRONIC', 'DIP10' ],
[ 'FOO DIP-11', false ],
Expand Down

0 comments on commit 7867192

Please sign in to comment.