Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
luozhenger
rt-thread
提交
b9a9225c
R
rt-thread
项目概览
luozhenger
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b9a9225c
编写于
11月 17, 2022
作者:
mysterywolf
提交者:
mysterywolf
11月 17, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
format imxrt drver files
上级
60b74152
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
42 addition
and
50 deletion
+42
-50
bsp/imxrt/libraries/drivers/drv_flexspi.c
bsp/imxrt/libraries/drivers/drv_flexspi.c
+2
-2
bsp/imxrt/libraries/drivers/drv_rtc.c
bsp/imxrt/libraries/drivers/drv_rtc.c
+8
-16
bsp/imxrt/libraries/drivers/drv_sdio.c
bsp/imxrt/libraries/drivers/drv_sdio.c
+3
-3
bsp/imxrt/libraries/drivers/drv_usbh.c
bsp/imxrt/libraries/drivers/drv_usbh.c
+1
-1
bsp/imxrt/libraries/drivers/usb/host/usb_host.h
bsp/imxrt/libraries/drivers/usb/host/usb_host.h
+1
-1
bsp/imxrt/libraries/drivers/usb/host/usb_host_ehci.c
bsp/imxrt/libraries/drivers/usb/host/usb_host_ehci.c
+16
-16
bsp/imxrt/libraries/drivers/usb/host/usb_host_ehci.h
bsp/imxrt/libraries/drivers/usb/host/usb_host_ehci.h
+1
-1
bsp/imxrt/libraries/drivers/usb/host/usb_host_hci.c
bsp/imxrt/libraries/drivers/usb/host/usb_host_hci.c
+4
-4
bsp/imxrt/libraries/drivers/usb/include/usb.h
bsp/imxrt/libraries/drivers/usb/include/usb.h
+2
-2
bsp/imxrt/libraries/drivers/usb/include/usb_host_config.h
bsp/imxrt/libraries/drivers/usb/include/usb_host_config.h
+3
-3
bsp/imxrt/libraries/drivers/usb/phy/usb_phy.c
bsp/imxrt/libraries/drivers/usb/phy/usb_phy.c
+1
-1
未找到文件。
bsp/imxrt/libraries/drivers/drv_flexspi.c
浏览文件 @
b9a9225c
...
...
@@ -80,7 +80,7 @@ static int rt_hw_imxrt_flexspi_init(void)
config
.
ahbConfig
.
enableAHBBufferable
=
true
;
config
.
ahbConfig
.
enableReadAddressOpt
=
true
;
config
.
ahbConfig
.
enableAHBCachable
=
true
;
config
.
ahbConfig
.
enableClearAHBBufferOpt
=
true
;
config
.
ahbConfig
.
enableClearAHBBufferOpt
=
true
;
config
.
rxSampleClock
=
FLEXSPI_RX_SAMPLE_CLOCK
;
if
(
COMBINATION_MODE
)
{
...
...
@@ -125,7 +125,7 @@ static void flexspi_test(void)
LOG_D
(
"FLEXSPI Memory 32 bit Write End
\n
"
);
memset
(
recv_buf
,
0
,
sizeof
(
recv_buf
));
LOG_D
(
"FLEXSPI Memory 32 bit Read Start
\n
"
);
recv_buf
[
2
]
=
*
(
flexspi
+
11
);
recv_buf
[
3
]
=
*
(
flexspi
+
15
);
...
...
bsp/imxrt/libraries/drivers/drv_rtc.c
浏览文件 @
b9a9225c
...
...
@@ -33,7 +33,7 @@ static time_t imxrt_hp_get_timestamp(void)
snvs_lp_srtc_datetime_t
srtcDate
=
{
0
};
SNVS_LP_SRTC_GetDatetime
(
SNVS
,
&
srtcDate
);
SNVS_HP_RTC_TimeSynchronize
(
SNVS
);
SNVS_HP_RTC_TimeSynchronize
(
SNVS
);
SNVS_HP_RTC_GetDatetime
(
SNVS
,
&
rtcDate
);
tm_new
.
tm_sec
=
rtcDate
.
second
;
...
...
@@ -69,7 +69,7 @@ static int imxrt_hp_set_timestamp(time_t timestamp)
return
-
RT_ERROR
;
}
SNVS_HP_RTC_TimeSynchronize
(
SNVS
);
SNVS_HP_RTC_TimeSynchronize
(
SNVS
);
return
RT_EOK
;
}
...
...
@@ -77,7 +77,7 @@ static int imxrt_hp_set_timestamp(time_t timestamp)
static
rt_err_t
imxrt_hp_rtc_init
(
rt_device_t
dev
)
{
snvs_hp_rtc_config_t
snvsRtcConfig
;
snvs_lp_srtc_config_t
snvsSrtcConfig
;
snvs_lp_srtc_config_t
snvsSrtcConfig
;
/* Init SNVS_HP */
SNVS_HP_RTC_GetDefaultConfig
(
&
snvsRtcConfig
);
...
...
@@ -105,12 +105,12 @@ static rt_err_t imxrt_hp_rtc_close(rt_device_t dev)
static
rt_size_t
imxrt_hp_rtc_read
(
rt_device_t
dev
,
rt_off_t
pos
,
void
*
buffer
,
rt_size_t
size
)
{
return
RT_EOK
;
return
-
RT_EINVAL
;
}
static
rt_size_t
imxrt_hp_rtc_write
(
rt_device_t
dev
,
rt_off_t
pos
,
const
void
*
buffer
,
rt_size_t
size
)
{
return
RT_EOK
;
return
-
RT_EINVAL
;
}
static
rt_err_t
imxrt_hp_rtc_control
(
rt_device_t
dev
,
int
cmd
,
void
*
args
)
...
...
@@ -132,7 +132,7 @@ static rt_err_t imxrt_hp_rtc_control(rt_device_t dev, int cmd, void *args)
break
;
default:
return
RT_EINVAL
;
return
-
RT_EINVAL
;
}
return
RT_EOK
;
...
...
@@ -179,7 +179,6 @@ static int rtc_sample(int argc, char *argv[])
time_t
now
;
rt_device_t
device
=
RT_NULL
;
/*寻找设备*/
device
=
rt_device_find
(
RTC_NAME
);
if
(
!
device
)
{
...
...
@@ -187,14 +186,12 @@ static int rtc_sample(int argc, char *argv[])
return
RT_ERROR
;
}
/*初始化RTC设备*/
if
(
rt_device_open
(
device
,
0
)
!=
RT_EOK
)
{
LOG_E
(
"open %s failed!"
,
RTC_NAME
);
return
RT_ERROR
;
return
-
RT_ERROR
;
}
/* 设置日期 */
ret
=
set_date
(
2018
,
12
,
3
);
if
(
ret
!=
RT_EOK
)
{
...
...
@@ -202,7 +199,6 @@ static int rtc_sample(int argc, char *argv[])
return
ret
;
}
/* 设置时间 */
ret
=
set_time
(
11
,
15
,
50
);
if
(
ret
!=
RT_EOK
)
{
...
...
@@ -210,16 +206,12 @@ static int rtc_sample(int argc, char *argv[])
return
ret
;
}
/* 延时3秒 */
rt_thread_mdelay
(
3000
);
rt_thread_mdelay
(
1000
);
/* 获取时间 */
now
=
time
(
RT_NULL
);
rt_kprintf
(
"%s
\n
"
,
ctime
(
&
now
));
return
ret
;
}
/* 导出到 msh 命令列表中 */
MSH_CMD_EXPORT
(
rtc_sample
,
rtc
sample
);
#endif
/* BSP_USING_RTC */
bsp/imxrt/libraries/drivers/drv_sdio.c
浏览文件 @
b9a9225c
...
...
@@ -49,7 +49,7 @@ static int enable_log = 1;
#define USDHC_DATA_TIMEOUT (0xFU)
/*!< data timeout counter value */
#define SDMMCHOST_SUPPORT_MAX_BLOCK_LENGTH (4096U)
#define SDMMCHOST_SUPPORT_MAX_BLOCK_COUNT (USDHC_MAX_BLOCK_COUNT)
/* Read/write watermark level. The bigger value indicates DMA has higher read/write performance. */
#define USDHC_READ_WATERMARK_LEVEL (0x80U)
#define USDHC_WRITE_WATERMARK_LEVEL (0x80U)
...
...
@@ -404,7 +404,7 @@ rt_int32_t _imxrt_mci_init(void)
struct
rt_mmcsd_host
*
host
;
struct
imxrt_mmcsd
*
mmcsd
;
uint32_t
hs400Capability
=
0U
;
host
=
mmcsd_alloc_host
();
if
(
!
host
)
{
...
...
@@ -433,7 +433,7 @@ rt_int32_t _imxrt_mci_init(void)
MMCSD_SUP_HIGHSPEED
|
MMCSD_SUP_SDIO_IRQ
;
#ifdef SOC_IMXRT1170_SERIES
#if defined FSL_FEATURE_USDHC_INSTANCE_SUPPORT_HS400_MODEn
hs400Capability
=
(
uint32_t
)
FSL_FEATURE_USDHC_INSTANCE_SUPPORT_HS400_MODEn
(
mmcsd
->
usdhc_host
.
base
);
hs400Capability
=
(
uint32_t
)
FSL_FEATURE_USDHC_INSTANCE_SUPPORT_HS400_MODEn
(
mmcsd
->
usdhc_host
.
base
);
#endif
#if (defined(FSL_FEATURE_USDHC_HAS_HS400_MODE) && (FSL_FEATURE_USDHC_HAS_HS400_MODE))
if
(
hs400Capability
!=
0U
)
...
...
bsp/imxrt/libraries/drivers/drv_usbh.c
浏览文件 @
b9a9225c
...
...
@@ -104,7 +104,7 @@ static void USB_HostClockInit(usb_controller_index_t controller_id)
usb_phy_config_struct_t
phyConfig
=
{
BOARD_USB_PHY_D_CAL
,
BOARD_USB_PHY_TXCAL45DP
,
BOARD_USB_PHY_TXCAL45DM
,
};
usbClockFreq
=
24000000
;
if
(
controller_id
==
kUSB_ControllerEhci0
)
...
...
bsp/imxrt/libraries/drivers/usb/host/usb_host.h
浏览文件 @
b9a9225c
...
...
@@ -107,7 +107,7 @@ typedef struct _usb_host_process_descriptor_param
device */
#ifdef SOC_IMXRT1170_SERIES
uint16_t
languageId
;
/*!< It specifies the language ID for string descriptors or is reset to zero for other
descriptors */
descriptors */
#else
uint8_t
languageId
;
/*!< It specifies the language ID for string descriptors or is reset to zero for other
descriptors */
...
...
bsp/imxrt/libraries/drivers/usb/host/usb_host_ehci.c
浏览文件 @
b9a9225c
...
...
@@ -1097,7 +1097,7 @@ static void USB_HostBandwidthHsHostComputeCurrentFsls(usb_host_ehci_instance_t *
usb_host_ehci_pipe_t
*
ehciPipePointer
;
uint8_t
index
;
#ifdef SOC_IMXRT1170_SERIES
uint32_t
deviceInfo
=
0
;
uint32_t
deviceInfo
=
0
;
#else
uint32_t
deviceInfo
;
#endif
...
...
@@ -1173,7 +1173,7 @@ static void USB_HostBandwidthHsHostComputeCurrentHsAll(usb_host_ehci_instance_t
usb_host_ehci_pipe_t
*
ehciPipePointer
;
uint16_t
index
;
#ifdef SOC_IMXRT1170_SERIES
uint32_t
deviceInfo
=
0U
;
uint32_t
deviceInfo
=
0U
;
#else
uint32_t
deviceInfo
;
#endif
...
...
@@ -3451,7 +3451,7 @@ static usb_status_t USB_HostEhciStartIP(usb_host_ehci_instance_t *ehciInstance)
}
#ifdef SOC_IMXRT1170_SERIES
/* no interrupt threshold */
ehciInstance
->
ehciIpBase
->
USBCMD
&=
~
USBHS_USBCMD_ITC_MASK
;
ehciInstance
->
ehciIpBase
->
USBCMD
&=
~
USBHS_USBCMD_ITC_MASK
;
#endif
/* start the controller */
ehciInstance
->
ehciIpBase
->
USBCMD
|=
USBHS_USBCMD_RS_MASK
;
...
...
@@ -3665,7 +3665,7 @@ void USB_HostEhciTransactionDone(usb_host_ehci_instance_t *ehciInstance)
usb_host_ehci_iso_t
*
isoPointer
;
uint32_t
dataLength
;
#ifdef SOC_IMXRT1170_SERIES
uint32_t
speed
=
0U
;
uint32_t
speed
=
0U
;
#else
uint32_t
speed
;
#endif
...
...
@@ -3794,7 +3794,7 @@ void USB_HostEhciTransactionDone(usb_host_ehci_instance_t *ehciInstance)
/* no action */
}
vltQtdPointer
=
(
volatile
usb_host_ehci_qtd_t
*
)
vltQtdPointer
->
nextQtdPointer
;
}
while
(
true
);
}
while
(
true
);
#else
while
((
vltQtdPointer
!=
NULL
)
&&
(
0U
==
(
transferResults
&
EHCI_HOST_QTD_IOC_MASK
)))
/* find the IOC qtd */
...
...
@@ -4025,7 +4025,7 @@ void USB_HostEhciPortChange(usb_host_ehci_instance_t *ehciInstance)
#ifdef SOC_IMXRT1170_SERIES
#if ((defined FSL_FEATURE_SOC_USBPHY_COUNT) && (FSL_FEATURE_SOC_USBPHY_COUNT > 0U))
USB_EhcihostPhyDisconnectDetectCmd
(
ehciInstance
->
controllerId
,
0
);
#endif
#endif
#else
USB_EhcihostPhyDisconnectDetectCmd
(
ehciInstance
->
controllerId
,
0
);
#endif
...
...
@@ -4192,28 +4192,28 @@ static void USB_HostEhciTimer1(usb_host_ehci_instance_t *ehciInstance)
#if (defined(FSL_FEATURE_USBPHY_28FDSOI) && (FSL_FEATURE_USBPHY_28FDSOI > 0U))
ehciInstance
->
registerPhyBase
->
USB1_VBUS_DETECT_SET
|=
USBPHY_USB1_VBUS_DETECT_VBUSVALID_TO_SESSVALID_MASK
;
#endif
#endif
#endif
ehciInstance
->
ehciIpBase
->
PORTSC1
|=
USBHS_PORTSC1_PHCD_MASK
;
#ifdef SOC_IMXRT1170_SERIES
#if ((defined FSL_FEATURE_SOC_USBPHY_COUNT) && (FSL_FEATURE_SOC_USBPHY_COUNT > 0U))
#if ((defined FSL_FEATURE_SOC_USBPHY_COUNT) && (FSL_FEATURE_SOC_USBPHY_COUNT > 0U))
ehciInstance
->
registerPhyBase
->
PWD
=
0xFFFFFFFFU
;
while
(
0U
!=
(
ehciInstance
->
registerPhyBase
->
CTRL
&
(
USBPHY_CTRL_UTMI_SUSPENDM_MASK
)))
{
__NOP
();
}
#endif
#endif
#else
ehciInstance
->
registerPhyBase
->
PWD
=
0xFFFFFFFFU
;
while
(
0U
!=
(
ehciInstance
->
registerPhyBase
->
CTRL
&
(
USBPHY_CTRL_UTMI_SUSPENDM_MASK
)))
{
__NOP
();
}
}
#endif
#if (defined(FSL_FEATURE_SOC_USBNC_COUNT) && (FSL_FEATURE_SOC_USBNC_COUNT > 0U))
ehciInstance
->
registerNcBase
->
USB_OTGn_CTRL
|=
USBNC_USB_OTGn_CTRL_WKUP_ID_EN_MASK
|
USBNC_USB_OTGn_CTRL_WKUP_VBUS_EN_MASK
|
...
...
@@ -4224,7 +4224,7 @@ static void USB_HostEhciTimer1(usb_host_ehci_instance_t *ehciInstance)
#if (defined(FSL_FEATURE_USB_ATLANTIC_EHCI_SUPPORT) && (FSL_FEATURE_USB_ATLANTIC_EHCI_SUPPORT > 0U))
#else
ehciInstance
->
ehciIpBase
->
USBGENCTRL
=
USBHS_USBGENCTRL_WU_IE_MASK
;
#endif
#endif
#else
ehciInstance
->
ehciIpBase
->
USBGENCTRL
=
USBHS_USBGENCTRL_WU_IE_MASK
;
#endif
...
...
@@ -4232,7 +4232,7 @@ static void USB_HostEhciTimer1(usb_host_ehci_instance_t *ehciInstance)
#ifdef
#if ((defined FSL_FEATURE_SOC_USBPHY_COUNT) && (FSL_FEATURE_SOC_USBPHY_COUNT > 0U))
ehciInstance
->
registerPhyBase
->
CTRL
|=
USBPHY_CTRL_CLKGATE_MASK
;
#endif
#endif
#else
ehciInstance
->
registerPhyBase
->
CTRL
|=
USBPHY_CTRL_CLKGATE_MASK
;
#endif
...
...
@@ -4309,11 +4309,11 @@ usb_status_t USB_HostEhciCreate(uint8_t controllerId,
#ifdef SOC_IMXRT1170_SERIES
#if ((defined FSL_FEATURE_SOC_USBPHY_COUNT) && (FSL_FEATURE_SOC_USBPHY_COUNT > 0U))
ehciInstance
->
registerPhyBase
=
(
USBPHY_Type
*
)
USB_EhciPhyGetBase
(
controllerId
);
#endif
#endif
#else
ehciInstance
->
registerPhyBase
=
(
USBPHY_Type
*
)
USB_EhciPhyGetBase
(
controllerId
);
#endif
#if (defined(FSL_FEATURE_SOC_USBNC_COUNT) && (FSL_FEATURE_SOC_USBNC_COUNT > 0U))
ehciInstance
->
registerNcBase
=
(
USBNC_Type
*
)
USB_EhciNCGetBase
(
controllerId
);
#endif
...
...
@@ -5084,7 +5084,7 @@ void USB_HostEhciIsrFunction(void *hostHandle)
ehciInstance
->
ehciIpBase
->
USBCMD
|=
(
USBHS_USBCMD_RS_MASK
);
ehciInstance
->
busSuspendStatus
=
kBus_EhciStartResume
;
}
#endif
#endif
#endif
(
void
)
OSA_EventSet
(
ehciInstance
->
taskEventHandle
,
EHCI_TASK_EVENT_PORT_CHANGE
);
}
...
...
bsp/imxrt/libraries/drivers/usb/host/usb_host_ehci.h
浏览文件 @
b9a9225c
...
...
@@ -312,7 +312,7 @@ typedef struct _usb_host_ehci_instance
#ifdef SOC_IMXRT1170_SERIES
#if ((defined FSL_FEATURE_SOC_USBPHY_COUNT) && (FSL_FEATURE_SOC_USBPHY_COUNT > 0U))
USBPHY_Type
*
registerPhyBase
;
/*!< The base address of the PHY register */
#endif
#endif
#else
USBPHY_Type
*
registerPhyBase
;
/*!< The base address of the PHY register */
#endif
...
...
bsp/imxrt/libraries/drivers/usb/host/usb_host_hci.c
浏览文件 @
b9a9225c
...
...
@@ -266,7 +266,7 @@ usb_status_t USB_HostInit(uint8_t controllerId, usb_host_handle *hostHandle, hos
{
return
kStatus_USB_Error
;
}
/* HOST instance init*/
hostInstance
->
controllerId
=
controllerId
;
...
...
@@ -291,7 +291,7 @@ usb_status_t USB_HostInit(uint8_t controllerId, usb_host_handle *hostHandle, hos
transferPrev
->
next
=
&
hostInstance
->
transferList
[
i
];
transferPrev
=
transferPrev
->
next
;
}
/* controller create, the callbackFn is initialized in USB_HostGetControllerInterface */
status
=
hostInstance
->
controllerTable
->
controllerCreate
(
controllerId
,
hostInstance
,
&
(
hostInstance
->
controllerHandle
));
...
...
@@ -700,7 +700,7 @@ usb_status_t USB_HostHelperParseAlternateSetting(usb_host_interface_handle inter
/* parse configuration descriptor */
#ifdef SOC_IMXRT1170_SERIES
temp
=
(
void
*
)((
usb_host_interface_t
*
)
interfaceHandle
)
->
interfaceExtension
;
temp
=
(
void
*
)((
usb_host_interface_t
*
)
interfaceHandle
)
->
interfaceExtension
;
#else
temp
=
(
void
*
)((
usb_host_interface_t
*
)
interfaceHandle
)
->
interfaceDesc
;
#endif
...
...
@@ -711,7 +711,7 @@ usb_status_t USB_HostHelperParseAlternateSetting(usb_host_interface_handle inter
#if !defined(SOC_IMXRT1170_SERIES)
unionDes
=
(
usb_descriptor_union_t
*
)((
uint32_t
)
unionDes
+
unionDes
->
common
.
bLength
);
#endif
/* search for the alternate setting interface descriptor */
while
((
uint32_t
)
unionDes
<
endPosition
)
{
...
...
bsp/imxrt/libraries/drivers/usb/include/usb.h
浏览文件 @
b9a9225c
...
...
@@ -61,7 +61,7 @@
#define USB_STACK_COMPONENT_VERSION \
MAKE_VERSION(USB_STACK_VERSION_MAJOR, USB_STACK_VERSION_MINOR, USB_STACK_VERSION_BUGFIX)
#endif
/*! @brief USB error code */
typedef
enum
_usb_status
{
...
...
@@ -90,7 +90,7 @@ typedef enum _usb_status
kStatus_USB_DataOverRun
,
/*!< The amount of data returned by the endpoint exceeded
either the size of the maximum data packet allowed
from the endpoint or the remaining buffer size. */
#endif
#endif
}
usb_status_t
;
/*! @brief USB host handle type define */
...
...
bsp/imxrt/libraries/drivers/usb/include/usb_host_config.h
浏览文件 @
b9a9225c
...
...
@@ -103,7 +103,7 @@
#define USB_HOST_CONFIG_BUFFER_PROPERTY_CACHEABLE (0U)
#endif
/*! @brief if 1, enable usb compliance test codes; if 0, disable usb compliance test codes. */
#ifdef SOC_IMXRT1170_SERIES
#ifdef SOC_IMXRT1170_SERIES
#ifndef USB_HOST_CONFIG_COMPLIANCE_TEST
#define USB_HOST_CONFIG_COMPLIANCE_TEST (0U)
#endif
...
...
@@ -165,7 +165,7 @@
/*!
* @brief ohci GTD max count.
*/
#define USB_HOST_CONFIG_OHCI_MAX_GTD (16U)
#define USB_HOST_CONFIG_OHCI_MAX_GTD (16U)
#else
/*!
* @brief ohci ED max count.
...
...
@@ -177,7 +177,7 @@
*/
#define USB_HOST_CONFIG_OHCI_MAX_GTD (8U)
#endif
/*!
* @brief ohci ITD max count.
*/
...
...
bsp/imxrt/libraries/drivers/usb/phy/usb_phy.c
浏览文件 @
b9a9225c
...
...
@@ -505,4 +505,4 @@ void USB_EhcihostPhyDisconnectDetectCmd(uint8_t controllerId, uint8_t enable)
}
#endif
}
#endif
\ No newline at end of file
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录