📄 main.h
字号:
/******************************************SpokePOV V1.0 firmwareSpokePOV firmware is distributed under CC license. For more info on CC go to www.creativecommons.orgFor more info on SpokePOV go to www.ladyada.net/make/spokepovCreative Commons DeedAttribution-NonCommercial-ShareAlike 2.5You are free: * to copy, distribute, display, and perform the work * to make derivative worksUnder the following conditions:Attribution. You must attribute the work in the manner specified by the author or licensor.Noncommercial. You may not use this work for commercial purposes.Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one. * For any reuse or distribution, you must make clear to others the license terms of this work. * Any of these conditions can be waived if you get permission from the copyright holder.Your fair use and other rights are in no way affected by the above.A more detailed version of this license is available at:http://creativecommons.org/licenses/by-nc-sa/2.5/legalcode******************************************//* ANNOTATED by RJW - trebor@animeigo.com - to further my understanding *//* of the code and environment before proceeding to make mods. All page *//* numbers refer to the ATMEL ATTiny2313 documentation located at *//* http://www.atmel.com/dyn/resources/prod_documents/doc2543.pdf *//* Any comments implying any ignorance were made by RJW! The esteemed *//* original author is by definition omniscient, and, it is feared, *//* omnipotent as well... */// Pin definition constants.// Back and Front LED row select bits#define BACK 5#define LATCH_SELECT_PORT PORTD#define FRONT 4// The pushbutton is bit 2 of Port D, input#define BUTTON_PIN PIND#define BUTTON 2// The Hall Effect sensor is bit 3 of Port D, input & output#define SENSOR_PORT PORTD#define SENSOR_PIN PIND#define SENSOR 3// Power is sent to the Hall Effect sensor using line D6#define SENSORPOWER 6// Serial interface black magic#define SPI_CLK1 _BV(USIWM0) | _BV(USICS0) | _BV(USITC)#define SPI_CLK2 _BV(USIWM0) | _BV(USICS0) | _BV(USITC) | _BV(USICLK)// Sometimes doing nothing is a good thing...#define NOP asm("nop");// PC communication link commands (all have msb set)#define COMP_SUCCESS 0x80#define COMP_CMD_SETFLED 0x81#define COMP_CMD_SETBLED 0x82#define COMP_CMD_CLRFLED 0x83#define COMP_CMD_CLRBLED 0x84#define COMP_CMD_RDEEPROM 0x85#define COMP_CMD_WREEPROM 0x86#define COMP_CMD_RDEEPROM16 0x87#define COMP_CMD_WREEPROM16 0x88// define a few functions//void clock_leds(void);//void set_led(uint8_t led);void set_all(uint8_t blockValue);void go_to_sleep(void);// void delay_ms(unsigned char ms);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -