From 37c1c455eeff5100e7d9e8c1de5012f5445d5f4d Mon Sep 17 00:00:00 2001 From: Zach Eveland Date: Fri, 21 Oct 2011 08:02:17 -0400 Subject: initial commit of new Diskloader-based bootloader experiment --- bootloaders/nuevo_diskloader/src/Platform.h | 60 +++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 bootloaders/nuevo_diskloader/src/Platform.h (limited to 'bootloaders/nuevo_diskloader/src/Platform.h') diff --git a/bootloaders/nuevo_diskloader/src/Platform.h b/bootloaders/nuevo_diskloader/src/Platform.h new file mode 100644 index 0000000..e300690 --- /dev/null +++ b/bootloaders/nuevo_diskloader/src/Platform.h @@ -0,0 +1,60 @@ +/* + * Platform.h + */ + +#ifndef __PLATFORM_H__ +#define __PLATFORM_H__ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#ifdef __cplusplus +extern "C"{ +#endif + +typedef unsigned char u8; +typedef unsigned short u16; +typedef unsigned long u32; + +#define CDC_ENABLED + +//#include "USBDesc.h" +//#include "../../../cores/arduino/USBCore.h" +#include "USBAPI.h" + +#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) +#define DISABLE_JTAG() MCUCR = (1 << JTD) | (1 << IVCE) | (0 << PUD); MCUCR = (1 << JTD) | (0 << IVSEL) | (0 << IVCE) | (0 << PUD) + +#define BOARD_INIT() DDRC |= (1<<7); DDRB |= (1<<0); DDRE |= (1<<6); CPU_PRESCALE(0); DISABLE_JTAG(); // for XXX-series boards +//#define BOARD_INIT() DDRC |= (1<<7); DDRB |= (1<<0); DDRD |= (1<<5); CPU_PRESCALE(0); DISABLE_JTAG(); // for non-XXX boards + +// for XXX-series boards +#define TX_LED_OFF() PORTE |= (1<<6) +#define TX_LED_ON() PORTE &= ~(1<<6) +#define RX_LED_OFF() PORTB |= (1<<0) +#define RX_LED_ON() PORTB &= ~(1<<0) +#define L_LED_OFF() PORTC &= ~(1<<7) +#define L_LED_ON() PORTC |= (1<<7) + +// these for non-XXX boards +//#define LED0 PORTC &= ~(1<<7) +//#define LED1 PORTC |= (1<<7) +//#define TXLED0 PORTD |= (1<<5) +//#define TXLED1 PORTD &= ~(1<<5) +//#define RXLED0 PORTB |= (1<<0) +//#define RXLED1 PORTB &= ~(1<<0) + +#ifdef __cplusplus +} /* extern "C"{ */ +#endif + +#endif /* __PLATFORM_H__ */ -- cgit v1.2.3-18-g5258