Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: samd: Implemented support for the SAMC21 series #1659

Merged
merged 2 commits into from
Oct 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion src/target/samd.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* * SAMD20J18A (rev B)
* * SAMD21J18A (rev B)
* * SAML21J17B (rev B)
* * SAMC21N18A (rev E)
*/

/*
Expand Down Expand Up @@ -129,7 +130,7 @@ const command_s samd_cmd_list[] = {
#define SAMD_STATUSB_PROT (1U << 16U)

/* Device Identification Register (DID) */
#define SAMD_DID_MASK 0xff380000U
#define SAMD_DID_MASK 0xfe380000U
#define SAMD_DID_CONST_VALUE 0x10000000U
#define SAMD_DID_DEVSEL_MASK 0xffU
#define SAMD_DID_DEVSEL_POS 0U
Expand Down Expand Up @@ -183,6 +184,24 @@ static const samd_part_s samd_d21_parts[] = {
{0xff, 0, 0, 0}, /* Sentinel entry */
};

static const samd_part_s samd_c21_parts[] = {
{0x00, 'J', 18, 'A'}, /* SAMC21J18A */
{0x01, 'J', 17, 'A'}, /* SAMC21J17A */
{0x02, 'J', 16, 'A'}, /* SAMC21J16A */
{0x03, 'J', 15, 'A'}, /* SAMC21J15A */
{0x05, 'G', 18, 'A'}, /* SAMC21G18A */
{0x06, 'G', 17, 'A'}, /* SAMC21G17A */
{0x07, 'G', 16, 'A'}, /* SAMC21G16A */
{0x08, 'G', 15, 'A'}, /* SAMC21G15A */
{0x0a, 'E', 18, 'A'}, /* SAMC21E18A */
{0x0b, 'E', 17, 'A'}, /* SAMC21E17A */
{0x0c, 'E', 16, 'A'}, /* SAMC21E16A */
{0x0d, 'E', 15, 'A'}, /* SAMC21E15A */
{0x20, 'N', 18, 'A'}, /* SAMC21N18A */
{0x21, 'N', 17, 'A'}, /* SAMC21N17A */
{0xff, 0, 0, 0}, /* Sentinel entry */
};

static const samd_part_s samd_l21_parts[] = {
{0x00, 'J', 18, 'A'}, /* SAML21J18A */
{0x01, 'J', 17, 'A'}, /* SAML21J17A */
Expand Down Expand Up @@ -379,6 +398,8 @@ samd_descr_s samd_parse_device_id(uint32_t did)
samd.series = 20;
break;
case 1:
if (family == 2)
parts = samd_c21_parts;
samd.series = 21;
break;
case 2:
Expand Down