Software APIs
multibits.h
1 // Copyright lowRISC contributors (OpenTitan project).
2 // Licensed under the Apache License, Version 2.0, see LICENSE for details.
3 // SPDX-License-Identifier: Apache-2.0
4 
5 #ifndef OPENTITAN_SW_DEVICE_LIB_BASE_MULTIBITS_H_
6 #define OPENTITAN_SW_DEVICE_LIB_BASE_MULTIBITS_H_
7 
8 /**
9  * Multi-bit boolean values
10  *
11  * Certain configuration fields in the design are multi-bits.
12  * This gives the configuration fields redundancy and ensures
13  * it is difficult to fault the values to a "good" state.
14  */
15 typedef enum multi_bit_bool {
16 
17  /**
18  * 4-bits boolean values
19  */
20  kMultiBitBool4True = 0x6,
21  kMultiBitBool4False = 0x9,
22 
23  /**
24  * 8-bits boolean values
25  */
26  kMultiBitBool8True = 0x96,
27  kMultiBitBool8False = 0x69,
28 
29  /**
30  * 12-bits boolean values
31  */
32  kMultiBitBool12True = 0x696,
33  kMultiBitBool12False = 0x969,
34 
35  /**
36  * 16-bits boolean values
37  */
38  kMultiBitBool16True = 0x9696,
39  kMultiBitBool16False = 0x6969,
40 
41  /**
42  * 20-bits boolean values
43  */
44  kMultiBitBool20True = 0x69696,
45  kMultiBitBool20False = 0x96969,
46 
47  /**
48  * 24-bits boolean values
49  */
50  kMultiBitBool24True = 0x969696,
51  kMultiBitBool24False = 0x696969,
52 
53  /**
54  * 28-bits boolean values
55  */
56  kMultiBitBool28True = 0x6969696,
57  kMultiBitBool28False = 0x9696969,
58 
59  /**
60  * 32-bits boolean values
61  */
62  kMultiBitBool32True = 0x96969696,
63  kMultiBitBool32False = 0x69696969,
64 
65 } multi_bit_bool_t;
66 
67 #endif // OPENTITAN_SW_DEVICE_LIB_BASE_MULTIBITS_H_