fds_config.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* Copyright (c) 2015 Nordic Semiconductor. All Rights Reserved.
  2. *
  3. * The information contained herein is property of Nordic Semiconductor ASA.
  4. * Terms and conditions of usage are described in detail in NORDIC
  5. * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
  6. *
  7. * Licensees are granted free, non-transferable use of the information. NO
  8. * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
  9. * the file.
  10. *
  11. */
  12. #ifndef FDS_CONFIG_H__
  13. #define FDS_CONFIG_H__
  14. /**
  15. * @file fds_config.h
  16. *
  17. * @defgroup flash_data_storage_config Configuration options
  18. * @ingroup flash_data_storage
  19. * @{
  20. * @brief Configuration options for FDS.
  21. */
  22. /**@brief Configures the size of the internal queue. */
  23. #define FDS_OP_QUEUE_SIZE (4)
  24. /**@brief Determines how many @ref fds_record_chunk_t structures can be buffered at any time. */
  25. #define FDS_CHUNK_QUEUE_SIZE (8)
  26. /**@brief Configures the maximum number of callbacks that can be registered. */
  27. #define FDS_MAX_USERS (3)
  28. /**@brief Configures the number of virtual flash pages to use.
  29. *
  30. * The total amount of flash memory that is used by FDS amounts to
  31. * @ref FDS_VIRTUAL_PAGES * @ref FDS_VIRTUAL_PAGE_SIZE * 4 bytes.
  32. * On nRF51 ICs, this defaults to 3 * 256 * 4 bytes = 3072 bytes.
  33. * On nRF52 ICs, it defaults to 3 * 1024 * 4 bytes = 12288 bytes.
  34. *
  35. * One of the virtual pages is reserved by the system for garbage collection. Therefore, the
  36. * minimum is two virtual pages: one page to store data and one page to be used by the system for
  37. * garbage collection.
  38. */
  39. #define FDS_VIRTUAL_PAGES (3)
  40. /**@brief Configures the size of a virtual page of flash memory, expressed in number of
  41. * 4-byte words.
  42. *
  43. * By default, a virtual page is the same size as a physical page. Therefore, the default size
  44. * is 1024 bytes for nRF51 ICs and 4096 bytes for nRF52 ICs.
  45. *
  46. * The size of a virtual page must be a multiple of the size of a physical page.
  47. */
  48. #if defined(NRF51)
  49. #define FDS_VIRTUAL_PAGE_SIZE (256)
  50. #elif defined(NRF52)
  51. #define FDS_VIRTUAL_PAGE_SIZE (1024)
  52. #endif
  53. /** @} */
  54. #endif // FDS_CONFIG_H__