Skip to content

add artemis mm pb variant #285

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

Merged
merged 1 commit into from
Oct 16, 2020
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion .github/workflows/generate-variants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ jobs:
{"name": "artemis-redboard-nano-lib", "config": {"base": "compile --library --source=mbed-os", "tgt": "SFE_ARTEMIS_NANO", "tool": "GCC_ARM"}, "user": {"variant": {"name": "ARTEMIS_NANO", "loc": "variants/SFE_ARTEMIS_NANO"}}},
{"name": "artemis-thing-plus-lib", "config": {"base": "compile --library --source=mbed-os", "tgt": "SFE_ARTEMIS_THING_PLUS", "tool": "GCC_ARM"}, "user": {"variant": {"name": "ARTEMIS_THING_PLUS", "loc": "variants/SFE_ARTEMIS_THING_PLUS"}}},
{"name": "edge-lib", "config": {"base": "compile --library --source=mbed-os", "tgt": "SFE_EDGE", "tool": "GCC_ARM"}, "user": {"variant": {"name": "EDGE", "loc": "variants/SFE_EDGE"}}},
{"name": "edge2-lib", "config": {"base": "compile --library --source=mbed-os", "tgt": "SFE_EDGE2", "tool": "GCC_ARM"}, "user": {"variant": {"name": "EDGE2", "loc": "variants/SFE_EDGE2"}}}
{"name": "edge2-lib", "config": {"base": "compile --library --source=mbed-os", "tgt": "SFE_EDGE2", "tool": "GCC_ARM"}, "user": {"variant": {"name": "EDGE2", "loc": "variants/SFE_EDGE2"}}},
{"name": "artemis-mm-pb-lib", "config": {"base": "compile --library --source=mbed-os", "tgt": "SFE_ARTEMIS_MM_PB", "tool": "GCC_ARM"}, "user": {"variant": {"name": "ARTEMIS_MM_PB", "loc": "variants/SFE_ARTEMIS_MM_PB"}}}
]
mbed: |
{"url": "https://github.com/sparkfun/mbed-os-ambiq-apollo3", "branch": "ambiq-apollo3-arduino"}
Expand Down
34 changes: 34 additions & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,40 @@ sfe_edge2.menu.loader.option_svl.build.ldscript={runtime.platform.path}/tools/up

###############################################################

sfe_artemis_mm_pb.name=Artemis Micro Mod Processor
sfe_artemis_mm_pb.build.core=arduino
sfe_artemis_mm_pb.build.variant=SFE_ARTEMIS_MM_PB
sfe_artemis_mm_pb.build.arch=APOLLO3
sfe_artemis_mm_pb.build.board=APOLLO3_SFE_ARTEMIS_MM_PB
sfe_artemis_mm_pb.build.export_format=bin
sfe_artemis_mm_pb.build.defines=
sfe_artemis_mm_pb.build.includes=
sfe_artemis_mm_pb.build.libs=

sfe_artemis_mm_pb.menu.svl_baud.921600=921600
sfe_artemis_mm_pb.menu.svl_baud.460800=460800
sfe_artemis_mm_pb.menu.svl_baud.230400=230400
sfe_artemis_mm_pb.menu.svl_baud.115200=115200
sfe_artemis_mm_pb.menu.svl_baud.57600=57600
sfe_artemis_mm_pb.menu.loader.option_asb=Ambiq Secure Bootloader (Recommended)
sfe_artemis_mm_pb.menu.loader.option_svl=SparkFun Variable Loader (Out of Order)

sfe_artemis_mm_pb.menu.svl_baud.57600.upload.svl_baud=57600
sfe_artemis_mm_pb.menu.svl_baud.115200.upload.svl_baud=115200
sfe_artemis_mm_pb.menu.svl_baud.230400.upload.svl_baud=230400
sfe_artemis_mm_pb.menu.svl_baud.460800.upload.svl_baud=460800
sfe_artemis_mm_pb.menu.svl_baud.921600.upload.svl_baud=921600

sfe_artemis_mm_pb.upload.asb_baud=115200

sfe_artemis_mm_pb.menu.loader.option_asb.upload.tool=asb
sfe_artemis_mm_pb.menu.loader.option_asb.build.ldscript={runtime.platform.path}/tools/uploaders/asb/0xC000.ld

sfe_artemis_mm_pb.menu.loader.option_svl.upload.tool=svl
sfe_artemis_mm_pb.menu.loader.option_svl.build.ldscript={runtime.platform.path}/tools/uploaders/svl/0x10000.ld

###############################################################

sfe_artemis_module.name=Artemis Module
sfe_artemis_module.build.core=arduino
sfe_artemis_module.build.variant=SFE_ARTEMIS_MODULE
Expand Down
51 changes: 51 additions & 0 deletions variants/SFE_ARTEMIS_MM_PB/config/pins.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
// This file is subject to the terms and conditions defined in
// file 'LICENSE.md', which is part of this source code package.
*/

#include "bridge/pins.h"

const pin_size_t variantPinCount = 40;

PinState variantPinStates[variantPinCount] = {
{AUD_OUT, 18, NULL, /*NULL, NULL, NULL,*/ NULL}, // only unique pins here, so AUD_MCLK == AUD_OUT on this board
{AUD_IN, 11, NULL, /*NULL, NULL, NULL,*/ NULL},
{AUD_LRCLK, 36, NULL, /*NULL, NULL, NULL,*/ NULL},
{AUD_BCLK, 37, NULL, /*NULL, NULL, NULL,*/ NULL},
{SCL, 39, NULL, /*NULL, NULL, NULL,*/ NULL},
{SDA, 40, NULL, /*NULL, NULL, NULL,*/ NULL},
{I2C_INT, 2, NULL, /*NULL, NULL, NULL,*/ NULL},
{SCL1, 8, NULL, /*NULL, NULL, NULL,*/ NULL},
{SDA1, 9, NULL, /*NULL, NULL, NULL,*/ NULL},
{BATT_VIN, 31, NULL, /*NULL, NULL, NULL,*/ NULL},
{SDIO_CLK, 5, NULL, /*NULL, NULL, NULL,*/ NULL},
{SDIO_CMD, 7, NULL, /*NULL, NULL, NULL,*/ NULL},
{SDIO_DATA0, 6, NULL, /*NULL, NULL, NULL,*/ NULL},
{SDIO_DATA1, 26, NULL, /*NULL, NULL, NULL,*/ NULL},
{SDIO_DATA2, 4, NULL, /*NULL, NULL, NULL,*/ NULL},
{SDIO_DATA3, 23, NULL, /*NULL, NULL, NULL,*/ NULL},
{SPI_SDI, 43, NULL, /*NULL, NULL, NULL,*/ NULL},
{SPI_SDO, 38, NULL, /*NULL, NULL, NULL,*/ NULL},
{SPI_SCK, 42, NULL, /*NULL, NULL, NULL,*/ NULL},
{SPI_CS, 41, NULL, /*NULL, NULL, NULL,*/ NULL},
{A0, 32, NULL, /*NULL, NULL, NULL,*/ NULL},
{A1, 35, NULL, /*NULL, NULL, NULL,*/ NULL},
{PWM0, 44, NULL, /*NULL, NULL, NULL,*/ NULL},
{PWM1, 45, NULL, /*NULL, NULL, NULL,*/ NULL},
{D0, 0, NULL, /*NULL, NULL, NULL,*/ NULL},
{D1, 1, NULL, /*NULL, NULL, NULL,*/ NULL},
{TX1, 12, NULL, /*NULL, NULL, NULL,*/ NULL},
{RX1, 25, NULL, /*NULL, NULL, NULL,*/ NULL},
{RTS1, 10, NULL, /*NULL, NULL, NULL,*/ NULL},
{CTS1, 17, NULL, /*NULL, NULL, NULL,*/ NULL},
{G0, 16, NULL, /*NULL, NULL, NULL,*/ NULL},
{G1, 33, NULL, /*NULL, NULL, NULL,*/ NULL},
{G2, 34, NULL, /*NULL, NULL, NULL,*/ NULL},
{G3, 27, NULL, /*NULL, NULL, NULL,*/ NULL},
{G4, 28, NULL, /*NULL, NULL, NULL,*/ NULL},
{G5, 29, NULL, /*NULL, NULL, NULL,*/ NULL},
{G6, 14, NULL, /*NULL, NULL, NULL,*/ NULL},
{G7, 15, NULL, /*NULL, NULL, NULL,*/ NULL},
{G9, 12, NULL, /*NULL, NULL, NULL,*/ NULL},
{G10, 13, NULL, /*NULL, NULL, NULL,*/ NULL},
};
11 changes: 11 additions & 0 deletions variants/SFE_ARTEMIS_MM_PB/config/pins.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
// This file is subject to the terms and conditions defined in
// file 'LICENSE.md', which is part of this source code package.
*/

#ifndef _VARIANT_PINS_H_
#define _VARIANT_PINS_H_

#define LED_BUILTIN pinNumberByName(LED1)

#endif // _VARIANT_PINS_H_
10 changes: 10 additions & 0 deletions variants/SFE_ARTEMIS_MM_PB/variant.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
// This file is subject to the terms and conditions defined in
// file 'LICENSE.md', which is part of this source code package.
*/

#include "variant.h"

void initVariant(void){

}
32 changes: 32 additions & 0 deletions variants/SFE_ARTEMIS_MM_PB/variant.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
// This file is subject to the terms and conditions defined in
// file 'LICENSE.md', which is part of this source code package.
*/

#ifndef _VARIANT_H_
#define _VARIANT_H_

#include "Arduino.h"

#include "config/pins.h"

#define VARIANT_SPI_INTFCS 2
#define VARIANT_WIRE_INTFCS 2

// SPI
#define VARIANT_SPI_SDI SPI_SDI
#define VARIANT_SPI_SDO SPI_SDO
#define VARIANT_SPI_CLK SPI_CLK

#define VARIANT_SPI1_SDI SPI1_SDI
#define VARIANT_SPI1_SDO SPI1_SDO
#define VARIANT_SPI1_CLK SPI1_CLK

// Wire
#define VARIANT_Wire_SDA I2C_SDA
#define VARIANT_Wire_SCL I2C_SCL

#define VARIANT_Wire1_SDA I2C1_SDA
#define VARIANT_Wire1_SCL I2C1_SCL

#endif // _VARIANT_H_