dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
unittest_init.c
Go to the documentation of this file.
1 /*
2  * These need to be defined in a .c file so that we can use
3  * designated initializer syntax which c++ doesn't support (yet).
4  */
5 
6 #define NELEMENTS(x) (sizeof(x) / sizeof(*(x)))
7 
8 #include "pios.h"
9 
11 
13  .fs_magic = 0x89abceef,
14  .arena_size = 0x00010000, /* 256 * slot size */
15  .slot_size = 0x00000100, /* 256 bytes */
16 };
17 
19  .fs_magic = 0x89abceef,
20  .arena_size = 0x00010000, /* 64 * slot size */
21  .slot_size = 0x00000400, /* 256 bytes */
22 };
23 
24 #include "pios_flash_posix_priv.h"
25 
26 #include "pios_flash_priv.h"
27 
29  .size_of_flash = 4 * 1024 * 1024,
30  .size_of_sector = FLASH_SECTOR_64KB,
31 };
32 
34  {
35  .base_sector = 0,
36  .last_sector = 63,
37  .sector_size = FLASH_SECTOR_64KB,
38  },
39 };
40 
42 static const struct pios_flash_chip pios_flash_chip_posix = {
44  .chip_id = &pios_posix_flash_id,
45  .page_size = 256,
46  .sector_blocks = posix_flash_sectors,
47  .num_blocks = NELEMENTS(posix_flash_sectors),
48 };
49 
51  {
53  .chip_desc = &pios_flash_chip_posix,
54  .first_sector = 0,
55  .last_sector = 31,
56  .chip_offset = 0,
57  .size = (31 - 0 + 1) * FLASH_SECTOR_64KB,
58  },
59 
60  {
62  .chip_desc = &pios_flash_chip_posix,
63  .first_sector = 32,
64  .last_sector = 47,
65  .chip_offset = (32 * 64 * 1024),
66  .size = (47 - 32 + 1) * FLASH_SECTOR_64KB,
67  },
68 
69  {
71  .chip_desc = &pios_flash_chip_posix,
72  .first_sector = 48,
73  .last_sector = 63,
74  .chip_offset = (48 * 64 * 1024),
75  .size = (63 - 48 + 1) * FLASH_SECTOR_64KB,
76  },
77 };
78 
79 uint32_t pios_flash_partition_table_size = NELEMENTS(pios_flash_partition_table);
static const struct pios_flash_sector_range posix_flash_sectors[]
Definition: unittest_init.c:33
Main PiOS header to include all the compiled in PiOS options.
const struct flashfs_logfs_cfg flashfs_config_waypoints
Definition: unittest_init.c:18
const struct pios_flash_posix_cfg flash_config
Definition: unittest_init.c:28
#define FLASH_SECTOR_64KB
uintptr_t pios_posix_flash_id
Definition: unittest_init.c:41
const struct flashfs_logfs_cfg flashfs_config_settings
Definition: unittest_init.c:12
#define NELEMENTS(x)
Definition: unittest_init.c:6
const struct pios_flash_driver * driver
const struct pios_flash_partition pios_flash_partition_table[]
Definition: unittest_init.c:50
static const struct pios_flash_chip pios_flash_chip_posix
Definition: unittest_init.c:42
enum pios_flash_partition_labels label
uint32_t pios_flash_partition_table_size
Definition: unittest_init.c:79
const struct pios_flash_driver pios_posix_flash_driver