summaryrefslogtreecommitdiffstats
path: root/libs/NVRam/bcm5719_NVM.h
blob: 056e20d517f40c988b71058c1b7f672f01c353a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
////////////////////////////////////////////////////////////////////////////////
///
/// @file       bcm5719_NVM.h
///
/// @project    bcm5719
///
/// @brief      bcm5719_NVM
///
////////////////////////////////////////////////////////////////////////////////
///
////////////////////////////////////////////////////////////////////////////////
///
/// @copyright Copyright (c) 2018, Evan Lojewski
/// @cond
///
/// All rights reserved.
///
/// Redistribution and use in source and binary forms, with or without
/// modification, are permitted provided that the following conditions are met:
/// 1. Redistributions of source code must retain the above copyright notice,
/// this list of conditions and the following disclaimer.
/// 2. Redistributions in binary form must reproduce the above copyright notice,
/// this list of conditions and the following disclaimer in the documentation
/// and/or other materials provided with the distribution.
/// 3. Neither the name of the <organization> nor the
/// names of its contributors may be used to endorse or promote products
/// derived from this software without specific prior written permission.
///
////////////////////////////////////////////////////////////////////////////////
///
/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
/// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
/// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
/// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
/// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
/// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
/// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
/// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
/// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
/// POSSIBILITY OF SUCH DAMAGE.
/// @endcond
////////////////////////////////////////////////////////////////////////////////

/** @defgroup BCM5719_NVM_H    bcm5719_NVM */
/** @addtogroup BCM5719_NVM_H
 * @{
 */
#ifndef BCM5719_NVM_H
#define BCM5719_NVM_H

#include <stdint.h>

#ifdef CXX_SIMULATOR /* Compiling c++ simulator code - uses register wrappers */
void init_bcm5719_NVM_sim(void* base);
void init_bcm5719_NVM(void);

#include <CXXRegister.h>
typedef CXXRegister<uint8_t,  0,  8> BCM5719_NVM_H_uint8_t;
typedef CXXRegister<uint16_t, 0, 16> BCM5719_NVM_H_uint16_t;
typedef CXXRegister<uint32_t, 0, 32> BCM5719_NVM_H_uint32_t;
#define BCM5719_NVM_H_uint8_t_bitfield(__pos__, __width__)  CXXRegister<uint8_t,  __pos__, __width__>
#define BCM5719_NVM_H_uint16_t_bitfield(__pos__, __width__) CXXRegister<uint16_t, __pos__, __width__>
#define BCM5719_NVM_H_uint32_t_bitfield(__pos__, __width__) CXXRegister<uint32_t, __pos__, __width__>
#define register_container struct
#define volatile
#define BITFIELD_BEGIN(__type__, __name__) struct {
#define BITFIELD_MEMBER(__type__, __name__, __offset__, __bits__) __type__##_bitfield(__offset__, __bits__) __name__;
#define BITFIELD_END(__type__, __name__) } __name__;

#else /* Firmware Data types */
typedef uint8_t  BCM5719_NVM_H_uint8_t;
typedef uint16_t BCM5719_NVM_H_uint16_t;
typedef uint32_t BCM5719_NVM_H_uint32_t;
#define register_container union
#define BITFIELD_BEGIN(__type__, __name__) struct {
#define BITFIELD_MEMBER(__type__, __name__, __offset__, __bits__) __type__ __name__:__bits__;
#define BITFIELD_END(__type__, __name__) } __name__;
#endif /* !CXX_SIMULATOR */

#define REG_NVM_BASE ((volatile void*)0xc0007000) /* Non-Volatile Memory Registers */
#define REG_NVM_SIZE (sizeof(NVM_t))

#define REG_NVM_COMMAND ((volatile BCM5719_NVM_H_uint32_t*)0xc0007000) /*  */
#define     NVM_COMMAND_DONE_SHIFT 3u
#define     NVM_COMMAND_DONE_MASK  0x8u
#define GET_NVM_COMMAND_DONE(__reg__)  (((__reg__) & 0x8) >> 3u)
#define SET_NVM_COMMAND_DONE(__val__)  (((__val__) << 3u) & 0x8u)
#define     NVM_COMMAND_DOIT_SHIFT 4u
#define     NVM_COMMAND_DOIT_MASK  0x10u
#define GET_NVM_COMMAND_DOIT(__reg__)  (((__reg__) & 0x10) >> 4u)
#define SET_NVM_COMMAND_DOIT(__val__)  (((__val__) << 4u) & 0x10u)
#define     NVM_COMMAND_WR_SHIFT 5u
#define     NVM_COMMAND_WR_MASK  0x20u
#define GET_NVM_COMMAND_WR(__reg__)  (((__reg__) & 0x20) >> 5u)
#define SET_NVM_COMMAND_WR(__val__)  (((__val__) << 5u) & 0x20u)
#define     NVM_COMMAND_ERASE_SHIFT 6u
#define     NVM_COMMAND_ERASE_MASK  0x40u
#define GET_NVM_COMMAND_ERASE(__reg__)  (((__reg__) & 0x40) >> 6u)
#define SET_NVM_COMMAND_ERASE(__val__)  (((__val__) << 6u) & 0x40u)
#define     NVM_COMMAND_FIRST_SHIFT 7u
#define     NVM_COMMAND_FIRST_MASK  0x80u
#define GET_NVM_COMMAND_FIRST(__reg__)  (((__reg__) & 0x80) >> 7u)
#define SET_NVM_COMMAND_FIRST(__val__)  (((__val__) << 7u) & 0x80u)
#define     NVM_COMMAND_LAST_SHIFT 8u
#define     NVM_COMMAND_LAST_MASK  0x100u
#define GET_NVM_COMMAND_LAST(__reg__)  (((__reg__) & 0x100) >> 8u)
#define SET_NVM_COMMAND_LAST(__val__)  (((__val__) << 8u) & 0x100u)
#define     NVM_COMMAND_WRITE_ENABLE_COMMAND_SHIFT 16u
#define     NVM_COMMAND_WRITE_ENABLE_COMMAND_MASK  0x10000u
#define GET_NVM_COMMAND_WRITE_ENABLE_COMMAND(__reg__)  (((__reg__) & 0x10000) >> 16u)
#define SET_NVM_COMMAND_WRITE_ENABLE_COMMAND(__val__)  (((__val__) << 16u) & 0x10000u)
#define     NVM_COMMAND_WRITE_DISABLE_COMMAND_SHIFT 17u
#define     NVM_COMMAND_WRITE_DISABLE_COMMAND_MASK  0x20000u
#define GET_NVM_COMMAND_WRITE_DISABLE_COMMAND(__reg__)  (((__reg__) & 0x20000) >> 17u)
#define SET_NVM_COMMAND_WRITE_DISABLE_COMMAND(__val__)  (((__val__) << 17u) & 0x20000u)

/** @brief Register definition for @ref NVM_t.Command. */
typedef register_container RegNVMCommand_t {
    /** @brief 32bit direct register access. */
    BCM5719_NVM_H_uint32_t r32;

    BITFIELD_BEGIN(BCM5719_NVM_H_uint32_t, bits)
#if defined(__LITTLE_ENDIAN__)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_2_0, 0, 3)
        /** @brief Sequence completion bit that is asserted when the command requested by assertion of the doit bit has completed. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, Done, 3, 1)
        /** @brief Command from software to start the defined command. The done bit must be clear before setting this bit. This bit is self clearing and will remain set while the command is active. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, Doit, 4, 1)
        /** @brief The write/not read command bit. Set to execute write or erase. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, Wr, 5, 1)
        /** @brief The erase command bit. Set high to execute an erase. This bit is ignored if the wr is clear. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, Erase, 6, 1)
        /** @brief This bit is passed to the SEE_FSM or SPI_FSM if the pass_mode bit is set */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, First, 7, 1)
        /** @brief When this bit is set, the next command sequence is interpreted as the last one of a burst and any cleanup work is done. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, Last, 8, 1)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_15_9, 9, 7)
        /** @brief The write enable command bit. Set '1' will make the flash interface state machine generate a write enable command cycle to the flash device to set the write enable bit in the device status register. This command is used for devices with a write protection function. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, WriteEnableCommand, 16, 1)
        /** @brief The write disable command bit. Set '1' will make the flash interface state machine generate a write disable command cycle to the flash device to clear the write enable bit in the device status register. This command is used for devices with a write protection function. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, WriteDisableCommand, 17, 1)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_31_18, 18, 14)
#elif defined(__BIG_ENDIAN__)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_31_18, 18, 14)
        /** @brief The write disable command bit. Set '1' will make the flash interface state machine generate a write disable command cycle to the flash device to clear the write enable bit in the device status register. This command is used for devices with a write protection function. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, WriteDisableCommand, 17, 1)
        /** @brief The write enable command bit. Set '1' will make the flash interface state machine generate a write enable command cycle to the flash device to set the write enable bit in the device status register. This command is used for devices with a write protection function. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, WriteEnableCommand, 16, 1)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_15_9, 9, 7)
        /** @brief When this bit is set, the next command sequence is interpreted as the last one of a burst and any cleanup work is done. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, Last, 8, 1)
        /** @brief This bit is passed to the SEE_FSM or SPI_FSM if the pass_mode bit is set */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, First, 7, 1)
        /** @brief The erase command bit. Set high to execute an erase. This bit is ignored if the wr is clear. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, Erase, 6, 1)
        /** @brief The write/not read command bit. Set to execute write or erase. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, Wr, 5, 1)
        /** @brief Command from software to start the defined command. The done bit must be clear before setting this bit. This bit is self clearing and will remain set while the command is active. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, Doit, 4, 1)
        /** @brief Sequence completion bit that is asserted when the command requested by assertion of the doit bit has completed. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, Done, 3, 1)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_2_0, 0, 3)
#else
#error Unknown Endian
#endif
    BITFIELD_END(BCM5719_NVM_H_uint32_t, bits)
#ifdef CXX_SIMULATOR
    /** @brief Register name for use with the simulator. */
    const char* getName(void) { return "Command"; }

    /** @brief Print register value. */
    void print(void) { r32.print(); }

    RegNVMCommand_t()
    {
        /** @brief constructor for @ref NVM_t.Command. */
        r32.setName("Command");
        bits.Done.setBaseRegister(&r32);
        bits.Done.setName("Done");
        bits.Doit.setBaseRegister(&r32);
        bits.Doit.setName("Doit");
        bits.Wr.setBaseRegister(&r32);
        bits.Wr.setName("Wr");
        bits.Erase.setBaseRegister(&r32);
        bits.Erase.setName("Erase");
        bits.First.setBaseRegister(&r32);
        bits.First.setName("First");
        bits.Last.setBaseRegister(&r32);
        bits.Last.setName("Last");
        bits.WriteEnableCommand.setBaseRegister(&r32);
        bits.WriteEnableCommand.setName("WriteEnableCommand");
        bits.WriteDisableCommand.setBaseRegister(&r32);
        bits.WriteDisableCommand.setName("WriteDisableCommand");
    }
    RegNVMCommand_t& operator=(const RegNVMCommand_t& other)
    {
        r32 = other.r32;
        return *this;
    }
#endif /* CXX_SIMULATOR */
} RegNVMCommand_t;

#define REG_NVM_WRITE ((volatile BCM5719_NVM_H_uint32_t*)0xc0007008) /* 32bits of write data are used when write commands are executed. */
/** @brief Register definition for @ref NVM_t.Write. */
typedef register_container RegNVMWrite_t {
    /** @brief 32bit direct register access. */
    BCM5719_NVM_H_uint32_t r32;
#ifdef CXX_SIMULATOR
    /** @brief Register name for use with the simulator. */
    const char* getName(void) { return "Write"; }

    /** @brief Print register value. */
    void print(void) { r32.print(); }

    RegNVMWrite_t()
    {
        /** @brief constructor for @ref NVM_t.Write. */
        r32.setName("Write");
    }
    RegNVMWrite_t& operator=(const RegNVMWrite_t& other)
    {
        r32 = other.r32;
        return *this;
    }
#endif /* CXX_SIMULATOR */
} RegNVMWrite_t;

#define REG_NVM_ADDR ((volatile BCM5719_NVM_H_uint32_t*)0xc000700c) /* The 24 bit address for a read or write operation (must be 4 byte aligned). */
/** @brief Register definition for @ref NVM_t.Addr. */
typedef register_container RegNVMAddr_t {
    /** @brief 32bit direct register access. */
    BCM5719_NVM_H_uint32_t r32;
#ifdef CXX_SIMULATOR
    /** @brief Register name for use with the simulator. */
    const char* getName(void) { return "Addr"; }

    /** @brief Print register value. */
    void print(void) { r32.print(); }

    RegNVMAddr_t()
    {
        /** @brief constructor for @ref NVM_t.Addr. */
        r32.setName("Addr");
    }
    RegNVMAddr_t& operator=(const RegNVMAddr_t& other)
    {
        r32 = other.r32;
        return *this;
    }
#endif /* CXX_SIMULATOR */
} RegNVMAddr_t;

#define REG_NVM_READ ((volatile BCM5719_NVM_H_uint32_t*)0xc0007010) /* 32bits of read data are used when read commands are executed. */
/** @brief Register definition for @ref NVM_t.Read. */
typedef register_container RegNVMRead_t {
    /** @brief 32bit direct register access. */
    BCM5719_NVM_H_uint32_t r32;
#ifdef CXX_SIMULATOR
    /** @brief Register name for use with the simulator. */
    const char* getName(void) { return "Read"; }

    /** @brief Print register value. */
    void print(void) { r32.print(); }

    RegNVMRead_t()
    {
        /** @brief constructor for @ref NVM_t.Read. */
        r32.setName("Read");
    }
    RegNVMRead_t& operator=(const RegNVMRead_t& other)
    {
        r32 = other.r32;
        return *this;
    }
#endif /* CXX_SIMULATOR */
} RegNVMRead_t;

#define REG_NVM_NVM_CFG_1 ((volatile BCM5719_NVM_H_uint32_t*)0xc0007014) /*  */
#define     NVM_NVM_CFG_1_FLASH_MODE_SHIFT 0u
#define     NVM_NVM_CFG_1_FLASH_MODE_MASK  0x1u
#define GET_NVM_NVM_CFG_1_FLASH_MODE(__reg__)  (((__reg__) & 0x1) >> 0u)
#define SET_NVM_NVM_CFG_1_FLASH_MODE(__val__)  (((__val__) << 0u) & 0x1u)
#define     NVM_NVM_CFG_1_BUFFER_MODE_SHIFT 1u
#define     NVM_NVM_CFG_1_BUFFER_MODE_MASK  0x2u
#define GET_NVM_NVM_CFG_1_BUFFER_MODE(__reg__)  (((__reg__) & 0x2) >> 1u)
#define SET_NVM_NVM_CFG_1_BUFFER_MODE(__val__)  (((__val__) << 1u) & 0x2u)
#define     NVM_NVM_CFG_1_SPI_CLK_DIV_SHIFT 7u
#define     NVM_NVM_CFG_1_SPI_CLK_DIV_MASK  0x780u
#define GET_NVM_NVM_CFG_1_SPI_CLK_DIV(__reg__)  (((__reg__) & 0x780) >> 7u)
#define SET_NVM_NVM_CFG_1_SPI_CLK_DIV(__val__)  (((__val__) << 7u) & 0x780u)
#define     NVM_NVM_CFG_1_PROTECT_MODE_SHIFT 24u
#define     NVM_NVM_CFG_1_PROTECT_MODE_MASK  0x1000000u
#define GET_NVM_NVM_CFG_1_PROTECT_MODE(__reg__)  (((__reg__) & 0x1000000) >> 24u)
#define SET_NVM_NVM_CFG_1_PROTECT_MODE(__val__)  (((__val__) << 24u) & 0x1000000u)
#define     NVM_NVM_CFG_1_FLASH_SIZE_SHIFT 25u
#define     NVM_NVM_CFG_1_FLASH_SIZE_MASK  0x2000000u
#define GET_NVM_NVM_CFG_1_FLASH_SIZE(__reg__)  (((__reg__) & 0x2000000) >> 25u)
#define SET_NVM_NVM_CFG_1_FLASH_SIZE(__val__)  (((__val__) << 25u) & 0x2000000u)
#define     NVM_NVM_CFG_1_PAGE_SIZE_SHIFT 28u
#define     NVM_NVM_CFG_1_PAGE_SIZE_MASK  0x70000000u
#define GET_NVM_NVM_CFG_1_PAGE_SIZE(__reg__)  (((__reg__) & 0x70000000) >> 28u)
#define SET_NVM_NVM_CFG_1_PAGE_SIZE(__val__)  (((__val__) << 28u) & 0x70000000u)
#define     NVM_NVM_CFG_1_PAGE_SIZE_256_BYTES 0x0u
#define     NVM_NVM_CFG_1_PAGE_SIZE_512_BYTES 0x1u
#define     NVM_NVM_CFG_1_PAGE_SIZE_1024_BYTES 0x2u
#define     NVM_NVM_CFG_1_PAGE_SIZE_2048_BYTES 0x3u
#define     NVM_NVM_CFG_1_PAGE_SIZE_4096_BYTES 0x4u
#define     NVM_NVM_CFG_1_PAGE_SIZE_264_BYTES 0x5u


/** @brief Register definition for @ref NVM_t.NvmCfg1. */
typedef register_container RegNVMNvmCfg1_t {
    /** @brief 32bit direct register access. */
    BCM5719_NVM_H_uint32_t r32;

    BITFIELD_BEGIN(BCM5719_NVM_H_uint32_t, bits)
#if defined(__LITTLE_ENDIAN__)
        /** @brief Enable Flash Interface mode. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, FlashMode, 0, 1)
        /** @brief Enable SSRAM Buffered Interface mode. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, BufferMode, 1, 1)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_6_2, 2, 5)
        /** @brief The equation to calculate the clock freq. for SCK is: CORE_CLK / ((SPI_CLK_DIV + 1) * 2) */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, SPICLKDIV, 7, 4)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_23_11, 11, 13)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ProtectMode, 24, 1)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, FlashSize, 25, 1)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_27_26, 26, 2)
        /** @brief These bits indicate the page size of the attached flash device. They are set automatically depending on the chosen flash as indicated by the strapping option pins. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, PageSize, 28, 3)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_31_31, 31, 1)
#elif defined(__BIG_ENDIAN__)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_31_31, 31, 1)
        /** @brief These bits indicate the page size of the attached flash device. They are set automatically depending on the chosen flash as indicated by the strapping option pins. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, PageSize, 28, 3)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_27_26, 26, 2)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, FlashSize, 25, 1)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ProtectMode, 24, 1)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_23_11, 11, 13)
        /** @brief The equation to calculate the clock freq. for SCK is: CORE_CLK / ((SPI_CLK_DIV + 1) * 2) */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, SPICLKDIV, 7, 4)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_6_2, 2, 5)
        /** @brief Enable SSRAM Buffered Interface mode. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, BufferMode, 1, 1)
        /** @brief Enable Flash Interface mode. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, FlashMode, 0, 1)
#else
#error Unknown Endian
#endif
    BITFIELD_END(BCM5719_NVM_H_uint32_t, bits)
#ifdef CXX_SIMULATOR
    /** @brief Register name for use with the simulator. */
    const char* getName(void) { return "NvmCfg1"; }

    /** @brief Print register value. */
    void print(void) { r32.print(); }

    RegNVMNvmCfg1_t()
    {
        /** @brief constructor for @ref NVM_t.NvmCfg1. */
        r32.setName("NvmCfg1");
        bits.FlashMode.setBaseRegister(&r32);
        bits.FlashMode.setName("FlashMode");
        bits.BufferMode.setBaseRegister(&r32);
        bits.BufferMode.setName("BufferMode");
        bits.SPICLKDIV.setBaseRegister(&r32);
        bits.SPICLKDIV.setName("SPICLKDIV");
        bits.ProtectMode.setBaseRegister(&r32);
        bits.ProtectMode.setName("ProtectMode");
        bits.FlashSize.setBaseRegister(&r32);
        bits.FlashSize.setName("FlashSize");
        bits.PageSize.setBaseRegister(&r32);
        bits.PageSize.setName("PageSize");
    }
    RegNVMNvmCfg1_t& operator=(const RegNVMNvmCfg1_t& other)
    {
        r32 = other.r32;
        return *this;
    }
#endif /* CXX_SIMULATOR */
} RegNVMNvmCfg1_t;

#define REG_NVM_NVM_CFG_2 ((volatile BCM5719_NVM_H_uint32_t*)0xc0007018) /*  */
#define     NVM_NVM_CFG_2_ERASE_COMMAND_SHIFT 0u
#define     NVM_NVM_CFG_2_ERASE_COMMAND_MASK  0xffu
#define GET_NVM_NVM_CFG_2_ERASE_COMMAND(__reg__)  (((__reg__) & 0xff) >> 0u)
#define SET_NVM_NVM_CFG_2_ERASE_COMMAND(__val__)  (((__val__) << 0u) & 0xffu)
#define     NVM_NVM_CFG_2_STATUS_COMMAND_SHIFT 16u
#define     NVM_NVM_CFG_2_STATUS_COMMAND_MASK  0xff0000u
#define GET_NVM_NVM_CFG_2_STATUS_COMMAND(__reg__)  (((__reg__) & 0xff0000) >> 16u)
#define SET_NVM_NVM_CFG_2_STATUS_COMMAND(__val__)  (((__val__) << 16u) & 0xff0000u)

/** @brief Register definition for @ref NVM_t.NvmCfg2. */
typedef register_container RegNVMNvmCfg2_t {
    /** @brief 32bit direct register access. */
    BCM5719_NVM_H_uint32_t r32;

    BITFIELD_BEGIN(BCM5719_NVM_H_uint32_t, bits)
#if defined(__LITTLE_ENDIAN__)
        /** @brief This is the Flash page erase command. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, EraseCommand, 0, 8)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_15_8, 8, 8)
        /** @brief This is the Flash status register read command. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, StatusCommand, 16, 8)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_31_24, 24, 8)
#elif defined(__BIG_ENDIAN__)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_31_24, 24, 8)
        /** @brief This is the Flash status register read command. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, StatusCommand, 16, 8)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_15_8, 8, 8)
        /** @brief This is the Flash page erase command. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, EraseCommand, 0, 8)
#else
#error Unknown Endian
#endif
    BITFIELD_END(BCM5719_NVM_H_uint32_t, bits)
#ifdef CXX_SIMULATOR
    /** @brief Register name for use with the simulator. */
    const char* getName(void) { return "NvmCfg2"; }

    /** @brief Print register value. */
    void print(void) { r32.print(); }

    RegNVMNvmCfg2_t()
    {
        /** @brief constructor for @ref NVM_t.NvmCfg2. */
        r32.setName("NvmCfg2");
        bits.EraseCommand.setBaseRegister(&r32);
        bits.EraseCommand.setName("EraseCommand");
        bits.StatusCommand.setBaseRegister(&r32);
        bits.StatusCommand.setName("StatusCommand");
    }
    RegNVMNvmCfg2_t& operator=(const RegNVMNvmCfg2_t& other)
    {
        r32 = other.r32;
        return *this;
    }
#endif /* CXX_SIMULATOR */
} RegNVMNvmCfg2_t;

#define REG_NVM_NVM_CFG_3 ((volatile BCM5719_NVM_H_uint32_t*)0xc000701c) /*  */
#define     NVM_NVM_CFG_3_WRITE_COMMAND_SHIFT 8u
#define     NVM_NVM_CFG_3_WRITE_COMMAND_MASK  0xff00u
#define GET_NVM_NVM_CFG_3_WRITE_COMMAND(__reg__)  (((__reg__) & 0xff00) >> 8u)
#define SET_NVM_NVM_CFG_3_WRITE_COMMAND(__val__)  (((__val__) << 8u) & 0xff00u)
#define     NVM_NVM_CFG_3_READ_COMMAND_SHIFT 24u
#define     NVM_NVM_CFG_3_READ_COMMAND_MASK  0xff000000u
#define GET_NVM_NVM_CFG_3_READ_COMMAND(__reg__)  (((__reg__) & 0xff000000) >> 24u)
#define SET_NVM_NVM_CFG_3_READ_COMMAND(__val__)  (((__val__) << 24u) & 0xff000000u)

/** @brief Register definition for @ref NVM_t.NvmCfg3. */
typedef register_container RegNVMNvmCfg3_t {
    /** @brief 32bit direct register access. */
    BCM5719_NVM_H_uint32_t r32;

    BITFIELD_BEGIN(BCM5719_NVM_H_uint32_t, bits)
#if defined(__LITTLE_ENDIAN__)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_7_0, 0, 8)
        /** @brief Command to write a series of bytes into a selected page in the Flash device. Note: this write command wraps around to the beginning of the page after the internal address counter in the Flash device reaches the end of the page. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, WriteCommand, 8, 8)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_23_16, 16, 8)
        /** @brief This is the Flash/SEEPROM read command. Following this command, any number of bytes may be read up to the end of the flash memory. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ReadCommand, 24, 8)
#elif defined(__BIG_ENDIAN__)
        /** @brief This is the Flash/SEEPROM read command. Following this command, any number of bytes may be read up to the end of the flash memory. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ReadCommand, 24, 8)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_23_16, 16, 8)
        /** @brief Command to write a series of bytes into a selected page in the Flash device. Note: this write command wraps around to the beginning of the page after the internal address counter in the Flash device reaches the end of the page. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, WriteCommand, 8, 8)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_7_0, 0, 8)
#else
#error Unknown Endian
#endif
    BITFIELD_END(BCM5719_NVM_H_uint32_t, bits)
#ifdef CXX_SIMULATOR
    /** @brief Register name for use with the simulator. */
    const char* getName(void) { return "NvmCfg3"; }

    /** @brief Print register value. */
    void print(void) { r32.print(); }

    RegNVMNvmCfg3_t()
    {
        /** @brief constructor for @ref NVM_t.NvmCfg3. */
        r32.setName("NvmCfg3");
        bits.WriteCommand.setBaseRegister(&r32);
        bits.WriteCommand.setName("WriteCommand");
        bits.ReadCommand.setBaseRegister(&r32);
        bits.ReadCommand.setName("ReadCommand");
    }
    RegNVMNvmCfg3_t& operator=(const RegNVMNvmCfg3_t& other)
    {
        r32 = other.r32;
        return *this;
    }
#endif /* CXX_SIMULATOR */
} RegNVMNvmCfg3_t;

#define REG_NVM_SOFTWARE_ARBITRATION ((volatile BCM5719_NVM_H_uint32_t*)0xc0007020) /*  */
#define     NVM_SOFTWARE_ARBITRATION_REQ_SET0_SHIFT 0u
#define     NVM_SOFTWARE_ARBITRATION_REQ_SET0_MASK  0x1u
#define GET_NVM_SOFTWARE_ARBITRATION_REQ_SET0(__reg__)  (((__reg__) & 0x1) >> 0u)
#define SET_NVM_SOFTWARE_ARBITRATION_REQ_SET0(__val__)  (((__val__) << 0u) & 0x1u)
#define     NVM_SOFTWARE_ARBITRATION_REQ_SET1_SHIFT 1u
#define     NVM_SOFTWARE_ARBITRATION_REQ_SET1_MASK  0x2u
#define GET_NVM_SOFTWARE_ARBITRATION_REQ_SET1(__reg__)  (((__reg__) & 0x2) >> 1u)
#define SET_NVM_SOFTWARE_ARBITRATION_REQ_SET1(__val__)  (((__val__) << 1u) & 0x2u)
#define     NVM_SOFTWARE_ARBITRATION_REQ_SET2_SHIFT 2u
#define     NVM_SOFTWARE_ARBITRATION_REQ_SET2_MASK  0x4u
#define GET_NVM_SOFTWARE_ARBITRATION_REQ_SET2(__reg__)  (((__reg__) & 0x4) >> 2u)
#define SET_NVM_SOFTWARE_ARBITRATION_REQ_SET2(__val__)  (((__val__) << 2u) & 0x4u)
#define     NVM_SOFTWARE_ARBITRATION_REQ_SET3_SHIFT 3u
#define     NVM_SOFTWARE_ARBITRATION_REQ_SET3_MASK  0x8u
#define GET_NVM_SOFTWARE_ARBITRATION_REQ_SET3(__reg__)  (((__reg__) & 0x8) >> 3u)
#define SET_NVM_SOFTWARE_ARBITRATION_REQ_SET3(__val__)  (((__val__) << 3u) & 0x8u)
#define     NVM_SOFTWARE_ARBITRATION_REQ_CLR0_SHIFT 4u
#define     NVM_SOFTWARE_ARBITRATION_REQ_CLR0_MASK  0x10u
#define GET_NVM_SOFTWARE_ARBITRATION_REQ_CLR0(__reg__)  (((__reg__) & 0x10) >> 4u)
#define SET_NVM_SOFTWARE_ARBITRATION_REQ_CLR0(__val__)  (((__val__) << 4u) & 0x10u)
#define     NVM_SOFTWARE_ARBITRATION_REQ_CLR1_SHIFT 5u
#define     NVM_SOFTWARE_ARBITRATION_REQ_CLR1_MASK  0x20u
#define GET_NVM_SOFTWARE_ARBITRATION_REQ_CLR1(__reg__)  (((__reg__) & 0x20) >> 5u)
#define SET_NVM_SOFTWARE_ARBITRATION_REQ_CLR1(__val__)  (((__val__) << 5u) & 0x20u)
#define     NVM_SOFTWARE_ARBITRATION_REQ_CLR2_SHIFT 6u
#define     NVM_SOFTWARE_ARBITRATION_REQ_CLR2_MASK  0x40u
#define GET_NVM_SOFTWARE_ARBITRATION_REQ_CLR2(__reg__)  (((__reg__) & 0x40) >> 6u)
#define SET_NVM_SOFTWARE_ARBITRATION_REQ_CLR2(__val__)  (((__val__) << 6u) & 0x40u)
#define     NVM_SOFTWARE_ARBITRATION_REQ_CLR3_SHIFT 7u
#define     NVM_SOFTWARE_ARBITRATION_REQ_CLR3_MASK  0x80u
#define GET_NVM_SOFTWARE_ARBITRATION_REQ_CLR3(__reg__)  (((__reg__) & 0x80) >> 7u)
#define SET_NVM_SOFTWARE_ARBITRATION_REQ_CLR3(__val__)  (((__val__) << 7u) & 0x80u)
#define     NVM_SOFTWARE_ARBITRATION_ARB_WON0_SHIFT 8u
#define     NVM_SOFTWARE_ARBITRATION_ARB_WON0_MASK  0x100u
#define GET_NVM_SOFTWARE_ARBITRATION_ARB_WON0(__reg__)  (((__reg__) & 0x100) >> 8u)
#define SET_NVM_SOFTWARE_ARBITRATION_ARB_WON0(__val__)  (((__val__) << 8u) & 0x100u)
#define     NVM_SOFTWARE_ARBITRATION_ARB_WON1_SHIFT 9u
#define     NVM_SOFTWARE_ARBITRATION_ARB_WON1_MASK  0x200u
#define GET_NVM_SOFTWARE_ARBITRATION_ARB_WON1(__reg__)  (((__reg__) & 0x200) >> 9u)
#define SET_NVM_SOFTWARE_ARBITRATION_ARB_WON1(__val__)  (((__val__) << 9u) & 0x200u)
#define     NVM_SOFTWARE_ARBITRATION_ARB_WON2_SHIFT 10u
#define     NVM_SOFTWARE_ARBITRATION_ARB_WON2_MASK  0x400u
#define GET_NVM_SOFTWARE_ARBITRATION_ARB_WON2(__reg__)  (((__reg__) & 0x400) >> 10u)
#define SET_NVM_SOFTWARE_ARBITRATION_ARB_WON2(__val__)  (((__val__) << 10u) & 0x400u)
#define     NVM_SOFTWARE_ARBITRATION_ARB_WON3_SHIFT 11u
#define     NVM_SOFTWARE_ARBITRATION_ARB_WON3_MASK  0x800u
#define GET_NVM_SOFTWARE_ARBITRATION_ARB_WON3(__reg__)  (((__reg__) & 0x800) >> 11u)
#define SET_NVM_SOFTWARE_ARBITRATION_ARB_WON3(__val__)  (((__val__) << 11u) & 0x800u)

/** @brief Register definition for @ref NVM_t.SoftwareArbitration. */
typedef register_container RegNVMSoftwareArbitration_t {
    /** @brief 32bit direct register access. */
    BCM5719_NVM_H_uint32_t r32;

    BITFIELD_BEGIN(BCM5719_NVM_H_uint32_t, bits)
#if defined(__LITTLE_ENDIAN__)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ReqSet0, 0, 1)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ReqSet1, 1, 1)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ReqSet2, 2, 1)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ReqSet3, 3, 1)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ReqClr0, 4, 1)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ReqClr1, 5, 1)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ReqClr2, 6, 1)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ReqClr3, 7, 1)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ArbWon0, 8, 1)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ArbWon1, 9, 1)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ArbWon2, 10, 1)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ArbWon3, 11, 1)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_31_12, 12, 20)
#elif defined(__BIG_ENDIAN__)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_31_12, 12, 20)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ArbWon3, 11, 1)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ArbWon2, 10, 1)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ArbWon1, 9, 1)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ArbWon0, 8, 1)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ReqClr3, 7, 1)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ReqClr2, 6, 1)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ReqClr1, 5, 1)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ReqClr0, 4, 1)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ReqSet3, 3, 1)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ReqSet2, 2, 1)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ReqSet1, 1, 1)
        /** @brief  */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, ReqSet0, 0, 1)
#else
#error Unknown Endian
#endif
    BITFIELD_END(BCM5719_NVM_H_uint32_t, bits)
#ifdef CXX_SIMULATOR
    /** @brief Register name for use with the simulator. */
    const char* getName(void) { return "SoftwareArbitration"; }

    /** @brief Print register value. */
    void print(void) { r32.print(); }

    RegNVMSoftwareArbitration_t()
    {
        /** @brief constructor for @ref NVM_t.SoftwareArbitration. */
        r32.setName("SoftwareArbitration");
        bits.ReqSet0.setBaseRegister(&r32);
        bits.ReqSet0.setName("ReqSet0");
        bits.ReqSet1.setBaseRegister(&r32);
        bits.ReqSet1.setName("ReqSet1");
        bits.ReqSet2.setBaseRegister(&r32);
        bits.ReqSet2.setName("ReqSet2");
        bits.ReqSet3.setBaseRegister(&r32);
        bits.ReqSet3.setName("ReqSet3");
        bits.ReqClr0.setBaseRegister(&r32);
        bits.ReqClr0.setName("ReqClr0");
        bits.ReqClr1.setBaseRegister(&r32);
        bits.ReqClr1.setName("ReqClr1");
        bits.ReqClr2.setBaseRegister(&r32);
        bits.ReqClr2.setName("ReqClr2");
        bits.ReqClr3.setBaseRegister(&r32);
        bits.ReqClr3.setName("ReqClr3");
        bits.ArbWon0.setBaseRegister(&r32);
        bits.ArbWon0.setName("ArbWon0");
        bits.ArbWon1.setBaseRegister(&r32);
        bits.ArbWon1.setName("ArbWon1");
        bits.ArbWon2.setBaseRegister(&r32);
        bits.ArbWon2.setName("ArbWon2");
        bits.ArbWon3.setBaseRegister(&r32);
        bits.ArbWon3.setName("ArbWon3");
    }
    RegNVMSoftwareArbitration_t& operator=(const RegNVMSoftwareArbitration_t& other)
    {
        r32 = other.r32;
        return *this;
    }
#endif /* CXX_SIMULATOR */
} RegNVMSoftwareArbitration_t;

#define REG_NVM_ACCESS ((volatile BCM5719_NVM_H_uint32_t*)0xc0007024) /*  */
#define     NVM_ACCESS_ENABLE_SHIFT 0u
#define     NVM_ACCESS_ENABLE_MASK  0x1u
#define GET_NVM_ACCESS_ENABLE(__reg__)  (((__reg__) & 0x1) >> 0u)
#define SET_NVM_ACCESS_ENABLE(__val__)  (((__val__) << 0u) & 0x1u)
#define     NVM_ACCESS_WRITE_ENABLE_SHIFT 1u
#define     NVM_ACCESS_WRITE_ENABLE_MASK  0x2u
#define GET_NVM_ACCESS_WRITE_ENABLE(__reg__)  (((__reg__) & 0x2) >> 1u)
#define SET_NVM_ACCESS_WRITE_ENABLE(__val__)  (((__val__) << 1u) & 0x2u)

/** @brief Register definition for @ref NVM_t.Access. */
typedef register_container RegNVMAccess_t {
    /** @brief 32bit direct register access. */
    BCM5719_NVM_H_uint32_t r32;

    BITFIELD_BEGIN(BCM5719_NVM_H_uint32_t, bits)
#if defined(__LITTLE_ENDIAN__)
        /** @brief When 1, allows the NVRAM write command to be issued even if the NVRAM write enable bit 21 of the mode control register 0x6800. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, Enable, 0, 1)
        /** @brief When 0, prevents write access to all other NVRAM registers, except for the Software arbitration register. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, WriteEnable, 1, 1)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_31_2, 2, 30)
#elif defined(__BIG_ENDIAN__)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_31_2, 2, 30)
        /** @brief When 0, prevents write access to all other NVRAM registers, except for the Software arbitration register. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, WriteEnable, 1, 1)
        /** @brief When 1, allows the NVRAM write command to be issued even if the NVRAM write enable bit 21 of the mode control register 0x6800. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, Enable, 0, 1)
#else
#error Unknown Endian
#endif
    BITFIELD_END(BCM5719_NVM_H_uint32_t, bits)
#ifdef CXX_SIMULATOR
    /** @brief Register name for use with the simulator. */
    const char* getName(void) { return "Access"; }

    /** @brief Print register value. */
    void print(void) { r32.print(); }

    RegNVMAccess_t()
    {
        /** @brief constructor for @ref NVM_t.Access. */
        r32.setName("Access");
        bits.Enable.setBaseRegister(&r32);
        bits.Enable.setName("Enable");
        bits.WriteEnable.setBaseRegister(&r32);
        bits.WriteEnable.setName("WriteEnable");
    }
    RegNVMAccess_t& operator=(const RegNVMAccess_t& other)
    {
        r32 = other.r32;
        return *this;
    }
#endif /* CXX_SIMULATOR */
} RegNVMAccess_t;

#define REG_NVM_NVM_WRITE_1 ((volatile BCM5719_NVM_H_uint32_t*)0xc0007028) /*  */
#define     NVM_NVM_WRITE_1_WRITE_ENABLE_COMMAND_SHIFT 0u
#define     NVM_NVM_WRITE_1_WRITE_ENABLE_COMMAND_MASK  0xffu
#define GET_NVM_NVM_WRITE_1_WRITE_ENABLE_COMMAND(__reg__)  (((__reg__) & 0xff) >> 0u)
#define SET_NVM_NVM_WRITE_1_WRITE_ENABLE_COMMAND(__val__)  (((__val__) << 0u) & 0xffu)
#define     NVM_NVM_WRITE_1_WRITE_DISABLE_COMMAND_SHIFT 8u
#define     NVM_NVM_WRITE_1_WRITE_DISABLE_COMMAND_MASK  0xff00u
#define GET_NVM_NVM_WRITE_1_WRITE_DISABLE_COMMAND(__reg__)  (((__reg__) & 0xff00) >> 8u)
#define SET_NVM_NVM_WRITE_1_WRITE_DISABLE_COMMAND(__val__)  (((__val__) << 8u) & 0xff00u)

/** @brief Register definition for @ref NVM_t.NvmWrite1. */
typedef register_container RegNVMNvmWrite1_t {
    /** @brief 32bit direct register access. */
    BCM5719_NVM_H_uint32_t r32;

    BITFIELD_BEGIN(BCM5719_NVM_H_uint32_t, bits)
#if defined(__LITTLE_ENDIAN__)
        /** @brief Flash write enable command when device with protection function is used. This command will be issued by the flash interface state machine through SPI interface. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, WriteEnableCommand, 0, 8)
        /** @brief Flash write disable command when device with protection function is used. This command will be issued by the flash interface state machine through SPI interface. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, WriteDisableCommand, 8, 8)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_31_16, 16, 16)
#elif defined(__BIG_ENDIAN__)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_31_16, 16, 16)
        /** @brief Flash write disable command when device with protection function is used. This command will be issued by the flash interface state machine through SPI interface. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, WriteDisableCommand, 8, 8)
        /** @brief Flash write enable command when device with protection function is used. This command will be issued by the flash interface state machine through SPI interface. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, WriteEnableCommand, 0, 8)
#else
#error Unknown Endian
#endif
    BITFIELD_END(BCM5719_NVM_H_uint32_t, bits)
#ifdef CXX_SIMULATOR
    /** @brief Register name for use with the simulator. */
    const char* getName(void) { return "NvmWrite1"; }

    /** @brief Print register value. */
    void print(void) { r32.print(); }

    RegNVMNvmWrite1_t()
    {
        /** @brief constructor for @ref NVM_t.NvmWrite1. */
        r32.setName("NvmWrite1");
        bits.WriteEnableCommand.setBaseRegister(&r32);
        bits.WriteEnableCommand.setName("WriteEnableCommand");
        bits.WriteDisableCommand.setBaseRegister(&r32);
        bits.WriteDisableCommand.setName("WriteDisableCommand");
    }
    RegNVMNvmWrite1_t& operator=(const RegNVMNvmWrite1_t& other)
    {
        r32 = other.r32;
        return *this;
    }
#endif /* CXX_SIMULATOR */
} RegNVMNvmWrite1_t;

#define REG_NVM_ARBITRATION_WATCHDOG ((volatile BCM5719_NVM_H_uint32_t*)0xc000702c) /*  */
#define     NVM_ARBITRATION_WATCHDOG_RESERVED_SHIFT 0u
#define     NVM_ARBITRATION_WATCHDOG_RESERVED_MASK  0xffffffffu
#define GET_NVM_ARBITRATION_WATCHDOG_RESERVED(__reg__)  (((__reg__) & 0xffffffff) >> 0u)
#define SET_NVM_ARBITRATION_WATCHDOG_RESERVED(__val__)  (((__val__) << 0u) & 0xffffffffu)

/** @brief Register definition for @ref NVM_t.ArbitrationWatchdog. */
typedef register_container RegNVMArbitrationWatchdog_t {
    /** @brief 32bit direct register access. */
    BCM5719_NVM_H_uint32_t r32;

    BITFIELD_BEGIN(BCM5719_NVM_H_uint32_t, bits)
#if defined(__LITTLE_ENDIAN__)
        /** @brief Reserved */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved, 0, 32)
#elif defined(__BIG_ENDIAN__)
        /** @brief Reserved */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved, 0, 32)
#else
#error Unknown Endian
#endif
    BITFIELD_END(BCM5719_NVM_H_uint32_t, bits)
#ifdef CXX_SIMULATOR
    /** @brief Register name for use with the simulator. */
    const char* getName(void) { return "ArbitrationWatchdog"; }

    /** @brief Print register value. */
    void print(void) { r32.print(); }

    RegNVMArbitrationWatchdog_t()
    {
        /** @brief constructor for @ref NVM_t.ArbitrationWatchdog. */
        r32.setName("ArbitrationWatchdog");
        bits.reserved.setBaseRegister(&r32);
        bits.reserved.setName("reserved");
    }
    RegNVMArbitrationWatchdog_t& operator=(const RegNVMArbitrationWatchdog_t& other)
    {
        r32 = other.r32;
        return *this;
    }
#endif /* CXX_SIMULATOR */
} RegNVMArbitrationWatchdog_t;

#define REG_NVM_AUTO_SENSE_STATUS ((volatile BCM5719_NVM_H_uint32_t*)0xc0007038) /*  */
#define     NVM_AUTO_SENSE_STATUS_AUTO_CONFIG_BUSY_SHIFT 0u
#define     NVM_AUTO_SENSE_STATUS_AUTO_CONFIG_BUSY_MASK  0x1u
#define GET_NVM_AUTO_SENSE_STATUS_AUTO_CONFIG_BUSY(__reg__)  (((__reg__) & 0x1) >> 0u)
#define SET_NVM_AUTO_SENSE_STATUS_AUTO_CONFIG_BUSY(__val__)  (((__val__) << 0u) & 0x1u)
#define     NVM_AUTO_SENSE_STATUS_AUTO_CONFIG_ENABLE_SHIFT 4u
#define     NVM_AUTO_SENSE_STATUS_AUTO_CONFIG_ENABLE_MASK  0x10u
#define GET_NVM_AUTO_SENSE_STATUS_AUTO_CONFIG_ENABLE(__reg__)  (((__reg__) & 0x10) >> 4u)
#define SET_NVM_AUTO_SENSE_STATUS_AUTO_CONFIG_ENABLE(__val__)  (((__val__) << 4u) & 0x10u)
#define     NVM_AUTO_SENSE_STATUS_AUTO_CONFIG_SUCCESSFUL_SHIFT 5u
#define     NVM_AUTO_SENSE_STATUS_AUTO_CONFIG_SUCCESSFUL_MASK  0x20u
#define GET_NVM_AUTO_SENSE_STATUS_AUTO_CONFIG_SUCCESSFUL(__reg__)  (((__reg__) & 0x20) >> 5u)
#define SET_NVM_AUTO_SENSE_STATUS_AUTO_CONFIG_SUCCESSFUL(__val__)  (((__val__) << 5u) & 0x20u)
#define     NVM_AUTO_SENSE_STATUS_AUTO_CONFIG_STATE_SHIFT 8u
#define     NVM_AUTO_SENSE_STATUS_AUTO_CONFIG_STATE_MASK  0x1f00u
#define GET_NVM_AUTO_SENSE_STATUS_AUTO_CONFIG_STATE(__reg__)  (((__reg__) & 0x1f00) >> 8u)
#define SET_NVM_AUTO_SENSE_STATUS_AUTO_CONFIG_STATE(__val__)  (((__val__) << 8u) & 0x1f00u)
#define     NVM_AUTO_SENSE_STATUS_AUTO_DETECTED_DEVICE_ID_SHIFT 16u
#define     NVM_AUTO_SENSE_STATUS_AUTO_DETECTED_DEVICE_ID_MASK  0x1f0000u
#define GET_NVM_AUTO_SENSE_STATUS_AUTO_DETECTED_DEVICE_ID(__reg__)  (((__reg__) & 0x1f0000) >> 16u)
#define SET_NVM_AUTO_SENSE_STATUS_AUTO_DETECTED_DEVICE_ID(__val__)  (((__val__) << 16u) & 0x1f0000u)
#define     NVM_AUTO_SENSE_STATUS_AUTO_DETECTED_DEVICE_ID_AT45DB041D 0x0u
#define     NVM_AUTO_SENSE_STATUS_AUTO_DETECTED_DEVICE_ID_AT45DB021D 0x3u
#define     NVM_AUTO_SENSE_STATUS_AUTO_DETECTED_DEVICE_ID_AT45DB011D 0x4u
#define     NVM_AUTO_SENSE_STATUS_AUTO_DETECTED_DEVICE_ID_STM25PE40 0x8u
#define     NVM_AUTO_SENSE_STATUS_AUTO_DETECTED_DEVICE_ID_STM25PE20 0xau
#define     NVM_AUTO_SENSE_STATUS_AUTO_DETECTED_DEVICE_ID_STM25PE10 0xbu
#define     NVM_AUTO_SENSE_STATUS_AUTO_DETECTED_DEVICE_ID_STM45PE10 0xcu
#define     NVM_AUTO_SENSE_STATUS_AUTO_DETECTED_DEVICE_ID_STM45PE20 0xdu
#define     NVM_AUTO_SENSE_STATUS_AUTO_DETECTED_DEVICE_ID_STM45PE40 0xeu


/** @brief Register definition for @ref NVM_t.AutoSenseStatus. */
typedef register_container RegNVMAutoSenseStatus_t {
    /** @brief 32bit direct register access. */
    BCM5719_NVM_H_uint32_t r32;

    BITFIELD_BEGIN(BCM5719_NVM_H_uint32_t, bits)
#if defined(__LITTLE_ENDIAN__)
        /** @brief Auto Configuration Busy */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, AutoConfigBusy, 0, 1)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_3_1, 1, 3)
        /** @brief Auto config feature is enabled through pin strap. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, AutoConfigEnable, 4, 1)
        /** @brief Auto config is successful. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, AutoConfigSuccessful, 5, 1)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_7_6, 6, 2)
        /** @brief Auto Config FSM state. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, AutoConfigState, 8, 5)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_15_13, 13, 3)
        /** @brief Auto detected device ID. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, AutoDetectedDeviceID, 16, 5)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_31_21, 21, 11)
#elif defined(__BIG_ENDIAN__)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_31_21, 21, 11)
        /** @brief Auto detected device ID. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, AutoDetectedDeviceID, 16, 5)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_15_13, 13, 3)
        /** @brief Auto Config FSM state. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, AutoConfigState, 8, 5)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_7_6, 6, 2)
        /** @brief Auto config is successful. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, AutoConfigSuccessful, 5, 1)
        /** @brief Auto config feature is enabled through pin strap. */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, AutoConfigEnable, 4, 1)
        /** @brief Padding */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, reserved_3_1, 1, 3)
        /** @brief Auto Configuration Busy */
        BITFIELD_MEMBER(BCM5719_NVM_H_uint32_t, AutoConfigBusy, 0, 1)
#else
#error Unknown Endian
#endif
    BITFIELD_END(BCM5719_NVM_H_uint32_t, bits)
#ifdef CXX_SIMULATOR
    /** @brief Register name for use with the simulator. */
    const char* getName(void) { return "AutoSenseStatus"; }

    /** @brief Print register value. */
    void print(void) { r32.print(); }

    RegNVMAutoSenseStatus_t()
    {
        /** @brief constructor for @ref NVM_t.AutoSenseStatus. */
        r32.setName("AutoSenseStatus");
        bits.AutoConfigBusy.setBaseRegister(&r32);
        bits.AutoConfigBusy.setName("AutoConfigBusy");
        bits.AutoConfigEnable.setBaseRegister(&r32);
        bits.AutoConfigEnable.setName("AutoConfigEnable");
        bits.AutoConfigSuccessful.setBaseRegister(&r32);
        bits.AutoConfigSuccessful.setName("AutoConfigSuccessful");
        bits.AutoConfigState.setBaseRegister(&r32);
        bits.AutoConfigState.setName("AutoConfigState");
        bits.AutoDetectedDeviceID.setBaseRegister(&r32);
        bits.AutoDetectedDeviceID.setName("AutoDetectedDeviceID");
    }
    RegNVMAutoSenseStatus_t& operator=(const RegNVMAutoSenseStatus_t& other)
    {
        r32 = other.r32;
        return *this;
    }
#endif /* CXX_SIMULATOR */
} RegNVMAutoSenseStatus_t;

/** @brief Component definition for @ref NVM. */
typedef struct NVM_t {
    /** @brief  */
    RegNVMCommand_t Command;

    /** @brief Reserved bytes to pad out data structure. */
    BCM5719_NVM_H_uint32_t reserved_4[1];

    /** @brief 32bits of write data are used when write commands are executed. */
    RegNVMWrite_t Write;

    /** @brief The 24 bit address for a read or write operation (must be 4 byte aligned). */
    RegNVMAddr_t Addr;

    /** @brief 32bits of read data are used when read commands are executed. */
    RegNVMRead_t Read;

    /** @brief  */
    RegNVMNvmCfg1_t NvmCfg1;

    /** @brief  */
    RegNVMNvmCfg2_t NvmCfg2;

    /** @brief  */
    RegNVMNvmCfg3_t NvmCfg3;

    /** @brief  */
    RegNVMSoftwareArbitration_t SoftwareArbitration;

    /** @brief  */
    RegNVMAccess_t Access;

    /** @brief  */
    RegNVMNvmWrite1_t NvmWrite1;

    /** @brief  */
    RegNVMArbitrationWatchdog_t ArbitrationWatchdog;

    /** @brief Reserved bytes to pad out data structure. */
    BCM5719_NVM_H_uint32_t reserved_48[2];

    /** @brief  */
    RegNVMAutoSenseStatus_t AutoSenseStatus;

#ifdef CXX_SIMULATOR
    NVM_t()
    {
        Command.r32.setComponentOffset(0x0);
        Write.r32.setComponentOffset(0x8);
        Addr.r32.setComponentOffset(0xc);
        Read.r32.setComponentOffset(0x10);
        NvmCfg1.r32.setComponentOffset(0x14);
        NvmCfg2.r32.setComponentOffset(0x18);
        NvmCfg3.r32.setComponentOffset(0x1c);
        SoftwareArbitration.r32.setComponentOffset(0x20);
        Access.r32.setComponentOffset(0x24);
        NvmWrite1.r32.setComponentOffset(0x28);
        ArbitrationWatchdog.r32.setComponentOffset(0x2c);
        AutoSenseStatus.r32.setComponentOffset(0x38);
    }
    typedef uint32_t (*callback_t)(uint32_t, uint32_t, void*);
    callback_t mIndexReadCallback;
    void* mIndexReadCallbackArgs;

    callback_t mIndexWriteCallback;
    void* mIndexWriteCallbackArgs;

    uint32_t read(int offset) { return mIndexReadCallback(0, offset, mIndexReadCallbackArgs); }
    void write(int offset, uint32_t value) { (void)mIndexWriteCallback(value, offset, mIndexWriteCallbackArgs); }
#endif /* CXX_SIMULATOR */
} NVM_t;

/** @brief Non-Volatile Memory Registers */
extern volatile NVM_t NVM;



#ifdef CXX_SIMULATOR /* Compiling c++ code - uses register wrappers */
#undef volatile
#endif /* CXX_SIMULATOR */

#undef register_container
#undef BITFIELD_BEGIN
#undef BITFIELD_MEMBER
#undef BITFIELD_END

#endif /* !BCM5719_NVM_H */

/** @} */
OpenPOWER on IntegriCloud