disk.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /******************************************************************************
  2. *
  3. * Freescale Semiconductor Inc.
  4. * (c) Copyright 2004-2009 Freescale Semiconductor, Inc.
  5. * ALL RIGHTS RESERVED.
  6. *
  7. **************************************************************************//*!
  8. *
  9. * @file disk.h
  10. *
  11. * @author
  12. *
  13. * @version
  14. *
  15. * @date May-08-2009
  16. *
  17. * @brief The file contains Macro's and functions needed by the disk
  18. * application
  19. *
  20. *****************************************************************************/
  21. #ifndef _DISK_H
  22. #define _DISK_H 1
  23. #include "user_config.h"
  24. #include "usb_msc.h"
  25. /******************************************************************************
  26. * Constants - None
  27. *****************************************************************************/
  28. /******************************************************************************
  29. * Macro's
  30. *****************************************************************************/
  31. #define USB_CONTROLLER_ID (0)
  32. #define LENGTH_OF_EACH_LAB (512)
  33. /* length of each logical address block */
  34. #define TOTAL_LOGICAL_ADDRESS_BLOCKS (0x080000)
  35. /* total number of logical blocks present */
  36. #define DISK_SIZE (LENGTH_OF_EACH_LAB * TOTAL_LOGICAL_ADDRESS_BLOCKS)
  37. #define LOGICAL_UNIT_SUPPORTED (1)
  38. /* Bootloader Status */
  39. #define BootloaderReady 0
  40. #define BootloaderS19Error 1
  41. #define BootloaderFlashError 2
  42. #define BootloaderSuccess 3
  43. #define BootloaderStarted 4
  44. #define FLASH_IMAGE_SUCCESS 0
  45. #define FLASH_IMAGE_ERROR 1
  46. /*****************************************************************************
  47. * Global variables
  48. *****************************************************************************/
  49. /******************************************************************************
  50. * Types
  51. *****************************************************************************/
  52. #pragma pack(1)
  53. typedef struct _disk_variable_struct
  54. {
  55. uint_8 app_controller_ID;
  56. boolean start_app;
  57. /* disk space reserved */
  58. uint_8 storage_disk[512];
  59. uint_8 disk_lock;
  60. }DISK_GLOBAL_VARIABLE_STRUCT, *PTR_DISK_GLOBAL_VARIABLE_STRUCT;
  61. /*****************************************************************************
  62. * Global Functions
  63. *****************************************************************************/
  64. extern void TestApp_Init(void);
  65. extern void TestApp_Task(void);
  66. extern void Disk_App(void);
  67. #endif
  68. extern uint_8 S19FileDone;
  69. extern unsigned char BootloaderStatus;
  70. extern unsigned char ReEnumerateNow;
  71. /************************************************************************************
  72. *************************************************************************************
  73. * Functions *
  74. *************************************************************************************
  75. ************************************************************************************/
  76. /* EOF */