started implementation on ATtiy84
This commit is contained in:
		
							
								
								
									
										8
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -52,3 +52,11 @@ Module.symvers | |||||||
| Mkfile.old | Mkfile.old | ||||||
| dkms.conf | dkms.conf | ||||||
|  |  | ||||||
|  | # Platformio | ||||||
|  | .pio | ||||||
|  | .pioenvs | ||||||
|  | .piolibdeps | ||||||
|  |  | ||||||
|  | # VSCode | ||||||
|  | .vscode | ||||||
|  | *.code-workspace | ||||||
|   | |||||||
| @@ -9,10 +9,11 @@ | |||||||
| ; https://docs.platformio.org/page/projectconf.html | ; https://docs.platformio.org/page/projectconf.html | ||||||
|  |  | ||||||
| [platformio] | [platformio] | ||||||
| default_envs = attiny85 | default_envs = attiny84 | ||||||
|  |  | ||||||
| [env] | [env] | ||||||
| build_flags = -D BUILD_ENV_NAME=$PIOENV | build_flags = -D BUILD_ENV_NAME=$PIOENV | ||||||
|  | lib_deps = LedControl, Encoder | ||||||
|  |  | ||||||
| [env:attiny85] | [env:attiny85] | ||||||
| platform = atmelavr | platform = atmelavr | ||||||
| @@ -21,6 +22,14 @@ framework = arduino | |||||||
| upload_protocol = usbtiny | upload_protocol = usbtiny | ||||||
| board_build.f_cpu = 1000000L | board_build.f_cpu = 1000000L | ||||||
|  |  | ||||||
|  | [env:attiny84] | ||||||
|  | platform = atmelavr | ||||||
|  | board = attiny84 | ||||||
|  | framework = arduino | ||||||
|  | upload_protocol = usbtiny | ||||||
|  | board_build.f_cpu = 800000L | ||||||
|  |  | ||||||
|  |  | ||||||
| [env:uno] | [env:uno] | ||||||
| platform = atmelavr | platform = atmelavr | ||||||
| board = uno | board = uno | ||||||
|   | |||||||
							
								
								
									
										40
									
								
								src/pins.hpp
									
									
									
									
									
								
							
							
						
						
									
										40
									
								
								src/pins.hpp
									
									
									
									
									
								
							| @@ -1,18 +1,36 @@ | |||||||
| #ifndef __PINS_HPP__ | #ifndef __PINS_HPP__ | ||||||
| #define __PINS_HPP__ | 	#define __PINS_HPP__ | ||||||
|  |  | ||||||
| /* MAX7219 */ | 	#ifdef ARDUINO_AVR_ATTINYX5 | ||||||
| #define MAX_DATAIN		0 | 		/* MAX7219 */ | ||||||
| #define MAX_CLK			2 | 		#define MAX_DATAIN		0 | ||||||
| #define MAX_LOAD		1 | 		#define MAX_CLK			2 | ||||||
|  | 		#define MAX_LOAD		1 | ||||||
|  |  | ||||||
| /* Rotary Encoder */ | 		/* Rotary Encoder */ | ||||||
| #define ENC_PINA		3 | 		#define ENC_PINA		3 | ||||||
| #define ENC_PINB		4 | 		#define ENC_PINB		4 | ||||||
|  |  | ||||||
|  |  | ||||||
| /* Button */ | 		/* Button */ | ||||||
| #define BTN_ANALOGPIN	0 | 		#define BTN_ANALOGPIN	0 | ||||||
| #define BTN_VREF		4600 | 		#define BTN_VREF		4600 | ||||||
|  |  | ||||||
|  | 	#else | ||||||
|  | 	#ifdef ARDUINO_AVR_ATTINYX4 | ||||||
|  | 		/* MAX7219 */ | ||||||
|  | 		#define MAX_DATAIN		7 | ||||||
|  | 		#define MAX_CLK			9 | ||||||
|  | 		#define MAX_LOAD		8 | ||||||
|  |  | ||||||
|  | 		/* Rotary Encoder */ | ||||||
|  | 		#define ENC_PINA		3 | ||||||
|  | 		#define ENC_PINB		6 | ||||||
|  |  | ||||||
|  |  | ||||||
|  | 		/* Button */ | ||||||
|  | 		#define BTN_SET			2 | ||||||
|  | 		#define BTN_RESET		5 | ||||||
|  | 	#endif /* ARDUINO_AVR_ATTINYX4 */ | ||||||
|  | 	#endif /* ARDUINO_AVR_ATTINYX5 */ | ||||||
| #endif /* __PINS_HPP__ */ | #endif /* __PINS_HPP__ */ | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| #ifndef __ROTARYENCODER_HPP__ | #ifndef __ROTARYENCODER_HPP__ | ||||||
| #define __ROTARYENCODER_HPP__ | #define __ROTARYENCODER_HPP__ | ||||||
|  |  | ||||||
| #include <encoder.h> | #include <Encoder.h> | ||||||
|  |  | ||||||
| #include "display.hpp" | #include "display.hpp" | ||||||
| #include "pins.hpp" | #include "pins.hpp" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user