Chameleon-Mini
DESFireFirmwareSettings.h
1 /*
2 The DESFire stack portion of this firmware source
3 is free software written by Maxie Dion Schmidt (@maxieds):
4 You can redistribute it and/or modify
5 it under the terms of this license.
6 
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 
11 The complete source distribution of
12 this firmware is available at the following link:
13 https://github.com/maxieds/ChameleonMiniFirmwareDESFireStack.
14 
15 Based in part on the original DESFire code created by
16 @dev-zzo (GitHub handle) [Dmitry Janushkevich] available at
17 https://github.com/dev-zzo/ChameleonMini/tree/desfire.
18 
19 This notice must be retained at the top of all source files where indicated.
20 */
21 
22 /*
23  * DESFireFirmwareSettings.h :
24  * Maxie D. Schmidt (github.com/maxieds)
25  */
26 
27 #ifndef __DESFIRE_FIRMWARE_SETTINGS_H__
28 #define __DESFIRE_FIRMWARE_SETTINGS_H__
29 
30 #include <stdint.h>
31 #include <stdbool.h>
32 
33 #include "../../Common.h"
34 
35 #define DESFIRE_FIRMWARE_DEBUGGING (1)
36 
37 #define DESFIRE_FIRMWARE_BUILD_TIMESTAMP (BUILD_DATE)
38 #define DESFIRE_FIRMWARE_GIT_COMMIT_ID (COMMIT_ID)
39 #define DESFIRE_FIRMWARE_REVISION ("0.0.2")
40 #define DESFIRE_FIRMWARE_PICC_LAYOUT_REVISION (0x02)
41 
42 #define DESFIRE_LITTLE_ENDIAN (1)
43 
44 #define DESFIRE_PICC_STRUCT_PACKING //__attribute__((aligned(1)))
45 #define DESFIRE_FIRMWARE_PACKING __attribute__((packed))
46 #define DESFIRE_FIRMWARE_ALIGNAT __attribute__((aligned(1)))
47 #define DESFIRE_PICC_ARRAY_ALIGNAT //__attribute__((aligned(1)))
48 #define DESFIRE_FIRMWARE_ARRAY_ALIGNAT //__attribute__((aligned(1)))
49 #define DESFIRE_FIRMWARE_ENUM_PACKING //__attribute__((aligned(1)))
50 #define DESFIRE_FIRMWARE_NOINIT //__attribute__ ((section (".noinit")))
51 
52 /* Some standard boolean interpreted and other values for types and return values: */
53 typedef int BOOL;
54 typedef uint8_t BYTE;
55 typedef uint16_t NIBBLE;
56 typedef uint16_t SIZET;
57 typedef uint32_t UINT;
58 
59 #define TRUE ((BOOL) 0x01)
60 #define FALSE ((BOOL) 0x00)
61 
62 #define IsTrue(rcond) (rcond != FALSE)
63 #define IsFalse(rcond) (rcond == FALSE)
64 
65 /* Allow users to modify typically reserved and protected read-only data on the tag
66  like the manufacturer bytes and the serial number (set in Makefile)? */
67 #ifdef ENABLE_PERMISSIVE_DESFIRE_SETTINGS
68 #define DESFIRE_ALLOW_PROTECTED_MODIFY (1)
69 #else
70 #define DESFIRE_ALLOW_PROTECTED_MODIFY (0)
71 #endif
72 
73 /* Whether to auto select application ID and file before the user (input system)
74  even invokes an ISO SELECT APPLICATION [0x00 0xa4 0x04] command? */
75 #define DESFIRE_LEGACY_SUPPORT (0)
76 
77 #endif