From 57acda4b3b0becc5ca7156052363be97364a23f6 Mon Sep 17 00:00:00 2001 From: Nav Date: Sun, 20 Jun 2021 22:55:48 +0100 Subject: [PATCH] Included SSOP target package and updated the Insight window to use the DIP widget for SOIC, SSOP and DIP packages. Also updated the Insight window to use the QFP widget for QFN packages. --- .../InsightWindow/InsightWindow.cpp | 18 ++++++++++++------ src/Targets/Microchip/AVR/AVR8/Avr8.cpp | 3 +++ src/Targets/TargetVariant.hpp | 12 +++++++++++- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp b/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp index e76fe130..9995c89c 100644 --- a/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp @@ -220,15 +220,18 @@ void InsightWindow::deactivate() { } bool InsightWindow::isVariantSupported(const TargetVariant& variant) { - if (variant.package == TargetPackage::DIP) { - // All DIP variants must have a pin count that is a multiple of two + if (variant.package == TargetPackage::DIP + || variant.package == TargetPackage::SOIC + || variant.package == TargetPackage::SSOP + ) { + // All DIP, SOIC and SSOP variants must have a pin count that is a multiple of two if (variant.pinDescriptorsByNumber.size() % 2 == 0) { return true; } } - if (variant.package == TargetPackage::QFP) { - // All QFP variants must have a pin count that is a multiple of four + if (variant.package == TargetPackage::QFP || variant.package == TargetPackage::QFN) { + // All QFP and QFN variants must have a pin count that is a multiple of four if (variant.pinDescriptorsByNumber.size() % 4 == 0) { return true; } @@ -256,14 +259,17 @@ void InsightWindow::selectVariant(const TargetVariant* variant) { this->selectedVariant = variant; this->variantMenu->setTitle(QString::fromStdString(variant->name + " (" + variant->packageName + ")")); - if (variant->package == TargetPackage::DIP) { + if (variant->package == TargetPackage::DIP + || variant->package == TargetPackage::SOIC + || variant->package == TargetPackage::SSOP + ) { this->targetPackageWidget = new InsightTargetWidgets::Dip::DualInlinePackageWidget( *variant, this, this->ioContainerWidget ); - } else if (variant->package == TargetPackage::QFP) { + } else if (variant->package == TargetPackage::QFP || variant->package == TargetPackage::QFN) { this->targetPackageWidget = new InsightTargetWidgets::Qfp::QuadFlatPackageWidget( *variant, this, diff --git a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp index 531f3878..ed0073aa 100644 --- a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp +++ b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp @@ -245,6 +245,9 @@ void Avr8::loadTargetVariants() { } else if (tdVariant.package.find("SOIC") == 0) { targetVariant.package = TargetPackage::SOIC; + + } else if (tdVariant.package.find("SSOP") == 0) { + targetVariant.package = TargetPackage::SSOP; } if (!tdPinoutsByName.contains(tdVariant.pinoutName)) { diff --git a/src/Targets/TargetVariant.hpp b/src/Targets/TargetVariant.hpp index 68712164..9b10fd5f 100644 --- a/src/Targets/TargetVariant.hpp +++ b/src/Targets/TargetVariant.hpp @@ -23,15 +23,25 @@ namespace Bloom::Targets DIP, /** - * Small outline integrated circuit (SOIC) package. + * "Small outline integrated circuit" package (SOIC). * * Because of the similarities between SOIC and DIP, Insight treats SOIC packages as DIP packages. That is, * it uses the same package widget. */ SOIC, + /** + * "Shrink small outline" package (SSOP) + * + * Because of the similarities between this and DIP, Insight treats SSOP packages as DIP packages. That is, + * it uses the same package widget. + */ + SSOP, + /** * Quad flat no-lead (QFN) package + * + * Because of the similarities between this and QFP, Insight treats QFN packages as QFP. */ QFN, };