From 3c0435cde19781c4710360ffd4ed4760f63eea5e Mon Sep 17 00:00:00 2001 From: Georg Date: Wed, 12 Jul 2017 11:27:20 +0200 Subject: [PATCH] doxygen update --- Doc/Doxygen/html/Page_14443AReader.html | 11 +++++++++-- Doc/Doxygen/html/Page_Buttons.html | 2 +- Doc/Doxygen/html/Page_CommandLine.html | 6 ++++-- Doc/Doxygen/html/Page_Configurations.html | 2 +- Doc/Doxygen/html/Page_GettingStarted.html | 2 +- Doc/Doxygen/html/Page_LED.html | 2 +- Doc/Doxygen/html/Page_LEDs.html | 2 +- Doc/Doxygen/html/Page_Log.html | 2 +- Doc/Doxygen/html/Page_Settings.html | 2 +- Doc/Doxygen/html/Page_UploadingDownloading.html | 2 +- Doc/Doxygen/html/_antenna_level_8h_source.html | 2 +- Doc/Doxygen/html/_application_8h_source.html | 2 +- Doc/Doxygen/html/_battery_8h_source.html | 2 +- Doc/Doxygen/html/_button_8h_source.html | 2 +- Doc/Doxygen/html/_buttons_8txt.html | 2 +- Doc/Doxygen/html/_chameleon-_mini_8h_source.html | 2 +- Doc/Doxygen/html/_codec_8h_source.html | 4 ++-- Doc/Doxygen/html/_command_line_8h_source.html | 2 +- Doc/Doxygen/html/_command_line_8txt.html | 2 +- Doc/Doxygen/html/_commands_8h_source.html | 4 ++-- Doc/Doxygen/html/_common_8h_source.html | 2 +- Doc/Doxygen/html/_configuration_8h.html | 2 +- Doc/Doxygen/html/_configuration_8h_source.html | 2 +- Doc/Doxygen/html/_configurations_8txt.html | 2 +- Doc/Doxygen/html/_crypto1_8h_source.html | 4 ++-- Doc/Doxygen/html/_getting_started_8txt.html | 2 +- Doc/Doxygen/html/_i_s_o14443-2_a_8h_source.html | 2 +- Doc/Doxygen/html/_i_s_o14443-3_a_8h_source.html | 2 +- Doc/Doxygen/html/_l_e_d_8h_source.html | 2 +- Doc/Doxygen/html/_l_e_d_8txt.html | 2 +- Doc/Doxygen/html/_l_e_d_hook_8h_source.html | 2 +- Doc/Doxygen/html/_l_e_ds_8txt.html | 2 +- Doc/Doxygen/html/_l_u_f_a_config_8h.html | 2 +- Doc/Doxygen/html/_l_u_f_a_config_8h_source.html | 2 +- Doc/Doxygen/html/_l_u_f_a_descriptors_8c.html | 2 +- Doc/Doxygen/html/_l_u_f_a_descriptors_8h.html | 2 +- Doc/Doxygen/html/_l_u_f_a_descriptors_8h_source.html | 2 +- Doc/Doxygen/html/_log_8h.html | 2 +- Doc/Doxygen/html/_log_8h_source.html | 2 +- Doc/Doxygen/html/_log_8txt.html | 2 +- Doc/Doxygen/html/_main_page_8txt.html | 2 +- Doc/Doxygen/html/_map_8h_source.html | 2 +- Doc/Doxygen/html/_memory_8h_source.html | 2 +- Doc/Doxygen/html/_mifare_classic_8h_source.html | 2 +- Doc/Doxygen/html/_mifare_ultralight_8h_source.html | 2 +- Doc/Doxygen/html/_random_8h_source.html | 2 +- Doc/Doxygen/html/_reader14443-2_a_8h_source.html | 2 +- Doc/Doxygen/html/_reader14443_a_8h_source.html | 4 ++-- Doc/Doxygen/html/_reader_8txt.html | 2 +- Doc/Doxygen/html/_settings_8h.html | 2 +- Doc/Doxygen/html/_settings_8h_source.html | 2 +- Doc/Doxygen/html/_settings_8txt.html | 2 +- Doc/Doxygen/html/_system_8h_source.html | 2 +- Doc/Doxygen/html/_terminal_8h_source.html | 2 +- Doc/Doxygen/html/_uploading_downloading_8txt.html | 2 +- Doc/Doxygen/html/_x_modem_8h_source.html | 2 +- Doc/Doxygen/html/annotated.html | 2 +- Doc/Doxygen/html/classes.html | 2 +- .../html/dir_5de29d499bb29a41092979d00d22c134.html | 2 +- .../html/dir_74b6a3b63f61c160c0f14b7a283a4c9b.html | 2 +- .../html/dir_8465ec698d237f801ae9966d4551fcfa.html | 2 +- .../html/dir_ddeffaa734f77525428b0dd4068da9cb.html | 2 +- .../html/dir_f5aab302412c0352d69464400cc5ee44.html | 2 +- Doc/Doxygen/html/files.html | 2 +- Doc/Doxygen/html/functions.html | 2 +- Doc/Doxygen/html/functions_vars.html | 2 +- Doc/Doxygen/html/globals.html | 2 +- Doc/Doxygen/html/globals_defs.html | 2 +- Doc/Doxygen/html/globals_enum.html | 2 +- Doc/Doxygen/html/globals_eval.html | 2 +- Doc/Doxygen/html/globals_func.html | 2 +- Doc/Doxygen/html/globals_vars.html | 2 +- Doc/Doxygen/html/index.html | 2 +- Doc/Doxygen/html/pages.html | 2 +- .../html/struct_configuration_type-members.html | 2 +- Doc/Doxygen/html/struct_configuration_type.html | 2 +- .../html/struct_settings_entry_type-members.html | 2 +- Doc/Doxygen/html/struct_settings_entry_type.html | 2 +- ...u_s_b___descriptor___configuration__t-members.html | 2 +- .../struct_u_s_b___descriptor___configuration__t.html | 2 +- Doc/DoxygenPages/CommandLine.txt | 3 ++- Doc/DoxygenPages/Reader.txt | 10 ++++++++++ 82 files changed, 107 insertions(+), 87 deletions(-) diff --git a/Doc/Doxygen/html/Page_14443AReader.html b/Doc/Doxygen/html/Page_14443AReader.html index 18eada9..8152b5c 100644 --- a/Doc/Doxygen/html/Page_14443AReader.html +++ b/Doc/Doxygen/html/Page_14443AReader.html @@ -155,12 +155,19 @@ Each of the following commands returns INVALID COMMAND USAGE on a n

If this command is called within the reader configuration, it ends in one of three ways:

  1. Return code 101:OK WITH TEXT, the card type and ATQA value, UID value and SAK value of the highest cascade level.
  2. Return code 101:OK WITH TEXT, the information that this card type is unknown to the ChameleonMini ("Unknown card.") and ATQA value, UID value and SAK value of the highest cascade level.
  3. -
  4. Timeout (no matter if on setting/configuration change or on real timeout).
  5. +
  6. Timeout (no matter if on setting/configuration change or on real timeout).
+

AUTOCALIBRATE

+

This is a timeout command. Tries to select to a card with every threshold within a range with a specific step size and chooses the best threshold.

+

If this command is called within the reader configuration, it ends in one of the following ways:

    +
  1. Return code 101:OK WITH TEXT and a list of the tested thresholds with a + for every threshold where the select protocol was successful and a - if the select protocol was not successfully finished.
  2. +
  3. Timeout (no matter if on setting/configuration change or on real timeout).
  4. +
+
Note
If no working threshold was found, the threshold is reset to the standard threshold.
diff --git a/Doc/Doxygen/html/Page_Buttons.html b/Doc/Doxygen/html/Page_Buttons.html index 0fc6748..07ee3b8 100644 --- a/Doc/Doxygen/html/Page_Buttons.html +++ b/Doc/Doxygen/html/Page_Buttons.html @@ -125,7 +125,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/Page_CommandLine.html b/Doc/Doxygen/html/Page_CommandLine.html index 414c333..c5547f0 100644 --- a/Doc/Doxygen/html/Page_CommandLine.html +++ b/Doc/Doxygen/html/Page_CommandLine.html @@ -249,7 +249,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); DUMP_MFU Reads the whole content of a Mifare Ultralight card that is in the range of the antenna and returns it. This command is a Timeout command. -IDENTIFY Identifies the type of a card in the range of the antenna and returns it. +IDENTIFY Identifies the type of a card in the range of the antenna and returns it. This command is a Timeout command. THRESHOLD=? Returns the possible number range for the reader threshold. @@ -257,6 +257,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); THRESHOLD? Returns the current reader threshold. +AUTOCALIBRATE Automatically finds a good threshold for communicating with the card that currently is on top of the Chameleon. This command is a Timeout command. + FIELD? Returns whether (1) or not (0) the reader field is active. FIELD=[0;1] Enables/disables the reader field. @@ -284,7 +286,7 @@ When setting the timeout to zero, there is no timeout and thus a process may con diff --git a/Doc/Doxygen/html/Page_Configurations.html b/Doc/Doxygen/html/Page_Configurations.html index 0d19c48..ac93e9b 100644 --- a/Doc/Doxygen/html/Page_Configurations.html +++ b/Doc/Doxygen/html/Page_Configurations.html @@ -121,7 +121,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/Page_GettingStarted.html b/Doc/Doxygen/html/Page_GettingStarted.html index aa59e15..1911b43 100644 --- a/Doc/Doxygen/html/Page_GettingStarted.html +++ b/Doc/Doxygen/html/Page_GettingStarted.html @@ -113,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/Page_LED.html b/Doc/Doxygen/html/Page_LED.html index 457bd4e..3584e29 100644 --- a/Doc/Doxygen/html/Page_LED.html +++ b/Doc/Doxygen/html/Page_LED.html @@ -109,7 +109,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/Page_LEDs.html b/Doc/Doxygen/html/Page_LEDs.html index 7f5b2fb..8785cfa 100644 --- a/Doc/Doxygen/html/Page_LEDs.html +++ b/Doc/Doxygen/html/Page_LEDs.html @@ -113,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/Page_Log.html b/Doc/Doxygen/html/Page_Log.html index c913f9d..766b381 100644 --- a/Doc/Doxygen/html/Page_Log.html +++ b/Doc/Doxygen/html/Page_Log.html @@ -112,7 +112,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/Page_Settings.html b/Doc/Doxygen/html/Page_Settings.html index 55392cb..960823a 100644 --- a/Doc/Doxygen/html/Page_Settings.html +++ b/Doc/Doxygen/html/Page_Settings.html @@ -100,7 +100,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/Page_UploadingDownloading.html b/Doc/Doxygen/html/Page_UploadingDownloading.html index 5f7570b..a68c00f 100644 --- a/Doc/Doxygen/html/Page_UploadingDownloading.html +++ b/Doc/Doxygen/html/Page_UploadingDownloading.html @@ -91,7 +91,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/_antenna_level_8h_source.html b/Doc/Doxygen/html/_antenna_level_8h_source.html index 6069809..6120257 100644 --- a/Doc/Doxygen/html/_antenna_level_8h_source.html +++ b/Doc/Doxygen/html/_antenna_level_8h_source.html @@ -92,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
1 /*
2  * AntennaLevel.h
3  *
4  * Created on: 24.11.2013
5  * Author: skuser
6  */
7 
8 #ifndef ANTENNALEVEL_H_
9 #define ANTENNALEVEL_H_
10 
11 #include "Common.h"
12 
13 #define ANTENNA_LEVEL_R1 47E3
14 #define ANTENNA_LEVEL_R2 1E3
15 #define ANTENNA_LEVEL_VREF 1.0
16 #define ANTENNA_LEVEL_RES 4096
17 #define ANTENNA_LEVEL_OFFSET 190 /* LSB */
18 
19 #define ANTENNA_LEVEL_MILLIVOLT 1E3
20 #define ANTENNA_LEVEL_FACTOR (ANTENNA_LEVEL_VREF * (ANTENNA_LEVEL_R1 + ANTENNA_LEVEL_R2) / (ANTENNA_LEVEL_RES * ANTENNA_LEVEL_R2) )
21 #define ANTENNA_LEVEL_SCALE ((uint32_t) 1<<16)
22 #define ANTENNA_LEVEL_NUMERATOR ((uint32_t) (ANTENNA_LEVEL_MILLIVOLT * ANTENNA_LEVEL_FACTOR * ANTENNA_LEVEL_SCALE + .5))
23 #define ANTENNA_LEVEL_DENOMINATOR (ANTENNA_LEVEL_SCALE)
24 
25 static inline
26 void AntennaLevelInit(void)
27 {
28  ADCA.CTRLA = ADC_ENABLE_bm;
29  ADCA.CTRLB = ADC_RESOLUTION_12BIT_gc;
30  ADCA.REFCTRL = ADC_REFSEL_INT1V_gc | ADC_BANDGAP_bm;
31  ADCA.PRESCALER = ADC_PRESCALER_DIV32_gc;
32  ADCA.CH0.CTRL = ADC_CH_INPUTMODE_SINGLEENDED_gc;
33  ADCA.CH0.MUXCTRL = ADC_CH_MUXPOS_PIN1_gc;
34 
35 }
36 
37 static inline
38 uint16_t AntennaLevelGet(void)
39 {
40  ADCA.CH0.CTRL |= ADC_CH_START_bm;
41  while( !(ADCA.CH0.INTFLAGS & ADC_CH_CHIF_bm) );
42 
43  ADCA.CH0.INTFLAGS = ADC_CH_CHIF_bm;
44 
45  int16_t Result = ADCA.CH0RES - ANTENNA_LEVEL_OFFSET;
46  if (Result < 0) Result = 0;
47 
48  return (uint16_t) (((uint32_t) Result * ANTENNA_LEVEL_NUMERATOR) / ANTENNA_LEVEL_DENOMINATOR);
49 }
50 
51 void AntennaLevelTick(void);
52 void AntennaLevelResetMaxRssi(void);
53 
54 #endif /* ANTENNALEVEL_H_ */
diff --git a/Doc/Doxygen/html/_application_8h_source.html b/Doc/Doxygen/html/_application_8h_source.html index f95b201..d9c32ec 100644 --- a/Doc/Doxygen/html/_application_8h_source.html +++ b/Doc/Doxygen/html/_application_8h_source.html @@ -101,7 +101,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/_battery_8h_source.html b/Doc/Doxygen/html/_battery_8h_source.html index fd0f493..8bd2dd0 100644 --- a/Doc/Doxygen/html/_battery_8h_source.html +++ b/Doc/Doxygen/html/_battery_8h_source.html @@ -92,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
1 /*
2  * Battery.h
3  *
4  * Created on: 20.08.2014
5  * Author: sk
6  */
7 
8 #ifndef BATTERY_H_
9 #define BATTERY_H_
10 
11 #include "Common.h"
12 
13 #define BATTERY_PORT PORTD
14 #define BATTERY_STAT_PIN PIN0_bm
15 #define BATTERY_STAT_PINCTRL PIN0CTRL
16 #define BATTERY_PORT_MASK (BATTERY_STAT_PIN)
17 
18 INLINE void BatteryInit(void) {
19  BATTERY_PORT.DIRCLR = BATTERY_PORT_MASK;
20  BATTERY_PORT.BATTERY_STAT_PINCTRL = PORT_OPC_PULLUP_gc;
21 }
22 
23 INLINE bool BatteryIsCharging(void) {
24  if (!(BATTERY_PORT.IN & BATTERY_STAT_PIN)) {
25  return true;
26  } else {
27  return false;
28  }
29 }
30 
31 #endif /* BATTERY_H_ */
diff --git a/Doc/Doxygen/html/_button_8h_source.html b/Doc/Doxygen/html/_button_8h_source.html index 4bcb54d..4a862ce 100644 --- a/Doc/Doxygen/html/_button_8h_source.html +++ b/Doc/Doxygen/html/_button_8h_source.html @@ -92,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
1 /*
2  * Button.h
3  *
4  * Created on: 13.05.2013
5  * Author: skuser
6  */
7 
8 #ifndef BUTTON_H_
9 #define BUTTON_H_
10 
11 #include "Common.h"
12 
13 typedef enum {
14  BUTTON_R_PRESS_SHORT = 0,
15  BUTTON_R_PRESS_LONG,
16  BUTTON_L_PRESS_SHORT,
17  BUTTON_L_PRESS_LONG,
18 
19  /* Must be last element */
20  BUTTON_TYPE_COUNT
21 } ButtonTypeEnum;
22 
23 typedef enum {
24  BUTTON_ACTION_NONE,
25  BUTTON_ACTION_UID_RANDOM,
26  BUTTON_ACTION_UID_LEFT_INCREMENT,
27  BUTTON_ACTION_UID_RIGHT_INCREMENT,
28  BUTTON_ACTION_UID_LEFT_DECREMENT,
29  BUTTON_ACTION_UID_RIGHT_DECREMENT,
30  BUTTON_ACTION_CYCLE_SETTINGS,
31  BUTTON_ACTION_STORE_MEM,
32  BUTTON_ACTION_RECALL_MEM,
33  BUTTON_ACTION_TOGGLE_FIELD,
34  BUTTON_ACTION_STORE_LOG,
35 
36  /* This has to be last element */
37  BUTTON_ACTION_COUNT
38 } ButtonActionEnum;
39 
40 void ButtonInit(void);
41 void ButtonTick(void);
42 
43 void ButtonGetActionList(char* List, uint16_t BufferSize);
44 void ButtonSetActionById(ButtonTypeEnum Type, ButtonActionEnum Action);
45 void ButtonGetActionByName(ButtonTypeEnum Type, char* Action, uint16_t BufferSize);
46 bool ButtonSetActionByName(ButtonTypeEnum Type, const char* Action);
47 
48 #endif /* BUTTON_H_ */
diff --git a/Doc/Doxygen/html/_buttons_8txt.html b/Doc/Doxygen/html/_buttons_8txt.html index f0f385e..17894e7 100644 --- a/Doc/Doxygen/html/_buttons_8txt.html +++ b/Doc/Doxygen/html/_buttons_8txt.html @@ -88,7 +88,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/_chameleon-_mini_8h_source.html b/Doc/Doxygen/html/_chameleon-_mini_8h_source.html index d00b8ee..85d0c5b 100644 --- a/Doc/Doxygen/html/_chameleon-_mini_8h_source.html +++ b/Doc/Doxygen/html/_chameleon-_mini_8h_source.html @@ -95,7 +95,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/_codec_8h_source.html b/Doc/Doxygen/html/_codec_8h_source.html index f083992..1dbc20e 100644 --- a/Doc/Doxygen/html/_codec_8h_source.html +++ b/Doc/Doxygen/html/_codec_8h_source.html @@ -89,13 +89,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
Codec.h
-
1 /*
2  * CODEC.h
3  *
4  * Created on: 18.02.2013
5  * Author: skuser
6  */
7 
8 #ifndef CODEC_H_
9 #define CODEC_H_
10 
11 #include <avr/io.h>
12 #include <stdint.h>
13 #include <stdbool.h>
14 #include "../Common.h"
15 #include "../Configuration.h"
16 
17 #include "ISO14443-2A.h"
18 #include "Reader14443-2A.h"
19 
20 /* Timing definitions for ISO14443A */
21 #define ISO14443A_SUBCARRIER_DIVIDER 16
22 #define ISO14443A_BIT_GRID_CYCLES 128
23 #define ISO14443A_BIT_RATE_CYCLES 128
24 #define ISO14443A_FRAME_DELAY_PREV1 1236
25 #define ISO14443A_FRAME_DELAY_PREV0 1172
26 #define ISO14443A_RX_PENDING_TIMEOUT 1 // ms
27 
28 /* Peripheral definitions */
29 #define CODEC_DEMOD_POWER_PORT PORTB
30 #define CODEC_DEMOD_POWER_MASK PIN0_bm
31 #define CODEC_DEMOD_IN_PORT PORTB
32 #define CODEC_DEMOD_IN_MASK (CODEC_DEMOD_IN_MASK0 | CODEC_DEMOD_IN_MASK1)
33 #define CODEC_DEMOD_IN_MASK0 PIN1_bm
34 #define CODEC_DEMOD_IN_MASK1 PIN2_bm
35 #define CODEC_DEMOD_IN_PINCTRL0 PIN1CTRL
36 #define CODEC_DEMOD_IN_PINCTRL1 PIN2CTRL
37 #define CODEC_DEMOD_IN_EVMUX0 EVSYS_CHMUX_PORTB_PIN1_gc
38 #define CODEC_DEMOD_IN_EVMUX1 EVSYS_CHMUX_PORTB_PIN2_gc
39 #define CODEC_DEMOD_IN_INT0_VECT PORTB_INT0_vect
40 #define CODEC_LOADMOD_PORT PORTC
41 #define CODEC_LOADMOD_MASK PIN6_bm
42 #define CODEC_CARRIER_IN_PORT PORTC
43 #define CODEC_CARRIER_IN_MASK PIN2_bm
44 #define CODEC_CARRIER_IN_PINCTRL PIN2CTRL
45 #define CODEC_CARRIER_IN_EVMUX EVSYS_CHMUX_PORTC_PIN2_gc
46 #define CODEC_CARRIER_IN_DIV 2 /* external clock division factor */
47 #define CODEC_SUBCARRIER_PORT PORTC
48 #define CODEC_SUBCARRIER_MASK_PSK PIN4_bm
49 #define CODEC_SUBCARRIER_MASK_OOK PIN5_bm
50 #define CODEC_SUBCARRIER_MASK (CODEC_SUBCARRIER_MASK_PSK | CODEC_SUBCARRIER_MASK_OOK)
51 #define CODEC_SUBCARRIER_TIMER TCC1
52 #define CODEC_SUBCARRIER_CC_PSK CCA
53 #define CODEC_SUBCARRIER_CC_OOK CCB
54 #define CODEC_SUBCARRIER_CCEN_PSK TC1_CCAEN_bm
55 #define CODEC_SUBCARRIER_CCEN_OOK TC1_CCBEN_bm
56 #define CODEC_TIMER_SAMPLING TCD0
57 #define CODEC_TIMER_SAMPLING_CCA_VECT TCD0_CCA_vect
58 #define CODEC_TIMER_SAMPLING_CCB_VECT TCD0_CCB_vect
59 #define CODEC_TIMER_LOADMOD TCE0
60 #define CODEC_TIMER_LOADMOD_OVF_VECT TCE0_OVF_vect
61 #define CODEC_TIMER_LOADMOD_CCA_VECT TCE0_CCA_vect
62 #define CODEC_TIMER_LOADMOD_CCB_VECT TCE0_CCB_vect
63 #define CODEC_TIMER_LOADMOD_CCC_VECT TCE0_CCC_vect
64 #define CODEC_TIMER_MODSTART_EVSEL TC_EVSEL_CH0_gc
65 #define CODEC_TIMER_MODEND_EVSEL TC_EVSEL_CH1_gc
66 #define CODEC_TIMER_CARRIER_CLKSEL TC_CLKSEL_EVCH6_gc
67 #define CODEC_READER_TIMER TCC0
68 #define CODEC_READER_PORT PORTC
69 #define CODEC_READER_MASK_LEFT PIN0_bm
70 #define CODEC_READER_MASK_RIGHT PIN1_bm
71 #define CODEC_READER_MASK (CODEC_READER_MASK_LEFT | CODEC_READER_MASK_RIGHT)
72 #define CODEC_READER_PINCTRL_LEFT PIN0CTRL
73 #define CODEC_READER_PINCTRL_RIGHT PIN1CTRL
74 #define CODEC_AC_DEMOD_SETTINGS AC_HSMODE_bm | AC_HYSMODE_NO_gc
75 #define CODEC_MAXIMUM_THRESHOLD 0xFFF // the maximum voltage can be calculated with ch0data * Vref / 0xFFF
76 #define CODEC_TIMER_TIMESTAMPS TCD1
77 #define CODEC_TIMER_TIMESTAMPS_CCA_VECT TCD1_CCA_vect
78 
79 #define CODEC_BUFFER_SIZE 256
80 
81 #define CODEC_CARRIER_FREQ 13560000
82 
83 #define Codec8Reg0 GPIOR0
84 #define Codec8Reg1 GPIOR1
85 #define Codec8Reg2 GPIOR2
86 #define Codec8Reg3 GPIOR3
87 #define CodecCount16Register1 (*((volatile uint16_t*) &GPIOR4)) /* GPIOR4 & GPIOR5 */
88 #define CodecCount16Register2 (*((volatile uint16_t*) &GPIOR6)) /* GPIOR4 & GPIOR5 */
89 #define CodecPtrRegister1 (*((volatile uint8_t**) &GPIOR8))
90 #define CodecPtrRegister2 (*((volatile uint8_t**) &GPIORA))
91 
92 extern uint16_t ReaderThreshold;
93 extern uint16_t Reader_FWT;
94 
95 #define FWI2FWT(x) ((uint32_t)(256 * 16 * ((uint32_t)1 << (x))) / (CODEC_CARRIER_FREQ / 1000) + 1)
96 
97 typedef enum {
98  CODEC_SUBCARRIERMOD_OFF,
99  CODEC_SUBCARRIERMOD_OOK
100 } SubcarrierModType;
101 
102 extern uint8_t CodecBuffer[CODEC_BUFFER_SIZE];
103 
104 INLINE void CodecInit(void) {
105  ActiveConfiguration.CodecInitFunc();
106 }
107 
108 INLINE void CodecDeInit(void) {
109  ActiveConfiguration.CodecDeInitFunc();
110 }
111 
112 INLINE void CodecTask(void) {
113  ActiveConfiguration.CodecTaskFunc();
114 }
115 
116 /* Helper Functions for Codec implementations */
117 INLINE void CodecInitCommon(void)
118 {
119  /* Configure CARRIER input pin and route it to EVSYS.
120  * Multiply by 2 again by using both edges when externally
121  * dividing by 2 */
122 #if CODEC_CARRIER_IN_DIV == 2
123  CODEC_CARRIER_IN_PORT.CODEC_CARRIER_IN_PINCTRL = PORT_ISC_BOTHEDGES_gc;
124 #else
125 #error Option not supported
126 #endif
127  CODEC_CARRIER_IN_PORT.DIRCLR = CODEC_CARRIER_IN_MASK;
128  EVSYS.CH6MUX = CODEC_CARRIER_IN_EVMUX;
129 
130  /* Configure two DEMOD pins for input.
131  * Configure event channel 0 for rising edge (begin of modulation pause)
132  * Configure event channel 1 for falling edge (end of modulation pause) */
133  CODEC_DEMOD_POWER_PORT.OUTCLR = CODEC_DEMOD_POWER_MASK;
134  CODEC_DEMOD_POWER_PORT.DIRSET = CODEC_DEMOD_POWER_MASK;
135  CODEC_DEMOD_IN_PORT.DIRCLR = CODEC_DEMOD_IN_MASK;
136  CODEC_DEMOD_IN_PORT.CODEC_DEMOD_IN_PINCTRL0 = PORT_ISC_RISING_gc;
137  CODEC_DEMOD_IN_PORT.CODEC_DEMOD_IN_PINCTRL1 = PORT_ISC_FALLING_gc;
138  CODEC_DEMOD_IN_PORT.INT0MASK = 0;
139  CODEC_DEMOD_IN_PORT.INTCTRL = PORT_INT0LVL_HI_gc;
140  EVSYS.CH0MUX = CODEC_DEMOD_IN_EVMUX0;
141  EVSYS.CH1MUX = CODEC_DEMOD_IN_EVMUX1;
142 
143  /* Configure loadmod pin configuration and use a virtual port configuration
144  * for single instruction cycle access */
145  CODEC_LOADMOD_PORT.DIRSET = CODEC_LOADMOD_MASK;
146  CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK;
147  PORTCFG.VPCTRLA &= ~PORTCFG_VP0MAP_gm;
148  PORTCFG.VPCTRLA |= PORTCFG_VP02MAP_PORTC_gc;
149 
150  /* Configure subcarrier pins for output */
151  CODEC_SUBCARRIER_PORT.DIRSET = CODEC_SUBCARRIER_MASK;
152  CODEC_SUBCARRIER_PORT.OUTCLR = CODEC_SUBCARRIER_MASK;
153 
154  /* Configure pins for reader field with the LEFT output being inverted
155  * and all bridge outputs static high */
156  CODEC_READER_PORT.CODEC_READER_PINCTRL_LEFT = PORT_INVEN_bm;
157  CODEC_READER_PORT.OUTCLR = CODEC_READER_MASK_LEFT;
158  CODEC_READER_PORT.OUTSET = CODEC_READER_MASK_RIGHT;
159  CODEC_READER_PORT.DIRSET = CODEC_READER_MASK;
160 
161  /* Configure timer for generating reader field and configure AWEX for outputting pattern
162  * with disabled outputs. */
163  CODEC_READER_TIMER.CTRLB = TC0_CCAEN_bm | TC_WGMODE_SINGLESLOPE_gc;
164  CODEC_READER_TIMER.PER = F_CPU / CODEC_CARRIER_FREQ - 1;
165  CODEC_READER_TIMER.CCA = F_CPU / CODEC_CARRIER_FREQ / 2 ;
166 
167  AWEXC.OUTOVEN = 0x00;
168  AWEXC.CTRL = AWEX_CWCM_bm | AWEX_DTICCAEN_bm | AWEX_DTICCBEN_bm;
169 
170  /* Configure DAC for the reference voltage */
171  DACB.EVCTRL = 0;
172  DACB.CTRLB = DAC_CHSEL_SINGLE_gc;
173  DACB.CTRLC = DAC_REFSEL_AVCC_gc;
174  DACB.CTRLA = DAC_IDOEN_bm | DAC_ENABLE_bm;
175  DACB.CH0DATA = ReaderThreshold; // real threshold voltage can be calculated with ch0data * Vref / 0xFFF
176 
177  /* Configure Analog Comparator 0 to detect changes in demodulated reader field */
178  ACA.AC0MUXCTRL = AC_MUXPOS_DAC_gc | AC_MUXNEG_PIN7_gc;
179  ACA.AC0CTRL = CODEC_AC_DEMOD_SETTINGS;
180 
181  /* Configure Analog Comparator 1 to detect SOC */
182  ACA.AC1MUXCTRL = AC_MUXPOS_DAC_gc | AC_MUXNEG_PIN7_gc;
183  ACA.AC1CTRL = CODEC_AC_DEMOD_SETTINGS;
184 }
185 
186 INLINE void CodecSetSubcarrier(SubcarrierModType ModType, uint16_t Divider)
187 {
188  if (ModType == CODEC_SUBCARRIERMOD_OFF) {
189  CODEC_SUBCARRIER_TIMER.CTRLA = TC_CLKSEL_OFF_gc;
190  CODEC_SUBCARRIER_TIMER.CTRLB = 0;
191  } else if (ModType == CODEC_SUBCARRIERMOD_OOK) {
192  /* Configure subcarrier generation with 50% DC output using OOK */
193  CODEC_SUBCARRIER_TIMER.CNT = 0;
194  CODEC_SUBCARRIER_TIMER.PER = Divider - 1;
195  CODEC_SUBCARRIER_TIMER.CODEC_SUBCARRIER_CC_OOK = Divider/2;
196  CODEC_SUBCARRIER_TIMER.CTRLB = CODEC_SUBCARRIER_CCEN_OOK | TC_WGMODE_SINGLESLOPE_gc;
197  }
198 }
199 
200 INLINE void CodecStartSubcarrier(void)
201 {
202  CODEC_SUBCARRIER_TIMER.CTRLA = CODEC_TIMER_CARRIER_CLKSEL;
203 }
204 
205 INLINE void CodecSetDemodPower(bool bOnOff)
206 {
207  if (bOnOff) {
208  CODEC_DEMOD_POWER_PORT.OUTSET = CODEC_DEMOD_POWER_MASK;
209  } else {
210  CODEC_DEMOD_POWER_PORT.OUTCLR = CODEC_DEMOD_POWER_MASK;
211  }
212 }
213 
214 INLINE bool CodecGetLoadmodState(void) {
215  if (ACA.STATUS & AC_AC0STATE_bm) {
216  return true;
217  } else {
218  return false;
219  }
220 }
221 
222 INLINE void CodecSetLoadmodState(bool bOnOff) {
223  if (bOnOff) {
224  VPORT0.OUT |= CODEC_LOADMOD_MASK;
225  } else {
226  VPORT0.OUT &= ~CODEC_LOADMOD_MASK;
227  }
228 }
229 
230 INLINE void CodecSetReaderField(bool bOnOff) { // this is the function for turning on/off the reader field dumbly; before using this function, please consider to use CodecReaderField{Start,Stop}
231 
232  if (bOnOff) {
233  /* Start timer for field generation and unmask outputs */
234  CODEC_READER_TIMER.CTRLA = TC_CLKSEL_DIV1_gc;
235  AWEXC.OUTOVEN = CODEC_READER_MASK;
236  } else {
237  /* Disable outputs of AWEX and stop field generation */
238  AWEXC.OUTOVEN = 0x00;
239  CODEC_READER_TIMER.CTRLA = TC_CLKSEL_OFF_gc;
240  }
241 }
242 
243 INLINE bool CodecGetReaderField(void) {
244  return (CODEC_READER_TIMER.CTRLA == TC_CLKSEL_DIV1_gc) && (AWEXC.OUTOVEN == CODEC_READER_MASK);
245 }
246 
247 void CodecReaderFieldStart(void);
248 void CodecReaderFieldStop(void);
249 bool CodecIsReaderFieldReady(void);
250 
251 void CodecReaderFieldRestart(uint16_t delay);
252 #define FIELD_RESTART() CodecReaderFieldRestart(100)
253 bool CodecIsReaderToBeRestarted(void);
254 #endif /* CODEC_H_ */
void(* CodecInitFunc)(void)
Definition: Configuration.h:57
+
1 /*
2  * CODEC.h
3  *
4  * Created on: 18.02.2013
5  * Author: skuser
6  */
7 
8 #ifndef CODEC_H_
9 #define CODEC_H_
10 
11 #include <avr/io.h>
12 #include <stdint.h>
13 #include <stdbool.h>
14 #include "../Common.h"
15 #include "../Configuration.h"
16 
17 #include "ISO14443-2A.h"
18 #include "Reader14443-2A.h"
19 
20 /* Timing definitions for ISO14443A */
21 #define ISO14443A_SUBCARRIER_DIVIDER 16
22 #define ISO14443A_BIT_GRID_CYCLES 128
23 #define ISO14443A_BIT_RATE_CYCLES 128
24 #define ISO14443A_FRAME_DELAY_PREV1 1236
25 #define ISO14443A_FRAME_DELAY_PREV0 1172
26 #define ISO14443A_RX_PENDING_TIMEOUT 1 // ms
27 
28 /* Peripheral definitions */
29 #define CODEC_DEMOD_POWER_PORT PORTB
30 #define CODEC_DEMOD_POWER_MASK PIN0_bm
31 #define CODEC_DEMOD_IN_PORT PORTB
32 #define CODEC_DEMOD_IN_MASK (CODEC_DEMOD_IN_MASK0 | CODEC_DEMOD_IN_MASK1)
33 #define CODEC_DEMOD_IN_MASK0 PIN1_bm
34 #define CODEC_DEMOD_IN_MASK1 PIN2_bm
35 #define CODEC_DEMOD_IN_PINCTRL0 PIN1CTRL
36 #define CODEC_DEMOD_IN_PINCTRL1 PIN2CTRL
37 #define CODEC_DEMOD_IN_EVMUX0 EVSYS_CHMUX_PORTB_PIN1_gc
38 #define CODEC_DEMOD_IN_EVMUX1 EVSYS_CHMUX_PORTB_PIN2_gc
39 #define CODEC_DEMOD_IN_INT0_VECT PORTB_INT0_vect
40 #define CODEC_LOADMOD_PORT PORTC
41 #define CODEC_LOADMOD_MASK PIN6_bm
42 #define CODEC_CARRIER_IN_PORT PORTC
43 #define CODEC_CARRIER_IN_MASK PIN2_bm
44 #define CODEC_CARRIER_IN_PINCTRL PIN2CTRL
45 #define CODEC_CARRIER_IN_EVMUX EVSYS_CHMUX_PORTC_PIN2_gc
46 #define CODEC_CARRIER_IN_DIV 2 /* external clock division factor */
47 #define CODEC_SUBCARRIER_PORT PORTC
48 #define CODEC_SUBCARRIER_MASK_PSK PIN4_bm
49 #define CODEC_SUBCARRIER_MASK_OOK PIN5_bm
50 #define CODEC_SUBCARRIER_MASK (CODEC_SUBCARRIER_MASK_PSK | CODEC_SUBCARRIER_MASK_OOK)
51 #define CODEC_SUBCARRIER_TIMER TCC1
52 #define CODEC_SUBCARRIER_CC_PSK CCA
53 #define CODEC_SUBCARRIER_CC_OOK CCB
54 #define CODEC_SUBCARRIER_CCEN_PSK TC1_CCAEN_bm
55 #define CODEC_SUBCARRIER_CCEN_OOK TC1_CCBEN_bm
56 #define CODEC_TIMER_SAMPLING TCD0
57 #define CODEC_TIMER_SAMPLING_CCA_VECT TCD0_CCA_vect
58 #define CODEC_TIMER_SAMPLING_CCB_VECT TCD0_CCB_vect
59 #define CODEC_TIMER_LOADMOD TCE0
60 #define CODEC_TIMER_LOADMOD_OVF_VECT TCE0_OVF_vect
61 #define CODEC_TIMER_LOADMOD_CCA_VECT TCE0_CCA_vect
62 #define CODEC_TIMER_LOADMOD_CCB_VECT TCE0_CCB_vect
63 #define CODEC_TIMER_LOADMOD_CCC_VECT TCE0_CCC_vect
64 #define CODEC_TIMER_MODSTART_EVSEL TC_EVSEL_CH0_gc
65 #define CODEC_TIMER_MODEND_EVSEL TC_EVSEL_CH1_gc
66 #define CODEC_TIMER_CARRIER_CLKSEL TC_CLKSEL_EVCH6_gc
67 #define CODEC_READER_TIMER TCC0
68 #define CODEC_READER_PORT PORTC
69 #define CODEC_READER_MASK_LEFT PIN0_bm
70 #define CODEC_READER_MASK_RIGHT PIN1_bm
71 #define CODEC_READER_MASK (CODEC_READER_MASK_LEFT | CODEC_READER_MASK_RIGHT)
72 #define CODEC_READER_PINCTRL_LEFT PIN0CTRL
73 #define CODEC_READER_PINCTRL_RIGHT PIN1CTRL
74 #define CODEC_AC_DEMOD_SETTINGS AC_HSMODE_bm | AC_HYSMODE_NO_gc
75 #define CODEC_MAXIMUM_THRESHOLD 0xFFF // the maximum voltage can be calculated with ch0data * Vref / 0xFFF
76 #define CODEC_THRESHOLD_CALIBRATE_MIN 128
77 #define CODEC_THRESHOLD_CALIBRATE_MAX 1024
78 #define CODEC_THRESHOLD_CALIBRATE_STEPS 8
79 #define CODEC_TIMER_TIMESTAMPS TCD1
80 #define CODEC_TIMER_TIMESTAMPS_CCA_VECT TCD1_CCA_vect
81 
82 #define CODEC_BUFFER_SIZE 256
83 
84 #define CODEC_CARRIER_FREQ 13560000
85 
86 #define Codec8Reg0 GPIOR0
87 #define Codec8Reg1 GPIOR1
88 #define Codec8Reg2 GPIOR2
89 #define Codec8Reg3 GPIOR3
90 #define CodecCount16Register1 (*((volatile uint16_t*) &GPIOR4)) /* GPIOR4 & GPIOR5 */
91 #define CodecCount16Register2 (*((volatile uint16_t*) &GPIOR6)) /* GPIOR4 & GPIOR5 */
92 #define CodecPtrRegister1 (*((volatile uint8_t**) &GPIOR8))
93 #define CodecPtrRegister2 (*((volatile uint8_t**) &GPIORA))
94 
95 extern uint16_t ReaderThreshold;
96 extern uint16_t Reader_FWT;
97 
98 #define FWI2FWT(x) ((uint32_t)(256 * 16 * ((uint32_t)1 << (x))) / (CODEC_CARRIER_FREQ / 1000) + 1)
99 
100 typedef enum {
101  CODEC_SUBCARRIERMOD_OFF,
102  CODEC_SUBCARRIERMOD_OOK
103 } SubcarrierModType;
104 
105 extern uint8_t CodecBuffer[CODEC_BUFFER_SIZE];
106 
107 INLINE void CodecInit(void) {
108  ActiveConfiguration.CodecInitFunc();
109 }
110 
111 INLINE void CodecDeInit(void) {
112  ActiveConfiguration.CodecDeInitFunc();
113 }
114 
115 INLINE void CodecTask(void) {
116  ActiveConfiguration.CodecTaskFunc();
117 }
118 
119 /* Helper Functions for Codec implementations */
120 INLINE void CodecInitCommon(void)
121 {
122  /* Configure CARRIER input pin and route it to EVSYS.
123  * Multiply by 2 again by using both edges when externally
124  * dividing by 2 */
125 #if CODEC_CARRIER_IN_DIV == 2
126  CODEC_CARRIER_IN_PORT.CODEC_CARRIER_IN_PINCTRL = PORT_ISC_BOTHEDGES_gc;
127 #else
128 #error Option not supported
129 #endif
130  CODEC_CARRIER_IN_PORT.DIRCLR = CODEC_CARRIER_IN_MASK;
131  EVSYS.CH6MUX = CODEC_CARRIER_IN_EVMUX;
132 
133  /* Configure two DEMOD pins for input.
134  * Configure event channel 0 for rising edge (begin of modulation pause)
135  * Configure event channel 1 for falling edge (end of modulation pause) */
136  CODEC_DEMOD_POWER_PORT.OUTCLR = CODEC_DEMOD_POWER_MASK;
137  CODEC_DEMOD_POWER_PORT.DIRSET = CODEC_DEMOD_POWER_MASK;
138  CODEC_DEMOD_IN_PORT.DIRCLR = CODEC_DEMOD_IN_MASK;
139  CODEC_DEMOD_IN_PORT.CODEC_DEMOD_IN_PINCTRL0 = PORT_ISC_RISING_gc;
140  CODEC_DEMOD_IN_PORT.CODEC_DEMOD_IN_PINCTRL1 = PORT_ISC_FALLING_gc;
141  CODEC_DEMOD_IN_PORT.INT0MASK = 0;
142  CODEC_DEMOD_IN_PORT.INTCTRL = PORT_INT0LVL_HI_gc;
143  EVSYS.CH0MUX = CODEC_DEMOD_IN_EVMUX0;
144  EVSYS.CH1MUX = CODEC_DEMOD_IN_EVMUX1;
145 
146  /* Configure loadmod pin configuration and use a virtual port configuration
147  * for single instruction cycle access */
148  CODEC_LOADMOD_PORT.DIRSET = CODEC_LOADMOD_MASK;
149  CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK;
150  PORTCFG.VPCTRLA &= ~PORTCFG_VP0MAP_gm;
151  PORTCFG.VPCTRLA |= PORTCFG_VP02MAP_PORTC_gc;
152 
153  /* Configure subcarrier pins for output */
154  CODEC_SUBCARRIER_PORT.DIRSET = CODEC_SUBCARRIER_MASK;
155  CODEC_SUBCARRIER_PORT.OUTCLR = CODEC_SUBCARRIER_MASK;
156 
157  /* Configure pins for reader field with the LEFT output being inverted
158  * and all bridge outputs static high */
159  CODEC_READER_PORT.CODEC_READER_PINCTRL_LEFT = PORT_INVEN_bm;
160  CODEC_READER_PORT.OUTCLR = CODEC_READER_MASK_LEFT;
161  CODEC_READER_PORT.OUTSET = CODEC_READER_MASK_RIGHT;
162  CODEC_READER_PORT.DIRSET = CODEC_READER_MASK;
163 
164  /* Configure timer for generating reader field and configure AWEX for outputting pattern
165  * with disabled outputs. */
166  CODEC_READER_TIMER.CTRLB = TC0_CCAEN_bm | TC_WGMODE_SINGLESLOPE_gc;
167  CODEC_READER_TIMER.PER = F_CPU / CODEC_CARRIER_FREQ - 1;
168  CODEC_READER_TIMER.CCA = F_CPU / CODEC_CARRIER_FREQ / 2 ;
169 
170  AWEXC.OUTOVEN = 0x00;
171  AWEXC.CTRL = AWEX_CWCM_bm | AWEX_DTICCAEN_bm | AWEX_DTICCBEN_bm;
172 
173  /* Configure DAC for the reference voltage */
174  DACB.EVCTRL = 0;
175  DACB.CTRLB = DAC_CHSEL_SINGLE_gc;
176  DACB.CTRLC = DAC_REFSEL_AVCC_gc;
177  DACB.CTRLA = DAC_IDOEN_bm | DAC_ENABLE_bm;
178  DACB.CH0DATA = ReaderThreshold; // real threshold voltage can be calculated with ch0data * Vref / 0xFFF
179 
180  /* Configure Analog Comparator 0 to detect changes in demodulated reader field */
181  ACA.AC0MUXCTRL = AC_MUXPOS_DAC_gc | AC_MUXNEG_PIN7_gc;
182  ACA.AC0CTRL = CODEC_AC_DEMOD_SETTINGS;
183 
184  /* Configure Analog Comparator 1 to detect SOC */
185  ACA.AC1MUXCTRL = AC_MUXPOS_DAC_gc | AC_MUXNEG_PIN7_gc;
186  ACA.AC1CTRL = CODEC_AC_DEMOD_SETTINGS;
187 }
188 
189 INLINE void CodecSetSubcarrier(SubcarrierModType ModType, uint16_t Divider)
190 {
191  if (ModType == CODEC_SUBCARRIERMOD_OFF) {
192  CODEC_SUBCARRIER_TIMER.CTRLA = TC_CLKSEL_OFF_gc;
193  CODEC_SUBCARRIER_TIMER.CTRLB = 0;
194  } else if (ModType == CODEC_SUBCARRIERMOD_OOK) {
195  /* Configure subcarrier generation with 50% DC output using OOK */
196  CODEC_SUBCARRIER_TIMER.CNT = 0;
197  CODEC_SUBCARRIER_TIMER.PER = Divider - 1;
198  CODEC_SUBCARRIER_TIMER.CODEC_SUBCARRIER_CC_OOK = Divider/2;
199  CODEC_SUBCARRIER_TIMER.CTRLB = CODEC_SUBCARRIER_CCEN_OOK | TC_WGMODE_SINGLESLOPE_gc;
200  }
201 }
202 
203 INLINE void CodecStartSubcarrier(void)
204 {
205  CODEC_SUBCARRIER_TIMER.CTRLA = CODEC_TIMER_CARRIER_CLKSEL;
206 }
207 
208 INLINE void CodecSetDemodPower(bool bOnOff)
209 {
210  if (bOnOff) {
211  CODEC_DEMOD_POWER_PORT.OUTSET = CODEC_DEMOD_POWER_MASK;
212  } else {
213  CODEC_DEMOD_POWER_PORT.OUTCLR = CODEC_DEMOD_POWER_MASK;
214  }
215 }
216 
217 INLINE bool CodecGetLoadmodState(void) {
218  if (ACA.STATUS & AC_AC0STATE_bm) {
219  return true;
220  } else {
221  return false;
222  }
223 }
224 
225 INLINE void CodecSetLoadmodState(bool bOnOff) {
226  if (bOnOff) {
227  VPORT0.OUT |= CODEC_LOADMOD_MASK;
228  } else {
229  VPORT0.OUT &= ~CODEC_LOADMOD_MASK;
230  }
231 }
232 
233 INLINE void CodecSetReaderField(bool bOnOff) { // this is the function for turning on/off the reader field dumbly; before using this function, please consider to use CodecReaderField{Start,Stop}
234 
235  if (bOnOff) {
236  /* Start timer for field generation and unmask outputs */
237  CODEC_READER_TIMER.CTRLA = TC_CLKSEL_DIV1_gc;
238  AWEXC.OUTOVEN = CODEC_READER_MASK;
239  } else {
240  /* Disable outputs of AWEX and stop field generation */
241  AWEXC.OUTOVEN = 0x00;
242  CODEC_READER_TIMER.CTRLA = TC_CLKSEL_OFF_gc;
243  }
244 }
245 
246 INLINE bool CodecGetReaderField(void) {
247  return (CODEC_READER_TIMER.CTRLA == TC_CLKSEL_DIV1_gc) && (AWEXC.OUTOVEN == CODEC_READER_MASK);
248 }
249 
250 void CodecReaderFieldStart(void);
251 void CodecReaderFieldStop(void);
252 bool CodecIsReaderFieldReady(void);
253 
254 void CodecReaderFieldRestart(uint16_t delay);
255 #define FIELD_RESTART() CodecReaderFieldRestart(100)
256 bool CodecIsReaderToBeRestarted(void);
257 
258 void CodecThresholdSet(uint16_t th);
259 uint16_t CodecThresholdIncrement(void);
260 void CodecThresholdReset(void);
261 #endif /* CODEC_H_ */
void(* CodecInitFunc)(void)
Definition: Configuration.h:57
void(* CodecTaskFunc)(void)
Definition: Configuration.h:63
void(* CodecDeInitFunc)(void)
Definition: Configuration.h:59
diff --git a/Doc/Doxygen/html/_command_line_8h_source.html b/Doc/Doxygen/html/_command_line_8h_source.html index 7d4e21c..8103e14 100644 --- a/Doc/Doxygen/html/_command_line_8h_source.html +++ b/Doc/Doxygen/html/_command_line_8h_source.html @@ -92,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
1 /*
2  * CommandLine.h
3  *
4  * Created on: 04.05.2013
5  * Author: skuser
6  */
7 
8 #ifndef COMMANDLINE_H_
9 #define COMMANDLINE_H_
10 
11 #include "Terminal.h"
12 #include "Commands.h"
13 
14 void CommandLineInit(void);
15 bool CommandLineProcessByte(uint8_t Byte);
16 void CommandLineTick(void);
17 
18 void CommandLineAppendData(void const * const Buffer, uint16_t Bytes);
19 
20 /* Functions for timeout commands */
21 void CommandLinePendingTaskFinished(CommandStatusIdType ReturnStatusID, char const * const OutMessage); // must be called, when the intended task is finished
22 extern void (*CommandLinePendingTaskTimeout) (void); // gets called on timeout to end the pending task
23 void CommandLinePendingTaskBreak(void); // this manually triggers a timeout
24 
25 #endif /* COMMANDLINE_H_ */
diff --git a/Doc/Doxygen/html/_command_line_8txt.html b/Doc/Doxygen/html/_command_line_8txt.html index a98d19c..bb8b61f 100644 --- a/Doc/Doxygen/html/_command_line_8txt.html +++ b/Doc/Doxygen/html/_command_line_8txt.html @@ -88,7 +88,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/_commands_8h_source.html b/Doc/Doxygen/html/_commands_8h_source.html index 4aad8e9..450438c 100644 --- a/Doc/Doxygen/html/_commands_8h_source.html +++ b/Doc/Doxygen/html/_commands_8h_source.html @@ -89,10 +89,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
Commands.h
-
1 
2 
3 #ifndef COMMANDS_H_
4 #define COMMANDS_H_
5 
6 #include "../Common.h"
7 
8 #define MAX_COMMAND_LENGTH 16
9 #define MAX_STATUS_LENGTH 32
10 
11 
12 #define COMMAND_INFO_OK_ID 100
13 #define COMMAND_INFO_OK "OK"
14 #define COMMAND_INFO_OK_WITH_TEXT_ID 101
15 #define COMMAND_INFO_OK_WITH_TEXT "OK WITH TEXT"
16 #define COMMAND_INFO_XMODEM_WAIT_ID 110
17 #define COMMAND_INFO_XMODEM_WAIT "WAITING FOR XMODEM"
18 #define COMMAND_INFO_FALSE_ID 120
19 #define COMMAND_INFO_FALSE "FALSE"
20 #define COMMAND_INFO_TRUE_ID 121
21 #define COMMAND_INFO_TRUE "TRUE"
22 #define COMMAND_ERR_UNKNOWN_CMD_ID 200
23 #define COMMAND_ERR_UNKNOWN_CMD "UNKNOWN COMMAND"
24 #define COMMAND_ERR_INVALID_USAGE_ID 201
25 #define COMMAND_ERR_INVALID_USAGE "INVALID COMMAND USAGE"
26 #define COMMAND_ERR_INVALID_PARAM_ID 202
27 #define COMMAND_ERR_INVALID_PARAM "INVALID PARAMETER"
28 #define COMMAND_ERR_TIMEOUT_ID 203
29 #define COMMAND_ERR_TIMEOUT "TIMEOUT"
30 #define TIMEOUT_COMMAND 255 // this is just for the CommandLine module to know that this is a timeout command
31 
32 
33 #define COMMAND_CHAR_TRUE '1'
34 #define COMMAND_CHAR_FALSE '0'
35 #define COMMAND_CHAR_SUGGEST '?' /* <CMD>=? for help */
36 
37 #define COMMAND_UID_BUFSIZE 32
38 
39 #define COMMAND_IS_SUGGEST_STRING(x) ( ((x)[0] == COMMAND_CHAR_SUGGEST) && ((x)[1] == '\0') )
40 
41 typedef uint8_t CommandStatusIdType;
42 typedef const char CommandStatusMessageType[MAX_STATUS_LENGTH];
43 
44 typedef CommandStatusIdType (*CommandExecFuncType) (char* OutMessage);
45 typedef CommandStatusIdType (*CommandExecParamFuncType) (char* OutMessage, const char* InParams);
46 typedef CommandStatusIdType (*CommandSetFuncType) (char* OutMessage, const char* InParam);
47 typedef CommandStatusIdType (*CommandGetFuncType) (char* OutParam);
48 
49 typedef struct {
50  char Command[MAX_COMMAND_LENGTH];
51  CommandExecFuncType ExecFunc;
52  CommandExecParamFuncType ExecParamFunc;
53  CommandSetFuncType SetFunc;
54  CommandGetFuncType GetFunc;
55 } CommandEntryType;
56 
57 #define COMMAND_VERSION "VERSION"
58 CommandStatusIdType CommandGetVersion(char* OutParam);
59 
60 #define COMMAND_CONFIG "CONFIG"
61 CommandStatusIdType CommandGetConfig(char* OutParam);
62 CommandStatusIdType CommandSetConfig(char* OutMessage, const char* InParam);
63 
64 #define COMMAND_UID "UID"
65 #define COMMAND_UID_RANDOM "RANDOM"
66 CommandStatusIdType CommandGetUid(char* OutParam);
67 CommandStatusIdType CommandSetUid(char* OutMessage, const char* InParam);
68 
69 #define COMMAND_READONLY "READONLY"
70 CommandStatusIdType CommandGetReadOnly(char* OutParam);
71 CommandStatusIdType CommandSetReadOnly(char* OutMessage, const char* InParam);
72 
73 #define COMMAND_UPLOAD "UPLOAD"
74 CommandStatusIdType CommandExecUpload(char* OutMessage);
75 
76 #define COMMAND_DOWNLOAD "DOWNLOAD"
77 CommandStatusIdType CommandExecDownload(char* OutMessage);
78 
79 #define COMMAND_RESET "RESET"
80 CommandStatusIdType CommandExecReset(char* OutMessage);
81 
82 #define COMMAND_UPGRADE "UPGRADE"
83 CommandStatusIdType CommandExecUpgrade(char* OutMessage);
84 
85 #define COMMAND_MEMSIZE "MEMSIZE"
86 CommandStatusIdType CommandGetMemSize(char* OutParam);
87 
88 #define COMMAND_UIDSIZE "UIDSIZE"
89 CommandStatusIdType CommandGetUidSize(char* OutParam);
90 
91 #define COMMAND_RBUTTON "RBUTTON"
92 CommandStatusIdType CommandGetRButton(char* OutParam);
93 CommandStatusIdType CommandSetRButton(char* OutMessage, const char* InParam);
94 
95 #define COMMAND_RBUTTON_LONG "RBUTTON_LONG"
96 CommandStatusIdType CommandGetRButtonLong(char* OutParam);
97 CommandStatusIdType CommandSetRButtonLong(char* OutMessage, const char* InParam);
98 
99 #define COMMAND_LBUTTON "LBUTTON"
100 CommandStatusIdType CommandGetLButton(char* OutParam);
101 CommandStatusIdType CommandSetLButton(char* OutMessage, const char* InParam);
102 
103 #define COMMAND_LBUTTON_LONG "LBUTTON_LONG"
104 CommandStatusIdType CommandGetLButtonLong(char* OutParam);
105 CommandStatusIdType CommandSetLButtonLong(char* OutMessage, const char* InParam);
106 
107 
108 #define COMMAND_LEDGREEN "LEDGREEN"
109 CommandStatusIdType CommandGetLedGreen(char* OutParam);
110 CommandStatusIdType CommandSetLedGreen(char* OutMessage, const char* InParam);
111 
112 #define COMMAND_LEDRED "LEDRED"
113 CommandStatusIdType CommandGetLedRed(char* OutParam);
114 CommandStatusIdType CommandSetLedRed(char* OutMessage, const char* InParam);
115 
116 #define COMMAND_LOGMODE "LOGMODE"
117 CommandStatusIdType CommandGetLogMode(char* OutParam);
118 CommandStatusIdType CommandSetLogMode(char* OutMessage, const char* InParam);
119 
120 #define COMMAND_LOGMEM "LOGMEM"
121 CommandStatusIdType CommandGetLogMem(char* OutParam);
122 
123 #define COMMAND_LOGDOWNLOAD "LOGDOWNLOAD"
124 CommandStatusIdType CommandExecLogDownload(char* OutMessage);
125 
126 #define COMMAND_STORELOG "LOGSTORE"
127 CommandStatusIdType CommandExecStoreLog(char* OutMessage);
128 
129 #define COMMAND_LOGCLEAR "LOGCLEAR"
130 CommandStatusIdType CommandExecLogClear(char* OutMessage);
131 
132 #define COMMAND_SETTING "SETTING"
133 CommandStatusIdType CommandGetSetting(char* OutParam);
134 CommandStatusIdType CommandSetSetting(char* OutMessage, const char* InParam);
135 
136 #define COMMAND_CLEAR "CLEAR"
137 CommandStatusIdType CommandExecClear(char* OutMessage);
138 
139 #define COMMAND_STORE "STORE"
140 CommandStatusIdType CommandExecStore(char* OutMessage);
141 
142 #define COMMAND_RECALL "RECALL"
143 CommandStatusIdType CommandExecRecall(char* OutMessage);
144 
145 #define COMMAND_CHARGING "CHARGING"
146 CommandStatusIdType CommandGetCharging(char* OutParam);
147 
148 #define COMMAND_HELP "HELP"
149 CommandStatusIdType CommandExecHelp(char* OutMessage);
150 
151 #define COMMAND_RSSI "RSSI"
152 CommandStatusIdType CommandGetRssi(char* OutParam);
153 
154 #define COMMAND_SYSTICK "SYSTICK"
155 CommandStatusIdType CommandGetSysTick(char* OutParam);
156 
157 #define COMMAND_SEND_RAW "SEND_RAW"
158 CommandStatusIdType CommandExecParamSendRaw(char* OutMessage, const char* InParams);
159 
160 #define COMMAND_SEND "SEND"
161 CommandStatusIdType CommandExecParamSend(char* OutMessage, const char* InParams);
162 
163 #define COMMAND_GETUID "GETUID"
164 CommandStatusIdType CommandExecGetUid(char* OutMessage);
165 
166 #define COMMAND_DUMP_MFU "DUMP_MFU"
167 CommandStatusIdType CommandExecDumpMFU(char* OutMessage);
168 
169 #define COMMAND_IDENTIFY_CARD "IDENTIFY"
170 CommandStatusIdType CommandExecIdentifyCard(char* OutMessage);
171 
172 #define COMMAND_TIMEOUT "TIMEOUT"
173 CommandStatusIdType CommandGetTimeout(char* OutMessage);
174 CommandStatusIdType CommandSetTimeout(char* OutMessage, const char* InParam);
175 
176 #define COMMAND_THRESHOLD "THRESHOLD"
177 CommandStatusIdType CommandGetThreshold(char* OutParam);
178 CommandStatusIdType CommandSetThreshold(char* OutMessage, const char* InParam);
179 
180 #define COMMAND_FIELD "FIELD"
181 CommandStatusIdType CommandSetField(char* OutMessage, const char* InParam);
182 CommandStatusIdType CommandGetField(char* OutMessage);
183 
184 #define COMMAND_LIST_END ""
185 /* Defines the end of command list. This is no actual command */
186 
187 #endif /* COMMANDS_H_ */
+
1 
2 
3 #ifndef COMMANDS_H_
4 #define COMMANDS_H_
5 
6 #include "../Common.h"
7 
8 #define MAX_COMMAND_LENGTH 16
9 #define MAX_STATUS_LENGTH 32
10 
11 
12 #define COMMAND_INFO_OK_ID 100
13 #define COMMAND_INFO_OK "OK"
14 #define COMMAND_INFO_OK_WITH_TEXT_ID 101
15 #define COMMAND_INFO_OK_WITH_TEXT "OK WITH TEXT"
16 #define COMMAND_INFO_XMODEM_WAIT_ID 110
17 #define COMMAND_INFO_XMODEM_WAIT "WAITING FOR XMODEM"
18 #define COMMAND_INFO_FALSE_ID 120
19 #define COMMAND_INFO_FALSE "FALSE"
20 #define COMMAND_INFO_TRUE_ID 121
21 #define COMMAND_INFO_TRUE "TRUE"
22 #define COMMAND_ERR_UNKNOWN_CMD_ID 200
23 #define COMMAND_ERR_UNKNOWN_CMD "UNKNOWN COMMAND"
24 #define COMMAND_ERR_INVALID_USAGE_ID 201
25 #define COMMAND_ERR_INVALID_USAGE "INVALID COMMAND USAGE"
26 #define COMMAND_ERR_INVALID_PARAM_ID 202
27 #define COMMAND_ERR_INVALID_PARAM "INVALID PARAMETER"
28 #define COMMAND_ERR_TIMEOUT_ID 203
29 #define COMMAND_ERR_TIMEOUT "TIMEOUT"
30 #define TIMEOUT_COMMAND 255 // this is just for the CommandLine module to know that this is a timeout command
31 
32 
33 #define COMMAND_CHAR_TRUE '1'
34 #define COMMAND_CHAR_FALSE '0'
35 #define COMMAND_CHAR_SUGGEST '?' /* <CMD>=? for help */
36 
37 #define COMMAND_UID_BUFSIZE 32
38 
39 #define COMMAND_IS_SUGGEST_STRING(x) ( ((x)[0] == COMMAND_CHAR_SUGGEST) && ((x)[1] == '\0') )
40 
41 typedef uint8_t CommandStatusIdType;
42 typedef const char CommandStatusMessageType[MAX_STATUS_LENGTH];
43 
44 typedef CommandStatusIdType (*CommandExecFuncType) (char* OutMessage);
45 typedef CommandStatusIdType (*CommandExecParamFuncType) (char* OutMessage, const char* InParams);
46 typedef CommandStatusIdType (*CommandSetFuncType) (char* OutMessage, const char* InParam);
47 typedef CommandStatusIdType (*CommandGetFuncType) (char* OutParam);
48 
49 typedef struct {
50  char Command[MAX_COMMAND_LENGTH];
51  CommandExecFuncType ExecFunc;
52  CommandExecParamFuncType ExecParamFunc;
53  CommandSetFuncType SetFunc;
54  CommandGetFuncType GetFunc;
55 } CommandEntryType;
56 
57 #define COMMAND_VERSION "VERSION"
58 CommandStatusIdType CommandGetVersion(char* OutParam);
59 
60 #define COMMAND_CONFIG "CONFIG"
61 CommandStatusIdType CommandGetConfig(char* OutParam);
62 CommandStatusIdType CommandSetConfig(char* OutMessage, const char* InParam);
63 
64 #define COMMAND_UID "UID"
65 #define COMMAND_UID_RANDOM "RANDOM"
66 CommandStatusIdType CommandGetUid(char* OutParam);
67 CommandStatusIdType CommandSetUid(char* OutMessage, const char* InParam);
68 
69 #define COMMAND_READONLY "READONLY"
70 CommandStatusIdType CommandGetReadOnly(char* OutParam);
71 CommandStatusIdType CommandSetReadOnly(char* OutMessage, const char* InParam);
72 
73 #define COMMAND_UPLOAD "UPLOAD"
74 CommandStatusIdType CommandExecUpload(char* OutMessage);
75 
76 #define COMMAND_DOWNLOAD "DOWNLOAD"
77 CommandStatusIdType CommandExecDownload(char* OutMessage);
78 
79 #define COMMAND_RESET "RESET"
80 CommandStatusIdType CommandExecReset(char* OutMessage);
81 
82 #define COMMAND_UPGRADE "UPGRADE"
83 CommandStatusIdType CommandExecUpgrade(char* OutMessage);
84 
85 #define COMMAND_MEMSIZE "MEMSIZE"
86 CommandStatusIdType CommandGetMemSize(char* OutParam);
87 
88 #define COMMAND_UIDSIZE "UIDSIZE"
89 CommandStatusIdType CommandGetUidSize(char* OutParam);
90 
91 #define COMMAND_RBUTTON "RBUTTON"
92 CommandStatusIdType CommandGetRButton(char* OutParam);
93 CommandStatusIdType CommandSetRButton(char* OutMessage, const char* InParam);
94 
95 #define COMMAND_RBUTTON_LONG "RBUTTON_LONG"
96 CommandStatusIdType CommandGetRButtonLong(char* OutParam);
97 CommandStatusIdType CommandSetRButtonLong(char* OutMessage, const char* InParam);
98 
99 #define COMMAND_LBUTTON "LBUTTON"
100 CommandStatusIdType CommandGetLButton(char* OutParam);
101 CommandStatusIdType CommandSetLButton(char* OutMessage, const char* InParam);
102 
103 #define COMMAND_LBUTTON_LONG "LBUTTON_LONG"
104 CommandStatusIdType CommandGetLButtonLong(char* OutParam);
105 CommandStatusIdType CommandSetLButtonLong(char* OutMessage, const char* InParam);
106 
107 
108 #define COMMAND_LEDGREEN "LEDGREEN"
109 CommandStatusIdType CommandGetLedGreen(char* OutParam);
110 CommandStatusIdType CommandSetLedGreen(char* OutMessage, const char* InParam);
111 
112 #define COMMAND_LEDRED "LEDRED"
113 CommandStatusIdType CommandGetLedRed(char* OutParam);
114 CommandStatusIdType CommandSetLedRed(char* OutMessage, const char* InParam);
115 
116 #define COMMAND_LOGMODE "LOGMODE"
117 CommandStatusIdType CommandGetLogMode(char* OutParam);
118 CommandStatusIdType CommandSetLogMode(char* OutMessage, const char* InParam);
119 
120 #define COMMAND_LOGMEM "LOGMEM"
121 CommandStatusIdType CommandGetLogMem(char* OutParam);
122 
123 #define COMMAND_LOGDOWNLOAD "LOGDOWNLOAD"
124 CommandStatusIdType CommandExecLogDownload(char* OutMessage);
125 
126 #define COMMAND_STORELOG "LOGSTORE"
127 CommandStatusIdType CommandExecStoreLog(char* OutMessage);
128 
129 #define COMMAND_LOGCLEAR "LOGCLEAR"
130 CommandStatusIdType CommandExecLogClear(char* OutMessage);
131 
132 #define COMMAND_SETTING "SETTING"
133 CommandStatusIdType CommandGetSetting(char* OutParam);
134 CommandStatusIdType CommandSetSetting(char* OutMessage, const char* InParam);
135 
136 #define COMMAND_CLEAR "CLEAR"
137 CommandStatusIdType CommandExecClear(char* OutMessage);
138 
139 #define COMMAND_STORE "STORE"
140 CommandStatusIdType CommandExecStore(char* OutMessage);
141 
142 #define COMMAND_RECALL "RECALL"
143 CommandStatusIdType CommandExecRecall(char* OutMessage);
144 
145 #define COMMAND_CHARGING "CHARGING"
146 CommandStatusIdType CommandGetCharging(char* OutParam);
147 
148 #define COMMAND_HELP "HELP"
149 CommandStatusIdType CommandExecHelp(char* OutMessage);
150 
151 #define COMMAND_RSSI "RSSI"
152 CommandStatusIdType CommandGetRssi(char* OutParam);
153 
154 #define COMMAND_SYSTICK "SYSTICK"
155 CommandStatusIdType CommandGetSysTick(char* OutParam);
156 
157 #define COMMAND_SEND_RAW "SEND_RAW"
158 CommandStatusIdType CommandExecParamSendRaw(char* OutMessage, const char* InParams);
159 
160 #define COMMAND_SEND "SEND"
161 CommandStatusIdType CommandExecParamSend(char* OutMessage, const char* InParams);
162 
163 #define COMMAND_GETUID "GETUID"
164 CommandStatusIdType CommandExecGetUid(char* OutMessage);
165 
166 #define COMMAND_DUMP_MFU "DUMP_MFU"
167 CommandStatusIdType CommandExecDumpMFU(char* OutMessage);
168 
169 #define COMMAND_IDENTIFY_CARD "IDENTIFY"
170 CommandStatusIdType CommandExecIdentifyCard(char* OutMessage);
171 
172 #define COMMAND_TIMEOUT "TIMEOUT"
173 CommandStatusIdType CommandGetTimeout(char* OutMessage);
174 CommandStatusIdType CommandSetTimeout(char* OutMessage, const char* InParam);
175 
176 #define COMMAND_THRESHOLD "THRESHOLD"
177 CommandStatusIdType CommandGetThreshold(char* OutParam);
178 CommandStatusIdType CommandSetThreshold(char* OutMessage, const char* InParam);
179 
180 #define COMMAND_AUTOCALIBRATE "AUTOCALIBRATE"
181 CommandStatusIdType CommandExecAutocalibrate(char* OutMessage);
182 
183 #define COMMAND_FIELD "FIELD"
184 CommandStatusIdType CommandSetField(char* OutMessage, const char* InParam);
185 CommandStatusIdType CommandGetField(char* OutMessage);
186 
187 #define COMMAND_LIST_END ""
188 /* Defines the end of command list. This is no actual command */
189 
190 #endif /* COMMANDS_H_ */
diff --git a/Doc/Doxygen/html/_common_8h_source.html b/Doc/Doxygen/html/_common_8h_source.html index 299755f..c94e4c0 100644 --- a/Doc/Doxygen/html/_common_8h_source.html +++ b/Doc/Doxygen/html/_common_8h_source.html @@ -92,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
1 /*
2  * Common.h
3  *
4  * Created on: 20.03.2013
5  * Author: skuser
6  */
7 
8 #ifndef COMMON_H_
9 #define COMMON_H_
10 
11 #include <stdio.h>
12 #include <stdbool.h>
13 #include <util/parity.h>
14 #include <util/delay.h>
15 #include <avr/pgmspace.h>
16 #include <avr/io.h>
17 
18 #define ODD_PARITY(Value) OddParityBit(Value)//(parity_even_bit(Value) ? 0 : 1)
19 
20 #define INLINE \
21  static inline __attribute__((always_inline))
22 
23 #define ARRAY_COUNT(x) \
24  (sizeof(x) / sizeof(x[0]))
25 
26 #define NIBBLE_TO_HEXCHAR(x) ( (x) < 0x0A ? (x) + '0' : (x) + 'A' - 0x0A )
27 #define HEXCHAR_TO_NIBBLE(x) ( (x) < 'A' ? (x) - '0' : (x) - 'A' + 0x0A )
28 #define VALID_HEXCHAR(x) ( ( (x) >= '0' && (x) <= '9' ) || ( (x) >= 'A' && (x) <= 'F' ) )
29 #define MIN(x,y) ( (x) < (y) ? (x) : (y) )
30 #define MAX(x,y) ( (x) > (y) ? (x) : (y) )
31 #define SYSTICK_DIFF(since) ((uint16_t) (SystemGetSysTick() - since))
32 #define SYSTICK_DIFF_100MS(since) (SYSTICK_DIFF(since) / 100)
33 
34 #define BITS_PER_BYTE 8
35 
36 uint16_t BufferToHexString(char* HexOut, uint16_t MaxChars, const void* Buffer, uint16_t ByteCount);
37 uint16_t HexStringToBuffer(void* Buffer, uint16_t MaxBytes, const char* HexIn);
38 
39 INLINE uint8_t BitReverseByte(uint8_t Byte)
40 {
41  extern const uint8_t PROGMEM BitReverseByteTable[];
42 
43  return pgm_read_byte(&BitReverseByteTable[Byte]);
44 }
45 
46 INLINE uint8_t OddParityBit(uint8_t Byte)
47 {
48  extern const uint8_t PROGMEM OddParityByteTable[];
49 
50  return pgm_read_byte(&OddParityByteTable[Byte]);
51 }
52 
53 INLINE uint8_t StringLength(const char* Str, uint8_t MaxLen)
54 {
55  uint8_t StrLen = 0;
56 
57  while(MaxLen > 0) {
58  if (*Str++ == '\0')
59  break;
60 
61  MaxLen--;
62  StrLen++;
63  }
64 
65  return StrLen;
66 }
67 
68 #endif /* COMMON_H_ */
diff --git a/Doc/Doxygen/html/_configuration_8h.html b/Doc/Doxygen/html/_configuration_8h.html index e453781..9fd5290 100644 --- a/Doc/Doxygen/html/_configuration_8h.html +++ b/Doc/Doxygen/html/_configuration_8h.html @@ -104,7 +104,7 @@ Classes diff --git a/Doc/Doxygen/html/_configuration_8h_source.html b/Doc/Doxygen/html/_configuration_8h_source.html index 6337398..8826b97 100644 --- a/Doc/Doxygen/html/_configuration_8h_source.html +++ b/Doc/Doxygen/html/_configuration_8h_source.html @@ -96,7 +96,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/_configurations_8txt.html b/Doc/Doxygen/html/_configurations_8txt.html index 53f85c2..0ba4168 100644 --- a/Doc/Doxygen/html/_configurations_8txt.html +++ b/Doc/Doxygen/html/_configurations_8txt.html @@ -88,7 +88,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/_crypto1_8h_source.html b/Doc/Doxygen/html/_crypto1_8h_source.html index a4ecd53..ca9aca4 100644 --- a/Doc/Doxygen/html/_crypto1_8h_source.html +++ b/Doc/Doxygen/html/_crypto1_8h_source.html @@ -89,10 +89,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
Crypto1.h
-
1 #ifndef CRYPTO1_H
2 #define CRYPTO1_H
3 
4 #include <stdint.h>
5 #include <stdbool.h>
6 
7 /* Gets the current keystream-bit, without shifting the internal LFSR */
8 uint8_t Crypto1FilterOutput(void);
9 
10 /* Set up Crypto1 cipher using the given Key, Uid and CardNonce. Also encrypts
11  * the CardNonce in-place while in non-linear mode. */
12 void Crypto1Setup(uint8_t Key[6], uint8_t Uid[4], uint8_t CardNonce[4]);
13 
14 /* Set up Crypto1 cipher using the given Key, Uid and CardNonce. Nested indicates
15  * whether the CardNonce is encrypted (true) or not (false).
16  * If the CardNonce is encrypted, it will we decrypted in-place. If not, it will
17  * be fed into the LFSR, but remains unchanged. */
18 void Crypto1SetupReader(uint8_t Key[6], uint8_t Uid[4], uint8_t CardNonce[4], bool Nested);
19 
20 /* Load the decrypted ReaderNonce into the Crypto1 state LFSR */
21 void Crypto1Auth(uint8_t EncryptedReaderNonce[4]);
22 
23 /* Generate 8 Bits of key stream */
24 uint8_t Crypto1Byte(void);
25 
26 /* Generate 4 Bits of key stream */
27 uint8_t Crypto1Nibble(void);
28 
29 /* Execute 'ClockCount' cycles on the PRNG state 'State' */
30 void Crypto1PRNG(uint8_t State[4], uint16_t ClockCount);
31 
32 /* Encrypts buffer with consideration of parity bits */
33 void Crypto1EncryptWithParity(uint8_t * Buffer, uint16_t BitCount);
34 
35 /* Encrypts buffer with LFSR feedback within reader nonce and considers parity bits */
36 void Crypto1ReaderAuthWithParity(uint8_t PlainReaderAnswerWithParityBits[9]);
37 
38 #endif //CRYPTO1_H
+
1 #ifndef CRYPTO1_H
2 #define CRYPTO1_H
3 
4 #include <stdint.h>
5 #include <stdbool.h>
6 
7 void Crypto1GetState(uint8_t* pEven, uint8_t* pOdd);
8 
9 /* Gets the current keystream-bit, without shifting the internal LFSR */
10 uint8_t Crypto1FilterOutput(void);
11 
12 /* Set up Crypto1 cipher using the given Key, Uid and CardNonce. Also encrypts
13  * the CardNonce in-place while in non-linear mode. */
14 void Crypto1Setup(uint8_t Key[6], uint8_t Uid[4], uint8_t CardNonce[4]);
15 /* Same for nested auth. CardNonce[4]..[7] will contain the parity bits after return */
16 void Crypto1SetupNested(uint8_t Key[6], uint8_t Uid[4], uint8_t CardNonce[8], bool Decrypt);
17 
18 /* Load the decrypted ReaderNonce into the Crypto1 state LFSR */
19 void Crypto1Auth(uint8_t EncryptedReaderNonce[4]);
20 
21 /* Generate 8 Bits of key stream */
22 uint8_t Crypto1Byte(void);
23 
24 /* Encrypt/Decrypt array */
25 void Crypto1ByteArray(uint8_t* Buffer, uint8_t Count);
26 void Crypto1ByteArrayWithParity(uint8_t* Buffer, uint8_t Count);
27 
28 /* Generate 4 Bits of key stream */
29 uint8_t Crypto1Nibble(void);
30 
31 /* Execute 'ClockCount' cycles on the PRNG state 'State' */
32 void Crypto1PRNG(uint8_t State[4], uint8_t ClockCount);
33 
34 /* Encrypts buffer with consideration of parity bits */
35 void Crypto1EncryptWithParity(uint8_t * Buffer, uint8_t BitCount);
36 
37 /* Encrypts buffer with LFSR feedback within reader nonce and considers parity bits */
38 void Crypto1ReaderAuthWithParity(uint8_t PlainReaderAnswerWithParityBits[9]);
39 
40 #endif //CRYPTO1_H
diff --git a/Doc/Doxygen/html/_getting_started_8txt.html b/Doc/Doxygen/html/_getting_started_8txt.html index 7732bf4..51ee229 100644 --- a/Doc/Doxygen/html/_getting_started_8txt.html +++ b/Doc/Doxygen/html/_getting_started_8txt.html @@ -88,7 +88,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/_i_s_o14443-2_a_8h_source.html b/Doc/Doxygen/html/_i_s_o14443-2_a_8h_source.html index af31680..c9ba1c1 100644 --- a/Doc/Doxygen/html/_i_s_o14443-2_a_8h_source.html +++ b/Doc/Doxygen/html/_i_s_o14443-2_a_8h_source.html @@ -92,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
1 /*
2  * ISO14443-2A.h
3  *
4  * Created on: 18.02.2013
5  * Author: skuser
6  */
7 
8 #ifndef ISO14443_2A_H_
9 #define ISO14443_2A_H_
10 
11 #include "Codec.h"
12 
13 #define ISO14443A_APP_NO_RESPONSE 0x0000
14 #define ISO14443A_APP_CUSTOM_PARITY 0x1000
15 
16 #define ISO14443A_BUFFER_PARITY_OFFSET (CODEC_BUFFER_SIZE/2)
17 
18 /* Codec Interface */
19 void ISO14443ACodecInit(void);
20 void ISO14443ACodecDeInit(void);
21 void ISO14443ACodecTask(void);
22 
23 
24 
25 #endif
diff --git a/Doc/Doxygen/html/_i_s_o14443-3_a_8h_source.html b/Doc/Doxygen/html/_i_s_o14443-3_a_8h_source.html index f9a1ea5..1a377a1 100644 --- a/Doc/Doxygen/html/_i_s_o14443-3_a_8h_source.html +++ b/Doc/Doxygen/html/_i_s_o14443-3_a_8h_source.html @@ -92,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
1 /*
2  * ISO14443-2A.h
3  *
4  * Created on: 19.03.2013
5  * Author: skuser
6  */
7 
8 #ifndef ISO14443_3A_H_
9 #define ISO14443_3A_H_
10 
11 #include "../Common.h"
12 #include <string.h>
13 
14 #define ISO14443A_UID_SIZE_SINGLE 4 /* bytes */
15 #define ISO14443A_UID_SIZE_DOUBLE 7
16 #define ISO14443A_UID_SIZE_TRIPLE 10
17 
18 #define ISO14443A_CMD_REQA 0x26
19 #define ISO14443A_CMD_WUPA 0x52
20 #define ISO14443A_CMD_SELECT_CL1 0x93
21 #define ISO14443A_CMD_SELECT_CL2 0x95
22 #define ISO14443A_CMD_SELECT_CL3 0x97
23 #define ISO14443A_CMD_HLTA 0x50
24 
25 #define ISO14443A_NVB_AC_START 0x20
26 #define ISO14443A_NVB_AC_END 0x70
27 
28 #define ISO14443A_CL_UID_OFFSET 0
29 #define ISO14443A_CL_UID_SIZE 4
30 #define ISO14443A_CL_BCC_OFFSET 4
31 #define ISO14443A_CL_BCC_SIZE 1 /* Byte */
32 #define ISO14443A_CL_FRAME_SIZE ((ISO14443A_CL_UID_SIZE + ISO14443A_CL_BCC_SIZE) * 8) /* UID[N...N+3] || BCCN */
33 #define ISO14443A_SAK_INCOMPLETE 0x04
34 #define ISO14443A_SAK_COMPLETE_COMPLIANT 0x20
35 #define ISO14443A_SAK_COMPLETE_NOT_COMPLIANT 0x00
36 
37 #define ISO14443A_ATQA_FRAME_SIZE (2 * 8) /* Bit */
38 #define ISO14443A_SAK_FRAME_SIZE (3 * 8) /* Bit */
39 
40 #define ISO14443A_UID0_RANDOM 0x08
41 #define ISO14443A_UID0_CT 0x88
42 
43 #define ISO14443A_CRCA_SIZE 2
44 
45 #define ISO14443A_CALC_BCC(ByteBuffer) \
46  ( ByteBuffer[0] ^ ByteBuffer[1] ^ ByteBuffer[2] ^ ByteBuffer[3] )
47 
48 void ISO14443AAppendCRCA(void* Buffer, uint16_t ByteCount);
49 bool ISO14443ACheckCRCA(const void* Buffer, uint16_t ByteCount);
50 
51 INLINE bool ISO14443ASelect(void* Buffer, uint16_t* BitCount, uint8_t* UidCL, uint8_t SAKValue);
52 INLINE bool ISO14443AWakeUp(void* Buffer, uint16_t* BitCount, uint16_t ATQAValue, bool FromHalt);
53 
54 INLINE
55 bool ISO14443ASelect(void* Buffer, uint16_t* BitCount, uint8_t* UidCL, uint8_t SAKValue)
56 {
57  uint8_t* DataPtr = (uint8_t*) Buffer;
58  uint8_t NVB = DataPtr[1];
59  //uint8_t CollisionByteCount = (NVB >> 4) & 0x0F;
60  //uint8_t CollisionBitCount = (NVB >> 0) & 0x0F;
61 
62  switch (NVB) {
63  case ISO14443A_NVB_AC_START:
64  /* Start of anticollision procedure.
65  * Send whole UID CLn + BCC */
66  DataPtr[0] = UidCL[0];
67  DataPtr[1] = UidCL[1];
68  DataPtr[2] = UidCL[2];
69  DataPtr[3] = UidCL[3];
70  DataPtr[4] = ISO14443A_CALC_BCC(DataPtr);
71 
72  *BitCount = ISO14443A_CL_FRAME_SIZE;
73 
74  return false;
75 
76  case ISO14443A_NVB_AC_END:
77  /* End of anticollision procedure.
78  * Send SAK CLn if we are selected. */
79  if ( (DataPtr[2] == UidCL[0]) &&
80  (DataPtr[3] == UidCL[1]) &&
81  (DataPtr[4] == UidCL[2]) &&
82  (DataPtr[5] == UidCL[3]) ) {
83 
84  DataPtr[0] = SAKValue;
85  ISO14443AAppendCRCA(Buffer, 1);
86 
87  *BitCount = ISO14443A_SAK_FRAME_SIZE;
88  return true;
89  } else {
90  /* We have not been selected. Don't send anything. */
91  *BitCount = 0;
92  return false;
93  }
94  default:
95  {
96  uint8_t CollisionByteCount = ((NVB >> 4) & 0x0f) - 2;
97  uint8_t CollisionBitCount = (NVB >> 0) & 0x0f;
98  uint8_t mask = 0xFF >> (8 - CollisionBitCount);
99  // Since the UidCL does not contain the BCC, we have to distinguish here
100  if (
101  ((CollisionByteCount == 5 || (CollisionByteCount == 4 && CollisionBitCount > 0)) && memcmp(UidCL, &DataPtr[2], 4) == 0 && (ISO14443A_CALC_BCC(UidCL) & mask) == (DataPtr[6] & mask))
102  ||
103  (CollisionByteCount == 4 && CollisionBitCount == 0 && memcmp(UidCL, &DataPtr[2], 4) == 0)
104  ||
105  (CollisionByteCount < 4 && memcmp(UidCL, &DataPtr[2], CollisionByteCount) == 0 && (UidCL[CollisionByteCount] & mask) == (DataPtr[CollisionByteCount + 2] & mask))
106  )
107  {
108  DataPtr[0] = UidCL[0];
109  DataPtr[1] = UidCL[1];
110  DataPtr[2] = UidCL[2];
111  DataPtr[3] = UidCL[3];
112  DataPtr[4] = ISO14443A_CALC_BCC(DataPtr);
113 
114  *BitCount = ISO14443A_CL_FRAME_SIZE;
115  } else {
116  *BitCount = 0;
117  }
118  return false;
119  }
120  /* TODO: No anticollision supported */
121  *BitCount = 0;
122  return false;
123  }
124 }
125 
126 INLINE
127 bool ISO14443AWakeUp(void* Buffer, uint16_t* BitCount, uint16_t ATQAValue, bool FromHalt)
128 {
129  uint8_t* DataPtr = (uint8_t*) Buffer;
130 
131  if ( ((! FromHalt) && (DataPtr[0] == ISO14443A_CMD_REQA)) ||
132  (DataPtr[0] == ISO14443A_CMD_WUPA) ){
133  DataPtr[0] = (ATQAValue >> 0) & 0x00FF;
134  DataPtr[1] = (ATQAValue >> 8) & 0x00FF;
135 
136  *BitCount = ISO14443A_ATQA_FRAME_SIZE;
137 
138  return true;
139  } else {
140  *BitCount = 0;
141 
142  return false;
143  }
144 }
145 
146 #endif
diff --git a/Doc/Doxygen/html/_l_e_d_8h_source.html b/Doc/Doxygen/html/_l_e_d_8h_source.html index 7e74e2e..91db7d8 100644 --- a/Doc/Doxygen/html/_l_e_d_8h_source.html +++ b/Doc/Doxygen/html/_l_e_d_8h_source.html @@ -92,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
1 /*
2  * LED.h
3  *
4  * Created on: 10.02.2013
5  * Author: skuser
6  */
7 
8 #ifndef LED_H
9 #define LED_H
10 
11 #include <avr/io.h>
12 #include "Common.h"
13 
14 #define LED_PORT PORTA
15 #define LED_GREEN PIN4_bm
16 #define LED_RED PIN3_bm
17 #define LED_MASK (LED_GREEN | LED_RED)
18 
19 typedef enum LEDFunctionEnum {
20  LED_NO_FUNC = 0, /* Don't light up the LED */
21  LED_POWERED, /* Light up the LED whenever the Chameleon is powered */
22 
23  LED_TERMINAL_CONN, /* A Terminal/USB connection has been established */
24  LED_TERMINAL_RXTX, /* There is traffic on the terminal */
25 
26  LED_SETTING_CHANGE, /* Outputs a blink code that shows the current setting */
27 
28  LED_MEMORY_STORED, /* Blink once when memory has been stored to flash */
29  LED_MEMORY_CHANGED, /* Switch LED on when card memory has changed compared to flash */
30 
31  LED_FIELD_DETECTED, /* Shows LED while a reader field is being detected or turned on by the chameleon itself */
32 
33  LED_CODEC_RX, /* Blink LED when receiving codec data */
34  LED_CODEC_TX, /* Blink LED when transmitting codec data */
35 
36  LED_LOG_MEM_FULL, /* Light up if log memory is full. */
37 
38  //TODO: LED_APP_SELECTED, /* Show LED while the correct UID has been selected and the application is active */
39  /* Has to be last element */
40  LED_FUNC_COUNT
41 } LEDHookEnum;
42 
43 typedef enum LEDActionEnum {
44  LED_NO_ACTION = 0x00,
45  LED_OFF = 0x10,
46  LED_ON = 0x11,
47  LED_TOGGLE = 0x12,
48  LED_PULSE = 0x13,
49  LED_BLINK = 0x20,
50  LED_BLINK_1X = 0x20,
51  LED_BLINK_2X, /* Have to be sequentially ordered */
52  LED_BLINK_3X,
53  LED_BLINK_4X,
54  LED_BLINK_5X,
55  LED_BLINK_6X,
56  LED_BLINK_7X,
57  LED_BLINK_8X,
58 } LEDActionEnum;
59 
60 
61 
62 void LEDInit(void);
63 void LEDTick(void);
64 
65 void LEDGetFuncList(char* List, uint16_t BufferSize);
66 void LEDSetFuncById(uint8_t Mask, LEDHookEnum Func);
67 void LEDGetFuncByName(uint8_t Mask, char* Function, uint16_t BufferSize);
68 bool LEDSetFuncByName(uint8_t Mask, const char* Function);
69 
70 #endif /* LED_H */
diff --git a/Doc/Doxygen/html/_l_e_d_8txt.html b/Doc/Doxygen/html/_l_e_d_8txt.html index 82ed094..8a937d1 100644 --- a/Doc/Doxygen/html/_l_e_d_8txt.html +++ b/Doc/Doxygen/html/_l_e_d_8txt.html @@ -88,7 +88,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/_l_e_d_hook_8h_source.html b/Doc/Doxygen/html/_l_e_d_hook_8h_source.html index 1df309b..6beecb4 100644 --- a/Doc/Doxygen/html/_l_e_d_hook_8h_source.html +++ b/Doc/Doxygen/html/_l_e_d_hook_8h_source.html @@ -93,7 +93,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/_l_e_ds_8txt.html b/Doc/Doxygen/html/_l_e_ds_8txt.html index 93dd998..ad40217 100644 --- a/Doc/Doxygen/html/_l_e_ds_8txt.html +++ b/Doc/Doxygen/html/_l_e_ds_8txt.html @@ -88,7 +88,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/_l_u_f_a_config_8h.html b/Doc/Doxygen/html/_l_u_f_a_config_8h.html index 03c046f..b05e7e7 100644 --- a/Doc/Doxygen/html/_l_u_f_a_config_8h.html +++ b/Doc/Doxygen/html/_l_u_f_a_config_8h.html @@ -101,7 +101,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/_l_u_f_a_config_8h_source.html b/Doc/Doxygen/html/_l_u_f_a_config_8h_source.html index 4781d47..688bc81 100644 --- a/Doc/Doxygen/html/_l_u_f_a_config_8h_source.html +++ b/Doc/Doxygen/html/_l_u_f_a_config_8h_source.html @@ -92,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); Go to the documentation of this file.
1 /*
2  LUFA Library
3  Copyright (C) Dean Camera, 2012.
4 
5  dean [at] fourwalledcubicle [dot] com
6  www.lufa-lib.org
7 */
8 
9 /*
10  Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11 
12  Permission to use, copy, modify, distribute, and sell this
13  software and its documentation for any purpose is hereby granted
14  without fee, provided that the above copyright notice appear in
15  all copies and that both that the copyright notice and this
16  permission notice and warranty disclaimer appear in supporting
17  documentation, and that the name of the author not be used in
18  advertising or publicity pertaining to distribution of the
19  software without specific, written prior permission.
20 
21  The author disclaim all warranties with regard to this
22  software, including all implied warranties of merchantability
23  and fitness. In no event shall the author be liable for any
24  special, indirect or consequential damages or any damages
25  whatsoever resulting from loss of use, data or profits, whether
26  in an action of contract, negligence or other tortious action,
27  arising out of or in connection with the use or performance of
28  this software.
29 */
30 
42 #ifndef _LUFA_CONFIG_H_
43 #define _LUFA_CONFIG_H_
44 
45  /* Non-USB Related Configuration Tokens: */
46 // #define DISABLE_TERMINAL_CODES
47 
48  /* USB Class Driver Related Tokens: */
49 // #define HID_HOST_BOOT_PROTOCOL_ONLY
50 // #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
51 // #define HID_USAGE_STACK_DEPTH {Insert Value Here}
52 // #define HID_MAX_COLLECTIONS {Insert Value Here}
53 // #define HID_MAX_REPORTITEMS {Insert Value Here}
54 // #define HID_MAX_REPORT_IDS {Insert Value Here}
55 // #define NO_CLASS_DRIVER_AUTOFLUSH
56 
57  /* General USB Driver Related Tokens: */
58  #define USE_STATIC_OPTIONS \
59  (USB_OPT_BUSEVENT_PRIMED | USB_DEVICE_OPT_FULLSPEED | /*USB_OPT_PLLCLKSRC*/ USB_OPT_RC32MCLKSRC)
60  #define USB_DEVICE_ONLY
61 // #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
62 // #define NO_LIMITED_CONTROLLER_CONNECT
63 // #define NO_SOF_EVENTS
64 
65  /* USB Device Mode Driver Related Tokens: */
66 // #define USE_RAM_DESCRIPTORS
67  #define USE_FLASH_DESCRIPTORS
68 // #define USE_EEPROM_DESCRIPTORS
69 // #define NO_INTERNAL_SERIAL
70  #define FIXED_CONTROL_ENDPOINT_SIZE 8
71 // #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
72  #define FIXED_NUM_CONFIGURATIONS 1
73 // #define CONTROL_ONLY_DEVICE
74  #define MAX_ENDPOINT_INDEX 5
75 // #define NO_DEVICE_REMOTE_WAKEUP
76 // #define NO_DEVICE_SELF_POWER
77 
78 #endif
diff --git a/Doc/Doxygen/html/_l_u_f_a_descriptors_8c.html b/Doc/Doxygen/html/_l_u_f_a_descriptors_8c.html index 913b4b0..235c111 100644 --- a/Doc/Doxygen/html/_l_u_f_a_descriptors_8c.html +++ b/Doc/Doxygen/html/_l_u_f_a_descriptors_8c.html @@ -218,7 +218,7 @@ Variables diff --git a/Doc/Doxygen/html/_l_u_f_a_descriptors_8h.html b/Doc/Doxygen/html/_l_u_f_a_descriptors_8h.html index f1d8d49..07e4ff7 100644 --- a/Doc/Doxygen/html/_l_u_f_a_descriptors_8h.html +++ b/Doc/Doxygen/html/_l_u_f_a_descriptors_8h.html @@ -226,7 +226,7 @@ Functions diff --git a/Doc/Doxygen/html/_l_u_f_a_descriptors_8h_source.html b/Doc/Doxygen/html/_l_u_f_a_descriptors_8h_source.html index 4d064b4..4d755de 100644 --- a/Doc/Doxygen/html/_l_u_f_a_descriptors_8h_source.html +++ b/Doc/Doxygen/html/_l_u_f_a_descriptors_8h_source.html @@ -94,7 +94,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/_log_8h.html b/Doc/Doxygen/html/_log_8h.html index 43f9a5f..81dde6f 100644 --- a/Doc/Doxygen/html/_log_8h.html +++ b/Doc/Doxygen/html/_log_8h.html @@ -192,7 +192,7 @@ Enumerations diff --git a/Doc/Doxygen/html/_log_8h_source.html b/Doc/Doxygen/html/_log_8h_source.html index 8dbab65..24b4da0 100644 --- a/Doc/Doxygen/html/_log_8h_source.html +++ b/Doc/Doxygen/html/_log_8h_source.html @@ -118,7 +118,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/_log_8txt.html b/Doc/Doxygen/html/_log_8txt.html index 4fc35af..2163bf9 100644 --- a/Doc/Doxygen/html/_log_8txt.html +++ b/Doc/Doxygen/html/_log_8txt.html @@ -88,7 +88,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/_main_page_8txt.html b/Doc/Doxygen/html/_main_page_8txt.html index 8c17c32..e4a6c97 100644 --- a/Doc/Doxygen/html/_main_page_8txt.html +++ b/Doc/Doxygen/html/_main_page_8txt.html @@ -88,7 +88,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/_map_8h_source.html b/Doc/Doxygen/html/_map_8h_source.html index dfec2d7..ab4217f 100644 --- a/Doc/Doxygen/html/_map_8h_source.html +++ b/Doc/Doxygen/html/_map_8h_source.html @@ -92,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
1 /*
2  * Map.h
3  *
4  * Created on: 07.12.2014
5  * Author: sk
6  */
7 
8 #ifndef MAP_H_
9 #define MAP_H_
10 
11 #include <stdint.h>
12 #include <stdbool.h>
13 #include <avr/pgmspace.h>
14 
15 #define MAP_TEXT_BUF_SIZE 32
16 #define MAP_MAX_TEXT_SIZE (MAP_TEXT_BUF_SIZE - 1)
17 
18 typedef uint8_t MapIdType;
19 typedef const char* MapTextPtrType;
20 
21 const typedef struct {
22  MapIdType Id;
23  const char Text[MAP_TEXT_BUF_SIZE];
24 } MapEntryType;
25 
26 bool MapIdToText(const MapEntryType* MapPtr, uint8_t MapSize, MapIdType Id, char* Text, uint16_t MaxBufferSize);
27 bool MapTextToId(const MapEntryType* MapPtr, uint8_t MapSize, MapTextPtrType Text, MapIdType* IdPtr);
28 void MapToString(const MapEntryType* MapPtr, uint8_t MapSize, char* String, uint16_t MaxBufferSize);
29 
30 #endif /* MAP_H_ */
diff --git a/Doc/Doxygen/html/_memory_8h_source.html b/Doc/Doxygen/html/_memory_8h_source.html index 55e674e..9608c80 100644 --- a/Doc/Doxygen/html/_memory_8h_source.html +++ b/Doc/Doxygen/html/_memory_8h_source.html @@ -92,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
1 /*
2  * Flash.h
3  *
4  * Created on: 20.03.2013
5  * Author: skuser
6  */
7 
8 #ifndef MEMORY_H_
9 #define MEMORY_H_
10 
11 #define MEMORY_SIZE (FLASH_DATA_SIZE) /* From makefile */
12 #define MEMORY_INIT_VALUE 0x00
13 #define MEMORY_SIZE_PER_SETTING 8192
14 
15 #ifndef __ASSEMBLER__
16 #include "Common.h"
17 
18 void MemoryInit(void);
19 void MemoryReadBlock(void* Buffer, uint16_t Address, uint16_t ByteCount);
20 void MemoryWriteBlock(const void* Buffer, uint16_t Address, uint16_t ByteCount);
21 void MemoryClear(void);
22 
23 
24 void MemoryRecall(void);
25 void MemoryStore(void);
26 
27 /* For use with XModem */
28 bool MemoryUploadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount);
29 bool MemoryDownloadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount);
30 
31 /* EEPROM functions */
32 uint16_t WriteEEPBlock(uint16_t Address, const void *SrcPtr, uint16_t ByteCount);
33 uint16_t ReadEEPBlock(uint16_t Address, void *DestPtr, uint16_t ByteCount);
34 
35 #endif /* __ASSEMBLER__ */
36 
37 #endif /* MEMORY_H_ */
diff --git a/Doc/Doxygen/html/_mifare_classic_8h_source.html b/Doc/Doxygen/html/_mifare_classic_8h_source.html index 7b80619..5107be0 100644 --- a/Doc/Doxygen/html/_mifare_classic_8h_source.html +++ b/Doc/Doxygen/html/_mifare_classic_8h_source.html @@ -92,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
1 /*
2  * MifareClassic.h
3  *
4  * Created on: 13.05.2013
5  * Author: skuser
6  */
7 
8 #ifndef MIFARECLASSIC_H_
9 #define MIFARECLASSIC_H_
10 
11 #include "Application.h"
12 #include "ISO14443-3A.h"
13 
14 #define MIFARE_CLASSIC_UID_SIZE ISO14443A_UID_SIZE_SINGLE
15 #define MIFARE_CLASSIC_1K_MEM_SIZE 1024
16 #define MIFARE_CLASSIC_4K_MEM_SIZE 4096
17 
18 void MifareClassicAppInit1K(void);
19 void MifareClassicAppInit1K7B(void);
20 void MifareClassicAppInit4K(void);
21 void MifareClassicAppReset(void);
22 void MifareClassicAppTask(void);
23 
24 uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount);
25 
26 void MifareClassicGetUid(ConfigurationUidType Uid);
27 void MifareClassicSetUid(ConfigurationUidType Uid);
28 
29 
30 #endif /* MIFARECLASSIC_H_ */
diff --git a/Doc/Doxygen/html/_mifare_ultralight_8h_source.html b/Doc/Doxygen/html/_mifare_ultralight_8h_source.html index 3bedf4a..7220b07 100644 --- a/Doc/Doxygen/html/_mifare_ultralight_8h_source.html +++ b/Doc/Doxygen/html/_mifare_ultralight_8h_source.html @@ -92,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
1 /*
2  * MifareUltralight.h
3  *
4  * Created on: 20.03.2013
5  * Author: skuser
6  */
7 
8 #ifndef MIFAREULTRALIGHT_H_
9 #define MIFAREULTRALIGHT_H_
10 
11 #include "Application.h"
12 #include "ISO14443-3A.h"
13 
14 #define MIFARE_ULTRALIGHT_UID_SIZE ISO14443A_UID_SIZE_DOUBLE
15 #define MIFARE_ULTRALIGHT_MEM_SIZE 64
16 
17 void MifareUltralightAppInit(void);
18 void MifareUltralightAppReset(void);
19 void MifareUltralightAppTask(void);
20 
21 uint16_t MifareUltralightAppProcess(uint8_t* Buffer, uint16_t BitCount);
22 
23 void MifareUltralightGetUid(ConfigurationUidType Uid);
24 void MifareUltralightSetUid(ConfigurationUidType Uid);
25 
26 
27 
28 #endif /* MIFAREULTRALIGHT_H_ */
diff --git a/Doc/Doxygen/html/_random_8h_source.html b/Doc/Doxygen/html/_random_8h_source.html index 33bd400..3ea833b 100644 --- a/Doc/Doxygen/html/_random_8h_source.html +++ b/Doc/Doxygen/html/_random_8h_source.html @@ -92,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
1 /*
2  * Random.h
3  *
4  * Created on: 22.03.2013
5  * Author: skuser
6  */
7 
8 #ifndef RANDOM_H_
9 #define RANDOM_H_
10 
11 #include "Common.h"
12 
13 void RandomInit(void);
14 uint8_t RandomGetByte(void);
15 void RandomGetBuffer(void* Buffer, uint8_t ByteCount);
16 void RandomTick(void);
17 
18 #endif /* RANDOM_H_ */
diff --git a/Doc/Doxygen/html/_reader14443-2_a_8h_source.html b/Doc/Doxygen/html/_reader14443-2_a_8h_source.html index 2029b17..76d3884 100644 --- a/Doc/Doxygen/html/_reader14443-2_a_8h_source.html +++ b/Doc/Doxygen/html/_reader14443-2_a_8h_source.html @@ -92,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
1 /*
2  * Reader14443-2A.h
3  *
4  * Created on: 26.08.2014
5  * Author: sk
6  */
7 
8 #ifndef READER14443_2A_H_
9 #define READER14443_2A_H_
10 
11 #include "Codec.h"
12 #include "Terminal/CommandLine.h"
13 
14 /* Codec Interface */
15 void Reader14443ACodecInit(void);
16 void Reader14443ACodecDeInit(void);
17 void Reader14443ACodecTask(void);
18 
19 /* Application Interface */
20 void Reader14443ACodecStart(void);
21 void Reader14443ACodecReset(void);
22 
23 #endif /* READER14443_2A_H_ */
diff --git a/Doc/Doxygen/html/_reader14443_a_8h_source.html b/Doc/Doxygen/html/_reader14443_a_8h_source.html index f9fcaea..f06b2c8 100644 --- a/Doc/Doxygen/html/_reader14443_a_8h_source.html +++ b/Doc/Doxygen/html/_reader14443_a_8h_source.html @@ -89,10 +89,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
Reader14443A.h
-
1 #ifndef READER14443A_H
2 #define READER14443A_H
3 
4 #include "Application.h"
5 #include "Codec/Codec.h"
6 
7 #define CRC_INIT 0x6363
8 
9 uint8_t ReaderSendBuffer[CODEC_BUFFER_SIZE];
10 uint16_t ReaderSendBitCount;
11 
12 void Reader14443AAppInit(void);
13 void Reader14443AAppReset(void);
14 void Reader14443AAppTask(void);
15 void Reader14443AAppTick(void);
16 void Reader14443AAppTimeout(void);
17 
18 uint16_t Reader14443AAppProcess(uint8_t* Buffer, uint16_t BitCount);
19 
20 uint16_t addParityBits(uint8_t * Buffer, uint16_t bits);
21 uint16_t removeParityBits(uint8_t * Buffer, uint16_t BitCount);
22 uint16_t removeSOC(uint8_t * Buffer, uint16_t BitCount);
23 bool checkParityBits(uint8_t * Buffer, uint16_t BitCount);
24 uint16_t ISO14443_CRCA(uint8_t * Buffer, uint8_t ByteCount);
25 
26 typedef enum {
27  Reader14443_Do_Nothing,
28  Reader14443_Send,
29  Reader14443_Send_Raw,
30  Reader14443_Get_UID,
31  Reader14443_Read_MF_Ultralight,
32  Reader14443_Identify
33 } Reader14443Command;
34 
35 
36 #endif //READER14443A_H
+
1 #ifndef READER14443A_H
2 #define READER14443A_H
3 
4 #include "Application.h"
5 #include "Codec/Codec.h"
6 
7 #define CRC_INIT 0x6363
8 
9 uint8_t ReaderSendBuffer[CODEC_BUFFER_SIZE];
10 uint16_t ReaderSendBitCount;
11 
12 void Reader14443AAppInit(void);
13 void Reader14443AAppReset(void);
14 void Reader14443AAppTask(void);
15 void Reader14443AAppTick(void);
16 void Reader14443AAppTimeout(void);
17 
18 uint16_t Reader14443AAppProcess(uint8_t* Buffer, uint16_t BitCount);
19 
20 uint16_t addParityBits(uint8_t * Buffer, uint16_t bits);
21 uint16_t removeParityBits(uint8_t * Buffer, uint16_t BitCount);
22 uint16_t removeSOC(uint8_t * Buffer, uint16_t BitCount);
23 bool checkParityBits(uint8_t * Buffer, uint16_t BitCount);
24 uint16_t ISO14443_CRCA(uint8_t * Buffer, uint8_t ByteCount);
25 
26 typedef enum {
27  Reader14443_Do_Nothing,
28  Reader14443_Send,
29  Reader14443_Send_Raw,
30  Reader14443_Get_UID,
31  Reader14443_Autocalibrate,
32  Reader14443_Read_MF_Ultralight,
33  Reader14443_Identify
34 } Reader14443Command;
35 
36 
37 #endif //READER14443A_H
diff --git a/Doc/Doxygen/html/_reader_8txt.html b/Doc/Doxygen/html/_reader_8txt.html index 103983a..5f83bf3 100644 --- a/Doc/Doxygen/html/_reader_8txt.html +++ b/Doc/Doxygen/html/_reader_8txt.html @@ -88,7 +88,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/_settings_8h.html b/Doc/Doxygen/html/_settings_8h.html index a925ea8..26f3a3f 100644 --- a/Doc/Doxygen/html/_settings_8h.html +++ b/Doc/Doxygen/html/_settings_8h.html @@ -107,7 +107,7 @@ Classes diff --git a/Doc/Doxygen/html/_settings_8h_source.html b/Doc/Doxygen/html/_settings_8h_source.html index 352c61f..4422112 100644 --- a/Doc/Doxygen/html/_settings_8h_source.html +++ b/Doc/Doxygen/html/_settings_8h_source.html @@ -100,7 +100,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/_settings_8txt.html b/Doc/Doxygen/html/_settings_8txt.html index f388f09..0d9e2d9 100644 --- a/Doc/Doxygen/html/_settings_8txt.html +++ b/Doc/Doxygen/html/_settings_8txt.html @@ -88,7 +88,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/_system_8h_source.html b/Doc/Doxygen/html/_system_8h_source.html index 8bb80b0..dbaaaf6 100644 --- a/Doc/Doxygen/html/_system_8h_source.html +++ b/Doc/Doxygen/html/_system_8h_source.html @@ -92,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
1 /*
2  * System.h
3  *
4  * Created on: 10.02.2013
5  * Author: skuser
6  */
7 
8 #ifndef SYSTEM_H
9 #define SYSTEM_H
10 
11 #include <avr/io.h>
12 #include <avr/pgmspace.h>
13 #include <avr/interrupt.h>
14 #include <stddef.h>
15 #include <stdbool.h>
16 #include "Common.h"
17 
18 #define F_RTC 1000
19 #define SYSTEM_MILLISECONDS_TO_RTC_CYCLES(x) \
20  ( (uint16_t) ( (double) F_RTC * x / 1E3 + 0.5) )
21 
22 #define SYSTEM_TICK_WIDTH 7 /* Bits */
23 #define SYSTEM_TICK_PERIOD (1<<7)
24 #define SYSTEM_TICK_MS (SYSTEM_TICK_PERIOD)
25 #define SYSTEM_TICK_FREQ (1000 / SYSTEM_TICK_PERIOD)
26 
27 #define SYSTEM_SMODE_PSAVE SLEEP_SMODE_PSAVE_gc
28 #define SYSTEM_SMODE_IDLE SLEEP_SMODE_IDLE_gc
29 
30 /* Use GPIORE and GPIORF as global tick register */
31 #define SYSTEM_TICK_REGISTER (*((volatile uint16_t*) &GPIORE))
32 
33 void SystemInit(void);
34 void SystemReset(void);
35 void SystemEnterBootloader(void);
36 void SystemStartUSBClock(void);
37 void SystemStopUSBClock(void);
38 void SystemInterruptInit(void);
39 INLINE bool SystemTick100ms(void);
40 
41 INLINE bool SystemTick100ms(void)
42 {
43  if (RTC.INTFLAGS & RTC_COMPIF_bm) {
44  while(RTC.STATUS & RTC_SYNCBUSY_bm)
45  ;
46 
47  RTC.INTFLAGS = RTC_COMPIF_bm;
48  return true;
49  }
50 
51  return false;
52 }
53 
54 INLINE uint16_t SystemGetSysTick(void) {
55  return SYSTEM_TICK_REGISTER | RTC.CNT;
56 }
57 
58 #endif /* SYSTEM_H */
diff --git a/Doc/Doxygen/html/_terminal_8h_source.html b/Doc/Doxygen/html/_terminal_8h_source.html index 8a80b6f..9763df7 100644 --- a/Doc/Doxygen/html/_terminal_8h_source.html +++ b/Doc/Doxygen/html/_terminal_8h_source.html @@ -92,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
1 /*
2  * CommandLine.h
3  *
4  * Created on: 10.02.2013
5  * Author: skuser
6  */
7 
8 #ifndef TERMINAL_H_
9 #define TERMINAL_H_
10 
11 #include "../Common.h"
12 #include "../LUFA/Drivers/USB/USB.h"
13 #include "XModem.h"
14 #include "CommandLine.h"
15 
16 #define TERMINAL_VBUS_PORT PORTD
17 #define TERMINAL_VBUS_MASK PIN5_bm
18 
19 #define TERMINAL_BUFFER_SIZE 512
20 
21 typedef enum {
22  TERMINAL_UNINITIALIZED,
23  TERMINAL_INITIALIZING,
24  TERMINAL_INITIALIZED,
25  TERMINAL_UNITIALIZING
26 } TerminalStateEnum;
27 
28 extern uint8_t TerminalBuffer[TERMINAL_BUFFER_SIZE];
29 extern USB_ClassInfo_CDC_Device_t TerminalHandle;
30 extern TerminalStateEnum TerminalState;
31 
32 void TerminalInit(void);
33 void TerminalTask(void);
34 void TerminalTick(void);
35 
36 /*void TerminalSendHex(void* Buffer, uint16_t ByteCount);*/
37 INLINE void TerminalSendByte(uint8_t Byte);
38 void TerminalSendBlock(const void* Buffer, uint16_t ByteCount);
39 
40 INLINE void TerminalSendChar(char c);
41 void TerminalSendString(const char* s);
42 void TerminalSendStringP(const char* s);
43 
44 void EVENT_USB_Device_Connect(void);
45 void EVENT_USB_Device_Disconnect(void);
46 void EVENT_USB_Device_ConfigurationChanged(void);
47 void EVENT_USB_Device_ControlRequest(void);
48 
49 INLINE void TerminalSendChar(char c) { CDC_Device_SendByte(&TerminalHandle, c); }
50 INLINE void TerminalSendByte(uint8_t Byte) { CDC_Device_SendByte(&TerminalHandle, Byte); }
51 
52 #endif /* TERMINAL_H_ */
diff --git a/Doc/Doxygen/html/_uploading_downloading_8txt.html b/Doc/Doxygen/html/_uploading_downloading_8txt.html index 171ee7d..90d0371 100644 --- a/Doc/Doxygen/html/_uploading_downloading_8txt.html +++ b/Doc/Doxygen/html/_uploading_downloading_8txt.html @@ -88,7 +88,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/_x_modem_8h_source.html b/Doc/Doxygen/html/_x_modem_8h_source.html index cc67288..44e54cb 100644 --- a/Doc/Doxygen/html/_x_modem_8h_source.html +++ b/Doc/Doxygen/html/_x_modem_8h_source.html @@ -92,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
1 /*
2  * TerminalXModem.h
3  *
4  * Created on: 22.03.2013
5  * Author: skuser
6  */
7 
8 #ifndef XMODEM_H_
9 #define XMODEM_H_
10 
11 #include "../Common.h"
12 
13 typedef bool (*XModemCallbackType) (void* ByteBuffer, uint32_t BlockAddress, uint16_t ByteCount);
14 
15 void XModemReceive(XModemCallbackType CallbackFunc);
16 void XModemSend(XModemCallbackType CallbackFunc);
17 
18 bool XModemProcessByte(uint8_t Byte);
19 void XModemTick(void);
20 
21 #endif /* TERMINALXMODEM_H_ */
diff --git a/Doc/Doxygen/html/annotated.html b/Doc/Doxygen/html/annotated.html index eeb6d83..a98b171 100644 --- a/Doc/Doxygen/html/annotated.html +++ b/Doc/Doxygen/html/annotated.html @@ -96,7 +96,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/classes.html b/Doc/Doxygen/html/classes.html index f1b8ee8..a5f2fb9 100644 --- a/Doc/Doxygen/html/classes.html +++ b/Doc/Doxygen/html/classes.html @@ -100,7 +100,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/dir_5de29d499bb29a41092979d00d22c134.html b/Doc/Doxygen/html/dir_5de29d499bb29a41092979d00d22c134.html index bea3890..1af58d5 100644 --- a/Doc/Doxygen/html/dir_5de29d499bb29a41092979d00d22c134.html +++ b/Doc/Doxygen/html/dir_5de29d499bb29a41092979d00d22c134.html @@ -96,7 +96,7 @@ Files diff --git a/Doc/Doxygen/html/dir_74b6a3b63f61c160c0f14b7a283a4c9b.html b/Doc/Doxygen/html/dir_74b6a3b63f61c160c0f14b7a283a4c9b.html index 5b3c09a..38e1ef2 100644 --- a/Doc/Doxygen/html/dir_74b6a3b63f61c160c0f14b7a283a4c9b.html +++ b/Doc/Doxygen/html/dir_74b6a3b63f61c160c0f14b7a283a4c9b.html @@ -96,7 +96,7 @@ Directories diff --git a/Doc/Doxygen/html/dir_8465ec698d237f801ae9966d4551fcfa.html b/Doc/Doxygen/html/dir_8465ec698d237f801ae9966d4551fcfa.html index ff0ffd1..5faf79b 100644 --- a/Doc/Doxygen/html/dir_8465ec698d237f801ae9966d4551fcfa.html +++ b/Doc/Doxygen/html/dir_8465ec698d237f801ae9966d4551fcfa.html @@ -112,7 +112,7 @@ Files diff --git a/Doc/Doxygen/html/dir_ddeffaa734f77525428b0dd4068da9cb.html b/Doc/Doxygen/html/dir_ddeffaa734f77525428b0dd4068da9cb.html index db63017..1ae71d0 100644 --- a/Doc/Doxygen/html/dir_ddeffaa734f77525428b0dd4068da9cb.html +++ b/Doc/Doxygen/html/dir_ddeffaa734f77525428b0dd4068da9cb.html @@ -96,7 +96,7 @@ Files diff --git a/Doc/Doxygen/html/dir_f5aab302412c0352d69464400cc5ee44.html b/Doc/Doxygen/html/dir_f5aab302412c0352d69464400cc5ee44.html index 937456c..e9a95e3 100644 --- a/Doc/Doxygen/html/dir_f5aab302412c0352d69464400cc5ee44.html +++ b/Doc/Doxygen/html/dir_f5aab302412c0352d69464400cc5ee44.html @@ -96,7 +96,7 @@ Files diff --git a/Doc/Doxygen/html/files.html b/Doc/Doxygen/html/files.html index d35688e..d6ea409 100644 --- a/Doc/Doxygen/html/files.html +++ b/Doc/Doxygen/html/files.html @@ -122,7 +122,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/functions.html b/Doc/Doxygen/html/functions.html index 263fd3a..f4fdd50 100644 --- a/Doc/Doxygen/html/functions.html +++ b/Doc/Doxygen/html/functions.html @@ -147,7 +147,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/functions_vars.html b/Doc/Doxygen/html/functions_vars.html index cf4786b..fd8a2eb 100644 --- a/Doc/Doxygen/html/functions_vars.html +++ b/Doc/Doxygen/html/functions_vars.html @@ -147,7 +147,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/globals.html b/Doc/Doxygen/html/globals.html index a3fafcc..ec34d5f 100644 --- a/Doc/Doxygen/html/globals.html +++ b/Doc/Doxygen/html/globals.html @@ -235,7 +235,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/globals_defs.html b/Doc/Doxygen/html/globals_defs.html index 03c4f3d..d0d3af3 100644 --- a/Doc/Doxygen/html/globals_defs.html +++ b/Doc/Doxygen/html/globals_defs.html @@ -111,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/globals_enum.html b/Doc/Doxygen/html/globals_enum.html index 374fe0d..f157a12 100644 --- a/Doc/Doxygen/html/globals_enum.html +++ b/Doc/Doxygen/html/globals_enum.html @@ -99,7 +99,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/globals_eval.html b/Doc/Doxygen/html/globals_eval.html index 4ebe646..49e85cf 100644 --- a/Doc/Doxygen/html/globals_eval.html +++ b/Doc/Doxygen/html/globals_eval.html @@ -171,7 +171,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/globals_func.html b/Doc/Doxygen/html/globals_func.html index 5168afc..f36b85a 100644 --- a/Doc/Doxygen/html/globals_func.html +++ b/Doc/Doxygen/html/globals_func.html @@ -100,7 +100,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/globals_vars.html b/Doc/Doxygen/html/globals_vars.html index faeb201..64aebab 100644 --- a/Doc/Doxygen/html/globals_vars.html +++ b/Doc/Doxygen/html/globals_vars.html @@ -111,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/index.html b/Doc/Doxygen/html/index.html index 9edc4ad..1b091e2 100644 --- a/Doc/Doxygen/html/index.html +++ b/Doc/Doxygen/html/index.html @@ -97,7 +97,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/pages.html b/Doc/Doxygen/html/pages.html index 974f3f8..23a4ae1 100644 --- a/Doc/Doxygen/html/pages.html +++ b/Doc/Doxygen/html/pages.html @@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/struct_configuration_type-members.html b/Doc/Doxygen/html/struct_configuration_type-members.html index ec16e51..6ecbc70 100644 --- a/Doc/Doxygen/html/struct_configuration_type-members.html +++ b/Doc/Doxygen/html/struct_configuration_type-members.html @@ -105,7 +105,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/struct_configuration_type.html b/Doc/Doxygen/html/struct_configuration_type.html index 3efff71..de9b399 100644 --- a/Doc/Doxygen/html/struct_configuration_type.html +++ b/Doc/Doxygen/html/struct_configuration_type.html @@ -322,7 +322,7 @@ Public Attributes diff --git a/Doc/Doxygen/html/struct_settings_entry_type-members.html b/Doc/Doxygen/html/struct_settings_entry_type-members.html index 0455914..0d5b0ea 100644 --- a/Doc/Doxygen/html/struct_settings_entry_type-members.html +++ b/Doc/Doxygen/html/struct_settings_entry_type-members.html @@ -97,7 +97,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/struct_settings_entry_type.html b/Doc/Doxygen/html/struct_settings_entry_type.html index d0279ff..68e77c2 100644 --- a/Doc/Doxygen/html/struct_settings_entry_type.html +++ b/Doc/Doxygen/html/struct_settings_entry_type.html @@ -121,7 +121,7 @@ uint16_t  diff --git a/Doc/Doxygen/html/struct_u_s_b___descriptor___configuration__t-members.html b/Doc/Doxygen/html/struct_u_s_b___descriptor___configuration__t-members.html index 4a88225..e0d92b6 100644 --- a/Doc/Doxygen/html/struct_u_s_b___descriptor___configuration__t-members.html +++ b/Doc/Doxygen/html/struct_u_s_b___descriptor___configuration__t-members.html @@ -92,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/Doxygen/html/struct_u_s_b___descriptor___configuration__t.html b/Doc/Doxygen/html/struct_u_s_b___descriptor___configuration__t.html index ea6577d..ee41d9d 100644 --- a/Doc/Doxygen/html/struct_u_s_b___descriptor___configuration__t.html +++ b/Doc/Doxygen/html/struct_u_s_b___descriptor___configuration__t.html @@ -95,7 +95,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Doc/DoxygenPages/CommandLine.txt b/Doc/DoxygenPages/CommandLine.txt index df816f0..66e9fef 100644 --- a/Doc/DoxygenPages/CommandLine.txt +++ b/Doc/DoxygenPages/CommandLine.txt @@ -110,10 +110,11 @@ * `SEND_RAW `| Does NOT add parity bits, sends the given byte string and returns the cards answer * `GETUID` | Obtains the UID of a card that is in the range of the antenna and returns it. This command is a \ref Anchor_TimeoutCommands "Timeout command". * `DUMP_MFU` | Reads the whole content of a Mifare Ultralight card that is in the range of the antenna and returns it. This command is a \ref Anchor_TimeoutCommands "Timeout command". - * `IDENTIFY` | Identifies the type of a card in the range of the antenna and returns it. + * `IDENTIFY` | Identifies the type of a card in the range of the antenna and returns it. This command is a \ref Anchor_TimeoutCommands "Timeout command". * `THRESHOLD=?` | Returns the possible number range for the reader threshold. * `THRESHOLD=` | Globally sets the reader threshold. The influences the reader function and range. Setting a wrong value may result in malfunctioning of the reader. DEFAULT: 400 * `THRESHOLD?` | Returns the current reader threshold. + * `AUTOCALIBRATE` | Automatically finds a good threshold for communicating with the card that currently is on top of the Chameleon. This command is a \ref Anchor_TimeoutCommands "Timeout command". * `FIELD?` | Returns whether (1) or not (0) the reader field is active. * `FIELD=[0;1]` | Enables/disables the reader field. * diff --git a/Doc/DoxygenPages/Reader.txt b/Doc/DoxygenPages/Reader.txt index e258657..6f3dabb 100644 --- a/Doc/DoxygenPages/Reader.txt +++ b/Doc/DoxygenPages/Reader.txt @@ -96,4 +96,14 @@ * -# Return code `101:OK WITH TEXT`, the card type and ATQA value, UID value and SAK value of the highest cascade level. * -# Return code `101:OK WITH TEXT`, the information that this card type is unknown to the ChameleonMini ("Unknown card.") and ATQA value, UID value and SAK value of the highest cascade level. * -# Timeout (no matter if on setting/configuration change or on real timeout). + * + * `AUTOCALIBRATE` + * --------------- + * This is a \ref Anchor_TimeoutCommands "timeout command". Tries to select to a card with every threshold within a range with a specific step size and chooses the best threshold. + * + * If this command is called within the reader configuration, it ends in one of the following ways: + * -# Return code `101:OK WITH TEXT` and a list of the tested thresholds with a `+` for every threshold where the select protocol was successful and a `-` if the select protocol was not successfully finished. + * -# Timeout (no matter if on setting/configuration change or on real timeout). + * + * \note If no working threshold was found, the threshold is reset to the standard threshold. */ \ No newline at end of file