2020-12-06 06:47:03 +08:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Copyright (C) 2020 sirloins
|
|
|
|
//
|
|
|
|
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
|
|
|
|
// at your option, any later version. See the LICENSE.txt file for the text of
|
|
|
|
// the license.
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Low frequency EM4x70 structs
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#ifndef EM4X70_H__
|
|
|
|
#define EM4X70_H__
|
|
|
|
|
2020-12-12 12:26:17 +08:00
|
|
|
#define EM4X70_NUM_BLOCKS 16
|
|
|
|
|
2020-12-16 00:22:43 +08:00
|
|
|
// Common word/block addresses
|
|
|
|
#define EM4X70_PIN_WORD_LOWER 10
|
|
|
|
#define EM4X70_PIN_WORD_UPPER 11
|
|
|
|
|
2020-12-06 06:47:03 +08:00
|
|
|
typedef struct {
|
|
|
|
bool parity;
|
2020-12-12 12:26:17 +08:00
|
|
|
|
|
|
|
// Used for writing address
|
|
|
|
uint8_t address;
|
|
|
|
uint16_t word;
|
2020-12-12 14:20:26 +08:00
|
|
|
|
|
|
|
// PIN to unlock
|
|
|
|
uint32_t pin;
|
|
|
|
|
2020-12-12 22:59:30 +08:00
|
|
|
// Used for authentication
|
|
|
|
uint8_t rnd[7];
|
|
|
|
uint8_t frnd[4];
|
|
|
|
|
2020-12-16 01:32:30 +08:00
|
|
|
// Used to write new key
|
|
|
|
uint8_t crypt_key[12];
|
|
|
|
|
2020-12-09 05:40:24 +08:00
|
|
|
} em4x70_data_t;
|
2020-12-06 06:47:03 +08:00
|
|
|
|
|
|
|
#endif /* EM4X70_H__ */
|