71 k_user_target_prologue = (1U<<8),
83 k_user_target_miniloguexd = (2U<<8),
95 k_user_target_nutektdigital = (3U<<8),
104 #define USER_TARGET_PLATFORM (k_user_target_nutektdigital)
105 #define USER_TARGET_PLATFORM_MASK (0x7F<<8)
106 #define USER_TARGET_MODULE_MASK (0x7F)
109 #define USER_TARGET_PLATFORM_IS_COMPAT(tgt) \
110 ((((tgt)&USER_TARGET_PLATFORM_MASK)==k_user_target_prologue) \
111 || (((tgt)&USER_TARGET_PLATFORM_MASK)==k_user_target_miniloguexd) \
112 || (((tgt)&USER_TARGET_PLATFORM_MASK)==k_user_target_nutektdigital))
122 k_user_api_1_0_0 = ((1U<<16) | (0U<<8) | (0U)),
123 k_user_api_1_1_0 = ((1U<<16) | (1U<<8) | (0U))
127 #define USER_API_VERSION (k_user_api_1_1_0)
128 #define USER_API_MAJOR_MASK (0x7F<<16)
129 #define USER_API_MINOR_MASK (0x7F<<8)
130 #define USER_API_PATCH_MASK (0x7F)
131 #define USER_API_MAJOR(v) ((v)>>16 & 0x7F)
132 #define USER_API_MINOR(v) ((v)>>8 & 0x7F)
133 #define USER_API_PATCH(v) ((v) & 0x7F)
136 #define USER_API_IS_COMPAT(api) \
137 ((((api) & USER_API_MAJOR_MASK) == (USER_API_VERSION & USER_API_MAJOR_MASK)) \
138 && (((api) & USER_API_MINOR_MASK) <= (USER_API_VERSION & USER_API_MINOR_MASK)))
141 #define USER_PRG_HEADER_SIZE (0x400) // 1KB
144 #define USER_PRG_SIG_SIZE (0x84) // 132B - can fit ECDSA sig using secp521r1
147 #define USER_PRG_MAX_PARAM_COUNT (6)
150 #define USER_PRG_PARAM_MIN_LIMIT (-100)
153 #define USER_PRG_PARAM_MAX_LIMIT (100)
156 #define USER_PRG_PARAM_NAME_LEN (12)
159 #define USER_PRG_NAME_LEN (13)
163 k_user_prg_param_type_percent = 0,
164 k_user_prg_param_type_percent_bipolar,
165 k_user_prg_param_type_select,
166 k_user_prg_param_type_count
170 #pragma pack(push, 1)
171 typedef struct user_prg_param {
175 char name[USER_PRG_PARAM_NAME_LEN+1];
180 #pragma pack(push, 1)
181 typedef struct user_prg_header {
187 char name[USER_PRG_NAME_LEN+1];
189 user_prg_param_t params[USER_PRG_MAX_PARAM_COUNT];
190 uint8_t pad[USER_PRG_HEADER_SIZE-40-USER_PRG_MAX_PARAM_COUNT*
sizeof(user_prg_param_t)];
197 #pragma pack(push, 1)
198 typedef struct user_prg_sig {
199 uint8_t pad[USER_PRG_SIG_SIZE];
207 #endif // __userprg_h