提交 f8fd0fd5 编写于 作者: wuyangyong's avatar wuyangyong

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@76 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 088b3a75
...@@ -138,6 +138,7 @@ void rt_hw_timer_handler(void) ...@@ -138,6 +138,7 @@ void rt_hw_timer_handler(void)
/** /**
* This function will initial STM32 Radio board. * This function will initial STM32 Radio board.
*/ */
extern void FSMC_SRAM_Init(void);
void rt_hw_board_init() void rt_hw_board_init()
{ {
NAND_IDTypeDef NAND_ID; NAND_IDTypeDef NAND_ID;
......
;******************** (C) COPYRIGHT 2007 STMicroelectronics ********************
;* File Name : cortexm3_macro.s
;* Author : MCD Application Team
;* Version : V1.1
;* Date : 11/26/2007
;* Description : Instruction wrappers for special Cortex-M3 instructions.
;*******************************************************************************
; THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
; WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
; AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
; INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
; CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
; INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
;*******************************************************************************
THUMB
REQUIRE8
PRESERVE8
AREA |.text|, CODE, READONLY, ALIGN=2
; Exported functions
EXPORT __WFI
EXPORT __WFE
EXPORT __SEV
EXPORT __ISB
EXPORT __DSB
EXPORT __DMB
EXPORT __SVC
EXPORT __MRS_CONTROL
EXPORT __MSR_CONTROL
EXPORT __MRS_PSP
EXPORT __MSR_PSP
EXPORT __MRS_MSP
EXPORT __MSR_MSP
EXPORT __SETPRIMASK
EXPORT __RESETPRIMASK
EXPORT __SETFAULTMASK
EXPORT __RESETFAULTMASK
EXPORT __BASEPRICONFIG
EXPORT __GetBASEPRI
EXPORT __REV_HalfWord
EXPORT __REV_Word
;*******************************************************************************
; Function Name : __WFI
; Description : Assembler function for the WFI instruction.
; Input : None
; Return : None
;*******************************************************************************
__WFI
WFI
BX r14
;*******************************************************************************
; Function Name : __WFE
; Description : Assembler function for the WFE instruction.
; Input : None
; Return : None
;*******************************************************************************
__WFE
WFE
BX r14
;*******************************************************************************
; Function Name : __SEV
; Description : Assembler function for the SEV instruction.
; Input : None
; Return : None
;*******************************************************************************
__SEV
SEV
BX r14
;*******************************************************************************
; Function Name : __ISB
; Description : Assembler function for the ISB instruction.
; Input : None
; Return : None
;*******************************************************************************
__ISB
ISB
BX r14
;*******************************************************************************
; Function Name : __DSB
; Description : Assembler function for the DSB instruction.
; Input : None
; Return : None
;*******************************************************************************
__DSB
DSB
BX r14
;*******************************************************************************
; Function Name : __DMB
; Description : Assembler function for the DMB instruction.
; Input : None
; Return : None
;*******************************************************************************
__DMB
DMB
BX r14
;*******************************************************************************
; Function Name : __SVC
; Description : Assembler function for the SVC instruction.
; Input : None
; Return : None
;*******************************************************************************
__SVC
SVC 0x01
BX r14
;*******************************************************************************
; Function Name : __MRS_CONTROL
; Description : Assembler function for the MRS instruction.
; Input : None
; Return : - r0 : Cortex-M3 CONTROL register value.
;*******************************************************************************
__MRS_CONTROL
MRS r0, CONTROL
BX r14
;*******************************************************************************
; Function Name : __MSR_CONTROL
; Description : Assembler function for the MSR instruction.
; Input : - r0 : Cortex-M3 CONTROL register new value.
; Return : None
;*******************************************************************************
__MSR_CONTROL
MSR CONTROL, r0
ISB
BX r14
;*******************************************************************************
; Function Name : __MRS_PSP
; Description : Assembler function for the MRS instruction.
; Input : None
; Return : - r0 : Process Stack value.
;*******************************************************************************
__MRS_PSP
MRS r0, PSP
BX r14
;*******************************************************************************
; Function Name : __MSR_PSP
; Description : Assembler function for the MSR instruction.
; Input : - r0 : Process Stack new value.
; Return : None
;*******************************************************************************
__MSR_PSP
MSR PSP, r0 ; set Process Stack value
BX r14
;*******************************************************************************
; Function Name : __MRS_MSP
; Description : Assembler function for the MRS instruction.
; Input : None
; Return : - r0 : Main Stack value.
;*******************************************************************************
__MRS_MSP
MRS r0, MSP
BX r14
;*******************************************************************************
; Function Name : __MSR_MSP
; Description : Assembler function for the MSR instruction.
; Input : - r0 : Main Stack new value.
; Return : None
;*******************************************************************************
__MSR_MSP
MSR MSP, r0 ; set Main Stack value
BX r14
;*******************************************************************************
; Function Name : __SETPRIMASK
; Description : Assembler function to set the PRIMASK.
; Input : None
; Return : None
;*******************************************************************************
__SETPRIMASK
CPSID i
BX r14
;*******************************************************************************
; Function Name : __RESETPRIMASK
; Description : Assembler function to reset the PRIMASK.
; Input : None
; Return : None
;*******************************************************************************
__RESETPRIMASK
CPSIE i
BX r14
;*******************************************************************************
; Function Name : __SETFAULTMASK
; Description : Assembler function to set the FAULTMASK.
; Input : None
; Return : None
;*******************************************************************************
__SETFAULTMASK
CPSID f
BX r14
;*******************************************************************************
; Function Name : __RESETFAULTMASK
; Description : Assembler function to reset the FAULTMASK.
; Input : None
; Return : None
;*******************************************************************************
__RESETFAULTMASK
CPSIE f
BX r14
;*******************************************************************************
; Function Name : __BASEPRICONFIG
; Description : Assembler function to set the Base Priority.
; Input : - r0 : Base Priority new value
; Return : None
;*******************************************************************************
__BASEPRICONFIG
MSR BASEPRI, r0
BX r14
;*******************************************************************************
; Function Name : __GetBASEPRI
; Description : Assembler function to get the Base Priority value.
; Input : None
; Return : - r0 : Base Priority value
;*******************************************************************************
__GetBASEPRI
MRS r0, BASEPRI_MAX
BX r14
;*******************************************************************************
; Function Name : __REV_HalfWord
; Description : Reverses the byte order in HalfWord(16-bit) input variable.
; Input : - r0 : specifies the input variable
; Return : - r0 : holds tve variable value after byte reversing.
;*******************************************************************************
__REV_HalfWord
REV16 r0, r0
BX r14
;*******************************************************************************
; Function Name : __REV_Word
; Description : Reverses the byte order in Word(32-bit) input variable.
; Input : - r0 : specifies the input variable
; Return : - r0 : holds tve variable value after byte reversing.
;*******************************************************************************
__REV_Word
REV r0, r0
BX r14
END
;******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE*****
...@@ -259,7 +259,8 @@ static rt_err_t rt_dm9000_init(rt_device_t dev) ...@@ -259,7 +259,8 @@ static rt_err_t rt_dm9000_init(rt_device_t dev)
/* see what we've got */ /* see what we've got */
lnk = phy_read(17) >> 12; lnk = phy_read(17) >> 12;
rt_kprintf("operating at "); rt_kprintf("operating at ");
switch (lnk) { switch (lnk)
{
case 1: case 1:
rt_kprintf("10M half duplex "); rt_kprintf("10M half duplex ");
break; break;
...@@ -313,11 +314,11 @@ static rt_size_t rt_dm9000_write (rt_device_t dev, rt_off_t pos, const void* buf ...@@ -313,11 +314,11 @@ static rt_size_t rt_dm9000_write (rt_device_t dev, rt_off_t pos, const void* buf
static rt_err_t rt_dm9000_control(rt_device_t dev, rt_uint8_t cmd, void *args) static rt_err_t rt_dm9000_control(rt_device_t dev, rt_uint8_t cmd, void *args)
{ {
switch(cmd) switch (cmd)
{ {
case NIOCTL_GADDR: case NIOCTL_GADDR:
/* get mac address */ /* get mac address */
if(args) rt_memcpy(args, dm9000_device.dev_addr, 6); if (args) rt_memcpy(args, dm9000_device.dev_addr, 6);
else return -RT_ERROR; else return -RT_ERROR;
break; break;
...@@ -351,7 +352,8 @@ rt_err_t rt_dm9000_tx( rt_device_t dev, struct pbuf* p) ...@@ -351,7 +352,8 @@ rt_err_t rt_dm9000_tx( rt_device_t dev, struct pbuf* p)
while (len > 0) while (len > 0)
{ {
DM9000_outw(DM9000_DATA_BASE, *ptr); DM9000_outw(DM9000_DATA_BASE, *ptr);
ptr ++; len -= 2; ptr ++;
len -= 2;
} }
} }
...@@ -417,7 +419,8 @@ struct pbuf *rt_dm9000_rx(rt_device_t dev) ...@@ -417,7 +419,8 @@ struct pbuf *rt_dm9000_rx(rt_device_t dev)
while (len > 0) while (len > 0)
{ {
*data = DM9000_inw(DM9000_DATA_BASE); *data = DM9000_inw(DM9000_DATA_BASE);
data ++; len -= 2; data ++;
len -= 2;
} }
} }
} }
...@@ -441,7 +444,8 @@ struct pbuf *rt_dm9000_rx(rt_device_t dev) ...@@ -441,7 +444,8 @@ struct pbuf *rt_dm9000_rx(rt_device_t dev)
{ {
rt_kprintf("rx fifo error\n"); rt_kprintf("rx fifo error\n");
} }
if (rx_status & 0x200) { if (rx_status & 0x200)
{
rt_kprintf("rx crc error\n"); rt_kprintf("rx crc error\n");
} }
if (rx_status & 0x8000) if (rx_status & 0x8000)
...@@ -489,7 +493,7 @@ static void NVIC_Configuration(void) ...@@ -489,7 +493,7 @@ static void NVIC_Configuration(void)
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1); NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
/* Enable the EXTI0 Interrupt */ /* Enable the EXTI0 Interrupt */
NVIC_InitStructure.NVIC_IRQChannel = EXTI15_10_IRQn; NVIC_InitStructure.NVIC_IRQChannel = EXTI9_5_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
......
此差异已折叠。
...@@ -16,7 +16,6 @@ Group (mp3) ...@@ -16,7 +16,6 @@ Group (mp3)
File 1,1,<.\application.c><application.c> File 1,1,<.\application.c><application.c>
File 1,1,<.\board.c><board.c> File 1,1,<.\board.c><board.c>
File 1,1,<.\startup.c><startup.c> File 1,1,<.\startup.c><startup.c>
File 1,2,<.\cortexm3_macro.s><cortexm3_macro.s>
File 1,1,<.\stm32f10x_it.c><stm32f10x_it.c> File 1,1,<.\stm32f10x_it.c><stm32f10x_it.c>
File 1,5,<.\stm32f10x_conf.h><stm32f10x_conf.h> File 1,5,<.\stm32f10x_conf.h><stm32f10x_conf.h>
File 1,5,<.\rtconfig.h><rtconfig.h> File 1,5,<.\rtconfig.h><rtconfig.h>
...@@ -213,7 +212,7 @@ Options 1,0,0 // Target 'RT-Thread STM32 Radio' ...@@ -213,7 +212,7 @@ Options 1,0,0 // Target 'RT-Thread STM32 Radio'
OCMADSXRAM { 0,0,0,0,0,0,0,0,0 } OCMADSXRAM { 0,0,0,0,0,0,0,0,0 }
OCR_RVCT { 1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,8,0,0,8,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,1,0,0,0,0,0,0,0,0,0,0 } OCR_RVCT { 1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,8,0,0,8,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,1,0,0,0,0,0,0,0,0,0,0 }
RV_STAVEC () RV_STAVEC ()
ADSCCFLG { 5,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } ADSCCFLG { 5,32,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
ADSCMISC () ADSCMISC ()
ADSCDEFN (USE_STDPERIPH_DRIVER, STM32F10X_HD,) ADSCDEFN (USE_STDPERIPH_DRIVER, STM32F10X_HD,)
ADSCUDEF () ADSCUDEF ()
......
...@@ -200,9 +200,9 @@ void wm8753_send(rt_uint16_t s_data) ...@@ -200,9 +200,9 @@ void wm8753_send(rt_uint16_t s_data)
u8 i; u8 i;
wm_sclk_0; wm_sclk_0;
for(i=0;i<16;i++) for (i=0;i<16;i++)
{ {
if(s_data & 0x8000) if (s_data & 0x8000)
{ {
wm_sdin_1; wm_sdin_1;
} }
...@@ -229,13 +229,13 @@ static rt_err_t wm8753_init (rt_device_t dev) ...@@ -229,13 +229,13 @@ static rt_err_t wm8753_init (rt_device_t dev)
wm8753_send(23<<9 | 1<<1 | 1 ); // 打开左右调音台电源 wm8753_send(23<<9 | 1<<1 | 1 ); // 打开左右调音台电源
/* 设置时钟及PLL  */ /* 设置时钟及PLL  */
#define MCLK1DIV2 0 #define MCLK1DIV2 0
#define pll1_N 11 #define pll1_N 11
#define pll1_K 0x1288CE #define pll1_K 0x1288CE
#if pll1_K > 0x3FFFFF #if pll1_K > 0x3FFFFF
#warning MAX bit(21:0) #warning MAX bit(21:0)
#endif #endif
wm8753_send(53<<9 | 1<<5 | MCLK1DIV2<<3 | 1<<2 | 1<<1 | 1 ); wm8753_send(53<<9 | 1<<5 | MCLK1DIV2<<3 | 1<<2 | 1<<1 | 1 );
wm8753_send(54<<9 | pll1_N<<5 | (pll1_K>>18) ); wm8753_send(54<<9 | pll1_N<<5 | (pll1_K>>18) );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册