Skip to content

Commit 78e5b2c

Browse files
committed
add board_get_unique_id() for lpc43
1 parent 202b945 commit 78e5b2c

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

hw/bsp/lpc43/family.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,13 @@ uint32_t board_button_read(void) {
236236
return BUTTON_STATE_ACTIVE == Chip_GPIO_GetPinState(LPC_GPIO_PORT, BUTTON_PORT, BUTTON_PIN);
237237
}
238238

239+
size_t board_get_unique_id(uint8_t id[], size_t max_len) {
240+
if ( max_len < 16 ) return 0;
241+
uint32_t* id32 = (uint32_t*) (uintptr_t) id;
242+
Chip_IAP_ReadUID(id32);
243+
return 16;
244+
}
245+
239246
int board_uart_read(uint8_t *buf, int len) {
240247
return Chip_UART_Read(UART_DEV, buf, len);
241248
}

hw/bsp/lpc43/family.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ function(add_board_target BOARD_TARGET)
2424
${SDK_DIR}/src/clock_18xx_43xx.c
2525
${SDK_DIR}/src/fpu_init.c
2626
${SDK_DIR}/src/gpio_18xx_43xx.c
27+
${SDK_DIR}/src/iap_18xx_43xx.c
2728
${SDK_DIR}/src/sysinit_18xx_43xx.c
2829
${SDK_DIR}/src/uart_18xx_43xx.c
2930
)

hw/bsp/lpc43/family.mk

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ CFLAGS += \
1212
-DCFG_TUSB_MCU=OPT_MCU_LPC43XX
1313

1414
# mcu driver cause following warnings
15-
CFLAGS += -Wno-error=unused-parameter -Wno-error=strict-prototypes -Wno-error=cast-qual
15+
CFLAGS += \
16+
-Wno-error=unused-parameter \
17+
-Wno-error=strict-prototypes \
18+
-Wno-error=cast-qual \
19+
-Wno-error=incompatible-pointer-types \
1620

1721
SRC_C += \
1822
src/portable/chipidea/ci_hs/dcd_ci_hs.c \
@@ -21,12 +25,11 @@ SRC_C += \
2125
${SDK_DIR}/../gcc/cr_startup_lpc43xx.c \
2226
${SDK_DIR}/src/chip_18xx_43xx.c \
2327
${SDK_DIR}/src/clock_18xx_43xx.c \
28+
${SDK_DIR}/src/fpu_init.c \
2429
${SDK_DIR}/src/gpio_18xx_43xx.c \
30+
${SDK_DIR}/src/iap_18xx_43xx.c \
2531
${SDK_DIR}/src/sysinit_18xx_43xx.c \
26-
${SDK_DIR}/src/i2c_18xx_43xx.c \
27-
${SDK_DIR}/src/i2cm_18xx_43xx.c \
2832
${SDK_DIR}/src/uart_18xx_43xx.c \
29-
${SDK_DIR}/src/fpu_init.c
3033

3134
INC += \
3235
$(TOP)/$(BOARD_PATH) \

0 commit comments

Comments
 (0)