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

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

芯片破解TM1650驱动数码管的STM程序

  1. 芯片破解#include "stm32f10x.h"
  2. 芯片破解#include "sys_conf.h"
  3. 芯片破解#include <stdio.h>

  4. void DelayXms(unsigned int count)
  5. {
  6.         unsigned int i,j;
  7.          for(i=0; i<count; i++)
  8.          {
  9.                  //WatchDOG();
  10.                   for(j=0; j<7968; j++)
  11.                  {
  12.                          __NOP();
  13.       
  14.                  }
  15.                   
  16.          }         
  17. }


  18. void DelayXus(unsigned int count)
  19. {
  20.         unsigned int i,j;
  21.          for(i=0; i<count; i++)
  22.          {
  23.                   for(j=0; j<8; j++)
  24.                  {
  25.                          __NOP();
  26.                      
  27.                  }
  28.                   
  29.          }         
  30. }
  31. void IIC_Init(void)
  32. {
  33.         GPIO_InitTypeDef GPIO_InitStructure;

  34.         RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB,ENABLE);


  35.         GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10|GPIO_Pin_11;
  36.         GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
  37.         GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  38.         GPIO_Init(GPIOB, &GPIO_InitStructure);   
  39.   
  40.        
  41. }

  42. void SDA_IN(void)
  43. {
  44.         GPIO_InitTypeDef GPIO_InitStructure;       
  45.         RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);       
  46.         GPIO_InitStructure.GPIO_Pin = IIC_SDA_PIN;
  47.         GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;
  48.         GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  49.         GPIO_Init(IIC_SDA_PORT,&GPIO_InitStructure);
  50. }

  51. void SDA_OUT(void)
  52. {
  53.         GPIO_InitTypeDef GPIO_InitStructure;       
  54.         RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);       
  55.         GPIO_InitStructure.GPIO_Pin = IIC_SDA_PIN;
  56.         GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
  57.         GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  58.         GPIO_Init(IIC_SDA_PORT,&GPIO_InitStructure);
  59. }



  60. /***************************************************************************
  61.     - 功能描述:STM32f103 模拟IIC起始信号函数
  62.     - 隶属模块:STM32 IIC操作
  63.         - 函数属性:外部,使用户使用
  64.         - 参数说明:无
  65.         - 返回说明:无
  66.     - 函数实现步骤:
  67.                 (1)首先将SDA配置为输出
  68.                 (2)在SCL为高电平期间,SDA有下降沿的变化
  69. ***************************************************************************/
  70. void IIC_Start(void)
  71. {
  72.         SDA_OUT();     //sda线输出
  73.         Set_IIC_SDA;                    
  74.         Set_IIC_SCL;
  75.         DelayXus(4);
  76.         Clr_IIC_SDA;//START:when CLK is high,DATA change form high to low
  77.         DelayXus(4);
  78.         Clr_IIC_SCL;//钳住I2C总线,准备发送或接收数据
  79. }          
  80. /***************************************************************************
  81.     - 功能描述:STM32f103 模拟IIC终止信号函数
  82.     - 隶属模块:STM32 IIC操作
  83.         - 函数属性:外部,使用户使用
  84.         - 参数说明:无
  85.         - 返回说明:无
  86.     - 函数实现步骤:
  87.                 (1)首先将SDA配置为输出
  88.                 (2)在SCL为高电平期间,SDA有上升沿的变化
  89. ***************************************************************************/
  90. void IIC_Stop(void)
  91. {
  92.         SDA_OUT();//sda线输出
  93.         Clr_IIC_SCL;
  94.         Clr_IIC_SDA;//STOP:when CLK is high DATA change form low to high
  95.         DelayXus(4);
  96.         Set_IIC_SCL;
  97.         Set_IIC_SDA;//发送I2C总线结束信号
  98.         DelayXus(4);                                                                  
  99. }



联系方式

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

在线客服
热线电话

企业微信