| | |
| | | <tvExpOptDlg>0</tvExpOptDlg> |
| | | <IsCurrentTarget>1</IsCurrentTarget> |
| | | </OPTFL> |
| | | <CpuCode>18</CpuCode> |
| | | <CpuCode>255</CpuCode> |
| | | <DebugOpt> |
| | | <uSim>0</uSim> |
| | | <uTrg>1</uTrg> |
| | |
| | | <TargetDriverDllRegistry> |
| | | <SetRegEntry> |
| | | <Number>0</Number> |
| | | <Key>UL2CM3</Key> |
| | | <Name>-UV0010M9E -O2254 -S0 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FN1 -FC1000 -FD20000000 -FF0STM32F10x_128 -FL020000 -FS08000000 -FP0($$Device:STM32F103T8$Flash\STM32F10x_128.FLM)</Name> |
| | | <Key>DLGUARM</Key> |
| | | <Name>æ¦?pè¹wæ¦?</Name> |
| | | </SetRegEntry> |
| | | <SetRegEntry> |
| | | <Number>0</Number> |
| | | <Key>JL2CM3</Key> |
| | | <Name>-U20090928 -O14 -S2 -ZTIFSpeedSel5000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0STM32F10x_128.FLM -FS08000000 -FL020000 -FP0($$Device:STM32F103T8$Flash\STM32F10x_128.FLM)</Name> |
| | | <Name>-U20090928 -O2254 -S1 -ZTIFSpeedSel10000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8008 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_128.FLM -FS08000000 -FL020000 -FP0($$Device:STM32F103T8$Flash\STM32F10x_128.FLM)</Name> |
| | | </SetRegEntry> |
| | | <SetRegEntry> |
| | | <Number>0</Number> |
| | | <Key>UL2CM3</Key> |
| | | <Name>-UV0010M9E -O2254 -S0 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FN1 -FC1000 -FD20000000 -FF0STM32F10x_128 -FL020000 -FS08000000 -FP0($$Device:STM32F103T8$Flash\STM32F10x_128.FLM)</Name> |
| | | </SetRegEntry> |
| | | <SetRegEntry> |
| | | <Number>0</Number> |
| | |
| | | <SetRegEntry> |
| | | <Number>0</Number> |
| | | <Key>DLGTARM</Key> |
| | | <Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)</Name> |
| | | <Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(100=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(1011=-1,-1,-1,-1,0)(180=-1,-1,-1,-1,0)(120=767,133,1188,538,0)(121=-1,-1,-1,-1,0)(123=-1,-1,-1,-1,0)(140=-1,-1,-1,-1,0)(240=-1,-1,-1,-1,0)(190=-1,-1,-1,-1,0)(200=-1,-1,-1,-1,0)(170=-1,-1,-1,-1,0)(130=-1,-1,-1,-1,0)(131=-1,-1,-1,-1,0)(132=-1,-1,-1,-1,0)(133=-1,-1,-1,-1,0)(160=-1,-1,-1,-1,0)(161=-1,-1,-1,-1,0)(210=-1,-1,-1,-1,0)(220=-1,-1,-1,-1,0)(230=-1,-1,-1,-1,0)(231=-1,-1,-1,-1,0)(232=-1,-1,-1,-1,0)(233=-1,-1,-1,-1,0)(150=-1,-1,-1,-1,0)(151=-1,-1,-1,-1,0)</Name> |
| | | </SetRegEntry> |
| | | <SetRegEntry> |
| | | <Number>0</Number> |
| | |
| | | <Ww> |
| | | <count>0</count> |
| | | <WinNumber>1</WinNumber> |
| | | <ItemText>distance</ItemText> |
| | | <ItemText>tempa</ItemText> |
| | | </Ww> |
| | | <Ww> |
| | | <count>1</count> |
| | | <WinNumber>1</WinNumber> |
| | | <ItemText>ID</ItemText> |
| | | </Ww> |
| | | <Ww> |
| | | <count>2</count> |
| | | <WinNumber>1</WinNumber> |
| | | <ItemText>send</ItemText> |
| | | </Ww> |
| | | <Ww> |
| | | <count>3</count> |
| | | <WinNumber>1</WinNumber> |
| | | <ItemText>frame_len</ItemText> |
| | | </Ww> |
| | | <Ww> |
| | | <count>4</count> |
| | | <WinNumber>1</WinNumber> |
| | | <ItemText>status_reg</ItemText> |
| | | </Ww> |
| | | <Ww> |
| | | <count>5</count> |
| | | <WinNumber>1</WinNumber> |
| | | <ItemText>status_reg</ItemText> |
| | | </Ww> |
| | | <Ww> |
| | | <count>6</count> |
| | | <WinNumber>1</WinNumber> |
| | | <ItemText>status_reg</ItemText> |
| | | </Ww> |
| | | <Ww> |
| | | <count>7</count> |
| | | <WinNumber>1</WinNumber> |
| | | <ItemText>status_reg</ItemText> |
| | | </Ww> |
| | | <Ww> |
| | | <count>8</count> |
| | | <WinNumber>1</WinNumber> |
| | | <ItemText>status_reg</ItemText> |
| | | </Ww> |
| | | <Ww> |
| | | <count>9</count> |
| | | <WinNumber>1</WinNumber> |
| | | <ItemText>status_reg</ItemText> |
| | | </Ww> |
| | | <Ww> |
| | | <count>10</count> |
| | | <WinNumber>1</WinNumber> |
| | | <ItemText>status_reg</ItemText> |
| | | </Ww> |
| | | <Ww> |
| | | <count>11</count> |
| | | <WinNumber>1</WinNumber> |
| | | <ItemText>status_reg</ItemText> |
| | | <ItemText>tempaaaa</ItemText> |
| | | </Ww> |
| | | </WatchWindow1> |
| | | <MemoryWindow1> |
| | | <Mm> |
| | | <WinNumber>1</WinNumber> |
| | | <SubType>0</SubType> |
| | | <ItemText>Uart2_Data</ItemText> |
| | | <ItemText>0x200004a8</ItemText> |
| | | <AccSizeX>0</AccSizeX> |
| | | </Mm> |
| | | </MemoryWindow1> |
| | |
| | | <GroupNumber>4</GroupNumber> |
| | | <FileNumber>31</FileNumber> |
| | | <FileType>1</FileType> |
| | | <tvExp>0</tvExp> |
| | | <tvExp>1</tvExp> |
| | | <tvExpOptDlg>0</tvExpOptDlg> |
| | | <bDave2>0</bDave2> |
| | | <PathWithFileName>..\Src\decadriver\deca_range_tables.c</PathWithFileName> |
| | |
| | | <RteFlg>0</RteFlg> |
| | | <bShared>0</bShared> |
| | | </File> |
| | | <File> |
| | | <GroupNumber>6</GroupNumber> |
| | | <FileNumber>37</FileNumber> |
| | | <FileType>1</FileType> |
| | | <tvExp>0</tvExp> |
| | | <tvExpOptDlg>0</tvExpOptDlg> |
| | | <bDave2>0</bDave2> |
| | | <PathWithFileName>..\Src\ExternalDevices\beep.c</PathWithFileName> |
| | | <FilenameWithoutPath>beep.c</FilenameWithoutPath> |
| | | <RteFlg>0</RteFlg> |
| | | <bShared>0</bShared> |
| | | </File> |
| | | </Group> |
| | | |
| | | </ProjectOpt> |
| | |
| | | <FileType>1</FileType> |
| | | <FilePath>..\Src\ExternalDevices\led.c</FilePath> |
| | | </File> |
| | | <File> |
| | | <FileName>beep.c</FileName> |
| | | <FileType>1</FileType> |
| | | <FilePath>..\Src\ExternalDevices\beep.c</FilePath> |
| | | </File> |
| | | </Files> |
| | | </Group> |
| | | </Groups> |
| | |
| | | <FileName>led.c</FileName> |
| | | <FileType>1</FileType> |
| | | <FilePath>..\Src\ExternalDevices\led.c</FilePath> |
| | | </File> |
| | | <File> |
| | | <FileName>beep.c</FileName> |
| | | <FileType>1</FileType> |
| | | <FilePath>..\Src\ExternalDevices\beep.c</FilePath> |
| | | </File> |
| | | </Files> |
| | | </Group> |
| | |
| | | <FileType>1</FileType> |
| | | <FilePath>..\Src\ExternalDevices\led.c</FilePath> |
| | | </File> |
| | | <File> |
| | | <FileName>beep.c</FileName> |
| | | <FileType>1</FileType> |
| | | <FilePath>..\Src\ExternalDevices\beep.c</FilePath> |
| | | </File> |
| | | </Files> |
| | | </Group> |
| | | </Groups> |
| | |
| | | <FileName>led.c</FileName> |
| | | <FileType>1</FileType> |
| | | <FilePath>..\Src\ExternalDevices\led.c</FilePath> |
| | | </File> |
| | | <File> |
| | | <FileName>beep.c</FileName> |
| | | <FileType>1</FileType> |
| | | <FilePath>..\Src\ExternalDevices\beep.c</FilePath> |
| | | </File> |
| | | </Files> |
| | | </Group> |
| | |
| | | <FileType>1</FileType> |
| | | <FilePath>..\Src\ExternalDevices\led.c</FilePath> |
| | | </File> |
| | | <File> |
| | | <FileName>beep.c</FileName> |
| | | <FileType>1</FileType> |
| | | <FilePath>..\Src\ExternalDevices\beep.c</FilePath> |
| | | </File> |
| | | </Files> |
| | | </Group> |
| | | </Groups> |
| | |
| | | <Capability>1</Capability> |
| | | <DriverSelection>4096</DriverSelection> |
| | | </Flash1> |
| | | <bUseTDR>0</bUseTDR> |
| | | <bUseTDR>1</bUseTDR> |
| | | <Flash2>BIN\UL2CM3.DLL</Flash2> |
| | | <Flash3>"" ()</Flash3> |
| | | <Flash4></Flash4> |
| | |
| | | <uSurpInc>0</uSurpInc> |
| | | <uC99>1</uC99> |
| | | <useXO>0</useXO> |
| | | <v6Lang>1</v6Lang> |
| | | <v6LangP>1</v6LangP> |
| | | <v6Lang>3</v6Lang> |
| | | <v6LangP>3</v6LangP> |
| | | <vShortEn>1</vShortEn> |
| | | <vShortWch>1</vShortWch> |
| | | <v6Lto>0</v6Lto> |
| | |
| | | <v6Rtti>0</v6Rtti> |
| | | <VariousControls> |
| | | <MiscControls></MiscControls> |
| | | <Define>USE_STDPERIPH_DRIVER, STM32F10X_MD</Define> |
| | | <Define>USE_STDPERIPH_DRIVER,__CC_ARM</Define> |
| | | <Undefine></Undefine> |
| | | <IncludePath>..\Src\Libraries\CMSIS\CM3\CoreSupport;..\Src\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x;..\Src\Libraries\STM32F10x_StdPeriph_Driver\inc;..\Src\decadriver;..\Src\platform;..\Src;..\Src\OnChipDevices;..\Src\ExternalDevices</IncludePath> |
| | | </VariousControls> |
| | |
| | | <FileType>1</FileType> |
| | | <FilePath>..\Src\ExternalDevices\led.c</FilePath> |
| | | </File> |
| | | <File> |
| | | <FileName>beep.c</FileName> |
| | | <FileType>1</FileType> |
| | | <FilePath>..\Src\ExternalDevices\beep.c</FilePath> |
| | | </File> |
| | | </Files> |
| | | </Group> |
| | | </Groups> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | #include "beep.h" |
| | | |
| | | void Beep_Init(void) |
| | | { |
| | | GPIO_InitTypeDef GPIO_InitStructure; |
| | | |
| | | /* Enable GPIO clock */ |
| | | RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE); |
| | | |
| | | // Enable GPIO used for beep |
| | | GPIO_InitStructure.GPIO_Pin = BEEP_PIN; |
| | | GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; |
| | | GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; |
| | | GPIO_Init(BEEP_GPIO, &GPIO_InitStructure); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | #ifndef __BEEP_H__ |
| | | #define __BEEP_H__ |
| | | |
| | | #include "stm32f10x.h" |
| | | |
| | | #define BEEP_PIN GPIO_Pin_0 |
| | | #define BEEP_GPIO GPIOA |
| | | #define BEEP_ON GPIO_WriteBit(BEEP_GPIO, BEEP_PIN, Bit_SET) |
| | | #define BEEP_OFF GPIO_WriteBit(BEEP_GPIO, BEEP_PIN, Bit_RESET) |
| | | |
| | | |
| | | void Beep_Init(void); |
| | | |
| | | #endif |
| | |
| | | /* Enable GPIO clock */ |
| | | RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE); |
| | | |
| | | // Enable GPIO used for DW1000 wakeup |
| | | // Enable GPIO used for LED flash |
| | | GPIO_InitStructure.GPIO_Pin = LED0_PIN; |
| | | GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; |
| | | GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; |
| | |
| | | #define LED0_GPIO GPIOA |
| | | #define LED_BLINK(...) GPIO_Toggle(__VA_ARGS__) |
| | | #define LED0_BLINK LED_BLINK(LED0_GPIO, LED0_PIN) |
| | | #define LED0_ON GPIO_WriteBit(LED0_GPIO, LED0_PIN, Bit_RESET) |
| | | #define LED0_OFF GPIO_WriteBit(LED0_GPIO, LED0_PIN, Bit_SET) |
| | | |
| | | |
| | | void Led_Init(void); |
| | |
| | | RCC_APB2PeriphClockCmd(RCC_APB2Periph_SPI1, ENABLE); |
| | | |
| | | /* SPI GPIO setup */ |
| | | // SPIx SCK and MOSI pin setup |
| | | GPIO_InitStructure.GPIO_Pin = SPIx_SCK | SPIx_MOSI; |
| | | // SPIx SCK, MISO and MOSI pin setup |
| | | GPIO_InitStructure.GPIO_Pin = SPIx_SCK | SPIx_MOSI | SPIx_MISO; |
| | | GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; |
| | | GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; |
| | | GPIO_Init(SPIx_GPIO, &GPIO_InitStructure); |
| | | |
| | | // SPIx MISO pin setup |
| | | GPIO_InitStructure.GPIO_Pin = SPIx_MISO; |
| | | GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU; |
| | | GPIO_Init(SPIx_GPIO, &GPIO_InitStructure); |
| | | |
| | | // SPIx CS pin setup |
| | |
| | | |
| | | // Set CS high |
| | | GPIO_SetBits(SPIx_CS_GPIO, SPIx_CS); |
| | | |
| | | |
| | | SPI_I2S_DeInit(SPIx); |
| | | |
| | |
| | | #include "Spi.h" |
| | | #include "dw_driver.h" |
| | | #include "led.h" |
| | | #include "beep.h" |
| | | |
| | | /* Example application name and version to display on LCD screen. */ |
| | | #define APP_NAME "DS TWR INIT v1.1" |
| | |
| | | uint32_t rec_dist, hex_dist; |
| | | uint16_t check; |
| | | |
| | | uint8_t tempaaaa[5] = {0}; |
| | | |
| | | void Device_Init(void) |
| | | { |
| | | Rcc_Init(); |
| | | Nvic_Init(); |
| | | Systick_Init(); |
| | | Led_Init(); |
| | | Beep_Init(); |
| | | DW_GPIO_Init(); |
| | | Usart_Init(); |
| | | Spi_Init(); |
| | | |
| | | GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable, ENABLE); |
| | | |
| | | while(1) |
| | | { |
| | | dwt_readsystime(tempaaaa); |
| | | delay_ms(500); |
| | | // dwt_readsystime(&tempb); |
| | | // delay_ms(500); |
| | | } |
| | | } |
| | | |
| | | int main(void) |
| | |
| | | #include "stm32f10x_it.h" |
| | | #include "stm32f10x.h" |
| | | /* Tick timer count. */ |
| | | volatile unsigned long time32_incr; |
| | | volatile uint32_t time32_incr; |
| | | void SysTick_Handler(void) |
| | | { |
| | | time32_incr++; |