Skip to content

Commit 91dbd1f

Browse files
author
ShawnHymel
committed
Added Arduino core files to Roshamglo. Windows uploading works. Burning bootloader does not.
1 parent 4a201eb commit 91dbd1f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+8334
-28
lines changed

IDE_Board_Manager/package_sparkfun_index.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,12 +485,12 @@
485485
{
486486
"name":"SparkFun ATtiny Boards",
487487
"architecture":"tiny",
488-
"version":"0.1.0",
488+
"version":"0.1.1",
489489
"category":"Contributed",
490490
"url":"https://github.com/sparkfun/Arduino_Boards/raw/tiny/IDE_Board_Manager/sparkfun-tiny-0.1.0.tar.bz2",
491-
"archiveFileName":"sparkfunboards-tiny-0.1.0.tar.bz2",
492-
"checksum":"SHA-256:1C671C33E6B04E20696E13B43F94C385E903AA267D2F9EFCBC894DC38D2200CC",
493-
"size":"369238",
491+
"archiveFileName":"sparkfun-tiny-0.1.1.tar.bz2",
492+
"checksum":"SHA-256:32FA1F16545A745BD36B6882DE0790C14C82B89411FB9382ABBED0BD452468C8",
493+
"size":"425335",
494494
"help":{
495495
"online":"https://forums.sparkfun.com"
496496
},
415 KB
Binary file not shown.

sparkfun/tiny/boards.txt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,26 @@ menu.cpu=Processor
77
################################################################################
88
Roshamglo.name=Roshamglo (ATtiny84, 3.3V, 8MHz)
99

10-
Roshamglo.upload.using=micronucleusprog
10+
#Roshamglo.vid.0=0x1B4F
11+
#Roshamglo.pid.1=0x0014
12+
13+
#Roshamglo.upload.using=micronucleusprog
1114
Roshamglo.upload.protocol=usb
1215
Roshamglo.upload.tool=micronucleus
1316
Roshamglo.upload.maximum_size=6144
1417

1518
Roshamglo.build.mcu=attiny84
1619
Roshamglo.build.f_cpu=8000000L
20+
Roshamglo.build.vid=0x1B4F
21+
Roshamglo.build.pid=0x0014
22+
Roshamglo.build.usb_manufacturer="SparkFun Electronics"
23+
Roshamglo.build.usb_product="SparkFun Roshamglo"
1724
Roshamglo.build.board=ROSHAMGLO
1825
Roshamglo.build.core=arduino
1926
Roshamglo.build.variant=tiny14
20-
Roshamglo.build.usb_manufacturer="SparkFun Electronics"
21-
Roshamglo.build.usb_product="SparkFun Roshamglo"
22-
Roshamglo.build.vid=0x1B4F
23-
Roshamglo.build.pid=0x0014
2427

25-
Roshamglo.bootloader.tool=avrdude
28+
Roshamglo.bootloader.tool=arduino:avrdude
2629
Roshamglo.bootloader.low_fuses=0xE2
2730
Roshamglo.bootloader.high_fuses=0xDD
2831
Roshamglo.bootloader.extended_fuses=0xFE
29-
Roshamglo.bootloader.path=attiny/releases
30-
Roshamglo.bootloader.file=t84_roshamglo.hex
32+
Roshamglo.bootloader.file=attiny/releases/t84_roshamglo.hex

sparkfun/tiny/cores/arduino/Arduino.h

Lines changed: 259 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,259 @@
1+
/*
2+
Arduino.h - Main include file for the Arduino SDK
3+
Copyright (c) 2005-2013 Arduino Team. All right reserved.
4+
5+
This library is free software; you can redistribute it and/or
6+
modify it under the terms of the GNU Lesser General Public
7+
License as published by the Free Software Foundation; either
8+
version 2.1 of the License, or (at your option) any later version.
9+
10+
This library is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
Lesser General Public License for more details.
14+
15+
You should have received a copy of the GNU Lesser General Public
16+
License along with this library; if not, write to the Free Software
17+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
19+
20+
#ifndef Arduino_h
21+
#define Arduino_h
22+
23+
#include <stdlib.h>
24+
#include <stdbool.h>
25+
#include <string.h>
26+
#include <math.h>
27+
28+
#include <avr/pgmspace.h>
29+
#include <avr/io.h>
30+
#include <avr/interrupt.h>
31+
32+
#include "binary.h"
33+
34+
#ifdef __cplusplus
35+
extern "C"{
36+
#endif
37+
38+
void yield(void);
39+
40+
#define HIGH 0x1
41+
#define LOW 0x0
42+
43+
#define INPUT 0x0
44+
#define OUTPUT 0x1
45+
#define INPUT_PULLUP 0x2
46+
47+
#define PI 3.1415926535897932384626433832795
48+
#define HALF_PI 1.5707963267948966192313216916398
49+
#define TWO_PI 6.283185307179586476925286766559
50+
#define DEG_TO_RAD 0.017453292519943295769236907684886
51+
#define RAD_TO_DEG 57.295779513082320876798154814105
52+
#define EULER 2.718281828459045235360287471352
53+
54+
#define SERIAL 0x0
55+
#define DISPLAY 0x1
56+
57+
#define LSBFIRST 0
58+
#define MSBFIRST 1
59+
60+
#define CHANGE 1
61+
#define FALLING 2
62+
#define RISING 3
63+
64+
#if defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)
65+
#define DEFAULT 0
66+
#define EXTERNAL 1
67+
#define INTERNAL1V1 2
68+
#define INTERNAL INTERNAL1V1
69+
#elif defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)
70+
#define DEFAULT 0
71+
#define EXTERNAL 4
72+
#define INTERNAL1V1 8
73+
#define INTERNAL INTERNAL1V1
74+
#define INTERNAL2V56 9
75+
#define INTERNAL2V56_EXTCAP 13
76+
#else
77+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega644__) || defined(__AVR_ATmega644A__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__)
78+
#define INTERNAL1V1 2
79+
#define INTERNAL2V56 3
80+
#else
81+
#define INTERNAL 3
82+
#endif
83+
#define DEFAULT 1
84+
#define EXTERNAL 0
85+
#endif
86+
87+
// undefine stdlib's abs if encountered
88+
#ifdef abs
89+
#undef abs
90+
#endif
91+
92+
#define min(a,b) ((a)<(b)?(a):(b))
93+
#define max(a,b) ((a)>(b)?(a):(b))
94+
#define abs(x) ((x)>0?(x):-(x))
95+
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
96+
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
97+
#define radians(deg) ((deg)*DEG_TO_RAD)
98+
#define degrees(rad) ((rad)*RAD_TO_DEG)
99+
#define sq(x) ((x)*(x))
100+
101+
#define interrupts() sei()
102+
#define noInterrupts() cli()
103+
104+
#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
105+
#define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() )
106+
#define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() )
107+
108+
#define lowByte(w) ((uint8_t) ((w) & 0xff))
109+
#define highByte(w) ((uint8_t) ((w) >> 8))
110+
111+
#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
112+
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
113+
#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
114+
#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
115+
116+
// avr-libc defines _NOP() since 1.6.2
117+
#ifndef _NOP
118+
#define _NOP() do { __asm__ volatile ("nop"); } while (0)
119+
#endif
120+
121+
typedef unsigned int word;
122+
123+
#define bit(b) (1UL << (b))
124+
125+
typedef bool boolean;
126+
typedef uint8_t byte;
127+
128+
void init(void);
129+
void initVariant(void);
130+
131+
int atexit(void (*func)()) __attribute__((weak));
132+
133+
void pinMode(uint8_t, uint8_t);
134+
void digitalWrite(uint8_t, uint8_t);
135+
int digitalRead(uint8_t);
136+
int analogRead(uint8_t);
137+
void analogReference(uint8_t mode);
138+
void analogWrite(uint8_t, int);
139+
140+
unsigned long millis(void);
141+
unsigned long micros(void);
142+
void delay(unsigned long);
143+
void delayMicroseconds(unsigned int us);
144+
unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout);
145+
unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout);
146+
147+
void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val);
148+
uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder);
149+
150+
void attachInterrupt(uint8_t, void (*)(void), int mode);
151+
void detachInterrupt(uint8_t);
152+
153+
void setup(void);
154+
void loop(void);
155+
156+
// Get the bit location within the hardware port of the given virtual pin.
157+
// This comes from the pins_*.c file for the active board configuration.
158+
159+
#define analogInPinToBit(P) (P)
160+
161+
// On the ATmega1280, the addresses of some of the port registers are
162+
// greater than 255, so we can't store them in uint8_t's.
163+
extern const uint16_t PROGMEM port_to_mode_PGM[];
164+
extern const uint16_t PROGMEM port_to_input_PGM[];
165+
extern const uint16_t PROGMEM port_to_output_PGM[];
166+
167+
extern const uint8_t PROGMEM digital_pin_to_port_PGM[];
168+
// extern const uint8_t PROGMEM digital_pin_to_bit_PGM[];
169+
extern const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[];
170+
extern const uint8_t PROGMEM digital_pin_to_timer_PGM[];
171+
172+
// Get the bit location within the hardware port of the given virtual pin.
173+
// This comes from the pins_*.c file for the active board configuration.
174+
//
175+
// These perform slightly better as macros compared to inline functions
176+
//
177+
#define digitalPinToPort(P) ( pgm_read_byte( digital_pin_to_port_PGM + (P) ) )
178+
#define digitalPinToBitMask(P) ( pgm_read_byte( digital_pin_to_bit_mask_PGM + (P) ) )
179+
#define digitalPinToTimer(P) ( pgm_read_byte( digital_pin_to_timer_PGM + (P) ) )
180+
#define analogInPinToBit(P) (P)
181+
#define portOutputRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_output_PGM + (P))) )
182+
#define portInputRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_input_PGM + (P))) )
183+
#define portModeRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_mode_PGM + (P))) )
184+
185+
#define NOT_A_PIN 0
186+
#define NOT_A_PORT 0
187+
188+
#define NOT_AN_INTERRUPT -1
189+
190+
#ifdef ARDUINO_MAIN
191+
#define PA 1
192+
#define PB 2
193+
#define PC 3
194+
#define PD 4
195+
#define PE 5
196+
#define PF 6
197+
#define PG 7
198+
#define PH 8
199+
#define PJ 10
200+
#define PK 11
201+
#define PL 12
202+
#endif
203+
204+
#define NOT_ON_TIMER 0
205+
#define TIMER0A 1
206+
#define TIMER0B 2
207+
#define TIMER1A 3
208+
#define TIMER1B 4
209+
#define TIMER1C 5
210+
#define TIMER2 6
211+
#define TIMER2A 7
212+
#define TIMER2B 8
213+
214+
#define TIMER3A 9
215+
#define TIMER3B 10
216+
#define TIMER3C 11
217+
#define TIMER4A 12
218+
#define TIMER4B 13
219+
#define TIMER4C 14
220+
#define TIMER4D 15
221+
#define TIMER5A 16
222+
#define TIMER5B 17
223+
#define TIMER5C 18
224+
225+
#ifdef __cplusplus
226+
} // extern "C"
227+
#endif
228+
229+
#ifdef __cplusplus
230+
#include "WCharacter.h"
231+
#include "WString.h"
232+
#include "HardwareSerial.h"
233+
#include "USBAPI.h"
234+
#if defined(HAVE_HWSERIAL0) && defined(HAVE_CDCSERIAL)
235+
#error "Targets with both UART0 and CDC serial not supported"
236+
#endif
237+
238+
uint16_t makeWord(uint16_t w);
239+
uint16_t makeWord(byte h, byte l);
240+
241+
#define word(...) makeWord(__VA_ARGS__)
242+
243+
unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L);
244+
unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L);
245+
246+
void tone(uint8_t _pin, unsigned int frequency, unsigned long duration = 0);
247+
void noTone(uint8_t _pin);
248+
249+
// WMath prototypes
250+
long random(long);
251+
long random(long, long);
252+
void randomSeed(unsigned long);
253+
long map(long, long, long, long, long);
254+
255+
#endif
256+
257+
#include "pins_arduino.h"
258+
259+
#endif

0 commit comments

Comments
 (0)