Showing preview only (4,815K chars total). Download the full file or copy to clipboard to get everything.
Repository: natashenka/Tamagotchi-Hack
Branch: master
Commit: b88aa36c5bf0
Files: 248
Total size: 39.1 MB
Directory structure:
gitextract_qaqs9osu/
├── IR/
│ ├── README.txt
│ ├── ir.pde
│ └── ir2.pde
├── README
├── RFIDler/
│ └── tama.py
├── TamagotchiFriends/
│ └── proxmark/
│ └── armsrc/
│ ├── LCD.c
│ ├── LCD.h
│ ├── Makefile
│ ├── appmain.c
│ ├── apps.h
│ ├── crapto1.c
│ ├── crapto1.h
│ ├── crypto1.c
│ ├── epa.c
│ ├── epa.h
│ ├── fonts.c
│ ├── fonts.h
│ ├── fpgaloader.c
│ ├── hitag2.c
│ ├── iclass.c
│ ├── iso14443.c
│ ├── iso14443a.c
│ ├── iso14443a.h
│ ├── iso15693.c
│ ├── ldscript
│ ├── legicrf.c
│ ├── legicrf.h
│ ├── lfops.c
│ ├── lfops_rcv_works.txt
│ ├── mifarecmd.c
│ ├── mifarecmd.h
│ ├── mifaresniff.c
│ ├── mifaresniff.h
│ ├── mifareutil.c
│ ├── mifareutil.h
│ ├── obj/
│ │ ├── appmain.d
│ │ ├── appmain.o
│ │ ├── cmd.d
│ │ ├── cmd.o
│ │ ├── crapto1.d
│ │ ├── crapto1.o
│ │ ├── crc.d
│ │ ├── crc.o
│ │ ├── crc16.d
│ │ ├── crc16.o
│ │ ├── crypto1.d
│ │ ├── crypto1.o
│ │ ├── epa.d
│ │ ├── epa.o
│ │ ├── fpga.o
│ │ ├── fpgaimage.elf
│ │ ├── fpgaimage.s19
│ │ ├── fpgaloader.d
│ │ ├── fpgaloader.o
│ │ ├── fullimage.elf
│ │ ├── hitag2.d
│ │ ├── hitag2.o
│ │ ├── iclass.d
│ │ ├── iclass.o
│ │ ├── iso14443.d
│ │ ├── iso14443.o
│ │ ├── iso14443a.d
│ │ ├── iso14443a.o
│ │ ├── iso14443crc.d
│ │ ├── iso14443crc.o
│ │ ├── iso15693.d
│ │ ├── iso15693.o
│ │ ├── iso15693tools.d
│ │ ├── iso15693tools.o
│ │ ├── legic_prng.d
│ │ ├── legic_prng.o
│ │ ├── legicrf.d
│ │ ├── legicrf.o
│ │ ├── lfops.d
│ │ ├── lfops.o
│ │ ├── mifarecmd.d
│ │ ├── mifarecmd.o
│ │ ├── mifaresniff.d
│ │ ├── mifaresniff.o
│ │ ├── mifareutil.d
│ │ ├── mifareutil.o
│ │ ├── osimage.elf
│ │ ├── osimage.s19
│ │ ├── printf.d
│ │ ├── printf.o
│ │ ├── start.d
│ │ ├── start.o
│ │ ├── string.d
│ │ ├── string.o
│ │ ├── usb_cdc.d
│ │ ├── usb_cdc.o
│ │ ├── util.d
│ │ ├── util.o
│ │ └── version.o
│ ├── printf.c
│ ├── printf.h
│ ├── start.c
│ ├── stdint.h
│ ├── string.c
│ ├── string.h
│ ├── util.c
│ ├── util.h
│ └── version.c
├── TamagotchiOn/
│ └── tasmgotchi/
│ ├── demos/
│ │ └── waitforbutton/
│ │ ├── myassembly.txt
│ │ └── myimages.txt
│ └── makegame.py
├── codedump/
│ ├── GPTestProgram
│ ├── README.txt
│ ├── binbits
│ ├── binbits2
│ ├── decode.py
│ ├── first100.txt
│ ├── in.txt
│ ├── ports.txt
│ └── tf/
│ ├── eeprom5cd/
│ │ └── eeprom5cd.ino
│ └── glitch2/
│ └── glitch2.ino
├── demos/
│ ├── README
│ ├── facemain.c
│ ├── harlemshake
│ ├── mad
│ ├── nataliemain.c
│ └── nsdemomain.c
├── devtools/
│ └── itemmake/
│ ├── README
│ ├── itemmake.py
│ ├── samplescript.txt
│ └── template.txt
├── die/
│ └── README
├── disassembler/
│ ├── README
│ ├── a.txt
│ ├── bytecode.txt
│ ├── bytecoden.txt
│ ├── bytecoder.txt
│ ├── bytecodes.txt
│ └── dissa.py
├── figure/
│ ├── Arduino/
│ │ ├── ClientSide/
│ │ │ ├── README.txt
│ │ │ ├── ser.py
│ │ │ └── serw.py
│ │ ├── GeneralPlusRomDump/
│ │ │ └── GeneralPlusRomDump.ino
│ │ ├── GeneralPlusRomWrite/
│ │ │ └── GeneralPlusRomWrite.ino
│ │ └── README.txt
│ ├── README
│ ├── ROMDump/
│ │ ├── README
│ │ ├── ROMDump
│ │ ├── imgs/
│ │ │ └── adds.txt
│ │ ├── makiko
│ │ └── shimashimatchi
│ ├── SignalPulls/
│ │ ├── README
│ │ ├── empire.txt
│ │ ├── signaldecode.py
│ │ ├── usatour.txt
│ │ └── usatourbuy.txt
│ └── scripts/
│ ├── README
│ ├── im.py
│ └── l.txt
├── figure-simulator/
│ ├── README
│ └── simulator.pde
├── figure-simulator-discovery/
│ ├── .cproject
│ ├── .project
│ ├── .settings/
│ │ ├── com.atollic.truestudio.debug.hardware_device.prefs
│ │ └── org.eclipse.cdt.managedbuilder.core.prefs
│ ├── Libraries/
│ │ ├── CMSIS/
│ │ │ └── Include/
│ │ │ ├── arm_common_tables.h
│ │ │ ├── arm_math.h
│ │ │ ├── core_cm4.h
│ │ │ ├── core_cm4_simd.h
│ │ │ ├── core_cmFunc.h
│ │ │ └── core_cmInstr.h
│ │ ├── Device/
│ │ │ └── STM32F4xx/
│ │ │ ├── Include/
│ │ │ │ ├── stm32f4xx.h
│ │ │ │ └── system_stm32f4xx.h
│ │ │ └── Release_Notes.html
│ │ └── STM32F4xx_StdPeriph_Driver/
│ │ ├── Release_Notes.html
│ │ ├── inc/
│ │ │ ├── misc.h
│ │ │ ├── stm32f4xx_adc.h
│ │ │ ├── stm32f4xx_can.h
│ │ │ ├── stm32f4xx_crc.h
│ │ │ ├── stm32f4xx_cryp.h
│ │ │ ├── stm32f4xx_dac.h
│ │ │ ├── stm32f4xx_dbgmcu.h
│ │ │ ├── stm32f4xx_dcmi.h
│ │ │ ├── stm32f4xx_dma.h
│ │ │ ├── stm32f4xx_exti.h
│ │ │ ├── stm32f4xx_flash.h
│ │ │ ├── stm32f4xx_fsmc.h
│ │ │ ├── stm32f4xx_gpio.h
│ │ │ ├── stm32f4xx_hash.h
│ │ │ ├── stm32f4xx_i2c.h
│ │ │ ├── stm32f4xx_iwdg.h
│ │ │ ├── stm32f4xx_pwr.h
│ │ │ ├── stm32f4xx_rcc.h
│ │ │ ├── stm32f4xx_rng.h
│ │ │ ├── stm32f4xx_rtc.h
│ │ │ ├── stm32f4xx_sdio.h
│ │ │ ├── stm32f4xx_spi.h
│ │ │ ├── stm32f4xx_syscfg.h
│ │ │ ├── stm32f4xx_tim.h
│ │ │ ├── stm32f4xx_usart.h
│ │ │ └── stm32f4xx_wwdg.h
│ │ └── src/
│ │ ├── misc.c
│ │ ├── stm32f4xx_adc.c
│ │ ├── stm32f4xx_can.c
│ │ ├── stm32f4xx_crc.c
│ │ ├── stm32f4xx_cryp.c
│ │ ├── stm32f4xx_cryp_aes.c
│ │ ├── stm32f4xx_cryp_des.c
│ │ ├── stm32f4xx_cryp_tdes.c
│ │ ├── stm32f4xx_dac.c
│ │ ├── stm32f4xx_dbgmcu.c
│ │ ├── stm32f4xx_dcmi.c
│ │ ├── stm32f4xx_dma.c
│ │ ├── stm32f4xx_exti.c
│ │ ├── stm32f4xx_flash.c
│ │ ├── stm32f4xx_fsmc.c
│ │ ├── stm32f4xx_gpio.c
│ │ ├── stm32f4xx_hash.c
│ │ ├── stm32f4xx_hash_md5.c
│ │ ├── stm32f4xx_hash_sha1.c
│ │ ├── stm32f4xx_i2c.c
│ │ ├── stm32f4xx_iwdg.c
│ │ ├── stm32f4xx_pwr.c
│ │ ├── stm32f4xx_rcc.c
│ │ ├── stm32f4xx_rng.c
│ │ ├── stm32f4xx_rtc.c
│ │ ├── stm32f4xx_sdio.c
│ │ ├── stm32f4xx_spi.c
│ │ ├── stm32f4xx_syscfg.c
│ │ ├── stm32f4xx_tim.c
│ │ ├── stm32f4xx_usart.c
│ │ └── stm32f4xx_wwdg.c
│ ├── README
│ ├── Utilities/
│ │ └── STM32F4-Discovery/
│ │ ├── Release_Notes.html
│ │ ├── libPDMFilter_GCC.a
│ │ ├── pdm_filter.h
│ │ ├── stm32f4_discovery.c
│ │ ├── stm32f4_discovery.h
│ │ ├── stm32f4_discovery_lis302dl.c
│ │ └── stm32f4_discovery_lis302dl.h
│ ├── spi.elf.launch
│ ├── src/
│ │ ├── main.c
│ │ ├── startup_stm32f4xx.s
│ │ ├── stm32f4xx_conf.h
│ │ ├── stm32f4xx_it.c
│ │ ├── stm32f4xx_it.h
│ │ ├── system_stm32f4xx.c
│ │ └── tiny_printf.c
│ └── stm32f4_flash.ld
├── imageformats/
│ ├── README
│ ├── conv.py
│ └── pic.txt
└── slides/
└── recon.ppt
================================================
FILE CONTENTS
================================================
================================================
FILE: IR/README.txt
================================================
IR.pde -- Arduino code for IR that sends the first request repeatedly, and waits for a listening Tamagotchi
IR2.pde -- Arduino code for IR that waits for the first request, and responds (Tamagotchi intiates interaction)
================================================
FILE: IR/ir.pde
================================================
#define BIT_IS_SET(i, bits) (1 << i & bits)
// LED connected to digital pin 13
const int LED_PIN = 13;
// Width of a pulse, in microseconds
const int PULSE_WIDTH = 2300;
// # of bytes per command
const int COMMAND_LENGTH = 4;
//const int REQUEST[] = {0xac, 0, 0xde, 0xde, 2, 0xd, 5, 0x18, 0, 0, 0x14, 0x00, 0, 0, 0x10, 0, 2, 0, 0, 0xff, 1, 0xff, 0xff, 0x55};
//const int RC[] = {0xac, 0x1a, 0xdd, 0xdd, 1, 2, 0, 0x3d, 0};
int conf[9];
int r[24];
#include <stdio.h>
// choose the pin for the LED
int inputPin = 2; // choose the input pin (for a pushbutton)
int val = 0; // variable for reading the pin status
int count;
boolean done = false;
void suck( int sig ){
while(digitalRead(inputPin) == sig){
}
}
int decodebuf( int* b){
int a = 0;
for( int i = 0; i < 8; i++){
if( b[i] != 1 &&b[i] != 2 &&b[i] != 3){
Serial.println("I've fallen and i can't get up");
Serial.println(b[i]);
}
if( b[i] == 3)
b[i] = 2;
a = a + ((b[i] - 1) << i);
}
return a;
}
void getser(void){
//while(Serial.available()){
boolean gr = false;
boolean gc = false;
while(true){
if(!Serial.available())
continue;
byte c = Serial.read();
//Serial.println(c);
if( c == 'R' ){
for( int i = 0; i < 24; i++)
{
while(!Serial.available());
r[i] = Serial.read();
//Serial.println(Serial.read());
}
gr = true;
Serial.println("read request");
}
if( c == 'C' )
{
for( int i = 0; i < 9; i++)
{
//conf[i] = Serial.read();
while(!Serial.available());
conf[i] = Serial.read();
//Serial.println(Serial.read());
}
Serial.println("read conf");
gc = true;
}
if (gr && gc)
break;
}
//}
}
boolean dec(void){
// int i = 0;
// getser();
int time;
int diff, hi, lo;
//char buf[9];
int buf[400];
int cycles = 0;
int c;
char obuf[12];
int i;
//char out = 0xf0;
// for(i = 0; i < 7; i ++ ) {
time = millis();
while(digitalRead(inputPin) == HIGH ){
if( millis() - time > 5000){
return false;
}
}
time = millis();
while(digitalRead(inputPin) == LOW){
}
diff = millis() - time;
time = millis();
if( diff > 8 && diff < 12){
//while(digitalRead(inputPin) == LOW ){
//}
time = millis();
while(digitalRead(inputPin) == HIGH ){
}
diff = millis() - time;
if( diff < 0){
Serial.println("NEG");
}
if( diff > 1 && diff < 6){
// Serial.println("HIT ");
// Serial.println(diff);
// Serial.println( diff);
cycles = 0;
i = 0;
while(true){
// suck(HIGH);
cycles++;
time = micros();
suck(LOW);
lo = micros() - time;
time = micros();
if( lo > 1000){
// Serial.println("SMALL LO");
// Serial.println(lo);
// Serial.println(cycles);
//cycles = 0;
break;
}
suck(HIGH);
hi = micros() - time;
time = micros();
buf[i] = hi/lo;
i++;
}
Serial.println("DETECTED");
cycles = cycles/8;
for( i = 0; i < cycles; i++){
c = decodebuf( buf + 8*i );
sprintf( obuf, "%x ", c);
//for( i = 0; i < 16; i++){
Serial.print(obuf);
}
cycles = 0;
return true;
//}
}
}
else{
}
}
void setup()
{
pinMode(LED_PIN, OUTPUT);
Serial.begin(9600); // declare LED as output
pinMode(inputPin, INPUT);
// getser();
//size(400, 300);
// set inital background:
// background(0);
}
/* Modulate pin at 39 kHz for give number of microseconds */
void off(int pin, int time) {
static const int period = 25;
// found wait_time by measuring with oscilloscope
// static const int wait_time = 12;
for (time = time/period; time > 0; time--) {
digitalWrite(pin, HIGH);
delayMicroseconds(9);
digitalWrite(pin, LOW);
delayMicroseconds(9);
}
}
/* Leave pin off for time (given in microseconds) */
void on(int pin, int time) {
digitalWrite(pin, LOW);
delayMicroseconds(time);
}
/* Send a byte over the IR LED */
void send_byte(int bits) {
for (int i = 0; i < 8; i++)
{
if (BIT_IS_SET(i, bits)) {
off(LED_PIN, 500);
on(LED_PIN, 1270);
} else {
off(LED_PIN, 500);
on(LED_PIN, 675);
}
}
}
/* Send a full command */
void command(const int bytes[], int len) {
int sum = 0;
for (int i = 0; i < len -1; i++) {
send_byte(bytes[i]);
sum = sum + bytes[i];
}
send_byte(sum%256);
off(LED_PIN, 1200); //check if not working
on(LED_PIN, 0);
}
void loop()
{
if(!done){
getser();
done = true;
}
while (Serial.available() > 0) {
Serial.write(Serial.read());
}
while(!dec()){
off(LED_PIN, 9500);
on(LED_PIN, 2500);
command(r, 24);
}
do{
off(LED_PIN, 9500);
on(LED_PIN, 2500);
command(conf, 9);
}while(!dec());
// delay(10000);
// dec();
}
================================================
FILE: IR/ir2.pde
================================================
/* Control a Lutron Maestro light dimmer */
#define BIT_IS_SET(i, bits) (1 << i & bits)
// LED connected to digital pin 13
const int LED_PIN = 13;
// Width of a pulse, in microseconds
const int PULSE_WIDTH = 2300;
// # of bytes per command
const int COMMAND_LENGTH = 4;
volatile int REQUEST[] = {0xac, 1, 0x24, 0xd7, 0x0a, 1, 0x0e, 0x09, 0x05, 0x01, 0x03, 0x88, 0x00, 0x01, 0x33, 0xc0, 0x0b, 0, 0, 0xff, 1, 0xff, 0xff, 0x55};
volatile int RC[] = {0xac, 0x0b, 0x24, 0xd7, 0x00, 0x47, 0x0, 0x17, 0x5a };
int conf[9];
int r[24];
volatile int bounce = 0;
#include <stdio.h>
// choose the pin for the LED
int inputPin = 2; // choose the input pin (for a pushbutton)
int val = 0; // variable for reading the pin status
int count;
volatile int b = 0x47;
boolean done = false;
void suck( int sig ){
while(digitalRead(inputPin) == sig){
}
}
int decodebuf( int* b){
int a = 0;
for( int i = 0; i < 8; i++){
if( b[i] != 1 &&b[i] != 2 &&b[i] != 3){
Serial.println("I've fallen and i can't get up");
Serial.println(b[i]);
}
if( b[i] == 3)
b[i] = 2;
a = a + ((b[i] - 1) << i);
}
return a;
}
void getser(void){
//while(Serial.available()){
boolean gr = false;
boolean gc = false;
while(true){
if(!Serial.available())
continue;
byte c = Serial.read();
//Serial.println(c);
if( c == 'R' ){
for( int i = 0; i < 24; i++)
{
while(!Serial.available());
r[i] = Serial.read();
//Serial.println(Serial.read());
}
gr = true;
Serial.println("read request");
}
if( c == 'C' )
{
for( int i = 0; i < 9; i++)
{
//conf[i] = Serial.read();
while(!Serial.available());
conf[i] = Serial.read();
//Serial.println(Serial.read());
}
Serial.println("read conf");
gc = true;
}
if (gr && gc)
break;
}
//}
}
boolean dec(void){
// int i = 0;
// getser();
int time;
int diff, hi, lo;
//char buf[9];
int buf[400];
int cycles = 0;
int c;
char obuf[12];
int i;
//char out = 0xf0;
// for(i = 0; i < 7; i ++ ) {
time = millis();
while(digitalRead(inputPin) == HIGH ){
if( millis() - time > 5000){
return false;
}
}
time = millis();
while(digitalRead(inputPin) == LOW){
}
diff = millis() - time;
time = millis();
if( diff > 8 && diff < 12){
//while(digitalRead(inputPin) == LOW ){
//}
time = millis();
while(digitalRead(inputPin) == HIGH ){
}
diff = millis() - time;
if( diff < 0){
Serial.println("NEG");
}
if( diff > 1 && diff < 6){
// Serial.println("HIT ");
// Serial.println(diff);
// Serial.println( diff);
cycles = 0;
i = 0;
while(true){
// suck(HIGH);
cycles++;
time = micros();
suck(LOW);
lo = micros() - time;
time = micros();
if( lo > 1000){
// Serial.println("SMALL LO");
// Serial.println(lo);
// Serial.println(cycles);
//cycles = 0;
break;
}
suck(HIGH);
hi = micros() - time;
time = micros();
buf[i] = hi/lo;
i++;
}
Serial.println("DETECTED");
cycles = cycles/8;
for( i = 0; i < cycles; i++){
c = decodebuf( buf + 8*i );
sprintf( obuf, "%x ", c);
//for( i = 0; i < 16; i++){
Serial.print(obuf);
}
cycles = 0;
return true;
}
}
else{
return false;
}
}
void setup()
{
pinMode(LED_PIN, OUTPUT);
Serial.begin(9600); // declare LED as output
pinMode(inputPin, INPUT);
// pinMode(5, INPUT);
// attachInterrupt(1, blink, FALLING);
// getser();
//size(400, 300);
// set inital background:
// background(0);
}
/* Modulate pin at 39 kHz for give number of microseconds */
void off(int pin, int time) {
static const int period = 25;
// found wait_time by measuring with oscilloscope
// static const int wait_time = 12;
for (time = time/period; time > 0; time--) {
digitalWrite(pin, HIGH);
delayMicroseconds(9);
digitalWrite(pin, LOW);
delayMicroseconds(9);
}
}
/* Leave pin off for time (given in microseconds) */
void on(int pin, int time) {
digitalWrite(pin, LOW);
delayMicroseconds(time);
}
/* Send a byte over the IR LED */
void send_byte(int bits) {
for (int i = 0; i < 8; i++)
{
if (BIT_IS_SET(i, bits)) {
off(LED_PIN, 500);
on(LED_PIN, 1270);
} else {
off(LED_PIN, 500);
on(LED_PIN, 675);
}
}
}
/* Send a full command */
void command(volatile int bytes[], int len) {
int sum = 0;
for (int i = 0; i < len -1; i++) {
send_byte(bytes[i]);
sum = sum + bytes[i];
}
send_byte(sum%256);
off(LED_PIN, 1200); //check if not working
on(LED_PIN, 0);
}
void loop()
{
/*if(!done){
getser();
done = true;
} */
while(!dec()){}
//if( digitalRead( 5 ) == HIGH)
do{
off(LED_PIN, 9500);
on(LED_PIN, 2500);
command(REQUEST, 24);
}while(!dec());
do{
off(LED_PIN, 9500);
on(LED_PIN, 2500);
command(RC, 9);
}while(!dec());
// delay(10000);
// dec();
}
// Serial.println("yes, i do enjoy being interrupted" );
================================================
FILE: README
================================================
Repository for Tamagotchi hacking code!
Directories:
/demos/ - Discovery board demos
/devtools/ - Tamagotchi development tools
/die/ - Photos of the Tamagotchi chip/die
/dissasembler/ - GeneralPlus binary dissasembler
/figure/ - Dumps and code from Tamagotchi figures
/figure-simulator/ - Chipkit Uno figure simulator
/figure-simulator-discovery/ - STM32F4 Discovery board figure simulator
/imageformats/ - Tamagotchi image format converters
/IR/ - IR code
Questions? Comments? Contributions?
Contact: natashenka@kwartzlab.ca / @natashenka
================================================
FILE: RFIDler/tama.py
================================================
import RFIDler
import sys
import time
packet1 = [0xf0, 0, 0x0f, 1, 0, 0x2e, 0x25, 0, 2 , 0x80, 2, 0x7, 8, 0x01, 0x8, 0x1a, 0x1a, 0x1a]
packet2 = [0xf0, int(sys.argv[2]), 5, 1, int(sys.argv[2]), 0x2e, 0x25, 0x1]
def send_byte(b):
i = 0;
result, data= rfidler.command("CLOCKH 125000")
time.sleep(0.540/1000);
result, data= rfidler.command("STOP")
i = 7
#print "send"
while(i>=0):
if (1):
result, data= rfidler.command("STOP")
time.sleep(1.650/1000);
result, data= rfidler.command("CLOCKH 125000")
time.sleep(0.150/1000);
else:
result, data= rfidler.command("STOP")
time.sleep(0.270/1000);
result, data= rfidler.command("CLOCKH 125000")
time.sleep(0.150/1000);
i = i - 1
result, data= rfidler.command("STOP");
time.sleep(0.210/1000);
def toBinary(n):
# print n
# print ''.join(str(1 & int(n) >> i) for i in range(8)[::-1])
return ''.join(str(1 & int(n) >> i) for i in range(8)[::-1])
port= sys.argv[1]
rfidler= RFIDler.RFIDler()
result, reason= rfidler.connect(port)
if not result:
print 'Warning - could not open serial port:', reason
for i in range(6, 7):
s = ""
n = 0
first = False
for item in packet1:
if (first==False):
first = True
else:
n = n + item
s = s + toBinary(item)
s = s + toBinary(n&0xff)
result, data= rfidler.command("PWM2 800 0 0 19 19 10 0 0 1 100 20 1 75 20");
time.sleep(.1)
result, data= rfidler.command("RWD2 " + s);
print len(s)
s = ""
n = 0
first = False
packet2[1] = i
packet2[4] = i
for item in packet2:
if (first==False):
first = True
else:
n = n + item
s = s + toBinary(item)
s = s + toBinary(n&0xff)
print len(s)
print result
print data
time.sleep(0.1)
result, data= rfidler.command("RWD2 " + s);
print result
print data
time.sleep(2)
print i
================================================
FILE: TamagotchiFriends/proxmark/armsrc/LCD.c
================================================
//-----------------------------------------------------------------------------
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
// at your option, any later version. See the LICENSE.txt file for the text of
// the license.
//-----------------------------------------------------------------------------
// LCD code
//-----------------------------------------------------------------------------
#include "proxmark3.h"
#include "apps.h"
#include "LCD.h"
#include "fonts.h"
void LCDSend(unsigned int data)
{
// 9th bit set for data, clear for command
while ((AT91C_BASE_SPI->SPI_SR & AT91C_SPI_TXEMPTY) == 0); // wait for the transfer to complete
// For clarity's sake we pass data with 9th bit clear and commands with 9th
// bit set since they're implemented as defines, se we need to invert bit
AT91C_BASE_SPI->SPI_TDR = data^0x100; // Send the data/command
}
void LCDSetXY(unsigned char x, unsigned char y)
{
LCDSend(PPASET); // page start/end ram
LCDSend(y); // Start Page to display to
LCDSend(131); // End Page to display to
LCDSend(PCASET); // column start/end ram
LCDSend(x); // Start Column to display to
LCDSend(131); // End Column to display to
}
void LCDSetPixel(unsigned char x, unsigned char y, unsigned char color)
{
LCDSetXY(x,y); // Set position
LCDSend(PRAMWR); // Now write the pixel to the display
LCDSend(color); // Write the data in the specified Color
}
void LCDFill (unsigned char xs,unsigned char ys,unsigned char width,unsigned char height, unsigned char color)
{
unsigned char i,j;
for (i=0;i < height;i++) // Number of horizontal lines
{
LCDSetXY(xs,ys+i); // Goto start of fill area (Top Left)
LCDSend(PRAMWR); // Write to display
for (j=0;j < width;j++) // pixels per line
LCDSend(color);
}
}
void LCDString (char *lcd_string, const char *font_style,unsigned char x, unsigned char y, unsigned char fcolor, unsigned char bcolor)
{
unsigned int i;
unsigned char mask=0, px, py, xme, yme, offset;
const char *data;
data = font_style; // point to the start of the font table
xme = *data; // get font x width
data++;
yme = *data; // get font y length
data++;
offset = *data; // get data bytes per font
do
{
// point to data in table to be loaded
data = (font_style + offset) + (offset * (int)(*lcd_string - 32));
for (i=0;i < yme;i++) {
mask |=0x80;
for (px=x; px < (x + xme); px++) {
py= y + i;
if (*data & mask) LCDSetPixel (px,py,fcolor);
else LCDSetPixel (px,py,bcolor);
mask>>=1;
}
data++;
}
x+=xme;
lcd_string++; // next character in string
} while(*lcd_string !='\0'); // keep spitting chars out until end of string
}
void LCDReset(void)
{
LED_A_ON();
SetupSpi(SPI_LCD_MODE);
LOW(GPIO_LRST);
SpinDelay(100);
HIGH(GPIO_LRST);
SpinDelay(100);
LED_A_OFF();
}
void LCDInit(void)
{
int i;
LCDReset();
LCDSend(PSWRESET); // software reset
SpinDelay(100);
LCDSend(PSLEEPOUT); // exit sleep mode
LCDSend(PBSTRON); // booster on
LCDSend(PDISPON); // display on
LCDSend(PNORON); // normal on
LCDSend(PMADCTL); // rotate display 180 deg
LCDSend(0xC0);
LCDSend(PCOLMOD); // color mode
LCDSend(0x02); // 8bpp color mode
LCDSend(PSETCON); // set contrast
LCDSend(0xDC);
// clear display
LCDSetXY(0,0);
LCDSend(PRAMWR); // Write to display
i=LCD_XRES*LCD_YRES;
while(i--) LCDSend(WHITE);
// test text on different colored backgrounds
LCDString(" The quick brown fox ", (char *)&FONT6x8,1,1+8*0,WHITE ,BLACK );
LCDString(" jumped over the ", (char *)&FONT6x8,1,1+8*1,BLACK ,WHITE );
LCDString(" lazy dog. ", (char *)&FONT6x8,1,1+8*2,YELLOW ,RED );
LCDString(" AaBbCcDdEeFfGgHhIiJj ", (char *)&FONT6x8,1,1+8*3,RED ,GREEN );
LCDString(" KkLlMmNnOoPpQqRrSsTt ", (char *)&FONT6x8,1,1+8*4,MAGENTA,BLUE );
LCDString("UuVvWwXxYyZz0123456789", (char *)&FONT6x8,1,1+8*5,BLUE ,YELLOW);
LCDString("`-=[]_;',./~!@#$%^&*()", (char *)&FONT6x8,1,1+8*6,BLACK ,CYAN );
LCDString(" _+{}|:\\\"<>? ",(char *)&FONT6x8,1,1+8*7,BLUE ,MAGENTA);
// color bands
LCDFill(0, 1+8* 8, 132, 8, BLACK);
LCDFill(0, 1+8* 9, 132, 8, WHITE);
LCDFill(0, 1+8*10, 132, 8, RED);
LCDFill(0, 1+8*11, 132, 8, GREEN);
LCDFill(0, 1+8*12, 132, 8, BLUE);
LCDFill(0, 1+8*13, 132, 8, YELLOW);
LCDFill(0, 1+8*14, 132, 8, CYAN);
LCDFill(0, 1+8*15, 132, 8, MAGENTA);
}
================================================
FILE: TamagotchiFriends/proxmark/armsrc/LCD.h
================================================
//-----------------------------------------------------------------------------
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
// at your option, any later version. See the LICENSE.txt file for the text of
// the license.
//-----------------------------------------------------------------------------
// LCD code
//-----------------------------------------------------------------------------
#ifndef __LCD_H
#define __LCD_H
// The resolution of the LCD
#define LCD_XRES 132
#define LCD_YRES 132
// 8bpp Color Mode - Some basic colors defined for ease of use
// remember 8bpp color = 3xRed, 3xGreen & 2xBlue bits
// organised as RRRGGGBB
#define BLACK 0x00
#define BLUE 0x03
#define GREEN 0x1C
#define CYAN 0x1F
#define RED 0xE0
#define MAGENTA 0xE3
#define YELLOW 0xFC
#define WHITE 0xFF
// EPSON LCD command set
#define ECASET 0x115
#define EPWRCTR 0x120
#define ENOP 0x125
#define ERAMWR 0x15C
#define ERAMRD 0x15D
#define EPASET 0x175
#define EEPSRRD1 0x17C
#define EEPSRRD2 0x17D
#define EVOLCTR 0x181
#define ETMPGRD 0x182
#define ESLPOUT 0x194
#define ESLPIN 0x195
#define EDISNOR 0x1A6
#define EDISINV 0x1A7
#define EPTLIN 0x1A8
#define EPTLOUT 0x1A9
#define EASCSET 0x1AA
#define ESCSTART 0x1AB
#define EDISOFF 0x1AE
#define EDISON 0x1AF
#define ECOMSCN 0x1BB
#define EDATCTL 0x1BC
#define EDISCTL 0x1CA
#define EEPCOUT 0x1CC
#define EEPCTIN 0x1CD
#define ERGBSET8 0x1CE
#define EOSCON 0x1D1
#define EOSCOFF 0x1D2
#define EVOLUP 0x1D6
#define EVOLDOWN 0x1D7
#define ERMWIN 0x1E0
#define ERMWOUT 0x1EE
#define EEPMWR 0x1FC
#define EEPMRD 0x1FD
// PHILIPS LCD command set
#define PNOP 0x100
#define PSWRESET 0x101
#define PBSTROFF 0x102
#define PBSTRON 0x103
#define PRDDIDIF 0x104
#define PRDDST 0x109
#define PSLEEPIN 0x110
#define PSLEEPOUT 0x111
#define PPTLON 0x112
#define PNORON 0x113
#define PINVOFF 0x120
#define PINVON 0x121
#define PDALO 0x122
#define PDAL 0x123
#define PSETCON 0x125
#define PDISPOFF 0x128
#define PDISPON 0x129
#define PCASET 0x12A
#define PPASET 0x12B
#define PRAMWR 0x12C
#define PRGBSET 0x12D
#define PPTLAR 0x130
#define PVSCRDEF 0x133
#define PTEOFF 0x134
#define PTEON 0x135
#define PMADCTL 0x136
#define PSEP 0x137
#define PIDMOFF 0x138
#define PIDMON 0x139
#define PCOLMOD 0x13A
#define PSETVOP 0x1B0
#define PBRS 0x1B4
#define PTRS 0x1B6
#define PFINV 0x1B9
#define PDOR 0x1BA
#define PTCDFE 0x1BD
#define PTCVOPE 0x1BF
#define PEC 0x1C0
#define PSETMUL 0x1C2
#define PTCVOPAB 0x1C3
#define PTCVOPCD 0x1C4
#define PTCDF 0x1C5
#define PDF8C 0x1C6
#define PSETBS 0x1C7
#define PRDTEMP 0x1C8
#define PNLI 0x1C9
#define PRDID1 0x1DA
#define PRDID2 0x1DB
#define PRDID3 0x1DC
#define PSFD 0x1EF
#define PECM 0x1F0
void LCDSend(unsigned int data);
void LCDInit(void);
void LCDReset(void);
void LCDSetXY(unsigned char x, unsigned char y);
void LCDSetPixel(unsigned char x, unsigned char y, unsigned char color);
void LCDString (char *lcd_string, const char *font_style,unsigned char x, unsigned char y, unsigned char fcolor, unsigned char bcolor);
void LCDFill (unsigned char xs,unsigned char ys,unsigned char width,unsigned char height, unsigned char color);
#endif
================================================
FILE: TamagotchiFriends/proxmark/armsrc/Makefile
================================================
#-----------------------------------------------------------------------------
# This code is licensed to you under the terms of the GNU GPL, version 2 or,
# at your option, any later version. See the LICENSE.txt file for the text of
# the license.
#-----------------------------------------------------------------------------
# Makefile for armsrc, see ../common/Makefile.common for common settings
#-----------------------------------------------------------------------------
APP_INCLUDES = apps.h
#remove one of the following defines and comment out the relevant line
#in the next section to remove that particular feature from compilation
APP_CFLAGS = -DWITH_LF -DWITH_ISO15693 -DWITH_ISO14443a -DWITH_ISO14443b -DWITH_ICLASS -DWITH_LEGICRF -DWITH_HITAG
#-DWITH_LCD
#SRC_LCD = fonts.c LCD.c
SRC_LF = lfops.c hitag2.c
SRC_ISO15693 = iso15693.c iso15693tools.c
SRC_ISO14443a = epa.c iso14443a.c mifareutil.c mifarecmd.c mifaresniff.c
SRC_ISO14443b = iso14443.c
SRC_CRAPTO1 = crapto1.c crypto1.c
THUMBSRC = start.c \
$(SRC_LCD) \
$(SRC_ISO15693) \
$(SRC_LF) \
appmain.c printf.c \
util.c \
string.c \
usb_cdc.c \
cmd.c
# These are to be compiled in ARM mode
ARMSRC = fpgaloader.c \
legicrf.c \
iso14443crc.c \
crc16.c \
$(SRC_ISO14443a) \
$(SRC_ISO14443b) \
$(SRC_CRAPTO1) \
legic_prng.c \
iclass.c \
crc.c
# stdint.h provided locally until GCC 4.5 becomes C99 compliant
APP_CFLAGS += -I.
# Do not move this inclusion before the definition of {THUMB,ASM,ARM}SRC
include ../common/Makefile.common
OBJS = $(OBJDIR)/osimage.s19 $(OBJDIR)/fpgaimage.s19
all: $(OBJS)
$(OBJDIR)/fpga.o: fpga.bit
$(OBJCOPY) -O elf32-littlearm -I binary -B arm --redefine-sym _binary____fpga_fpga_bit_start=_binary_fpga_bit_start --redefine-sym _binary____fpga_fpga_bit_end=_binary_fpga_bit_end --prefix-sections=fpga_bit $^ $@
$(OBJDIR)/fullimage.elf: $(VERSIONOBJ) $(OBJDIR)/fpga.o $(THUMBOBJ) $(ARMOBJ)
$(CC) $(LDFLAGS) -Wl,-T,ldscript,-Map,$(patsubst %.elf,%.map,$@) -o $@ $^ $(LIBS)
$(OBJDIR)/fpgaimage.elf: $(OBJDIR)/fullimage.elf
$(OBJCOPY) -F elf32-littlearm --only-section .fpgaimage $^ $@
$(OBJDIR)/osimage.elf: $(OBJDIR)/fullimage.elf
$(OBJCOPY) -F elf32-littlearm --remove-section .fpgaimage $^ $@
tarbin: $(OBJS)
$(TAR) $(TARFLAGS) ../proxmark3-$(platform)-bin.tar $(OBJS:%=armsrc/%) $(OBJS:%.s19=armsrc/%.elf)
clean:
$(DELETE) $(OBJDIR)$(PATHSEP)*.o
$(DELETE) $(OBJDIR)$(PATHSEP)*.elf
$(DELETE) $(OBJDIR)$(PATHSEP)*.s19
$(DELETE) $(OBJDIR)$(PATHSEP)*.map
$(DELETE) $(OBJDIR)$(PATHSEP)*.d
$(DELETE) version.c
.PHONY: all clean help
help:
@echo Multi-OS Makefile, you are running on $(DETECTED_OS)
@echo Possible targets:
@echo + all - Make both:
@echo + $(OBJDIR)/osimage.s19 - The OS image
@echo + $(OBJDIR)/fpgaimage.s19 - The FPGA image
@echo + clean - Clean $(OBJDIR)
================================================
FILE: TamagotchiFriends/proxmark/armsrc/appmain.c
================================================
//-----------------------------------------------------------------------------
// Jonathan Westhues, Mar 2006
// Edits by Gerhard de Koning Gans, Sep 2007 (##)
//
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
// at your option, any later version. See the LICENSE.txt file for the text of
// the license.
//-----------------------------------------------------------------------------
// The main application code. This is the first thing called after start.c
// executes.
//-----------------------------------------------------------------------------
#include "usb_cdc.h"
#include "cmd.h"
#include "proxmark3.h"
#include "apps.h"
#include "util.h"
#include "printf.h"
#include "string.h"
#include <stdarg.h>
#include "legicrf.h"
#include <hitag2.h>
#ifdef WITH_LCD
#include "LCD.h"
#endif
#define abs(x) ( ((x)<0) ? -(x) : (x) )
//=============================================================================
// A buffer where we can queue things up to be sent through the FPGA, for
// any purpose (fake tag, as reader, whatever). We go MSB first, since that
// is the order in which they go out on the wire.
//=============================================================================
uint8_t ToSend[512];
int ToSendMax;
static int ToSendBit;
struct common_area common_area __attribute__((section(".commonarea")));
void BufferClear(void)
{
memset(BigBuf,0,sizeof(BigBuf));
Dbprintf("Buffer cleared (%i bytes)",sizeof(BigBuf));
}
void ToSendReset(void)
{
ToSendMax = -1;
ToSendBit = 8;
}
void ToSendStuffBit(int b)
{
if(ToSendBit >= 8) {
ToSendMax++;
ToSend[ToSendMax] = 0;
ToSendBit = 0;
}
if(b) {
ToSend[ToSendMax] |= (1 << (7 - ToSendBit));
}
ToSendBit++;
if(ToSendBit >= sizeof(ToSend)) {
ToSendBit = 0;
DbpString("ToSendStuffBit overflowed!");
}
}
//=============================================================================
// Debug print functions, to go out over USB, to the usual PC-side client.
//=============================================================================
void DbpString(char *str)
{
byte_t len = strlen(str);
cmd_send(CMD_DEBUG_PRINT_STRING,len,0,0,(byte_t*)str,len);
// /* this holds up stuff unless we're connected to usb */
// if (!UsbConnected())
// return;
//
// UsbCommand c;
// c.cmd = CMD_DEBUG_PRINT_STRING;
// c.arg[0] = strlen(str);
// if(c.arg[0] > sizeof(c.d.asBytes)) {
// c.arg[0] = sizeof(c.d.asBytes);
// }
// memcpy(c.d.asBytes, str, c.arg[0]);
//
// UsbSendPacket((uint8_t *)&c, sizeof(c));
// // TODO fix USB so stupid things like this aren't req'd
// SpinDelay(50);
}
#if 0
void DbpIntegers(int x1, int x2, int x3)
{
cmd_send(CMD_DEBUG_PRINT_INTEGERS,x1,x2,x3,0,0);
// /* this holds up stuff unless we're connected to usb */
// if (!UsbConnected())
// return;
//
// UsbCommand c;
// c.cmd = CMD_DEBUG_PRINT_INTEGERS;
// c.arg[0] = x1;
// c.arg[1] = x2;
// c.arg[2] = x3;
//
// UsbSendPacket((uint8_t *)&c, sizeof(c));
// // XXX
// SpinDelay(50);
}
#endif
void Dbprintf(const char *fmt, ...) {
// should probably limit size here; oh well, let's just use a big buffer
char output_string[128];
va_list ap;
va_start(ap, fmt);
kvsprintf(fmt, output_string, 10, ap);
va_end(ap);
DbpString(output_string);
}
// prints HEX & ASCII
void Dbhexdump(int len, uint8_t *d, bool bAsci) {
int l=0,i;
char ascii[9];
while (len>0) {
if (len>8) l=8;
else l=len;
memcpy(ascii,d,l);
ascii[l]=0;
// filter safe ascii
for (i=0;i<l;i++)
if (ascii[i]<32 || ascii[i]>126) ascii[i]='.';
if (bAsci) {
Dbprintf("%-8s %*D",ascii,l,d," ");
} else {
Dbprintf("%*D",l,d," ");
}
len-=8;
d+=8;
}
}
//-----------------------------------------------------------------------------
// Read an ADC channel and block till it completes, then return the result
// in ADC units (0 to 1023). Also a routine to average 32 samples and
// return that.
//-----------------------------------------------------------------------------
static int ReadAdc(int ch)
{
uint32_t d;
AT91C_BASE_ADC->ADC_CR = AT91C_ADC_SWRST;
AT91C_BASE_ADC->ADC_MR =
ADC_MODE_PRESCALE(32) |
ADC_MODE_STARTUP_TIME(16) |
ADC_MODE_SAMPLE_HOLD_TIME(8);
AT91C_BASE_ADC->ADC_CHER = ADC_CHANNEL(ch);
AT91C_BASE_ADC->ADC_CR = AT91C_ADC_START;
while(!(AT91C_BASE_ADC->ADC_SR & ADC_END_OF_CONVERSION(ch)))
;
d = AT91C_BASE_ADC->ADC_CDR[ch];
return d;
}
int AvgAdc(int ch) // was static - merlok
{
int i;
int a = 0;
for(i = 0; i < 32; i++) {
a += ReadAdc(ch);
}
return (a + 15) >> 5;
}
void MeasureAntennaTuning(void)
{
uint8_t *dest = (uint8_t *)BigBuf+FREE_BUFFER_OFFSET;
int i, adcval = 0, peak = 0, peakv = 0, peakf = 0; //ptr = 0
int vLf125 = 0, vLf134 = 0, vHf = 0; // in mV
// UsbCommand c;
LED_B_ON();
DbpString("Measuring antenna characteristics, please wait...");
memset(dest,0,sizeof(FREE_BUFFER_SIZE));
/*
* Sweeps the useful LF range of the proxmark from
* 46.8kHz (divisor=255) to 600kHz (divisor=19) and
* read the voltage in the antenna, the result left
* in the buffer is a graph which should clearly show
* the resonating frequency of your LF antenna
* ( hopefully around 95 if it is tuned to 125kHz!)
*/
FpgaWriteConfWord(FPGA_MAJOR_MODE_LF_READER);
for (i=255; i>19; i--) {
WDT_HIT();
FpgaSendCommand(FPGA_CMD_SET_DIVISOR, i);
SpinDelay(20);
// Vref = 3.3V, and a 10000:240 voltage divider on the input
// can measure voltages up to 137500 mV
adcval = ((137500 * AvgAdc(ADC_CHAN_LF)) >> 10);
if (i==95) vLf125 = adcval; // voltage at 125Khz
if (i==89) vLf134 = adcval; // voltage at 134Khz
dest[i] = adcval>>8; // scale int to fit in byte for graphing purposes
if(dest[i] > peak) {
peakv = adcval;
peak = dest[i];
peakf = i;
//ptr = i;
}
}
LED_A_ON();
// Let the FPGA drive the high-frequency antenna around 13.56 MHz.
FpgaWriteConfWord(FPGA_MAJOR_MODE_HF_READER_RX_XCORR);
SpinDelay(20);
// Vref = 3300mV, and an 10:1 voltage divider on the input
// can measure voltages up to 33000 mV
vHf = (33000 * AvgAdc(ADC_CHAN_HF)) >> 10;
// c.cmd = CMD_MEASURED_ANTENNA_TUNING;
// c.arg[0] = (vLf125 << 0) | (vLf134 << 16);
// c.arg[1] = vHf;
// c.arg[2] = peakf | (peakv << 16);
DbpString("Measuring complete, sending report back to host");
cmd_send(CMD_MEASURED_ANTENNA_TUNING,vLf125|(vLf134<<16),vHf,peakf|(peakv<<16),0,0);
// UsbSendPacket((uint8_t *)&c, sizeof(c));
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
LED_A_OFF();
LED_B_OFF();
return;
}
void MeasureAntennaTuningHf(void)
{
int vHf = 0; // in mV
DbpString("Measuring HF antenna, press button to exit");
for (;;) {
// Let the FPGA drive the high-frequency antenna around 13.56 MHz.
FpgaWriteConfWord(FPGA_MAJOR_MODE_HF_READER_RX_XCORR);
SpinDelay(20);
// Vref = 3300mV, and an 10:1 voltage divider on the input
// can measure voltages up to 33000 mV
vHf = (33000 * AvgAdc(ADC_CHAN_HF)) >> 10;
Dbprintf("%d mV",vHf);
if (BUTTON_PRESS()) break;
}
DbpString("cancelled");
}
void SimulateTagHfListen(void)
{
uint8_t *dest = (uint8_t *)BigBuf+FREE_BUFFER_OFFSET;
uint8_t v = 0;
int i;
int p = 0;
// We're using this mode just so that I can test it out; the simulated
// tag mode would work just as well and be simpler.
FpgaWriteConfWord(FPGA_MAJOR_MODE_HF_READER_RX_XCORR | FPGA_HF_READER_RX_XCORR_848_KHZ | FPGA_HF_READER_RX_XCORR_SNOOP);
// We need to listen to the high-frequency, peak-detected path.
SetAdcMuxFor(GPIO_MUXSEL_HIPKD);
FpgaSetupSsc();
i = 0;
for(;;) {
if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_TXRDY)) {
AT91C_BASE_SSC->SSC_THR = 0xff;
}
if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_RXRDY)) {
uint8_t r = (uint8_t)AT91C_BASE_SSC->SSC_RHR;
v <<= 1;
if(r & 1) {
v |= 1;
}
p++;
if(p >= 8) {
dest[i] = v;
v = 0;
p = 0;
i++;
if(i >= FREE_BUFFER_SIZE) {
break;
}
}
}
}
DbpString("simulate tag (now type bitsamples)");
}
void ReadMem(int addr)
{
const uint8_t *data = ((uint8_t *)addr);
Dbprintf("%x: %02x %02x %02x %02x %02x %02x %02x %02x",
addr, data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]);
}
/* osimage version information is linked in */
extern struct version_information version_information;
/* bootrom version information is pointed to from _bootphase1_version_pointer */
extern char *_bootphase1_version_pointer, _flash_start, _flash_end;
void SendVersion(void)
{
char temp[48]; /* Limited data payload in USB packets */
DbpString("Prox/RFID mark3 RFID instrument");
/* Try to find the bootrom version information. Expect to find a pointer at
* symbol _bootphase1_version_pointer, perform slight sanity checks on the
* pointer, then use it.
*/
char *bootrom_version = *(char**)&_bootphase1_version_pointer;
if( bootrom_version < &_flash_start || bootrom_version >= &_flash_end ) {
DbpString("bootrom version information appears invalid");
} else {
FormatVersionInformation(temp, sizeof(temp), "bootrom: ", bootrom_version);
DbpString(temp);
}
FormatVersionInformation(temp, sizeof(temp), "os: ", &version_information);
DbpString(temp);
FpgaGatherVersion(temp, sizeof(temp));
DbpString(temp);
}
#ifdef WITH_LF
// samy's sniff and repeat routine
void SamyRun()
{
DbpString("Stand-alone mode! No PC necessary.");
// 3 possible options? no just 2 for now
#define OPTS 2
int high[OPTS], low[OPTS];
// Oooh pretty -- notify user we're in elite samy mode now
LED(LED_RED, 200);
LED(LED_ORANGE, 200);
LED(LED_GREEN, 200);
LED(LED_ORANGE, 200);
LED(LED_RED, 200);
LED(LED_ORANGE, 200);
LED(LED_GREEN, 200);
LED(LED_ORANGE, 200);
LED(LED_RED, 200);
int selected = 0;
int playing = 0;
// Turn on selected LED
LED(selected + 1, 0);
for (;;)
{
// UsbPoll(FALSE);
usb_poll();
WDT_HIT();
// Was our button held down or pressed?
int button_pressed = BUTTON_HELD(1000);
SpinDelay(300);
// Button was held for a second, begin recording
if (button_pressed > 0)
{
LEDsoff();
LED(selected + 1, 0);
LED(LED_RED2, 0);
// record
DbpString("Starting recording");
// wait for button to be released
while(BUTTON_PRESS())
WDT_HIT();
/* need this delay to prevent catching some weird data */
SpinDelay(500);
CmdHIDdemodFSK(1, &high[selected], &low[selected], 0);
Dbprintf("Recorded %x %x %x", selected, high[selected], low[selected]);
LEDsoff();
LED(selected + 1, 0);
// Finished recording
// If we were previously playing, set playing off
// so next button push begins playing what we recorded
playing = 0;
}
// Change where to record (or begin playing)
else if (button_pressed)
{
// Next option if we were previously playing
if (playing)
selected = (selected + 1) % OPTS;
playing = !playing;
LEDsoff();
LED(selected + 1, 0);
// Begin transmitting
if (playing)
{
LED(LED_GREEN, 0);
DbpString("Playing");
// wait for button to be released
while(BUTTON_PRESS())
WDT_HIT();
Dbprintf("%x %x %x", selected, high[selected], low[selected]);
CmdHIDsimTAG(high[selected], low[selected], 0);
DbpString("Done playing");
if (BUTTON_HELD(1000) > 0)
{
DbpString("Exiting");
LEDsoff();
return;
}
/* We pressed a button so ignore it here with a delay */
SpinDelay(300);
// when done, we're done playing, move to next option
selected = (selected + 1) % OPTS;
playing = !playing;
LEDsoff();
LED(selected + 1, 0);
}
else
while(BUTTON_PRESS())
WDT_HIT();
}
}
}
#endif
/*
OBJECTIVE
Listen and detect an external reader. Determine the best location
for the antenna.
INSTRUCTIONS:
Inside the ListenReaderField() function, there is two mode.
By default, when you call the function, you will enter mode 1.
If you press the PM3 button one time, you will enter mode 2.
If you press the PM3 button a second time, you will exit the function.
DESCRIPTION OF MODE 1:
This mode just listens for an external reader field and lights up green
for HF and/or red for LF. This is the original mode of the detectreader
function.
DESCRIPTION OF MODE 2:
This mode will visually represent, using the LEDs, the actual strength of the
current compared to the maximum current detected. Basically, once you know
what kind of external reader is present, it will help you spot the best location to place
your antenna. You will probably not get some good results if there is a LF and a HF reader
at the same place! :-)
LIGHT SCHEME USED:
*/
static const char LIGHT_SCHEME[] = {
0x0, /* ---- | No field detected */
0x1, /* X--- | 14% of maximum current detected */
0x2, /* -X-- | 29% of maximum current detected */
0x4, /* --X- | 43% of maximum current detected */
0x8, /* ---X | 57% of maximum current detected */
0xC, /* --XX | 71% of maximum current detected */
0xE, /* -XXX | 86% of maximum current detected */
0xF, /* XXXX | 100% of maximum current detected */
};
static const int LIGHT_LEN = sizeof(LIGHT_SCHEME)/sizeof(LIGHT_SCHEME[0]);
void ListenReaderField(int limit)
{
int lf_av, lf_av_new, lf_baseline= 0, lf_count= 0, lf_max;
int hf_av, hf_av_new, hf_baseline= 0, hf_count= 0, hf_max;
int mode=1, display_val, display_max, i;
#define LF_ONLY 1
#define HF_ONLY 2
LEDsoff();
lf_av=lf_max=ReadAdc(ADC_CHAN_LF);
if(limit != HF_ONLY) {
Dbprintf("LF 125/134 Baseline: %d", lf_av);
lf_baseline = lf_av;
}
hf_av=hf_max=ReadAdc(ADC_CHAN_HF);
if (limit != LF_ONLY) {
Dbprintf("HF 13.56 Baseline: %d", hf_av);
hf_baseline = hf_av;
}
for(;;) {
if (BUTTON_PRESS()) {
SpinDelay(500);
switch (mode) {
case 1:
mode=2;
DbpString("Signal Strength Mode");
break;
case 2:
default:
DbpString("Stopped");
LEDsoff();
return;
break;
}
}
WDT_HIT();
if (limit != HF_ONLY) {
if(mode==1) {
if (abs(lf_av - lf_baseline) > 10) LED_D_ON();
else LED_D_OFF();
}
++lf_count;
lf_av_new= ReadAdc(ADC_CHAN_LF);
// see if there's a significant change
if(abs(lf_av - lf_av_new) > 10) {
Dbprintf("LF 125/134 Field Change: %x %x %x", lf_av, lf_av_new, lf_count);
lf_av = lf_av_new;
if (lf_av > lf_max)
lf_max = lf_av;
lf_count= 0;
}
}
if (limit != LF_ONLY) {
if (mode == 1){
if (abs(hf_av - hf_baseline) > 10) LED_B_ON();
else LED_B_OFF();
}
++hf_count;
hf_av_new= ReadAdc(ADC_CHAN_HF);
// see if there's a significant change
if(abs(hf_av - hf_av_new) > 10) {
Dbprintf("HF 13.56 Field Change: %x %x %x", hf_av, hf_av_new, hf_count);
hf_av = hf_av_new;
if (hf_av > hf_max)
hf_max = hf_av;
hf_count= 0;
}
}
if(mode == 2) {
if (limit == LF_ONLY) {
display_val = lf_av;
display_max = lf_max;
} else if (limit == HF_ONLY) {
display_val = hf_av;
display_max = hf_max;
} else { /* Pick one at random */
if( (hf_max - hf_baseline) > (lf_max - lf_baseline) ) {
display_val = hf_av;
display_max = hf_max;
} else {
display_val = lf_av;
display_max = lf_max;
}
}
for (i=0; i<LIGHT_LEN; i++) {
if (display_val >= ((display_max/LIGHT_LEN)*i) && display_val <= ((display_max/LIGHT_LEN)*(i+1))) {
if (LIGHT_SCHEME[i] & 0x1) LED_C_ON(); else LED_C_OFF();
if (LIGHT_SCHEME[i] & 0x2) LED_A_ON(); else LED_A_OFF();
if (LIGHT_SCHEME[i] & 0x4) LED_B_ON(); else LED_B_OFF();
if (LIGHT_SCHEME[i] & 0x8) LED_D_ON(); else LED_D_OFF();
break;
}
}
}
}
}
void UsbPacketReceived(uint8_t *packet, int len)
{
UsbCommand *c = (UsbCommand *)packet;
// Dbprintf("received %d bytes, with command: 0x%04x and args: %d %d %d",len,c->cmd,c->arg[0],c->arg[1],c->arg[2]);
switch(c->cmd) {
#ifdef WITH_LF
case CMD_ACQUIRE_RAW_ADC_SAMPLES_125K:
AcquireRawAdcSamples125k(c->arg[0]);
cmd_send(CMD_ACK,0,0,0,0,0);
break;
case CMD_MOD_THEN_ACQUIRE_RAW_ADC_SAMPLES_125K:
ModThenAcquireRawAdcSamples125k(c->arg[0],c->arg[1],c->arg[2],c->d.asBytes);
break;
case CMD_HID_DEMOD_FSK:
CmdHIDdemodFSK(0, 0, 0, 1); // Demodulate HID tag
break;
case CMD_HID_SIM_TAG:
CmdHIDsimTAG(c->arg[0], c->arg[1], 1); // Simulate HID tag by ID
break;
case CMD_HID_CLONE_TAG: // Clone HID tag by ID to T55x7
CopyHIDtoT55x7(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes[0]);
break;
case CMD_EM410X_WRITE_TAG:
WriteEM410x(c->arg[0], c->arg[1], c->arg[2]);
break;
case CMD_READ_TI_TYPE:
ReadTItag();
break;
case CMD_WRITE_TI_TYPE:
WriteTItag(c->arg[0],c->arg[1],c->arg[2]);
break;
case CMD_SIMULATE_TAG_125K:
LED_A_ON();
SimulateTagLowFrequency(c->arg[0], c->arg[1], 1);
LED_A_OFF();
break;
case CMD_LF_SIMULATE_BIDIR:
SimulateTagLowFrequencyBidir(c->arg[0], c->arg[1]);
break;
case CMD_INDALA_CLONE_TAG: // Clone Indala 64-bit tag by UID to T55x7
CopyIndala64toT55x7(c->arg[0], c->arg[1]);
break;
case CMD_INDALA_CLONE_TAG_L: // Clone Indala 224-bit tag by UID to T55x7
CopyIndala224toT55x7(c->d.asDwords[0], c->d.asDwords[1], c->d.asDwords[2], c->d.asDwords[3], c->d.asDwords[4], c->d.asDwords[5], c->d.asDwords[6]);
break;
case CMD_T55XX_READ_BLOCK:
T55xxReadBlock(c->arg[1], c->arg[2],c->d.asBytes[0]);
break;
case CMD_T55XX_WRITE_BLOCK:
T55xxWriteBlock(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes[0]);
break;
case CMD_T55XX_READ_TRACE: // Clone HID tag by ID to T55x7
T55xxReadTrace();
break;
case CMD_PCF7931_READ: // Read PCF7931 tag
ReadPCF7931();
cmd_send(CMD_ACK,0,0,0,0,0);
// UsbSendPacket((uint8_t*)&ack, sizeof(ack));
break;
case CMD_EM4X_READ_WORD:
EM4xReadWord(c->arg[1], c->arg[2],c->d.asBytes[0]);
break;
case CMD_EM4X_WRITE_WORD:
EM4xWriteWord(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes[0]);
break;
#endif
#ifdef WITH_HITAG
case CMD_SNOOP_HITAG: // Eavesdrop Hitag tag, args = type
SnoopHitag(c->arg[0]);
break;
case CMD_SIMULATE_HITAG: // Simulate Hitag tag, args = memory content
SimulateHitagTag((bool)c->arg[0],(byte_t*)c->d.asBytes);
break;
case CMD_READER_HITAG: // Reader for Hitag tags, args = type and function
ReaderHitag((hitag_function)c->arg[0],(hitag_data*)c->d.asBytes);
break;
#endif
#ifdef WITH_ISO15693
case CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_15693:
AcquireRawAdcSamplesIso15693();
break;
case CMD_RECORD_RAW_ADC_SAMPLES_ISO_15693:
RecordRawAdcSamplesIso15693();
break;
case CMD_ISO_15693_COMMAND:
DirectTag15693Command(c->arg[0],c->arg[1],c->arg[2],c->d.asBytes);
break;
case CMD_ISO_15693_FIND_AFI:
BruteforceIso15693Afi(c->arg[0]);
break;
case CMD_ISO_15693_DEBUG:
SetDebugIso15693(c->arg[0]);
break;
case CMD_READER_ISO_15693:
ReaderIso15693(c->arg[0]);
break;
case CMD_SIMTAG_ISO_15693:
SimTagIso15693(c->arg[0]);
break;
#endif
#ifdef WITH_LEGICRF
case CMD_SIMULATE_TAG_LEGIC_RF:
LegicRfSimulate(c->arg[0], c->arg[1], c->arg[2]);
break;
case CMD_WRITER_LEGIC_RF:
LegicRfWriter(c->arg[1], c->arg[0]);
break;
case CMD_READER_LEGIC_RF:
LegicRfReader(c->arg[0], c->arg[1]);
break;
#endif
#ifdef WITH_ISO14443b
case CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_14443:
AcquireRawAdcSamplesIso14443(c->arg[0]);
break;
case CMD_READ_SRI512_TAG:
ReadSRI512Iso14443(c->arg[0]);
break;
case CMD_READ_SRIX4K_TAG:
ReadSRIX4KIso14443(c->arg[0]);
break;
case CMD_SNOOP_ISO_14443:
SnoopIso14443();
break;
case CMD_SIMULATE_TAG_ISO_14443:
SimulateIso14443Tag();
break;
#endif
#ifdef WITH_ISO14443a
case CMD_SNOOP_ISO_14443a:
SnoopIso14443a(c->arg[0]);
break;
case CMD_READER_ISO_14443a:
ReaderIso14443a(c);
break;
case CMD_SIMULATE_TAG_ISO_14443a:
SimulateIso14443aTag(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes); // ## Simulate iso14443a tag - pass tag type & UID
break;
case CMD_EPA_PACE_COLLECT_NONCE:
EPA_PACE_Collect_Nonce(c);
break;
case CMD_READER_MIFARE:
ReaderMifare(c->arg[0]);
break;
case CMD_MIFARE_READBL:
MifareReadBlock(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
break;
case CMD_MIFARE_READSC:
MifareReadSector(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
break;
case CMD_MIFARE_WRITEBL:
MifareWriteBlock(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
break;
case CMD_MIFARE_NESTED:
MifareNested(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
break;
case CMD_MIFARE_CHKKEYS:
MifareChkKeys(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
break;
case CMD_SIMULATE_MIFARE_CARD:
Mifare1ksim(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
break;
// emulator
case CMD_MIFARE_SET_DBGMODE:
MifareSetDbgLvl(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
break;
case CMD_MIFARE_EML_MEMCLR:
MifareEMemClr(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
break;
case CMD_MIFARE_EML_MEMSET:
MifareEMemSet(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
break;
case CMD_MIFARE_EML_MEMGET:
MifareEMemGet(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
break;
case CMD_MIFARE_EML_CARDLOAD:
MifareECardLoad(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
break;
// Work with "magic Chinese" card
case CMD_MIFARE_EML_CSETBLOCK:
MifareCSetBlock(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
break;
case CMD_MIFARE_EML_CGETBLOCK:
MifareCGetBlock(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
break;
// mifare sniffer
case CMD_MIFARE_SNIFFER:
SniffMifare(c->arg[0]);
break;
#endif
#ifdef WITH_ICLASS
// Makes use of ISO14443a FPGA Firmware
case CMD_SNOOP_ICLASS:
SnoopIClass();
break;
case CMD_SIMULATE_TAG_ICLASS:
SimulateIClass(c->arg[0], c->d.asBytes);
break;
case CMD_READER_ICLASS:
ReaderIClass(c->arg[0]);
break;
#endif
case CMD_SIMULATE_TAG_HF_LISTEN:
SimulateTagHfListen();
break;
case CMD_BUFF_CLEAR:
BufferClear();
break;
case CMD_MEASURE_ANTENNA_TUNING:
MeasureAntennaTuning();
break;
case CMD_MEASURE_ANTENNA_TUNING_HF:
MeasureAntennaTuningHf();
break;
case CMD_LISTEN_READER_FIELD:
ListenReaderField(c->arg[0]);
break;
case CMD_FPGA_MAJOR_MODE_OFF: // ## FPGA Control
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
SpinDelay(200);
LED_D_OFF(); // LED D indicates field ON or OFF
break;
case CMD_DOWNLOAD_RAW_ADC_SAMPLES_125K:
// UsbCommand n;
// if(c->cmd == CMD_DOWNLOAD_RAW_ADC_SAMPLES_125K) {
// n.cmd = CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K;
// } else {
// n.cmd = CMD_DOWNLOADED_RAW_BITS_TI_TYPE;
// }
// n.arg[0] = c->arg[0];
// memcpy(n.d.asBytes, BigBuf+c->arg[0], 48); // 12*sizeof(uint32_t)
// LED_B_ON();
// usb_write((uint8_t *)&n, sizeof(n));
// UsbSendPacket((uint8_t *)&n, sizeof(n));
// LED_B_OFF();
LED_B_ON();
for(size_t i=0; i<c->arg[1]; i += USB_CMD_DATA_SIZE) {
size_t len = MIN((c->arg[1] - i),USB_CMD_DATA_SIZE);
cmd_send(CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K,i,len,0,((byte_t*)BigBuf)+c->arg[0]+i,len);
}
// Trigger a finish downloading signal with an ACK frame
cmd_send(CMD_ACK,0,0,0,0,0);
LED_B_OFF();
break;
case CMD_DOWNLOADED_SIM_SAMPLES_125K: {
uint8_t *b = (uint8_t *)BigBuf;
memcpy(b+c->arg[0], c->d.asBytes, 48);
//Dbprintf("copied 48 bytes to %i",b+c->arg[0]);
// UsbSendPacket((uint8_t*)&ack, sizeof(ack));
cmd_send(CMD_ACK,0,0,0,0,0);
break;
}
case CMD_READ_MEM:
ReadMem(c->arg[0]);
break;
case CMD_SET_LF_DIVISOR:
FpgaSendCommand(FPGA_CMD_SET_DIVISOR, c->arg[0]);
break;
case CMD_SET_ADC_MUX:
switch(c->arg[0]) {
case 0: SetAdcMuxFor(GPIO_MUXSEL_LOPKD); break;
case 1: SetAdcMuxFor(GPIO_MUXSEL_LORAW); break;
case 2: SetAdcMuxFor(GPIO_MUXSEL_HIPKD); break;
case 3: SetAdcMuxFor(GPIO_MUXSEL_HIRAW); break;
}
break;
case CMD_VERSION:
SendVersion();
break;
#ifdef WITH_LCD
case CMD_LCD_RESET:
LCDReset();
break;
case CMD_LCD:
LCDSend(c->arg[0]);
break;
#endif
case CMD_SETUP_WRITE:
case CMD_FINISH_WRITE:
case CMD_HARDWARE_RESET:
usb_disable();
SpinDelay(1000);
SpinDelay(1000);
AT91C_BASE_RSTC->RSTC_RCR = RST_CONTROL_KEY | AT91C_RSTC_PROCRST;
for(;;) {
// We're going to reset, and the bootrom will take control.
}
break;
case CMD_START_FLASH:
if(common_area.flags.bootrom_present) {
common_area.command = COMMON_AREA_COMMAND_ENTER_FLASH_MODE;
}
usb_disable();
AT91C_BASE_RSTC->RSTC_RCR = RST_CONTROL_KEY | AT91C_RSTC_PROCRST;
for(;;);
break;
case CMD_DEVICE_INFO: {
uint32_t dev_info = DEVICE_INFO_FLAG_OSIMAGE_PRESENT | DEVICE_INFO_FLAG_CURRENT_MODE_OS;
if(common_area.flags.bootrom_present) dev_info |= DEVICE_INFO_FLAG_BOOTROM_PRESENT;
// UsbSendPacket((uint8_t*)&c, sizeof(c));
cmd_send(CMD_DEVICE_INFO,dev_info,0,0,0,0);
break;
}
default:
Dbprintf("%s: 0x%04x","unknown command:",c->cmd);
break;
}
}
void __attribute__((noreturn)) AppMain(void)
{
SpinDelay(100);
if(common_area.magic != COMMON_AREA_MAGIC || common_area.version != 1) {
/* Initialize common area */
memset(&common_area, 0, sizeof(common_area));
common_area.magic = COMMON_AREA_MAGIC;
common_area.version = 1;
}
common_area.flags.osimage_present = 1;
LED_D_OFF();
LED_C_OFF();
LED_B_OFF();
LED_A_OFF();
// Init USB device`
usb_enable();
// UsbStart();
// The FPGA gets its clock from us from PCK0 output, so set that up.
AT91C_BASE_PIOA->PIO_BSR = GPIO_PCK0;
AT91C_BASE_PIOA->PIO_PDR = GPIO_PCK0;
AT91C_BASE_PMC->PMC_SCER = AT91C_PMC_PCK0;
// PCK0 is PLL clock / 4 = 96Mhz / 4 = 24Mhz
AT91C_BASE_PMC->PMC_PCKR[0] = AT91C_PMC_CSS_PLL_CLK |
AT91C_PMC_PRES_CLK_4;
AT91C_BASE_PIOA->PIO_OER = GPIO_PCK0;
// Reset SPI
AT91C_BASE_SPI->SPI_CR = AT91C_SPI_SWRST;
// Reset SSC
AT91C_BASE_SSC->SSC_CR = AT91C_SSC_SWRST;
// Load the FPGA image, which we have stored in our flash.
FpgaDownloadAndGo();
StartTickCount();
#ifdef WITH_LCD
LCDInit();
#endif
byte_t rx[sizeof(UsbCommand)];
size_t rx_len;
for(;;) {
if (usb_poll()) {
rx_len = usb_read(rx,sizeof(UsbCommand));
if (rx_len) {
UsbPacketReceived(rx,rx_len);
}
}
// UsbPoll(FALSE);
WDT_HIT();
#ifdef WITH_LF
if (BUTTON_HELD(1000) > 0)
SamyRun();
#endif
}
}
================================================
FILE: TamagotchiFriends/proxmark/armsrc/apps.h
================================================
//-----------------------------------------------------------------------------
// Jonathan Westhues, Aug 2005
// Gerhard de Koning Gans, April 2008, May 2011
//
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
// at your option, any later version. See the LICENSE.txt file for the text of
// the license.
//-----------------------------------------------------------------------------
// Definitions internal to the app source.
//-----------------------------------------------------------------------------
#ifndef __APPS_H
#define __APPS_H
#include <stdint.h>
#include <stddef.h>
#include "common.h"
#include "hitag2.h"
#include "mifare.h"
// The large multi-purpose buffer, typically used to hold A/D samples,
// maybe processed in some way.
uint8_t BigBuf[40000];
// BIG CHANGE - UNDERSTAND THIS BEFORE WE COMMIT
#define TRACE_OFFSET 0
#define TRACE_SIZE 3000
#define RECV_CMD_OFFSET 3032
#define RECV_CMD_SIZE 64
#define RECV_RES_OFFSET 3096
#define RECV_RES_SIZE 64
#define DMA_BUFFER_OFFSET 3160
#define DMA_BUFFER_SIZE 4096
#define FREE_BUFFER_OFFSET 7256
#define FREE_BUFFER_SIZE 2744
extern const uint8_t OddByteParity[256];
extern uint8_t *trace; // = (uint8_t *) BigBuf;
extern int traceLen; // = 0;
extern int rsamples; // = 0;
extern int tracing; // = TRUE;
extern uint8_t trigger;
// This may be used (sparingly) to declare a function to be copied to
// and executed from RAM
#define RAMFUNC __attribute((long_call, section(".ramfunc")))
/// appmain.h
void ReadMem(int addr);
void __attribute__((noreturn)) AppMain(void);
void SamyRun(void);
//void DbpIntegers(int a, int b, int c);
void DbpString(char *str);
void Dbprintf(const char *fmt, ...);
void Dbhexdump(int len, uint8_t *d, bool bAsci);
int AvgAdc(int ch);
void ToSendStuffBit(int b);
void ToSendReset(void);
void ListenReaderField(int limit);
void AcquireRawAdcSamples125k(int at134khz);
void DoAcquisition125k(void);
extern int ToSendMax;
extern uint8_t ToSend[];
extern uint8_t BigBuf[];
/// fpga.h
void FpgaSendCommand(uint16_t cmd, uint16_t v);
void FpgaWriteConfWord(uint8_t v);
void FpgaDownloadAndGo(void);
void FpgaGatherVersion(char *dst, int len);
void FpgaSetupSsc(void);
void SetupSpi(int mode);
bool FpgaSetupSscDma(uint8_t *buf, int len);
#define FpgaDisableSscDma(void) AT91C_BASE_PDC_SSC->PDC_PTCR = AT91C_PDC_RXTDIS;
#define FpgaEnableSscDma(void) AT91C_BASE_PDC_SSC->PDC_PTCR = AT91C_PDC_RXTEN;
void SetAdcMuxFor(uint32_t whichGpio);
// Definitions for the FPGA commands.
#define FPGA_CMD_SET_CONFREG (1<<12)
#define FPGA_CMD_SET_DIVISOR (2<<12)
// Definitions for the FPGA configuration word.
#define FPGA_MAJOR_MODE_LF_READER (0<<5)
#define FPGA_MAJOR_MODE_LF_EDGE_DETECT (1<<5)
#define FPGA_MAJOR_MODE_HF_READER_TX (2<<5)
#define FPGA_MAJOR_MODE_HF_READER_RX_XCORR (3<<5)
#define FPGA_MAJOR_MODE_HF_SIMULATOR (4<<5)
#define FPGA_MAJOR_MODE_HF_ISO14443A (5<<5)
#define FPGA_MAJOR_MODE_LF_PASSTHRU (6<<5)
#define FPGA_MAJOR_MODE_OFF (7<<5)
// Options for LF_EDGE_DETECT
#define FPGA_LF_EDGE_DETECT_READER_FIELD (1<<0)
// Options for the HF reader, tx to tag
#define FPGA_HF_READER_TX_SHALLOW_MOD (1<<0)
// Options for the HF reader, correlating against rx from tag
#define FPGA_HF_READER_RX_XCORR_848_KHZ (1<<0)
#define FPGA_HF_READER_RX_XCORR_SNOOP (1<<1)
#define FPGA_HF_READER_RX_XCORR_QUARTER_FREQ (1<<2)
// Options for the HF simulated tag, how to modulate
#define FPGA_HF_SIMULATOR_NO_MODULATION (0<<0)
#define FPGA_HF_SIMULATOR_MODULATE_BPSK (1<<0)
#define FPGA_HF_SIMULATOR_MODULATE_212K (2<<0)
// Options for ISO14443A
#define FPGA_HF_ISO14443A_SNIFFER (0<<0)
#define FPGA_HF_ISO14443A_TAGSIM_LISTEN (1<<0)
#define FPGA_HF_ISO14443A_TAGSIM_MOD (2<<0)
#define FPGA_HF_ISO14443A_READER_LISTEN (3<<0)
#define FPGA_HF_ISO14443A_READER_MOD (4<<0)
/// lfops.h
void AcquireRawAdcSamples125k(int at134khz);
void ModThenAcquireRawAdcSamples125k(int delay_off,int period_0,int period_1,uint8_t *command);
void ReadTItag(void);
void WriteTItag(uint32_t idhi, uint32_t idlo, uint16_t crc);
void AcquireTiType(void);
void AcquireRawBitsTI(void);
void SimulateTagLowFrequency(int period, int gap, int ledcontrol);
void CmdHIDsimTAG(int hi, int lo, int ledcontrol);
void CmdHIDdemodFSK(int findone, int *high, int *low, int ledcontrol);
void SimulateTagLowFrequencyBidir(int divisor, int max_bitlen);
void CopyHIDtoT55x7(uint32_t hi2, uint32_t hi, uint32_t lo, uint8_t longFMT); // Clone an HID card to T5557/T5567
void WriteEM410x(uint32_t card, uint32_t id_hi, uint32_t id_lo);
void CopyIndala64toT55x7(int hi, int lo); // Clone Indala 64-bit tag by UID to T55x7
void CopyIndala224toT55x7(int uid1, int uid2, int uid3, int uid4, int uid5, int uid6, int uid7); // Clone Indala 224-bit tag by UID to T55x7
void T55xxWriteBlock(uint32_t Data, uint32_t Block, uint32_t Pwd, uint8_t PwdMode);
void T55xxReadBlock(uint32_t Block, uint32_t Pwd, uint8_t PwdMode );
void T55xxReadTrace(void);
int DemodPCF7931(uint8_t **outBlocks);
int IsBlock0PCF7931(uint8_t *Block);
int IsBlock1PCF7931(uint8_t *Block);
void ReadPCF7931();
void EM4xReadWord(uint8_t Address, uint32_t Pwd, uint8_t PwdMode);
void EM4xWriteWord(uint32_t Data, uint8_t Address, uint32_t Pwd, uint8_t PwdMode);
/// iso14443.h
void SimulateIso14443Tag(void);
void AcquireRawAdcSamplesIso14443(uint32_t parameter);
void ReadSRI512Iso14443(uint32_t parameter);
void ReadSRIX4KIso14443(uint32_t parameter);
void ReadSTMemoryIso14443(uint32_t parameter,uint32_t dwLast);
void RAMFUNC SnoopIso14443(void);
/// iso14443a.h
void RAMFUNC SnoopIso14443a(uint8_t param);
void SimulateIso14443aTag(int tagType, int uid_1st, int uid_2nd, byte_t* data);
void ReaderIso14443a(UsbCommand * c);
// Also used in iclass.c
int RAMFUNC LogTrace(const uint8_t * btBytes, int iLen, int iSamples, uint32_t dwParity, int bReader);
uint32_t GetParity(const uint8_t * pbtCmd, int iLen);
void iso14a_set_trigger(bool enable);
void iso14a_clear_trace();
void iso14a_set_tracing(bool enable);
void RAMFUNC SniffMifare(uint8_t param);
/// epa.h
void EPA_PACE_Collect_Nonce(UsbCommand * c);
// mifarecmd.h
void ReaderMifare(bool first_try);
void MifareReadBlock(uint8_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *data);
void MifareReadSector(uint8_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *datain);
void MifareWriteBlock(uint8_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *datain);
void MifareNested(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datain);
void MifareChkKeys(uint8_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *datain);
void Mifare1ksim(uint8_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *datain);
void MifareSetDbgLvl(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datain);
void MifareEMemClr(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datain);
void MifareEMemSet(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datain);
void MifareEMemGet(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datain);
void MifareECardLoad(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datain);
void MifareCSetBlock(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datain); // Work with "magic Chinese" card
void MifareCGetBlock(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datain);
/// iso15693.h
void RecordRawAdcSamplesIso15693(void);
void AcquireRawAdcSamplesIso15693(void);
void ReaderIso15693(uint32_t parameter); // Simulate an ISO15693 reader - greg
void SimTagIso15693(uint32_t parameter); // simulate an ISO15693 tag - greg
void BruteforceIso15693Afi(uint32_t speed); // find an AFI of a tag - atrox
void DirectTag15693Command(uint32_t datalen,uint32_t speed, uint32_t recv, uint8_t data[]); // send arbitrary commands from CLI - atrox
void SetDebugIso15693(uint32_t flag);
/// iclass.h
void RAMFUNC SnoopIClass(void);
void SimulateIClass(uint8_t arg0, uint8_t *datain);
void ReaderIClass(uint8_t arg0);
// hitag2.h
void SnoopHitag(uint32_t type);
void SimulateHitagTag(bool tag_mem_supplied, byte_t* data);
void ReaderHitag(hitag_function htf, hitag_data* htd);
// cmd.h
bool cmd_receive(UsbCommand* cmd);
bool cmd_send(uint32_t cmd, uint32_t arg0, uint32_t arg1, uint32_t arg2, void* data, size_t len);
/// util.h
#endif
================================================
FILE: TamagotchiFriends/proxmark/armsrc/crapto1.c
================================================
/* crapto1.c
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, US$
Copyright (C) 2008-2008 bla <blapost@gmail.com>
*/
#include "crapto1.h"
#include <stdlib.h>
#if !defined LOWMEM && defined __GNUC__
static uint8_t filterlut[1 << 20];
static void __attribute__((constructor)) fill_lut()
{
uint32_t i;
for(i = 0; i < 1 << 20; ++i)
filterlut[i] = filter(i);
}
#define filter(x) (filterlut[(x) & 0xfffff])
#endif
static void quicksort(uint32_t* const start, uint32_t* const stop)
{
uint32_t *it = start + 1, *rit = stop;
if(it > rit)
return;
while(it < rit)
if(*it <= *start)
++it;
else if(*rit > *start)
--rit;
else
*it ^= (*it ^= *rit, *rit ^= *it);
if(*rit >= *start)
--rit;
if(rit != start)
*rit ^= (*rit ^= *start, *start ^= *rit);
quicksort(start, rit - 1);
quicksort(rit + 1, stop);
}
/** binsearch
* Binary search for the first occurence of *stop's MSB in sorted [start,stop]
*/
static inline uint32_t* binsearch(uint32_t *start, uint32_t *stop)
{
uint32_t mid, val = *stop & 0xff000000;
while(start != stop)
if(start[mid = (stop - start) >> 1] > val)
stop = &start[mid];
else
start += mid + 1;
return start;
}
/** update_contribution
* helper, calculates the partial linear feedback contributions and puts in MSB
*/
static inline void
update_contribution(uint32_t *item, const uint32_t mask1, const uint32_t mask2)
{
uint32_t p = *item >> 25;
p = p << 1 | parity(*item & mask1);
p = p << 1 | parity(*item & mask2);
*item = p << 24 | (*item & 0xffffff);
}
/** extend_table
* using a bit of the keystream extend the table of possible lfsr states
*/
static inline void
extend_table(uint32_t *tbl, uint32_t **end, int bit, int m1, int m2, uint32_t in)
{
in <<= 24;
for(*tbl <<= 1; tbl <= *end; *++tbl <<= 1)
if(filter(*tbl) ^ filter(*tbl | 1)) {
*tbl |= filter(*tbl) ^ bit;
update_contribution(tbl, m1, m2);
*tbl ^= in;
} else if(filter(*tbl) == bit) {
*++*end = tbl[1];
tbl[1] = tbl[0] | 1;
update_contribution(tbl, m1, m2);
*tbl++ ^= in;
update_contribution(tbl, m1, m2);
*tbl ^= in;
} else
*tbl-- = *(*end)--;
}
/** extend_table_simple
* using a bit of the keystream extend the table of possible lfsr states
*/
static inline void extend_table_simple(uint32_t *tbl, uint32_t **end, int bit)
{
for(*tbl <<= 1; tbl <= *end; *++tbl <<= 1)
if(filter(*tbl) ^ filter(*tbl | 1))
*tbl |= filter(*tbl) ^ bit;
else if(filter(*tbl) == bit) {
*++*end = *++tbl;
*tbl = tbl[-1] | 1;
} else
*tbl-- = *(*end)--;
}
/** recover
* recursively narrow down the search space, 4 bits of keystream at a time
*/
static struct Crypto1State*
recover(uint32_t *o_head, uint32_t *o_tail, uint32_t oks,
uint32_t *e_head, uint32_t *e_tail, uint32_t eks, int rem,
struct Crypto1State *sl, uint32_t in)
{
uint32_t *o, *e, i;
if(rem == -1) {
for(e = e_head; e <= e_tail; ++e) {
*e = *e << 1 ^ parity(*e & LF_POLY_EVEN) ^ !!(in & 4);
for(o = o_head; o <= o_tail; ++o, ++sl) {
sl->even = *o;
sl->odd = *e ^ parity(*o & LF_POLY_ODD);
sl[1].odd = sl[1].even = 0;
}
}
return sl;
}
for(i = 0; i < 4 && rem--; i++) {
oks >>= 1;
eks >>= 1;
in >>= 2;
extend_table(o_head, &o_tail, oks & 1, LF_POLY_EVEN << 1 | 1,
LF_POLY_ODD << 1, 0);
if(o_head > o_tail)
return sl;
extend_table(e_head, &e_tail, eks & 1, LF_POLY_ODD,
LF_POLY_EVEN << 1 | 1, in & 3);
if(e_head > e_tail)
return sl;
}
quicksort(o_head, o_tail);
quicksort(e_head, e_tail);
while(o_tail >= o_head && e_tail >= e_head)
if(((*o_tail ^ *e_tail) >> 24) == 0) {
o_tail = binsearch(o_head, o = o_tail);
e_tail = binsearch(e_head, e = e_tail);
sl = recover(o_tail--, o, oks,
e_tail--, e, eks, rem, sl, in);
}
else if(*o_tail > *e_tail)
o_tail = binsearch(o_head, o_tail) - 1;
else
e_tail = binsearch(e_head, e_tail) - 1;
return sl;
}
/** lfsr_recovery
* recover the state of the lfsr given 32 bits of the keystream
* additionally you can use the in parameter to specify the value
* that was fed into the lfsr at the time the keystream was generated
*/
struct Crypto1State* lfsr_recovery32(uint32_t ks2, uint32_t in)
{
struct Crypto1State *statelist;
uint32_t *odd_head = 0, *odd_tail = 0, oks = 0;
uint32_t *even_head = 0, *even_tail = 0, eks = 0;
int i;
for(i = 31; i >= 0; i -= 2)
oks = oks << 1 | BEBIT(ks2, i);
for(i = 30; i >= 0; i -= 2)
eks = eks << 1 | BEBIT(ks2, i);
odd_head = odd_tail = malloc(sizeof(uint32_t) << 21);
even_head = even_tail = malloc(sizeof(uint32_t) << 21);
statelist = malloc(sizeof(struct Crypto1State) << 18);
if(!odd_tail-- || !even_tail-- || !statelist) {
free(statelist);
statelist = 0;
goto out;
}
statelist->odd = statelist->even = 0;
for(i = 1 << 20; i >= 0; --i) {
if(filter(i) == (oks & 1))
*++odd_tail = i;
if(filter(i) == (eks & 1))
*++even_tail = i;
}
for(i = 0; i < 4; i++) {
extend_table_simple(odd_head, &odd_tail, (oks >>= 1) & 1);
extend_table_simple(even_head, &even_tail, (eks >>= 1) & 1);
}
in = (in >> 16 & 0xff) | (in << 16) | (in & 0xff00);
recover(odd_head, odd_tail, oks,
even_head, even_tail, eks, 11, statelist, in << 1);
out:
free(odd_head);
free(even_head);
return statelist;
}
static const uint32_t S1[] = { 0x62141, 0x310A0, 0x18850, 0x0C428, 0x06214,
0x0310A, 0x85E30, 0xC69AD, 0x634D6, 0xB5CDE, 0xDE8DA, 0x6F46D, 0xB3C83,
0x59E41, 0xA8995, 0xD027F, 0x6813F, 0x3409F, 0x9E6FA};
static const uint32_t S2[] = { 0x3A557B00, 0x5D2ABD80, 0x2E955EC0, 0x174AAF60,
0x0BA557B0, 0x05D2ABD8, 0x0449DE68, 0x048464B0, 0x42423258, 0x278192A8,
0x156042D0, 0x0AB02168, 0x43F89B30, 0x61FC4D98, 0x765EAD48, 0x7D8FDD20,
0x7EC7EE90, 0x7F63F748, 0x79117020};
static const uint32_t T1[] = {
0x4F37D, 0x279BE, 0x97A6A, 0x4BD35, 0x25E9A, 0x12F4D, 0x097A6, 0x80D66,
0xC4006, 0x62003, 0xB56B4, 0x5AB5A, 0xA9318, 0xD0F39, 0x6879C, 0xB057B,
0x582BD, 0x2C15E, 0x160AF, 0x8F6E2, 0xC3DC4, 0xE5857, 0x72C2B, 0x39615,
0x98DBF, 0xC806A, 0xE0680, 0x70340, 0x381A0, 0x98665, 0x4C332, 0xA272C};
static const uint32_t T2[] = { 0x3C88B810, 0x5E445C08, 0x2982A580, 0x14C152C0,
0x4A60A960, 0x253054B0, 0x52982A58, 0x2FEC9EA8, 0x1156C4D0, 0x08AB6268,
0x42F53AB0, 0x217A9D58, 0x161DC528, 0x0DAE6910, 0x46D73488, 0x25CB11C0,
0x52E588E0, 0x6972C470, 0x34B96238, 0x5CFC3A98, 0x28DE96C8, 0x12CFC0E0,
0x4967E070, 0x64B3F038, 0x74F97398, 0x7CDC3248, 0x38CE92A0, 0x1C674950,
0x0E33A4A8, 0x01B959D0, 0x40DCACE8, 0x26CEDDF0};
static const uint32_t C1[] = { 0x846B5, 0x4235A, 0x211AD};
static const uint32_t C2[] = { 0x1A822E0, 0x21A822E0, 0x21A822E0};
/** Reverse 64 bits of keystream into possible cipher states
* Variation mentioned in the paper. Somewhat optimized version
*/
struct Crypto1State* lfsr_recovery64(uint32_t ks2, uint32_t ks3)
{
struct Crypto1State *statelist, *sl;
uint8_t oks[32], eks[32], hi[32];
uint32_t low = 0, win = 0;
uint32_t *tail, table[1 << 16];
int i, j;
sl = statelist = malloc(sizeof(struct Crypto1State) << 4);
if(!sl)
return 0;
sl->odd = sl->even = 0;
for(i = 30; i >= 0; i -= 2) {
oks[i >> 1] = BEBIT(ks2, i);
oks[16 + (i >> 1)] = BEBIT(ks3, i);
}
for(i = 31; i >= 0; i -= 2) {
eks[i >> 1] = BEBIT(ks2, i);
eks[16 + (i >> 1)] = BEBIT(ks3, i);
}
for(i = 0xfffff; i >= 0; --i) {
if (filter(i) != oks[0])
continue;
*(tail = table) = i;
for(j = 1; tail >= table && j < 29; ++j)
extend_table_simple(table, &tail, oks[j]);
if(tail < table)
continue;
for(j = 0; j < 19; ++j)
low = low << 1 | parity(i & S1[j]);
for(j = 0; j < 32; ++j)
hi[j] = parity(i & T1[j]);
for(; tail >= table; --tail) {
for(j = 0; j < 3; ++j) {
*tail = *tail << 1;
*tail |= parity((i & C1[j]) ^ (*tail & C2[j]));
if(filter(*tail) != oks[29 + j])
goto continue2;
}
for(j = 0; j < 19; ++j)
win = win << 1 | parity(*tail & S2[j]);
win ^= low;
for(j = 0; j < 32; ++j) {
win = win << 1 ^ hi[j] ^ parity(*tail & T2[j]);
if(filter(win) != eks[j])
goto continue2;
}
*tail = *tail << 1 | parity(LF_POLY_EVEN & *tail);
sl->odd = *tail ^ parity(LF_POLY_ODD & win);
sl->even = win;
++sl;
sl->odd = sl->even = 0;
continue2:;
}
}
return statelist;
}
/** lfsr_rollback_bit
* Rollback the shift register in order to get previous states
*/
uint8_t lfsr_rollback_bit(struct Crypto1State *s, uint32_t in, int fb)
{
int out;
uint8_t ret;
s->odd &= 0xffffff;
s->odd ^= (s->odd ^= s->even, s->even ^= s->odd);
out = s->even & 1;
out ^= LF_POLY_EVEN & (s->even >>= 1);
out ^= LF_POLY_ODD & s->odd;
out ^= !!in;
out ^= (ret = filter(s->odd)) & !!fb;
s->even |= parity(out) << 23;
return ret;
}
/** lfsr_rollback_byte
* Rollback the shift register in order to get previous states
*/
uint8_t lfsr_rollback_byte(struct Crypto1State *s, uint32_t in, int fb)
{
int i, ret = 0;
for (i = 7; i >= 0; --i)
ret |= lfsr_rollback_bit(s, BIT(in, i), fb) << i;
return ret;
}
/** lfsr_rollback_word
* Rollback the shift register in order to get previous states
*/
uint32_t lfsr_rollback_word(struct Crypto1State *s, uint32_t in, int fb)
{
int i;
uint32_t ret = 0;
for (i = 31; i >= 0; --i)
ret |= lfsr_rollback_bit(s, BEBIT(in, i), fb) << (i ^ 24);
return ret;
}
/** nonce_distance
* x,y valid tag nonces, then prng_successor(x, nonce_distance(x, y)) = y
*/
static uint16_t *dist = 0;
int nonce_distance(uint32_t from, uint32_t to)
{
uint16_t x, i;
if(!dist) {
dist = malloc(2 << 16);
if(!dist)
return -1;
for (x = i = 1; i; ++i) {
dist[(x & 0xff) << 8 | x >> 8] = i;
x = x >> 1 | (x ^ x >> 2 ^ x >> 3 ^ x >> 5) << 15;
}
}
return (65535 + dist[to >> 16] - dist[from >> 16]) % 65535;
}
static uint32_t fastfwd[2][8] = {
{ 0, 0x4BC53, 0xECB1, 0x450E2, 0x25E29, 0x6E27A, 0x2B298, 0x60ECB},
{ 0, 0x1D962, 0x4BC53, 0x56531, 0xECB1, 0x135D3, 0x450E2, 0x58980}};
/** lfsr_prefix_ks
*
* Is an exported helper function from the common prefix attack
* Described in the "dark side" paper. It returns an -1 terminated array
* of possible partial(21 bit) secret state.
* The required keystream(ks) needs to contain the keystream that was used to
* encrypt the NACK which is observed when varying only the 3 last bits of Nr
* only correct iff [NR_3] ^ NR_3 does not depend on Nr_3
*/
uint32_t *lfsr_prefix_ks(uint8_t ks[8], int isodd)
{
uint32_t c, entry, *candidates = malloc(4 << 10);
int i, size = 0, good;
if(!candidates)
return 0;
for(i = 0; i < 1 << 21; ++i) {
for(c = 0, good = 1; good && c < 8; ++c) {
entry = i ^ fastfwd[isodd][c];
good &= (BIT(ks[c], isodd) == filter(entry >> 1));
good &= (BIT(ks[c], isodd + 2) == filter(entry));
}
if(good)
candidates[size++] = i;
}
candidates[size] = -1;
return candidates;
}
/** check_pfx_parity
* helper function which eliminates possible secret states using parity bits
*/
static struct Crypto1State*
check_pfx_parity(uint32_t prefix, uint32_t rresp, uint8_t parities[8][8],
uint32_t odd, uint32_t even, struct Crypto1State* sl)
{
uint32_t ks1, nr, ks2, rr, ks3, c, good = 1;
for(c = 0; good && c < 8; ++c) {
sl->odd = odd ^ fastfwd[1][c];
sl->even = even ^ fastfwd[0][c];
lfsr_rollback_bit(sl, 0, 0);
lfsr_rollback_bit(sl, 0, 0);
ks3 = lfsr_rollback_bit(sl, 0, 0);
ks2 = lfsr_rollback_word(sl, 0, 0);
ks1 = lfsr_rollback_word(sl, prefix | c << 5, 1);
nr = ks1 ^ (prefix | c << 5);
rr = ks2 ^ rresp;
good &= parity(nr & 0x000000ff) ^ parities[c][3] ^ BIT(ks2, 24);
good &= parity(rr & 0xff000000) ^ parities[c][4] ^ BIT(ks2, 16);
good &= parity(rr & 0x00ff0000) ^ parities[c][5] ^ BIT(ks2, 8);
good &= parity(rr & 0x0000ff00) ^ parities[c][6] ^ BIT(ks2, 0);
good &= parity(rr & 0x000000ff) ^ parities[c][7] ^ ks3;
}
return sl + good;
}
/** lfsr_common_prefix
* Implentation of the common prefix attack.
*/
struct Crypto1State*
lfsr_common_prefix(uint32_t pfx, uint32_t rr, uint8_t ks[8], uint8_t par[8][8])
{
struct Crypto1State *statelist, *s;
uint32_t *odd, *even, *o, *e, top;
odd = lfsr_prefix_ks(ks, 1);
even = lfsr_prefix_ks(ks, 0);
s = statelist = malloc((sizeof *statelist) << 20);
if(!s || !odd || !even) {
free(statelist);
statelist = 0;
goto out;
}
for(o = odd; *o + 1; ++o)
for(e = even; *e + 1; ++e)
for(top = 0; top < 64; ++top) {
*o += 1 << 21;
*e += (!(top & 7) + 1) << 21;
s = check_pfx_parity(pfx, rr, par, *o, *e, s);
}
s->odd = s->even = 0;
out:
free(odd);
free(even);
return statelist;
}
================================================
FILE: TamagotchiFriends/proxmark/armsrc/crapto1.h
================================================
/* crapto1.h
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, US$
Copyright (C) 2008-2008 bla <blapost@gmail.com>
*/
#ifndef CRAPTO1_INCLUDED
#define CRAPTO1_INCLUDED
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
struct Crypto1State {uint32_t odd, even;};
void crypto1_create(struct Crypto1State *s, uint64_t key);
void crypto1_destroy(struct Crypto1State*);
void crypto1_get_lfsr(struct Crypto1State*, uint64_t*);
uint8_t crypto1_bit(struct Crypto1State*, uint8_t, int);
uint8_t crypto1_byte(struct Crypto1State*, uint8_t, int);
uint32_t crypto1_word(struct Crypto1State*, uint32_t, int);
uint32_t prng_successor(uint32_t x, uint32_t n);
struct Crypto1State* lfsr_recovery32(uint32_t ks2, uint32_t in);
struct Crypto1State* lfsr_recovery64(uint32_t ks2, uint32_t ks3);
uint32_t *lfsr_prefix_ks(uint8_t ks[8], int isodd);
struct Crypto1State*
lfsr_common_prefix(uint32_t pfx, uint32_t rr, uint8_t ks[8], uint8_t par[8][8]);
uint8_t lfsr_rollback_bit(struct Crypto1State* s, uint32_t in, int fb);
uint8_t lfsr_rollback_byte(struct Crypto1State* s, uint32_t in, int fb);
uint32_t lfsr_rollback_word(struct Crypto1State* s, uint32_t in, int fb);
int nonce_distance(uint32_t from, uint32_t to);
#define FOREACH_VALID_NONCE(N, FILTER, FSIZE)\
uint32_t __n = 0,__M = 0, N = 0;\
int __i;\
for(; __n < 1 << 16; N = prng_successor(__M = ++__n, 16))\
for(__i = FSIZE - 1; __i >= 0; __i--)\
if(BIT(FILTER, __i) ^ parity(__M & 0xFF01))\
break;\
else if(__i)\
__M = prng_successor(__M, (__i == 7) ? 48 : 8);\
else
#define LF_POLY_ODD (0x29CE5C)
#define LF_POLY_EVEN (0x870804)
#define BIT(x, n) ((x) >> (n) & 1)
#define BEBIT(x, n) BIT(x, (n) ^ 24)
static inline int parity(uint32_t x)
{
#if !defined __i386__ || !defined __GNUC__
x ^= x >> 16;
x ^= x >> 8;
x ^= x >> 4;
return BIT(0x6996, x & 0xf);
#else
asm( "movl %1, %%eax\n"
"mov %%ax, %%cx\n"
"shrl $0x10, %%eax\n"
"xor %%ax, %%cx\n"
"xor %%ch, %%cl\n"
"setpo %%al\n"
"movzx %%al, %0\n": "=r"(x) : "r"(x): "eax","ecx");
return x;
#endif
}
static inline int filter(uint32_t const x)
{
uint32_t f;
f = 0xf22c0 >> (x & 0xf) & 16;
f |= 0x6c9c0 >> (x >> 4 & 0xf) & 8;
f |= 0x3c8b0 >> (x >> 8 & 0xf) & 4;
f |= 0x1e458 >> (x >> 12 & 0xf) & 2;
f |= 0x0d938 >> (x >> 16 & 0xf) & 1;
return BIT(0xEC57E80A, f);
}
#ifdef __cplusplus
}
#endif
#endif
================================================
FILE: TamagotchiFriends/proxmark/armsrc/crypto1.c
================================================
/* crypto1.c
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, US
Copyright (C) 2008-2008 bla <blapost@gmail.com>
*/
#include "crapto1.h"
#include <stdlib.h>
#define SWAPENDIAN(x)\
(x = (x >> 8 & 0xff00ff) | (x & 0xff00ff) << 8, x = x >> 16 | x << 16)
void crypto1_create(struct Crypto1State *s, uint64_t key)
{
// struct Crypto1State *s = malloc(sizeof(*s));
int i;
for(i = 47;s && i > 0; i -= 2) {
s->odd = s->odd << 1 | BIT(key, (i - 1) ^ 7);
s->even = s->even << 1 | BIT(key, i ^ 7);
}
return;
}
void crypto1_destroy(struct Crypto1State *state)
{
// free(state);
state->odd = 0;
state->even = 0;
}
void crypto1_get_lfsr(struct Crypto1State *state, uint64_t *lfsr)
{
int i;
for(*lfsr = 0, i = 23; i >= 0; --i) {
*lfsr = *lfsr << 1 | BIT(state->odd, i ^ 3);
*lfsr = *lfsr << 1 | BIT(state->even, i ^ 3);
}
}
uint8_t crypto1_bit(struct Crypto1State *s, uint8_t in, int is_encrypted)
{
uint32_t feedin;
uint8_t ret = filter(s->odd);
feedin = ret & !!is_encrypted;
feedin ^= !!in;
feedin ^= LF_POLY_ODD & s->odd;
feedin ^= LF_POLY_EVEN & s->even;
s->even = s->even << 1 | parity(feedin);
s->odd ^= (s->odd ^= s->even, s->even ^= s->odd);
return ret;
}
uint8_t crypto1_byte(struct Crypto1State *s, uint8_t in, int is_encrypted)
{
uint8_t i, ret = 0;
for (i = 0; i < 8; ++i)
ret |= crypto1_bit(s, BIT(in, i), is_encrypted) << i;
return ret;
}
uint32_t crypto1_word(struct Crypto1State *s, uint32_t in, int is_encrypted)
{
uint32_t i, ret = 0;
for (i = 0; i < 32; ++i)
ret |= crypto1_bit(s, BEBIT(in, i), is_encrypted) << (i ^ 24);
return ret;
}
/* prng_successor
* helper used to obscure the keystream during authentication
*/
uint32_t prng_successor(uint32_t x, uint32_t n)
{
SWAPENDIAN(x);
while(n--)
x = x >> 1 | (x >> 16 ^ x >> 18 ^ x >> 19 ^ x >> 21) << 31;
return SWAPENDIAN(x);
}
================================================
FILE: TamagotchiFriends/proxmark/armsrc/epa.c
================================================
//-----------------------------------------------------------------------------
// Frederik Möllers - August 2012
//
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
// at your option, any later version. See the LICENSE.txt file for the text of
// the license.
//-----------------------------------------------------------------------------
// Routines to support the German eletronic "Personalausweis" (ID card)
// Note that the functions which do not implement USB commands do NOT initialize
// the card (with iso14443a_select_card etc.). If You want to use these
// functions, You need to do the setup before calling them!
//-----------------------------------------------------------------------------
#include "iso14443a.h"
#include "epa.h"
#include "cmd.h"
// Protocol and Parameter Selection Request
// use regular (1x) speed in both directions
// CRC is already included
static const uint8_t pps[] = {0xD0, 0x11, 0x00, 0x52, 0xA6};
// APDUs for communication with German Identification Card
// General Authenticate (request encrypted nonce) WITHOUT the Le at the end
static const uint8_t apdu_general_authenticate_pace_get_nonce[] = {
0x10, // CLA
0x86, // INS
0x00, // P1
0x00, // P2
0x02, // Lc
0x7C, // Type: Dynamic Authentication Data
0x00, // Length: 0 bytes
};
// MSE: Set AT (only CLA, INS, P1 and P2)
static const uint8_t apdu_mse_set_at_start[] = {
0x00, // CLA
0x22, // INS
0xC1, // P1
0xA4, // P2
};
// SELECT BINARY with the ID for EF.CardAccess
static const uint8_t apdu_select_binary_cardaccess[] = {
0x00, // CLA
0xA4, // INS
0x02, // P1
0x0C, // P2
0x02, // Lc
0x01, // ID
0x1C // ID
};
// READ BINARY
static const uint8_t apdu_read_binary[] = {
0x00, // CLA
0xB0, // INS
0x00, // P1
0x00, // P2
0x38 // Le
};
// the leading bytes of a PACE OID
static const uint8_t oid_pace_start[] = {
0x04, // itu-t, identified-organization
0x00, // etsi
0x7F, // reserved
0x00, // etsi-identified-organization
0x07, // bsi-de
0x02, // protocols
0x02, // smartcard
0x04 // id-PACE
};
//-----------------------------------------------------------------------------
// Closes the communication channel and turns off the field
//-----------------------------------------------------------------------------
void EPA_Finish()
{
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
LEDsoff();
}
//-----------------------------------------------------------------------------
// Parses DER encoded data, e.g. from EF.CardAccess and fills out the given
// structs. If a pointer is 0, it is ignored.
// The function returns 0 on success and if an error occured, it returns the
// offset where it occured.
//
// TODO: This function can access memory outside of the given data if the DER
// encoding is broken
// TODO: Support skipping elements with a length > 0x7F
// TODO: Support OIDs with a length > 7F
// TODO: Support elements with long tags (tag is longer than 1 byte)
// TODO: Support proprietary PACE domain parameters
//-----------------------------------------------------------------------------
size_t EPA_Parse_CardAccess(uint8_t *data,
size_t length,
pace_version_info_t *pace_info)
{
size_t index = 0;
while (index <= length - 2) {
// determine type of element
// SET or SEQUENCE
if (data[index] == 0x31 || data[index] == 0x30) {
// enter the set (skip tag + length)
index += 2;
// extended length
if ((data[index - 1] & 0x80) != 0) {
index += (data[index] & 0x7F);
}
}
// OID
else if (data[index] == 0x06) {
// is this a PACE OID?
if (data[index + 1] == 0x0A // length matches
&& memcmp(data + index + 2,
oid_pace_start,
sizeof(oid_pace_start)) == 0 // content matches
&& pace_info != NULL)
{
// first, clear the pace_info struct
memset(pace_info, 0, sizeof(pace_version_info_t));
memcpy(pace_info->oid, data + index + 2, sizeof(pace_info->oid));
// a PACE OID is followed by the version
index += data[index + 1] + 2;
if (data[index] == 02 && data[index + 1] == 01) {
pace_info->version = data[index + 2];
index += 3;
}
else {
return index;
}
// after that there might(!) be the parameter ID
if (data[index] == 02 && data[index + 1] == 01) {
pace_info->parameter_id = data[index + 2];
index += 3;
}
}
else {
// skip this OID
index += 2 + data[index + 1];
}
}
// if the length is 0, something is wrong
// TODO: This needs to be extended to support long tags
else if (data[index + 1] == 0) {
return index;
}
else {
// skip this part
// TODO: This needs to be extended to support long tags
// TODO: This needs to be extended to support unknown elements with
// a size > 0x7F
index += 2 + data[index + 1];
}
}
// TODO: We should check whether we reached the end in error, but for that
// we need a better parser (e.g. with states like IN_SET or IN_PACE_INFO)
return 0;
}
//-----------------------------------------------------------------------------
// Read the file EF.CardAccess and save it into a buffer (at most max_length bytes)
// Returns -1 on failure or the length of the data on success
// TODO: for the moment this sends only 1 APDU regardless of the requested length
//-----------------------------------------------------------------------------
int EPA_Read_CardAccess(uint8_t *buffer, size_t max_length)
{
// the response APDU of the card
// since the card doesn't always care for the expected length we send it,
// we reserve 262 bytes here just to be safe (256-byte APDU + SW + ISO frame)
uint8_t response_apdu[262];
int rapdu_length = 0;
// select the file EF.CardAccess
rapdu_length = iso14_apdu((uint8_t *)apdu_select_binary_cardaccess,
sizeof(apdu_select_binary_cardaccess),
response_apdu);
if (rapdu_length != 6
|| response_apdu[rapdu_length - 4] != 0x90
|| response_apdu[rapdu_length - 3] != 0x00)
{
return -1;
}
// read the file
rapdu_length = iso14_apdu((uint8_t *)apdu_read_binary,
sizeof(apdu_read_binary),
response_apdu);
if (rapdu_length <= 6
|| response_apdu[rapdu_length - 4] != 0x90
|| response_apdu[rapdu_length - 3] != 0x00)
{
return -1;
}
// copy the content into the buffer
// length of data available: apdu_length - 4 (ISO frame) - 2 (SW)
size_t to_copy = rapdu_length - 6;
to_copy = to_copy < max_length ? to_copy : max_length;
memcpy(buffer, response_apdu+2, to_copy);
return to_copy;
}
//-----------------------------------------------------------------------------
// Abort helper function for EPA_PACE_Collect_Nonce
// sets relevant data in ack, sends the response
//-----------------------------------------------------------------------------
static void EPA_PACE_Collect_Nonce_Abort(uint8_t step, int func_return)
{
// // step in which the failure occured
// ack->arg[0] = step;
// // last return code
// ack->arg[1] = func_return;
// power down the field
EPA_Finish();
// send the USB packet
cmd_send(CMD_ACK,step,func_return,0,0,0);
//UsbSendPacket((void *)ack, sizeof(UsbCommand));
}
//-----------------------------------------------------------------------------
// Acquire one encrypted PACE nonce
//-----------------------------------------------------------------------------
void EPA_PACE_Collect_Nonce(UsbCommand *c)
{
/*
* ack layout:
* arg:
* 1. element
* step where the error occured or 0 if no error occured
* 2. element
* return code of the last executed function
* d:
* Encrypted nonce
*/
// return value of a function
int func_return;
// // initialize ack with 0s
// memset(ack->arg, 0, 12);
// memset(ack->d.asBytes, 0, 48);
// set up communication
func_return = EPA_Setup();
if (func_return != 0) {
EPA_PACE_Collect_Nonce_Abort(1, func_return);
return;
}
// increase the timeout (at least some cards really do need this!)
iso14a_set_timeout(0x0002FFFF);
// read the CardAccess file
// this array will hold the CardAccess file
uint8_t card_access[256] = {0};
int card_access_length = EPA_Read_CardAccess(card_access, 256);
// the response has to be at least this big to hold the OID
if (card_access_length < 18) {
EPA_PACE_Collect_Nonce_Abort(2, card_access_length);
return;
}
// this will hold the PACE info of the card
pace_version_info_t pace_version_info;
// search for the PACE OID
func_return = EPA_Parse_CardAccess(card_access,
card_access_length,
&pace_version_info);
if (func_return != 0 || pace_version_info.version == 0) {
EPA_PACE_Collect_Nonce_Abort(3, func_return);
return;
}
// initiate the PACE protocol
// use the CAN for the password since that doesn't change
func_return = EPA_PACE_MSE_Set_AT(pace_version_info, 2);
// now get the nonce
uint8_t nonce[256] = {0};
uint8_t requested_size = (uint8_t)c->arg[0];
func_return = EPA_PACE_Get_Nonce(requested_size, nonce);
// check if the command succeeded
if (func_return < 0)
{
EPA_PACE_Collect_Nonce_Abort(4, func_return);
return;
}
// all done, return
EPA_Finish();
// save received information
// ack->arg[1] = func_return;
// memcpy(ack->d.asBytes, nonce, func_return);
// UsbSendPacket((void *)ack, sizeof(UsbCommand));
cmd_send(CMD_ACK,0,func_return,0,nonce,func_return);
}
//-----------------------------------------------------------------------------
// Performs the "Get Nonce" step of the PACE protocol and saves the returned
// nonce. The caller is responsible for allocating enough memory to store the
// nonce. Note that the returned size might be less or than or greater than the
// requested size!
// Returns the actual size of the nonce on success or a less-than-zero error
// code on failure.
//-----------------------------------------------------------------------------
int EPA_PACE_Get_Nonce(uint8_t requested_length, uint8_t *nonce)
{
// build the APDU
uint8_t apdu[sizeof(apdu_general_authenticate_pace_get_nonce) + 1];
// copy the constant part
memcpy(apdu,
apdu_general_authenticate_pace_get_nonce,
sizeof(apdu_general_authenticate_pace_get_nonce));
// append Le (requested length + 2 due to tag/length taking 2 bytes) in RAPDU
apdu[sizeof(apdu_general_authenticate_pace_get_nonce)] = requested_length + 4;
// send it
uint8_t response_apdu[262];
int send_return = iso14_apdu(apdu,
sizeof(apdu),
response_apdu);
// check if the command succeeded
if (send_return < 6
|| response_apdu[send_return - 4] != 0x90
|| response_apdu[send_return - 3] != 0x00)
{
return -1;
}
// if there is no nonce in the RAPDU, return here
if (send_return < 10)
{
// no error
return 0;
}
// get the actual length of the nonce
uint8_t nonce_length = response_apdu[5];
if (nonce_length > send_return - 10)
{
nonce_length = send_return - 10;
}
// copy the nonce
memcpy(nonce, response_apdu + 6, nonce_length);
return nonce_length;
}
//-----------------------------------------------------------------------------
// Initializes the PACE protocol by performing the "MSE: Set AT" step
// Returns 0 on success or a non-zero error code on failure
//-----------------------------------------------------------------------------
int EPA_PACE_MSE_Set_AT(pace_version_info_t pace_version_info, uint8_t password)
{
// create the MSE: Set AT APDU
uint8_t apdu[23];
// the minimum length (will be increased as more data is added)
size_t apdu_length = 20;
// copy the constant part
memcpy(apdu,
apdu_mse_set_at_start,
sizeof(apdu_mse_set_at_start));
// type: OID
apdu[5] = 0x80;
// length of the OID
apdu[6] = sizeof(pace_version_info.oid);
// copy the OID
memcpy(apdu + 7,
pace_version_info.oid,
sizeof(pace_version_info.oid));
// type: password
apdu[17] = 0x83;
// length: 1
apdu[18] = 1;
// password
apdu[19] = password;
// if standardized domain parameters are used, copy the ID
if (pace_version_info.parameter_id != 0) {
apdu_length += 3;
// type: domain parameter
apdu[20] = 0x84;
// length: 1
apdu[21] = 1;
// copy the parameter ID
apdu[22] = pace_version_info.parameter_id;
}
// now set Lc to the actual length
apdu[4] = apdu_length - 5;
// send it
uint8_t response_apdu[6];
int send_return = iso14_apdu(apdu,
apdu_length,
response_apdu);
// check if the command succeeded
if (send_return != 6
|| response_apdu[send_return - 4] != 0x90
|| response_apdu[send_return - 3] != 0x00)
{
return 1;
}
return 0;
}
//-----------------------------------------------------------------------------
// Set up a communication channel (Card Select, PPS)
// Returns 0 on success or a non-zero error code on failure
//-----------------------------------------------------------------------------
int EPA_Setup()
{
// return code
int return_code = 0;
// card UID
uint8_t uid[8];
// card select information
iso14a_card_select_t card_select_info;
// power up the field
iso14443a_setup();
// select the card
return_code = iso14443a_select_card(uid, &card_select_info, NULL);
if (return_code != 1) {
return 1;
}
// send the PPS request
ReaderTransmit((uint8_t *)pps, sizeof(pps));
uint8_t pps_response[3];
return_code = ReaderReceive(pps_response);
if (return_code != 3 || pps_response[0] != 0xD0) {
return return_code == 0 ? 2 : return_code;
}
return 0;
}
================================================
FILE: TamagotchiFriends/proxmark/armsrc/epa.h
================================================
//-----------------------------------------------------------------------------
// Frederik Möllers - August 2012
//
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
// at your option, any later version. See the LICENSE.txt file for the text of
// the license.
//-----------------------------------------------------------------------------
// Routines to support the German eletronic "Personalausweis" (ID card)
//-----------------------------------------------------------------------------
#ifndef __EPA_H
#define __EPA_H
// this struct is used by EPA_Parse_CardAccess and contains info about the
// PACE protocol supported by the chip
typedef struct {
uint8_t oid[10];
uint8_t version;
uint8_t parameter_id;
} pace_version_info_t;
// note: EPA_PACE_GetNonce is declared in apps.h
// general functions
void EPA_Finish();
size_t EPA_Parse_CardAccess(uint8_t *data,
size_t length,
pace_version_info_t *pace_info);
int EPA_Read_CardAccess(uint8_t *buffer, size_t max_length);
int EPA_Setup();
// PACE related functions
int EPA_PACE_MSE_Set_AT(pace_version_info_t pace_version_info, uint8_t password);
int EPA_PACE_Get_Nonce(uint8_t requested_length, uint8_t *nonce);
#endif /* __EPA_H */
================================================
FILE: TamagotchiFriends/proxmark/armsrc/fonts.c
================================================
//-----------------------------------------------------------------------------
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
// at your option, any later version. See the LICENSE.txt file for the text of
// the license.
//-----------------------------------------------------------------------------
// Fonts for the LCD
//-----------------------------------------------------------------------------
const char FONT6x8[97][8] = {
{0x06,0x08,0x08,0x00,0x00,0x00,0x00,0x00}, // columns, rows, bytes per char
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // space
{0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x00}, // !
{0x50,0x50,0x50,0x00,0x00,0x00,0x00,0x00}, // "
{0x50,0x50,0xF8,0x50,0xF8,0x50,0x50,0x00}, // #
{0x20,0x78,0xA0,0x70,0x28,0xF0,0x20,0x00}, // $
{0xC0,0xC8,0x10,0x20,0x40,0x98,0x18,0x00}, // %
{0x40,0xA0,0xA0,0x40,0xA8,0x90,0x68,0x00}, // &
{0x30,0x30,0x20,0x40,0x00,0x00,0x00,0x00}, // '
{0x10,0x20,0x40,0x40,0x40,0x20,0x10,0x00}, // (
{0x40,0x20,0x10,0x10,0x10,0x20,0x40,0x00}, // )
{0x00,0x20,0xA8,0x70,0x70,0xA8,0x20,0x00}, // *
{0x00,0x20,0x20,0xF8,0x20,0x20,0x00,0x00}, // +
{0x00,0x00,0x00,0x00,0x30,0x30,0x20,0x40}, // ,
{0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00}, // -
{0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00}, // .
{0x00,0x08,0x10,0x20,0x40,0x80,0x00,0x00}, // /
{0x70,0x88,0x88,0xA8,0x88,0x88,0x70,0x00}, // 0
{0x20,0x60,0x20,0x20,0x20,0x20,0x70,0x00}, // 1
{0x70,0x88,0x08,0x70,0x80,0x80,0xF8,0x00}, // 2
{0xF8,0x08,0x10,0x30,0x08,0x88,0x70,0x00}, // 3
{0x10,0x30,0x50,0x90,0xF8,0x10,0x10,0x00}, // 4
{0xF8,0x80,0xF0,0x08,0x08,0x88,0x70,0x00}, // 5
{0x38,0x40,0x80,0xF0,0x88,0x88,0x70,0x00}, // 6
{0xF8,0x08,0x08,0x10,0x20,0x40,0x80,0x00}, // 7
{0x70,0x88,0x88,0x70,0x88,0x88,0x70,0x00}, // 8
{0x70,0x88,0x88,0x78,0x08,0x10,0xE0,0x00}, // 9
{0x00,0x00,0x20,0x00,0x20,0x00,0x00,0x00}, // :
{0x00,0x00,0x20,0x00,0x20,0x20,0x40,0x00}, // ;
{0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x00}, // <
{0x00,0x00,0xF8,0x00,0xF8,0x00,0x00,0x00}, // =
{0x40,0x20,0x10,0x08,0x10,0x20,0x40,0x00}, // >
{0x70,0x88,0x08,0x30,0x20,0x00,0x20,0x00}, // ?
{0x70,0x88,0xA8,0xB8,0xB0,0x80,0x78,0x00}, // @
{0x20,0x50,0x88,0x88,0xF8,0x88,0x88,0x00}, // A
{0xF0,0x88,0x88,0xF0,0x88,0x88,0xF0,0x00}, // B
{0x70,0x88,0x80,0x80,0x80,0x88,0x70,0x00}, // C
{0xF0,0x88,0x88,0x88,0x88,0x88,0xF0,0x00}, // D
{0xF8,0x80,0x80,0xF0,0x80,0x80,0xF8,0x00}, // E
{0xF8,0x80,0x80,0xF0,0x80,0x80,0x80,0x00}, // F
{0x78,0x88,0x80,0x80,0x98,0x88,0x78,0x00}, // G
{0x88,0x88,0x88,0xF8,0x88,0x88,0x88,0x00}, // H
{0x70,0x20,0x20,0x20,0x20,0x20,0x70,0x00}, // I
{0x38,0x10,0x10,0x10,0x10,0x90,0x60,0x00}, // J
{0x88,0x90,0xA0,0xC0,0xA0,0x90,0x88,0x00}, // K
{0x80,0x80,0x80,0x80,0x80,0x80,0xF8,0x00}, // L
{0x88,0xD8,0xA8,0xA8,0xA8,0x88,0x88,0x00}, // M
{0x88,0x88,0xC8,0xA8,0x98,0x88,0x88,0x00}, // N
{0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x00}, // O
{0xF0,0x88,0x88,0xF0,0x80,0x80,0x80,0x00}, // P
{0x70,0x88,0x88,0x88,0xA8,0x90,0x68,0x00}, // Q
{0xF0,0x88,0x88,0xF0,0xA0,0x90,0x88,0x00}, // R
{0x70,0x88,0x80,0x70,0x08,0x88,0x70,0x00}, // S
{0xF8,0xA8,0x20,0x20,0x20,0x20,0x20,0x00}, // T
{0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x00}, // U
{0x88,0x88,0x88,0x88,0x88,0x50,0x20,0x00}, // V
{0x88,0x88,0x88,0xA8,0xA8,0xA8,0x50,0x00}, // W
{0x88,0x88,0x50,0x20,0x50,0x88,0x88,0x00}, // X
{0x88,0x88,0x50,0x20,0x20,0x20,0x20,0x00}, // Y
{0xF8,0x08,0x10,0x70,0x40,0x80,0xF8,0x00}, // Z
{0x78,0x40,0x40,0x40,0x40,0x40,0x78,0x00}, // [
{0x00,0x80,0x40,0x20,0x10,0x08,0x00,0x00}, // backslash
{0x78,0x08,0x08,0x08,0x08,0x08,0x78,0x00}, // ]
{0x20,0x50,0x88,0x00,0x00,0x00,0x00,0x00}, // ^
{0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00}, // _
{0x60,0x60,0x20,0x10,0x00,0x00,0x00,0x00}, // `
{0x00,0x00,0x60,0x10,0x70,0x90,0x78,0x00}, // a
{0x80,0x80,0xB0,0xC8,0x88,0xC8,0xB0,0x00}, // b
{0x00,0x00,0x70,0x88,0x80,0x88,0x70,0x00}, // c
{0x08,0x08,0x68,0x98,0x88,0x98,0x68,0x00}, // d
{0x00,0x00,0x70,0x88,0xF8,0x80,0x70,0x00}, // e
{0x10,0x28,0x20,0x70,0x20,0x20,0x20,0x00}, // f
{0x00,0x00,0x70,0x98,0x98,0x68,0x08,0x70}, // g
{0x80,0x80,0xB0,0xC8,0x88,0x88,0x88,0x00}, // h
{0x20,0x00,0x60,0x20,0x20,0x20,0x70,0x00}, // i
{0x10,0x00,0x10,0x10,0x10,0x90,0x60,0x00}, // j
{0x80,0x80,0x90,0xA0,0xC0,0xA0,0x90,0x00}, // k
{0x60,0x20,0x20,0x20,0x20,0x20,0x70,0x00}, // l
{0x00,0x00,0xD0,0xA8,0xA8,0xA8,0xA8,0x00}, // m
{0x00,0x00,0xB0,0xC8,0x88,0x88,0x88,0x00}, // n
{0x00,0x00,0x70,0x88,0x88,0x88,0x70,0x00}, // o
{0x00,0x00,0xB0,0xC8,0xC8,0xB0,0x80,0x80}, // p
{0x00,0x00,0x68,0x98,0x98,0x68,0x08,0x08}, // q
{0x00,0x00,0xB0,0xC8,0x80,0x80,0x80,0x00}, // r
{0x00,0x00,0x78,0x80,0x70,0x08,0xF0,0x00}, // s
{0x20,0x20,0xF8,0x20,0x20,0x28,0x10,0x00}, // t
{0x00,0x00,0x88,0x88,0x88,0x98,0x68,0x00}, // u
{0x00,0x00,0x88,0x88,0x88,0x50,0x20,0x00}, // v
{0x00,0x00,0x88,0x88,0xA8,0xA8,0x50,0x00}, // w
{0x00,0x00,0x88,0x50,0x20,0x50,0x88,0x00}, // x
{0x00,0x00,0x88,0x88,0x78,0x08,0x88,0x70}, // y
{0x00,0x00,0xF8,0x10,0x20,0x40,0xF8,0x00}, // z
{0x10,0x20,0x20,0x40,0x20,0x20,0x10,0x00}, // {
{0x20,0x20,0x20,0x00,0x20,0x20,0x20,0x00}, // |
{0x40,0x20,0x20,0x10,0x20,0x20,0x40,0x00}, // }
{0x40,0xA8,0x10,0x00,0x00,0x00,0x00,0x00}, // ~
{0x70,0xD8,0xD8,0x70,0x00,0x00,0x00,0x00} // DEL
};
/*
const char FONT8x8F[97][8] = {
{0x08,0x08,0x08,0x00,0x00,0x00,0x00,0x00}, // columns, rows, bytes per char
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // space
{0x30,0x78,0x78,0x30,0x30,0x00,0x30,0x00}, // !
{0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00}, // "
{0x6C,0x6C,0xFE,0x6C,0xFE,0x6C,0x6C,0x00}, // #
{0x18,0x3E,0x60,0x3C,0x06,0x7C,0x18,0x00}, // $
{0x00,0x63,0x66,0x0C,0x18,0x33,0x63,0x00}, // %
{0x1C,0x36,0x1C,0x3B,0x6E,0x66,0x3B,0x00}, // &
{0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00}, // '
{0x0C,0x18,0x30,0x30,0x30,0x18,0x0C,0x00}, // (
{0x30,0x18,0x0C,0x0C,0x0C,0x18,0x30,0x00}, // )
{0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00}, // *
{0x00,0x30,0x30,0xFC,0x30,0x30,0x00,0x00}, // +
{0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x30}, // ,
{0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00}, // -
{0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00}, // .
{0x03,0x06,0x0C,0x18,0x30,0x60,0x40,0x00}, // /
{0x3E,0x63,0x63,0x6B,0x63,0x63,0x3E,0x00}, // 0
{0x18,0x38,0x58,0x18,0x18,0x18,0x7E,0x00}, // 1
{0x3C,0x66,0x06,0x1C,0x30,0x66,0x7E,0x00}, // 2
{0x3C,0x66,0x06,0x1C,0x06,0x66,0x3C,0x00}, // 3
{0x0E,0x1E,0x36,0x66,0x7F,0x06,0x0F,0x00}, // 4
{0x7E,0x60,0x7C,0x06,0x06,0x66,0x3C,0x00}, // 5
{0x1C,0x30,0x60,0x7C,0x66,0x66,0x3C,0x00}, // 6
{0x7E,0x66,0x06,0x0C,0x18,0x18,0x18,0x00}, // 7
{0x3C,0x66,0x66,0x3C,0x66,0x66,0x3C,0x00}, // 8
{0x3C,0x66,0x66,0x3E,0x06,0x0C,0x38,0x00}, // 9
{0x00,0x18,0x18,0x00,0x00,0x18,0x18,0x00}, // :
{0x00,0x18,0x18,0x00,0x00,0x18,0x18,0x30}, // ;
{0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x00}, // <
{0x00,0x00,0x7E,0x00,0x00,0x7E,0x00,0x00}, // =
{0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x00}, // >
{0x3C,0x66,0x06,0x0C,0x18,0x00,0x18,0x00}, // ?
{0x3E,0x63,0x6F,0x69,0x6F,0x60,0x3E,0x00}, // @
{0x18,0x3C,0x66,0x66,0x7E,0x66,0x66,0x00}, // A
{0x7E,0x33,0x33,0x3E,0x33,0x33,0x7E,0x00}, // B
{0x1E,0x33,0x60,0x60,0x60,0x33,0x1E,0x00}, // C
{0x7C,0x36,0x33,0x33,0x33,0x36,0x7C,0x00}, // D
{0x7F,0x31,0x34,0x3C,0x34,0x31,0x7F,0x00}, // E
{0x7F,0x31,0x34,0x3C,0x34,0x30,0x78,0x00}, // F
{0x1E,0x33,0x60,0x60,0x67,0x33,0x1F,0x00}, // G
{0x66,0x66,0x66,0x7E,0x66,0x66,0x66,0x00}, // H
{0x3C,0x18,0x18,0x18,0x18,0x18,0x3C,0x00}, // I
{0x0F,0x06,0x06,0x06,0x66,0x66,0x3C,0x00}, // J
{0x73,0x33,0x36,0x3C,0x36,0x33,0x73,0x00}, // K
{0x78,0x30,0x30,0x30,0x31,0x33,0x7F,0x00}, // L
{0x63,0x77,0x7F,0x7F,0x6B,0x63,0x63,0x00}, // M
{0x63,0x73,0x7B,0x6F,0x67,0x63,0x63,0x00}, // N
{0x3E,0x63,0x63,0x63,0x63,0x63,0x3E,0x00}, // O
{0x7E,0x33,0x33,0x3E,0x30,0x30,0x78,0x00}, // P
{0x3C,0x66,0x66,0x66,0x6E,0x3C,0x0E,0x00}, // Q
{0x7E,0x33,0x33,0x3E,0x36,0x33,0x73,0x00}, // R
{0x3C,0x66,0x30,0x18,0x0C,0x66,0x3C,0x00}, // S
{0x7E,0x5A,0x18,0x18,0x18,0x18,0x3C,0x00}, // T
{0x66,0x66,0x66,0x66,0x66,0x66,0x7E,0x00}, // U
{0x66,0x66,0x66,0x66,0x66,0x3C,0x18,0x00}, // V
{0x63,0x63,0x63,0x6B,0x7F,0x77,0x63,0x00}, // W
{0x63,0x63,0x36,0x1C,0x1C,0x36,0x63,0x00}, // X
{0x66,0x66,0x66,0x3C,0x18,0x18,0x3C,0x00}, // Y
{0x7F,0x63,0x46,0x0C,0x19,0x33,0x7F,0x00}, // Z
{0x3C,0x30,0x30,0x30,0x30,0x30,0x3C,0x00}, // [
{0x60,0x30,0x18,0x0C,0x06,0x03,0x01,0x00}, // backslash
{0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x3C,0x00}, // ]
{0x08,0x1C,0x36,0x63,0x00,0x00,0x00,0x00}, // ^
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF}, // _
{0x18,0x18,0x0C,0x00,0x00,0x00,0x00,0x00}, // `
{0x00,0x00,0x3C,0x06,0x3E,0x66,0x3B,0x00}, // a
{0x70,0x30,0x3E,0x33,0x33,0x33,0x6E,0x00}, // b
{0x00,0x00,0x3C,0x66,0x60,0x66,0x3C,0x00}, // c
{0x0E,0x06,0x3E,0x66,0x66,0x66,0x3B,0x00}, // d
{0x00,0x00,0x3C,0x66,0x7E,0x60,0x3C,0x00}, // e
{0x1C,0x36,0x30,0x78,0x30,0x30,0x78,0x00}, // f
{0x00,0x00,0x3B,0x66,0x66,0x3E,0x06,0x7C}, // g
{0x70,0x30,0x36,0x3B,0x33,0x33,0x73,0x00}, // h
{0x18,0x00,0x38,0x18,0x18,0x18,0x3C,0x00}, // i
{0x06,0x00,0x06,0x06,0x06,0x66,0x66,0x3C}, // j
{0x70,0x30,0x33,0x36,0x3C,0x36,0x73,0x00}, // k
{0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00}, // l
{0x00,0x00,0x66,0x7F,0x7F,0x6B,0x63,0x00}, // m
{0x00,0x00,0x7C,0x66,0x66,0x66,0x66,0x00}, // n
{0x00,0x00,0x3C,0x66,0x66,0x66,0x3C,0x00}, // o
{0x00,0x00,0x6E,0x33,0x33,0x3E,0x30,0x78}, // p
{0x00,0x00,0x3B,0x66,0x66,0x3E,0x06,0x0F}, // q
{0x00,0x00,0x6E,0x3B,0x33,0x30,0x78,0x00}, // r
{0x00,0x00,0x3E,0x60,0x3C,0x06,0x7C,0x00}, // s
{0x08,0x18,0x3E,0x18,0x18,0x1A,0x0C,0x00}, // t
{0x00,0x00,0x66,0x66,0x66,0x66,0x3B,0x00}, // u
{0x00,0x00,0x66,0x66,0x66,0x3C,0x18,0x00}, // v
{0x00,0x00,0x63,0x6B,0x7F,0x7F,0x36,0x00}, // w
{0x00,0x00,0x63,0x36,0x1C,0x36,0x63,0x00}, // x
{0x00,0x00,0x66,0x66,0x66,0x3E,0x06,0x7C}, // y
{0x00,0x00,0x7E,0x4C,0x18,0x32,0x7E,0x00}, // z
{0x0E,0x18,0x18,0x70,0x18,0x18,0x0E,0x00}, // {
{0x0C,0x0C,0x0C,0x00,0x0C,0x0C,0x0C,0x00}, // |
{0x70,0x18,0x18,0x0E,0x18,0x18,0x70,0x00}, // }
{0x3B,0x6E,0x00,0x00,0x00,0x00,0x00,0x00}, // ~
{0x1C,0x36,0x36,0x1C,0x00,0x00,0x00,0x00} // DEL
};
const char FONT8x16[97][16] = {
{0x08,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // columns, rows, bytes per char
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // space
{0x00,0x00,0x18,0x3C,0x3C,0x3C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00}, // !
{0x00,0x63,0x63,0x63,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // "
{0x00,0x00,0x00,0x36,0x36,0x7F,0x36,0x36,0x36,0x7F,0x36,0x36,0x00,0x00,0x00,0x00}, // #
{0x0C,0x0C,0x3E,0x63,0x61,0x60,0x3E,0x03,0x03,0x43,0x63,0x3E,0x0C,0x0C,0x00,0x00}, // $
{0x00,0x00,0x00,0x00,0x00,0x61,0x63,0x06,0x0C,0x18,0x33,0x63,0x00,0x00,0x00,0x00}, // %
{0x00,0x00,0x00,0x1C,0x36,0x36,0x1C,0x3B,0x6E,0x66,0x66,0x3B,0x00,0x00,0x00,0x00}, // &
{0x00,0x30,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // '
{0x00,0x00,0x0C,0x18,0x18,0x30,0x30,0x30,0x30,0x18,0x18,0x0C,0x00,0x00,0x00,0x00}, // (
{0x00,0x00,0x18,0x0C,0x0C,0x06,0x06,0x06,0x06,0x0C,0x0C,0x18,0x00,0x00,0x00,0x00}, // )
{0x00,0x00,0x00,0x00,0x42,0x66,0x3C,0xFF,0x3C,0x66,0x42,0x00,0x00,0x00,0x00,0x00}, // *
{0x00,0x00,0x00,0x00,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00}, // +
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00}, // ,
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // -
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00}, // .
{0x00,0x00,0x01,0x03,0x07,0x0E,0x1C,0x38,0x70,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00}, // /
{0x00,0x00,0x3E,0x63,0x63,0x63,0x6B,0x6B,0x63,0x63,0x63,0x3E,0x00,0x00,0x00,0x00}, // 0
{0x00,0x00,0x0C,0x1C,0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x3F,0x00,0x00,0x00,0x00}, // 1
{0x00,0x00,0x3E,0x63,0x03,0x06,0x0C,0x18,0x30,0x61,0x63,0x7F,0x00,0x00,0x00,0x00}, // 2
{0x00,0x00,0x3E,0x63,0x03,0x03,0x1E,0x03,0x03,0x03,0x63,0x3E,0x00,0x00,0x00,0x00}, // 3
{0x00,0x00,0x06,0x0E,0x1E,0x36,0x66,0x66,0x7F,0x06,0x06,0x0F,0x00,0x00,0x00,0x00}, // 4
{0x00,0x00,0x7F,0x60,0x60,0x60,0x7E,0x03,0x03,0x63,0x73,0x3E,0x00,0x00,0x00,0x00}, // 5
{0x00,0x00,0x1C,0x30,0x60,0x60,0x7E,0x63,0x63,0x63,0x63,0x3E,0x00,0x00,0x00,0x00}, // 6
{0x00,0x00,0x7F,0x63,0x03,0x06,0x06,0x0C,0x0C,0x18,0x18,0x18,0x00,0x00,0x00,0x00}, // 7
{0x00,0x00,0x3E,0x63,0x63,0x63,0x3E,0x63,0x63,0x63,0x63,0x3E,0x00,0x00,0x00,0x00}, // 8
{0x00,0x00,0x3E,0x63,0x63,0x63,0x63,0x3F,0x03,0x03,0x06,0x3C,0x00,0x00,0x00,0x00}, // 9
{0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00}, // :
{0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00}, // ;
{0x00,0x00,0x00,0x06,0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x06,0x00,0x00,0x00,0x00}, // <
{0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00}, // =
{0x00,0x00,0x00,0x60,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x60,0x00,0x00,0x00,0x00}, // >
{0x00,0x00,0x3E,0x63,0x63,0x06,0x0C,0x0C,0x0C,0x00,0x0C,0x0C,0x00,0x00,0x00,0x00}, // ?
{0x00,0x00,0x3E,0x63,0x63,0x6F,0x6B,0x6B,0x6E,0x60,0x60,0x3E,0x00,0x00,0x00,0x00}, // @
{0x00,0x00,0x08,0x1C,0x36,0x63,0x63,0x63,0x7F,0x63,0x63,0x63,0x00,0x00,0x00,0x00}, // A
{0x00,0x00,0x7E,0x33,0x33,0x33,0x3E,0x33,0x33,0x33,0x33,0x7E,0x00,0x00,0x00,0x00}, // B
{0x00,0x00,0x1E,0x33,0x61,0x60,0x60,0x60,0x60,0x61,0x33,0x1E,0x00,0x00,0x00,0x00}, // C
{0x00,0x00,0x7C,0x36,0x33,0x33,0x33,0x33,0x33,0x33,0x36,0x7C,0x00,0x00,0x00,0x00}, // D
{0x00,0x00,0x7F,0x33,0x31,0x34,0x3C,0x34,0x30,0x31,0x33,0x7F,0x00,0x00,0x00,0x00}, // E
{0x00,0x00,0x7F,0x33,0x31,0x34,0x3C,0x34,0x30,0x30,0x30,0x78,0x00,0x00,0x00,0x00}, // F
{0x00,0x00,0x1E,0x33,0x61,0x60,0x60,0x6F,0x63,0x63,0x37,0x1D,0x00,0x00,0x00,0x00}, // G
{0x00,0x00,0x63,0x63,0x63,0x63,0x7F,0x63,0x63,0x63,0x63,0x63,0x00,0x00,0x00,0x00}, // H
{0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}, // I
{0x00,0x00,0x0F,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3C,0x00,0x00,0x00,0x00}, // J
{0x00,0x00,0x73,0x33,0x36,0x36,0x3C,0x36,0x36,0x33,0x33,0x73,0x00,0x00,0x00,0x00}, // K
{0x00,0x00,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x33,0x7F,0x00,0x00,0x00,0x00}, // L
{0x00,0x00,0x63,0x77,0x7F,0x6B,0x63,0x63,0x63,0x63,0x63,0x63,0x00,0x00,0x00,0x00}, // M
{0x00,0x00,0x63,0x63,0x73,0x7B,0x7F,0x6F,0x67,0x63,0x63,0x63,0x00,0x00,0x00,0x00}, // N
{0x00,0x00,0x1C,0x36,0x63,0x63,0x63,0x63,0x63,0x63,0x36,0x1C,0x00,0x00,0x00,0x00}, // O
{0x00,0x00,0x7E,0x33,0x33,0x33,0x3E,0x30,0x30,0x30,0x30,0x78,0x00,0x00,0x00,0x00}, // P
{0x00,0x00,0x3E,0x63,0x63,0x63,0x63,0x63,0x63,0x6B,0x6F,0x3E,0x06,0x07,0x00,0x00}, // Q
{0x00,0x00,0x7E,0x33,0x33,0x33,0x3E,0x36,0x36,0x33,0x33,0x73,0x00,0x00,0x00,0x00}, // R
{0x00,0x00,0x3E,0x63,0x63,0x30,0x1C,0x06,0x03,0x63,0x63,0x3E,0x00,0x00,0x00,0x00}, // S
{0x00,0x00,0xFF,0xDB,0x99,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}, // T
{0x00,0x00,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x3E,0x00,0x00,0x00,0x00}, // U
{0x00,0x00,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x36,0x1C,0x08,0x00,0x00,0x00,0x00}, // V
{0x00,0x00,0x63,0x63,0x63,0x63,0x63,0x6B,0x6B,0x7F,0x36,0x36,0x00,0x00,0x00,0x00}, // W
{0x00,0x00,0xC3,0xC3,0x66,0x3C,0x18,0x18,0x3C,0x66,0xC3,0xC3,0x00,0x00,0x00,0x00}, // X
{0x00,0x00,0xC3,0xC3,0xC3,0x66,0x3C,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}, // Y
{0x00,0x00,0x7F,0x63,0x43,0x06,0x0C,0x18,0x30,0x61,0x63,0x7F,0x00,0x00,0x00,0x00}, // Z
{0x00,0x00,0x3C,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3C,0x00,0x00,0x00,0x00}, // [
{0x00,0x00,0x80,0xC0,0xE0,0x70,0x38,0x1C,0x0E,0x07,0x03,0x01,0x00,0x00,0x00,0x00}, // backslash
{0x00,0x00,0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x3C,0x00,0x00,0x00,0x00}, // ]
{0x08,0x1C,0x36,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // ^
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00}, // _
{0x18,0x18,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // `
{0x00,0x00,0x00,0x00,0x00,0x3C,0x46,0x06,0x3E,0x66,0x66,0x3B,0x00,0x00,0x00,0x00}, // a
{0x00,0x00,0x70,0x30,0x30,0x3C,0x36,0x33,0x33,0x33,0x33,0x6E,0x00,0x00,0x00,0x00}, // b
{0x00,0x00,0x00,0x00,0x00,0x3E,0x63,0x60,0x60,0x60,0x63,0x3E,0x00,0x00,0x00,0x00}, // c
{0x00,0x00,0x0E,0x06,0x06,0x1E,0x36,0x66,0x66,0x66,0x66,0x3B,0x00,0x00,0x00,0x00}, // d
{0x00,0x00,0x00,0x00,0x00,0x3E,0x63,0x63,0x7E,0x60,0x63,0x3E,0x00,0x00,0x00,0x00}, // e
{0x00,0x00,0x1C,0x36,0x32,0x30,0x7C,0x30,0x30,0x30,0x30,0x78,0x00,0x00,0x00,0x00}, // f
{0x00,0x00,0x00,0x00,0x00,0x3B,0x66,0x66,0x66,0x66,0x3E,0x06,0x66,0x3C,0x00,0x00}, // g
{0x00,0x00,0x70,0x30,0x30,0x36,0x3B,0x33,0x33,0x33,0x33,0x73,0x00,0x00,0x00,0x00}, // h
{0x00,0x00,0x0C,0x0C,0x00,0x1C,0x0C,0x0C,0x0C,0x0C,0x0C,0x1E,0x00,0x00,0x00,0x00}, // i
{0x00,0x00,0x06,0x06,0x00,0x0E,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3C,0x00,0x00}, // j
{0x00,0x00,0x70,0x30,0x30,0x33,0x33,0x36,0x3C,0x36,0x33,0x73,0x00,0x00,0x00,0x00}, // k
{0x00,0x00,0x1C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x1E,0x00,0x00,0x00,0x00}, // l
{0x00,0x00,0x00,0x00,0x00,0x6E,0x7F,0x6B,0x6B,0x6B,0x6B,0x6B,0x00,0x00,0x00,0x00}, // m
{0x00,0x00,0x00,0x00,0x00,0x6E,0x33,0x33,0x33,0x33,0x33,0x33,0x00,0x00,0x00,0x00}, // n
{0x00,0x00,0x00,0x00,0x00,0x3E,0x63,0x63,0x63,0x63,0x63,0x3E,0x00,0x00,0x00,0x00}, // o
{0x00,0x00,0x00,0x00,0x00,0x6E,0x33,0x33,0x33,0x33,0x3E,0x30,0x30,0x78,0x00,0x00}, // p
{0x00,0x00,0x00,0x00,0x00,0x3B,0x66,0x66,0x66,0x66,0x3E,0x06,0x06,0x0F,0x00,0x00}, // q
{0x00,0x00,0x00,0x00,0x00,0x6E,0x3B,0x33,0x30,0x30,0x30,0x78,0x00,0x00,0x00,0x00}, // r
{0x00,0x00,0x00,0x00,0x00,0x3E,0x63,0x38,0x0E,0x03,0x63,0x3E,0x00,0x00,0x00,0x00}, // s
{0x00,0x00,0x08,0x18,0x18,0x7E,0x18,0x18,0x18,0x18,0x1B,0x0E,0x00,0x00,0x00,0x00}, // t
{0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x3B,0x00,0x00,0x00,0x00}, // u
{0x00,0x00,0x00,0x00,0x00,0x63,0x63,0x36,0x36,0x1C,0x1C,0x08,0x00,0x00,0x00,0x00}, // v
{0x00,0x00,0x00,0x00,0x00,0x63,0x63,0x63,0x6B,0x6B,0x7F,0x36,0x00,0x00,0x00,0x00}, // w
{0x00,0x00,0x00,0x00,0x00,0x63,0x36,0x1C,0x1C,0x1C,0x36,0x63,0x00,0x00,0x00,0x00}, // x
{0x00,0x00,0x00,0x00,0x00,0x63,0x63,0x63,0x63,0x63,0x3F,0x03,0x06,0x3C,0x00,0x00}, // y
{0x00,0x00,0x00,0x00,0x00,0x7F,0x66,0x0C,0x18,0x30,0x63,0x7F,0x00,0x00,0x00,0x00}, // z
{0x00,0x00,0x0E,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00}, // {
{0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00}, // |
{0x00,0x00,0x70,0x18,0x18,0x18,0x0E,0x18,0x18,0x18,0x18,0x70,0x00,0x00,0x00,0x00}, // }
{0x00,0x00,0x3B,0x6E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // ~
{0x00,0x70,0xD8,0xD8,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00} // DEL
};
*/
================================================
FILE: TamagotchiFriends/proxmark/armsrc/fonts.h
================================================
//-----------------------------------------------------------------------------
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
// at your option, any later version. See the LICENSE.txt file for the text of
// the license.
//-----------------------------------------------------------------------------
// Fonts for the LCD
//-----------------------------------------------------------------------------
#ifndef __FONTS_H
#define __FONTS_H
extern const char FONT6x8[97][8];
extern const char FONT8x8F[97][8];
extern const char FONT8x16[97][16];
#endif
================================================
FILE: TamagotchiFriends/proxmark/armsrc/fpgaloader.c
================================================
//-----------------------------------------------------------------------------
// Jonathan Westhues, April 2006
//
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
// at your option, any later version. See the LICENSE.txt file for the text of
// the license.
//-----------------------------------------------------------------------------
// Routines to load the FPGA image, and then to configure the FPGA's major
// mode once it is configured.
//-----------------------------------------------------------------------------
#include "proxmark3.h"
#include "apps.h"
#include "util.h"
#include "string.h"
//-----------------------------------------------------------------------------
// Set up the Serial Peripheral Interface as master
// Used to write the FPGA config word
// May also be used to write to other SPI attached devices like an LCD
//-----------------------------------------------------------------------------
void SetupSpi(int mode)
{
// PA10 -> SPI_NCS2 chip select (LCD)
// PA11 -> SPI_NCS0 chip select (FPGA)
// PA12 -> SPI_MISO Master-In Slave-Out
// PA13 -> SPI_MOSI Master-Out Slave-In
// PA14 -> SPI_SPCK Serial Clock
// Disable PIO control of the following pins, allows use by the SPI peripheral
AT91C_BASE_PIOA->PIO_PDR =
GPIO_NCS0 |
GPIO_NCS2 |
GPIO_MISO |
GPIO_MOSI |
GPIO_SPCK;
AT91C_BASE_PIOA->PIO_ASR =
GPIO_NCS0 |
GPIO_MISO |
GPIO_MOSI |
GPIO_SPCK;
AT91C_BASE_PIOA->PIO_BSR = GPIO_NCS2;
//enable the SPI Peripheral clock
AT91C_BASE_PMC->PMC_PCER = (1<<AT91C_ID_SPI);
// Enable SPI
AT91C_BASE_SPI->SPI_CR = AT91C_SPI_SPIEN;
switch (mode) {
case SPI_FPGA_MODE:
AT91C_BASE_SPI->SPI_MR =
( 0 << 24) | // Delay between chip selects (take default: 6 MCK periods)
(14 << 16) | // Peripheral Chip Select (selects FPGA SPI_NCS0 or PA11)
( 0 << 7) | // Local Loopback Disabled
( 1 << 4) | // Mode Fault Detection disabled
( 0 << 2) | // Chip selects connected directly to peripheral
( 0 << 1) | // Fixed Peripheral Select
( 1 << 0); // Master Mode
AT91C_BASE_SPI->SPI_CSR[0] =
( 1 << 24) | // Delay between Consecutive Transfers (32 MCK periods)
( 1 << 16) | // Delay Before SPCK (1 MCK period)
( 6 << 8) | // Serial Clock Baud Rate (baudrate = MCK/6 = 24Mhz/6 = 4M baud
( 8 << 4) | // Bits per Transfer (16 bits)
( 0 << 3) | // Chip Select inactive after transfer
( 1 << 1) | // Clock Phase data captured on leading edge, changes on following edge
( 0 << 0); // Clock Polarity inactive state is logic 0
break;
case SPI_LCD_MODE:
AT91C_BASE_SPI->SPI_MR =
( 0 << 24) | // Delay between chip selects (take default: 6 MCK periods)
(11 << 16) | // Peripheral Chip Select (selects LCD SPI_NCS2 or PA10)
( 0 << 7) | // Local Loopback Disabled
( 1 << 4) | // Mode Fault Detection disabled
( 0 << 2) | // Chip selects connected directly to peripheral
( 0 << 1) | // Fixed Peripheral Select
( 1 << 0); // Master Mode
AT91C_BASE_SPI->SPI_CSR[2] =
( 1 << 24) | // Delay between Consecutive Transfers (32 MCK periods)
( 1 << 16) | // Delay Before SPCK (1 MCK period)
( 6 << 8) | // Serial Clock Baud Rate (baudrate = MCK/6 = 24Mhz/6 = 4M baud
( 1 << 4) | // Bits per Transfer (9 bits)
( 0 << 3) | // Chip Select inactive after transfer
( 1 << 1) | // Clock Phase data captured on leading edge, changes on following edge
( 0 << 0); // Clock Polarity inactive state is logic 0
break;
default: // Disable SPI
AT91C_BASE_SPI->SPI_CR = AT91C_SPI_SPIDIS;
break;
}
}
//-----------------------------------------------------------------------------
// Set up the synchronous serial port, with the one set of options that we
// always use when we are talking to the FPGA. Both RX and TX are enabled.
//-----------------------------------------------------------------------------
void FpgaSetupSsc(void)
{
// First configure the GPIOs, and get ourselves a clock.
AT91C_BASE_PIOA->PIO_ASR =
GPIO_SSC_FRAME |
GPIO_SSC_DIN |
GPIO_SSC_DOUT |
GPIO_SSC_CLK;
AT91C_BASE_PIOA->PIO_PDR = GPIO_SSC_DOUT;
AT91C_BASE_PMC->PMC_PCER = (1 << AT91C_ID_SSC);
// Now set up the SSC proper, starting from a known state.
AT91C_BASE_SSC->SSC_CR = AT91C_SSC_SWRST;
// RX clock comes from TX clock, RX starts when TX starts, data changes
// on RX clock rising edge, sampled on falling edge
AT91C_BASE_SSC->SSC_RCMR = SSC_CLOCK_MODE_SELECT(1) | SSC_CLOCK_MODE_START(1);
// 8 bits per transfer, no loopback, MSB first, 1 transfer per sync
// pulse, no output sync, start on positive-going edge of sync
AT91C_BASE_SSC->SSC_RFMR = SSC_FRAME_MODE_BITS_IN_WORD(8) | AT91C_SSC_MSBF | SSC_FRAME_MODE_WORDS_PER_TRANSFER(0);
// clock comes from TK pin, no clock output, outputs change on falling
// edge of TK, start on rising edge of TF
AT91C_BASE_SSC->SSC_TCMR = SSC_CLOCK_MODE_SELECT(2) | SSC_CLOCK_MODE_START(5);
// tx framing is the same as the rx framing
AT91C_BASE_SSC->SSC_TFMR = AT91C_BASE_SSC->SSC_RFMR;
AT91C_BASE_SSC->SSC_CR = AT91C_SSC_RXEN | AT91C_SSC_TXEN;
}
//-----------------------------------------------------------------------------
// Set up DMA to receive samples from the FPGA. We will use the PDC, with
// a single buffer as a circular buffer (so that we just chain back to
// ourselves, not to another buffer). The stuff to manipulate those buffers
// is in apps.h, because it should be inlined, for speed.
//-----------------------------------------------------------------------------
bool FpgaSetupSscDma(uint8_t *buf, int len)
{
if (buf == NULL) {
return false;
}
AT91C_BASE_PDC_SSC->PDC_PTCR = AT91C_PDC_RXTDIS;
AT91C_BASE_PDC_SSC->PDC_RPR = (uint32_t) buf;
AT91C_BASE_PDC_SSC->PDC_RCR = len;
AT91C_BASE_PDC_SSC->PDC_RNPR = (uint32_t) buf;
AT91C_BASE_PDC_SSC->PDC_RNCR = len;
AT91C_BASE_PDC_SSC->PDC_PTCR = AT91C_PDC_RXTEN;
return true;
}
static void DownloadFPGA_byte(unsigned char w)
{
#define SEND_BIT(x) { if(w & (1<<x) ) HIGH(GPIO_FPGA_DIN); else LOW(GPIO_FPGA_DIN); HIGH(GPIO_FPGA_CCLK); LOW(GPIO_FPGA_CCLK); }
SEND_BIT(7);
SEND_BIT(6);
SEND_BIT(5);
SEND_BIT(4);
SEND_BIT(3);
SEND_BIT(2);
SEND_BIT(1);
SEND_BIT(0);
}
// Download the fpga image starting at FpgaImage and with length FpgaImageLen bytes
// If bytereversal is set: reverse the byte order in each 4-byte word
static void DownloadFPGA(const char *FpgaImage, int FpgaImageLen, int bytereversal)
{
int i=0;
AT91C_BASE_PIOA->PIO_OER = GPIO_FPGA_ON;
AT91C_BASE_PIOA->PIO_PER = GPIO_FPGA_ON;
HIGH(GPIO_FPGA_ON); // ensure everything is powered on
SpinDelay(50);
LED_D_ON();
// These pins are inputs
AT91C_BASE_PIOA->PIO_ODR =
GPIO_FPGA_NINIT |
GPIO_FPGA_DONE;
// PIO controls the following pins
AT91C_BASE_PIOA->PIO_PER =
GPIO_FPGA_NINIT |
GPIO_FPGA_DONE;
// Enable pull-ups
AT91C_BASE_PIOA->PIO_PPUER =
GPIO_FPGA_NINIT |
GPIO_FPGA_DONE;
// setup initial logic state
HIGH(GPIO_FPGA_NPROGRAM);
LOW(GPIO_FPGA_CCLK);
LOW(GPIO_FPGA_DIN);
// These pins are outputs
AT91C_BASE_PIOA->PIO_OER =
GPIO_FPGA_NPROGRAM |
GPIO_FPGA_CCLK |
GPIO_FPGA_DIN;
// enter FPGA configuration mode
LOW(GPIO_FPGA_NPROGRAM);
SpinDelay(50);
HIGH(GPIO_FPGA_NPROGRAM);
i=100000;
// wait for FPGA ready to accept data signal
while ((i) && ( !(AT91C_BASE_PIOA->PIO_PDSR & GPIO_FPGA_NINIT ) ) ) {
i--;
}
// crude error indicator, leave both red LEDs on and return
if (i==0){
LED_C_ON();
LED_D_ON();
return;
}
if(bytereversal) {
/* This is only supported for uint32_t aligned images */
if( ((int)FpgaImage % sizeof(uint32_t)) == 0 ) {
i=0;
while(FpgaImageLen-->0)
DownloadFPGA_byte(FpgaImage[(i++)^0x3]);
/* Explanation of the magic in the above line:
* i^0x3 inverts the lower two bits of the integer i, counting backwards
* for each 4 byte increment. The generated sequence of (i++)^3 is
* 3 2 1 0 7 6 5 4 11 10 9 8 15 14 13 12 etc. pp.
*/
}
} else {
while(FpgaImageLen-->0)
DownloadFPGA_byte(*FpgaImage++);
}
// continue to clock FPGA until ready signal goes high
i=100000;
while ( (i--) && ( !(AT91C_BASE_PIOA->PIO_PDSR & GPIO_FPGA_DONE ) ) ) {
HIGH(GPIO_FPGA_CCLK);
LOW(GPIO_FPGA_CCLK);
}
// crude error indicator, leave both red LEDs on and return
if (i==0){
LED_C_ON();
LED_D_ON();
return;
}
LED_D_OFF();
}
static char *bitparse_headers_start;
static char *bitparse_bitstream_end;
static int bitparse_initialized;
/* Simple Xilinx .bit parser. The file starts with the fixed opaque byte sequence
* 00 09 0f f0 0f f0 0f f0 0f f0 00 00 01
* After that the format is 1 byte section type (ASCII character), 2 byte length
* (big endian), <length> bytes content. Except for section 'e' which has 4 bytes
* length.
*/
static const char _bitparse_fixed_header[] = {0x00, 0x09, 0x0f, 0xf0, 0x0f, 0xf0, 0x0f, 0xf0, 0x0f, 0xf0, 0x00, 0x00, 0x01};
static int bitparse_init(void * start_address, void *end_address)
{
bitparse_initialized = 0;
if(memcmp(_bitparse_fixed_header, start_address, sizeof(_bitparse_fixed_header)) != 0) {
return 0; /* Not matched */
} else {
bitparse_headers_start= ((char*)start_address) + sizeof(_bitparse_fixed_header);
bitparse_bitstream_end= (char*)end_address;
bitparse_initialized = 1;
return 1;
}
}
int bitparse_find_section(char section_name, char **section_start, unsigned int *section_length)
{
char *pos = bitparse_headers_start;
int result = 0;
if(!bitparse_initialized) return 0;
while(pos < bitparse_bitstream_end) {
char current_name = *pos++;
unsigned int current_length = 0;
if(current_name < 'a' || current_name > 'e') {
/* Strange section name, abort */
break;
}
current_length = 0;
switch(current_name) {
case 'e':
/* Four byte length field */
current_length += (*pos++) << 24;
current_length += (*pos++) << 16;
default: /* Fall through, two byte length field */
current_length += (*pos++) << 8;
current_length += (*pos++) << 0;
}
if(current_name != 'e' && current_length > 255) {
/* Maybe a parse error */
break;
}
if(current_name == section_name) {
/* Found it */
*section_start = pos;
*section_length = current_length;
result = 1;
break;
}
pos += current_length; /* Skip section */
}
return result;
}
//-----------------------------------------------------------------------------
// Find out which FPGA image format is stored in flash, then call DownloadFPGA
// with the right parameters to download the image
//-----------------------------------------------------------------------------
extern char _binary_fpga_bit_start, _binary_fpga_bit_end;
void FpgaDownloadAndGo(void)
{
/* Check for the new flash image format: Should have the .bit file at &_binary_fpga_bit_start
*/
if(bitparse_init(&_binary_fpga_bit_start, &_binary_fpga_bit_end)) {
/* Successfully initialized the .bit parser. Find the 'e' section and
* send its contents to the FPGA.
*/
char *bitstream_start;
unsigned int bitstream_length;
if(bitparse_find_section('e', &bitstream_start, &bitstream_length)) {
DownloadFPGA(bitstream_start, bitstream_length, 0);
return; /* All done */
}
}
/* Fallback for the old flash image format: Check for the magic marker 0xFFFFFFFF
* 0xAA995566 at address 0x102000. This is raw bitstream with a size of 336,768 bits
* = 10,524 uint32_t, stored as uint32_t e.g. little-endian in memory, but each DWORD
* is still to be transmitted in MSBit first order. Set the invert flag to indicate
* that the DownloadFPGA function should invert every 4 byte sequence when doing
* the bytewise download.
*/
if( *(uint32_t*)0x102000 == 0xFFFFFFFF && *(uint32_t*)0x102004 == 0xAA995566 )
DownloadFPGA((char*)0x102000, 10524*4, 1);
}
void FpgaGatherVersion(char *dst, int len)
{
char *fpga_info;
unsigned int fpga_info_len;
dst[0] = 0;
if(!bitparse_find_section('e', &fpga_info, &fpga_info_len)) {
strncat(dst, "FPGA image: legacy image without version information", len-1);
} else {
strncat(dst, "FPGA image built", len-1);
/* USB packets only have 48 bytes data payload, so be terse */
#if 0
if(bitparse_find_section('a', &fpga_info, &fpga_info_len) && fpga_info[fpga_info_len-1] == 0 ) {
strncat(dst, " from ", len-1);
strncat(dst, fpga_info, len-1);
}
if(bitparse_find_section('b', &fpga_info, &fpga_info_len) && fpga_info[fpga_info_len-1] == 0 ) {
strncat(dst, " for ", len-1);
strncat(dst, fpga_info, len-1);
}
#endif
if(bitparse_find_section('c', &fpga_info, &fpga_info_len) && fpga_info[fpga_info_len-1] == 0 ) {
strncat(dst, " on ", len-1);
strncat(dst, fpga_info, len-1);
}
if(bitparse_find_section('d', &fpga_info, &fpga_info_len) && fpga_info[fpga_info_len-1] == 0 ) {
strncat(dst, " at ", len-1);
strncat(dst, fpga_info, len-1);
}
}
}
//-----------------------------------------------------------------------------
// Send a 16 bit command/data pair to the FPGA.
// The bit format is: C3 C2 C1 C0 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
// where C is the 4 bit command and D is the 12 bit data
//-----------------------------------------------------------------------------
void FpgaSendCommand(uint16_t cmd, uint16_t v)
{
SetupSpi(SPI_FPGA_MODE);
while ((AT91C_BASE_SPI->SPI_SR & AT91C_SPI_TXEMPTY) == 0); // wait for the transfer to complete
AT91C_BASE_SPI->SPI_TDR = AT91C_SPI_LASTXFER | cmd | v; // send the data
}
//-----------------------------------------------------------------------------
// Write the FPGA setup word (that determines what mode the logic is in, read
// vs. clone vs. etc.). This is now a special case of FpgaSendCommand() to
// avoid changing this function's occurence everywhere in the source code.
//-----------------------------------------------------------------------------
void FpgaWriteConfWord(uint8_t v)
{
FpgaSendCommand(FPGA_CMD_SET_CONFREG, v);
}
//-----------------------------------------------------------------------------
// Set up the CMOS switches that mux the ADC: four switches, independently
// closable, but should only close one at a time. Not an FPGA thing, but
// the samples from the ADC always flow through the FPGA.
//-----------------------------------------------------------------------------
void SetAdcMuxFor(uint32_t whichGpio)
{
AT91C_BASE_PIOA->PIO_OER =
GPIO_MUXSEL_HIPKD |
GPIO_MUXSEL_LOPKD |
GPIO_MUXSEL_LORAW |
GPIO_MUXSEL_HIRAW;
AT91C_BASE_PIOA->PIO_PER =
GPIO_MUXSEL_HIPKD |
GPIO_MUXSEL_LOPKD |
GPIO_MUXSEL_LORAW |
GPIO_MUXSEL_HIRAW;
LOW(GPIO_MUXSEL_HIPKD);
LOW(GPIO_MUXSEL_HIRAW);
LOW(GPIO_MUXSEL_LORAW);
LOW(GPIO_MUXSEL_LOPKD);
HIGH(whichGpio);
}
================================================
FILE: TamagotchiFriends/proxmark/armsrc/hitag2.c
================================================
//-----------------------------------------------------------------------------
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
// at your option, any later version. See the LICENSE.txt file for the text of
// the license.
//-----------------------------------------------------------------------------
// Hitag2 emulation (preliminary test version)
//
// (c) 2009 Henryk Plötz <henryk@ploetzli.ch>
//-----------------------------------------------------------------------------
// Hitag2 complete rewrite of the code
// - Fixed modulation/encoding issues
// - Rewrote code for transponder emulation
// - Added snooping of transponder communication
// - Added reader functionality
//
// (c) 2012 Roel Verdult
//-----------------------------------------------------------------------------
#include "proxmark3.h"
#include "apps.h"
#include "util.h"
#include "hitag2.h"
#include "string.h"
static bool bQuiet;
bool bCrypto;
bool bAuthenticating;
bool bPwd;
bool bSuccessful;
int LogTraceHitag(const uint8_t * btBytes, int iBits, int iSamples, uint32_t dwParity, int bReader)
{
// Return when trace is full
if (traceLen >= TRACE_SIZE) return FALSE;
// Trace the random, i'm curious
rsamples += iSamples;
trace[traceLen++] = ((rsamples >> 0) & 0xff);
trace[traceLen++] = ((rsamples >> 8) & 0xff);
trace[traceLen++] = ((rsamples >> 16) & 0xff);
trace[traceLen++] = ((rsamples >> 24) & 0xff);
if (!bReader) {
trace[traceLen - 1] |= 0x80;
}
trace[traceLen++] = ((dwParity >> 0) & 0xff);
trace[traceLen++] = ((dwParity >> 8) & 0xff);
trace[traceLen++] = ((dwParity >> 16) & 0xff);
trace[traceLen++] = ((dwParity >> 24) & 0xff);
trace[traceLen++] = iBits;
memcpy(trace + traceLen, btBytes, nbytes(iBits));
traceLen += nbytes(iBits);
return TRUE;
}
struct hitag2_tag {
uint32_t uid;
enum {
TAG_STATE_RESET = 0x01, // Just powered up, awaiting GetSnr
TAG_STATE_ACTIVATING = 0x02 , // In activation phase (password mode), sent UID, awaiting reader password
TAG_STATE_ACTIVATED = 0x03, // Activation complete, awaiting read/write commands
TAG_STATE_WRITING = 0x04, // In write command, awaiting sector contents to be written
} state;
unsigned int active_sector;
byte_t crypto_active;
uint64_t cs;
byte_t sectors[12][4];
};
static struct hitag2_tag tag = {
.state = TAG_STATE_RESET,
.sectors = { // Password mode: | Crypto mode:
[0] = { 0x02, 0x4e, 0x02, 0x20}, // UID | UID
[1] = { 0x4d, 0x49, 0x4b, 0x52}, // Password RWD | 32 bit LSB key
[2] = { 0x20, 0xf0, 0x4f, 0x4e}, // Reserved | 16 bit MSB key, 16 bit reserved
[3] = { 0x0e, 0xaa, 0x48, 0x54}, // Configuration, password TAG | Configuration, password TAG
[4] = { 0x46, 0x5f, 0x4f, 0x4b}, // Data: F_OK
[5] = { 0x55, 0x55, 0x55, 0x55}, // Data: UUUU
[6] = { 0xaa, 0xaa, 0xaa, 0xaa}, // Data: ....
[7] = { 0x55, 0x55, 0x55, 0x55}, // Data: UUUU
[8] = { 0x00, 0x00, 0x00, 0x00}, // RSK Low
[9] = { 0x00, 0x00, 0x00, 0x00}, // RSK High
[10] = { 0x00, 0x00, 0x00, 0x00}, // RCF
[11] = { 0x00, 0x00, 0x00, 0x00}, // SYNC
},
};
//#define TRACE_LENGTH 3000
//uint8_t *trace = (uint8_t *) BigBuf;
//int traceLen = 0;
//int rsamples = 0;
#define AUTH_TABLE_OFFSET FREE_BUFFER_OFFSET
#define AUTH_TABLE_LENGTH FREE_BUFFER_SIZE
byte_t* auth_table = (byte_t *)BigBuf+AUTH_TABLE_OFFSET;
size_t auth_table_pos = 0;
size_t auth_table_len = AUTH_TABLE_LENGTH;
byte_t password[4];
byte_t NrAr[8];
byte_t key[8];
uint64_t cipher_state;
/* Following is a modified version of cryptolib.com/ciphers/hitag2/ */
// Software optimized 48-bit Philips/NXP Mifare Hitag2 PCF7936/46/47/52 stream cipher algorithm by I.C. Wiener 2006-2007.
// For educational purposes only.
// No warranties or guarantees of any kind.
// This code is released into the public domain by its author.
// Basic macros:
#define u8 uint8_t
#define u32 uint32_t
#define u64 uint64_t
#define rev8(x) ((((x)>>7)&1)+((((x)>>6)&1)<<1)+((((x)>>5)&1)<<2)+((((x)>>4)&1)<<3)+((((x)>>3)&1)<<4)+((((x)>>2)&1)<<5)+((((x)>>1)&1)<<6)+(((x)&1)<<7))
#define rev16(x) (rev8 (x)+(rev8 (x>> 8)<< 8))
#define rev32(x) (rev16(x)+(rev16(x>>16)<<16))
#define rev64(x) (rev32(x)+(rev32(x>>32)<<32))
#define bit(x,n) (((x)>>(n))&1)
#define bit32(x,n) ((((x)[(n)>>5])>>((n)))&1)
#define inv32(x,i,n) ((x)[(i)>>5]^=((u32)(n))<<((i)&31))
#define rotl64(x, n) ((((u64)(x))<<((n)&63))+(((u64)(x))>>((0-(n))&63)))
// Single bit Hitag2 functions:
#define i4(x,a,b,c,d) ((u32)((((x)>>(a))&1)+(((x)>>(b))&1)*2+(((x)>>(c))&1)*4+(((x)>>(d))&1)*8))
static const u32 ht2_f4a = 0x2C79; // 0010 1100 0111 1001
static const u32 ht2_f4b = 0x6671; // 0110 0110 0111 0001
static const u32 ht2_f5c = 0x7907287B; // 0111 1001 0000 0111 0010 1000 0111 1011
static u32 _f20 (const u64 x)
{
u32 i5;
i5 = ((ht2_f4a >> i4 (x, 1, 2, 4, 5)) & 1)* 1
+ ((ht2_f4b >> i4 (x, 7,11,13,14)) & 1)* 2
+ ((ht2_f4b >> i4 (x,16,20,22,25)) & 1)* 4
+ ((ht2_f4b >> i4 (x,27,28,30,32)) & 1)* 8
+ ((ht2_f4a >> i4 (x,33,42,43,45)) & 1)*16;
return (ht2_f5c >> i5) & 1;
}
static u64 _hitag2_init (const u64 key, const u32 serial, const u32 IV)
{
u32 i;
u64 x = ((key & 0xFFFF) << 32) + serial;
for (i = 0; i < 32; i++)
{
x >>= 1;
x += (u64) (_f20 (x) ^ (((IV >> i) ^ (key >> (i+16))) & 1)) << 47;
}
return x;
}
static u64 _hitag2_round (u64 *state)
{
u64 x = *state;
x = (x >> 1) +
((((x >> 0) ^ (x >> 2) ^ (x >> 3) ^ (x >> 6)
^ (x >> 7) ^ (x >> 8) ^ (x >> 16) ^ (x >> 22)
^ (x >> 23) ^ (x >> 26) ^ (x >> 30) ^ (x >> 41)
^ (x >> 42) ^ (x >> 43) ^ (x >> 46) ^ (x >> 47)) & 1) << 47);
*state = x;
return _f20 (x);
}
static u32 _hitag2_byte (u64 * x)
{
u32 i, c;
for (i = 0, c = 0; i < 8; i++) c += (u32) _hitag2_round (x) << (i^7);
return c;
}
int hitag2_reset(void)
{
tag.state = TAG_STATE_RESET;
tag.crypto_active = 0;
return 0;
}
int hitag2_init(void)
{
// memcpy(&tag, &resetdata, sizeof(tag));
hitag2_reset();
return 0;
}
static void hitag2_cipher_reset(struct hitag2_tag *tag, const byte_t *iv)
{
uint64_t key = ((uint64_t)tag->sectors[2][2]) |
((uint64_t)tag->sectors[2][3] << 8) |
((uint64_t)tag->sectors[1][0] << 16) |
((uint64_t)tag->sectors[1][1] << 24) |
((uint64_t)tag->sectors[1][2] << 32) |
((uint64_t)tag->sectors[1][3] << 40);
uint32_t uid = ((uint32_t)tag->sectors[0][0]) |
((uint32_t)tag->sectors[0][1] << 8) |
((uint32_t)tag->sectors[0][2] << 16) |
((uint32_t)tag->sectors[0][3] << 24);
uint32_t iv_ = (((uint32_t)(iv[0]))) |
(((uint32_t)(iv[1])) << 8) |
(((uint32_t)(iv[2])) << 16) |
(((uint32_t)(iv[3])) << 24);
tag->cs = _hitag2_init(rev64(key), rev32(uid), rev32(iv_));
}
static int hitag2_cipher_authenticate(uint64_t* cs, const byte_t *authenticator_is)
{
byte_t authenticator_should[4];
authenticator_should[0] = ~_hitag2_byte(cs);
authenticator_should[1] = ~_hitag2_byte(cs);
authenticator_should[2] = ~_hitag2_byte(cs);
authenticator_should[3] = ~_hitag2_byte(cs);
return (memcmp(authenticator_should, authenticator_is, 4) == 0);
}
static int hitag2_cipher_transcrypt(uint64_t* cs, byte_t *data, unsigned int bytes, unsigned int bits)
{
int i;
for(i=0; i<bytes; i++) data[i] ^= _hitag2_byte(cs);
for(i=0; i<bits; i++) data[bytes] ^= _hitag2_round(cs) << (7-i);
return 0;
}
// Sam7s has several timers, we will use the source TIMER_CLOCK1 (aka AT91C_TC_CLKS_TIMER_DIV1_CLOCK)
// TIMER_CLOCK1 = MCK/2, MCK is running at 48 MHz, Timer is running at 48/2 = 24 MHz
// Hitag units (T0) have duration of 8 microseconds (us), which is 1/125000 per second (carrier)
// T0 = TIMER_CLOCK1 / 125000 = 192
#define T0 192
#define SHORT_COIL() LOW(GPIO_SSC_DOUT)
#define OPEN_COIL() HIGH(GPIO_SSC_DOUT)
#define HITAG_FRAME_LEN 20
#define HITAG_T_STOP 36 /* T_EOF should be > 36 */
#define HITAG_T_LOW 8 /* T_LOW should be 4..10 */
#define HITAG_T_0_MIN 15 /* T[0] should be 18..22 */
#define HITAG_T_1_MIN 25 /* T[1] should be 26..30 */
//#define HITAG_T_EOF 40 /* T_EOF should be > 36 */
#define HITAG_T_EOF 80 /* T_EOF should be > 36 */
#define HITAG_T_WAIT_1 200 /* T_wresp should be 199..206 */
#define HITAG_T_WAIT_2 90 /* T_wresp should be 199..206 */
#define HITAG_T_WAIT_MAX 300 /* bit more than HITAG_T_WAIT_1 + HITAG_T_WAIT_2 */
#define HITAG_T_TAG_ONE_HALF_PERIOD 10
#define HITAG_T_TAG_TWO_HALF_PERIOD 25
#define HITAG_T_TAG_THREE_HALF_PERIOD 41
#define HITAG_T_TAG_FOUR_HALF_PERIOD 57
#define HITAG_T_TAG_HALF_PERIOD 16
#define HITAG_T_TAG_FULL_PERIOD 32
#define HITAG_T_TAG_CAPTURE_ONE_HALF 13
#define HITAG_T_TAG_CAPTURE_TWO_HALF 25
#define HITAG_T_TAG_CAPTURE_THREE_HALF 41
#define HITAG_T_TAG_CAPTURE_FOUR_HALF 57
static void hitag_send_bit(int bit) {
LED_A_ON();
// Reset clock for the next bit
AT91C_BASE_TC0->TC_CCR = AT91C_TC_SWTRG;
// Fixed modulation, earlier proxmark version used inverted signal
if(bit == 0) {
// Manchester: Unloaded, then loaded |__--|
LOW(GPIO_SSC_DOUT);
while(AT91C_BASE_TC0->TC_CV < T0*HITAG_T_TAG_HALF_PERIOD);
HIGH(GPIO_SSC_DOUT);
while(AT91C_BASE_TC0->TC_CV < T0*HITAG_T_TAG_FULL_PERIOD);
} else {
// Manchester: Loaded, then unloaded |--__|
HIGH(GPIO_SSC_DOUT);
while(AT91C_BASE_TC0->TC_CV < T0*HITAG_T_TAG_HALF_PERIOD);
LOW(GPIO_SSC_DOUT);
while(AT91C_BASE_TC0->TC_CV < T0*HITAG_T_TAG_FULL_PERIOD);
}
LED_A_OFF();
}
static void hitag_send_frame(const byte_t* frame, size_t frame_len)
{
// Send start of frame
for(size_t i=0; i<5; i++) {
hitag_send_bit(1);
}
// Send the content of the frame
for(size_t i=0; i<frame_len; i++) {
hitag_send_bit((frame[i/8] >> (7-(i%8)))&1);
}
// Drop the modulation
LOW(GPIO_SSC_DOUT);
}
void hitag2_handle_reader_command(byte_t* rx, const size_t rxlen, byte_t* tx, size_t* txlen)
{
byte_t rx_air[HITAG_FRAME_LEN];
// Copy the (original) received frame how it is send over the air
memcpy(rx_air,rx,nbytes(rxlen));
if(tag.crypto_active) {
hitag2_cipher_transcrypt(&(tag.cs),rx,rxlen/8,rxlen%8);
}
// Reset the transmission frame length
*txlen = 0;
// Try to find out which command was send by selecting on length (in bits)
switch (rxlen) {
// Received 11000 from the reader, request for UID, send UID
case 05: {
// Always send over the air in the clear plaintext mode
if(rx_air[0] != 0xC0) {
// Unknown frame ?
return;
}
*txlen = 32;
memcpy(tx,tag.sectors[0],4);
tag.crypto_active = 0;
}
break;
// Read/Write command: ..xx x..y yy with yyy == ~xxx, xxx is sector number
case 10: {
unsigned int sector = (~( ((rx[0]<<2)&0x04) | ((rx[1]>>6)&0x03) ) & 0x07);
// Verify complement of sector index
if(sector != ((rx[0]>>3)&0x07)) {
//DbpString("Transmission error (read/write)");
return;
}
switch (rx[0] & 0xC6) {
// Read command: 11xx x00y
case 0xC0:
memcpy(tx,tag.sectors[sector],4);
*txlen = 32;
break;
// Inverted Read command: 01xx x10y
case 0x44:
for (size_t i=0; i<4; i++) {
tx[i] = tag.sectors[sector][i] ^ 0xff;
}
*txlen = 32;
break;
// Write command: 10xx x01y
case 0x82:
// Prepare write, acknowledge by repeating command
memcpy(tx,rx,nbytes(rxlen));
*txlen = rxlen;
tag.active_sector = sector;
tag.state=TAG_STATE_WRITING;
break;
// Unknown command
default:
Dbprintf("Uknown command: %02x %02x",rx[0],rx[1]);
return;
break;
}
}
break;
// Writing data or Reader password
case 32: {
if(tag.state == TAG_STATE_WRITING) {
// These are the sector contents to be written. We don't have to do anything else.
memcpy(tag.sectors[tag.active_sector],rx,nbytes(rxlen));
tag.state=TAG_STATE_RESET;
return;
} else {
// Received RWD password, respond with configuration and our password
if(memcmp(rx,tag.sectors[1],4) != 0) {
DbpString("Reader password is wrong");
return;
}
*txlen = 32;
memcpy(tx,tag.sectors[3],4);
}
}
break;
// Received RWD authentication challenge and respnse
case 64: {
// Store the authentication attempt
if (auth_table_len < (AUTH_TABLE_LENGTH-8)) {
memcpy(auth_table+auth_table_len,rx,8);
auth_table_len += 8;
}
// Reset the cipher state
hitag2_cipher_reset(&tag,rx);
// Check if the authentication was correct
if(!hitag2_cipher_authenticate(&(tag.cs),rx+4)) {
// The reader failed to authenticate, do nothing
Dbprintf("auth: %02x%02x%02x%02x%02x%02x%02x%02x Failed!",rx[0],rx[1],rx[2],rx[3],rx[4],rx[5],rx[6],rx[7]);
return;
}
// Succesful, but commented out reporting back to the Host, this may delay to much.
// Dbprintf("auth: %02x%02x%02x%02x%02x%02x%02x%02x OK!",rx[0],rx[1],rx[2],rx[3],rx[4],rx[5],rx[6],rx[7]);
// Activate encryption algorithm for all further communication
tag.crypto_active = 1;
// Use the tag password as response
memcpy(tx,tag.sectors[3],4);
*txlen = 32;
}
break;
}
// LogTraceHitag(rx,rxlen,0,0,false);
// LogTraceHitag(tx,*txlen,0,0,true);
if(tag.crypto_active) {
hitag2_cipher_transcrypt(&(tag.cs), tx, *txlen/8, *txlen%8);
}
}
static void hitag_reader_send_bit(int bit) {
LED_A_ON();
// Reset clock for the next bit
AT91C_BASE_TC0->TC_CCR = AT91C_TC_SWTRG;
// Binary puls length modulation (BPLM) is used to encode the data stream
// This means that a transmission of a one takes longer than that of a zero
// Enable modulation, which means, drop the the field
HIGH(GPIO_SSC_DOUT);
// Wait for 4-10 times the carrier period
while(AT91C_BASE_TC0->TC_CV < T0*6);
// SpinDelayUs(8*8);
// Disable modulation, just activates the field again
LOW(GPIO_SSC_DOUT);
if(bit == 0) {
// Zero bit: |_-|
while(AT91C_BASE_TC0->TC_CV < T0*22);
// SpinDelayUs(16*8);
} else {
// One bit: |_--|
while(AT91C_BASE_TC0->TC_CV < T0*28);
// SpinDelayUs(22*8);
}
LED_A_OFF();
}
static void hitag_reader_send_frame(const byte_t* frame, size_t frame_len)
{
// Send the content of the frame
for(size_t i=0; i<frame_len; i++) {
hitag_reader_send_bit((frame[i/8] >> (7-(i%8)))&1);
}
// Send EOF
AT91C_BASE_TC0->TC_CCR = AT91C_TC_SWTRG;
// Enable modulation, which means, drop the the field
HIGH(GPIO_SSC_DOUT);
// Wait for 4-10 times the carrier period
while(AT91C_BASE_TC0->TC_CV < T0*6);
// Disable modulation, just activates the field again
LOW(GPIO_SSC_DOUT);
}
size_t blocknr;
bool hitag2_password(byte_t* rx, const size_t rxlen, byte_t* tx, size_t* txlen) {
// Reset the transmission frame length
*txlen = 0;
// Try to find out which command was send by selecting on length (in bits)
switch (rxlen) {
// No answer, try to resurrect
case 0: {
// Stop if there is no answer (after sending password)
if (bPwd) {
DbpString("Password failed!");
return false;
}
*txlen = 5;
memcpy(tx,"\xc0",nbytes(*txlen));
} break;
// Received UID, tag password
case 32: {
if (!bPwd) {
*txlen = 32;
memcpy(tx,password,4);
bPwd = true;
memcpy(tag.sectors[blocknr],rx,4);
blocknr++;
} else {
if(blocknr == 1){
//store password in block1, the TAG answers with Block3, but we need the password in memory
memcpy(tag.sectors[blocknr],tx,4);
}else{
memcpy(tag.sectors[blocknr],rx,4);
}
blocknr++;
if (blocknr > 7) {
DbpString("Read succesful!");
bSuccessful = true;
return false;
}
*txlen = 10;
tx[0] = 0xc0 | (blocknr << 3) | ((blocknr^7) >> 2);
tx[1] = ((blocknr^7) << 6);
}
} break;
// Unexpected response
default: {
Dbprintf("Uknown frame length: %d",rxlen);
return false;
} break;
}
return true;
}
bool hitag2_crypto(byte_t* rx, const size_t rxlen, byte_t* tx, size_t* txlen) {
// Reset the transmission frame length
*txlen = 0;
if(bCrypto) {
hitag2_cipher_transcrypt(&cipher_state,rx,rxlen/8,rxlen%8);
}
// Try to find out which command was send by selecting on length (in bits)
switch (rxlen) {
// No answer, try to resurrect
case 0: {
// Stop if there is no answer while we are in crypto mode (after sending NrAr)
if (bCrypto) {
// Failed during authentication
if (bAuthenticating) {
DbpString("Authentication failed!");
return false;
} else {
// Failed reading a block, could be (read/write) locked, skip block and re-authenticate
if (blocknr == 1) {
// Write the low part of the key in memory
memcpy(tag.sectors[1],key+2,4);
} else if (blocknr == 2) {
// Write the high part of the key in memory
tag.sectors[2][0] = 0x00;
tag.sectors[2][1] = 0x00;
tag.sectors[2][2] = key[0];
tag.sectors[2][3] = key[1];
} else {
// Just put zero's in the memory (of the unreadable block)
memset(tag.sectors[blocknr],0x00,4);
}
blocknr++;
bCrypto = false;
}
} else {
*txlen = 5;
memcpy(tx,"\xc0",nbytes(*txlen));
}
} break;
// Received UID, crypto tag answer
case 32: {
if (!bCrypto) {
uint64_t ui64key = key[0] | ((uint64_t)key[1]) << 8 | ((uint64_t)key[2]) << 16 | ((uint64_t)key[3]) << 24 | ((uint64_t)key[4]) << 32 | ((uint64_t)key[5]) << 40;
uint32_t ui32uid = rx[0] | ((uint32_t)rx[1]) << 8 | ((uint32_t)rx[2]) << 16 | ((uint32_t)rx[3]) << 24;
cipher_state = _hitag2_init(rev64(ui64key), rev32(ui32uid), 0);
memset(tx,0x00,4);
memset(tx+4,0xff,4);
hitag2_cipher_transcrypt(&cipher_state,tx+4,4,0);
*txlen = 64;
bCrypto = true;
bAuthenticating = true;
} else {
// Check if we received answer tag (at)
if (bAuthenticating) {
bAuthenticating = false;
} else {
// Store the received block
memcpy(tag.sectors[blocknr],rx,4);
blocknr++;
}
if (blocknr > 7) {
DbpString("Read succesful!");
bSuccessful = true;
return false;
}
*txlen = 10;
tx[0] = 0xc0 | (blocknr << 3) | ((blocknr^7) >> 2);
tx[1] = ((blocknr^7) << 6);
}
} break;
// Unexpected response
default: {
Dbprintf("Uknown frame length: %d",rxlen);
return false;
} break;
}
if(bCrypto) {
// We have to return now to avoid double encryption
if (!bAuthenticating) {
hitag2_cipher_transcrypt(&cipher_state,tx,*txlen/8,*txlen%8);
}
}
return true;
}
bool hitag2_authenticate(byte_t* rx, const size_t rxlen, byte_t* tx, size_t* txlen) {
// Reset the transmission frame length
*txlen = 0;
// Try to find out which command was send by selecting on length (in bits)
switch (rxlen) {
// No answer, try to resurrect
case 0: {
// Stop if there is no answer while we are in crypto mode (after sending NrAr)
if (bCrypto) {
DbpString("Authentication failed!");
return false;
}
*txlen = 5;
memcpy(tx,"\xc0",nbytes(*txlen));
} break;
// Received UID, crypto tag answer
case 32: {
if (!bCrypto) {
*txlen = 64;
memcpy(tx,NrAr,8);
bCrypto = true;
} else {
DbpString("Authentication succesful!");
// We are done... for now
return false;
}
} break;
// Unexpected response
default: {
Dbprintf("Uknown frame length: %d",rxlen);
return false;
} break;
}
return true;
}
bool hitag2_test_auth_attempts(byte_t* rx, const size_t rxlen, byte_t* tx, size_t* txlen) {
// Reset the transmission frame length
*txlen = 0;
// Try to find out which command was send by selecting on length (in bits)
switch (rxlen) {
// No answer, try to resurrect
case 0: {
// Stop if there is no answer while we are in crypto mode (after sending NrAr)
if (bCrypto) {
Dbprintf("auth: %02x%02x%02x%02x%02x%02x%02x%02x Failed, removed entry!",NrAr[0],NrAr[1],NrAr[2],NrAr[3],NrAr[4],NrAr[5],NrAr[6],NrAr[7]);
// Removing failed entry from authentiations table
memcpy(auth_table+auth_table_pos,auth_table+auth_table_pos+8,8);
auth_table_len -= 8;
// Return if we reached the end of the authentiactions table
bCrypto = false;
if (auth_table_pos == auth_table_len) {
return false;
}
// Copy the next authentication attempt in row (at the same position, b/c we removed last failed entry)
memcpy(NrAr,auth_table+auth_table_pos,8);
}
*txlen = 5;
memcpy(tx,"\xc0",nbytes(*txlen));
} break;
// Received UID, crypto tag answer, or read block response
case 32: {
if (!bCrypto) {
*txlen = 64;
memcpy(tx,NrAr,8);
bCrypto = true;
} else {
Dbprintf("auth: %02x%02x%02x%02x%02x%02x%02x%02x OK",NrAr[0],NrAr[1],NrAr[2],NrAr[3],NrAr[4],NrAr[5],NrAr[6],NrAr[7]);
bCrypto = false;
if ((auth_table_pos+8) == auth_table_len) {
return false;
}
auth_table_pos += 8;
memcpy(NrAr,auth_table+auth_table_pos,8);
}
} break;
default: {
Dbprintf("Uknown frame length: %d",rxlen);
return false;
} break;
}
return true;
}
void SnoopHitag(uint32_t type) {
int frame_count;
int response;
int overflow;
bool rising_edge;
bool reader_frame;
int lastbit;
bool bSkip;
int tag_sof;
byte_t rx[HITAG_FRAME_LEN];
size_t rxlen=0;
// Clean up trace and prepare it for storing frames
iso14a_set_tracing(TRUE);
iso14a_clear_trace();
auth_table_len = 0;
auth_table_pos = 0;
memset(auth_table, 0x00, AUTH_TABLE_LENGTH);
DbpString("Starting Hitag2 snoop");
LED_D_ON();
// Set up eavesdropping mode, frequency divisor which will drive the FPGA
// and analog mux selection.
FpgaWriteConfWord(FPGA_MAJOR_MODE_LF_EDGE_DETECT);
FpgaSendCommand(FPGA_CMD_SET_DIVISOR, 95); //125Khz
SetAdcMuxFor(GPIO_MUXSEL_LOPKD);
RELAY_OFF();
// Configure output pin that is connected to the FPGA (for modulating)
AT91C_BASE_PIOA->PIO_OER = GPIO_SSC_DOUT;
AT91C_BASE_PIOA->PIO_PER = GPIO_SSC_DOUT;
// Disable modulation, we are going to eavesdrop, not modulate ;)
LOW(GPIO_SSC_DOUT);
// Enable Peripheral Clock for TIMER_CLOCK1, used to capture edges of the reader frames
AT91C_BASE_PMC->PMC_PCER = (1 << AT91C_ID_TC1);
AT91C_BASE_PIOA->PIO_BSR = GPIO_SSC_FRAME;
// Disable timer during configuration
AT91C_BASE_TC1->TC_CCR = AT91C_TC_CLKDIS;
// Capture mode, defaul timer source = MCK/2 (TIMER_CLOCK1), TIOA is external trigger,
// external trigger rising edge, load RA on rising edge of TIOA.
uint32_t t1_channel_mode = AT91C_TC_CLKS_TIMER_DIV1_CLOCK | AT91C_TC_ETRGEDG_BOTH | AT91C_TC_ABETRG | AT91C_TC_LDRA_BOTH;
AT91C_BASE_TC1->TC_CMR = t1_channel_mode;
// Enable and reset counter
AT91C_BASE_TC1->TC_CCR = AT91C_TC_CLKEN | AT91C_TC_SWTRG;
// Reset the received frame, frame count and timing info
memset(rx,0x00,sizeof(rx));
frame_count = 0;
response = 0;
overflow = 0;
reader_frame = false;
lastbit = 1;
bSkip = true;
tag_sof = 4;
while(!BUTTON_PRESS()) {
// Watchdog hit
WDT_HIT();
// Receive frame, watch for at most T0*EOF periods
while (AT91C_BASE_TC1->TC_CV < T0*HITAG_T_EOF) {
// Check if rising edge in modulation is detected
if(AT91C_BASE_TC1->TC_SR & AT91C_TC_LDRAS) {
// Retrieve the new timing values
int ra = (AT91C_BASE_TC1->TC_RA/T0);
// Find out if we are dealing with a rising or falling edge
rising_edge = (AT91C_BASE_PIOA->PIO_PDSR & GPIO_SSC_FRAME) > 0;
// Shorter periods will only happen with reader frames
if (!reader_frame && rising_edge && ra < HITAG_T_TAG_CAPTURE_ONE_HALF) {
// Switch from tag to reader capture
LED_C_OFF();
reader_frame = true;
memset(rx,0x00,sizeof(rx));
rxlen = 0;
}
// Only handle if reader frame and rising edge, or tag frame and falling edge
if (reader_frame != rising_edge) {
overflow += ra;
continue;
}
// Add the buffered timing values of earlier captured edges which were skipped
ra += overflow;
overflow = 0;
if (reader_frame) {
LED_B_ON();
// Capture reader frame
if(ra >= HITAG_T_STOP) {
if (rxlen != 0) {
//DbpString("wierd0?");
}
// Capture the T0 periods that have passed since last communication or field drop (reset)
response = (ra - HITAG_T_LOW);
} else if(ra >= HITAG_T_1_MIN ) {
// '1' bit
rx[rxlen / 8] |= 1 << (7-(rxlen%8));
rxlen++;
} else if(ra >= HITAG_T_0_MIN) {
// '0' bit
rx[rxlen / 8] |= 0 << (7-(rxlen%8));
rxlen++;
} else {
// Ignore wierd value, is to small to mean anything
}
} else {
LED_C_ON();
// Capture tag frame (manchester decoding using only falling edges)
if(ra >= HITAG_T_EOF) {
if (rxlen != 0) {
//DbpString("wierd1?");
}
// Capture the T0 periods that have passed since last communication or field drop (reset)
// We always recieve a 'one' first, which has the falling edge after a half period |-_|
response = ra-HITAG_T_TAG_HALF_PERIOD;
} else if(ra >= HITAG_T_TAG_CAPTURE_FOUR_HALF) {
// Manchester coding example |-_|_-|-_| (101)
rx[rxlen / 8] |= 0 << (7-(rxlen%8));
rxlen++;
rx[rxlen / 8] |= 1 << (7-(rxlen%8));
rxlen++;
} else if(ra >= HITAG_T_TAG_CAPTURE_THREE_HALF) {
// Manchester coding example |_-|...|_-|-_| (0...01)
rx[rxlen / 8] |= 0 << (7-(rxlen%8));
rxlen++;
// We have to skip this half period at start and add the 'one' the second time
if (!bSkip) {
rx[rxlen / 8] |= 1 << (7-(rxlen%8));
rxlen++;
}
lastbit = !lastbit;
bSkip = !bSkip;
} else if(ra >= HITAG_T_TAG_CAPTURE_TWO_HALF) {
// Manchester coding example |_-|_-| (00) or |-_|-_| (11)
if (tag_sof) {
// Ignore bits that are transmitted during SOF
tag_sof--;
} else {
// bit is same as last bit
rx[rxlen / 8] |= lastbit << (7-(rxlen%8));
rxlen++;
}
} else {
// Ignore wierd value, is to small to mean anything
}
}
}
}
// Check if frame was captured
if(rxlen > 0) {
frame_count++;
if (!LogTraceHitag(rx,rxlen,response,0,reader_frame)) {
DbpString("Trace full");
break;
}
// Check if we recognize a valid authentication attempt
if (nbytes(rxlen) == 8) {
// Store the authentication attempt
if (auth_table_len < (AUTH_TABLE_LENGTH-8)) {
memcpy(auth_table+auth_table_len,rx,8);
auth_table_len += 8;
}
}
// Reset the received frame and response timing info
memset(rx,0x00,sizeof(rx));
response = 0;
reader_frame = false;
lastbit = 1;
bSkip = true;
tag_sof = 4;
overflow = 0;
LED_B_OFF();
LED_C_OFF();
} else {
// Save the timer overflow, will be 0 when frame was received
overflow += (AT91C_BASE_TC1->TC_CV/T0);
}
// Reset the frame length
rxlen = 0;
// Reset the timer to restart while-loop that receives frames
AT91C_BASE_TC1->TC_CCR = AT91C_TC_SWTRG;
}
LED_A_ON();
LED_B_OFF();
LED_C_OFF();
LED_D_OFF();
AT91C_BASE_TC1->TC_CCR = AT91C_TC_CLKDIS;
AT91C_BASE_TC0->TC_CCR = AT91C_TC_CLKDIS;
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
LED_A_OFF();
// Dbprintf("frame received: %d",frame_count);
// Dbprintf("Authentication Attempts: %d",(auth_table_len/8));
// DbpString("All done");
}
void SimulateHitagTag(bool tag_mem_supplied, byte_t* data) {
int frame_count;
int response;
int overflow;
byte_t rx[HITAG_FRAME_LEN];
size_t rxlen=0;
byte_t tx[HITAG_FRAME_LEN];
size_t txlen=0;
bool bQuitTraceFull = false;
bQuiet = false;
// Clean up trace and prepare it for storing frames
iso14a_set_tracing(TRUE);
iso14a_clear_trace();
auth_table_len = 0;
auth_table_pos = 0;
memset(auth_table, 0x00, AUTH_TABLE_LENGTH);
DbpString("Starting Hitag2 simulation");
LED_D_ON();
hitag2_init();
if (tag_mem_supplied) {
DbpString("Loading hitag2 memory...");
memcpy((byte_t*)tag.sectors,data,48);
}
uint32_t block = 0;
for (size_t i=0; i<12; i++) {
for (size_t j=0; j<4; j++) {
block <<= 8;
block |= tag.sectors[i][j];
}
Dbprintf("| %d | %08x |",i,block);
}
// Set up simulator mode, frequency divisor which will drive the FPGA
// and analog mux selection.
FpgaWriteConfWord(FPGA_MAJOR_MODE_LF_EDGE_DETECT);
FpgaSendCommand(FPGA_CMD_SET_DIVISOR, 95); //125Khz
SetAdcMuxFor(GPIO_MUXSEL_LOPKD);
RELAY_OFF();
// Configure output pin that is connected to the FPGA (for modulating)
AT91C_BASE_PIOA->PIO_OER = GPIO_SSC_DOUT;
AT91C_BASE_PIOA->PIO_PER = GPIO_SSC_DOUT;
// Disable modulation at default, which means release resistance
LOW(GPIO_SSC_DOUT);
// Enable Peripheral Clock for TIMER_CLOCK0, used to measure exact timing before answering
AT91C_BASE_PMC->PMC_PCER = (1 << AT91C_ID_TC0);
// Enable Peripheral Clock for TIMER_CLOCK1, used to capture edges of the reader frames
AT91C_BASE_PMC->PMC_PCER = (1 << AT91C_ID_TC1);
AT91C_BASE_PIOA->PIO_BSR = GPIO_SSC_FRAME;
// Disable timer during configuration
AT91C_BASE_TC1->TC_CCR = AT91C_TC_CLKDIS;
// Capture mode, defaul timer source = MCK/2 (TIMER_CLOCK1), TIOA is external trigger,
// external trigger rising edge, load RA on rising edge of TIOA.
AT91C_BASE_TC1->TC_CMR = AT91C_TC_CLKS_TIMER_DIV1_CLOCK | AT91C_TC_ETRGEDG_RISING | AT91C_TC_ABETRG | AT91C_TC_LDRA_RISING;
// Enable and reset counter
AT91C_BASE_TC1->TC_CCR = AT91C_TC_CLKEN | AT91C_TC_SWTRG;
// Reset the received frame, frame count and timing info
memset(rx,0x00,sizeof(rx));
frame_count = 0;
response = 0;
overflow = 0;
while(!BUTTON_PRESS()) {
// Watchdog hit
WDT_HIT();
// Receive frame, watch for at most T0*EOF periods
while (AT91C_BASE_TC1->TC_CV < T0*HITAG_T_EOF) {
// Check if rising edge in modulation is detected
if(AT91C_BASE_TC1->TC_SR & AT91C_TC_LDRAS) {
// Retrieve the new timing values
int ra = (AT91C_BASE_TC1->TC_RA/T0) + overflow;
overflow = 0;
// Reset timer every frame, we have to capture the last edge for timing
AT91C_BASE_TC0->TC_CCR = AT91C_TC_CLKEN | AT91C_TC_SWTRG;
LED_B_ON();
// Capture reader frame
if(ra >= HITAG_T_STOP) {
if (rxlen != 0) {
//DbpString("wierd0?");
}
// Capture the T0 periods that have passed since last communication or field drop (reset)
response = (ra - HITAG_T_LOW);
} else if(ra >= HITAG_T_1_MIN ) {
// '1' bit
rx[rxlen / 8] |= 1 << (7-(rxlen%8));
rxlen++;
} else if(ra >= HITAG_T_0_MIN) {
// '0' bit
rx[rxlen / 8] |= 0 << (7-(rxlen%8));
rxlen++;
} else {
// Ignore wierd value, is to small to mean anything
}
}
}
// Check if frame was captured
if(rxlen > 4) {
frame_count++;
if (!bQuiet) {
if (!LogTraceHitag(rx,rxlen,response,0,true)) {
DbpString("Trace full");
if (bQuitTraceFull) {
break;
} else {
bQuiet = true;
}
}
}
// Disable timer 1 with external trigger to avoid triggers during our own modulation
AT91C_BASE_TC1->TC_CCR = AT91C_TC_CLKDIS;
// Process the incoming frame (rx) and prepare the outgoing frame (tx)
hitag2_handle_reader_command(rx,rxlen,tx,&txlen);
// Wait for HITAG_T_WAIT_1 carrier periods after the last reader bit,
// not that since the clock counts since the rising edge, but T_Wait1 is
// with respect to the falling edge, we need to wait actually (T_Wait1 - T_Low)
// periods. The gap time T_Low varies (4..10). All timer values are in
// terms of T0 units
while(AT91C_BASE_TC0->TC_CV < T0*(HITAG_T_WAIT_1-HITAG_T_LOW));
// Send and store the tag answer (if there is any)
if (txlen) {
// Transmit the tag frame
hitag_send_frame(tx,txlen);
// Store the frame in the trace
if (!bQuiet) {
if (!LogTraceHitag(tx,txlen,0,0,false)) {
DbpString("Trace full");
if (bQuitTraceFull) {
break;
} else {
bQuiet = true;
}
}
}
}
// Reset the received frame and response timing info
memset(rx,0x00,sizeof(rx));
response = 0;
// Enable and reset external trigger in timer for capturing future frames
AT91C_BASE_TC1->TC_CCR = AT91C_TC_CLKEN | AT91C_TC_SWTRG;
LED_B_OFF();
}
// Reset the frame length
rxlen = 0;
// Save the timer overflow, will be 0 when frame was received
overflow += (AT91C_BASE_TC1->TC_CV/T0);
// Reset the timer to restart while-loop that receives frames
AT91C_BASE_TC1->TC_CCR = AT91C_TC_SWTRG;
}
LED_B_OFF();
LED_D_OFF();
AT91C_BASE_TC1->TC_CCR = AT91C_TC_CLKDIS;
AT91C_BASE_TC0->TC_CCR = AT91C_TC_CLKDIS;
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
// Dbprintf("frame received: %d",frame_count);
// Dbprintf("Authentication Attempts: %d",(auth_table_len/8));
// DbpString("All done");
}
void ReaderHitag(hitag_function htf, hitag_data* htd) {
int frame_count;
int response;
byte_t rx[HITAG_FRAME_LEN];
size_t rxlen=0;
byte_t txbuf[HITAG_FRAME_LEN];
byte_t* tx = txbuf;
size_t txlen=0;
int lastbit;
bool bSkip;
int reset_sof;
int tag_sof;
int t_wait = HITAG_T_WAIT_MAX;
bool bStop;
bool bQuitTraceFull = false;
// Reset the return status
bSuccessful = false;
// Clean up trace and prepare it for storing frames
iso14a_set_tracing(TRUE);
iso14a_clear_trace();
DbpString("Starting Hitag reader family");
// Check configuration
switch(htf) {
case RHT2F_PASSWORD: {
Dbprintf("List identifier in password mode");
memcpy(password,htd->pwd.password,4);
blocknr = 0;
bQuitTraceFull = false;
bQuiet = false;
bPwd = false;
} break;
case RHT2F_AUTHENTICATE: {
DbpString("Authenticating using nr,ar pair:");
memcpy(NrAr,htd->auth.NrAr,8);
Dbhexdump(8,NrAr,false);
bQuiet = false;
bCrypto = false;
bAuthenticating = false;
bQuitTraceFull = true;
} break;
case RHT2F_CRYPTO: {
DbpString("Authenticating using key:");
memcpy(key,htd->crypto.key,6);
Dbhexdump(6,key,false);
blocknr = 0;
bQuiet = false;
bCrypto = false;
bAuthenticating = false;
bQuitTraceFull = true;
} break;
case RHT2F_TEST_AUTH_ATTEMPTS: {
Dbprintf("Testing %d authentication attempts",(auth_table_len/8));
auth_table_pos = 0;
memcpy(NrAr,auth_table,8);
bQuitTraceFull = false;
bQuiet = false;
bCrypto = false;
} break;
default: {
Dbprintf("Error, unknown function: %d",htf);
return;
} break;
}
LED_D_ON();
hitag2_init();
// Configure output and enable pin that is connected to the FPGA (for modulating)
AT91C_BASE_PIOA->PIO_OER = GPIO_SSC_DOUT;
AT91C_BASE_PIOA->PIO_PER = GPIO_SSC_DOUT;
// Set fpga in edge detect with reader field, we can modulate as reader now
FpgaWriteConfWord(FPGA_MAJOR_MODE_LF_EDGE_DETECT | FPGA_LF_EDGE_DETECT_READER_FIELD);
// Set Frequency divisor which will drive the FPGA and analog mux selection
FpgaSendCommand(FPGA_CMD_SET_DIVISOR, 95); //125Khz
SetAdcMuxFor(GPIO_MUXSEL_LOPKD);
RELAY_OFF();
// Disable modulation at default, which means enable the field
LOW(GPIO_SSC_DOUT);
// Give it a bit of time for the resonant antenna to settle.
SpinDelay(30);
// Enable Peripheral Clock for TIMER_CLOCK0, used to measure exact timing before answering
AT91C_BASE_PMC->PMC_PCER = (1 << AT91C_ID_TC0);
// Enable Peripheral Clock for TIMER_CLOCK1, used to capture edges of the tag frames
AT91C_BASE_PMC->PMC_PCER = (1 << AT91C_ID_TC1);
AT91C_BASE_PIOA->PIO_BSR = GPIO_SSC_FRAME;
// Disable timer during configuration
AT91C_BASE_TC1->TC_CCR = AT91C_TC_CLKDIS;
// Capture mode, defaul timer source = MCK/2 (TIMER_CLOCK1), TIOA is external trigger,
// external trigger rising edge, load RA on falling edge of TIOA.
AT91C_BASE_TC1->TC_CMR = AT91C_TC_CLKS_TIMER_DIV1_CLOCK | AT91C_TC_ETRGEDG_FALLING | AT91C_TC_ABETRG | AT91C_TC_LDRA_FALLING;
// Enable and reset counters
AT91C_BASE_TC0->TC_CCR = AT91C_TC_CLKEN | AT91C_TC_SWTRG;
AT91C_BASE_TC1->TC_CCR = AT91C_TC_CLKEN | AT91C_TC_SWTRG;
// Reset the received frame, frame count and timing info
frame_count = 0;
response = 0;
lastbit = 1;
bStop = false;
// Tag specific configuration settings (sof, timings, etc.)
if (htf < 10){
// hitagS settings
reset_sof = 1;
t_wait = 200;
DbpString("Configured for hitagS reader");
} else if (htf < 20) {
// hitag1 settings
reset_sof = 1;
t_wait = 200;
DbpString("Configured for hitag1 reader");
} else if (htf < 30) {
// hitag2 settings
reset_sof = 4;
t_wait = HITAG_T_WAIT_2;
DbpString("Configured for hitag2 reader");
} else {
Dbprintf("Error, unknown hitag reader type: %d",htf);
return;
}
while(!bStop && !BUTTON_PRESS()) {
// Watchdog hit
WDT_HIT();
// Check if frame was captured and store it
if(rxlen > 0) {
frame_count++;
if (!bQuiet) {
if (!LogTraceHitag(rx,rxlen,response,0,false)) {
DbpString("Trace full");
if (bQuitTraceFull) {
break;
} else {
bQuiet = true;
}
}
}
}
// By default reset the transmission buffer
tx = txbuf;
switch(htf) {
case RHT2F_PASSWORD: {
bStop = !hitag2_password(rx,rxlen,tx,&txlen);
} break;
case RHT2F_AUTHENTICATE: {
bStop = !hitag2_authenticate(rx,rxlen,tx,&txlen);
} break;
case RHT2F_CRYPTO: {
bStop = !hitag2_crypto(rx,rxlen,tx,&txlen);
} break;
case RHT2F_TEST_AUTH_ATTEMPTS: {
bStop = !hitag2_test_auth_attempts(rx,rxlen,tx,&txlen);
} break;
default: {
Dbprintf("Error, unknown function: %d",htf);
return;
} break;
}
// Send and store the reader command
// Disable timer 1 with external trigger to avoid triggers during our own modulation
AT91C_BASE_TC1->TC_CCR = AT91C_TC_CLKDIS;
// Wait for HITAG_T_WAIT_2 carrier periods after the last tag bit before transmitting,
// Since the clock counts since the last falling edge, a 'one' means that the
// falling edge occured halfway the period. with respect to this falling edge,
// we need to wait (T_Wait2 + half_tag_period) when the last was a 'one'.
// All timer values are in terms of T0 units
while(AT91C_BASE_TC0->TC_CV < T0*(t_wait+(HITAG_T_TAG_HALF_PERIOD*lastbit)));
// Transmit the reader frame
hitag_reader_send_frame(tx,txlen);
// Enable and reset external trigger in timer for capturing future frames
AT91C_BASE_TC1->TC_CCR = AT91C_TC_CLKEN | AT91C_TC_SWTRG;
// Add transmitted frame to total count
if(txlen > 0) {
frame_count++;
if (!bQuiet) {
// Store the frame in the trace
if (!LogTraceHitag(tx,txlen,HITAG_T_WAIT_2,0,true)) {
if (bQuitTraceFull) {
break;
} else {
bQuiet = true;
}
}
}
}
// Reset values for receiving frames
memset(rx,0x00,sizeof(rx));
rxlen = 0;
lastbit = 1;
bSkip = true;
tag_sof = reset_sof;
response = 0;
// Receive frame, watch for at most T0*EOF periods
while (AT91C_BASE_TC1->TC_CV < T0*HITAG_T_WAIT_MAX) {
// Check if falling edge in tag modulation is detected
if(AT91C_BASE_TC1->TC_SR & AT91C_TC_LDRAS) {
// Retrieve the new timing values
int ra = (AT91C_BASE_TC1->TC_RA/T0);
// Reset timer every frame, we have to capture the last edge for timing
AT91C_BASE_TC0->TC_CCR = AT91C_TC_SWTRG;
LED_B_ON();
// Capture tag frame (manchester decoding using only falling edges)
if(ra >= HITAG_T_EOF) {
if (rxlen != 0) {
//DbpString("wierd1?");
}
// Capture the T0 periods that have passed since last communication or field drop (reset)
// We always recieve a 'one' first, which has the falling edge after a half period |-_|
response = ra-HITAG_T_TAG_HALF_PERIOD;
} else if(ra >= HITAG_T_TAG_CAPTURE_FOUR_HALF) {
// Manchester coding example |-_|_-|-_| (101)
rx[rxlen / 8] |= 0 << (7-(rxlen%8));
rxlen++;
rx[rxlen / 8] |= 1 << (7-(rxlen%8));
rxlen++;
} else if(ra >= HITAG_T_TAG_CAPTURE_THREE_HALF) {
// Manchester coding example |_-|...|_-|-_| (0...01)
rx[rxlen / 8] |= 0 << (7-(rxlen%8));
rxlen++;
// We have to skip this half period at start and add the 'one' the second time
if (!bSkip) {
rx[rxlen / 8] |= 1 << (7-(rxlen%8));
rxlen++;
}
lastbit = !lastbit;
bSkip = !bSkip;
} else if(ra >= HITAG_T_TAG_CAPTURE_TWO_HALF) {
// Manchester coding example |_-|_-| (00) or |-_|-_| (11)
if (tag_sof) {
// Ignore bits that are transmitted during SOF
tag_sof--;
} else {
// bit is same as last bit
rx[rxlen / 8] |= lastbit << (7-(rxlen%8));
rxlen++;
}
} else {
// Ignore wierd value, is to small to mean anything
}
}
// We can break this loop if we received the last bit from a frame
if (AT91C_BASE_TC1->TC_CV > T0*HITAG_T_EOF) {
if (rxlen>0) break;
}
}
}
LED_B_OFF();
LED_D_OFF();
AT91C_BASE_TC1->TC_CCR = AT91C_TC_CLKDIS;
AT91C_BASE_TC0->TC_CCR = AT91C_TC_CLKDIS;
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
Dbprintf("frame received: %d",frame_count);
DbpString("All done");
cmd_send(CMD_ACK,bSuccessful,0,0,(byte_t*)tag.sectors,48);
}
================================================
FILE: TamagotchiFriends/proxmark/armsrc/iclass.c
================================================
//-----------------------------------------------------------------------------
// Gerhard de Koning Gans - May 2008
// Hagen Fritsch - June 2010
// Gerhard de Koning Gans - May 2011
// Gerhard de Koning Gans - June 2012 - Added iClass card and reader emulation
//
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
// at your option, any later version. See the LICENSE.txt file for the text of
// the license.
//-----------------------------------------------------------------------------
// Routines to support iClass.
//-----------------------------------------------------------------------------
// Based on ISO14443a implementation. Still in experimental phase.
// Contribution made during a security research at Radboud University Nijmegen
//
// Please feel free to contribute and extend iClass support!!
//-----------------------------------------------------------------------------
//
// FIX:
// ====
// We still have sometimes a demodulation error when snooping iClass communication.
// The resulting trace of a read-block-03 command may look something like this:
//
// + 22279: : 0c 03 e8 01
//
// ...with an incorrect answer...
//
// + 85: 0: TAG ff! ff! ff! ff! ff! ff! ff! ff! bb 33 bb 00 01! 0e! 04! bb !crc
//
// We still left the error signalling bytes in the traces like 0xbb
//
// A correct trace should look like this:
//
// + 21112: : 0c 03 e8 01
// + 85: 0: TAG ff ff ff ff ff ff ff ff ea f5
//
//-----------------------------------------------------------------------------
#include "proxmark3.h"
#include "apps.h"
#include "util.h"
#include "string.h"
#include "common.h"
// Needed for CRC in emulation mode;
// same construction as in ISO 14443;
// different initial value (CRC_ICLASS)
#include "iso14443crc.h"
static int timeout = 4096;
// CARD TO READER
// Sequence D: 11110000 modulation with subcarrier during first half
// Sequence E: 00001111 modulation with subcarrier during second half
// Sequence F: 00000000 no modulation with subcarrier
// READER TO CARD
// Sequence X: 00001100 drop after half a period
// Sequence Y: 00000000 no drop
// Sequence Z: 11000000 drop at start
#define SEC_X 0x0c
#define SEC_Y 0x00
#define SEC_Z 0xc0
static int SendIClassAnswer(uint8_t *resp, int respLen, int delay);
//-----------------------------------------------------------------------------
// The software UART that receives commands from the reader, and its state
// variables.
//-----------------------------------------------------------------------------
static struct {
enum {
STATE_UNSYNCD,
STATE_START_OF_COMMUNICATION,
STATE_RECEIVING
} state;
uint16_t shiftReg;
int bitCnt;
int byteCnt;
int byteCntMax;
int posCnt;
int nOutOfCnt;
int OutOfCnt;
int syncBit;
int parityBits;
int samples;
int highCnt;
int swapper;
int counter;
int bitBuffer;
int dropPosition;
uint8_t *output;
} Uart;
static RAMFUNC int OutOfNDecoding(int bit)
{
//int error = 0;
int bitright;
if(!Uart.bitBuffer) {
Uart.bitBuffer = bit ^ 0xFF0;
return FALSE;
}
else {
Uart.bitBuffer <<= 4;
Uart.bitBuffer ^= bit;
}
/*if(Uart.swapper) {
Uart.output[Uart.byteCnt] = Uart.bitBuffer & 0xFF;
Uart.byteCnt++;
Uart.swapper = 0;
if(Uart.byteCnt > 15) { return TRUE; }
}
else {
Uart.swapper = 1;
}*/
if(Uart.state != STATE_UNSYNCD) {
Uart.posCnt++;
if((Uart.bitBuffer & Uart.syncBit) ^ Uart.syncBit) {
bit = 0x00;
}
else {
bit = 0x01;
}
if(((Uart.bitBuffer << 1) & Uart.syncBit) ^ Uart.syncBit) {
bitright = 0x00;
}
else {
bitright = 0x01;
}
if(bit != bitright) { bit = bitright; }
// So, now we only have to deal with *bit*, lets see...
if(Uart.posCnt == 1) {
// measurement first half bitperiod
if(!bit) {
// Drop in first half means that we are either seeing
// an SOF or an EOF.
if(Uart.nOutOfCnt == 1) {
// End of Communication
Uart.state = STATE_UNSYNCD;
Uart.highCnt = 0;
if(Uart.byteCnt == 0) {
// Its not straightforward to show single EOFs
// So just leave it and do not return TRUE
Uart.output[Uart.byteCnt] = 0xf0;
Uart.byteCnt++;
// Calculate the parity bit for the client...
Uart.parityBits = 1;
}
else {
return TRUE;
}
}
else if(Uart.state != STATE_START_OF_COMMUNICATION) {
// When not part of SOF or EOF, it is an error
Uart.state = STATE_UNSYNCD;
Uart.highCnt = 0;
//error = 4;
}
}
}
else {
// measurement second half bitperiod
// Count the bitslot we are in... (ISO 15693)
Uart.nOutOfCnt++;
if(!bit) {
if(Uart.dropPosition) {
if(Uart.state == STATE_START_OF_COMMUNICATION) {
//error = 1;
}
else {
//error = 7;
}
// It is an error if we already have seen a drop in current frame
Uart.state = STATE_UNSYNCD;
Uart.highCnt = 0;
}
else {
Uart.dropPosition = Uart.nOutOfCnt;
}
}
Uart.posCnt = 0;
if(Uart.nOutOfCnt == Uart.OutOfCnt && Uart.OutOfCnt == 4) {
Uart.nOutOfCnt = 0;
if(Uart.state == STATE_START_OF_COMMUNICATION) {
if(Uart.dropPosition == 4) {
Uart.state = STATE_RECEIVING;
Uart.OutOfCnt = 256;
}
else if(Uart.dropPosition == 3) {
Uart.state = STATE_RECEIVING;
Uart.OutOfCnt = 4;
//Uart.output[Uart.byteCnt] = 0xdd;
//Uart.byteCnt++;
}
else {
Uart.state = STATE_UNSYNCD;
Uart.highCnt = 0;
}
Uart.dropPosition = 0;
}
else {
// RECEIVING DATA
// 1 out of 4
if(!Uart.dropPosition) {
Uart.state = STATE_UNSYNCD;
Uart.highCnt = 0;
//error = 9;
}
else {
Uart.shiftReg >>= 2;
// Swap bit order
Uart.dropPosition--;
//if(Uart.dropPosition == 1) { Uart.dropPosition = 2; }
//else if(Uart.dropPosition == 2) { Uart.dropPosition = 1; }
Uart.shiftReg ^= ((Uart.dropPosition & 0x03) << 6);
Uart.bitCnt += 2;
Uart.dropPosition = 0;
if(Uart.bitCnt == 8) {
Uart.output[Uart.byteCnt] = (Uart.shiftReg & 0xff);
Uart.byteCnt++;
// Calculate the parity bit for the client...
Uart.parityBits <<= 1;
Uart.parityBits ^= OddByteParity[(Uart.shiftReg & 0xff)];
Uart.bitCnt = 0;
Uart.shiftReg = 0;
}
}
}
}
else if(Uart.nOutOfCnt == Uart.OutOfCnt) {
// RECEIVING DATA
// 1 out of 256
if(!Uart.dropPosition) {
Uart.state = STATE_UNSYNCD;
Uart.highCnt = 0;
//error = 3;
}
else {
Uart.dropPosition--;
Uart.output[Uart.byteCnt] = (Uart.dropPosition & 0xff);
Uart.byteCnt++;
// Calculate the parity bit for the client...
Uart.parityBits <<= 1;
Uart.parityBits ^= OddByteParity[(Uart.dropPosition & 0xff)];
Uart.bitCnt = 0;
Uart.shiftReg = 0;
Uart.nOutOfCnt = 0;
Uart.dropPosition = 0;
}
}
/*if(error) {
Uart.output[Uart.byteCnt] = 0xAA;
Uart.byteCnt++;
Uart.output[Uart.byteCnt] = error & 0xFF;
Uart.byteCnt++;
Uart.output[Uart.byteCnt] = 0xAA;
Uart.byteCnt++;
Uart.output[Uart.byteCnt] = (Uart.bitBuffer >> 8) & 0xFF;
Uart.byteCnt++;
Uart.output[Uart.byteCnt] = Uart.bitBuffer & 0xFF;
Uart.byteCnt++;
Uart.output[Uart.byteCnt] = (Uart.syncBit >> 3) & 0xFF;
Uart.byteCnt++;
Uart.output[Uart.byteCnt] = 0xAA;
Uart.byteCnt++;
return TRUE;
}*/
}
}
else {
bit = Uart.bitBuffer & 0xf0;
bit >>= 4;
bit ^= 0x0F; // drops become 1s ;-)
if(bit) {
// should have been high or at least (4 * 128) / fc
// according to ISO this should be at least (9 * 128 + 20) / fc
if(Uart.highCnt == 8) {
// we went low, so this could be start of communication
// it turns out to be safer to choose a less significant
// syncbit... so we check whether the neighbour also represents the drop
Uart.posCnt = 1; // apparently we are busy with our first half bit period
Uart.syncBit = bit & 8;
Uart.samples = 3;
if(!Uart.syncBit) { Uart.syncBit = bit & 4; Uart.samples = 2; }
else if(bit & 4) { Uart.syncBit = bit & 4; Uart.samples = 2; bit <<= 2; }
if(!Uart.syncBit) { Uart.syncBit = bit & 2; Uart.samples = 1; }
else if(bit & 2) { Uart.syncBit = bit & 2; Uart.samples = 1; bit <<= 1; }
if(!Uart.syncBit) { Uart.syncBit = bit & 1; Uart.samples = 0;
if(Uart.syncBit && (Uart.bitBuffer & 8)) {
Uart.syncBit = 8;
// the first half bit period is expected in next sample
Uart.posCnt = 0;
Uart.samples = 3;
}
}
else if(bit & 1) { Uart.syncBit = bit & 1; Uart.samples = 0; }
Uart.syncBit <<= 4;
Uart.state = STATE_START_OF_COMMUNICATION;
Uart.bitCnt = 0;
Uart.byteCnt = 0;
Uart.parityBits = 0;
Uart.nOutOfCnt = 0;
Uart.OutOfCnt = 4; // Start at 1/4, could switch to 1/256
Uart.dropPosition = 0;
Uart.shiftReg = 0;
//error = 0;
}
else {
Uart.highCnt = 0;
}
}
else {
if(Uart.highCnt < 8) {
Uart.highCnt++;
}
}
}
return FALSE;
}
//=============================================================================
// Manchester
//=============================================================================
static struct {
enum {
DEMOD_UNSYNCD,
DEMOD_START_OF_COMMUNICATION,
DEMOD_START_OF_COMMUNICATION2,
DEMOD_START_OF_COMMUNICATION3,
DEMOD_SOF_COMPLETE,
DEMOD_MANCHESTER_D,
DEMOD_MANCHESTER_E,
DEMOD_END_OF_COMMUNICATION,
DEMOD_END_OF_COMMUNICATION2,
DEMOD_MANCHESTER_F,
DEMOD_ERROR_WAIT
} state;
int bitCount;
int posCount;
int syncBit;
int parityBits;
uint16_t shiftReg;
int buffer;
int buffer2;
int buffer3;
int buff;
int samples;
int len;
enum {
SUB_NONE,
SUB_FIRST_HALF,
SUB_SECOND_HALF,
SUB_BOTH
} sub;
uint8_t *output;
} Demod;
static RAMFUNC int ManchesterDecoding(int v)
{
int bit;
int modulation;
int error = 0;
bit = Demod.buffer;
Demod.buffer = Demod.buffer2;
Demod.buffer2 = Demod.buffer3;
Demod.buffer3 = v;
if(Demod.buff < 3) {
Demod.buff++;
return FALSE;
}
if(Demod.state==DEMOD_UNSYNCD) {
Demod.output[Demod.len] = 0xfa;
Demod.syncBit = 0;
//Demod.samples = 0;
Demod.posCount = 1; // This is the first half bit period, so after syncing handle the second part
if(bit & 0x08) {
Demod.syncBit = 0x08;
}
if(bit & 0x04) {
if(Demod.syncBit) {
bit <<= 4;
}
Demod.syncBit = 0x04;
}
if(bit & 0x02) {
if(Demod.syncBit) {
bit <<= 2;
}
Demod.syncBit = 0x02;
}
if(bit & 0x01 && Demod.syncBit) {
Demod.syncBit = 0x01;
}
if(Demod.syncBit) {
Demod.len = 0;
Demod.state = DEMOD_START_OF_COMMUNICATION;
Demod.sub = SUB_FIRST_HALF;
Demod.bitCount = 0;
Demod.shiftReg = 0;
Demod.parityBits = 0;
Demod.samples = 0;
if(Demod.posCount) {
//if(trigger) LED_A_OFF(); // Not useful in this case...
switch(Demod.syncBit) {
case 0x08: Demod.samples = 3; break;
case 0x04: Demod.samples = 2; break;
case 0x02: Demod.samples = 1; break;
case 0x01: Demod.samples = 0; break;
}
// SOF must be long burst... otherwise stay unsynced!!!
if(!(Demod.buffer & Demod.syncBit) || !(Demod.buffer2 & Demod.syncBit)) {
Demod.state = DEMOD_UNSYNCD;
}
}
else {
// SOF must be long burst... otherwise stay unsynced!!!
if(!(Demod.buffer2 & Demod.syncBit) || !(Demod.buffer3 & Demod.syncBit)) {
Demod.state = DEMOD_UNSYNCD;
error = 0x88;
}
}
error = 0;
}
}
else {
modulation = bit & Demod.syncBit;
modulation |= ((bit << 1) ^ ((Demod.buffer & 0x08) >> 3)) & Demod.syncBit;
//modulation = ((bit << 1) ^ ((Demod.buffer & 0x08) >> 3)) & Demod.syncBit;
Demod.samples += 4;
if(Demod.posCount==0) {
Demod.posCount = 1;
if(modulation) {
Demod.sub = SUB_FIRST_HALF;
}
else {
Demod.sub = SUB_NONE;
}
}
else {
Demod.posCount = 0;
/*(modulation && (Demod.sub == SUB_FIRST_HALF)) {
if(Demod.state!=DEMOD_ERROR_WAIT) {
Demod.state = DEMOD_ERROR_WAIT;
Demod.output[Demod.len] = 0xaa;
error = 0x01;
}
}*/
//else if(modulation) {
if(modulation) {
if(Demod.sub == SUB_FIRST_HALF) {
Demod.sub = SUB_BOTH;
}
else {
Demod.sub = SUB_SECOND_HALF;
}
}
else if(Demod.sub == SUB_NONE) {
if(Demod.state == DEMOD_SOF_COMPLETE) {
Demod.output[Demod.len] = 0x0f;
Demod.len++;
Demod.parityBits <<= 1;
Demod.parityBits ^= OddByteParity[0x0f];
Demod.state = DEMOD_UNSYNCD;
// error = 0x0f;
return TRUE;
}
else {
Demod.state = DEMOD_ERROR_WAIT;
error = 0x33;
}
/*if(Demod.state!=DEMOD_ERROR_WAIT) {
Demod.state = DEMOD_ERROR_WAIT;
Demod.output[Demod.len] = 0xaa;
error = 0x01;
}*/
}
switch(Demod.state) {
case DEMOD_START_OF_COMMUNICATION:
if(Demod.sub == SUB_BOTH) {
//Demod.state = DEMOD_MANCHESTER_D;
Demod.state = DEMOD_START_OF_COMMUNICATION2;
Demod.posCount = 1;
Demod.sub = SUB_NONE;
}
else {
Demod.output[Demod.len] = 0xab;
Demod.state = DEMOD_ERROR_WAIT;
error = 0xd2;
}
break;
case DEMOD_START_OF_COMMUNICATION2:
if(Demod.sub == SUB_SECOND_HALF) {
Demod.state = DEMOD_START_OF_COMMUNICATION3;
}
else {
Demod.output[Demod.len] = 0xab;
Demod.state = DEMOD_ERROR_WAIT;
error = 0xd3;
}
break;
case DEMOD_START_OF_COMMUNICATION3:
if(Demod.sub == SUB_SECOND_HALF) {
// Demod.state = DEMOD_MANCHESTER_D;
Demod.state = DEMOD_SOF_COMPLETE;
//Demod.output[Demod.len] = Demod.syncBit & 0xFF;
//Demod.len++;
}
else {
Demod.output[Demod.len] = 0xab;
Demod.state = DEMOD_ERROR_WAIT;
error = 0xd4;
}
break;
case DEMOD_SOF_COMPLETE:
case DEMOD_MANCHESTER_D:
case DEMOD_MANCHESTER_E:
// OPPOSITE FROM ISO14443 - 11110000 = 0 (1 in 14443)
// 00001111 = 1 (0 in 14443)
if(Demod.sub == SUB_SECOND_HALF) { // SUB_FIRST_HALF
Demod.bitCount++;
Demod.shiftReg = (Demod.shiftReg >> 1) ^ 0x100;
Demod.state = DEMOD_MANCHESTER_D;
}
else if(Demod.sub == SUB_FIRST_HALF) { // SUB_SECOND_HALF
Demod.bitCount++;
Demod.shiftReg >>= 1;
Demod.state = DEMOD_MANCHESTER_E;
}
else if(Demod.sub == SUB_BOTH) {
Demod.state = DEMOD_MANCHESTER_F;
}
else {
Demod.state = DEMOD_ERROR_WAIT;
error = 0x55;
}
break;
case DEMOD_MANCHESTER_F:
// Tag response does not need to be a complete byte!
if(Demod.len > 0 || Demod.bitCount > 0) {
if(Demod.bitCount > 1) { // was > 0, do not interpret last closing bit, is part of EOF
Demod.shiftReg >>= (9 - Demod.bitCount);
Demod.output[Demod.len] = Demod.shiftReg & 0xff;
Demod.len++;
// No parity bit, so just shift a 0
Demod.parityBits <<= 1;
}
Demod.state = DEMOD_UNSYNCD;
return TRUE;
}
else {
Demod.output[Demod.len] = 0xad;
Demod.state = DEMOD_ERROR_WAIT;
error = 0x03;
}
break;
case DEMOD_ERROR_WAIT:
Demod.state = DEMOD_UNSYNCD;
break;
default:
Demod.output[Demod.len] = 0xdd;
Demod.state = DEMOD_UNSYNCD;
break;
}
/*if(Demod.bitCount>=9) {
Demod.output[Demod.len] = Demod.shiftReg & 0xff;
Demod.len++;
Demod.parityBits <<= 1;
Demod.parityBits ^= ((Demod.shiftReg >> 8) & 0x01);
Demod.bitCount = 0;
Demod.shiftReg = 0;
}*/
if(Demod.bitCount>=8) {
Demod.shiftReg >>= 1;
Demod.output[Demod.len] = (Demod.shiftReg & 0xff);
Demod.len++;
// FOR ISO15639 PARITY NOT SEND OTA, JUST CALCULATE IT FOR THE CLIENT
Demod.parityBits <<= 1;
Demod.parityBits ^= OddByteParity[(Demod.shiftReg & 0xff)];
Demod.bitCount = 0;
Demod.shiftReg = 0;
}
if(error) {
Demod.output[Demod.len] = 0xBB;
Demod.len++;
Demod.output[Demod.len] = error & 0xFF;
Demod.len++;
Demod.output[Demod.len] = 0xBB;
Demod.len++;
Demod.output[Demod.len] = bit & 0xFF;
Demod.len++;
Demod.output[Demod.len] = Demod.buffer & 0xFF;
Demod.len++;
// Look harder ;-)
Demod.output[Demod.len] = Demod.buffer2 & 0xFF;
Demod.len++;
Demod.output[Demod.len] = Demod.syncBit & 0xFF;
Demod.len++;
Demod.output[Demod.len] = 0xBB;
Demod.len++;
return TRUE;
}
}
} // end (state != UNSYNCED)
return FALSE;
}
//=============================================================================
// Finally, a `sniffer' for iClass communication
// Both sides of communication!
//=============================================================================
//-----------------------------------------------------------------------------
// Record the sequence of commands sent by the reader to the tag, with
// triggering so that we start recording at the point that the tag is moved
// near the reader.
//-----------------------------------------------------------------------------
void RAMFUNC SnoopIClass(void)
{
// DEFINED ABOVE
// #define RECV_CMD_OFFSET 3032
// #define RECV_RES_OFFSET 3096
// #define DMA_BUFFER_OFFSET 3160
// #define DMA_BUFFER_SIZE 4096
// #define TRACE_SIZE 3000
// We won't start recording the frames that we acquire until we trigger;
// a good trigger condition to get started is probably when we see a
// response from the tag.
//int triggered = FALSE; // FALSE to wait first for card
// The command (reader -> tag) that we're receiving.
// The length of a received command will in most cases be no more than 18 bytes.
// So 32 should be enough!
uint8_t *receivedCmd = (((uint8_t *)BigBuf) + RECV_CMD_OFFSET);
// The response (tag -> reader) that we're receiving.
uint8_t *receivedResponse = (((uint8_t *)BigBuf) + RECV_RES_OFFSET);
// As we receive stuff, we copy it from receivedCmd or receivedResponse
// into trace, along with its length and other annotations.
//uint8_t *trace = (uint8_t *)BigBuf;
// reset traceLen to 0
iso14a_set_tracing(TRUE);
iso14a_clear_trace();
iso14a_set_trigger(FALSE);
// The DMA buffer, used to stream samples from the FPGA
int8_t *dmaBuf = ((int8_t *)BigBuf) + DMA_BUFFER_OFFSET;
int lastRxCounter;
int8_t *upTo;
int smpl;
int maxBehindBy = 0;
// Count of samples received so far, so that we can include timing
// information in the trace buffer.
int samples = 0;
rsamples = 0;
memset(trace, 0x44, RECV_CMD_OFFSET);
// Set up the demodulator for tag -> reader responses.
Demod.output = receivedResponse;
Demod.len = 0;
Demod.state = DEMOD_UNSYNCD;
// Setup for the DMA.
FpgaSetupSsc();
upTo = dmaBuf;
lastRxCounter = DMA_BUFFER_SIZE;
FpgaSetupSscDma((uint8_t *)dmaBuf, DMA_BUFFER_SIZE);
// And the reader -> tag commands
memset(&Uart, 0, sizeof(Uart));
Uart.output = receivedCmd;
Uart.byteCntMax = 32; // was 100 (greg)////////////////////////////////////////////////////////////////////////
Uart.state = STATE_UNSYNCD;
// And put the FPGA in the appropriate mode
// Signal field is off with the appropriate LED
LED_D_OFF();
FpgaWriteConfWord(FPGA_MAJOR_MODE_HF_ISO14443A | FPGA_HF_ISO14443A_SNIFFER);
SetAdcMuxFor(GPIO_MUXSEL_HIPKD);
int div = 0;
//int div2 = 0;
int decbyte = 0;
int decbyter = 0;
// And now we loop, receiving samples.
for(;;) {
LED_A_ON();
WDT_HIT();
int behindBy = (lastRxCounter - AT91C_BASE_PDC_SSC->PDC_RCR) &
(DMA_BUFFER_SIZE-1);
if(behindBy > maxBehindBy) {
maxBehindBy = behindBy;
if(behindBy > 400) {
Dbprintf("blew circular buffer! behindBy=0x%x", behindBy);
goto done;
}
}
if(behindBy < 1) continue;
LED_A_OFF();
smpl = upTo[0];
upTo++;
lastRxCounter -= 1;
if(upTo - dmaBuf > DMA_BUFFER_SIZE) {
upTo -= DMA_BUFFER_SIZE;
lastRxCounter += DMA_BUFFER_SIZE;
AT91C_BASE_PDC_SSC->PDC_RNPR = (uint32_t) upTo;
AT91C_BASE_PDC_SSC->PDC_RNCR = DMA_BUFFER_SIZE;
}
//samples += 4;
samples += 1;
//div2++;
//if(div2 > 3) {
//div2 = 0;
//decbyte ^= ((smpl & 0x01) << (3 - div));
//decbyte ^= (((smpl & 0x01) | ((smpl & 0x02) >> 1)) << (3 - div)); // better already...
//decbyte ^= (((smpl & 0x01) | ((smpl & 0x02) >> 1) | ((smpl & 0x04) >> 2)) << (3 - div)); // even better...
if(smpl & 0xF) {
decbyte ^= (1 << (3 - div));
}
//decbyte ^= (MajorityNibble[(smpl & 0x0F)] << (3 - div));
// FOR READER SIDE COMMUMICATION...
//decbyte ^= ((smpl & 0x10) << (3 - div));
decbyter <<= 2;
decbyter ^= (smpl & 0x30);
div++;
if((div + 1) % 2 == 0) {
smpl = decbyter;
if(OutOfNDecoding((smpl & 0xF0) >> 4)) {
rsamples = samples - Uart.samples;
LED_C_ON();
//if(triggered) {
trace[traceLen++] = ((rsamples >> 0) & 0xff);
trace[traceLen++] = ((rsamples >> 8) & 0xff);
trace[traceLen++] = ((rsamples >> 16) & 0xff);
trace[traceLen++] = ((rsamples >> 24) & 0xff);
trace[traceLen++] = ((Uart.parityBits >> 0) & 0xff);
trace[traceLen++] = ((Uart.parityBits >> 8) & 0xff);
trace[traceLen++] = ((Uart.parityBits >> 16) & 0xff);
trace[traceLen++] = ((Uart.parityBits >> 24) & 0xff);
trace[traceLen++] = Uart.byteCnt;
memcpy(trace+traceLen, receivedCmd, Uart.byteCnt);
traceLen += Uart.byteCnt;
if(traceLen > TRACE_SIZE) break;
//}
/* And ready to receive another command. */
Uart.state = STATE_UNSYNCD;
/* And also reset the demod code, which might have been */
/* false-triggered by the commands from the reader. */
Demod.state = DEMOD_UNSYNCD;
LED_B_OFF();
Uart.byteCnt = 0;
}
decbyter = 0;
}
if(div > 3) {
smpl = decbyte;
if(ManchesterDecoding(smpl & 0x0F)) {
rsamples = samples - Demod.samples;
LED_B_ON();
// timestamp, as a count of samples
trace[traceLen++] = ((rsamples >> 0) & 0xff);
trace[traceLen++] = ((rsamples >> 8) & 0xff);
trace[traceLen++] = ((rsamples >> 16) & 0xff);
trace[traceLen++] = 0x80 | ((rsamples >> 24) & 0xff);
trace[traceLen++] = ((Demod.parityBits >> 0) & 0xff);
trace[traceLen++] = ((Demod.parityBits >> 8) & 0xff);
trace[traceLen++] = ((Demod.parityBits >> 16) & 0xff);
trace[traceLen++] = ((Demod.parityBits >> 24) & 0xff);
// length
trace[traceLen++] = Demod.len;
memcpy(trace+traceLen, receivedResponse, Demod.len);
traceLen += Demod.len;
if(traceLen > TRACE_SIZE) break;
//triggered = TRUE;
// And ready to receive another response.
memset(&Demod, 0, sizeof(Demod));
Demod.output = receivedResponse;
Demod.state = DEMOD_UNSYNCD;
LED_C_OFF();
}
div = 0;
decbyte = 0x00;
}
//}
if(BUTTON_PRESS()) {
DbpString("cancelled_a");
goto done;
}
}
DbpString("COMMAND FINISHED");
Dbprintf("%x %x %x", maxBehindBy, Uart.state, Uart.byteCnt);
Dbprintf("%x %x %x", Uart.byteCntMax, traceLen, (int)Uart.output[0]);
done:
AT91C_BASE_PDC_SSC->PDC_PTCR = AT91C_PDC_RXTDIS;
Dbprintf("%x %x %x", maxBehindBy, Uart.state, Uart.byteCnt);
Dbprintf("%x %x %x", Uart.byteCntMax, traceLen, (int)Uart.output[0]);
LED_A_OFF();
LED_B_OFF();
LED_C_OFF();
LED_D_OFF();
}
void rotateCSN(uint8_t* originalCSN, ui
gitextract_qaqs9osu/
├── IR/
│ ├── README.txt
│ ├── ir.pde
│ └── ir2.pde
├── README
├── RFIDler/
│ └── tama.py
├── TamagotchiFriends/
│ └── proxmark/
│ └── armsrc/
│ ├── LCD.c
│ ├── LCD.h
│ ├── Makefile
│ ├── appmain.c
│ ├── apps.h
│ ├── crapto1.c
│ ├── crapto1.h
│ ├── crypto1.c
│ ├── epa.c
│ ├── epa.h
│ ├── fonts.c
│ ├── fonts.h
│ ├── fpgaloader.c
│ ├── hitag2.c
│ ├── iclass.c
│ ├── iso14443.c
│ ├── iso14443a.c
│ ├── iso14443a.h
│ ├── iso15693.c
│ ├── ldscript
│ ├── legicrf.c
│ ├── legicrf.h
│ ├── lfops.c
│ ├── lfops_rcv_works.txt
│ ├── mifarecmd.c
│ ├── mifarecmd.h
│ ├── mifaresniff.c
│ ├── mifaresniff.h
│ ├── mifareutil.c
│ ├── mifareutil.h
│ ├── obj/
│ │ ├── appmain.d
│ │ ├── appmain.o
│ │ ├── cmd.d
│ │ ├── cmd.o
│ │ ├── crapto1.d
│ │ ├── crapto1.o
│ │ ├── crc.d
│ │ ├── crc.o
│ │ ├── crc16.d
│ │ ├── crc16.o
│ │ ├── crypto1.d
│ │ ├── crypto1.o
│ │ ├── epa.d
│ │ ├── epa.o
│ │ ├── fpga.o
│ │ ├── fpgaimage.elf
│ │ ├── fpgaimage.s19
│ │ ├── fpgaloader.d
│ │ ├── fpgaloader.o
│ │ ├── fullimage.elf
│ │ ├── hitag2.d
│ │ ├── hitag2.o
│ │ ├── iclass.d
│ │ ├── iclass.o
│ │ ├── iso14443.d
│ │ ├── iso14443.o
│ │ ├── iso14443a.d
│ │ ├── iso14443a.o
│ │ ├── iso14443crc.d
│ │ ├── iso14443crc.o
│ │ ├── iso15693.d
│ │ ├── iso15693.o
│ │ ├── iso15693tools.d
│ │ ├── iso15693tools.o
│ │ ├── legic_prng.d
│ │ ├── legic_prng.o
│ │ ├── legicrf.d
│ │ ├── legicrf.o
│ │ ├── lfops.d
│ │ ├── lfops.o
│ │ ├── mifarecmd.d
│ │ ├── mifarecmd.o
│ │ ├── mifaresniff.d
│ │ ├── mifaresniff.o
│ │ ├── mifareutil.d
│ │ ├── mifareutil.o
│ │ ├── osimage.elf
│ │ ├── osimage.s19
│ │ ├── printf.d
│ │ ├── printf.o
│ │ ├── start.d
│ │ ├── start.o
│ │ ├── string.d
│ │ ├── string.o
│ │ ├── usb_cdc.d
│ │ ├── usb_cdc.o
│ │ ├── util.d
│ │ ├── util.o
│ │ └── version.o
│ ├── printf.c
│ ├── printf.h
│ ├── start.c
│ ├── stdint.h
│ ├── string.c
│ ├── string.h
│ ├── util.c
│ ├── util.h
│ └── version.c
├── TamagotchiOn/
│ └── tasmgotchi/
│ ├── demos/
│ │ └── waitforbutton/
│ │ ├── myassembly.txt
│ │ └── myimages.txt
│ └── makegame.py
├── codedump/
│ ├── GPTestProgram
│ ├── README.txt
│ ├── binbits
│ ├── binbits2
│ ├── decode.py
│ ├── first100.txt
│ ├── in.txt
│ ├── ports.txt
│ └── tf/
│ ├── eeprom5cd/
│ │ └── eeprom5cd.ino
│ └── glitch2/
│ └── glitch2.ino
├── demos/
│ ├── README
│ ├── facemain.c
│ ├── harlemshake
│ ├── mad
│ ├── nataliemain.c
│ └── nsdemomain.c
├── devtools/
│ └── itemmake/
│ ├── README
│ ├── itemmake.py
│ ├── samplescript.txt
│ └── template.txt
├── die/
│ └── README
├── disassembler/
│ ├── README
│ ├── a.txt
│ ├── bytecode.txt
│ ├── bytecoden.txt
│ ├── bytecoder.txt
│ ├── bytecodes.txt
│ └── dissa.py
├── figure/
│ ├── Arduino/
│ │ ├── ClientSide/
│ │ │ ├── README.txt
│ │ │ ├── ser.py
│ │ │ └── serw.py
│ │ ├── GeneralPlusRomDump/
│ │ │ └── GeneralPlusRomDump.ino
│ │ ├── GeneralPlusRomWrite/
│ │ │ └── GeneralPlusRomWrite.ino
│ │ └── README.txt
│ ├── README
│ ├── ROMDump/
│ │ ├── README
│ │ ├── ROMDump
│ │ ├── imgs/
│ │ │ └── adds.txt
│ │ ├── makiko
│ │ └── shimashimatchi
│ ├── SignalPulls/
│ │ ├── README
│ │ ├── empire.txt
│ │ ├── signaldecode.py
│ │ ├── usatour.txt
│ │ └── usatourbuy.txt
│ └── scripts/
│ ├── README
│ ├── im.py
│ └── l.txt
├── figure-simulator/
│ ├── README
│ └── simulator.pde
├── figure-simulator-discovery/
│ ├── .cproject
│ ├── .project
│ ├── .settings/
│ │ ├── com.atollic.truestudio.debug.hardware_device.prefs
│ │ └── org.eclipse.cdt.managedbuilder.core.prefs
│ ├── Libraries/
│ │ ├── CMSIS/
│ │ │ └── Include/
│ │ │ ├── arm_common_tables.h
│ │ │ ├── arm_math.h
│ │ │ ├── core_cm4.h
│ │ │ ├── core_cm4_simd.h
│ │ │ ├── core_cmFunc.h
│ │ │ └── core_cmInstr.h
│ │ ├── Device/
│ │ │ └── STM32F4xx/
│ │ │ ├── Include/
│ │ │ │ ├── stm32f4xx.h
│ │ │ │ └── system_stm32f4xx.h
│ │ │ └── Release_Notes.html
│ │ └── STM32F4xx_StdPeriph_Driver/
│ │ ├── Release_Notes.html
│ │ ├── inc/
│ │ │ ├── misc.h
│ │ │ ├── stm32f4xx_adc.h
│ │ │ ├── stm32f4xx_can.h
│ │ │ ├── stm32f4xx_crc.h
│ │ │ ├── stm32f4xx_cryp.h
│ │ │ ├── stm32f4xx_dac.h
│ │ │ ├── stm32f4xx_dbgmcu.h
│ │ │ ├── stm32f4xx_dcmi.h
│ │ │ ├── stm32f4xx_dma.h
│ │ │ ├── stm32f4xx_exti.h
│ │ │ ├── stm32f4xx_flash.h
│ │ │ ├── stm32f4xx_fsmc.h
│ │ │ ├── stm32f4xx_gpio.h
│ │ │ ├── stm32f4xx_hash.h
│ │ │ ├── stm32f4xx_i2c.h
│ │ │ ├── stm32f4xx_iwdg.h
│ │ │ ├── stm32f4xx_pwr.h
│ │ │ ├── stm32f4xx_rcc.h
│ │ │ ├── stm32f4xx_rng.h
│ │ │ ├── stm32f4xx_rtc.h
│ │ │ ├── stm32f4xx_sdio.h
│ │ │ ├── stm32f4xx_spi.h
│ │ │ ├── stm32f4xx_syscfg.h
│ │ │ ├── stm32f4xx_tim.h
│ │ │ ├── stm32f4xx_usart.h
│ │ │ └── stm32f4xx_wwdg.h
│ │ └── src/
│ │ ├── misc.c
│ │ ├── stm32f4xx_adc.c
│ │ ├── stm32f4xx_can.c
│ │ ├── stm32f4xx_crc.c
│ │ ├── stm32f4xx_cryp.c
│ │ ├── stm32f4xx_cryp_aes.c
│ │ ├── stm32f4xx_cryp_des.c
│ │ ├── stm32f4xx_cryp_tdes.c
│ │ ├── stm32f4xx_dac.c
│ │ ├── stm32f4xx_dbgmcu.c
│ │ ├── stm32f4xx_dcmi.c
│ │ ├── stm32f4xx_dma.c
│ │ ├── stm32f4xx_exti.c
│ │ ├── stm32f4xx_flash.c
│ │ ├── stm32f4xx_fsmc.c
│ │ ├── stm32f4xx_gpio.c
│ │ ├── stm32f4xx_hash.c
│ │ ├── stm32f4xx_hash_md5.c
│ │ ├── stm32f4xx_hash_sha1.c
│ │ ├── stm32f4xx_i2c.c
│ │ ├── stm32f4xx_iwdg.c
│ │ ├── stm32f4xx_pwr.c
│ │ ├── stm32f4xx_rcc.c
│ │ ├── stm32f4xx_rng.c
│ │ ├── stm32f4xx_rtc.c
│ │ ├── stm32f4xx_sdio.c
│ │ ├── stm32f4xx_spi.c
│ │ ├── stm32f4xx_syscfg.c
│ │ ├── stm32f4xx_tim.c
│ │ ├── stm32f4xx_usart.c
│ │ └── stm32f4xx_wwdg.c
│ ├── README
│ ├── Utilities/
│ │ └── STM32F4-Discovery/
│ │ ├── Release_Notes.html
│ │ ├── libPDMFilter_GCC.a
│ │ ├── pdm_filter.h
│ │ ├── stm32f4_discovery.c
│ │ ├── stm32f4_discovery.h
│ │ ├── stm32f4_discovery_lis302dl.c
│ │ └── stm32f4_discovery_lis302dl.h
│ ├── spi.elf.launch
│ ├── src/
│ │ ├── main.c
│ │ ├── startup_stm32f4xx.s
│ │ ├── stm32f4xx_conf.h
│ │ ├── stm32f4xx_it.c
│ │ ├── stm32f4xx_it.h
│ │ ├── system_stm32f4xx.c
│ │ └── tiny_printf.c
│ └── stm32f4_flash.ld
├── imageformats/
│ ├── README
│ ├── conv.py
│ └── pic.txt
└── slides/
└── recon.ppt
SYMBOL INDEX (1378 symbols across 97 files)
FILE: RFIDler/tama.py
function send_byte (line 10) | def send_byte(b):
function toBinary (line 40) | def toBinary(n):
FILE: TamagotchiFriends/proxmark/armsrc/LCD.c
function LCDSend (line 14) | void LCDSend(unsigned int data)
function LCDSetXY (line 23) | void LCDSetXY(unsigned char x, unsigned char y)
function LCDSetPixel (line 34) | void LCDSetPixel(unsigned char x, unsigned char y, unsigned char color)
function LCDFill (line 41) | void LCDFill (unsigned char xs,unsigned char ys,unsigned char width,unsi...
function LCDString (line 55) | void LCDString (char *lcd_string, const char *font_style,unsigned char x...
function LCDReset (line 94) | void LCDReset(void)
function LCDInit (line 106) | void LCDInit(void)
FILE: TamagotchiFriends/proxmark/armsrc/appmain.c
type common_area (line 42) | struct common_area
function BufferClear (line 42) | __attribute__((section(".commonarea")));
function ToSendReset (line 50) | void ToSendReset(void)
function ToSendStuffBit (line 56) | void ToSendStuffBit(int b)
function DbpString (line 80) | void DbpString(char *str)
function DbpIntegers (line 102) | void DbpIntegers(int x1, int x2, int x3)
function Dbprintf (line 121) | void Dbprintf(const char *fmt, ...) {
function Dbhexdump (line 134) | void Dbhexdump(int len, uint8_t *d, bool bAsci) {
function ReadAdc (line 165) | static int ReadAdc(int ch)
function AvgAdc (line 184) | int AvgAdc(int ch) // was static - merlok
function MeasureAntennaTuning (line 196) | void MeasureAntennaTuning(void)
function MeasureAntennaTuningHf (line 259) | void MeasureAntennaTuningHf(void)
function SimulateTagHfListen (line 280) | void SimulateTagHfListen(void)
function ReadMem (line 325) | void ReadMem(int addr)
type version_information (line 334) | struct version_information
function SendVersion (line 337) | void SendVersion(void)
function SamyRun (line 363) | void SamyRun()
function ListenReaderField (line 511) | void ListenReaderField(int limit)
function UsbPacketReceived (line 619) | void UsbPacketReceived(uint8_t *packet, int len)
function AppMain (line 961) | void __attribute__((noreturn)) AppMain(void)
FILE: TamagotchiFriends/proxmark/armsrc/crapto1.c
function fill_lut (line 25) | static void __attribute__((constructor)) fill_lut()
function quicksort (line 34) | static void quicksort(uint32_t* const start, uint32_t* const stop)
function update_contribution (line 75) | static inline void
function extend_table (line 88) | static inline void
function extend_table_simple (line 110) | static inline void extend_table_simple(uint32_t *tbl, uint32_t **end, in...
type Crypto1State (line 124) | struct Crypto1State
type Crypto1State (line 127) | struct Crypto1State
type Crypto1State (line 180) | struct Crypto1State
type Crypto1State (line 182) | struct Crypto1State
type Crypto1State (line 194) | struct Crypto1State
type Crypto1State (line 248) | struct Crypto1State
type Crypto1State (line 250) | struct Crypto1State
type Crypto1State (line 256) | struct Crypto1State
function lfsr_rollback_bit (line 318) | uint8_t lfsr_rollback_bit(struct Crypto1State *s, uint32_t in, int fb)
function lfsr_rollback_byte (line 338) | uint8_t lfsr_rollback_byte(struct Crypto1State *s, uint32_t in, int fb)
function lfsr_rollback_word (line 348) | uint32_t lfsr_rollback_word(struct Crypto1State *s, uint32_t in, int fb)
function nonce_distance (line 361) | int nonce_distance(uint32_t from, uint32_t to)
type Crypto1State (line 415) | struct Crypto1State
type Crypto1State (line 417) | struct Crypto1State
type Crypto1State (line 449) | struct Crypto1State
type Crypto1State (line 452) | struct Crypto1State
FILE: TamagotchiFriends/proxmark/armsrc/crapto1.h
type Crypto1State (line 27) | struct Crypto1State {uint32_t odd, even;}
type Crypto1State (line 28) | struct Crypto1State
type Crypto1State (line 29) | struct Crypto1State
type Crypto1State (line 30) | struct Crypto1State
type Crypto1State (line 31) | struct Crypto1State
type Crypto1State (line 32) | struct Crypto1State
type Crypto1State (line 33) | struct Crypto1State
type Crypto1State (line 36) | struct Crypto1State
type Crypto1State (line 37) | struct Crypto1State
type Crypto1State (line 39) | struct Crypto1State
type Crypto1State (line 42) | struct Crypto1State
type Crypto1State (line 43) | struct Crypto1State
type Crypto1State (line 44) | struct Crypto1State
function parity (line 61) | static inline int parity(uint32_t x)
function filter (line 79) | static inline int filter(uint32_t const x)
FILE: TamagotchiFriends/proxmark/armsrc/crypto1.c
function crypto1_create (line 26) | void crypto1_create(struct Crypto1State *s, uint64_t key)
function crypto1_destroy (line 37) | void crypto1_destroy(struct Crypto1State *state)
function crypto1_get_lfsr (line 43) | void crypto1_get_lfsr(struct Crypto1State *state, uint64_t *lfsr)
function crypto1_bit (line 51) | uint8_t crypto1_bit(struct Crypto1State *s, uint8_t in, int is_encrypted)
function crypto1_byte (line 66) | uint8_t crypto1_byte(struct Crypto1State *s, uint8_t in, int is_encrypted)
function crypto1_word (line 75) | uint32_t crypto1_word(struct Crypto1State *s, uint32_t in, int is_encryp...
function prng_successor (line 88) | uint32_t prng_successor(uint32_t x, uint32_t n)
FILE: TamagotchiFriends/proxmark/armsrc/epa.c
function EPA_Finish (line 80) | void EPA_Finish()
function EPA_Parse_CardAccess (line 99) | size_t EPA_Parse_CardAccess(uint8_t *data,
function EPA_Read_CardAccess (line 172) | int EPA_Read_CardAccess(uint8_t *buffer, size_t max_length)
function EPA_PACE_Collect_Nonce_Abort (line 214) | static void EPA_PACE_Collect_Nonce_Abort(uint8_t step, int func_return)
function EPA_PACE_Collect_Nonce (line 232) | void EPA_PACE_Collect_Nonce(UsbCommand *c)
function EPA_PACE_Get_Nonce (line 316) | int EPA_PACE_Get_Nonce(uint8_t requested_length, uint8_t *nonce)
function EPA_PACE_MSE_Set_AT (line 362) | int EPA_PACE_MSE_Set_AT(pace_version_info_t pace_version_info, uint8_t p...
function EPA_Setup (line 417) | int EPA_Setup()
FILE: TamagotchiFriends/proxmark/armsrc/epa.h
type pace_version_info_t (line 16) | typedef struct {
FILE: TamagotchiFriends/proxmark/armsrc/fpgaloader.c
function SetupSpi (line 22) | void SetupSpi(int mode)
function FpgaSetupSsc (line 98) | void FpgaSetupSsc(void)
function FpgaSetupSscDma (line 137) | bool FpgaSetupSscDma(uint8_t *buf, int len)
function DownloadFPGA_byte (line 153) | static void DownloadFPGA_byte(unsigned char w)
function DownloadFPGA (line 168) | static void DownloadFPGA(const char *FpgaImage, int FpgaImageLen, int by...
function bitparse_init (line 263) | static int bitparse_init(void * start_address, void *end_address)
function bitparse_find_section (line 277) | int bitparse_find_section(char section_name, char **section_start, unsig...
function FpgaDownloadAndGo (line 326) | void FpgaDownloadAndGo(void)
function FpgaGatherVersion (line 354) | void FpgaGatherVersion(char *dst, int len)
function FpgaSendCommand (line 390) | void FpgaSendCommand(uint16_t cmd, uint16_t v)
function FpgaWriteConfWord (line 401) | void FpgaWriteConfWord(uint8_t v)
function SetAdcMuxFor (line 411) | void SetAdcMuxFor(uint32_t whichGpio)
FILE: TamagotchiFriends/proxmark/armsrc/hitag2.c
function LogTraceHitag (line 32) | int LogTraceHitag(const uint8_t * btBytes, int iBits, int iSamples, uint...
type hitag2_tag (line 56) | struct hitag2_tag {
type hitag2_tag (line 70) | struct hitag2_tag
function u32 (line 132) | static u32 _f20 (const u64 x)
function u64 (line 145) | static u64 _hitag2_init (const u64 key, const u32 serial, const u32 IV)
function u64 (line 158) | static u64 _hitag2_round (u64 *state)
function u32 (line 172) | static u32 _hitag2_byte (u64 * x)
function hitag2_reset (line 180) | int hitag2_reset(void)
function hitag2_init (line 187) | int hitag2_init(void)
function hitag2_cipher_reset (line 194) | static void hitag2_cipher_reset(struct hitag2_tag *tag, const byte_t *iv)
function hitag2_cipher_authenticate (line 213) | static int hitag2_cipher_authenticate(uint64_t* cs, const byte_t *authen...
function hitag2_cipher_transcrypt (line 223) | static int hitag2_cipher_transcrypt(uint64_t* cs, byte_t *data, unsigned...
function hitag_send_bit (line 265) | static void hitag_send_bit(int bit) {
function hitag_send_frame (line 287) | static void hitag_send_frame(const byte_t* frame, size_t frame_len)
function hitag2_handle_reader_command (line 303) | void hitag2_handle_reader_command(byte_t* rx, const size_t rxlen, byte_t...
function hitag_reader_send_bit (line 430) | static void hitag_reader_send_bit(int bit) {
function hitag_reader_send_frame (line 460) | static void hitag_reader_send_frame(const byte_t* frame, size_t frame_len)
function hitag2_password (line 478) | bool hitag2_password(byte_t* rx, const size_t rxlen, byte_t* tx, size_t*...
function hitag2_crypto (line 533) | bool hitag2_crypto(byte_t* rx, const size_t rxlen, byte_t* tx, size_t* t...
function hitag2_authenticate (line 626) | bool hitag2_authenticate(byte_t* rx, const size_t rxlen, byte_t* tx, siz...
function hitag2_test_auth_attempts (line 666) | bool hitag2_test_auth_attempts(byte_t* rx, const size_t rxlen, byte_t* t...
function SnoopHitag (line 721) | void SnoopHitag(uint32_t type) {
function SimulateHitagTag (line 931) | void SimulateHitagTag(bool tag_mem_supplied, byte_t* data) {
function ReaderHitag (line 1111) | void ReaderHitag(hitag_function htf, hitag_data* htd) {
FILE: TamagotchiFriends/proxmark/armsrc/iclass.c
function RAMFUNC (line 93) | static RAMFUNC int OutOfNDecoding(int bit)
function RAMFUNC (line 382) | static RAMFUNC int ManchesterDecoding(int v)
function SnoopIClass (line 667) | void RAMFUNC SnoopIClass(void)
function rotateCSN (line 872) | void rotateCSN(uint8_t* originalCSN, uint8_t* rotatedCSN) {
function GetIClassCommandFromReader (line 884) | static int GetIClassCommandFromReader(uint8_t *received, int *len, int m...
function CodeIClassTagAnswer (line 923) | static void CodeIClassTagAnswer(const uint8_t *cmd, int len)
function CodeIClassTagSOF (line 971) | static void CodeIClassTagSOF()
function SimulateIClass (line 994) | void SimulateIClass(uint8_t arg0, uint8_t *datain)
function SendIClassAnswer (line 1189) | static int SendIClassAnswer(uint8_t *resp, int respLen, int delay)
function TransmitIClassCommand (line 1236) | static void TransmitIClassCommand(const uint8_t *cmd, int len, int *samp...
function CodeIClassCommand (line 1297) | void CodeIClassCommand(const uint8_t * cmd, int len)
function ReaderTransmitIClass (line 1336) | void ReaderTransmitIClass(uint8_t* frame, int len)
function GetIClassAnswer (line 1360) | static int GetIClassAnswer(uint8_t *receivedResponse, int maxLen, int *s...
function ReaderReceiveIClass (line 1406) | int ReaderReceiveIClass(uint8_t* receivedAnswer)
function ReaderIClass (line 1416) | void ReaderIClass(uint8_t arg0) {
FILE: TamagotchiFriends/proxmark/armsrc/iso14443.c
function CodeIso14443bAsTag (line 40) | static void CodeIso14443bAsTag(const uint8_t *cmd, int len)
function Handle14443UartBit (line 154) | static int Handle14443UartBit(int bit)
function GetIso14443CommandFromReader (line 286) | static int GetIso14443CommandFromReader(uint8_t *received, int *len, int...
function SimulateIso14443Tag (line 331) | void SimulateIso14443Tag(void)
function RAMFUNC (line 468) | static RAMFUNC int Handle14443SamplesDemod(int ci, int cq)
function GetSamplesFor14443Demod (line 626) | static void GetSamplesFor14443Demod(int weTx, int n, int quiet)
function TransmitFor14443 (line 738) | static void TransmitFor14443(void)
function CodeIso14443bAsReader (line 789) | void CodeIso14443bAsReader(const uint8_t *cmd, int len)
function AcquireRawAdcSamplesIso14443 (line 847) | void AcquireRawAdcSamplesIso14443(uint32_t parameter)
function ReadSRI512Iso14443 (line 883) | void ReadSRI512Iso14443(uint32_t parameter)
function ReadSRIX4KIso14443 (line 887) | void ReadSRIX4KIso14443(uint32_t parameter)
function ReadSTMemoryIso14443 (line 892) | void ReadSTMemoryIso14443(uint32_t parameter,uint32_t dwLast)
function SnoopIso14443 (line 1033) | void RAMFUNC SnoopIso14443(void)
FILE: TamagotchiFriends/proxmark/armsrc/iso14443a.c
function iso14a_set_trigger (line 68) | void iso14a_set_trigger(bool enable) {
function iso14a_clear_trace (line 72) | void iso14a_clear_trace() {
function iso14a_set_tracing (line 77) | void iso14a_set_tracing(bool enable) {
function iso14a_set_timeout (line 81) | void iso14a_set_timeout(uint32_t timeout) {
function byte_t (line 89) | byte_t oddparity (const byte_t bt)
function GetParity (line 94) | uint32_t GetParity(const uint8_t * pbtCmd, int iLen)
function AppendCrc14443a (line 107) | void AppendCrc14443a(uint8_t* data, int len)
function LogTrace (line 113) | int RAMFUNC LogTrace(const uint8_t * btBytes, int iLen, int iSamples, ui...
function RAMFUNC (line 143) | static RAMFUNC int MillerDecoding(int bit)
function RAMFUNC (line 382) | static RAMFUNC int ManchesterDecoding(int v)
function SnoopIso14443a (line 580) | void RAMFUNC SnoopIso14443a(uint8_t param) {
function CodeIso14443aAsTagPar (line 726) | static void CodeIso14443aAsTagPar(const uint8_t *cmd, int len, uint32_t ...
function CodeIso14443aAsTag (line 774) | static void CodeIso14443aAsTag(const uint8_t *cmd, int len){
function CodeStrangeAnswerAsTag (line 781) | static void CodeStrangeAnswerAsTag()
function Code4bitAnswerAsTag (line 821) | static void Code4bitAnswerAsTag(uint8_t cmd)
function GetIso14443aCommandFromReader (line 867) | static int GetIso14443aCommandFromReader(uint8_t *received, int *len, in...
function SimulateIso14443aTag (line 915) | void SimulateIso14443aTag(int tagType, int uid_1st, int uid_2nd, byte_t*...
function TransmitFor14443a (line 1224) | static void TransmitFor14443a(const uint8_t *cmd, int len, int *samples,...
function CodeIso14443aBitsAsReaderPar (line 1267) | void CodeIso14443aBitsAsReaderPar(const uint8_t * cmd, int bits, uint32_...
function CodeIso14443aAsReaderPar (line 1348) | void CodeIso14443aAsReaderPar(const uint8_t * cmd, int len, uint32_t dwP...
function EmGetCmd (line 1358) | static int EmGetCmd(uint8_t *received, int *len, int maxLen)
function EmSendCmd14443aRaw (line 1430) | static int EmSendCmd14443aRaw(uint8_t *resp, int respLen, int correction...
function EmSend4bitEx (line 1473) | int EmSend4bitEx(uint8_t resp, int correctionNeeded){
function EmSend4bit (line 1480) | int EmSend4bit(uint8_t resp){
function EmSendCmdExPar (line 1484) | int EmSendCmdExPar(uint8_t *resp, int respLen, int correctionNeeded, uin...
function EmSendCmdEx (line 1491) | int EmSendCmdEx(uint8_t *resp, int respLen, int correctionNeeded){
function EmSendCmd (line 1495) | int EmSendCmd(uint8_t *resp, int respLen){
function EmSendCmdPar (line 1499) | int EmSendCmdPar(uint8_t *resp, int respLen, uint32_t par){
function GetIso14443aAnswerFromTag (line 1508) | static int GetIso14443aAnswerFromTag(uint8_t *receivedResponse, int maxL...
function ReaderTransmitBitsPar (line 1550) | void ReaderTransmitBitsPar(uint8_t* frame, int bits, uint32_t par)
function ReaderTransmitPar (line 1568) | void ReaderTransmitPar(uint8_t* frame, int len, uint32_t par)
function ReaderTransmit (line 1573) | void ReaderTransmit(uint8_t* frame, int len)
function ReaderReceive (line 1579) | int ReaderReceive(uint8_t* receivedAnswer)
function ReaderReceivePar (line 1588) | int ReaderReceivePar(uint8_t* receivedAnswer, uint32_t * parptr)
function iso14443a_select_card (line 1601) | int iso14443a_select_card(byte_t* uid_ptr, iso14a_card_select_t* p_hi14a...
function iso14443a_setup (line 1704) | void iso14443a_setup() {
function iso14_apdu (line 1724) | int iso14_apdu(uint8_t * cmd, size_t cmd_len, void * data) {
function ReaderIso14443a (line 1755) | void ReaderIso14443a(UsbCommand * c)
function PrepareDelayedAuthTransfer (line 1816) | void PrepareDelayedAuthTransfer(uint8_t* frame, int len, uint16_t delay)
function dist_nt (line 1843) | int32_t dist_nt(uint32_t nt1, uint32_t nt2) {
function ReaderMifare (line 1870) | void ReaderMifare(bool first_try)
function Mifare1ksim (line 2078) | void Mifare1ksim(uint8_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *datain)
function SniffMifare (line 2510) | void RAMFUNC SniffMifare(uint8_t param) {
FILE: TamagotchiFriends/proxmark/armsrc/iso14443a.h
type nestedVector (line 25) | typedef struct nestedVector { uint32_t nt, ks1; } nestedVector;
type tDemod (line 27) | typedef struct {
type tUart (line 53) | typedef struct {
FILE: TamagotchiFriends/proxmark/armsrc/iso15693.c
function CodeIso15693AsReader (line 95) | static void CodeIso15693AsReader(uint8_t *cmd, int n)
function CodeIso15693AsReader256 (line 177) | static void CodeIso15693AsReader256(uint8_t *cmd, int n)
function TransmitTo15693Tag (line 223) | static void TransmitTo15693Tag(const uint8_t *cmd, int len, int *samples...
function TransmitTo15693Reader (line 264) | static void TransmitTo15693Reader(const uint8_t *cmd, int len, int *samp...
function GetIso15693AnswerFromTag (line 299) | static int GetIso15693AnswerFromTag(uint8_t *receivedResponse, int maxLe...
function GetIso15693AnswerFromSniff (line 449) | static int GetIso15693AnswerFromSniff(uint8_t *receivedResponse, int max...
function AcquireRawAdcSamplesIso15693 (line 601) | void AcquireRawAdcSamplesIso15693(void)
function RecordRawAdcSamplesIso15693 (line 682) | void RecordRawAdcSamplesIso15693(void)
function Iso15693InitReader (line 750) | void Iso15693InitReader() {
function BuildIdentifyRequest (line 783) | static void BuildIdentifyRequest(void)
function BuildReadBlockRequest (line 804) | static void BuildReadBlockRequest(uint8_t *uid, uint8_t blockNumber )
function BuildInventoryResponse (line 836) | static void BuildInventoryResponse(void)
function SendDataTag (line 868) | int SendDataTag(uint8_t *send, int sendlen, int init, int speed, uint8_t...
function DbdecodeIso15693Answer (line 921) | void DbdecodeIso15693Answer(int len, uint8_t *d) {
function SetDebugIso15693 (line 983) | void SetDebugIso15693(uint32_t debug) {
function ReaderIso15693 (line 995) | void ReaderIso15693(uint32_t parameter)
function SimTagIso15693 (line 1155) | void SimTagIso15693(uint32_t parameter)
function BruteforceIso15693Afi (line 1215) | void BruteforceIso15693Afi(uint32_t speed)
function DirectTag15693Command (line 1259) | void DirectTag15693Command(uint32_t datalen,uint32_t speed, uint32_t rec...
FILE: TamagotchiFriends/proxmark/armsrc/legicrf.c
type legic_frame (line 20) | struct legic_frame {
function setup_timer (line 43) | static void setup_timer(void)
function get_key_stream (line 82) | static uint32_t get_key_stream(int skip, int count)
function frame_send_tag (line 120) | static void frame_send_tag(uint16_t response, int bits, int crypt)
function frame_send_rwd (line 160) | static void frame_send_rwd(uint32_t data, int bits)
function frame_receive_rwd (line 223) | static void frame_receive_rwd(struct legic_frame * const f, int bits, in...
function frame_append_bit (line 277) | static void frame_append_bit(struct legic_frame * const f, int bit)
function frame_clean (line 286) | static void frame_clean(struct legic_frame * const f)
function perform_setup_phase_rwd (line 292) | static uint32_t perform_setup_phase_rwd(int iv)
function LegicCommonInit (line 312) | static void LegicCommonInit(void) {
function switch_off_tag_rwd (line 327) | static void switch_off_tag_rwd(void)
function LegicCRC (line 336) | static int LegicCRC(int byte_index, int value, int cmd_sz) {
function legic_read_byte (line 344) | int legic_read_byte(int byte_index, int cmd_sz) {
function legic_write_byte (line 372) | int legic_write_byte(int byte, int addr, int addr_sz) {
function LegicRfReader (line 423) | int LegicRfReader(int offset, int bytes) {
function LegicRfWriter (line 480) | void LegicRfWriter(int bytes, int offset) {
function frame_handle_tag (line 534) | static void frame_handle_tag(struct legic_frame const * const f)
function emit (line 647) | static void emit(int bit)
function LegicRfSimulate (line 664) | void LegicRfSimulate(int phase, int frame, int reqresp)
FILE: TamagotchiFriends/proxmark/armsrc/lfops.c
function AcquireRawAdcSamples125k (line 19) | void AcquireRawAdcSamples125k(int at134khz)
function DoAcquisition125k (line 36) | void DoAcquisition125k(void)
function ModThenAcquireRawAdcSamples125k (line 60) | void ModThenAcquireRawAdcSamples125k(int delay_off, int period_0, int pe...
function ReadTItag (line 129) | void ReadTItag(void)
function WriteTIbyte (line 261) | void WriteTIbyte(uint8_t b)
function AcquireTiType (line 295) | void AcquireTiType(void)
function WriteTItag (line 369) | void WriteTItag(uint32_t idhi, uint32_t idlo, uint16_t crc)
function SimulateTagLowFrequency (line 467) | void SimulateTagLowFrequency(int period, int gap, int ledcontrol)
function SimulateTagLowFrequencyBidir (line 523) | void SimulateTagLowFrequencyBidir(int divisor, int t0)
function fc (line 528) | static void fc(int c, int *n) {
function CmdHIDsimTAG (line 576) | void CmdHIDsimTAG(int hi, int lo, int ledcontrol)
function CmdHIDdemodFSK (line 632) | void CmdHIDdemodFSK(int findone, int *high, int *low, int ledcontrol)
function T55xxWriteBit (line 908) | void T55xxWriteBit(int bit)
function T55xxWriteBlock (line 921) | void T55xxWriteBlock(uint32_t Data, uint32_t Block, uint32_t Pwd, uint8_...
function T55xxReadBlock (line 964) | void T55xxReadBlock(uint32_t Block, uint32_t Pwd, uint8_t PwdMode)
function T55xxReadTrace (line 1029) | void T55xxReadTrace(void){
function CopyHIDtoT55x7 (line 1081) | void CopyHIDtoT55x7(uint32_t hi2, uint32_t hi, uint32_t lo, uint8_t long...
function WriteEM410x (line 1206) | void WriteEM410x(uint32_t card, uint32_t id_hi, uint32_t id_lo)
function CopyIndala64toT55x7 (line 1313) | void CopyIndala64toT55x7(int hi, int lo)
function CopyIndala224toT55x7 (line 1332) | void CopyIndala224toT55x7(int uid1, int uid2, int uid3, int uid4, int ui...
function DemodPCF7931 (line 1360) | int DemodPCF7931(uint8_t **outBlocks) {
function IsBlock0PCF7931 (line 1483) | int IsBlock0PCF7931(uint8_t *Block) {
function IsBlock1PCF7931 (line 1492) | int IsBlock1PCF7931(uint8_t *Block) {
function ReadPCF7931 (line 1503) | void ReadPCF7931() {
function Prepare_Cmd (line 1635) | uint8_t Prepare_Cmd( uint8_t cmd ) {
function Prepare_Addr (line 1658) | uint8_t Prepare_Addr( uint8_t addr ) {
function Prepare_Data (line 1682) | uint8_t Prepare_Data( uint16_t data_low, uint16_t data_hi) {
function SendForward (line 1720) | void SendForward(uint8_t fwd_bit_count) {
function EM4xLogin (line 1759) | void EM4xLogin(uint32_t Password) {
function EM4xReadWord (line 1774) | void EM4xReadWord(uint8_t Address, uint32_t Pwd, uint8_t PwdMode) {
function EM4xWriteWord (line 1813) | void EM4xWriteWord(uint32_t Data, uint8_t Address, uint32_t Pwd, uint8_t...
FILE: TamagotchiFriends/proxmark/armsrc/mifarecmd.c
function MifareReadBlock (line 20) | void MifareReadBlock(uint8_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *...
function MifareReadSector (line 101) | void MifareReadSector(uint8_t arg0, uint8_t arg1, uint8_t arg2, uint8_t ...
function MifareWriteBlock (line 198) | void MifareWriteBlock(uint8_t arg0, uint8_t arg1, uint8_t arg2, uint8_t ...
function valid_nonce (line 277) | int valid_nonce(uint32_t Nt, uint32_t NtEnc, uint32_t Ks1, byte_t * pari...
function MifareNested (line 287) | void MifareNested(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *...
function MifareChkKeys (line 526) | void MifareChkKeys(uint8_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *da...
function MifareSetDbgLvl (line 604) | void MifareSetDbgLvl(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_...
function MifareEMemClr (line 613) | void MifareEMemClr(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t ...
function MifareEMemSet (line 617) | void MifareEMemSet(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t ...
function MifareEMemGet (line 621) | void MifareEMemGet(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t ...
function MifareECardLoad (line 637) | void MifareECardLoad(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_...
function MifareCSetBlock (line 743) | void MifareCSetBlock(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_...
function MifareCGetBlock (line 885) | void MifareCGetBlock(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_...
FILE: TamagotchiFriends/proxmark/armsrc/mifaresniff.c
function MfSniffInit (line 23) | int MfSniffInit(void){
function MfSniffEnd (line 33) | int MfSniffEnd(void){
function MfSniffLogic (line 44) | int RAMFUNC MfSniffLogic(const uint8_t * data, int len, uint32_t parity,...
function MfSniffSend (line 151) | int RAMFUNC MfSniffSend(int maxTimeoutMs) {
function intMfSniffSend (line 159) | int intMfSniffSend() {
FILE: TamagotchiFriends/proxmark/armsrc/mifareutil.c
function mf_crypto1_decrypt (line 39) | void mf_crypto1_decrypt(struct Crypto1State *pcs, uint8_t *data, int len){
function mf_crypto1_encrypt (line 56) | void mf_crypto1_encrypt(struct Crypto1State *pcs, uint8_t *data, int len...
function mf_crypto1_encrypt4bit (line 69) | uint8_t mf_crypto1_encrypt4bit(struct Crypto1State *pcs, uint8_t data) {
function mifare_sendcmd_short (line 80) | int mifare_sendcmd_short(struct Crypto1State *pcs, uint8_t crypted, uint...
function mifare_sendcmd_shortex (line 85) | int mifare_sendcmd_shortex(struct Crypto1State *pcs, uint8_t crypted, ui...
function mifare_classic_auth (line 134) | int mifare_classic_auth(struct Crypto1State *pcs, uint32_t uid, uint8_t ...
function mifare_classic_authex (line 139) | int mifare_classic_authex(struct Crypto1State *pcs, uint32_t uid, uint8_...
function mifare_classic_readblock (line 229) | int mifare_classic_readblock(struct Crypto1State *pcs, uint32_t uid, uin...
function mifare_classic_writeblock (line 259) | int mifare_classic_writeblock(struct Crypto1State *pcs, uint32_t uid, ui...
function mifare_classic_halt (line 306) | int mifare_classic_halt(struct Crypto1State *pcs, uint32_t uid)
function emlSetMem (line 324) | void emlSetMem(uint8_t *data, int blockNum, int blocksCount) {
function emlGetMem (line 330) | void emlGetMem(uint8_t *data, int blockNum, int blocksCount) {
function emlGetMemBt (line 336) | void emlGetMemBt(uint8_t *data, int bytePtr, int byteCount) {
function emlCheckValBl (line 342) | int emlCheckValBl(int blockNum) {
function emlGetValBl (line 357) | int emlGetValBl(uint32_t *blReg, uint8_t *blBlock, int blockNum) {
function emlSetValBl (line 371) | int emlSetValBl(uint32_t blReg, uint8_t blBlock, int blockNum) {
function emlGetKey (line 388) | uint64_t emlGetKey(int sectorNum, int keyType) {
function emlClearMem (line 396) | void emlClearMem(void) {
FILE: TamagotchiFriends/proxmark/armsrc/mifareutil.h
type Crypto1State (line 64) | struct Crypto1State
type Crypto1State (line 65) | struct Crypto1State
type Crypto1State (line 67) | struct Crypto1State
type Crypto1State (line 69) | struct Crypto1State
type Crypto1State (line 71) | struct Crypto1State
type Crypto1State (line 72) | struct Crypto1State
type Crypto1State (line 73) | struct Crypto1State
type Crypto1State (line 76) | struct Crypto1State
type Crypto1State (line 77) | struct Crypto1State
type Crypto1State (line 78) | struct Crypto1State
FILE: TamagotchiFriends/proxmark/armsrc/printf.c
type uintmax_t (line 43) | typedef uint32_t uintmax_t;
type intmax_t (line 44) | typedef int32_t intmax_t;
type u_char (line 46) | typedef unsigned char u_char;
type u_int (line 47) | typedef unsigned int u_int;
type u_long (line 48) | typedef unsigned long u_long;
type u_short (line 49) | typedef unsigned short u_short;
type u_quad_t (line 50) | typedef unsigned long long u_quad_t;
type quad_t (line 51) | typedef long long quad_t;
function kvsprintf (line 112) | int
function vsprintf (line 423) | int vsprintf(char *dest, const char *fmt, va_list ap)
function sprintf (line 428) | int
FILE: TamagotchiFriends/proxmark/armsrc/start.c
function Vector (line 16) | void __attribute__((section(".startos"))) Vector(void)
FILE: TamagotchiFriends/proxmark/armsrc/string.c
function memcmp (line 36) | int memcmp(const void *av, const void *bv, int len)
function strlen (line 51) | int strlen(const char *str)
function strreverse (line 87) | void strreverse(char s[])
function itoa (line 99) | void itoa(int n, char s[])
FILE: TamagotchiFriends/proxmark/armsrc/util.c
function nbytes (line 15) | size_t nbytes(size_t nbits) {
function SwapBits (line 19) | uint32_t SwapBits(uint32_t value, int nrbits) {
function num_to_bytes (line 28) | void num_to_bytes(uint64_t n, size_t len, uint8_t* dest)
function bytes_to_num (line 36) | uint64_t bytes_to_num(uint8_t* src, size_t len)
function LEDsoff (line 47) | void LEDsoff()
function LED (line 56) | void LED(int led, int ms)
function BUTTON_CLICKED (line 87) | int BUTTON_CLICKED(int ms)
function BUTTON_HELD (line 150) | int BUTTON_HELD(int ms)
function SpinDelayUs (line 190) | void SpinDelayUs(int us)
function SpinDelay (line 212) | void SpinDelay(int ms)
function FormatVersionInformation (line 223) | void FormatVersionInformation(char *dst, int len, const char *prefix, vo...
function StartTickCount (line 262) | void StartTickCount()
function GetTickCount (line 274) | uint32_t RAMFUNC GetTickCount(){
function StartCountUS (line 281) | void StartCountUS()
function GetCountUS (line 303) | uint32_t RAMFUNC GetCountUS(){
function GetDeltaCountUS (line 309) | uint32_t RAMFUNC GetDeltaCountUS(){
function StartCountMifare (line 320) | void StartCountMifare()
function GetCountMifare (line 364) | uint32_t RAMFUNC GetCountMifare(){
FILE: TamagotchiFriends/proxmark/armsrc/version.c
type version_information (line 3) | struct version_information __attribute__((section(".version_information")))
FILE: TamagotchiOn/tasmgotchi/makegame.py
function addimage (line 24) | def addimage(path):
FILE: demos/facemain.c
function EXTILine0_Config (line 54) | void EXTILine0_Config(void)
function EXTI0_IRQHandler (line 192) | void EXTI0_IRQHandler() {
function EXTI1_IRQHandler (line 217) | void EXTI1_IRQHandler() {
function main (line 313) | int main(void)
function getAddress (line 466) | uint32_t getAddress(){
FILE: demos/nataliemain.c
function EXTILine0_Config (line 54) | void EXTILine0_Config(void)
function EXTI0_IRQHandler (line 190) | void EXTI0_IRQHandler() {
function EXTI1_IRQHandler (line 215) | void EXTI1_IRQHandler() {
function main (line 311) | int main(void)
function getAddress (line 464) | uint32_t getAddress(){
FILE: demos/nsdemomain.c
function EXTILine0_Config (line 53) | void EXTILine0_Config(void)
function EXTI0_IRQHandler (line 178) | void EXTI0_IRQHandler() {
function EXTI1_IRQHandler (line 203) | void EXTI1_IRQHandler() {
function main (line 286) | int main(void)
function getAddress (line 431) | uint32_t getAddress(){
FILE: devtools/itemmake/itemmake.py
function tofourbit (line 4) | def tofourbit(a):
function conv (line 14) | def conv(a):
function getnote (line 21) | def getnote(n):
function imconv (line 27) | def imconv(path):
FILE: figure-simulator-discovery/Libraries/CMSIS/Include/arm_math.h
type arm_status (line 305) | typedef enum
type q7_t (line 319) | typedef int8_t q7_t;
type q15_t (line 324) | typedef int16_t q15_t;
type q31_t (line 329) | typedef int32_t q31_t;
type q63_t (line 334) | typedef int64_t q63_t;
type float32_t (line 339) | typedef float float32_t;
type float64_t (line 344) | typedef double float64_t;
function __INLINE (line 383) | static __INLINE q31_t clip_q63_to_q31(
function __INLINE (line 393) | static __INLINE q15_t clip_q63_to_q15(
function __INLINE (line 403) | static __INLINE q7_t clip_q31_to_q7(
function __INLINE (line 413) | static __INLINE q15_t clip_q31_to_q15(
function __INLINE (line 424) | static __INLINE q63_t mult32x64(
function __INLINE (line 442) | static __INLINE uint32_t __CLZ(q31_t data)
function __INLINE (line 463) | static __INLINE uint32_t arm_recip_q31(
function __INLINE (line 514) | static __INLINE uint32_t arm_recip_q15(
function __INLINE (line 567) | static __INLINE q31_t __SSAT(
function __INLINE (line 615) | static __INLINE q31_t __QADD8(
function __INLINE (line 641) | static __INLINE q31_t __QSUB8(
function __INLINE (line 670) | static __INLINE q31_t __QADD16(
function __INLINE (line 693) | static __INLINE q31_t __SHADD16(
function __INLINE (line 716) | static __INLINE q31_t __QSUB16(
function __INLINE (line 738) | static __INLINE q31_t __SHSUB16(
function __INLINE (line 760) | static __INLINE q31_t __QASX(
function __INLINE (line 776) | static __INLINE q31_t __SHASX(
function __INLINE (line 799) | static __INLINE q31_t __QSAX(
function __INLINE (line 815) | static __INLINE q31_t __SHSAX(
function __INLINE (line 837) | static __INLINE q31_t __SMUSDX(
function __INLINE (line 849) | static __INLINE q31_t __SMUADX(
function __INLINE (line 861) | static __INLINE q31_t __QADD(
function __INLINE (line 871) | static __INLINE q31_t __QSUB(
function __INLINE (line 881) | static __INLINE q31_t __SMLAD(
function __INLINE (line 894) | static __INLINE q31_t __SMLADX(
function __INLINE (line 907) | static __INLINE q31_t __SMLSDX(
function __INLINE (line 920) | static __INLINE q63_t __SMLALD(
function __INLINE (line 933) | static __INLINE q63_t __SMLALDX(
function __INLINE (line 946) | static __INLINE q31_t __SMUAD(
function __INLINE (line 958) | static __INLINE q31_t __SMUSD(
type arm_fir_instance_q7 (line 976) | typedef struct
type arm_fir_instance_q15 (line 986) | typedef struct
type arm_fir_instance_q31 (line 996) | typedef struct
type arm_fir_instance_f32 (line 1006) | typedef struct
type arm_biquad_casd_df1_inst_q15 (line 1170) | typedef struct
type arm_biquad_casd_df1_inst_q31 (line 1183) | typedef struct
type arm_biquad_casd_df1_inst_f32 (line 1195) | typedef struct
type arm_matrix_instance_f32 (line 1337) | typedef struct
type arm_matrix_instance_q15 (line 1348) | typedef struct
type arm_matrix_instance_q31 (line 1360) | typedef struct
type arm_pid_instance_q15 (line 1664) | typedef struct
type arm_pid_instance_q31 (line 1682) | typedef struct
type arm_pid_instance_f32 (line 1697) | typedef struct
type arm_linear_interp_instance_f32 (line 1771) | typedef struct
type arm_bilinear_interp_instance_f32 (line 1783) | typedef struct
type arm_bilinear_interp_instance_q31 (line 1794) | typedef struct
type arm_bilinear_interp_instance_q15 (line 1805) | typedef struct
type arm_bilinear_interp_instance_q7 (line 1816) | typedef struct
type arm_cfft_radix4_instance_q15 (line 1889) | typedef struct
type arm_cfft_radix4_instance_q31 (line 1904) | typedef struct
type arm_cfft_radix4_instance_f32 (line 1919) | typedef struct
type arm_rfft_instance_q15 (line 2156) | typedef struct
type arm_rfft_instance_q31 (line 2172) | typedef struct
type arm_rfft_instance_f32 (line 2188) | typedef struct
type arm_dct4_instance_f32 (line 2294) | typedef struct
type arm_dct4_instance_q31 (line 2341) | typedef struct
type arm_dct4_instance_q15 (line 2388) | typedef struct
type arm_fir_decimate_instance_q15 (line 3214) | typedef struct
type arm_fir_decimate_instance_q31 (line 3226) | typedef struct
type arm_fir_decimate_instance_f32 (line 3239) | typedef struct
type arm_fir_interpolate_instance_q15 (line 3395) | typedef struct
type arm_fir_interpolate_instance_q31 (line 3407) | typedef struct
type arm_fir_interpolate_instance_f32 (line 3419) | typedef struct
type arm_biquad_cas_df1_32x64_ins_q31 (line 3539) | typedef struct
type arm_biquad_cascade_df2T_instance_f32 (line 3586) | typedef struct
type arm_fir_lattice_instance_q15 (line 3631) | typedef struct
type arm_fir_lattice_instance_q31 (line 3642) | typedef struct
type arm_fir_lattice_instance_f32 (line 3653) | typedef struct
type arm_iir_lattice_instance_q15 (line 3754) | typedef struct
type arm_iir_lattice_instance_q31 (line 3765) | typedef struct
type arm_iir_lattice_instance_f32 (line 3776) | typedef struct
type arm_lms_instance_f32 (line 3894) | typedef struct
type arm_lms_instance_q15 (line 3944) | typedef struct
type arm_lms_instance_q31 (line 3999) | typedef struct
type arm_lms_norm_instance_f32 (line 4053) | typedef struct
type arm_lms_norm_instance_q31 (line 4105) | typedef struct
type arm_lms_norm_instance_q15 (line 4161) | typedef struct
type arm_fir_sparse_instance_f32 (line 4319) | typedef struct
type arm_fir_sparse_instance_q31 (line 4333) | typedef struct
type arm_fir_sparse_instance_q15 (line 4347) | typedef struct
type arm_fir_sparse_instance_q7 (line 4361) | typedef struct
function __INLINE (line 4711) | static __INLINE float32_t arm_pid_f32(
function __INLINE (line 4746) | static __INLINE q31_t arm_pid_q31(
function __INLINE (line 4794) | static __INLINE q15_t arm_pid_q15(
function __INLINE (line 4905) | static __INLINE void arm_clarke_f32(
function __INLINE (line 4934) | static __INLINE void arm_clarke_q31(
function __INLINE (line 5009) | static __INLINE void arm_inv_clarke_f32(
function __INLINE (line 5038) | static __INLINE void arm_inv_clarke_q31(
function __INLINE (line 5125) | static __INLINE void arm_park_f32(
function __INLINE (line 5159) | static __INLINE void arm_park_q31(
function __INLINE (line 5244) | static __INLINE void arm_inv_park_f32(
function __INLINE (line 5279) | static __INLINE void arm_inv_park_q31(
function __INLINE (line 5377) | static __INLINE float32_t arm_linear_interp_f32(
function __INLINE (line 5436) | static __INLINE q31_t arm_linear_interp_q31(q31_t *pYData,
function __INLINE (line 5496) | static __INLINE q15_t arm_linear_interp_q15(q15_t *pYData, q31_t x, uint...
function __INLINE (line 5553) | static __INLINE q7_t arm_linear_interp_q7(q7_t *pYData, q31_t x, uint32...
function __INLINE (line 5695) | static __INLINE arm_status arm_sqrt_f32(
function __INLINE (line 5752) | static __INLINE void arm_circularWrite_f32(
function __INLINE (line 5797) | static __INLINE void arm_circularRead_f32(
function __INLINE (line 5852) | static __INLINE void arm_circularWrite_q15(
function __INLINE (line 5897) | static __INLINE void arm_circularRead_q15(
function __INLINE (line 5954) | static __INLINE void arm_circularWrite_q7(
function __INLINE (line 5999) | static __INLINE void arm_circularRead_q7(
function __INLINE (line 6740) | static __INLINE float32_t arm_bilinear_interp_f32(
function __INLINE (line 6807) | static __INLINE q31_t arm_bilinear_interp_q31(
function __INLINE (line 6883) | static __INLINE q15_t arm_bilinear_interp_q15(
function __INLINE (line 6963) | static __INLINE q7_t arm_bilinear_interp_q7(
FILE: figure-simulator-discovery/Libraries/CMSIS/Include/core_cm4.h
type APSR_Type (line 218) | typedef union
type IPSR_Type (line 241) | typedef union
type xPSR_Type (line 254) | typedef union
type CONTROL_Type (line 280) | typedef union
type NVIC_Type (line 303) | typedef struct
type SCB_Type (line 335) | typedef struct
type SCnSCB_Type (line 552) | typedef struct
type SysTick_Type (line 590) | typedef struct
type MPU_Type (line 700) | typedef struct
type FPU_Type (line 775) | typedef struct
type CoreDebug_Type (line 880) | typedef struct
function __INLINE (line 1037) | static __INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
function __INLINE (line 1058) | static __INLINE uint32_t NVIC_GetPriorityGrouping(void)
function __INLINE (line 1071) | static __INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
function __INLINE (line 1085) | static __INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)
function __INLINE (line 1100) | static __INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn)
function __INLINE (line 1113) | static __INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn)
function __INLINE (line 1126) | static __INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn)
function __INLINE (line 1139) | static __INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn)
function __INLINE (line 1156) | static __INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
function __INLINE (line 1177) | static __INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn)
function __INLINE (line 1201) | static __INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, ui...
function __INLINE (line 1231) | static __INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t Pr...
function __INLINE (line 1249) | static __INLINE void NVIC_SystemReset(void)
function __INLINE (line 1281) | static __INLINE uint32_t SysTick_Config(uint32_t ticks)
function __INLINE (line 1319) | static __INLINE uint32_t ITM_SendChar (uint32_t ch)
function __INLINE (line 1341) | static __INLINE int32_t ITM_ReceiveChar (void) {
function __INLINE (line 1361) | static __INLINE int32_t ITM_CheckChar (void) {
FILE: figure-simulator-discovery/Libraries/CMSIS/Include/core_cm4_simd.h
function __INLINE (line 194) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __SADD8(uint...
function __INLINE (line 202) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __QADD8(uint...
function __INLINE (line 210) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __SHADD8(uin...
function __INLINE (line 218) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __UADD8(uint...
function __INLINE (line 226) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __UQADD8(uin...
function __INLINE (line 234) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __UHADD8(uin...
function __INLINE (line 243) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __SSUB8(uint...
function __INLINE (line 251) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __QSUB8(uint...
function __INLINE (line 259) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __SHSUB8(uin...
function __INLINE (line 267) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __USUB8(uint...
function __INLINE (line 275) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __UQSUB8(uin...
function __INLINE (line 283) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __UHSUB8(uin...
function __INLINE (line 292) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __SADD16(uin...
function __INLINE (line 300) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __QADD16(uin...
function __INLINE (line 308) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __SHADD16(ui...
function __INLINE (line 316) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __UADD16(uin...
function __INLINE (line 324) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __UQADD16(ui...
function __INLINE (line 332) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __UHADD16(ui...
function __INLINE (line 340) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __SSUB16(uin...
function __INLINE (line 348) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __QSUB16(uin...
function __INLINE (line 356) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __SHSUB16(ui...
function __INLINE (line 364) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __USUB16(uin...
function __INLINE (line 372) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __UQSUB16(ui...
function __INLINE (line 380) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __UHSUB16(ui...
function __INLINE (line 388) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __SASX(uint3...
function __INLINE (line 396) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __QASX(uint3...
function __INLINE (line 404) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __SHASX(uint...
function __INLINE (line 412) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __UASX(uint3...
function __INLINE (line 420) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __UQASX(uint...
function __INLINE (line 428) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __UHASX(uint...
function __INLINE (line 436) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __SSAX(uint3...
function __INLINE (line 444) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __QSAX(uint3...
function __INLINE (line 452) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __SHSAX(uint...
function __INLINE (line 460) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __USAX(uint3...
function __INLINE (line 468) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __UQSAX(uint...
function __INLINE (line 476) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __UHSAX(uint...
function __INLINE (line 484) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __USAD8(uint...
function __INLINE (line 492) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __USADA8(uin...
function __INLINE (line 514) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __UXTB16(uin...
function __INLINE (line 522) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __UXTAB16(ui...
function __INLINE (line 530) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __SXTB16(uin...
function __INLINE (line 538) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __SXTAB16(ui...
function __INLINE (line 546) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __SMUAD (ui...
function __INLINE (line 554) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __SMUADX (ui...
function __INLINE (line 562) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __SMLAD (uin...
function __INLINE (line 570) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __SMLADX (ui...
function __INLINE (line 592) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __SMUSD (ui...
function __INLINE (line 600) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __SMUSDX (ui...
function __INLINE (line 608) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __SMLSD (uin...
function __INLINE (line 616) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __SMLSDX (ui...
function __INLINE (line 638) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __SEL (uint...
function __INLINE (line 646) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __QADD(uint3...
function __INLINE (line 654) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __QSUB(uint3...
FILE: figure-simulator-discovery/Libraries/CMSIS/Include/core_cmFunc.h
function __INLINE (line 50) | static __INLINE uint32_t __get_CONTROL(void)
function __INLINE (line 63) | static __INLINE void __set_CONTROL(uint32_t control)
function __INLINE (line 76) | static __INLINE uint32_t __get_IPSR(void)
function __INLINE (line 89) | static __INLINE uint32_t __get_APSR(void)
function __INLINE (line 102) | static __INLINE uint32_t __get_xPSR(void)
function __INLINE (line 115) | static __INLINE uint32_t __get_PSP(void)
function __INLINE (line 128) | static __INLINE void __set_PSP(uint32_t topOfProcStack)
function __INLINE (line 141) | static __INLINE uint32_t __get_MSP(void)
function __INLINE (line 154) | static __INLINE void __set_MSP(uint32_t topOfMainStack)
function __INLINE (line 167) | static __INLINE uint32_t __get_PRIMASK(void)
function __INLINE (line 180) | static __INLINE void __set_PRIMASK(uint32_t priMask)
function __INLINE (line 211) | static __INLINE uint32_t __get_BASEPRI(void)
function __INLINE (line 224) | static __INLINE void __set_BASEPRI(uint32_t basePri)
function __INLINE (line 237) | static __INLINE uint32_t __get_FAULTMASK(void)
function __INLINE (line 250) | static __INLINE void __set_FAULTMASK(uint32_t faultMask)
function __INLINE (line 267) | static __INLINE uint32_t __get_FPSCR(void)
function __INLINE (line 284) | static __INLINE void __set_FPSCR(uint32_t fpscr)
function __INLINE (line 308) | __attribute__( ( always_inline ) ) static __INLINE void __enable_irq(void)
function __INLINE (line 319) | __attribute__( ( always_inline ) ) static __INLINE void __disable_irq(void)
function __INLINE (line 331) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __get_CONTRO...
function __INLINE (line 346) | __attribute__( ( always_inline ) ) static __INLINE void __set_CONTROL(ui...
function __INLINE (line 358) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __get_IPSR(v...
function __INLINE (line 373) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __get_APSR(v...
function __INLINE (line 388) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __get_xPSR(v...
function __INLINE (line 403) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __get_PSP(void)
function __INLINE (line 418) | __attribute__( ( always_inline ) ) static __INLINE void __set_PSP(uint32...
function __INLINE (line 430) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __get_MSP(void)
function __INLINE (line 445) | __attribute__( ( always_inline ) ) static __INLINE void __set_MSP(uint32...
function __INLINE (line 457) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __get_PRIMAS...
function __INLINE (line 472) | __attribute__( ( always_inline ) ) static __INLINE void __set_PRIMASK(ui...
function __INLINE (line 485) | __attribute__( ( always_inline ) ) static __INLINE void __enable_fault_i...
function __INLINE (line 496) | __attribute__( ( always_inline ) ) static __INLINE void __disable_fault_...
function __INLINE (line 508) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __get_BASEPR...
function __INLINE (line 523) | __attribute__( ( always_inline ) ) static __INLINE void __set_BASEPRI(ui...
function __INLINE (line 535) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __get_FAULTM...
function __INLINE (line 550) | __attribute__( ( always_inline ) ) static __INLINE void __set_FAULTMASK(...
function __INLINE (line 566) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __get_FPSCR(...
function __INLINE (line 585) | __attribute__( ( always_inline ) ) static __INLINE void __set_FPSCR(uint...
FILE: figure-simulator-discovery/Libraries/CMSIS/Include/core_cmInstr.h
function __REV16 (line 114) | uint32_t __REV16(uint32_t value)
function __REVSH (line 128) | int32_t __REVSH(int32_t value)
function __INLINE (line 269) | __attribute__( ( always_inline ) ) static __INLINE void __NOP(void)
function __INLINE (line 280) | __attribute__( ( always_inline ) ) static __INLINE void __WFI(void)
function __INLINE (line 291) | __attribute__( ( always_inline ) ) static __INLINE void __WFE(void)
function __INLINE (line 301) | __attribute__( ( always_inline ) ) static __INLINE void __SEV(void)
function __INLINE (line 313) | __attribute__( ( always_inline ) ) static __INLINE void __ISB(void)
function __INLINE (line 324) | __attribute__( ( always_inline ) ) static __INLINE void __DSB(void)
function __INLINE (line 335) | __attribute__( ( always_inline ) ) static __INLINE void __DMB(void)
function __INLINE (line 348) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __REV(uint32...
function __INLINE (line 364) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __REV16(uint...
function __INLINE (line 380) | __attribute__( ( always_inline ) ) static __INLINE int32_t __REVSH(int32...
function __INLINE (line 398) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __RBIT(uint3...
function __INLINE (line 414) | __attribute__( ( always_inline ) ) static __INLINE uint8_t __LDREXB(vola...
function __INLINE (line 430) | __attribute__( ( always_inline ) ) static __INLINE uint16_t __LDREXH(vol...
function __INLINE (line 446) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __LDREXW(vol...
function __INLINE (line 464) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __STREXB(uin...
function __INLINE (line 482) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __STREXH(uin...
function __INLINE (line 500) | __attribute__( ( always_inline ) ) static __INLINE uint32_t __STREXW(uin...
function __INLINE (line 514) | __attribute__( ( always_inline ) ) static __INLINE void __CLREX(void)
function __INLINE (line 559) | __attribute__( ( always_inline ) ) static __INLINE uint8_t __CLZ(uint32_...
FILE: figure-simulator-discovery/Libraries/Device/STM32F4xx/Include/stm32f4xx.h
type IRQn_Type (line 146) | typedef enum IRQn
type s32 (line 254) | typedef int32_t s32;
type s16 (line 255) | typedef int16_t s16;
type s8 (line 256) | typedef int8_t s8;
type sc32 (line 258) | typedef const int32_t sc32;
type sc16 (line 259) | typedef const int16_t sc16;
type sc8 (line 260) | typedef const int8_t sc8;
type __IO (line 262) | typedef __IO int32_t vs32;
type __IO (line 263) | typedef __IO int16_t vs16;
type __IO (line 264) | typedef __IO int8_t vs8;
type __I (line 266) | typedef __I int32_t vsc32;
type __I (line 267) | typedef __I int16_t vsc16;
type __I (line 268) | typedef __I int8_t vsc8;
type u32 (line 270) | typedef uint32_t u32;
type u16 (line 271) | typedef uint16_t u16;
type u8 (line 272) | typedef uint8_t u8;
type uc32 (line 274) | typedef const uint32_t uc32;
type uc16 (line 275) | typedef const uint16_t uc16;
type uc8 (line 276) | typedef const uint8_t uc8;
type __IO (line 278) | typedef __IO uint32_t vu32;
type __IO (line 279) | typedef __IO uint16_t vu16;
type __IO (line 280) | typedef __IO uint8_t vu8;
type __I (line 282) | typedef __I uint32_t vuc32;
type __I (line 283) | typedef __I uint16_t vuc16;
type __I (line 284) | typedef __I uint8_t vuc8;
type FlagStatus (line 286) | typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
type FunctionalState (line 288) | typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
type ErrorStatus (line 291) | typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus;
type ADC_TypeDef (line 305) | typedef struct
type ADC_Common_TypeDef (line 329) | typedef struct
type CAN_TxMailBox_TypeDef (line 342) | typedef struct
type CAN_FIFOMailBox_TypeDef (line 354) | typedef struct
type CAN_FilterRegister_TypeDef (line 366) | typedef struct
type CAN_TypeDef (line 376) | typedef struct
type CRC_TypeDef (line 406) | typedef struct
type DAC_TypeDef (line 419) | typedef struct
type DBGMCU_TypeDef (line 441) | typedef struct
type DCMI_TypeDef (line 453) | typedef struct
type DMA_Stream_TypeDef (line 472) | typedef struct
type DMA_TypeDef (line 482) | typedef struct
type ETH_TypeDef (line 494) | typedef struct
type EXTI_TypeDef (line 568) | typedef struct
type FLASH_TypeDef (line 582) | typedef struct
type FSMC_Bank1_TypeDef (line 596) | typedef struct
type FSMC_Bank1E_TypeDef (line 605) | typedef struct
type FSMC_Bank2_TypeDef (line 614) | typedef struct
type FSMC_Bank3_TypeDef (line 628) | typedef struct
type FSMC_Bank4_TypeDef (line 642) | typedef struct
type GPIO_TypeDef (line 655) | typedef struct
type SYSCFG_TypeDef (line 673) | typedef struct
type I2C_TypeDef (line 686) | typedef struct
type IWDG_TypeDef (line 712) | typedef struct
type PWR_TypeDef (line 724) | typedef struct
type RCC_TypeDef (line 734) | typedef struct
type RTC_TypeDef (line 772) | typedef struct
type SDIO_TypeDef (line 820) | typedef struct
type SPI_TypeDef (line 848) | typedef struct
type TIM_TypeDef (line 874) | typedef struct
type USART_TypeDef (line 918) | typedef struct
type WWDG_TypeDef (line 940) | typedef struct
type CRYP_TypeDef (line 951) | typedef struct
type HASH_TypeDef (line 979) | typedef struct
type RNG_TypeDef (line 995) | typedef struct
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/misc.h
type NVIC_InitTypeDef (line 54) | typedef struct
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_adc.h
type ADC_InitTypeDef (line 53) | typedef struct
type ADC_CommonInitTypeDef (line 84) | typedef struct
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_can.h
type CAN_InitTypeDef (line 56) | typedef struct
type CAN_FilterInitTypeDef (line 98) | typedef struct
type CanTxMsg (line 136) | typedef struct
type CanRxMsg (line 163) | typedef struct
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_cryp.h
type CRYP_InitTypeDef (line 53) | typedef struct
type CRYP_KeyInitTypeDef (line 70) | typedef struct
type CRYP_IVInitTypeDef (line 84) | typedef struct
type CRYP_Context (line 95) | typedef struct
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dac.h
type DAC_InitTypeDef (line 54) | typedef struct
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dcmi.h
type DCMI_InitTypeDef (line 51) | typedef struct
type DCMI_CROPInitTypeDef (line 78) | typedef struct
type DCMI_CodesInitTypeDef (line 97) | typedef struct
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dma.h
type DMA_InitTypeDef (line 54) | typedef struct
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_exti.h
type EXTIMode_TypeDef (line 54) | typedef enum
type EXTITrigger_TypeDef (line 66) | typedef enum
type EXTI_InitTypeDef (line 80) | typedef struct
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_flash.h
type FLASH_Status (line 52) | typedef enum
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_fsmc.h
type FSMC_NORSRAMTimingInitTypeDef (line 53) | typedef struct
type FSMC_NORSRAMInitTypeDef (line 94) | typedef struct
type FSMC_NAND_PCCARDTimingInitTypeDef (line 152) | typedef struct
type FSMC_NANDInitTypeDef (line 183) | typedef struct
type FSMC_PCCARDInitTypeDef (line 217) | typedef struct
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_gpio.h
type GPIOMode_TypeDef (line 63) | typedef enum
type GPIOOType_TypeDef (line 76) | typedef enum
type GPIOSpeed_TypeDef (line 87) | typedef enum
type GPIOPuPd_TypeDef (line 100) | typedef enum
type BitAction (line 112) | typedef enum
type GPIO_InitTypeDef (line 123) | typedef struct
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_hash.h
type HASH_InitTypeDef (line 53) | typedef struct
type HASH_MsgDigest (line 69) | typedef struct
type HASH_Context (line 78) | typedef struct
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_i2c.h
type I2C_InitTypeDef (line 54) | typedef struct
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_rcc.h
type RCC_ClocksTypeDef (line 48) | typedef struct
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_rtc.h
type RTC_InitTypeDef (line 53) | typedef struct
type RTC_TimeTypeDef (line 68) | typedef struct
type RTC_DateTypeDef (line 88) | typedef struct
type RTC_AlarmTypeDef (line 106) | typedef struct
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_sdio.h
type SDIO_InitTypeDef (line 50) | typedef struct
type SDIO_CmdInitTypeDef (line 74) | typedef struct
type SDIO_DataInitTypeDef (line 94) | typedef struct
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_spi.h
type SPI_InitTypeDef (line 54) | typedef struct
type I2S_InitTypeDef (line 91) | typedef struct
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_tim.h
type TIM_TimeBaseInitTypeDef (line 55) | typedef struct
type TIM_OCInitTypeDef (line 84) | typedef struct
type TIM_ICInitTypeDef (line 119) | typedef struct
type TIM_BDTRInitTypeDef (line 143) | typedef struct
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_usart.h
type USART_InitTypeDef (line 54) | typedef struct
type USART_ClockInitTypeDef (line 87) | typedef struct
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/misc.c
function NVIC_PriorityGroupConfig (line 118) | void NVIC_PriorityGroupConfig(uint32_t NVIC_PriorityGroup)
function NVIC_Init (line 136) | void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct)
function NVIC_SetVectorTable (line 180) | void NVIC_SetVectorTable(uint32_t NVIC_VectTab, uint32_t Offset)
function NVIC_SystemLPConfig (line 199) | void NVIC_SystemLPConfig(uint8_t LowPowerMode, FunctionalState NewState)
function SysTick_CLKSourceConfig (line 223) | void SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource)
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_adc.c
function ADC_DeInit (line 212) | void ADC_DeInit(void)
function ADC_Init (line 234) | void ADC_Init(ADC_TypeDef* ADCx, ADC_InitTypeDef* ADC_InitStruct)
function ADC_StructInit (line 309) | void ADC_StructInit(ADC_InitTypeDef* ADC_InitStruct)
function ADC_CommonInit (line 340) | void ADC_CommonInit(ADC_CommonInitTypeDef* ADC_CommonInitStruct)
function ADC_CommonStructInit (line 376) | void ADC_CommonStructInit(ADC_CommonInitTypeDef* ADC_CommonInitStruct)
function ADC_Cmd (line 398) | void ADC_Cmd(ADC_TypeDef* ADCx, FunctionalState NewState)
function ADC_AnalogWatchdogCmd (line 456) | void ADC_AnalogWatchdogCmd(ADC_TypeDef* ADCx, uint32_t ADC_AnalogWatchdog)
function ADC_AnalogWatchdogThresholdsConfig (line 485) | void ADC_AnalogWatchdogThresholdsConfig(ADC_TypeDef* ADCx, uint16_t High...
function ADC_AnalogWatchdogSingleChannelConfig (line 526) | void ADC_AnalogWatchdogSingleChannelConfig(ADC_TypeDef* ADCx, uint8_t AD...
function ADC_TempSensorVrefintCmd (line 591) | void ADC_TempSensorVrefintCmd(FunctionalState NewState)
function ADC_VBATCmd (line 613) | void ADC_VBATCmd(FunctionalState NewState)
function ADC_RegularChannelConfig (line 714) | void ADC_RegularChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel, ui...
function ADC_SoftwareStartConv (line 834) | void ADC_SoftwareStartConv(ADC_TypeDef* ADCx)
function FlagStatus (line 848) | FlagStatus ADC_GetSoftwareStartConvStatus(ADC_TypeDef* ADCx)
function ADC_EOCOnEachRegularChannelCmd (line 878) | void ADC_EOCOnEachRegularChannelCmd(ADC_TypeDef* ADCx, FunctionalState N...
function ADC_ContinuousModeCmd (line 903) | void ADC_ContinuousModeCmd(ADC_TypeDef* ADCx, FunctionalState NewState)
function ADC_DiscModeChannelCountConfig (line 929) | void ADC_DiscModeChannelCountConfig(ADC_TypeDef* ADCx, uint8_t Number)
function ADC_DiscModeCmd (line 961) | void ADC_DiscModeCmd(ADC_TypeDef* ADCx, FunctionalState NewState)
function ADC_GetConversionValue (line 984) | uint16_t ADC_GetConversionValue(ADC_TypeDef* ADCx)
function ADC_GetMultiModeConversionValue (line 1005) | uint32_t ADC_GetMultiModeConversionValue(void)
function ADC_DMACmd (line 1054) | void ADC_DMACmd(ADC_TypeDef* ADCx, FunctionalState NewState)
function ADC_DMARequestAfterLastTransferCmd (line 1078) | void ADC_DMARequestAfterLastTransferCmd(ADC_TypeDef* ADCx, FunctionalSta...
function ADC_MultiModeDMARequestAfterLastTransferCmd (line 1105) | void ADC_MultiModeDMARequestAfterLastTransferCmd(FunctionalState NewState)
function ADC_InjectedChannelConfig (line 1192) | void ADC_InjectedChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel, u...
function ADC_InjectedSequencerLengthConfig (line 1255) | void ADC_InjectedSequencerLengthConfig(ADC_TypeDef* ADCx, uint8_t Length)
function ADC_SetInjectedOffset (line 1290) | void ADC_SetInjectedOffset(ADC_TypeDef* ADCx, uint8_t ADC_InjectedChanne...
function ADC_ExternalTrigInjectedConvConfig (line 1328) | void ADC_ExternalTrigInjectedConvConfig(ADC_TypeDef* ADCx, uint32_t ADC_...
function ADC_ExternalTrigInjectedConvEdgeConfig (line 1362) | void ADC_ExternalTrigInjectedConvEdgeConfig(ADC_TypeDef* ADCx, uint32_t ...
function ADC_SoftwareStartInjectedConv (line 1383) | void ADC_SoftwareStartInjectedConv(ADC_TypeDef* ADCx)
function FlagStatus (line 1396) | FlagStatus ADC_GetSoftwareStartInjectedConvCmdStatus(ADC_TypeDef* ADCx)
function ADC_AutoInjectedConvCmd (line 1425) | void ADC_AutoInjectedConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState)
function ADC_InjectedDiscModeCmd (line 1451) | void ADC_InjectedDiscModeCmd(ADC_TypeDef* ADCx, FunctionalState NewState)
function ADC_GetInjectedConversionValue (line 1479) | uint16_t ADC_GetInjectedConversionValue(ADC_TypeDef* ADCx, uint8_t ADC_I...
function ADC_ITConfig (line 1587) | void ADC_ITConfig(ADC_TypeDef* ADCx, uint16_t ADC_IT, FunctionalState Ne...
function FlagStatus (line 1624) | FlagStatus ADC_GetFlagStatus(ADC_TypeDef* ADCx, uint8_t ADC_FLAG)
function ADC_ClearFlag (line 1659) | void ADC_ClearFlag(ADC_TypeDef* ADCx, uint8_t ADC_FLAG)
function ITStatus (line 1680) | ITStatus ADC_GetITStatus(ADC_TypeDef* ADCx, uint16_t ADC_IT)
function ADC_ClearITPendingBit (line 1721) | void ADC_ClearITPendingBit(ADC_TypeDef* ADCx, uint16_t ADC_IT)
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_can.c
function CAN_DeInit (line 168) | void CAN_DeInit(CAN_TypeDef* CANx)
function CAN_Init (line 198) | uint8_t CAN_Init(CAN_TypeDef* CANx, CAN_InitTypeDef* CAN_InitStruct)
function CAN_FilterInit (line 335) | void CAN_FilterInit(CAN_FilterInitTypeDef* CAN_FilterInitStruct)
function CAN_StructInit (line 426) | void CAN_StructInit(CAN_InitTypeDef* CAN_InitStruct)
function CAN_SlaveStartBank (line 469) | void CAN_SlaveStartBank(uint8_t CAN_BankNumber)
function CAN_DBGFreeze (line 494) | void CAN_DBGFreeze(CAN_TypeDef* CANx, FunctionalState NewState)
function CAN_TTComModeCmd (line 524) | void CAN_TTComModeCmd(CAN_TypeDef* CANx, FunctionalState NewState)
function CAN_Transmit (line 578) | uint8_t CAN_Transmit(CAN_TypeDef* CANx, CanTxMsg* TxMessage)
function CAN_TransmitStatus (line 650) | uint8_t CAN_TransmitStatus(CAN_TypeDef* CANx, uint8_t TransmitMailbox)
function CAN_CancelTransmit (line 704) | void CAN_CancelTransmit(CAN_TypeDef* CANx, uint8_t Mailbox)
function CAN_Receive (line 751) | void CAN_Receive(CAN_TypeDef* CANx, uint8_t FIFONumber, CanRxMsg* RxMess...
function CAN_FIFORelease (line 800) | void CAN_FIFORelease(CAN_TypeDef* CANx, uint8_t FIFONumber)
function CAN_MessagePending (line 823) | uint8_t CAN_MessagePending(CAN_TypeDef* CANx, uint8_t FIFONumber)
function CAN_OperatingModeRequest (line 873) | uint8_t CAN_OperatingModeRequest(CAN_TypeDef* CANx, uint8_t CAN_Operatin...
function CAN_Sleep (line 954) | uint8_t CAN_Sleep(CAN_TypeDef* CANx)
function CAN_WakeUp (line 979) | uint8_t CAN_WakeUp(CAN_TypeDef* CANx)
function CAN_GetLastErrorCode (line 1041) | uint8_t CAN_GetLastErrorCode(CAN_TypeDef* CANx)
function CAN_GetReceiveErrorCounter (line 1066) | uint8_t CAN_GetReceiveErrorCounter(CAN_TypeDef* CANx)
function CAN_GetLSBTransmitErrorCounter (line 1086) | uint8_t CAN_GetLSBTransmitErrorCounter(CAN_TypeDef* CANx)
function CAN_ITConfig (line 1293) | void CAN_ITConfig(CAN_TypeDef* CANx, uint32_t CAN_IT, FunctionalState Ne...
function FlagStatus (line 1333) | FlagStatus CAN_GetFlagStatus(CAN_TypeDef* CANx, uint32_t CAN_FLAG)
function CAN_ClearFlag (line 1433) | void CAN_ClearFlag(CAN_TypeDef* CANx, uint32_t CAN_FLAG)
function ITStatus (line 1493) | ITStatus CAN_GetITStatus(CAN_TypeDef* CANx, uint32_t CAN_IT)
function CAN_ClearITPendingBit (line 1597) | void CAN_ClearITPendingBit(CAN_TypeDef* CANx, uint32_t CAN_IT)
function ITStatus (line 1675) | static ITStatus CheckITStatus(uint32_t CAN_Reg, uint32_t It_Bit)
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_crc.c
function CRC_ResetDR (line 56) | void CRC_ResetDR(void)
function CRC_CalcCRC (line 67) | uint32_t CRC_CalcCRC(uint32_t Data)
function CRC_CalcBlockCRC (line 80) | uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength)
function CRC_GetCRC (line 96) | uint32_t CRC_GetCRC(void)
function CRC_SetIDRegister (line 106) | void CRC_SetIDRegister(uint8_t IDValue)
function CRC_GetIDRegister (line 116) | uint8_t CRC_GetIDRegister(void)
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_cryp.c
function CRYP_DeInit (line 221) | void CRYP_DeInit(void)
function CRYP_Init (line 237) | void CRYP_Init(CRYP_InitTypeDef* CRYP_InitStruct)
function CRYP_StructInit (line 276) | void CRYP_StructInit(CRYP_InitTypeDef* CRYP_InitStruct)
function CRYP_KeyInit (line 298) | void CRYP_KeyInit(CRYP_KeyInitTypeDef* CRYP_KeyInitStruct)
function CRYP_KeyStructInit (line 317) | void CRYP_KeyStructInit(CRYP_KeyInitTypeDef* CRYP_KeyInitStruct)
function CRYP_IVInit (line 335) | void CRYP_IVInit(CRYP_IVInitTypeDef* CRYP_IVInitStruct)
function CRYP_IVStructInit (line 349) | void CRYP_IVStructInit(CRYP_IVInitTypeDef* CRYP_IVInitStruct)
function CRYP_FIFOFlush (line 364) | void CRYP_FIFOFlush(void)
function CRYP_Cmd (line 376) | void CRYP_Cmd(FunctionalState NewState)
function CRYP_DataIn (line 419) | void CRYP_DataIn(uint32_t Data)
function CRYP_DataOut (line 429) | uint32_t CRYP_DataOut(void)
function ErrorStatus (line 472) | ErrorStatus CRYP_SaveContext(CRYP_Context* CRYP_ContextSave,
function CRYP_RestoreContext (line 557) | void CRYP_RestoreContext(CRYP_Context* CRYP_ContextRestore)
function CRYP_DMACmd (line 618) | void CRYP_DMACmd(uint8_t CRYP_DMAReq, FunctionalState NewState)
function CRYP_ITConfig (line 743) | void CRYP_ITConfig(uint8_t CRYP_IT, FunctionalState NewState)
function ITStatus (line 771) | ITStatus CRYP_GetITStatus(uint8_t CRYP_IT)
function FlagStatus (line 805) | FlagStatus CRYP_GetFlagStatus(uint8_t CRYP_FLAG)
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_cryp_aes.c
function ErrorStatus (line 104) | ErrorStatus CRYP_AES_ECB(uint8_t Mode, uint8_t* Key, uint16_t Keysize,
function ErrorStatus (line 285) | ErrorStatus CRYP_AES_CBC(uint8_t Mode, uint8_t InitVectors[16], uint8_t ...
function ErrorStatus (line 481) | ErrorStatus CRYP_AES_CTR(uint8_t Mode, uint8_t InitVectors[16], uint8_t ...
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_cryp_des.c
function ErrorStatus (line 100) | ErrorStatus CRYP_DES_ECB(uint8_t Mode, uint8_t Key[8], uint8_t *Input,
function ErrorStatus (line 195) | ErrorStatus CRYP_DES_CBC(uint8_t Mode, uint8_t Key[8], uint8_t InitVecto...
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_cryp_tdes.c
function ErrorStatus (line 102) | ErrorStatus CRYP_TDES_ECB(uint8_t Mode, uint8_t Key[24], uint8_t *Input,
function ErrorStatus (line 204) | ErrorStatus CRYP_TDES_CBC(uint8_t Mode, uint8_t Key[24], uint8_t InitVec...
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dac.c
function DAC_DeInit (line 180) | void DAC_DeInit(void)
function DAC_Init (line 199) | void DAC_Init(uint32_t DAC_Channel, DAC_InitTypeDef* DAC_InitStruct)
function DAC_StructInit (line 235) | void DAC_StructInit(DAC_InitTypeDef* DAC_InitStruct)
function DAC_Cmd (line 259) | void DAC_Cmd(uint32_t DAC_Channel, FunctionalState NewState)
function DAC_SoftwareTriggerCmd (line 287) | void DAC_SoftwareTriggerCmd(uint32_t DAC_Channel, FunctionalState NewState)
function DAC_DualSoftwareTriggerCmd (line 311) | void DAC_DualSoftwareTriggerCmd(FunctionalState NewState)
function DAC_WaveGenerationCmd (line 342) | void DAC_WaveGenerationCmd(uint32_t DAC_Channel, uint32_t DAC_Wave, Func...
function DAC_SetChannel1Data (line 371) | void DAC_SetChannel1Data(uint32_t DAC_Align, uint16_t Data)
function DAC_SetChannel2Data (line 396) | void DAC_SetChannel2Data(uint32_t DAC_Align, uint16_t Data)
function DAC_SetDualChannelData (line 424) | void DAC_SetDualChannelData(uint32_t DAC_Align, uint16_t Data2, uint16_t...
function DAC_GetDataOutputValue (line 458) | uint16_t DAC_GetDataOutputValue(uint32_t DAC_Channel)
function DAC_DMACmd (line 503) | void DAC_DMACmd(uint32_t DAC_Channel, FunctionalState NewState)
function DAC_ITConfig (line 551) | void DAC_ITConfig(uint32_t DAC_Channel, uint32_t DAC_IT, FunctionalState...
function FlagStatus (line 583) | FlagStatus DAC_GetFlagStatus(uint32_t DAC_Channel, uint32_t DAC_FLAG)
function DAC_ClearFlag (line 618) | void DAC_ClearFlag(uint32_t DAC_Channel, uint32_t DAC_FLAG)
function ITStatus (line 641) | ITStatus DAC_GetITStatus(uint32_t DAC_Channel, uint32_t DAC_IT)
function DAC_ClearITPendingBit (line 681) | void DAC_ClearITPendingBit(uint32_t DAC_Channel, uint32_t DAC_IT)
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dbgmcu.c
function DBGMCU_GetREVID (line 58) | uint32_t DBGMCU_GetREVID(void)
function DBGMCU_GetDEVID (line 68) | uint32_t DBGMCU_GetDEVID(void)
function DBGMCU_Config (line 84) | void DBGMCU_Config(uint32_t DBGMCU_Periph, FunctionalState NewState)
function DBGMCU_APB1PeriphConfig (line 123) | void DBGMCU_APB1PeriphConfig(uint32_t DBGMCU_Periph, FunctionalState New...
function DBGMCU_APB2PeriphConfig (line 152) | void DBGMCU_APB2PeriphConfig(uint32_t DBGMCU_Periph, FunctionalState New...
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dcmi.c
function DCMI_DeInit (line 128) | void DCMI_DeInit(void)
function DCMI_Init (line 145) | void DCMI_Init(DCMI_InitTypeDef* DCMI_InitStruct)
function DCMI_StructInit (line 187) | void DCMI_StructInit(DCMI_InitTypeDef* DCMI_InitStruct)
function DCMI_CROPConfig (line 207) | void DCMI_CROPConfig(DCMI_CROPInitTypeDef* DCMI_CROPInitStruct)
function DCMI_CROPCmd (line 225) | void DCMI_CROPCmd(FunctionalState NewState)
function DCMI_SetEmbeddedSynchroCodes (line 248) | void DCMI_SetEmbeddedSynchroCodes(DCMI_CodesInitTypeDef* DCMI_CodesInitS...
function DCMI_JPEGCmd (line 263) | void DCMI_JPEGCmd(FunctionalState NewState)
function DCMI_Cmd (line 301) | void DCMI_Cmd(FunctionalState NewState)
function DCMI_CaptureCmd (line 324) | void DCMI_CaptureCmd(FunctionalState NewState)
function DCMI_ReadData (line 346) | uint32_t DCMI_ReadData(void)
function DCMI_ITConfig (line 379) | void DCMI_ITConfig(uint16_t DCMI_IT, FunctionalState NewState)
function FlagStatus (line 416) | FlagStatus DCMI_GetFlagStatus(uint16_t DCMI_FLAG)
function DCMI_ClearFlag (line 463) | void DCMI_ClearFlag(uint16_t DCMI_FLAG)
function ITStatus (line 485) | ITStatus DCMI_GetITStatus(uint16_t DCMI_IT)
function DCMI_ClearITPendingBit (line 517) | void DCMI_ClearITPendingBit(uint16_t DCMI_IT)
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dma.c
function DMA_DeInit (line 194) | void DMA_DeInit(DMA_Stream_TypeDef* DMAy_Streamx)
function DMA_Init (line 317) | void DMA_Init(DMA_Stream_TypeDef* DMAy_Streamx, DMA_InitTypeDef* DMA_Ini...
function DMA_StructInit (line 401) | void DMA_StructInit(DMA_InitTypeDef* DMA_InitStruct)
function DMA_Cmd (line 476) | void DMA_Cmd(DMA_Stream_TypeDef* DMAy_Streamx, FunctionalState NewState)
function DMA_PeriphIncOffsetSizeConfig (line 512) | void DMA_PeriphIncOffsetSizeConfig(DMA_Stream_TypeDef* DMAy_Streamx, uin...
function DMA_FlowControllerConfig (line 548) | void DMA_FlowControllerConfig(DMA_Stream_TypeDef* DMAy_Streamx, uint32_t...
function DMA_SetCurrDataCounter (line 632) | void DMA_SetCurrDataCounter(DMA_Stream_TypeDef* DMAy_Streamx, uint16_t C...
function DMA_GetCurrDataCounter (line 647) | uint16_t DMA_GetCurrDataCounter(DMA_Stream_TypeDef* DMAy_Streamx)
function DMA_DoubleBufferModeConfig (line 724) | void DMA_DoubleBufferModeConfig(DMA_Stream_TypeDef* DMAy_Streamx, uint32...
function DMA_DoubleBufferModeCmd (line 755) | void DMA_DoubleBufferModeCmd(DMA_Stream_TypeDef* DMAy_Streamx, Functiona...
function DMA_MemoryTargetConfig (line 796) | void DMA_MemoryTargetConfig(DMA_Stream_TypeDef* DMAy_Streamx, uint32_t M...
function DMA_GetCurrentMemoryTarget (line 822) | uint32_t DMA_GetCurrentMemoryTarget(DMA_Stream_TypeDef* DMAy_Streamx)
function FunctionalState (line 931) | FunctionalState DMA_GetCmdStatus(DMA_Stream_TypeDef* DMAy_Streamx)
function DMA_GetFIFOStatus (line 965) | uint32_t DMA_GetFIFOStatus(DMA_Stream_TypeDef* DMAy_Streamx)
function FlagStatus (line 992) | FlagStatus DMA_GetFlagStatus(DMA_Stream_TypeDef* DMAy_Streamx, uint32_t ...
function DMA_ClearFlag (line 1059) | void DMA_ClearFlag(DMA_Stream_TypeDef* DMAy_Streamx, uint32_t DMA_FLAG)
function DMA_ITConfig (line 1106) | void DMA_ITConfig(DMA_Stream_TypeDef* DMAy_Streamx, uint32_t DMA_IT, Fun...
function ITStatus (line 1158) | ITStatus DMA_GetITStatus(DMA_Stream_TypeDef* DMAy_Streamx, uint32_t DMA_IT)
function DMA_ClearITPendingBit (line 1240) | void DMA_ClearITPendingBit(DMA_Stream_TypeDef* DMAy_Streamx, uint32_t DM...
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_exti.c
function EXTI_DeInit (line 109) | void EXTI_DeInit(void)
function EXTI_Init (line 125) | void EXTI_Init(EXTI_InitTypeDef* EXTI_InitStruct)
function EXTI_StructInit (line 181) | void EXTI_StructInit(EXTI_InitTypeDef* EXTI_InitStruct)
function EXTI_GenerateSWInterrupt (line 196) | void EXTI_GenerateSWInterrupt(uint32_t EXTI_Line)
function FlagStatus (line 226) | FlagStatus EXTI_GetFlagStatus(uint32_t EXTI_Line)
function EXTI_ClearFlag (line 249) | void EXTI_ClearFlag(uint32_t EXTI_Line)
function ITStatus (line 263) | ITStatus EXTI_GetITStatus(uint32_t EXTI_Line)
function EXTI_ClearITPendingBit (line 288) | void EXTI_ClearITPendingBit(uint32_t EXTI_Line)
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_flash.c
function FLASH_SetLatency (line 172) | void FLASH_SetLatency(uint32_t FLASH_Latency)
function FLASH_PrefetchBufferCmd (line 187) | void FLASH_PrefetchBufferCmd(FunctionalState NewState)
function FLASH_InstructionCacheCmd (line 209) | void FLASH_InstructionCacheCmd(FunctionalState NewState)
function FLASH_DataCacheCmd (line 230) | void FLASH_DataCacheCmd(FunctionalState NewState)
function FLASH_InstructionCacheReset (line 251) | void FLASH_InstructionCacheReset(void)
function FLASH_DataCacheReset (line 262) | void FLASH_DataCacheReset(void)
function FLASH_Unlock (line 306) | void FLASH_Unlock(void)
function FLASH_Lock (line 321) | void FLASH_Lock(void)
function FLASH_Status (line 347) | FLASH_Status FLASH_EraseSector(uint32_t FLASH_Sector, uint8_t VoltageRange)
function FLASH_Status (line 412) | FLASH_Status FLASH_EraseAllSectors(uint8_t VoltageRange)
function FLASH_Status (line 465) | FLASH_Status FLASH_ProgramDoubleWord(uint32_t Address, uint64_t Data)
function FLASH_Status (line 503) | FLASH_Status FLASH_ProgramWord(uint32_t Address, uint32_t Data)
function FLASH_Status (line 541) | FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data)
function FLASH_Status (line 579) | FLASH_Status FLASH_ProgramByte(uint32_t Address, uint8_t Data)
function FLASH_OB_Unlock (line 664) | void FLASH_OB_Unlock(void)
function FLASH_OB_Lock (line 679) | void FLASH_OB_Lock(void)
function FLASH_OB_WRPConfig (line 695) | void FLASH_OB_WRPConfig(uint32_t OB_WRP, FunctionalState NewState)
function FLASH_OB_RDPConfig (line 730) | void FLASH_OB_RDPConfig(uint8_t OB_RDP)
function FLASH_OB_UserConfig (line 762) | void FLASH_OB_UserConfig(uint8_t OB_IWDG, uint8_t OB_STOP, uint8_t OB_ST...
function FLASH_OB_BORConfig (line 795) | void FLASH_OB_BORConfig(uint8_t OB_BOR)
function FLASH_Status (line 812) | FLASH_Status FLASH_OB_Launch(void)
function FLASH_OB_GetUser (line 831) | uint8_t FLASH_OB_GetUser(void)
function FLASH_OB_GetWRP (line 842) | uint16_t FLASH_OB_GetWRP(void)
function FlagStatus (line 855) | FlagStatus FLASH_OB_GetRDP(void)
function FLASH_OB_GetBOR (line 879) | uint8_t FLASH_OB_GetBOR(void)
function FLASH_ITConfig (line 909) | void FLASH_ITConfig(uint32_t FLASH_IT, FunctionalState NewState)
function FlagStatus (line 940) | FlagStatus FLASH_GetFlagStatus(uint32_t FLASH_FLAG)
function FLASH_ClearFlag (line 970) | void FLASH_ClearFlag(uint32_t FLASH_FLAG)
function FLASH_Status (line 985) | FLASH_Status FLASH_GetStatus(void)
function FLASH_Status (line 1028) | FLASH_Status FLASH_WaitForLastOperation(void)
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_fsmc.c
function FSMC_NORSRAMDeInit (line 121) | void FSMC_NORSRAMDeInit(uint32_t FSMC_Bank)
function FSMC_NORSRAMInit (line 148) | void FSMC_NORSRAMInit(FSMC_NORSRAMInitTypeDef* FSMC_NORSRAMInitStruct)
function FSMC_NORSRAMStructInit (line 230) | void FSMC_NORSRAMStructInit(FSMC_NORSRAMInitTypeDef* FSMC_NORSRAMInitStr...
function FSMC_NORSRAMCmd (line 273) | void FSMC_NORSRAMCmd(uint32_t FSMC_Bank, FunctionalState NewState)
function FSMC_NANDDeInit (line 344) | void FSMC_NANDDeInit(uint32_t FSMC_Bank)
function FSMC_NANDInit (line 375) | void FSMC_NANDInit(FSMC_NANDInitTypeDef* FSMC_NANDInitStruct)
function FSMC_NANDStructInit (line 440) | void FSMC_NANDStructInit(FSMC_NANDInitTypeDef* FSMC_NANDInitStruct)
function FSMC_NANDCmd (line 469) | void FSMC_NANDCmd(uint32_t FSMC_Bank, FunctionalState NewState)
function FSMC_NANDECCCmd (line 509) | void FSMC_NANDECCCmd(uint32_t FSMC_Bank, FunctionalState NewState)
function FSMC_GetECC (line 548) | uint32_t FSMC_GetECC(uint32_t FSMC_Bank)
function FSMC_PCCARDDeInit (line 612) | void FSMC_PCCARDDeInit(void)
function FSMC_PCCARDInit (line 629) | void FSMC_PCCARDInit(FSMC_PCCARDInitTypeDef* FSMC_PCCARDInitStruct)
function FSMC_PCCARDStructInit (line 681) | void FSMC_PCCARDStructInit(FSMC_PCCARDInitTypeDef* FSMC_PCCARDInitStruct)
function FSMC_PCCARDCmd (line 707) | void FSMC_PCCARDCmd(FunctionalState NewState)
function FSMC_ITConfig (line 754) | void FSMC_ITConfig(uint32_t FSMC_Bank, uint32_t FSMC_IT, FunctionalState...
function FlagStatus (line 814) | FlagStatus FSMC_GetFlagStatus(uint32_t FSMC_Bank, uint32_t FSMC_FLAG)
function FSMC_ClearFlag (line 864) | void FSMC_ClearFlag(uint32_t FSMC_Bank, uint32_t FSMC_FLAG)
function ITStatus (line 899) | ITStatus FSMC_GetITStatus(uint32_t FSMC_Bank, uint32_t FSMC_IT)
function FSMC_ClearITPendingBit (line 950) | void FSMC_ClearITPendingBit(uint32_t FSMC_Bank, uint32_t FSMC_IT)
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_gpio.c
function GPIO_DeInit (line 126) | void GPIO_DeInit(GPIO_TypeDef* GPIOx)
function GPIO_Init (line 188) | void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct)
function GPIO_StructInit (line 240) | void GPIO_StructInit(GPIO_InitTypeDef* GPIO_InitStruct)
function GPIO_PinLockConfig (line 261) | void GPIO_PinLockConfig(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
function GPIO_ReadInputDataBit (line 305) | uint8_t GPIO_ReadInputDataBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
function GPIO_ReadInputData (line 332) | uint16_t GPIO_ReadInputData(GPIO_TypeDef* GPIOx)
function GPIO_ReadOutputDataBit (line 347) | uint8_t GPIO_ReadOutputDataBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
function GPIO_ReadOutputData (line 371) | uint16_t GPIO_ReadOutputData(GPIO_TypeDef* GPIOx)
function GPIO_SetBits (line 389) | void GPIO_SetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
function GPIO_ResetBits (line 408) | void GPIO_ResetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
function GPIO_WriteBit (line 428) | void GPIO_WriteBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, BitAction Bit...
function GPIO_Write (line 451) | void GPIO_Write(GPIO_TypeDef* GPIOx, uint16_t PortVal)
function GPIO_ToggleBits (line 465) | void GPIO_ToggleBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
function GPIO_PinAFConfig (line 538) | void GPIO_PinAFConfig(GPIO_TypeDef* GPIOx, uint16_t GPIO_PinSource, uint...
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_hash.c
function HASH_DeInit (line 177) | void HASH_DeInit(void)
function HASH_Init (line 197) | void HASH_Init(HASH_InitTypeDef* HASH_InitStruct)
function HASH_StructInit (line 231) | void HASH_StructInit(HASH_InitTypeDef* HASH_InitStruct)
function HASH_Reset (line 255) | void HASH_Reset(void)
function HASH_SetLastWordValidBitsNbr (line 297) | void HASH_SetLastWordValidBitsNbr(uint16_t ValidNumber)
function HASH_DataIn (line 312) | void HASH_DataIn(uint32_t Data)
function HASH_GetInFIFOWordsNbr (line 323) | uint8_t HASH_GetInFIFOWordsNbr(void)
function HASH_GetDigest (line 337) | void HASH_GetDigest(HASH_MsgDigest* HASH_MessageDigest)
function HASH_StartDigest (line 352) | void HASH_StartDigest(void)
function HASH_SaveContext (line 395) | void HASH_SaveContext(HASH_Context* HASH_ContextSave)
function HASH_RestoreContext (line 417) | void HASH_RestoreContext(HASH_Context* HASH_ContextRestore)
function HASH_DMACmd (line 466) | void HASH_DMACmd(FunctionalState NewState)
function HASH_ITConfig (line 561) | void HASH_ITConfig(uint8_t HASH_IT, FunctionalState NewState)
function FlagStatus (line 590) | FlagStatus HASH_GetFlagStatus(uint16_t HASH_FLAG)
function HASH_ClearFlag (line 631) | void HASH_ClearFlag(uint16_t HASH_FLAG)
function ITStatus (line 647) | ITStatus HASH_GetITStatus(uint8_t HASH_IT)
function HASH_ClearITPendingBit (line 681) | void HASH_ClearITPendingBit(uint8_t HASH_IT)
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_hash_md5.c
function ErrorStatus (line 93) | ErrorStatus HASH_MD5(uint8_t *Input, uint32_t Ilen, uint8_t Output[16])
function ErrorStatus (line 168) | ErrorStatus HMAC_MD5(uint8_t *Key, uint32_t Keylen, uint8_t *Input,
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_hash_sha1.c
function ErrorStatus (line 93) | ErrorStatus HASH_SHA1(uint8_t *Input, uint32_t Ilen, uint8_t Output[20])
function ErrorStatus (line 169) | ErrorStatus HMAC_SHA1(uint8_t *Key, uint32_t Keylen, uint8_t *Input,
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_i2c.c
function I2C_DeInit (line 138) | void I2C_DeInit(I2C_TypeDef* I2Cx)
function I2C_Init (line 181) | void I2C_Init(I2C_TypeDef* I2Cx, I2C_InitTypeDef* I2C_InitStruct)
function I2C_StructInit (line 290) | void I2C_StructInit(I2C_InitTypeDef* I2C_InitStruct)
function I2C_Cmd (line 314) | void I2C_Cmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
function I2C_GenerateSTART (line 338) | void I2C_GenerateSTART(I2C_TypeDef* I2Cx, FunctionalState NewState)
function I2C_GenerateSTOP (line 362) | void I2C_GenerateSTOP(I2C_TypeDef* I2Cx, FunctionalState NewState)
function I2C_Send7bitAddress (line 390) | void I2C_Send7bitAddress(I2C_TypeDef* I2Cx, uint8_t Address, uint8_t I2C...
function I2C_AcknowledgeConfig (line 417) | void I2C_AcknowledgeConfig(I2C_TypeDef* I2Cx, FunctionalState NewState)
function I2C_OwnAddress2Config (line 440) | void I2C_OwnAddress2Config(I2C_TypeDef* I2Cx, uint8_t Address)
function I2C_DualAddressCmd (line 467) | void I2C_DualAddressCmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
function I2C_GeneralCallCmd (line 491) | void I2C_GeneralCallCmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
function I2C_SoftwareResetCmd (line 517) | void I2C_SoftwareResetCmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
function I2C_StretchClockCmd (line 541) | void I2C_StretchClockCmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
function I2C_FastModeDutyCycleConfig (line 567) | void I2C_FastModeDutyCycleConfig(I2C_TypeDef* I2Cx, uint16_t I2C_DutyCycle)
function I2C_NACKPositionConfig (line 605) | void I2C_NACKPositionConfig(I2C_TypeDef* I2Cx, uint16_t I2C_NACKPosition)
function I2C_SMBusAlertConfig (line 633) | void I2C_SMBusAlertConfig(I2C_TypeDef* I2Cx, uint16_t I2C_SMBusAlert)
function I2C_ARPCmd (line 657) | void I2C_ARPCmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
function I2C_SendData (line 695) | void I2C_SendData(I2C_TypeDef* I2Cx, uint8_t Data)
function I2C_ReceiveData (line 708) | uint8_t I2C_ReceiveData(I2C_TypeDef* I2Cx)
function I2C_TransmitPEC (line 739) | void I2C_TransmitPEC(I2C_TypeDef* I2Cx, FunctionalState NewState)
function I2C_PECPositionConfig (line 770) | void I2C_PECPositionConfig(I2C_TypeDef* I2Cx, uint16_t I2C_PECPosition)
function I2C_CalculatePEC (line 794) | void I2C_CalculatePEC(I2C_TypeDef* I2Cx, FunctionalState NewState)
function I2C_GetPEC (line 816) | uint8_t I2C_GetPEC(I2C_TypeDef* I2Cx)
function I2C_DMACmd (line 849) | void I2C_DMACmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
function I2C_DMALastTransferCmd (line 873) | void I2C_DMALastTransferCmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
function I2C_ReadRegister (line 1011) | uint16_t I2C_ReadRegister(I2C_TypeDef* I2Cx, uint8_t I2C_Register)
function I2C_ITConfig (line 1038) | void I2C_ITConfig(I2C_TypeDef* I2Cx, uint16_t I2C_IT, FunctionalState Ne...
function ErrorStatus (line 1097) | ErrorStatus I2C_CheckEvent(I2C_TypeDef* I2Cx, uint32_t I2C_EVENT)
function I2C_GetLastEvent (line 1145) | uint32_t I2C_GetLastEvent(I2C_TypeDef* I2Cx)
function FlagStatus (line 1200) | FlagStatus I2C_GetFlagStatus(I2C_TypeDef* I2Cx, uint32_t I2C_FLAG)
function I2C_ClearFlag (line 1277) | void I2C_ClearFlag(I2C_TypeDef* I2Cx, uint32_t I2C_FLAG)
function ITStatus (line 1311) | ITStatus I2C_GetITStatus(I2C_TypeDef* I2Cx, uint32_t I2C_IT)
function I2C_ClearITPendingBit (line 1371) | void I2C_ClearITPendingBit(I2C_TypeDef* I2Cx, uint32_t I2C_IT)
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_iwdg.c
function IWDG_WriteAccessCmd (line 135) | void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess)
function IWDG_SetPrescaler (line 155) | void IWDG_SetPrescaler(uint8_t IWDG_Prescaler)
function IWDG_SetReload (line 168) | void IWDG_SetReload(uint16_t Reload)
function IWDG_ReloadCounter (line 181) | void IWDG_ReloadCounter(void)
function IWDG_Enable (line 207) | void IWDG_Enable(void)
function FlagStatus (line 236) | FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG)
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_pwr.c
function PWR_DeInit (line 126) | void PWR_DeInit(void)
function PWR_BackupAccessCmd (line 141) | void PWR_BackupAccessCmd(FunctionalState NewState)
function PWR_PVDLevelConfig (line 189) | void PWR_PVDLevelConfig(uint32_t PWR_PVDLevel)
function PWR_PVDCmd (line 214) | void PWR_PVDCmd(FunctionalState NewState)
function PWR_WakeUpPinCmd (line 248) | void PWR_WakeUpPinCmd(FunctionalState NewState)
function PWR_BackupRegulatorCmd (line 306) | void PWR_BackupRegulatorCmd(FunctionalState NewState)
function PWR_MainRegulatorModeConfig (line 326) | void PWR_MainRegulatorModeConfig(uint32_t PWR_Regulator_Voltage)
function PWR_FlashPowerDownCmd (line 368) | void PWR_FlashPowerDownCmd(FunctionalState NewState)
function PWR_EnterSTOPMode (line 508) | void PWR_EnterSTOPMode(uint32_t PWR_Regulator, uint8_t PWR_STOPEntry)
function PWR_EnterSTANDBYMode (line 556) | void PWR_EnterSTANDBYMode(void)
function FlagStatus (line 613) | FlagStatus PWR_GetFlagStatus(uint32_t PWR_FLAG)
function PWR_ClearFlag (line 640) | void PWR_ClearFlag(uint32_t PWR_FLAG)
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c
function RCC_DeInit (line 202) | void RCC_DeInit(void)
function RCC_HSEConfig (line 243) | void RCC_HSEConfig(uint8_t RCC_HSE)
function ErrorStatus (line 267) | ErrorStatus RCC_WaitForHSEStartUp(void)
function RCC_AdjustHSICalibrationValue (line 298) | void RCC_AdjustHSICalibrationValue(uint8_t HSICalibrationValue)
function RCC_HSICmd (line 334) | void RCC_HSICmd(FunctionalState NewState)
function RCC_LSEConfig (line 359) | void RCC_LSEConfig(uint8_t RCC_LSE)
function RCC_LSICmd (line 399) | void RCC_LSICmd(FunctionalState NewState)
function RCC_PLLConfig (line 442) | void RCC_PLLConfig(uint32_t RCC_PLLSource, uint32_t PLLM, uint32_t PLLN,...
function RCC_PLLCmd (line 465) | void RCC_PLLCmd(FunctionalState NewState)
function RCC_PLLI2SConfig (line 491) | void RCC_PLLI2SConfig(uint32_t PLLI2SN, uint32_t PLLI2SR)
function RCC_PLLI2SCmd (line 506) | void RCC_PLLI2SCmd(FunctionalState NewState)
function RCC_ClockSecuritySystemCmd (line 524) | void RCC_ClockSecuritySystemCmd(FunctionalState NewState)
function RCC_MCO1Config (line 549) | void RCC_MCO1Config(uint32_t RCC_MCO1Source, uint32_t RCC_MCO1Div)
function RCC_MCO2Config (line 587) | void RCC_MCO2Config(uint32_t RCC_MCO2Source, uint32_t RCC_MCO2Div)
function RCC_SYSCLKConfig (line 693) | void RCC_SYSCLKConfig(uint32_t RCC_SYSCLKSource)
function RCC_GetSYSCLKSource (line 721) | uint8_t RCC_GetSYSCLKSource(void)
function RCC_HCLKConfig (line 746) | void RCC_HCLKConfig(uint32_t RCC_SYSCLK)
function RCC_PCLK1Config (line 778) | void RCC_PCLK1Config(uint32_t RCC_HCLK)
function RCC_PCLK2Config (line 809) | void RCC_PCLK2Config(uint32_t RCC_HCLK)
function RCC_GetClocksFreq (line 861) | void RCC_GetClocksFreq(RCC_ClocksTypeDef* RCC_Clocks)
function RCC_RTCCLKConfig (line 986) | void RCC_RTCCLKConfig(uint32_t RCC_RTCCLKSource)
function RCC_RTCCLKCmd (line 1018) | void RCC_RTCCLKCmd(FunctionalState NewState)
function RCC_BackupResetCmd (line 1035) | void RCC_BackupResetCmd(FunctionalState NewState)
function RCC_I2SCLKConfig (line 1052) | void RCC_I2SCLKConfig(uint32_t RCC_I2SCLKSource)
function RCC_AHB1PeriphClockCmd (line 1091) | void RCC_AHB1PeriphClockCmd(uint32_t RCC_AHB1Periph, FunctionalState New...
function RCC_AHB2PeriphClockCmd (line 1123) | void RCC_AHB2PeriphClockCmd(uint32_t RCC_AHB2Periph, FunctionalState New...
function RCC_AHB3PeriphClockCmd (line 1150) | void RCC_AHB3PeriphClockCmd(uint32_t RCC_AHB3Periph, FunctionalState New...
function RCC_APB1PeriphClockCmd (line 1200) | void RCC_APB1PeriphClockCmd(uint32_t RCC_APB1Periph, FunctionalState New...
function RCC_APB2PeriphClockCmd (line 1240) | void RCC_APB2PeriphClockCmd(uint32_t RCC_APB2Periph, FunctionalState New...
function RCC_AHB1PeriphResetCmd (line 1279) | void RCC_AHB1PeriphResetCmd(uint32_t RCC_AHB1Periph, FunctionalState New...
function RCC_AHB2PeriphResetCmd (line 1308) | void RCC_AHB2PeriphResetCmd(uint32_t RCC_AHB2Periph, FunctionalState New...
function RCC_AHB3PeriphResetCmd (line 1332) | void RCC_AHB3PeriphResetCmd(uint32_t RCC_AHB3Periph, FunctionalState New...
function RCC_APB1PeriphResetCmd (line 1379) | void RCC_APB1PeriphResetCmd(uint32_t RCC_APB1Periph, FunctionalState New...
function RCC_APB2PeriphResetCmd (line 1415) | void RCC_APB2PeriphResetCmd(uint32_t RCC_APB2Periph, FunctionalState New...
function RCC_AHB1PeriphClockLPModeCmd (line 1461) | void RCC_AHB1PeriphClockLPModeCmd(uint32_t RCC_AHB1Periph, FunctionalSta...
function RCC_AHB2PeriphClockLPModeCmd (line 1493) | void RCC_AHB2PeriphClockLPModeCmd(uint32_t RCC_AHB2Periph, FunctionalSta...
function RCC_AHB3PeriphClockLPModeCmd (line 1520) | void RCC_AHB3PeriphClockLPModeCmd(uint32_t RCC_AHB3Periph, FunctionalSta...
function RCC_APB1PeriphClockLPModeCmd (line 1570) | void RCC_APB1PeriphClockLPModeCmd(uint32_t RCC_APB1Periph, FunctionalSta...
function RCC_APB2PeriphClockLPModeCmd (line 1610) | void RCC_APB2PeriphClockLPModeCmd(uint32_t RCC_APB2Periph, FunctionalSta...
function RCC_ITConfig (line 1655) | void RCC_ITConfig(uint8_t RCC_IT, FunctionalState NewState)
function FlagStatus (line 1691) | FlagStatus RCC_GetFlagStatus(uint8_t RCC_FLAG)
function RCC_ClearFlag (line 1736) | void RCC_ClearFlag(void)
function ITStatus (line 1755) | ITStatus RCC_GetITStatus(uint8_t RCC_IT)
function RCC_ClearITPendingBit (line 1788) | void RCC_ClearITPendingBit(uint8_t RCC_IT)
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rng.c
function RNG_DeInit (line 100) | void RNG_DeInit(void)
function RNG_Cmd (line 115) | void RNG_Cmd(FunctionalState NewState)
function RNG_GetRandomNumber (line 177) | uint32_t RNG_GetRandomNumber(void)
function RNG_ITConfig (line 274) | void RNG_ITConfig(FunctionalState NewState)
function FlagStatus (line 300) | FlagStatus RNG_GetFlagStatus(uint8_t RNG_FLAG)
function RNG_ClearFlag (line 333) | void RNG_ClearFlag(uint8_t RNG_FLAG)
function ITStatus (line 349) | ITStatus RNG_GetITStatus(uint8_t RNG_IT)
function RNG_ClearITPendingBit (line 379) | void RNG_ClearITPendingBit(uint8_t RNG_IT)
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rtc.c
function ErrorStatus (line 373) | ErrorStatus RTC_DeInit(void)
function ErrorStatus (line 455) | ErrorStatus RTC_Init(RTC_InitTypeDef* RTC_InitStruct)
function RTC_StructInit (line 501) | void RTC_StructInit(RTC_InitTypeDef* RTC_InitStruct)
function RTC_WriteProtectionCmd (line 523) | void RTC_WriteProtectionCmd(FunctionalState NewState)
function ErrorStatus (line 550) | ErrorStatus RTC_EnterInitMode(void)
function RTC_ExitInitMode (line 595) | void RTC_ExitInitMode(void)
function ErrorStatus (line 617) | ErrorStatus RTC_WaitForSynchro(void)
function ErrorStatus (line 660) | ErrorStatus RTC_RefClockCmd(FunctionalState NewState)
function RTC_BypassShadowCmd (line 708) | void RTC_BypassShadowCmd(FunctionalState NewState)
function ErrorStatus (line 763) | ErrorStatus RTC_SetTime(uint32_t RTC_Format, RTC_TimeTypeDef* RTC_TimeSt...
function RTC_TimeStructInit (line 866) | void RTC_TimeStructInit(RTC_TimeTypeDef* RTC_TimeStruct)
function RTC_GetTime (line 885) | void RTC_GetTime(uint32_t RTC_Format, RTC_TimeTypeDef* RTC_TimeStruct)
function RTC_GetSubSecond (line 918) | uint32_t RTC_GetSubSecond(void)
function ErrorStatus (line 943) | ErrorStatus RTC_SetDate(uint32_t RTC_Format, RTC_DateTypeDef* RTC_DateSt...
function RTC_DateStructInit (line 1034) | void RTC_DateStructInit(RTC_DateTypeDef* RTC_DateStruct)
function RTC_GetDate (line 1053) | void RTC_GetDate(uint32_t RTC_Format, RTC_DateTypeDef* RTC_DateStruct)
function RTC_SetAlarm (line 1113) | void RTC_SetAlarm(uint32_t RTC_Format, uint32_t RTC_Alarm, RTC_AlarmType...
function RTC_AlarmStructInit (line 1224) | void RTC_AlarmStructInit(RTC_AlarmTypeDef* RTC_AlarmStruct)
function RTC_GetAlarm (line 1254) | void RTC_GetAlarm(uint32_t RTC_Format, uint32_t RTC_Alarm, RTC_AlarmType...
function ErrorStatus (line 1308) | ErrorStatus RTC_AlarmCmd(uint32_t RTC_Alarm, FunctionalState NewState)
function RTC_AlarmSubSecondConfig (line 1402) | void RTC_AlarmSubSecondConfig(uint32_t RTC_Alarm, uint32_t RTC_AlarmSubS...
function RTC_GetAlarmSubSecond (line 1443) | uint32_t RTC_GetAlarmSubSecond(uint32_t RTC_Alarm)
function RTC_WakeUpClockConfig (line 1492) | void RTC_WakeUpClockConfig(uint32_t RTC_WakeUpClock)
function RTC_SetWakeUpCounter (line 1519) | void RTC_SetWakeUpCounter(uint32_t RTC_WakeUpCounter)
function RTC_GetWakeUpCounter (line 1540) | uint32_t RTC_GetWakeUpCounter(void)
function ErrorStatus (line 1552) | ErrorStatus RTC_WakeUpCmd(FunctionalState NewState)
function RTC_DayLightSavingConfig (line 1629) | void RTC_DayLightSavingConfig(uint32_t RTC_DayLightSaving, uint32_t RTC_...
function RTC_GetStoreOperation (line 1656) | uint32_t RTC_GetStoreOperation(void)
function RTC_OutputConfig (line 1695) | void RTC_OutputConfig(uint32_t RTC_Output, uint32_t RTC_OutputPolarity)
function ErrorStatus (line 1749) | ErrorStatus RTC_CoarseCalibConfig(uint32_t RTC_CalibSign, uint32_t Value)
function ErrorStatus (line 1790) | ErrorStatus RTC_CoarseCalibCmd(FunctionalState NewState)
function RTC_CalibOutputCmd (line 1836) | void RTC_CalibOutputCmd(FunctionalState NewState)
function RTC_CalibOutputConfig (line 1868) | void RTC_CalibOutputConfig(uint32_t RTC_CalibOutput)
function ErrorStatus (line 1904) | ErrorStatus RTC_SmoothCalibConfig(uint32_t RTC_SmoothCalibPeriod,
function RTC_TimeStampCmd (line 1980) | void RTC_TimeStampCmd(uint32_t RTC_TimeStampEdge, FunctionalState NewState)
function RTC_GetTimeStamp (line 2024) | void RTC_GetTimeStamp(uint32_t RTC_Format, RTC_TimeTypeDef* RTC_StampTim...
function RTC_GetTimeStampSubSecond (line 2068) | uint32_t RTC_GetTimeStampSubSecond(void)
function RTC_TamperTriggerConfig (line 2103) | void RTC_TamperTriggerConfig(uint32_t RTC_Tamper, uint32_t RTC_TamperTri...
function RTC_TamperCmd (line 2129) | void RTC_TamperCmd(uint32_t RTC_Tamper, FunctionalState NewState)
function RTC_TamperFilterConfig (line 2160) | void RTC_TamperFilterConfig(uint32_t RTC_TamperFilter)
function RTC_TamperSamplingFreqConfig (line 2194) | void RTC_TamperSamplingFreqConfig(uint32_t RTC_TamperSamplingFreq)
function RTC_TamperPinsPrechargeDuration (line 2217) | void RTC_TamperPinsPrechargeDuration(uint32_t RTC_TamperPrechargeDuration)
function RTC_TimeStampOnTamperDetectionCmd (line 2237) | void RTC_TimeStampOnTamperDetectionCmd(FunctionalState NewState)
function RTC_TamperPullUpCmd (line 2260) | void RTC_TamperPullUpCmd(FunctionalState NewState)
function RTC_WriteBackupRegister (line 2301) | void RTC_WriteBackupRegister(uint32_t RTC_BKP_DR, uint32_t Data)
function RTC_ReadBackupRegister (line 2322) | uint32_t RTC_ReadBackupRegister(uint32_t RTC_BKP_DR)
function RTC_TamperPinSelection (line 2362) | void RTC_TamperPinSelection(uint32_t RTC_TamperPin)
function RTC_TimeStampPinSelection (line 2379) | void RTC_TimeStampPinSelection(uint32_t RTC_TimeStampPin)
function RTC_OutputTypeConfig (line 2398) | void RTC_OutputTypeConfig(uint32_t RTC_OutputType)
function ErrorStatus (line 2436) | ErrorStatus RTC_SynchroShiftConfig(uint32_t RTC_ShiftAdd1S, uint32_t RTC...
function RTC_ITConfig (line 2555) | void RTC_ITConfig(uint32_t RTC_IT, FunctionalState NewState)
function FlagStatus (line 2603) | FlagStatus RTC_GetFlagStatus(uint32_t RTC_FLAG)
function RTC_ClearFlag (line 2639) | void RTC_ClearFlag(uint32_t RTC_FLAG)
function ITStatus (line 2659) | ITStatus RTC_GetITStatus(uint32_t RTC_IT)
function RTC_ClearITPendingBit (line 2699) | void RTC_ClearITPendingBit(uint32_t RTC_IT)
function RTC_ByteToBcd2 (line 2722) | static uint8_t RTC_ByteToBcd2(uint8_t Value)
function RTC_Bcd2ToByte (line 2740) | static uint8_t RTC_Bcd2ToByte(uint8_t Value)
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_sdio.c
function SDIO_DeInit (line 265) | void SDIO_DeInit(void)
function SDIO_Init (line 278) | void SDIO_Init(SDIO_InitTypeDef* SDIO_InitStruct)
function SDIO_StructInit (line 316) | void SDIO_StructInit(SDIO_InitTypeDef* SDIO_InitStruct)
function SDIO_ClockCmd (line 333) | void SDIO_ClockCmd(FunctionalState NewState)
function SDIO_SetPowerState (line 349) | void SDIO_SetPowerState(uint32_t SDIO_PowerState)
function SDIO_GetPowerState (line 366) | uint32_t SDIO_GetPowerState(void)
function SDIO_SendCommand (line 398) | void SDIO_SendCommand(SDIO_CmdInitTypeDef *SDIO_CmdInitStruct)
function SDIO_CmdStructInit (line 434) | void SDIO_CmdStructInit(SDIO_CmdInitTypeDef* SDIO_CmdInitStruct)
function SDIO_GetCommandResponse (line 449) | uint8_t SDIO_GetCommandResponse(void)
function SDIO_GetResponse (line 464) | uint32_t SDIO_GetResponse(uint32_t SDIO_RESP)
function SDIO_DataConfig (line 502) | void SDIO_DataConfig(SDIO_DataInitTypeDef* SDIO_DataInitStruct)
function SDIO_DataStructInit (line 543) | void SDIO_DataStructInit(SDIO_DataInitTypeDef* SDIO_DataInitStruct)
function SDIO_GetDataCounter (line 559) | uint32_t SDIO_GetDataCounter(void)
function SDIO_ReadData (line 569) | uint32_t SDIO_ReadData(void)
function SDIO_WriteData (line 579) | void SDIO_WriteData(uint32_t Data)
function SDIO_GetFIFOCount (line 589) | uint32_t SDIO_GetFIFOCount(void)
function SDIO_StartSDIOReadWait (line 618) | void SDIO_StartSDIOReadWait(FunctionalState NewState)
function SDIO_StopSDIOReadWait (line 632) | void SDIO_StopSDIOReadWait(FunctionalState NewState)
function SDIO_SetSDIOReadWaitMode (line 648) | void SDIO_SetSDIOReadWaitMode(uint32_t SDIO_ReadWaitMode)
function SDIO_SetSDIOOperation (line 662) | void SDIO_SetSDIOOperation(FunctionalState NewState)
function SDIO_SendSDIOSuspendCmd (line 676) | void SDIO_SendSDIOSuspendCmd(FunctionalState NewState)
function SDIO_CommandCompletionCmd (line 708) | void SDIO_CommandCompletionCmd(FunctionalState NewState)
function SDIO_CEATAITCmd (line 722) | void SDIO_CEATAITCmd(FunctionalState NewState)
function SDIO_SendCEATACmd (line 736) | void SDIO_SendCEATACmd(FunctionalState NewState)
function SDIO_DMACmd (line 768) | void SDIO_DMACmd(FunctionalState NewState)
function SDIO_ITConfig (line 826) | void SDIO_ITConfig(uint32_t SDIO_IT, FunctionalState NewState)
function FlagStatus (line 874) | FlagStatus SDIO_GetFlagStatus(uint32_t SDIO_FLAG)
function SDIO_ClearFlag (line 911) | void SDIO_ClearFlag(uint32_t SDIO_FLAG)
function ITStatus (line 950) | ITStatus SDIO_GetITStatus(uint32_t SDIO_IT)
function SDIO_ClearITPendingBit (line 986) | void SDIO_ClearITPendingBit(uint32_t SDIO_IT)
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_spi.c
function SPI_I2S_DeInit (line 224) | void SPI_I2S_DeInit(SPI_TypeDef* SPIx)
function SPI_Init (line 263) | void SPI_Init(SPI_TypeDef* SPIx, SPI_InitTypeDef* SPI_InitStruct)
function I2S_Init (line 327) | void I2S_Init(SPI_TypeDef* SPIx, I2S_InitTypeDef* I2S_InitStruct)
function SPI_StructInit (line 459) | void SPI_StructInit(SPI_InitTypeDef* SPI_InitStruct)
function I2S_StructInit (line 487) | void I2S_StructInit(I2S_InitTypeDef* I2S_InitStruct)
function SPI_Cmd (line 516) | void SPI_Cmd(SPI_TypeDef* SPIx, FunctionalState NewState)
function I2S_Cmd (line 541) | void I2S_Cmd(SPI_TypeDef* SPIx, FunctionalState NewState)
function SPI_DataSizeConfig (line 568) | void SPI_DataSizeConfig(SPI_TypeDef* SPIx, uint16_t SPI_DataSize)
function SPI_BiDirectionalLineConfig (line 588) | void SPI_BiDirectionalLineConfig(SPI_TypeDef* SPIx, uint16_t SPI_Direction)
function SPI_NSSInternalSoftwareConfig (line 614) | void SPI_NSSInternalSoftwareConfig(SPI_TypeDef* SPIx, uint16_t SPI_NSSIn...
function SPI_SSOutputCmd (line 638) | void SPI_SSOutputCmd(SPI_TypeDef* SPIx, FunctionalState NewState)
function SPI_TIModeCmd (line 669) | void SPI_TIModeCmd(SPI_TypeDef* SPIx, FunctionalState NewState)
function I2S_FullDuplexConfig (line 706) | void I2S_FullDuplexConfig(SPI_TypeDef* I2Sxext, I2S_InitTypeDef* I2S_Ini...
function SPI_I2S_ReceiveData (line 781) | uint16_t SPI_I2S_ReceiveData(SPI_TypeDef* SPIx)
function SPI_I2S_SendData (line 797) | void SPI_I2S_SendData(SPI_TypeDef* SPIx, uint16_t Data)
function SPI_CalculateCRC (line 886) | void SPI_CalculateCRC(SPI_TypeDef* SPIx, FunctionalState NewState)
function SPI_TransmitCRC (line 908) | void SPI_TransmitCRC(SPI_TypeDef* SPIx)
function SPI_GetCRC (line 926) | uint16_t SPI_GetCRC(SPI_TypeDef* SPIx, uint8_t SPI_CRC)
function SPI_GetCRCPolynomial (line 951) | uint16_t SPI_GetCRCPolynomial(SPI_TypeDef* SPIx)
function SPI_I2S_DMACmd (line 988) | void SPI_I2S_DMACmd(SPI_TypeDef* SPIx, uint16_t SPI_I2S_DMAReq, Function...
function SPI_I2S_ITConfig (line 1097) | void SPI_I2S_ITConfig(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT, FunctionalS...
function FlagStatus (line 1141) | FlagStatus SPI_I2S_GetFlagStatus(SPI_TypeDef* SPIx, uint16_t SPI_I2S_FLAG)
function SPI_I2S_ClearFlag (line 1182) | void SPI_I2S_ClearFlag(SPI_TypeDef* SPIx, uint16_t SPI_I2S_FLAG)
function ITStatus (line 1207) | ITStatus SPI_I2S_GetITStatus(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT)
function SPI_I2S_ClearITPendingBit (line 1262) | void SPI_I2S_ClearITPendingBit(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT)
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_syscfg.c
function SYSCFG_DeInit (line 92) | void SYSCFG_DeInit(void)
function SYSCFG_MemoryRemapConfig (line 108) | void SYSCFG_MemoryRemapConfig(uint8_t SYSCFG_MemoryRemap)
function SYSCFG_EXTILineConfig (line 125) | void SYSCFG_EXTILineConfig(uint8_t EXTI_PortSourceGPIOx, uint8_t EXTI_Pi...
function SYSCFG_ETH_MediaInterfaceConfig (line 146) | void SYSCFG_ETH_MediaInterfaceConfig(uint32_t SYSCFG_ETH_MediaInterface)
function SYSCFG_CompensationCellCmd (line 163) | void SYSCFG_CompensationCellCmd(FunctionalState NewState)
function FlagStatus (line 176) | FlagStatus SYSCFG_GetCompensationCellStatus(void)
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_tim.c
function TIM_DeInit (line 200) | void TIM_DeInit(TIM_TypeDef* TIMx)
function TIM_TimeBaseInit (line 288) | void TIM_TimeBaseInit(TIM_TypeDef* TIMx, TIM_TimeBaseInitTypeDef* TIM_Ti...
function TIM_TimeBaseStructInit (line 340) | void TIM_TimeBaseStructInit(TIM_TimeBaseInitTypeDef* TIM_TimeBaseInitStr...
function TIM_PrescalerConfig (line 360) | void TIM_PrescalerConfig(TIM_TypeDef* TIMx, uint16_t Prescaler, uint16_t...
function TIM_CounterModeConfig (line 383) | void TIM_CounterModeConfig(TIM_TypeDef* TIMx, uint16_t TIM_CounterMode)
function TIM_SetCounter (line 409) | void TIM_SetCounter(TIM_TypeDef* TIMx, uint32_t Counter)
function TIM_SetAutoreload (line 424) | void TIM_SetAutoreload(TIM_TypeDef* TIMx, uint32_t Autoreload)
function TIM_GetCounter (line 438) | uint32_t TIM_GetCounter(TIM_TypeDef* TIMx)
function TIM_GetPrescaler (line 452) | uint16_t TIM_GetPrescaler(TIM_TypeDef* TIMx)
function TIM_UpdateDisableConfig (line 468) | void TIM_UpdateDisableConfig(TIM_TypeDef* TIMx, FunctionalState NewState)
function TIM_UpdateRequestConfig (line 497) | void TIM_UpdateRequestConfig(TIM_TypeDef* TIMx, uint16_t TIM_UpdateSource)
function TIM_ARRPreloadConfig (line 522) | void TIM_ARRPreloadConfig(TIM_TypeDef* TIMx, FunctionalState NewState)
function TIM_SelectOnePulseMode (line 549) | void TIM_SelectOnePulseMode(TIM_TypeDef* TIMx, uint16_t TIM_OPMode)
function TIM_SetClockDivision (line 572) | void TIM_SetClockDivision(TIM_TypeDef* TIMx, uint16_t TIM_CKD)
function TIM_Cmd (line 592) | void TIM_Cmd(TIM_TypeDef* TIMx, FunctionalState NewState)
function TIM_OC1Init (line 671) | void TIM_OC1Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct)
function TIM_OC2Init (line 752) | void TIM_OC2Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct)
function TIM_OC3Init (line 833) | void TIM_OC3Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct)
function TIM_OC4Init (line 913) | void TIM_OC4Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct)
function TIM_OCStructInit (line 976) | void TIM_OCStructInit(TIM_OCInitTypeDef* TIM_OCInitStruct)
function TIM_SelectOCxM (line 1012) | void TIM_SelectOCxM(TIM_TypeDef* TIMx, uint16_t TIM_Channel, uint16_t TI...
function TIM_SetCompare1 (line 1058) | void TIM_SetCompare1(TIM_TypeDef* TIMx, uint32_t Compare1)
function TIM_SetCompare2 (line 1074) | void TIM_SetCompare2(TIM_TypeDef* TIMx, uint32_t Compare2)
function TIM_SetCompare3 (line 1089) | void TIM_SetCompare3(TIM_TypeDef* TIMx, uint32_t Compare3)
function TIM_SetCompare4 (line 1104) | void TIM_SetCompare4(TIM_TypeDef* TIMx, uint32_t Compare4)
function TIM_ForcedOC1Config (line 1122) | void TIM_ForcedOC1Config(TIM_TypeDef* TIMx, uint16_t TIM_ForcedAction)
function TIM_ForcedOC2Config (line 1151) | void TIM_ForcedOC2Config(TIM_TypeDef* TIMx, uint16_t TIM_ForcedAction)
function TIM_ForcedOC3Config (line 1179) | void TIM_ForcedOC3Config(TIM_TypeDef* TIMx, uint16_t TIM_ForcedAction)
function TIM_ForcedOC4Config (line 1208) | void TIM_ForcedOC4Config(TIM_TypeDef* TIMx, uint16_t TIM_ForcedAction)
function TIM_OC1PreloadConfig (line 1236) | void TIM_OC1PreloadConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPreload)
function TIM_OC2PreloadConfig (line 1266) | void TIM_OC2PreloadConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPreload)
function TIM_OC3PreloadConfig (line 1295) | void TIM_OC3PreloadConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPreload)
function TIM_OC4PreloadConfig (line 1324) | void TIM_OC4PreloadConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPreload)
function TIM_OC1FastConfig (line 1353) | void TIM_OC1FastConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCFast)
function TIM_OC2FastConfig (line 1384) | void TIM_OC2FastConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCFast)
function TIM_OC3FastConfig (line 1414) | void TIM_OC3FastConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCFast)
function TIM_OC4FastConfig (line 1444) | void TIM_OC4FastConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCFast)
function TIM_ClearOC1Ref (line 1474) | void TIM_ClearOC1Ref(TIM_TypeDef* TIMx, uint16_t TIM_OCClear)
function TIM_ClearOC2Ref (line 1504) | void TIM_ClearOC2Ref(TIM_TypeDef* TIMx, uint16_t TIM_OCClear)
function TIM_ClearOC3Ref (line 1533) | void TIM_ClearOC3Ref(TIM_TypeDef* TIMx, uint16_t TIM_OCClear)
function TIM_ClearOC4Ref (line 1562) | void TIM_ClearOC4Ref(TIM_TypeDef* TIMx, uint16_t TIM_OCClear)
function TIM_OC1PolarityConfig (line 1591) | void TIM_OC1PolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPolarity)
function TIM_OC1NPolarityConfig (line 1618) | void TIM_OC1NPolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCNPolarity)
function TIM_OC2PolarityConfig (line 1645) | void TIM_OC2PolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPolarity)
function TIM_OC2NPolarityConfig (line 1672) | void TIM_OC2NPolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCNPolarity)
function TIM_OC3PolarityConfig (line 1699) | void TIM_OC3PolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPolarity)
function TIM_OC3NPolarityConfig (line 1726) | void TIM_OC3NPolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCNPolarity)
function TIM_OC4PolarityConfig (line 1753) | void TIM_OC4PolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPolarity)
function TIM_CCxCmd (line 1784) | void TIM_CCxCmd(TIM_TypeDef* TIMx, uint16_t TIM_Channel, uint16_t TIM_CCx)
function TIM_CCxNCmd (line 1814) | void TIM_CCxNCmd(TIM_TypeDef* TIMx, uint16_t TIM_Channel, uint16_t TIM_C...
function TIM_ICInit (line 1896) | void TIM_ICInit(TIM_TypeDef* TIMx, TIM_ICInitTypeDef* TIM_ICInitStruct)
function TIM_ICStructInit (line 1952) | void TIM_ICStructInit(TIM_ICInitTypeDef* TIM_ICInitStruct)
function TIM_PWMIConfig (line 1971) | void TIM_PWMIConfig(TIM_TypeDef* TIMx, TIM_ICInitTypeDef* TIM_ICInitStruct)
function TIM_GetCapture1 (line 2028) | uint32_t TIM_GetCapture1(TIM_TypeDef* TIMx)
function TIM_GetCapture2 (line 2043) | uint32_t TIM_GetCapture2(TIM_TypeDef* TIMx)
function TIM_GetCapture3 (line 2057) | uint32_t TIM_GetCapture3(TIM_TypeDef* TIMx)
function TIM_GetCapture4 (line 2071) | uint32_t TIM_GetCapture4(TIM_TypeDef* TIMx)
function TIM_SetIC1Prescaler (line 2091) | void TIM_SetIC1Prescaler(TIM_TypeDef* TIMx, uint16_t TIM_ICPSC)
function TIM_SetIC2Prescaler (line 2116) | void TIM_SetIC2Prescaler(TIM_TypeDef* TIMx, uint16_t TIM_ICPSC)
function TIM_SetIC3Prescaler (line 2140) | void TIM_SetIC3Prescaler(TIM_TypeDef* TIMx, uint16_t TIM_ICPSC)
function TIM_SetIC4Prescaler (line 2164) | void TIM_SetIC4Prescaler(TIM_TypeDef* TIMx, uint16_t TIM_ICPSC)
function TIM_BDTRConfig (line 2217) | void TIM_BDTRConfig(TIM_TypeDef* TIMx, TIM_BDTRInitTypeDef *TIM_BDTRInit...
function TIM_BDTRStructInit (line 2242) | void TIM_BDTRStructInit(TIM_BDTRInitTypeDef* TIM_BDTRInitStruct)
function TIM_CtrlPWMOutputs (line 2261) | void TIM_CtrlPWMOutputs(TIM_TypeDef* TIMx, FunctionalState NewState)
function TIM_SelectCOM (line 2286) | void TIM_SelectCOM(TIM_TypeDef* TIMx, FunctionalState NewState)
function TIM_CCPreloadControl (line 2311) | void TIM_CCPreloadControl(TIM_TypeDef* TIMx, FunctionalState NewState)
function TIM_ITConfig (line 2368) | void TIM_ITConfig(TIM_TypeDef* TIMx, uint16_t TIM_IT, FunctionalState Ne...
function TIM_GenerateEvent (line 2406) | void TIM_GenerateEvent(TIM_TypeDef* TIMx, uint16_t TIM_EventSource)
function FlagStatus (line 2439) | FlagStatus TIM_GetFlagStatus(TIM_TypeDef* TIMx, uint16_t TIM_FLAG)
function TIM_ClearFlag (line 2481) | void TIM_ClearFlag(TIM_TypeDef* TIMx, uint16_t TIM_FLAG)
function ITStatus (line 2509) | ITStatus TIM_GetITStatus(TIM_TypeDef* TIMx, uint16_t TIM_IT)
function TIM_ClearITPendingBit (line 2550) | void TIM_ClearITPendingBit(TIM_TypeDef* TIMx, uint16_t TIM_IT)
function TIM_DMAConfig (line 2587) | void TIM_DMAConfig(TIM_TypeDef* TIMx, uint16_t TIM_DMABase, uint16_t TIM...
function TIM_DMACmd (line 2614) | void TIM_DMACmd(TIM_TypeDef* TIMx, uint16_t TIM_DMASource, FunctionalSta...
function TIM_SelectCCDMA (line 2640) | void TIM_SelectCCDMA(TIM_TypeDef* TIMx, FunctionalState NewState)
function TIM_InternalClockConfig (line 2679) | void TIM_InternalClockConfig(TIM_TypeDef* TIMx)
function TIM_ITRxExternalClockConfig (line 2700) | void TIM_ITRxExternalClockConfig(TIM_TypeDef* TIMx, uint16_t TIM_InputTr...
function TIM_TIxExternalClockConfig (line 2730) | void TIM_TIxExternalClockConfig(TIM_TypeDef* TIMx, uint16_t TIM_TIxExter...
function TIM_ETRClockMode1Config (line 2770) | void TIM_ETRClockMode1Config(TIM_TypeDef* TIMx, uint16_t TIM_ExtTRGPresc...
function TIM_ETRClockMode2Config (line 2817) | void TIM_ETRClockMode2Config(TIM_TypeDef* TIMx, uint16_t TIM_ExtTRGPresc...
function TIM_SelectInputTrigger (line 2885) | void TIM_SelectInputTrigger(TIM_TypeDef* TIMx, uint16_t TIM_InputTrigger...
function TIM_SelectOutputTrigger (line 2928) | void TIM_SelectOutputTrigger(TIM_TypeDef* TIMx, uint16_t TIM_TRGOSource)
function TIM_SelectSlaveMode (line 2952) | void TIM_SelectSlaveMode(TIM_TypeDef* TIMx, uint16_t TIM_SlaveMode)
function TIM_SelectMasterSlaveMode (line 2975) | void TIM_SelectMasterSlaveMode(TIM_TypeDef* TIMx, uint16_t TIM_MasterSla...
function TIM_ETRConfig (line 3005) | void TIM_ETRConfig(TIM_TypeDef* TIMx, uint16_t TIM_ExtTRGPrescaler,
function TIM_EncoderInterfaceConfig (line 3063) | void TIM_EncoderInterfaceConfig(TIM_TypeDef* TIMx, uint16_t TIM_EncoderM...
function TIM_SelectHallSensor (line 3115) | void TIM_SelectHallSensor(TIM_TypeDef* TIMx, FunctionalState NewState)
function TIM_RemapConfig (line 3166) | void TIM_RemapConfig(TIM_TypeDef* TIMx, uint16_t TIM_Remap)
function TI1_Config (line 3197) | static void TI1_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint1...
function TI2_Config (line 3238) | static void TI2_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint1...
function TI3_Config (line 3280) | static void TI3_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint1...
function TI4_Config (line 3321) | static void TI4_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint1...
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_usart.c
function USART_DeInit (line 184) | void USART_DeInit(USART_TypeDef* USARTx)
function USART_Init (line 233) | void USART_Init(USART_TypeDef* USARTx, USART_InitTypeDef* USART_InitStruct)
function USART_StructInit (line 346) | void USART_StructInit(USART_InitTypeDef* USART_InitStruct)
function USART_ClockInit (line 366) | void USART_ClockInit(USART_TypeDef* USARTx, USART_ClockInitTypeDef* USAR...
function USART_ClockStructInit (line 397) | void USART_ClockStructInit(USART_ClockInitTypeDef* USART_ClockInitStruct)
function USART_Cmd (line 414) | void USART_Cmd(USART_TypeDef* USARTx, FunctionalState NewState)
function USART_SetPrescaler (line 440) | void USART_SetPrescaler(USART_TypeDef* USARTx, uint8_t USART_Prescaler)
function USART_OverSampling8Cmd (line 461) | void USART_OverSampling8Cmd(USART_TypeDef* USARTx, FunctionalState NewSt...
function USART_OneBitMethodCmd (line 487) | void USART_OneBitMethodCmd(USART_TypeDef* USARTx, FunctionalState NewState)
function USART_SendData (line 544) | void USART_SendData(USART_TypeDef* USARTx, uint16_t Data)
function USART_ReceiveData (line 560) | uint16_t USART_ReceiveData(USART_TypeDef* USARTx)
function USART_SetAddress (line 611) | void USART_SetAddress(USART_TypeDef* USARTx, uint8_t USART_Address)
function USART_ReceiverWakeUpCmd (line 631) | void USART_ReceiverWakeUpCmd(USART_TypeDef* USARTx, FunctionalState NewS...
function USART_WakeUpConfig (line 658) | void USART_WakeUpConfig(USART_TypeDef* USARTx, uint16_t USART_WakeUp)
function USART_LINBreakDetectLengthConfig (line 727) | void USART_LINBreakDetectLengthConfig(USART_TypeDef* USARTx, uint16_t US...
function USART_LINCmd (line 745) | void USART_LINCmd(USART_TypeDef* USARTx, FunctionalState NewState)
function USART_SendBreak (line 769) | void USART_SendBreak(USART_TypeDef* USARTx)
function USART_HalfDuplexCmd (line 822) | void USART_HalfDuplexCmd(USART_TypeDef* USARTx, FunctionalState NewState)
function USART_SetGuardTime (line 907) | void USART_SetGuardTime(USART_TypeDef* USARTx, uint8_t USART_GuardTime)
function USART_SmartCardCmd (line 926) | void USART_SmartCardCmd(USART_TypeDef* USARTx, FunctionalState NewState)
function USART_SmartCardNACKCmd (line 951) | void USART_SmartCardNACKCmd(USART_TypeDef* USARTx, FunctionalState NewSt...
function USART_IrDAConfig (line 1022) | void USART_IrDAConfig(USART_TypeDef* USARTx, uint16_t USART_IrDAMode)
function USART_IrDACmd (line 1040) | void USART_IrDACmd(USART_TypeDef* USARTx, FunctionalState NewState)
function USART_DMACmd (line 1086) | void USART_DMACmd(USART_TypeDef* USARTx, uint16_t USART_DMAReq, Function...
function USART_ITConfig (line 1214) | void USART_ITConfig(USART_TypeDef* USARTx, uint16_t USART_IT, Functional...
function FlagStatus (line 1278) | FlagStatus USART_GetFlagStatus(USART_TypeDef* USARTx, uint16_t USART_FLAG)
function USART_ClearFlag (line 1327) | void USART_ClearFlag(USART_TypeDef* USARTx, uint16_t USART_FLAG)
function ITStatus (line 1361) | ITStatus USART_GetITStatus(USART_TypeDef* USARTx, uint16_t USART_IT)
function USART_ClearITPendingBit (line 1435) | void USART_ClearITPendingBit(USART_TypeDef* USARTx, uint16_t USART_IT)
FILE: figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_wwdg.c
function WWDG_DeInit (line 140) | void WWDG_DeInit(void)
function WWDG_SetPrescaler (line 156) | void WWDG_SetPrescaler(uint32_t WWDG_Prescaler)
function WWDG_SetWindowValue (line 175) | void WWDG_SetWindowValue(uint8_t WindowValue)
function WWDG_EnableIT (line 198) | void WWDG_EnableIT(void)
function WWDG_SetCounter (line 210) | void WWDG_SetCounter(uint8_t Counter)
function WWDG_Enable (line 241) | void WWDG_Enable(uint8_t Counter)
function FlagStatus (line 268) | FlagStatus WWDG_GetFlagStatus(void)
function WWDG_ClearFlag (line 288) | void WWDG_ClearFlag(void)
FILE: figure-simulator-discovery/Utilities/STM32F4-Discovery/pdm_filter.h
type PDMFilter_InitStruct (line 44) | typedef struct {
FILE: figure-simulator-discovery/Utilities/STM32F4-Discovery/stm32f4_discovery.c
function STM_EVAL_LEDInit (line 122) | void STM_EVAL_LEDInit(Led_TypeDef Led)
function STM_EVAL_LEDOn (line 148) | void STM_EVAL_LEDOn(Led_TypeDef Led)
function STM_EVAL_LEDOff (line 163) | void STM_EVAL_LEDOff(Led_TypeDef Led)
function STM_EVAL_LEDToggle (line 178) | void STM_EVAL_LEDToggle(Led_TypeDef Led)
function STM_EVAL_PBInit (line 194) | void STM_EVAL_PBInit(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode)
function STM_EVAL_PBGetState (line 238) | uint32_t STM_EVAL_PBGetState(Button_TypeDef Button)
FILE: figure-simulator-discovery/Utilities/STM32F4-Discovery/stm32f4_discovery.h
type Led_TypeDef (line 55) | typedef enum
type Button_TypeDef (line 63) | typedef enum
type ButtonMode_TypeDef (line 68) | typedef enum
FILE: figure-simulator-discovery/Utilities/STM32F4-Discovery/stm32f4_discovery_lis302dl.c
function LIS302DL_Init (line 105) | void LIS302DL_Init(LIS302DL_InitTypeDef *LIS302DL_InitStruct)
function LIS302DL_FilterConfig (line 127) | void LIS302DL_FilterConfig(LIS302DL_FilterConfigTypeDef *LIS302DL_Filter...
function LIS302DL_InterruptConfig (line 153) | void LIS302DL_InterruptConfig(LIS302DL_InterruptConfigTypeDef *LIS302DL_...
function LIS302DL_LowpowerCmd (line 177) | void LIS302DL_LowpowerCmd(uint8_t LowPowerMode)
function LIS302DL_DataRateCmd (line 200) | void LIS302DL_DataRateCmd(uint8_t DataRateValue)
function LIS302DL_FullScaleCmd (line 223) | void LIS302DL_FullScaleCmd(uint8_t FS_value)
function LIS302DL_RebootCmd (line 243) | void LIS302DL_RebootCmd(void)
function LIS302DL_Write (line 263) | void LIS302DL_Write(uint8_t* pBuffer, uint8_t WriteAddr, uint16_t NumByt...
function LIS302DL_Read (line 297) | void LIS302DL_Read(uint8_t* pBuffer, uint8_t ReadAddr, uint16_t NumByteT...
function LIS302DL_ReadACC (line 332) | void LIS302DL_ReadACC(int32_t* out)
function LIS302DL_LowLevel_Init (line 368) | static void LIS302DL_LowLevel_Init(void)
function LIS302DL_SendByte (line 453) | static uint8_t LIS302DL_SendByte(uint8_t byte)
function LIS302DL_TIMEOUT_UserCallback (line 482) | uint32_t LIS302DL_TIMEOUT_UserCallback(void)
FILE: figure-simulator-discovery/Utilities/STM32F4-Discovery/stm32f4_discovery_lis302dl.h
type LIS302DL_InitTypeDef (line 58) | typedef struct
type LIS302DL_FilterConfigTypeDef (line 68) | typedef struct
type LIS302DL_InterruptConfigTypeDef (line 76) | typedef struct
FILE: figure-simulator-discovery/src/main.c
function EXTILine0_Config (line 54) | void EXTILine0_Config(void)
function EXTI0_IRQHandler (line 333) | void EXTI0_IRQHandler() {
function EXTI1_IRQHandler (line 358) | void EXTI1_IRQHandler() {
function main (line 454) | int main(void)
FILE: figure-simulator-discovery/src/stm32f4xx_it.c
function NMI_Handler (line 47) | void NMI_Handler(void)
function HardFault_Handler (line 56) | void HardFault_Handler(void)
function MemManage_Handler (line 69) | void MemManage_Handler(void)
function BusFault_Handler (line 82) | void BusFault_Handler(void)
function UsageFault_Handler (line 95) | void UsageFault_Handler(void)
function SVC_Handler (line 108) | void SVC_Handler(void)
function DebugMon_Handler (line 117) | void DebugMon_Handler(void)
function PendSV_Handler (line 126) | void PendSV_Handler(void)
function SysTick_Handler (line 135) | void SysTick_Handler(void)
FILE: figure-simulator-discovery/src/system_stm32f4xx.c
function SystemInit (line 204) | void SystemInit(void)
function SystemCoreClockUpdate (line 282) | void SystemCoreClockUpdate(void)
function SetSysClock (line 338) | static void SetSysClock(void)
function SystemInit_ExtMemCtl (line 425) | void SystemInit_ExtMemCtl(void)
FILE: figure-simulator-discovery/src/tiny_printf.c
function ts_itoa (line 65) | void ts_itoa(char **buf, unsigned int d, int base)
function ts_formatstring (line 89) | int ts_formatstring(char *buf, const char *fmt, va_list va)
function ts_formatlength (line 155) | int ts_formatlength(const char *fmt, va_list va)
function sprintf (line 210) | int sprintf(char *buf, const char *fmt, ...)
function fprintf (line 227) | int fprintf(FILE * stream, const char *fmt, ...)
function printf (line 252) | int printf(const char *fmt, ...)
function fputs (line 277) | int fputs(const char *s, FILE *fp)
function puts (line 307) | int puts(const char *s)
FILE: imageformats/conv.py
function tofourbit (line 10) | def tofourbit(a):
function conv (line 21) | def conv(a):
Condensed preview — 248 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (5,118K chars).
[
{
"path": "IR/README.txt",
"chars": 220,
"preview": "IR.pde -- Arduino code for IR that sends the first request repeatedly, and waits for a listening Tamagotchi\r\nIR2.pde -- "
},
{
"path": "IR/ir.pde",
"chars": 5687,
"preview": "#define BIT_IS_SET(i, bits) (1 << i & bits)\r\n\r\n// LED connected to digital pin 13\r\nconst int LED_PIN = 13;\r\n// Width of"
},
{
"path": "IR/ir2.pde",
"chars": 5984,
"preview": "/* Control a Lutron Maestro light dimmer */\r\n#define BIT_IS_SET(i, bits) (1 << i & bits)\r\n\r\n// LED connected to digital"
},
{
"path": "README",
"chars": 569,
"preview": "Repository for Tamagotchi hacking code!\r\n\r\nDirectories:\r\n\r\n\t/demos/ - Discovery board demos\r\n\t/devtools/ - Tamagotchi de"
},
{
"path": "RFIDler/tama.py",
"chars": 1909,
"preview": "import RFIDler\r\nimport sys\r\nimport time\r\n\r\npacket1 = [0xf0, 0, 0x0f, 1, 0, 0x2e, 0x25, 0, 2 , 0x80, 2, 0x7, 8, 0x01, 0x8"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/LCD.c",
"chars": 4608,
"preview": "//-----------------------------------------------------------------------------\r\n// This code is licensed to you under t"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/LCD.h",
"chars": 3353,
"preview": "//-----------------------------------------------------------------------------\r\n// This code is licensed to you under t"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/Makefile",
"chars": 2937,
"preview": "#-----------------------------------------------------------------------------\r\n# This code is licensed to you under the"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/appmain.c",
"chars": 27471,
"preview": "//-----------------------------------------------------------------------------\r\n// Jonathan Westhues, Mar 2006\r\n// Edit"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/apps.h",
"chars": 8479,
"preview": "//-----------------------------------------------------------------------------\r\n// Jonathan Westhues, Aug 2005\r\n// Gerh"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/crapto1.c",
"chars": 13693,
"preview": "/* crapto1.c\r\n\r\n This program is free software; you can redistribute it and/or\r\n modify it under the terms of the"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/crapto1.h",
"chars": 3094,
"preview": "/* crapto1.h\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GN"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/crypto1.c",
"chars": 2527,
"preview": "/* crypto1.c\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GN"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/epa.c",
"chars": 13708,
"preview": "//-----------------------------------------------------------------------------\n// Frederik Möllers - August 2012\n//\n// "
},
{
"path": "TamagotchiFriends/proxmark/armsrc/epa.h",
"chars": 1281,
"preview": "//-----------------------------------------------------------------------------\n// Frederik Möllers - August 2012\n//\n// "
},
{
"path": "TamagotchiFriends/proxmark/armsrc/fonts.c",
"chars": 19114,
"preview": "//-----------------------------------------------------------------------------\r\n// This code is licensed to you under t"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/fonts.h",
"chars": 601,
"preview": "//-----------------------------------------------------------------------------\r\n// This code is licensed to you under t"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/fpgaloader.c",
"chars": 15098,
"preview": "//-----------------------------------------------------------------------------\r\n// Jonathan Westhues, April 2006\r\n//\r\n/"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/hitag2.c",
"chars": 42906,
"preview": "//-----------------------------------------------------------------------------\r\n// This code is licensed to you under t"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/iclass.c",
"chars": 39558,
"preview": "//-----------------------------------------------------------------------------\n// Gerhard de Koning Gans - May 2008\n// "
},
{
"path": "TamagotchiFriends/proxmark/armsrc/iso14443.c",
"chars": 40093,
"preview": "//-----------------------------------------------------------------------------\r\n// Jonathan Westhues, split Nov 2006\r\n/"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/iso14443a.c",
"chars": 76816,
"preview": "//-----------------------------------------------------------------------------\r\n// Merlok - June 2011, 2012\r\n// Gerhard"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/iso14443a.h",
"chars": 2715,
"preview": "//-----------------------------------------------------------------------------\n// Merlok - June 2011\n// Gerhard de Koni"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/iso15693.c",
"chars": 38262,
"preview": "//-----------------------------------------------------------------------------\r\n// Jonathan Westhues, split Nov 2006\r\n/"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/ldscript",
"chars": 1352,
"preview": "/*\r\n-----------------------------------------------------------------------------\r\n This code is licensed to you under t"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/legicrf.c",
"chars": 22932,
"preview": "//-----------------------------------------------------------------------------\r\n// (c) 2009 Henryk Plötz <henryk@ploetz"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/legicrf.h",
"chars": 751,
"preview": "//-----------------------------------------------------------------------------\r\n// (c) 2009 Henryk Plötz <henryk@ploetz"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/lfops.c",
"chars": 51527,
"preview": "//-----------------------------------------------------------------------------\r\n// This code is licensed to you under t"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/lfops_rcv_works.txt",
"chars": 51465,
"preview": "//-----------------------------------------------------------------------------\r\n// This code is licensed to you under t"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/mifarecmd.c",
"chars": 25840,
"preview": "//-----------------------------------------------------------------------------\r\n// Merlok - June 2011, 2012\r\n// Gerhard"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/mifarecmd.h",
"chars": 819,
"preview": "//-----------------------------------------------------------------------------\r\n// Merlok - June 2011\r\n// Gerhard de Ko"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/mifaresniff.c",
"chars": 4671,
"preview": "//-----------------------------------------------------------------------------\r\n// Merlok - 2012\r\n//\r\n// This code is l"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/mifaresniff.h",
"chars": 1319,
"preview": "//-----------------------------------------------------------------------------\r\n// Merlok - June 2012\r\n//\r\n// This code"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/mifareutil.c",
"chars": 11082,
"preview": "//-----------------------------------------------------------------------------\r\n// Merlok, May 2011, 2012\r\n// Many auth"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/mifareutil.h",
"chars": 3761,
"preview": "//-----------------------------------------------------------------------------\r\n// Merlok, May 2011\r\n// Many authors, t"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/appmain.d",
"chars": 368,
"preview": "obj/appmain.d obj/appmain.o: appmain.c ../common/usb_cdc.h \\\r\n ../include/common.h stdint.h ../include/at91sam7s512.h .."
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/cmd.d",
"chars": 245,
"preview": "obj/cmd.d obj/cmd.o: ../common/cmd.c ../common/cmd.h ../include/common.h \\\r\n stdint.h ../include/at91sam7s512.h ../inclu"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/crapto1.d",
"chars": 59,
"preview": "obj/crapto1.d obj/crapto1.o: crapto1.c crapto1.h stdint.h\r\n"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/crc.d",
"chars": 64,
"preview": "obj/crc.d obj/crc.o: ../common/crc.c ../include/crc.h stdint.h\r\n"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/crc16.d",
"chars": 62,
"preview": "obj/crc16.d obj/crc16.o: ../common/crc16.c ../common/crc16.h\r\n"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/crypto1.d",
"chars": 59,
"preview": "obj/crypto1.d obj/crypto1.o: crypto1.c crapto1.h stdint.h\r\n"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/epa.d",
"chars": 396,
"preview": "obj/epa.d obj/epa.o: epa.c iso14443a.h ../include/common.h stdint.h \\\r\n ../include/at91sam7s512.h mifaresniff.h ../inclu"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/fpgaimage.s19",
"chars": 126582,
"preview": "S01400006F626A2F66706761696D6167652E733139D5\r\nS3150000200000090FF00FF00FF00FF000000161001053\r\nS31500002010667067612D706C"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/fpgaloader.d",
"chars": 298,
"preview": "obj/fpgaloader.d obj/fpgaloader.o: fpgaloader.c ../include/proxmark3.h \\\r\n ../include/at91sam7s512.h ../include/config_g"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/hitag2.d",
"chars": 286,
"preview": "obj/hitag2.d obj/hitag2.o: hitag2.c ../include/proxmark3.h \\\r\n ../include/at91sam7s512.h ../include/config_gpio.h ../inc"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/iclass.d",
"chars": 310,
"preview": "obj/iclass.d obj/iclass.o: iclass.c ../include/proxmark3.h \\\r\n ../include/at91sam7s512.h ../include/config_gpio.h ../inc"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/iso14443.d",
"chars": 316,
"preview": "obj/iso14443.d obj/iso14443.o: iso14443.c ../include/proxmark3.h \\\r\n ../include/at91sam7s512.h ../include/config_gpio.h "
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/iso14443a.d",
"chars": 408,
"preview": "obj/iso14443a.d obj/iso14443a.o: iso14443a.c ../include/proxmark3.h \\\r\n ../include/at91sam7s512.h ../include/config_gpio"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/iso14443crc.d",
"chars": 149,
"preview": "obj/iso14443crc.d obj/iso14443crc.o: ../common/iso14443crc.c \\\r\n ../common/iso14443crc.h ../include/common.h stdint.h \\\r"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/iso15693.d",
"chars": 354,
"preview": "obj/iso15693.d obj/iso15693.o: iso15693.c ../include/proxmark3.h \\\r\n ../include/at91sam7s512.h ../include/config_gpio.h "
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/iso15693tools.d",
"chars": 180,
"preview": "obj/iso15693tools.d obj/iso15693tools.o: ../common/iso15693tools.c \\\r\n ../include/proxmark3.h ../include/at91sam7s512.h "
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/legic_prng.d",
"chars": 96,
"preview": "obj/legic_prng.d obj/legic_prng.o: ../common/legic_prng.c \\\r\n ../include/legic_prng.h stdint.h\r\n"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/legicrf.d",
"chars": 340,
"preview": "obj/legicrf.d obj/legicrf.o: legicrf.c ../include/proxmark3.h \\\r\n ../include/at91sam7s512.h ../include/config_gpio.h ../"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/lfops.d",
"chars": 301,
"preview": "obj/lfops.d obj/lfops.o: lfops.c ../include/proxmark3.h \\\r\n ../include/at91sam7s512.h ../include/config_gpio.h ../includ"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/mifarecmd.d",
"chars": 384,
"preview": "obj/mifarecmd.d obj/mifarecmd.o: mifarecmd.c mifarecmd.h \\\r\n ../include/proxmark3.h ../include/at91sam7s512.h \\\r\n ../inc"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/mifaresniff.d",
"chars": 378,
"preview": "obj/mifaresniff.d obj/mifaresniff.o: mifaresniff.c mifaresniff.h \\\r\n ../include/proxmark3.h ../include/at91sam7s512.h \\\r"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/mifareutil.d",
"chars": 375,
"preview": "obj/mifareutil.d obj/mifareutil.o: mifareutil.c ../include/proxmark3.h \\\r\n ../include/at91sam7s512.h ../include/config_g"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/osimage.s19",
"chars": 259548,
"preview": "S01200006F626A2F6F73696D6167652E73313993\r\nS3150001000008B50B4B0B495A1E581C00238A4202D2D3\r\nS315000100101370031CF6E7084A08"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/printf.d",
"chars": 121,
"preview": "obj/printf.d obj/printf.o: printf.c printf.h util.h stdint.h \\\r\n ../include/common.h ../include/at91sam7s512.h string.h\r"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/start.d",
"chars": 263,
"preview": "obj/start.d obj/start.o: start.c ../include/proxmark3.h \\\r\n ../include/at91sam7s512.h ../include/config_gpio.h ../includ"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/string.d",
"chars": 55,
"preview": "obj/string.d obj/string.o: string.c string.h stdint.h\r\n"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/usb_cdc.d",
"chars": 158,
"preview": "obj/usb_cdc.d obj/usb_cdc.o: ../common/usb_cdc.c ../common/usb_cdc.h \\\r\n ../include/common.h stdint.h ../include/at91sam"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/obj/util.d",
"chars": 205,
"preview": "obj/util.d obj/util.o: util.c ../include/proxmark3.h \\\r\n ../include/at91sam7s512.h ../include/config_gpio.h ../include/u"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/printf.c",
"chars": 10288,
"preview": "/*-\n * Copyright (c) 1986, 1988, 1991, 1993\n *\tThe Regents of the University of California. All rights reserved.\n * (c)"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/printf.h",
"chars": 879,
"preview": "//-----------------------------------------------------------------------------\n// Copyright (C) 2010 Hector Martin \"mar"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/start.c",
"chars": 1107,
"preview": "//-----------------------------------------------------------------------------\n// Jonathan Westhues, Mar 2006\n//\n// Thi"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/stdint.h",
"chars": 945,
"preview": "//-----------------------------------------------------------------------------\n// Copyright (C) 2010 Hector Martin \"mar"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/string.c",
"chars": 2294,
"preview": "//-----------------------------------------------------------------------------\n// Jonathan Westhues, Sept 2005\n//\n// Th"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/string.h",
"chars": 945,
"preview": "//-----------------------------------------------------------------------------\n// Jonathan Westhues, Aug 2005\n// Copyri"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/util.c",
"chars": 10740,
"preview": "//-----------------------------------------------------------------------------\n// Jonathan Westhues, Sept 2005\n//\n// Th"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/util.h",
"chars": 1526,
"preview": "//-----------------------------------------------------------------------------\n// Jonathan Westhues, Aug 2005\n//\n// Thi"
},
{
"path": "TamagotchiFriends/proxmark/armsrc/version.c",
"chars": 252,
"preview": "#include \"proxmark3.h\"\r\n/* Generated file, do not edit */\r\nconst struct version_information __attribute__((section(\".ver"
},
{
"path": "TamagotchiOn/tasmgotchi/demos/waitforbutton/myassembly.txt",
"chars": 3161,
"preview": "PUSH {R4-R8,LR}\nSUB SP, SP, #0x20\nMOV R0, #9\nLDR R3, =(set_image_mode+1)\n"
},
{
"path": "TamagotchiOn/tasmgotchi/demos/waitforbutton/myimages.txt",
"chars": 278,
"preview": "violetchi\t/home/natashenka/Documents/violetchi_tama.bmp\ncheck\t\t/home/natashenka/Documents/check.bmp\nximg\t\t/home/natashen"
},
{
"path": "TamagotchiOn/tasmgotchi/makegame.py",
"chars": 3524,
"preview": "import sys\ntry:\n\timport armasm\nexcept:\n\tprint \"armasm is required https://github.com/stephanh42/armasm\"\ntry:\n\timport Ima"
},
{
"path": "codedump/README.txt",
"chars": 474,
"preview": "Code Dump Files\r\n\r\nbinbits -- First 0x100 bytes of Tama code in binary\r\ndecode.py -- SPI decoding code (not used)\r\nfirst"
},
{
"path": "codedump/decode.py",
"chars": 628,
"preview": "f = open(\"c.csv\", 'r')\r\no = open(\"c.bin\", 'w')\r\n\r\nl = f.readlines()\r\nbegin = True\r\nstate = 1\r\nval = 0\r\ncount = 8\r\nc = 0\r"
},
{
"path": "codedump/first100.txt",
"chars": 9868,
"preview": " * = 0000\r\n0000 78 SEI\r\n0001 A2 FF LDX #$FF\r\n0003 9A TXS\r\n0004 A9 FF "
},
{
"path": "codedump/ports.txt",
"chars": 910,
"preview": "Port\tFunction\t\t\t\t\tSource\r\n \r\n3000\tROM page\t\t\t\t\tTamagotchi ROM dump (tested)\r\n3001\tClock Control\t\t\t\t\tData sheet\r\n3002\tOsc"
},
{
"path": "codedump/tf/eeprom5cd/eeprom5cd.ino",
"chars": 8226,
"preview": " #include <Wire.h> //I2C library\n\n byte somedata[]= { 0x0, 0xaa, 0x55, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0"
},
{
"path": "codedump/tf/glitch2/glitch2.ino",
"chars": 895,
"preview": "/*\n Blink\n Turns on an LED on for one second, then off for one second, repeatedly.\n \n This example code is in the pub"
},
{
"path": "demos/README",
"chars": 354,
"preview": "Figure simulator demos\r\n\r\nfacemain.c -- displays a picture \r\nnataliemain.c -- displays an animation\r\nnsdemomain.c -- dis"
},
{
"path": "demos/facemain.c",
"chars": 176670,
"preview": "/**\r\n ******************************************************************************\r\n * @file main.c\r\n * @author "
},
{
"path": "demos/nataliemain.c",
"chars": 174832,
"preview": "/**\r\n ******************************************************************************\r\n * @file main.c\r\n * @author "
},
{
"path": "demos/nsdemomain.c",
"chars": 169154,
"preview": "/**\r\n ******************************************************************************\r\n * @file main.c\r\n * @author "
},
{
"path": "devtools/itemmake/README",
"chars": 1523,
"preview": "Tamagotchi Item Maker!\r\n\r\nMakes a flash image for a Tamagotchi item from a script. See the sample script as an example.\r"
},
{
"path": "devtools/itemmake/itemmake.py",
"chars": 3131,
"preview": "import sys\r\nimport Image\r\n\r\ndef tofourbit(a):\r\n\t#print a\r\n\tif ((a > -1) and (a < 1)):\r\n\t\treturn 3;\r\n\tif ((a > 0) and (a "
},
{
"path": "devtools/itemmake/samplescript.txt",
"chars": 11302,
"preview": "SOUND MULTIPLIER:\r\n\r\n2\r\n\r\nIMAGE TABLE:\r\n\r\nC:\\Users\\Natalie\\Pictures\\madworld\\mad.bmp\r\nC:\\Users\\Natalie\\Pictures\\madworld"
},
{
"path": "die/README",
"chars": 247,
"preview": "Repository for Tamagotchi chip photos!\r\n\r\nFiles:\r\n\r\n\tlogo.jpg -- close up of the only logo on the die\r\n\ttamatowntamago.j"
},
{
"path": "disassembler/README",
"chars": 481,
"preview": "Very rudimentary script to detect and disassemble GeneralPlus (SunPlus) bytecode in a binary\r\n\r\nDecodes 'standard'(accor"
},
{
"path": "disassembler/a.txt",
"chars": 26740,
"preview": "assembly found, size 61 index 21253\r\nAND (85) 85 85 \r\nAND (85) 85 85 \r\nAND (85) 90 149 \r\nAND (85) 85 85 \r\nAND (85) 8"
},
{
"path": "disassembler/bytecode.txt",
"chars": 5104,
"preview": "001: ADC #dd ADC A,dd 69H 56H 2 2 cpu3 ; immediate\r\n002: ADC aa ADC A,(aa) 65H 17H 2 3"
},
{
"path": "disassembler/bytecoden.txt",
"chars": 11174,
"preview": "001: ADC #dd ADC A,dd 69H 56H 2 2 cpu3 ; immediate\r\n002: ADC aa ADC A,(aa) 65H 17H 2 3"
},
{
"path": "disassembler/bytecoder.txt",
"chars": 5177,
"preview": " NO: SYNTAX 6502: SYNTAX 2500: 6502 SUN b c type addressing modes\r\n001: ADC #dd ADC A,dd 69H 56H 2 2 cp"
},
{
"path": "disassembler/bytecodes.txt",
"chars": 4659,
"preview": " NO: SYNTAX 6502: SYNTAX 2500: 6502 SUN b c type addressing modes\r\n001: ADC #dd ADC A,dd 69H 56H 2 2 cp"
},
{
"path": "disassembler/dissa.py",
"chars": 1525,
"preview": "a = open(\"bytecoden.txt\")\r\n\r\nf = a.read()\r\nf = f[f.find(\"001:\"):]\r\nt = f.split()\r\n\r\nops = []\r\no6502 = []\r\nosun = []\r\nb ="
},
{
"path": "figure/Arduino/ClientSide/README.txt",
"chars": 62,
"preview": "ser.py -- ROM/Flash dump client\r\nserw.py -- Flash write client"
},
{
"path": "figure/Arduino/ClientSide/ser.py",
"chars": 565,
"preview": "import serial\r\nimport time\r\n\r\n#enter your device file\r\narddev = 'COM5'\r\nbaud = 9600\r\n\r\n#setup - if a Serial object can't"
},
{
"path": "figure/Arduino/ClientSide/serw.py",
"chars": 911,
"preview": "import serial\r\nimport time\r\n\r\n#enter your device file\r\narddev = 'COM5'\r\nbaud = 115200\r\n\r\n#setup - if a Serial object can"
},
{
"path": "figure/Arduino/GeneralPlusRomDump/GeneralPlusRomDump.ino",
"chars": 3074,
"preview": "#define DATAOUT 11//MOSI\n#define DATAIN 12//MISO \n#define SPICLOCK 13//sck\n#define SLAVESELECT 10//ss\n\n//opcodes\n#defi"
},
{
"path": "figure/Arduino/GeneralPlusRomWrite/GeneralPlusRomWrite.ino",
"chars": 3897,
"preview": "#define DATAOUT 11//MOSI\n#define DATAIN 12//MISO \n#define SPICLOCK 13//sck\n#define SLAVESELECT 10//ss\n\n//opcodes\n#defi"
},
{
"path": "figure/Arduino/README.txt",
"chars": 174,
"preview": "GeneralPlusRomDump.pde -- Dumps a GeneralPlus Low Power SPI ROM\r\nGeneralPlusRomWrite.pde -- Dumps GeneralPlus SPI Flash\r"
},
{
"path": "figure/README",
"chars": 177,
"preview": "Figure code\r\n\r\n/Arduino -- Arduino code to dump and write memory\r\n/ROMDump -- Actual ROM dumps\r\n/scripts -- Misc scripts"
},
{
"path": "figure/ROMDump/README",
"chars": 249,
"preview": "ROM dumps\r\n\r\n/imgs/ - images extracted from the Memetchi figure dump\r\n/makikoimgs/ - images extracted from a Makiko figu"
},
{
"path": "figure/ROMDump/imgs/adds.txt",
"chars": 19515,
"preview": "20 20\r\nimg 0 at 2884\r\n20 20\r\nimg 1 at 2986\r\n20 20\r\nimg 2 at 3088\r\n20 20\r\nimg 3 at 3190\r\n20 20\r\nimg 4 at 3292\r\n20 20\r\nimg"
},
{
"path": "figure/SignalPulls/README",
"chars": 282,
"preview": "Signal Pulls\r\n\r\nempire.txt -- Reads when doing USA tour (the NY tour version)\r\nsignaldecode.py -- takes signal analyzer "
},
{
"path": "figure/SignalPulls/empire.txt",
"chars": 135127,
"preview": "here\r\nTime [s],Packet ID,MOSI,MISO\r\n\r\nBREAK\r\n1\r\n2a8\r\n2af2\r\n2af4\r\n2af8\r\n2afc\r\n2b00\r\n2b04\r\n2b08\r\n2b0c\r\n2b10\r\n2b14\r\n2b18\r\n2"
},
{
"path": "figure/SignalPulls/signaldecode.py",
"chars": 381,
"preview": "f = open(\"clock.csv\")\r\nl = []\r\nt = 0\r\nt= f.readline()\r\nprint \"here\"\r\nprint t\r\nwhile(True):\r\n\ttry:\r\n\t\tt= f.readline()\r\n\t\t"
},
{
"path": "figure/SignalPulls/usatour.txt",
"chars": 135357,
"preview": "here\r\nTime [s],Packet ID,MOSI,MISO\r\n\r\nBREAK\r\n1\r\n2a8\r\n2af2//load usa logo\r\n2af4\r\n2af8\r\n2afc\r\n2b00\r\n2b04\r\n2b08\r\n2b0c\r\n2b10"
},
{
"path": "figure/SignalPulls/usatourbuy.txt",
"chars": 1458,
"preview": "here\r\nTime [s],Packet ID,MOSI,MISO\r\n\r\nBREAK\r\n1\r\nbf\r\n2300\r\n2302\r\n2307\r\n230c\r\n2311\r\n2316\r\n231b\r\n2320\r\n2325\r\n232a\r\n232f\r\n23"
},
{
"path": "figure/scripts/README",
"chars": 38,
"preview": "im.py -- extracts images from ROM dump"
},
{
"path": "figure/scripts/im.py",
"chars": 1273,
"preview": "import Image\r\n\r\nf = open(\"C:\\\\Users\\\\Natalie\\\\Downloads\\\\Tamagotchi-Hack-master\\\\figure\\\\ROMDump\\\\makiko\", 'rb')\r\n\r\na = "
},
{
"path": "figure/scripts/l.txt",
"chars": 18891,
"preview": "48 31\r\nPadded to 48 by 31\r\nimg 0 at 5807\r\n48 31\r\nPadded to 48 by 31\r\nimg 1 at 6181\r\n48 31\r\nPadded to 48 by 31\r\nimg 2 at "
},
{
"path": "figure-simulator/README",
"chars": 48,
"preview": "Code to simulate a memetchi figure. In progress."
},
{
"path": "figure-simulator/simulator.pde",
"chars": 3008,
"preview": "#include <DSPI.h>\n\nDSPI0 spi;\nconst int len = 200;\nuint8_t rgbSnd[len] = {0};\nuint8_t rgbRcv[len] = {0};\nuint8_t b"
},
{
"path": "figure-simulator-discovery/.cproject",
"chars": 28436,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<?fileVersion 4.0.0?><cproject storage_type_id=\"org.eclipse.cdt."
},
{
"path": "figure-simulator-discovery/.project",
"chars": 2136,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<projectDescription>\r\n\t<name>spi</name>\r\n\t<comment></comment>\r\n\t<projects>\r\n\t</p"
},
{
"path": "figure-simulator-discovery/.settings/com.atollic.truestudio.debug.hardware_device.prefs",
"chars": 264,
"preview": "#Sun Dec 16 21:31:24 EST 2012\r\nBOARD=STM32F4_Discovery\r\nCODE_LOCATION=FLASH\r\nENDIAN=Little-endian\r\nMCU=STM32F407VG\r\nMCU_"
},
{
"path": "figure-simulator-discovery/.settings/org.eclipse.cdt.managedbuilder.core.prefs",
"chars": 2232,
"preview": "#Sat Dec 22 00:56:48 EST 2012\r\neclipse.preferences.version=1\r\nenvironment/buildEnvironmentInclude/com.atollic.truestudio"
},
{
"path": "figure-simulator-discovery/Libraries/CMSIS/Include/arm_common_tables.h",
"chars": 1120,
"preview": "/* ---------------------------------------------------------------------- \r\n* Copyright (C) 2010 ARM Limited. All rights"
},
{
"path": "figure-simulator-discovery/Libraries/CMSIS/Include/arm_math.h",
"chars": 240326,
"preview": "/* ---------------------------------------------------------------------- \r\n * Copyright (C) 2010 ARM Limited. All rig"
},
{
"path": "figure-simulator-discovery/Libraries/CMSIS/Include/core_cm4.h",
"chars": 79281,
"preview": "/**************************************************************************//**\r\n * @file core_cm4.h\r\n * @brief C"
},
{
"path": "figure-simulator-discovery/Libraries/CMSIS/Include/core_cm4_simd.h",
"chars": 23979,
"preview": "/**************************************************************************//**\r\n * @file core_cm4_simd.h\r\n * @brief"
},
{
"path": "figure-simulator-discovery/Libraries/CMSIS/Include/core_cmFunc.h",
"chars": 15691,
"preview": "/**************************************************************************//**\r\n * @file core_cmFunc.h\r\n * @brief "
},
{
"path": "figure-simulator-discovery/Libraries/CMSIS/Include/core_cmInstr.h",
"chars": 16108,
"preview": "/**************************************************************************//**\r\n * @file core_cmInstr.h\r\n * @brief "
},
{
"path": "figure-simulator-discovery/Libraries/Device/STM32F4xx/Include/stm32f4xx.h",
"chars": 530854,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx.h\r\n * @au"
},
{
"path": "figure-simulator-discovery/Libraries/Device/STM32F4xx/Include/system_stm32f4xx.h",
"chars": 2222,
"preview": "/**\r\n ******************************************************************************\r\n * @file system_stm32f4xx.h\r\n"
},
{
"path": "figure-simulator-discovery/Libraries/Device/STM32F4xx/Release_Notes.html",
"chars": 20549,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:o=\"u"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/Release_Notes.html",
"chars": 49555,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:o=\"u"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/misc.h",
"chars": 6923,
"preview": "/**\r\n ******************************************************************************\r\n * @file misc.h\r\n * @author "
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_adc.h",
"chars": 32548,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_adc.h\r\n *"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_can.h",
"chars": 27317,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_can.h\r\n *"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_crc.h",
"chars": 2415,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_crc.h\r\n *"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_cryp.h",
"chars": 12659,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_cryp.h\r\n "
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dac.h",
"chars": 14945,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_dac.h\r\n *"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dbgmcu.h",
"chars": 4295,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_dbgmcu.h\r\n"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dcmi.h",
"chars": 12976,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_dcmi.h\r\n "
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dma.h",
"chars": 28879,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_dma.h\r\n *"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_exti.h",
"chars": 8011,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_exti.h\r\n "
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_flash.h",
"chars": 14594,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_flash.h\r\n "
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_fsmc.h",
"chars": 27175,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_fsmc.h\r\n "
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_gpio.h",
"chars": 17700,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_gpio.h\r\n "
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_hash.h",
"chars": 9083,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_hash.h\r\n "
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_i2c.h",
"chars": 31645,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_i2c.h\r\n *"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_iwdg.h",
"chars": 4322,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_iwdg.h\r\n "
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_pwr.h",
"chars": 6153,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_pwr.h\r\n *"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_rcc.h",
"chars": 24873,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_rcc.h\r\n *"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_rng.h",
"chars": 3957,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_rng.h\r\n *"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_rtc.h",
"chars": 40544,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_rtc.h\r\n *"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_sdio.h",
"chars": 22776,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_sdio.h\r\n "
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_spi.h",
"chars": 20778,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_spi.h\r\n *"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_syscfg.h",
"chars": 7227,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_syscfg.h\r\n"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_tim.h",
"chars": 51688,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_tim.h\r\n *"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_usart.h",
"chars": 17801,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_usart.h\r\n "
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_wwdg.h",
"chars": 3541,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_wwdg.h\r\n "
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/misc.c",
"chars": 11442,
"preview": "/**\r\n ******************************************************************************\r\n * @file misc.c\r\n * @author "
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_adc.c",
"chars": 68402,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_adc.c\r\n *"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_can.c",
"chars": 60056,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_can.c\r\n *"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_crc.c",
"chars": 3595,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_crc.c\r\n *"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_cryp.c",
"chars": 32716,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_cryp.c\r\n "
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_cryp_aes.c",
"chars": 21778,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_cryp_aes.c"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_cryp_des.c",
"chars": 9489,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_cryp_des.c"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_cryp_tdes.c",
"chars": 10213,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_cryp_tdes."
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dac.c",
"chars": 27121,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_dac.c\r\n *"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dbgmcu.c",
"chars": 6808,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_dbgmcu.c\r\n"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dcmi.c",
"chars": 18997,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_dcmi.c\r\n "
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dma.c",
"chars": 52695,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_dma.c\r\n *"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_exti.c",
"chars": 10346,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_exti.c\r\n "
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_flash.c",
"chars": 38039,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_flash.c\r\n "
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_fsmc.c",
"chars": 41888,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_fsmc.c\r\n "
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_gpio.c",
"chars": 21187,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_gpio.c\r\n "
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_hash.c",
"chars": 26216,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_hash.c\r\n "
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_hash_md5.c",
"chars": 9675,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_hash_md5.c"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_hash_sha1.c",
"chars": 9871,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_hash_sha1."
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_i2c.c",
"chars": 52812,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_i2c.c\r\n *"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_iwdg.c",
"chars": 9671,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_iwdg.c\r\n "
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_pwr.c",
"chars": 25222,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_pwr.c\r\n *"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c",
"chars": 74781,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_rcc.c\r\n *"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rng.c",
"chars": 14140,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_rng.c\r\n *"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rtc.c",
"chars": 104477,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_rtc.c\r\n *"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_sdio.c",
"chars": 39827,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_sdio.c\r\n "
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_spi.c",
"chars": 51850,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_spi.c\r\n *"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_syscfg.c",
"chars": 7603,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_syscfg.c\r\n"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_tim.c",
"chars": 125490,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_tim.c\r\n *"
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_usart.c",
"chars": 56804,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_usart.c\r\n "
},
{
"path": "figure-simulator-discovery/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_wwdg.c",
"chars": 10791,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4xx_wwdg.c\r\n "
},
{
"path": "figure-simulator-discovery/README",
"chars": 160,
"preview": "Figure simulator for STM32F4 Discovery board. Builds with Atollic\r\n\r\nQuestions? Comments? Contributions? \r\n\r\nContact: na"
},
{
"path": "figure-simulator-discovery/Utilities/STM32F4-Discovery/Release_Notes.html",
"chars": 16090,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:o=\"u"
},
{
"path": "figure-simulator-discovery/Utilities/STM32F4-Discovery/pdm_filter.h",
"chars": 2990,
"preview": "/**\r\n ******************************************************************************\r\n * @file pdm_filter.h\r\n * @a"
},
{
"path": "figure-simulator-discovery/Utilities/STM32F4-Discovery/stm32f4_discovery.c",
"chars": 7454,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4_discovery.c\r"
},
{
"path": "figure-simulator-discovery/Utilities/STM32F4-Discovery/stm32f4_discovery.h",
"chars": 4230,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4_discovery.h\r"
},
{
"path": "figure-simulator-discovery/Utilities/STM32F4-Discovery/stm32f4_discovery_lis302dl.c",
"chars": 16117,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4_discovery_li"
},
{
"path": "figure-simulator-discovery/Utilities/STM32F4-Discovery/stm32f4_discovery_lis302dl.h",
"chars": 32323,
"preview": "/**\r\n ******************************************************************************\r\n * @file stm32f4_discovery_li"
},
{
"path": "figure-simulator-discovery/spi.elf.launch",
"chars": 4815,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<launchConfiguration type=\"com.atollic.hardwaredebug.launch.laun"
},
{
"path": "figure-simulator-discovery/src/main.c",
"chars": 183377,
"preview": "/**\r\n ******************************************************************************\r\n * @file main.c\r\n * @author MCD A"
},
{
"path": "figure-simulator-discovery/src/startup_stm32f4xx.s",
"chars": 24157,
"preview": "/**\r\n ******************************************************************************\r\n * @file startup_stm32f4xx."
},
{
"path": "figure-simulator-discovery/src/stm32f4xx_conf.h",
"chars": 3490,
"preview": "/**\r\n*****************************************************************************\r\n**\r\n** File : stm32f4xx_conf"
},
{
"path": "figure-simulator-discovery/src/stm32f4xx_it.c",
"chars": 4177,
"preview": "/**\r\n*****************************************************************************\r\n**\r\n** File : stm32f4xx_it.c"
},
{
"path": "figure-simulator-discovery/src/stm32f4xx_it.h",
"chars": 2042,
"preview": "/**\r\n*****************************************************************************\r\n**\r\n** File : stm32f4xx_it.h"
},
{
"path": "figure-simulator-discovery/src/system_stm32f4xx.c",
"chars": 21399,
"preview": "/**\r\n ******************************************************************************\r\n * @file system_stm32f4xx.c\r\n"
}
]
// ... and 48 more files (download for full content)
About this extraction
This page contains the full source code of the natashenka/Tamagotchi-Hack GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 248 files (39.1 MB), approximately 1.2M tokens, and a symbol index with 1378 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.