Skip to content

Commit 5557f66

Browse files
Fix arduino pinmap test failing
1 parent 9b06a99 commit 5557f66

File tree

3 files changed

+70
-2
lines changed

3 files changed

+70
-2
lines changed

targets/TARGET_Ambiq_Micro/TARGET_Apollo3/device/PeripheralPins.c

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,3 +312,68 @@ const PinMap PinMap_PWM_OUT[] = {
312312

313313
{NC, NC, 0}
314314
};
315+
316+
/************ GPIO ***************/
317+
318+
// Note that this is only used for testing, so that the test knows what are valid GPIO pins.
319+
// It's not used in normal usage.
320+
// Also, only the "pin" field is significant here. Other fields are don't cares.
321+
322+
const PinMap PinMap_GPIO[] = {
323+
{IO_0, 0, 0},
324+
{IO_1, 0, 0},
325+
{IO_2, 0, 0},
326+
{IO_3, 0, 0},
327+
{IO_4, 0, 0},
328+
{IO_5, 0, 0},
329+
{IO_6, 0, 0},
330+
{IO_7, 0, 0},
331+
{IO_8, 0, 0},
332+
{IO_9, 0, 0},
333+
{IO_10, 0, 0},
334+
{IO_11, 0, 0},
335+
{IO_12, 0, 0},
336+
{IO_13, 0, 0},
337+
{IO_14, 0, 0},
338+
{IO_15, 0, 0},
339+
{IO_16, 0, 0},
340+
{IO_17, 0, 0},
341+
{IO_18, 0, 0},
342+
{IO_19, 0, 0},
343+
{IO_20, 0, 0},
344+
{IO_21, 0, 0},
345+
{IO_22, 0, 0},
346+
{IO_23, 0, 0},
347+
{IO_24, 0, 0},
348+
{IO_25, 0, 0},
349+
{IO_26, 0, 0},
350+
{IO_27, 0, 0},
351+
{IO_28, 0, 0},
352+
{IO_29, 0, 0},
353+
{IO_39, 0, 0},
354+
{IO_40, 0, 0},
355+
{IO_41, 0, 0},
356+
{IO_44, 0, 0},
357+
{IO_47, 0, 0},
358+
{IO_48, 0, 0},
359+
{IO_49, 0, 0},
360+
361+
// Apollo3 I/O pins - BGA package only
362+
{IO_30, 0, 0},
363+
{IO_31, 0, 0},
364+
{IO_32, 0, 0},
365+
{IO_33, 0, 0},
366+
{IO_34, 0, 0},
367+
{IO_35, 0, 0},
368+
{IO_36, 0, 0},
369+
{IO_37, 0, 0},
370+
{IO_38, 0, 0},
371+
{IO_42, 0, 0},
372+
{IO_43, 0, 0},
373+
{IO_45, 0, 0},
374+
{IO_46, 0, 0},
375+
376+
{NC, NC, 0}
377+
};
378+
379+

targets/TARGET_Ambiq_Micro/TARGET_Apollo3/device/PeripheralPins.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "pinmap.h"
2424
#include "PeripheralNames.h"
2525

26+
2627
//*** I2C ***
2728
#if DEVICE_I2C
2829
extern const PinMap PinMap_I2C_SDA[];
@@ -70,4 +71,6 @@ extern const PinMap PinMap_QSPI_DATA2[];
7071
extern const PinMap PinMap_QSPI_DATA3[];
7172
#endif
7273

74+
extern const PinMap PinMap_GPIO[];
75+
7376
#endif

targets/TARGET_Ambiq_Micro/TARGET_Apollo3/device/gpio_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include "mbed_assert.h"
2525
#include "gpio_api.h"
26+
#include "PeripheralPins.h"
2627

2728
/** Set the given pin as GPIO
2829
*
@@ -224,6 +225,5 @@ int gpio_read(gpio_t *obj)
224225
*/
225226
const PinMap *gpio_pinmap(void)
226227
{
227-
MBED_ASSERT(false);
228-
return NULL;
228+
return PinMap_GPIO;
229229
}

0 commit comments

Comments
 (0)