Example_Flash2803x_API.h 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. //###########################################################################
  2. //
  3. // FILE: Example_Flash2803x_API.h
  4. //
  5. // TITLE: F2803x Flash API example include file
  6. //
  7. // DESCRIPTION:
  8. //
  9. // Function prototypes and macros for the F2803x Flash API library examples.
  10. //
  11. //###########################################################################
  12. // $TI Release: F2803x C/C++ Header Files and Peripheral Examples V130 $
  13. // $Release Date: May 8, 2015 $
  14. // $Copyright: Copyright (C) 2009-2015 Texas Instruments Incorporated -
  15. // http://www.ti.com/ ALL RIGHTS RESERVED $
  16. //###########################################################################
  17. #ifndef EXAMPLE_FLASH2803x_API_H
  18. #define EXAMPLE_FLASH2803x_API_H
  19. /*---- flash program files -------------------------------------------------*/
  20. #include "Flash2803x_API_Library.h"
  21. /*---- device support includes ---------------------------------------------*/
  22. #include "DSP28x_Project.h"
  23. /*---------------------------------------------------------------------------
  24. Functions used by this example
  25. *---------------------------------------------------------------------------*/
  26. void Example_ToggleTest(Uint16 Pin); // Run the ToggleTest
  27. Uint16 Example_CsmUnlock(void); // Unlock the Code Security Module
  28. void Example_CallFlashAPI(void); // Kernel function that interfaces to the API
  29. void Example_Error(Uint16 Status); // If an error, stop here
  30. void Example_Done(void); // If done, stop here
  31. void Example_MemCopy(Uint16 *SourceAddr, Uint16* SourceEndAddr, Uint16* DestAddr);
  32. void CsmPwlDummyRead(void);
  33. /*---------------------------------------------------------------------------
  34. Symbols used to copy support functions from Flash to RAM
  35. These symbols are assigned by the linker. Refer to the .cmd file
  36. ---------------------------------------------------------------------------*/
  37. extern Uint16 RamfuncsLoadStart;
  38. extern Uint16 RamfuncsLoadEnd;
  39. extern Uint16 RamfuncsRunStart;
  40. /*-----------------------------------------------------------------------------
  41. Specify the PLLCR (PLL Control Register) value.
  42. Uncomment the appropriate line by removing the leading double slash: //
  43. Only one statement should be uncommented.
  44. The user's application must set the PLLCR Register before calling any
  45. of the Flash API functions.
  46. Example: CLKIN is a 10MHz crystal.
  47. The user wants to have a 60Mhz CPU clock (SYSCLKOUT = 60MHz).
  48. In this case, PLLCR must be set to 12 (0x000C)
  49. Uncomment the line: #define PLLCR_VALUE 0x000C
  50. Comment out the remaining lines with a double slash: //
  51. -----------------------------------------------------------------------------*/
  52. #define PLLCR_VALUE 0x000C // SYSCLKOUT = (OSCLK*12)/2
  53. // #define PLLCR_VALUE 0x000B // SYSCLKOUT = (OSCLK*11)/2
  54. // #define PLLCR_VALUE 0x000A // SYSCLKOUT = (OSCLK*10)/2
  55. // #define PLLCR_VALUE 0x0009 // SYSCLKOUT = (OSCLK*9)/2
  56. // #define PLLCR_VALUE 0x0008 // SYSCLKOUT = (OSCLK*8)/2
  57. // #define PLLCR_VALUE 0x0007 // SYSCLKOUT = (OSCLK*7)/2
  58. // #define PLLCR_VALUE 0x0006 // SYSCLKOUT = (OSCLK*6)/2
  59. // #define PLLCR_VALUE 0x0005 // SYSCLKOUT = (OSCLK*5)/2
  60. // #define PLLCR_VALUE 0x0004 // SYSCLKOUT = (OSCLK*4)/2
  61. // #define PLLCR_VALUE 0x0003 // SYSCLKOUT = (OSCLK*3)/2
  62. // #define PLLCR_VALUE 0x0002 // SYSCLKOUT = (OSCLK*2)/2
  63. // #define PLLCR_VALUE 0x0001 // SYSCLKOUT = (OSCLK*1)/2
  64. // #define PLLCR_VALUE 0x0000 // SYSCLKOUT = (OSCLK)/2 (PLL Bypassed)
  65. /*---------------------------------------------------------------------------
  66. These key values are used to unlock the CSM by this example
  67. They are defined in Example_Flash2803x_CsmKeys.asm
  68. --------------------------------------------------------------------------*/
  69. extern Uint16 PRG_key0; // CSM Key values
  70. extern Uint16 PRG_key1;
  71. extern Uint16 PRG_key2;
  72. extern Uint16 PRG_key3;
  73. extern Uint16 PRG_key4;
  74. extern Uint16 PRG_key5;
  75. extern Uint16 PRG_key6;
  76. extern Uint16 PRG_key7;
  77. #endif // ---- End of EXAMPLE_FLASH2803x_API_H