Skip to content

Initial Release allowing blink sketch compile and download #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 24 additions & 21 deletions boards.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
# See: http://code.google.com/p/arduino/wiki/Platforms

menu.cpu=Processor

##############################################################

izmir_ec.name=Intel® AtlasEdge
izmir_ec.upload.tool=shakespere
izmir_ec.upload.protocol=shakespere
izmir_ec.upload.maximum_size=10000000
izmir_ec.upload.use_1200bps_touch=false
izmir_ec.upload.wait_for_upload_port=false
izmir_ec.upload.native_usb=false

izmir_ec.build.mcu=arc32
izmir_ec.build.f_cpu=-m32
#izmir_ec.build.main=arduino\main.cpp
izmir_ec.build.core=arduino
izmir_ec.build.variant=atlas_fab_c
#izmir_ec.build.variant_system_lib=libx86_izmir_gcc_rel.a
izmir_ec.build.toolchain_path=x86_64-pokysdk-linux-eglibc/usr/bin/i586-poky-linux
izmir_ec.build.sysroot_path=i586-poky-linux-eglibc
izmir_ec.build.toolchain_prefix=i586-poky-linux-
intel_edu_x.name=Intel® EDU
intel_edu_x.vid.0=0x2341
intel_edu_x.pid.0=0x003e
intel_edu_x.vid.1=0x2A03
intel_edu_x.pid.1=0x003e
intel_edu_x.vid.0x2A03.warning=Uncertified
intel_edu_x.upload.tool=eduload
intel_edu_x.upload.protocol=script
intel_edu_x.upload.maximum_size=196608
intel_edu_x.upload.use_1200bps_touch=falase
intel_edu_x.upload.wait_for_upload_port=false
intel_edu_x.upload.native_usb=false
intel_edu_x.upload.params.quiet=-q
intel_edu_x.upload.params.verbose=-q
intel_edu_x.build.usb_product="Arduino Due"
intel_edu_x.build.mcu=ARCv2EM
intel_edu_x.build.board=ARC32_TOOLS
intel_edu_x.build.core=arduino
intel_edu_x.build.ldscript=linker_scripts/flash.ld
intel_edu_x.build.variant=intel_edu_x
intel_edu_x.build.variant_system_lib=arc32drv_edu
intel_edu_x.build.vid=0x2341
intel_edu_x.build.pid=0x003e

# See: http://code.google.com/p/arduino/wiki/Platforms


91 changes: 88 additions & 3 deletions cores/arduino/Arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,92 @@

#ifndef Arduino_h
#define Arduino_h
void setup(void);
void loop(void);
/*int main(void);*/

#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#include "binary.h"
#include "itoa.h"

#ifdef __cplusplus
extern "C"{
#endif // __cplusplus

#include "wiring_constants.h"

#define clockCyclesPerMicrosecond() ( SystemCoreClock / 1000000L )
#define clockCyclesToMicroseconds(a) ( ((a) * 1000L) / (SystemCoreClock / 1000L) )
#define microsecondsToClockCycles(a) ( (a) * (SystemCoreClock / 1000000L) )

void yield(void);

/* sketch */
extern void setup( void ) ;
extern void loop( void ) ;

typedef void (*voidFuncPtr)( void ) ;

/* Define attribute */
#define WEAK __attribute__ ((weak))

#define INVALID 0xFFFFFFFF

/* Types used for the tables below */
/* TODO - consider using smaller types to optimise storage space */
typedef struct _PinDescription
{
uint32_t ulGPIOId; // GPIO port pin
uint32_t ulGPIOPort; // GPIO port ID
uint32_t ulGPIOType; // LMT or SS
uint32_t ulGPIOBase; // GPIO register base address
uint32_t ulSocPin; // SoC pin number
uint32_t ulPinMode; // Current SoC pin mux mode
uint32_t ulPwmChan; // PWM channel
uint32_t ulPwmScale; // PWM frequency scaler
} PinDescription;

#ifdef OUT
/* Types used for the tables below */
typedef struct _PinDescription
{
// TODO Pio* pPort ;
uint32_t ulPin ;
uint32_t ulPeripheralId ;
// TODO EPioType ulPinType ;
uint32_t ulPinConfiguration ;
uint32_t ulPinAttribute ;
EAnalogChannel ulAnalogChannel ; /* Analog pin in the Arduino context (label on the board) */
EAnalogChannel ulADCChannelNumber ; /* ADC Channel number in the SAM device */
EPWMChannel ulPWMChannel ;
ETCChannel ulTCChannel ;
} PinDescription ;
#endif


/* Pins table to be instanciated into variant.cpp */
extern PinDescription g_APinDescription[] ;

#ifdef __cplusplus
} // extern "C"

#include "WCharacter.h"
#include "WString.h"
#include "Tone.h"
#include "WMath.h"
#include "HardwareSerial.h"
#include "wiring_pulse.h"

#endif // __cplusplus

// Include board variant
#include "variant.h"

#include "wiring.h"
#include "wiring_digital.h"
#include "wiring_analog.h"
#include "wiring_shift.h"
#include "WInterrupts.h"

#endif // Arduino_h
42 changes: 42 additions & 0 deletions cores/arduino/HardwareSerial.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
Copyright (c) 2011 Arduino. All right reserved.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef HardwareSerial_h
#define HardwareSerial_h

#include <inttypes.h>

#include "Stream.h"

class HardwareSerial : public Stream
{
public:
virtual void begin(unsigned long);
virtual void end();
virtual int available(void) = 0;
virtual int peek(void) = 0;
virtual int read(void) = 0;
virtual void flush(void) = 0;
virtual size_t write(uint8_t) = 0;
using Print::write; // pull in write(str) and write(buf, size) from Print
virtual operator bool() = 0;
};

extern void serialEventRun(void) __attribute__((weak));

#endif
84 changes: 84 additions & 0 deletions cores/arduino/Print.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
Print.h - Base class that provides print() and println()
Copyright (c) 2008 David A. Mellis. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef Print_h
#define Print_h

#include <inttypes.h>
#include <stdio.h> // for size_t

#include "WString.h"
#include "Printable.h"

#define DEC 10
#define HEX 16
#define OCT 8
#define BIN 2

class Print
{
private:
int write_error;
size_t printNumber(unsigned long, uint8_t);
size_t printFloat(double, uint8_t);
protected:
void setWriteError(int err = 1) { write_error = err; }
public:
Print() : write_error(0) {}

int getWriteError() { return write_error; }
void clearWriteError() { setWriteError(0); }

virtual size_t write(uint8_t) = 0;
size_t write(const char *str) {
if (str == NULL) return 0;
return write((const uint8_t *)str, strlen(str));
}
virtual size_t write(const uint8_t *buffer, size_t size);
size_t write(const char *buffer, size_t size) {
return write((const uint8_t *)buffer, size);
}

size_t print(const __FlashStringHelper *);
size_t print(const String &);
size_t print(const char[]);
size_t print(char);
size_t print(unsigned char, int = DEC);
size_t print(int, int = DEC);
size_t print(unsigned int, int = DEC);
size_t print(long, int = DEC);
size_t print(unsigned long, int = DEC);
size_t print(double, int = 2);
size_t print(const Printable&);

size_t println(const __FlashStringHelper *);
size_t println(const String &s);
size_t println(const char[]);
size_t println(char);
size_t println(unsigned char, int = DEC);
size_t println(int, int = DEC);
size_t println(unsigned int, int = DEC);
size_t println(long, int = DEC);
size_t println(unsigned long, int = DEC);
size_t println(double, int = 2);
size_t println(const Printable&);
size_t println(void);
};

#endif
40 changes: 40 additions & 0 deletions cores/arduino/Printable.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
Printable.h - Interface class that allows printing of complex types
Copyright (c) 2011 Adrian McEwen. All right reserved.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef Printable_h
#define Printable_h

#include <stdlib.h>

class Print;

/** The Printable class provides a way for new classes to allow themselves to be printed.
By deriving from Printable and implementing the printTo method, it will then be possible
for users to print out instances of this class by passing them into the usual
Print::print and Print::println methods.
*/

class Printable
{
public:
virtual size_t printTo(Print& p) const = 0;
};

#endif

Loading