#ifndef DMAChannel_h_ | #ifndef DMAChannel_h_ | ||||
#define DMAChannel_h_ | #define DMAChannel_h_ | ||||
#include "mk20dx128.h" | |||||
#include "kinetis.h" | |||||
// This code is a work-in-progress. It's incomplete and not usable yet... | // This code is a work-in-progress. It's incomplete and not usable yet... | ||||
// | // |
#ifndef HardwareSerial_h | #ifndef HardwareSerial_h | ||||
#define HardwareSerial_h | #define HardwareSerial_h | ||||
#include "mk20dx128.h" | |||||
#include <inttypes.h> | |||||
#include "kinetis.h" | |||||
// uncomment to enable 9 bit formats | // uncomment to enable 9 bit formats | ||||
//#define SERIAL_9BIT_SUPPORT | //#define SERIAL_9BIT_SUPPORT |
#ifndef __INTERVALTIMER_H__ | #ifndef __INTERVALTIMER_H__ | ||||
#define __INTERVALTIMER_H__ | #define __INTERVALTIMER_H__ | ||||
#include <stdint.h> | |||||
#include "mk20dx128.h" | |||||
#include "kinetis.h" | |||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
extern "C" { | extern "C" { |
#ifndef _avr_emulation_h_ | #ifndef _avr_emulation_h_ | ||||
#define _avr_emulation_h_ | #define _avr_emulation_h_ | ||||
#include "mk20dx128.h" | |||||
#include "kinetis.h" | |||||
#include "core_pins.h" | #include "core_pins.h" | ||||
#include "pins_arduino.h" | #include "pins_arduino.h" | ||||
#ifndef _core_pins_h_ | #ifndef _core_pins_h_ | ||||
#define _core_pins_h_ | #define _core_pins_h_ | ||||
#include "mk20dx128.h" | |||||
#include "kinetis.h" | |||||
#include "pins_arduino.h" | #include "pins_arduino.h" | ||||
static inline void analogWriteResolution(uint32_t bits) { analogWriteRes(bits); } | static inline void analogWriteResolution(uint32_t bits) { analogWriteRes(bits); } | ||||
void analogWriteFrequency(uint8_t pin, uint32_t frequency); | void analogWriteFrequency(uint8_t pin, uint32_t frequency); | ||||
void analogWriteDAC0(int val); | void analogWriteDAC0(int val); | ||||
#ifdef __cplusplus | |||||
void attachInterruptVector(IRQ_NUMBER_t irq, void (*function)(void)); | |||||
#else | |||||
void attachInterruptVector(enum IRQ_NUMBER_t irq, void (*function)(void)); | |||||
#endif | |||||
void attachInterrupt(uint8_t pin, void (*function)(void), int mode); | void attachInterrupt(uint8_t pin, void (*function)(void), int mode); | ||||
void detachInterrupt(uint8_t pin); | void detachInterrupt(uint8_t pin); | ||||
void _init_Teensyduino_internal_(void); | void _init_Teensyduino_internal_(void); |
* SOFTWARE. | * SOFTWARE. | ||||
*/ | */ | ||||
#include "mk20dx128.h" | |||||
#include "kinetis.h" | |||||
#include <stdint.h> | #include <stdint.h> | ||||
//#include "HardwareSerial.h" | //#include "HardwareSerial.h" | ||||
* SOFTWARE. | * SOFTWARE. | ||||
*/ | */ | ||||
#include "mk20dx128.h" | |||||
#include "kinetis.h" | |||||
extern unsigned long _stext; | extern unsigned long _stext; |
// fast interrupts will still be serviced quickly? | // fast interrupts will still be serviced quickly? | ||||
} | } | ||||
void attachInterruptVector(enum IRQ_NUMBER_t irq, void (*function)(void)) | |||||
{ | |||||
_VectorsRam[irq + 16] = function; | |||||
} | |||||
void attachInterrupt(uint8_t pin, void (*function)(void), int mode) | void attachInterrupt(uint8_t pin, void (*function)(void), int mode) | ||||
{ | { | ||||
volatile uint32_t *config; | volatile uint32_t *config; |
* SOFTWARE. | * SOFTWARE. | ||||
*/ | */ | ||||
#include "mk20dx128.h" | |||||
#include "kinetis.h" | |||||
#include "core_pins.h" | #include "core_pins.h" | ||||
#include "HardwareSerial.h" | #include "HardwareSerial.h" | ||||
* SOFTWARE. | * SOFTWARE. | ||||
*/ | */ | ||||
#include "mk20dx128.h" | |||||
#include "kinetis.h" | |||||
#include "core_pins.h" | #include "core_pins.h" | ||||
#include "HardwareSerial.h" | #include "HardwareSerial.h" | ||||
* SOFTWARE. | * SOFTWARE. | ||||
*/ | */ | ||||
#include "mk20dx128.h" | |||||
#include "kinetis.h" | |||||
#include "core_pins.h" | #include "core_pins.h" | ||||
#include "HardwareSerial.h" | #include "HardwareSerial.h" | ||||
#include "usb_desc.h" | #include "usb_desc.h" | ||||
#ifdef NUM_ENDPOINTS | #ifdef NUM_ENDPOINTS | ||||
#include "usb_names.h" | #include "usb_names.h" | ||||
#include "mk20dx128.h" | |||||
#include "kinetis.h" | |||||
#include "avr_functions.h" | #include "avr_functions.h" | ||||
// USB Descriptors are binary data which the USB host reads to | // USB Descriptors are binary data which the USB host reads to |
#include "usb_dev.h" | #include "usb_dev.h" | ||||
#if F_CPU >= 20000000 && defined(NUM_ENDPOINTS) | #if F_CPU >= 20000000 && defined(NUM_ENDPOINTS) | ||||
#include "mk20dx128.h" | |||||
#include "kinetis.h" | |||||
//#include "HardwareSerial.h" | //#include "HardwareSerial.h" | ||||
#include "usb_mem.h" | #include "usb_mem.h" | ||||
#include "usb_dev.h" | #include "usb_dev.h" | ||||
#if F_CPU >= 20000000 && defined(NUM_ENDPOINTS) | #if F_CPU >= 20000000 && defined(NUM_ENDPOINTS) | ||||
#include "mk20dx128.h" | |||||
#include "kinetis.h" | |||||
//#include "HardwareSerial.h" | //#include "HardwareSerial.h" | ||||
#include "usb_mem.h" | #include "usb_mem.h" | ||||
#if F_CPU >= 20000000 | #if F_CPU >= 20000000 | ||||
//#include "mk20dx128.h" | |||||
#include "usb_dev.h" | #include "usb_dev.h" | ||||
#include "usb_seremu.h" | #include "usb_seremu.h" | ||||
#include "core_pins.h" // for yield() | #include "core_pins.h" // for yield() |