芯片解密,芯片破解,IC解密,单片机解密,MCU解密,STM解密

飞芯科技提供芯片解密,芯片破解,IC解密,单片机解密,MCU解密,STM解密逆向服务

IC解密STM32F4+W5500以太网通讯

  1. IC解密#include <string.h>
  2. IC解密#include <stdio.h>
  3. IC解密#include "stm32f10x.h"

  4. #include "W5500.h"
  5. #include "device.h"
  6. #include "systick.h"
  7. #include "led.h"
  8. #include "mb.h"


  9. /* ----------------------- Holding register Defines ------------------------------------------*/

  10. #define REG_HOLDING_START 1000
  11. #define REG_HOLDING_NREGS 4

  12. /* ----------------------- Static variables ---------------------------------*/
  13. static unsigned short usRegHoldingStart = REG_HOLDING_START;
  14. static unsigned short usRegHoldingBuf[REG_HOLDING_NREGS]={0xaa,0x55,0x5599,0x5588};

  15. /* ----------------------- input register Defines ------------------------------------------*/
  16. #define REG_INPUT_START 1000
  17. #define REG_INPUT_NREGS 4

  18. /* ----------------------- Static variables ---------------------------------*/
  19. static unsigned short usRegInputStart = REG_INPUT_START;
  20. static unsigned short usRegInputBuf[REG_INPUT_NREGS]={0,0,0x5599,0x5588};

  21. /* ----------------------- coils register Defines ------------------------------------------*/
  22. #define REG_COILS_START     1000
  23. #define REG_COILS_SIZE      16

  24. /* ----------------------- Static variables ---------------------------------*/
  25. static unsigned char ucRegCoilsBuf[REG_COILS_SIZE / 8]={0xaa,0xfe};          //数量低于8个还需要验证一下,是否需要加1呢。

  26. /* ----------------------- discrete register Defines ------------------------------------------*/
  27. #define REG_DISC_START     1000
  28. #define REG_DISC_SIZE      16

  29. /* ----------------------- Static variables ---------------------------------*/
  30. static unsigned char ucRegDiscBuf[REG_DISC_SIZE / 8] = { 0x98, 0x6e };           //数量8的整数倍。


  31. void BSP_LED(void);          //LED指示线圈操作

  32. /* W5500 configuration */
  33. void W5500_Configuration()
  34. {
  35.         unsigned char array[6];

  36.         GPIO_SetBits(GPIO_W5500_RST_PORT, GPIO_W5500_RST_Pin);
  37.         Delay_ms(100);    /*delay 100ms 使用systick 1ms时基的延时*/
  38.         while((Read_1_Byte(PHYCFGR)&LINK)==0);                 /* Waiting for Ethernet Link */

  39.         Write_1_Byte(MR, RST);
  40.         Delay_ms(20);                /*delay 20ms */

  41.         /* Set Gateway IP as: 192.168.1.1 */
  42.         array[0]=192;
  43.         array[1]=168;
  44.         array[2]=1;
  45.         array[3]=1;
  46.         Write_Bytes(GAR, array, 4);

  47.         /* Set Subnet Mask as: 255.255.255.0 */
  48.         array[0]=255;
  49.         array[1]=255;
  50.         array[2]=255;
  51.         array[3]=0;
  52.         Write_Bytes(SUBR, array, 4);

  53.         /* Set MAC Address as: 0x48,0x53,0x00,0x57,0x55,0x00 */
  54.         array[0]=0x48;
  55.         array[1]=0x53;
  56.         array[2]=0x00;
  57.         array[3]=0x57;
  58.         array[4]=0x55;
  59.         array[5]=0x00;
  60.         Write_Bytes(SHAR, array, 6);

  61.         /* Set W5500 IP as: 192.168.1.128 */
  62.         array[0]=192;
  63.         array[1]=168;
  64.         array[2]=1;
  65.         array[3]=128;
  66.         Write_Bytes(SIPR, array, 4);
  67. }



联系方式

地址:石家庄市新华区民族路77号华强广场D座2009
电话:0311-88816616/87087811
手机:13315190088
传真:0311-67901001
联系人:张工
网址:www.taihedz.cn
邮箱:feixindz@163.com
微信:xinpianjiemi
QQ:527263666/568069805

在线客服
热线电话

企业微信