mirror of
https://github.com/hathach/tinyusb.git
synced 2025-02-19 06:40:45 +00:00
Merge pull request #2721 from hathach/hild-add-metro-m7
HIL add metro m7
This commit is contained in:
commit
b8581b4ab7
@ -24,8 +24,8 @@
|
||||
* This file is part of the TinyUSB stack.
|
||||
*/
|
||||
|
||||
#ifndef _BOARD_API_H_
|
||||
#define _BOARD_API_H_
|
||||
#ifndef BOARD_API_H_
|
||||
#define BOARD_API_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include "fsl_iomuxc.h"
|
||||
#include "fsl_clock.h"
|
||||
#include "fsl_lpuart.h"
|
||||
#include "fsl_ocotp.h"
|
||||
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic pop
|
||||
@ -186,6 +187,29 @@ uint32_t board_button_read(void) {
|
||||
return BUTTON_STATE_ACTIVE == GPIO_PinRead(BUTTON_PORT, BUTTON_PIN);
|
||||
}
|
||||
|
||||
size_t board_get_unique_id(uint8_t id[], size_t max_len) {
|
||||
(void) max_len;
|
||||
|
||||
#if FSL_FEATURE_OCOTP_HAS_TIMING_CTRL
|
||||
OCOTP_Init(OCOTP, CLOCK_GetFreq(kCLOCK_IpgClk));
|
||||
#else
|
||||
OCOTP_Init(OCOTP, 0u);
|
||||
#endif
|
||||
|
||||
// Reads shadow registers 0x01 - 0x04 (Configuration and Manufacturing Info)
|
||||
// into 8 bit wide destination, avoiding punning.
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
uint32_t wr = OCOTP_ReadFuseShadowRegister(OCOTP, i + 1);
|
||||
for (int j = 0; j < 4; j++) {
|
||||
id[i*4+j] = wr & 0xff;
|
||||
wr >>= 8;
|
||||
}
|
||||
}
|
||||
OCOTP_Deinit(OCOTP);
|
||||
|
||||
return 16;
|
||||
}
|
||||
|
||||
int board_uart_read(uint8_t* buf, int len) {
|
||||
int count = 0;
|
||||
|
||||
|
@ -44,6 +44,7 @@ function(add_board_target BOARD_TARGET)
|
||||
${SDK_DIR}/drivers/igpio/fsl_gpio.c
|
||||
${SDK_DIR}/drivers/lpspi/fsl_lpspi.c
|
||||
${SDK_DIR}/drivers/lpuart/fsl_lpuart.c
|
||||
${SDK_DIR}/drivers/ocotp/fsl_ocotp.c
|
||||
${SDK_DIR}/devices/${MCU_VARIANT}/system_${MCU_VARIANT_WITH_CORE}.c
|
||||
${SDK_DIR}/devices/${MCU_VARIANT}/xip/fsl_flexspi_nor_boot.c
|
||||
${SDK_DIR}/devices/${MCU_VARIANT}/drivers/fsl_clock.c
|
||||
@ -75,6 +76,7 @@ function(add_board_target BOARD_TARGET)
|
||||
${SDK_DIR}/drivers/igpio
|
||||
${SDK_DIR}/drivers/lpspi
|
||||
${SDK_DIR}/drivers/lpuart
|
||||
${SDK_DIR}/drivers/ocotp
|
||||
)
|
||||
|
||||
update_board(${BOARD_TARGET})
|
||||
|
@ -50,7 +50,8 @@ SRC_C += \
|
||||
$(SDK_DIR)/drivers/common/fsl_common.c \
|
||||
$(SDK_DIR)/drivers/common/fsl_common_arm.c \
|
||||
$(SDK_DIR)/drivers/igpio/fsl_gpio.c \
|
||||
$(SDK_DIR)/drivers/lpuart/fsl_lpuart.c
|
||||
$(SDK_DIR)/drivers/lpuart/fsl_lpuart.c \
|
||||
$(SDK_DIR)/drivers/ocotp/fsl_ocotp.c \
|
||||
|
||||
# Optional drivers: only available for some mcus: rt1160, rt1170
|
||||
ifneq (,$(wildcard ${TOP}/${MCU_DIR}/drivers/fsl_dcdc.c))
|
||||
@ -68,7 +69,8 @@ INC += \
|
||||
$(TOP)/$(MCU_DIR)/drivers \
|
||||
$(TOP)/$(SDK_DIR)/drivers/common \
|
||||
$(TOP)/$(SDK_DIR)/drivers/igpio \
|
||||
$(TOP)/$(SDK_DIR)/drivers/lpuart
|
||||
$(TOP)/$(SDK_DIR)/drivers/lpuart \
|
||||
$(TOP)/$(SDK_DIR)/drivers/ocotp \
|
||||
|
||||
SRC_S += $(MCU_DIR)/gcc/startup_$(MCU_VARIANT_WITH_CORE).S
|
||||
|
||||
|
@ -30,6 +30,13 @@
|
||||
"flasher": "esptool",
|
||||
"flasher_sn": "3ea619acd1cdeb11a0a0b806e93fd3f1",
|
||||
"flasher_args": "-b 1500000"
|
||||
},
|
||||
{
|
||||
"name": "metro_m7_1011",
|
||||
"uid": "9CE8715DD71137363E00005002004200",
|
||||
"flasher": "jlink",
|
||||
"flasher_sn": "000611000000",
|
||||
"flasher_args": "-device MIMXRT1011xxx5A"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user