查看: 1523|回复: 0

dsp2812的12864液晶显示源码

[复制链接]

该用户从未签到

发表于 2020-11-29 16:29:18 | 显示全部楼层 |阅读模式
分享到:
源程序如下:
  1. //###########################################################################
  2. //
  3. // FILE:    Example_2833xI2c_eeprom.c
  4. //
  5. // TITLE:   DSP2833x I2C EEPROM Example
  6. //
  7. // ASSUMPTIONS:
  8. //
  9. //    This program requires the DSP2833x header files.
  10. //
  11. //    This program requires an external I2C EEPROM connected to
  12. //    the I2C bus at address 0x50.
  13. //
  14. //    As supplied, this project is configured for "boot to SARAM"
  15. //    operation.  The 2833x Boot Mode table is shown below.
  16. //    For information on configuring the boot mode of an eZdsp,
  17. //    please refer to the documentation included with the eZdsp,
  18. //
  19. //       $Boot_Table:
  20. //
  21. //         GPIO87   GPIO86     GPIO85   GPIO84
  22. //          XA15     XA14       XA13     XA12
  23. //           PU       PU         PU       PU
  24. //        ==========================================
  25. //            1        1          1        1    Jump to Flash
  26. //            1        1          1        0    SCI-A boot
  27. //            1        1          0        1    SPI-A boot
  28. //            1        1          0        0    I2C-A boot
  29. //            1        0          1        1    eCAN-A boot
  30. //            1        0          1        0    McBSP-A boot
  31. //            1        0          0        1    Jump to XINTF x16
  32. //            1        0          0        0    Jump to XINTF x32
  33. //            0        1          1        1    Jump to OTP
  34. //            0        1          1        0    Parallel GPIO I/O boot
  35. //            0        1          0        1    Parallel XINTF boot
  36. //            0        1          0        0    Jump to SARAM            <- "boot to SARAM"
  37. //            0        0          1        1    Branch to check boot mode
  38. //            0        0          1        0    Boot to flash, bypass ADC cal
  39. //            0        0          0        1    Boot to SARAM, bypass ADC cal
  40. //            0        0          0        0    Boot to SCI-A, bypass ADC cal
  41. //                                              Boot_Table_End$
  42. //
  43. // DESCRIPTION:
  44. //
  45. //    This program will write 1-14 words to EEPROM and read them back.
  46. //    The data written and the EEPROM address written to are contained
  47. //    in the message structure, I2cMsgOut1. The data read back will be
  48. //    contained in the message structure I2cMsgIn1.
  49. //
  50. //    This program will work with the on-board I2C EEPROM supplied on
  51. //    the F2833x eZdsp.
  52. //
  53. //
  54. //###########################################################################
  55. // Original Author: D.F.
  56. //
  57. // $TI Release: 2833x/2823x Header Files and Peripheral Examples V133 $
  58. // $Release Date: June 8, 2012 $
  59. //###########################################################################


  60. #include "DSP281x_Device.h"
  61. #include "DSP281x_Examples.h"

  62. // Note: I2C Macros used in this example can be found in the
  63. // DSP2833x_I2C_defines.h file

  64. // Prototype statements for functions found within this file.

  65. extern void Lcd_12864_Test(void);
  66. extern void Init_Port(void);
  67. void main(void)
  68. {


  69. // Step 1. Initialize System Control:
  70. // PLL, WatchDog, enable Peripheral Clocks
  71. // This example function is found in the DSP2833x_SysCtrl.c file.
  72.    InitSysCtrl();


  73. // Step 2. Initalize GPIO:
  74. // This example function is found in the DSP2833x_Gpio.c file and
  75. // illustrates how to set the GPIO to it's default state.
  76. // InitGpio();
  77. // Setup only the GP I/O only for I2C functionality

  78. // Step 3. Clear all interrupts and initialize PIE vector table:
  79. // Disable CPU interrupts
  80.    DINT;

  81. // Initialize PIE control registers to their default state.
  82. // The default state is all PIE interrupts disabled and flags
  83. // are cleared.
  84. // This function is found in the DSP2833x_PieCtrl.c file.
  85.    InitPieCtrl();

  86. // Disable CPU interrupts and clear all CPU interrupt flags:
  87.    IER = 0x0000;
  88.    IFR = 0x0000;

  89. // Initialize the PIE vector table with pointers to the shell Interrupt
  90. // Service Routines (ISR).
  91. // This will populate the entire table, even if the interrupt
  92. // is not used in this example.  This is useful for debug purposes.
  93. // The shell ISR routines are found in DSP2833x_DefaultIsr.c.
  94. // This function is found in DSP2833x_PieVect.c.
  95.    InitPieVectTable();

  96. // Interrupts that are used in this example are re-mapped to
  97. // ISR functions found within this file.

  98.    Init_Port();
  99. // Step 4. Initialize all the Device Peripherals:
  100. // This function is found in DSP2833x_InitPeripherals.c
  101. // InitPeripherals(); // Not required for this example

  102. // Step 5. User specific code



  103. // Enable interrupts required for this example


  104. // Enable CPU INT8 which is connected to PIE group 8

  105.    EINT;   // Enable Global interrupt INTM

  106.    for(;;)
  107.    {
  108.                 Lcd_12864_Test();
  109.    }   // end of for(;;)
  110. //#endif
  111. }   // end of main






  112. //===========================================================================
  113. // No more.
  114. //===========================================================================
复制代码


回复

使用道具 举报

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

本版积分规则

关闭

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



手机版|小黑屋|与非网

GMT+8, 2024-11-22 15:08 , Processed in 0.101502 second(s), 15 queries , MemCache On.

ICP经营许可证 苏B2-20140176  苏ICP备14012660号-2   苏州灵动帧格网络科技有限公司 版权所有.

苏公网安备 32059002001037号

Powered by Discuz! X3.4

Copyright © 2001-2024, Tencent Cloud.