社区导航

 

搜索
查看: 98|回复: 0

[资料分享] dsp2812的12864液晶显示源码

[复制链接]

1039

TA的帖子

0

TA的资源

一粒金砂(中级)

Rank: 2

发表于 7 天前 | 显示全部楼层 |阅读模式

源程序如下:

  1.  
  2. //###########################################################################
  3. //
  4. // FILE:    Example_2833xI2c_eeprom.c
  5. //
  6. // TITLE:   DSP2833x I2C EEPROM Example
  7. //
  8. // ASSUMPTIONS:
  9. //
  10. //    This program requires the DSP2833x header files.
  11. //
  12. //    This program requires an external I2C EEPROM connected to
  13. //    the I2C bus at address 0x50.
  14. //
  15. //    As supplied, this project is configured for "boot to SARAM"
  16. //    operation.  The 2833x Boot Mode table is shown below.
  17. //    For information on configuring the boot mode of an eZdsp,
  18. //    please refer to the documentation included with the eZdsp,
  19. //
  20. //       $Boot_Table:
  21. //
  22. //         GPIO87   GPIO86     GPIO85   GPIO84
  23. //          XA15     XA14       XA13     XA12
  24. //           PU       PU         PU       PU
  25. //        ==========================================
  26. //            1        1          1        1    Jump to Flash
  27. //            1        1          1        0    SCI-A boot
  28. //            1        1          0        1    SPI-A boot
  29. //            1        1          0        0    I2C-A boot
  30. //            1        0          1        1    eCAN-A boot
  31. //            1        0          1        0    McBSP-A boot
  32. //            1        0          0        1    Jump to XINTF x16
  33. //            1        0          0        0    Jump to XINTF x32
  34. //            0        1          1        1    Jump to OTP
  35. //            0        1          1        0    Parallel GPIO I/O boot
  36. //            0        1          0        1    Parallel XINTF boot
  37. //            0        1          0        0    Jump to SARAM            <- "boot to SARAM"
  38. //            0        0          1        1    Branch to check boot mode
  39. //            0        0          1        0    Boot to flash, bypass ADC cal
  40. //            0        0          0        1    Boot to SARAM, bypass ADC cal
  41. //            0        0          0        0    Boot to SCI-A, bypass ADC cal
  42. //                                              Boot_Table_End$
  43. //
  44. // DESCRIPTION:
  45. //
  46. //    This program will write 1-14 words to EEPROM and read them back.
  47. //    The data written and the EEPROM address written to are contained
  48. //    in the message structure, I2cMsgOut1. The data read back will be
  49. //    contained in the message structure I2cMsgIn1.
  50. //
  51. //    This program will work with the on-board I2C EEPROM supplied on
  52. //    the F2833x eZdsp.
  53. //
  54. //
  55. //###########################################################################
  56. // Original Author: D.F.
  57. //
  58. // $TI Release: 2833x/2823x Header Files and Peripheral Examples V133 $
  59. // $Release Date: June 8, 2012 $
  60. //###########################################################################
  61.  
  62.  
  63. #include "DSP281x_Device.h"
  64. #include "DSP281x_Examples.h"
  65.  
  66. // Note: I2C Macros used in this example can be found in the
  67. // DSP2833x_I2C_defines.h file
  68.  
  69. // Prototype statements for functions found within this file.
  70.  
  71. extern void Lcd_12864_Test(void);
  72. extern void Init_Port(void);
  73. void main(void)
  74. {
  75.  
  76.  
  77. // Step 1. Initialize System Control:
  78. // PLL, WatchDog, enable Peripheral Clocks
  79. // This example function is found in the DSP2833x_SysCtrl.c file.
  80.    InitSysCtrl();
  81.  
  82.  
  83. // Step 2. Initalize GPIO:
  84. // This example function is found in the DSP2833x_Gpio.c file and
  85. // illustrates how to set the GPIO to it's default state.
  86. // InitGpio();
  87. // Setup only the GP I/O only for I2C functionality
  88.  
  89. // Step 3. Clear all interrupts and initialize PIE vector table:
  90. // Disable CPU interrupts
  91.    DINT;
  92.  
  93. // Initialize PIE control registers to their default state.
  94. // The default state is all PIE interrupts disabled and flags
  95. // are cleared.
  96. // This function is found in the DSP2833x_PieCtrl.c file.
  97.    InitPieCtrl();
  98.  
  99. // Disable CPU interrupts and clear all CPU interrupt flags:
  100.    IER = 0x0000;
  101.    IFR = 0x0000;
  102.  
  103. // Initialize the PIE vector table with pointers to the shell Interrupt
  104. // Service Routines (ISR).
  105. // This will populate the entire table, even if the interrupt
  106. // is not used in this example.  This is useful for debug purposes.
  107. // The shell ISR routines are found in DSP2833x_DefaultIsr.c.
  108. // This function is found in DSP2833x_PieVect.c.
  109.    InitPieVectTable();
  110.  
  111. // Interrupts that are used in this example are re-mapped to
  112. // ISR functions found within this file.
  113.  
  114.    Init_Port();
  115. // Step 4. Initialize all the Device Peripherals:
  116. // This function is found in DSP2833x_InitPeripherals.c
  117. // InitPeripherals(); // Not required for this example
  118.  
  119. // Step 5. User specific code
  120.  
  121.  
  122.  
  123. // Enable interrupts required for this example
  124.  
  125.  
  126. // Enable CPU INT8 which is connected to PIE group 8
  127.  
  128.    EINT;   // Enable Global interrupt INTM
  129.  
  130.    for(;;)
  131.    {
  132.                 Lcd_12864_Test();
  133.    }   // end of for(;;)
  134. //#endif
  135. }   // end of main
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142. //===========================================================================
  143. // No more.
  144. //===========================================================================


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

关闭

站长推荐上一条 /1 下一条

  • 论坛活动 E手掌握

    扫码关注
    EEWORLD 官方微信

  • EE福利  唾手可得

    扫码关注
    EE福利 唾手可得

Archiver|手机版|小黑屋|电子工程世界 ( 京ICP证 060456 )

GMT+8, 2019-7-18 21:23 , Processed in 0.092995 second(s), 18 queries , Gzip On, MemCache On.

快速回复 返回顶部 返回列表