资源简介
官网下载的NXP IMX系列跨平台,最新SOC RT1064的SKD包
代码片段和文件信息
/*
* Copyright 2018 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include “fsl_common.h“
#include “fsl_debug_console.h“
#include “board.h“
#if defined(SDK_I2C_baseD_COMPONENT_USED) && SDK_I2C_baseD_COMPONENT_USED
#include “fsl_lpi2c.h“
#endif /* SDK_I2C_baseD_COMPONENT_USED */
#include “fsl_iomuxc.h“
/*******************************************************************************
* Variables
******************************************************************************/
/*******************************************************************************
* Code
******************************************************************************/
/* Get debug console frequency. */
uint32_t BOARD_DebugConsoleSrcFreq(void)
{
uint32_t freq;
/* To make it simple we assume default PLL and divider settings and the only variable
from application is use PLL3 source or OSC source */
if (CLOCK_GetMux(kCLOCK_UartMux) == 0) /* PLL3 div6 80M */
{
freq = (CLOCK_GetPllFreq(kCLOCK_PllUsb1) / 6U) / (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U);
}
else
{
freq = CLOCK_GetOscFreq() / (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U);
}
return freq;
}
/* Initialize debug console. */
void BOARD_InitDebugConsole(void)
{
uint32_t uartClkSrcFreq = BOARD_DebugConsoleSrcFreq();
DbgConsole_Init(BOARD_DEBUG_UART_INSTANCE BOARD_DEBUG_UART_BAUDRATE BOARD_DEBUG_UART_TYPE uartClkSrcFreq);
}
#if defined(SDK_I2C_baseD_COMPONENT_USED) && SDK_I2C_baseD_COMPONENT_USED
void BOARD_LPI2C_Init(LPI2C_Type *base uint32_t clkSrc_Hz)
{
lpi2c_master_config_t lpi2cConfig = {0};
/*
* lpi2cConfig.debugEnable = false;
* lpi2cConfig.ignoreAck = false;
* lpi2cConfig.pinConfig = kLPI2C_2PinOpenDrain;
* lpi2cConfig.baudRate_Hz = 100000U;
* lpi2cConfig.busIdleTimeout_ns = 0;
* lpi2cConfig.pinLowTimeout_ns = 0;
* lpi2cConfig.sdaGlitchFilterWidth_ns = 0;
* lpi2cConfig.sclGlitchFilterWidth_ns = 0;
*/
LPI2C_MasterGetDefaultConfig(&lpi2cConfig);
LPI2C_MasterInit(base &lpi2cConfig clkSrc_Hz);
}
status_t BOARD_LPI2C_Send(LPI2C_Type *base
uint8_t deviceAddress
uint32_t subAddress
uint8_t subAddressSize
uint8_t *txBuff
uint8_t txBuffSize)
{
status_t reVal;
/* Send master blocking data to slave */
reVal = LPI2C_MasterStart(base deviceAddress kLPI2C_Write);
if (kStatus_Success == reVal)
{
while (LPI2C_MasterGetStatusFlags(base) & kLPI2C_MasterNackDetectFlag)
{
}
reVal = LPI2C_MasterSend(base &subAddress subAddressSize);
if (reVal != kStatus_Success)
{
return reVal;
}
reVal = LPI2C_MasterSend(base txBuff txBuffSize);
if (reVal != kSta
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3971 2019-07-04 01:47 SW-Content-Register.txt
目录 0 2019-07-05 01:47 CMSIS\
目录 0 2019-07-05 01:47 CMSIS\Include\
文件 10958 2019-07-04 01:47 CMSIS\Include\mpu_armv8.h
文件 97089 2019-07-04 01:47 CMSIS\Include\core_armv8mbl.h
文件 27561 2019-07-04 01:47 CMSIS\Include\cmsis_iccarm.h
文件 9014 2019-07-04 01:47 CMSIS\Include\cmsis_compiler.h
文件 1716 2019-07-04 01:47 CMSIS\Include\cmsis_version.h
文件 7482 2019-07-04 01:47 CMSIS\Include\mpu_armv7.h
文件 147455 2019-07-04 01:47 CMSIS\Include\core_cm7.h
文件 3027 2019-07-04 01:47 CMSIS\Include\arm_const_structs.h
文件 109499 2019-07-04 01:47 CMSIS\Include\core_sc300.h
文件 46751 2019-07-04 01:47 CMSIS\Include\core_sc000.h
文件 97271 2019-07-04 01:47 CMSIS\Include\core_cm23.h
文件 111105 2019-07-04 01:47 CMSIS\Include\core_cm3.h
文件 56905 2019-07-04 01:47 CMSIS\Include\cmsis_armclang.h
文件 253563 2019-07-04 01:47 CMSIS\Include\arm_math.h
文件 28359 2019-07-04 01:47 CMSIS\Include\cmsis_armcc.h
文件 62637 2019-07-04 01:47 CMSIS\Include\cmsis_gcc.h
文件 46889 2019-07-04 01:47 CMSIS\Include\core_cm0plus.h
文件 6156 2019-07-04 01:47 CMSIS\Include\arm_common_tables.h
文件 2757 2019-07-04 01:47 CMSIS\Include\tz_context.h
文件 122447 2019-07-04 01:47 CMSIS\Include\core_cm4.h
文件 171404 2019-07-04 01:47 CMSIS\Include\core_cm33.h
文件 2780 2019-07-04 01:47 CMSIS\Include\core_dsp.h
文件 171099 2019-07-04 01:47 CMSIS\Include\core_armv8mml.h
文件 38629 2019-07-04 01:47 CMSIS\Include\core_cm0.h
目录 0 2019-07-05 01:47 CMSIS\Driver\
目录 0 2019-07-05 01:47 CMSIS\Driver\DriverTemplates\
文件 2810 2019-07-04 01:47 CMSIS\Driver\DriverTemplates\Driver_SAI.c
文件 5036 2019-07-04 01:47 CMSIS\Driver\DriverTemplates\Driver_MCI.c
............此处省略5265个文件信息
评论
共有 条评论