device_firmware_template
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | device_firmware_template [2014/01/16 23:02] (current) – created breaker27 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Files ====== | ||
+ | The main source file should be called like the device type and the directory name, prefixed with " | ||
+ | |||
+ | ====== Main Function ====== | ||
+ | |||
+ | Use these typical functions to initialize your device in the main function: | ||
+ | |||
+ | Create a delay to avoid problems with E2P access when a programmer resets the device in short intervals (which mine did...):\\ | ||
+ | '' | ||
+ | |||
+ | Initialize the util functions (e.g. the LED output):\\ | ||
+ | '' | ||
+ | |||
+ | Check if the EEPROM matches the device type (and blink forever if it doesn' | ||
+ | '' | ||
+ | |||
+ | Set, increase and write packet counter:\\ | ||
+ | '' | ||
+ | eeprom_write_UIntValue(EEPROM_PACKETCOUNTER_BYTE, | ||
+ | |||
+ | Read AES key:\\ | ||
+ | '' | ||
+ | EEPROM_AESKEYCOUNT_LENGTH_BITS, | ||
+ | '' | ||
+ | |||
+ | Read device ID:\\ | ||
+ | '' | ||
+ | EEPROM_DEVICEID_LENGTH_BITS, | ||
+ | '' | ||
+ | |||
+ | Init UART and print out software info:\\ | ||
+ | '' | ||
+ | UART_PUTS(...'' | ||
+ | |||
+ | Blink three times to show everything is ok (or don't if it's not):\\ | ||
+ | '' | ||
+ | |||
+ | Init the RFM12:\\ | ||
+ | '' | ||
+ | sei();'' | ||
+ | |||
+ | Start your endless loop:\\ | ||
+ | '' | ||
+ | {\\ | ||
+ | /* do something */\\ | ||
+ | }'' |
device_firmware_template.txt · Last modified: 2014/01/16 23:02 by breaker27