add lpc11u37 for hil rpi

This commit is contained in:
hathach
2024-07-19 22:33:53 +07:00
parent e9f9d43d67
commit 6bb59eeb3f
5 changed files with 18 additions and 2 deletions

View File

@@ -90,6 +90,13 @@ void board_led_write(bool state) {
Chip_GPIO_SetPinState(LPC_GPIO, LED_PORT, LED_PIN, state ? LED_STATE_ON : (1 - LED_STATE_ON));
}
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;
id32[0] = Chip_IAP_ReadUID();
return 4;
}
uint32_t board_button_read(void) {
return BUTTON_STATE_ACTIVE == Chip_GPIO_GetPinState(LPC_GPIO, BUTTON_PORT, BUTTON_PIN);
}

View File

@@ -30,6 +30,7 @@ function(add_board_target BOARD_TARGET)
${SDK_DIR}/../gcc/cr_startup_lpc${LPC_FAMILY}.c
${SDK_DIR}/src/chip_${LPC_FAMILY}.c
${SDK_DIR}/src/clock_${LPC_FAMILY}.c
${SDK_DIR}/src/iap.c
${SDK_DIR}/src/iocon_${LPC_FAMILY}.c
${SDK_DIR}/src/sysinit_${LPC_FAMILY}.c
)