This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;new program to set up and test the PN532 chip reader | |
;compile with gavrasm write_pn532.asm ;flash with avrdude -c avrisp -p m168 -P /dev/tty.usbmodem1411 -b 19200 -U flash:w:write_pn532.asm | |
; | |
; I/O pins: | |
; ** use PORTB except RDYN on PORTD ** | |
; ** SCK on pin 5 configured as output ** | |
; ** MISO on pin 4 configured as input with pullup ** | |
; ** MOSI on pin 3 configured as output ** | |
; ** NSS on pin 2 configured as output ** | |
; ** NSS on pin 2 not selected (high) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;this program attempts to read a MiFare card initialized with a name at address 0x04 | |
; and a value block at 0x05 | |
; | |
;compile with gavrasm read_dec.asm ;flash with avrdude -c avrisp -p m168 -P /dev/tty.usbmodem1411 -b 19200 -U flash:w:read_dec.hex | |
; | |
; I/O pins: | |
; ** use PORTB except RDYN on PORTD ** | |
; ** SCK on pin 5 configured as output ** | |
; ** MISO on pin 4 configured as input with pullup ** | |
; ** MOSI on pin 3 configured as output ** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// firmware to receive bytes from atmega186 over USART and send over Wifi | |
// The atmega168 is programmed to talk to the pn532 nfc card reader and then send the card info | |
// over USART. | |
#define debug 0 | |
#define MAXLEN 256 | |
TCPServer server = TCPServer(2342); | |
TCPClient client; | |
bool unlocked = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ lets try to blink an LED on the discovery stm32 L1 board | |
@ uses LED on PB7 | |
@ how to compile and flash: | |
@ arm-none-eabi-as -mcpu=cortex-m3 blinky.s -o blinky.o | |
@ arm-none-eabi-ld -v -T stm32.ld -nostartfiles -o blinky.elf blinky.o | |
@ arm-none-eabi-objcopy -O binary blinky.elf blinky.bin | |
@ then from st-link (https://github.com/texane/stlink) | |
@ ./st-flash write ../first_arm/blinky.bin 0x08000000 | |
.thumb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* linker script for STM32 Cortex M3 c/o pygmy.utoh.org */ | |
SECTIONS | |
{ | |
/* interupt vectors start at zero */ | |
. = 0x0; /* start of flash */ | |
.text : { *(text) } | |
/* constant data follows code but still in flash */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ cylon eyes for stm32L discovery | |
@ uses lcd software driver 1/4 duty 1/3 bias | |
@ how to compile and flash: | |
@ arm-none-eabi-as -mcpu=cortex-m3 cylon_eyes.s -o cylon_eyes.o | |
@ arm-none-eabi-ld -v -T stm32.ld -nostartfiles -o cylon_eyes.elf cylon_eyes.o | |
@ arm-none-eabi-objcopy -O binary cylon_eyes.elf cylon_eyes.bin | |
@ then from st-link (https://github.com/texane/stlink) | |
@ ./st-flash write ../first_arm/cylon_eyes.bin 0x08000000 | |
.thumb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ program: systick_tst.s | |
@ programmer: reb | |
@ device: stm32L152c discovery eval board | |
@ description: blink led with systick count down | |
@ uses systick interrupt routine | |
@ | |
@ how to compile and flash: | |
@ arm-none-eabi-as -mcpu=cortex-m3 systick_tst.s -o systick_tst.o | |
@ arm-none-eabi-ld -v -T stm32.ld -nostartfiles -o systick_tst.elf systick_tst.o | |
@ arm-none-eabi-objcopy -O binary systick_tst.elf systick_tst.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
/* program to demonstrate how to find multiplicative inverse in Rijndal's Galois Field | |
* part of the AES encryption algorithm or Rijndal's block cipher. | |
* | |
* code expanded on blog @ www.samiam/galois.html | |
*/ | |
/* global vars */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
/* Rijndael Field S-box transformation | |
* part of the AES encryption algorythm or Rijndal's block cipher. | |
* | |
* code expanded on blog @ www.samiam/galois.html | |
*/ | |
/* global vars */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
/* quick program to solve affine cipher with key a, b mod 26 */ | |
/* usage: ./aff_c <key a> <key b> <optional e=encrypt> | |
* cipher-text from stdin or pipe | |
*/ | |
int |