mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-23 13:20:54 +00:00
add board_get_unique_id() for lpc43
This commit is contained in:
parent
202b945f88
commit
78e5b2c6a4
@ -236,6 +236,13 @@ uint32_t board_button_read(void) {
|
|||||||
return BUTTON_STATE_ACTIVE == Chip_GPIO_GetPinState(LPC_GPIO_PORT, BUTTON_PORT, BUTTON_PIN);
|
return BUTTON_STATE_ACTIVE == Chip_GPIO_GetPinState(LPC_GPIO_PORT, BUTTON_PORT, BUTTON_PIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t board_get_unique_id(uint8_t id[], size_t max_len) {
|
||||||
|
if ( max_len < 16 ) return 0;
|
||||||
|
uint32_t* id32 = (uint32_t*) (uintptr_t) id;
|
||||||
|
Chip_IAP_ReadUID(id32);
|
||||||
|
return 16;
|
||||||
|
}
|
||||||
|
|
||||||
int board_uart_read(uint8_t *buf, int len) {
|
int board_uart_read(uint8_t *buf, int len) {
|
||||||
return Chip_UART_Read(UART_DEV, buf, len);
|
return Chip_UART_Read(UART_DEV, buf, len);
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ function(add_board_target BOARD_TARGET)
|
|||||||
${SDK_DIR}/src/clock_18xx_43xx.c
|
${SDK_DIR}/src/clock_18xx_43xx.c
|
||||||
${SDK_DIR}/src/fpu_init.c
|
${SDK_DIR}/src/fpu_init.c
|
||||||
${SDK_DIR}/src/gpio_18xx_43xx.c
|
${SDK_DIR}/src/gpio_18xx_43xx.c
|
||||||
|
${SDK_DIR}/src/iap_18xx_43xx.c
|
||||||
${SDK_DIR}/src/sysinit_18xx_43xx.c
|
${SDK_DIR}/src/sysinit_18xx_43xx.c
|
||||||
${SDK_DIR}/src/uart_18xx_43xx.c
|
${SDK_DIR}/src/uart_18xx_43xx.c
|
||||||
)
|
)
|
||||||
|
@ -12,7 +12,11 @@ CFLAGS += \
|
|||||||
-DCFG_TUSB_MCU=OPT_MCU_LPC43XX
|
-DCFG_TUSB_MCU=OPT_MCU_LPC43XX
|
||||||
|
|
||||||
# mcu driver cause following warnings
|
# mcu driver cause following warnings
|
||||||
CFLAGS += -Wno-error=unused-parameter -Wno-error=strict-prototypes -Wno-error=cast-qual
|
CFLAGS += \
|
||||||
|
-Wno-error=unused-parameter \
|
||||||
|
-Wno-error=strict-prototypes \
|
||||||
|
-Wno-error=cast-qual \
|
||||||
|
-Wno-error=incompatible-pointer-types \
|
||||||
|
|
||||||
SRC_C += \
|
SRC_C += \
|
||||||
src/portable/chipidea/ci_hs/dcd_ci_hs.c \
|
src/portable/chipidea/ci_hs/dcd_ci_hs.c \
|
||||||
@ -21,12 +25,11 @@ SRC_C += \
|
|||||||
${SDK_DIR}/../gcc/cr_startup_lpc43xx.c \
|
${SDK_DIR}/../gcc/cr_startup_lpc43xx.c \
|
||||||
${SDK_DIR}/src/chip_18xx_43xx.c \
|
${SDK_DIR}/src/chip_18xx_43xx.c \
|
||||||
${SDK_DIR}/src/clock_18xx_43xx.c \
|
${SDK_DIR}/src/clock_18xx_43xx.c \
|
||||||
|
${SDK_DIR}/src/fpu_init.c \
|
||||||
${SDK_DIR}/src/gpio_18xx_43xx.c \
|
${SDK_DIR}/src/gpio_18xx_43xx.c \
|
||||||
|
${SDK_DIR}/src/iap_18xx_43xx.c \
|
||||||
${SDK_DIR}/src/sysinit_18xx_43xx.c \
|
${SDK_DIR}/src/sysinit_18xx_43xx.c \
|
||||||
${SDK_DIR}/src/i2c_18xx_43xx.c \
|
|
||||||
${SDK_DIR}/src/i2cm_18xx_43xx.c \
|
|
||||||
${SDK_DIR}/src/uart_18xx_43xx.c \
|
${SDK_DIR}/src/uart_18xx_43xx.c \
|
||||||
${SDK_DIR}/src/fpu_init.c
|
|
||||||
|
|
||||||
INC += \
|
INC += \
|
||||||
$(TOP)/$(BOARD_PATH) \
|
$(TOP)/$(BOARD_PATH) \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user