芯片解密|单片机解密|IC解密|芯片破解|芯片复制| PCB抄板|软件开发

飞芯科技-芯片解密|单片机解密|IC解密|芯片破解|芯片复制| PCB抄板|软件开发

LPC1788 SPI主从机代码PCB抄板

单片机源程序如下:

  1. PCB抄板/**********************************************************************
  2. * $Id[        DISCUZ_CODE_1        ]nbsp;               mcu_main_new.c                        2012-05-04
  3. *//**
  4. * @file                mcu_main_new.c
  5. * @brief        User program.
  6. * @version        1.0
  7. * @date                04. May. 2012
  8. * @author        NXP MCU SW Application Team
  9. *
  10. * PCB抄板
  11. * All rights reserved.
  12. *
  13. ***********************************************************************
  14. * Software that is described herein is for illustrative purposes only
  15. * which provides customers with programming information regarding the
  16. * products. This software is supplied "AS IS" without any warranties.
  17. * NXP Semiconductors assumes no responsibility or liability for the
  18. * use of the software, conveys no license or title under any patent,
  19. * copyright, or mask work right to the product. NXP Semiconductors
  20. * reserves the right to make changes in the software without
  21. * notification. NXP Semiconductors also make no representation or
  22. * warranty that such application will be suitable for the specified
  23. * use without further testing or modification.
  24. * Permission to use, copy, modify, and distribute this software and its
  25. * documentation is hereby granted, under NXP Semiconductors'
  26. * relevant copyright in the software, without fee, provided that it
  27. * is used in conjunction with NXP Semiconductors microcontrollers.  This
  28. * copyright, permission, and disclaimer notice must appear in all copies of
  29. * this code.
  30. **********************************************************************/

  31. #include "includes.h"

  32. #define VTOR_OFFSET         (0x00001000)

  33. SBL_FirmVerion_Type firm_vers __attribute__((section("firmware_id_section")))= {0,1,'b'};

  34. /************************** PRIVATE DEFINITIONS *************************/
  35. #ifdef __MCU_LPC17xx
  36. #define MCB_1700
  37. //#define IAR_LPC_1768
  38. #elif defined (__MCU_LPC11xx)
  39. #define MCB_1100
  40. #endif

  41. #if defined (MCB_1700)
  42. /* Number of user LEDs */
  43. #define LED_NUM     4
  44. const unsigned long led_mask[] = { 1<<3, 1<<4, 1<<5, 1<<6 };
  45. #elif defined(MCB_1100)
  46. #define LED_NUM     4
  47. const unsigned long led_pin[] = { 3, 4, 5, 6 };
  48. #endif

  49. /************************** PRIVATE VARIABLES *************************/
  50. /* SysTick Counter */
  51. volatile unsigned long SysTickCnt;

  52. /************************** PRIVATE FUNCTIONS *************************/
  53. void SysTick_Handler (void);
  54. void ReAllocateNVIC(void);

  55. /*----------------- INTERRUPT SERVICE ROUTINES --------------------------*/
  56. /*********************************************************************//**
  57. * @brief            SysTick handler sub-routine (1ms)
  58. * @param[in]        None
  59. * @return           None
  60. **********************************************************************/
  61. void SysTick_Handler (void) {
  62.   SysTickCnt++;
  63. }

  64. /*-------------------------PRIVATE FUNCTIONS------------------------------*/
  65. /*********************************************************************//**
  66. * @brief            Re-allocate vector interrupt table
  67. * @param[in]        None
  68. * @return           int
  69. **********************************************************************/
  70. void ReAllocateNVIC(void)
  71. {
  72. #ifdef __MCU_LPC17xx
  73.     __disable_irq();
  74.     NVIC_SetVTOR(VTOR_OFFSET);
  75.     __enable_irq();
  76. #elif defined (__MCU_LPC11xx)
  77.     uint32_t* src,*dst;
  78.     int32_t size;

  79.     __disable_irq();
  80.     // copy vector table
  81.     src = (uint32_t*)VTOR_OFFSET;
  82.     dst = (uint32_t*)0x10000000;
  83.     size = 192;

  84.     while(size > 0)
  85.     {
  86.         *dst++ = *src++;
  87.         size -= 4;
  88.     }
  89.      LPC_SYSCON->SYSMEMREMAP = 0x1;    /* remap to internal RAM */
  90.     __enable_irq();
  91. #endif
  92. }



联系方式

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

在线客服
热线电话

企业微信