CY7C68013A USB Board教程IC解密
IC解密单片机源程序如下:
- /*! ----------------------------------------------------------------------------
- * @file main.c
- * @brief main loop for the DecaRanging application
- *
- * @attention
- *
- * Copyright 2013 (c) DecaWave Ltd, Dublin, Ireland.
- *
- * All rights reserved.
- *
- * @author DecaWave
- */
- /* Includes */
- #include "compiler.h"
- #include "port.h"
- #include "instance.h"
- #include "deca_types.h"
- #include "deca_spi.h"
- #include "stdio.h"
- extern void usb_run(void);
- extern int usb_init(void);
- extern void usb_printconfig(int, uint8*, int);
- extern void send_usbmessage(uint8*, int);
- #define DWINTERRUPT_EN (1) //set to 1 when using DW interrupt, set to 0 to poll DW1000 IRQ line
- #define SOFTWARE_VER_STRING "Version 3.05 " //
- #define SWS1_SRM_MODE 0x80 //slow ranging mode with PC - response is configurable and > 150 ms
- #define SWS1_ANC_MODE 0x08 //anchor mode
- #define SWS1_SHF_MODE 0x10 //short frame mode (6.81M) (switch S1-5)
- #define SWS1_64M_MODE 0x20 // 64M PRF mode (switch S1-6)
- #define SWS1_CH5_MODE 0x40 //channel 5 mode (switch S1-7)
- int instance_anchaddr = 0; //0 = 0xDECA020000000001; 1 = 0xDECA020000000002; 2 = 0xDECA020000000003
- //NOTE: switches TA_SW1_7 and TA_SW1_8 are used to set tag/anchor address
- int dr_mode = 0;
- //if instance_mode = TAG_TDOA then the device cannot be selected as anchor
- int instance_mode = ANCHOR;
- //int instance_mode = TAG;
- //int instance_mode = TAG_TDOA;
- //int instance_mode = LISTENER;
- uint8 s1switch = 0;
- int chan, tagaddr, ancaddr;
- #define LCD_BUFF_LEN (100)
- uint8 dataseq[LCD_BUFF_LEN];
- uint8 dataseq1[LCD_BUFF_LEN];
- int ranging = 0;
- typedef struct
- {
- uint8 channel ;
- uint8 prf ;
- uint8 datarate ;
- uint8 preambleCode ;
- uint8 preambleLength ;
- uint8 pacSize ;
- uint8 nsSFD ;
- uint16 sfdTO ;
- } chConfig_t ;
- //Configuration for DecaRanging Modes (8 default use cases selectable by the switch S1 on EVK)
- chConfig_t chConfig[8] ={
- //mode 1 - S1: 7 off, 6 off, 5 off
- {
- 2, // channel
- DWT_PRF_16M, // prf
- DWT_BR_110K, // datarate
- 3, // preambleCode
- DWT_PLEN_1024, // preambleLength
- DWT_PAC32, // pacSize
- 1, // non-standard SFD
- (1025 + 64 - 32) //SFD timeout
- },
- //mode 2
- {
- 2, // channel
- DWT_PRF_16M, // prf
- DWT_BR_6M8, // datarate
- 3, // preambleCode
- DWT_PLEN_128, // preambleLength
- DWT_PAC8, // pacSize
- 0, // non-standard SFD
- (129 + 8 - 8) //SFD timeout
- },
- //mode 3
- {
- 2, // channel
- DWT_PRF_64M, // prf
- DWT_BR_110K, // datarate
- 9, // preambleCode
- DWT_PLEN_1024, // preambleLength
- DWT_PAC32, // pacSize
- 1, // non-standard SFD
- (1025 + 64 - 32) //SFD timeout
- },
- //mode 4
- {
- 2, // channel
- DWT_PRF_64M, // prf
- DWT_BR_6M8, // datarate
- 9, // preambleCode
- DWT_PLEN_128, // preambleLength
- DWT_PAC8, // pacSize
- 0, // non-standard SFD
- (129 + 8 - 8) //SFD tim

芯片解密