Просмотр исходного кода

Add register definitions

teensy4-core
PaulStoffregen 9 лет назад
Родитель
Сommit
1e49af2dd2
6 измененных файлов: 1796 добавлений и 170 удалений
  1. +4
    -0
      teensy3/analog.c
  2. +2
    -2
      teensy3/core_pins.h
  3. +1660
    -160
      teensy3/kinetis.h
  4. +127
    -5
      teensy3/mk20dx128.c
  5. +2
    -2
      teensy3/pins_teensy.c
  6. +1
    -1
      teensy3/touch.c

+ 4
- 0
teensy3/analog.c Просмотреть файл

@@ -31,6 +31,10 @@
#include "core_pins.h"
//#include "HardwareSerial.h"

#if defined(__MK66FX1M0__) // ugly hack for now...
#define __MK20DX256__
#endif

static uint8_t calibrating;
static uint8_t analog_right_shift = 0;
static uint8_t analog_config_bits = 10;

+ 2
- 2
teensy3/core_pins.h Просмотреть файл

@@ -99,7 +99,7 @@
#define CORE_NUM_INTERRUPT 34
#define CORE_NUM_ANALOG 14
#define CORE_NUM_PWM 10
#elif defined(__MK20DX256__)
#elif defined(__MK20DX256__) || defined(__MK66FX1M0__)
#define CORE_NUM_TOTAL_PINS 34
#define CORE_NUM_DIGITAL 34
#define CORE_NUM_INTERRUPT 34
@@ -113,7 +113,7 @@
#define CORE_NUM_PWM 10
#endif

#if defined(__MK20DX128__) || defined(__MK20DX256__)
#if defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK66FX1M0__)

#define CORE_PIN0_BIT 16
#define CORE_PIN1_BIT 17

+ 1660
- 160
teensy3/kinetis.h
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 127
- 5
teensy3/mk20dx128.c Просмотреть файл

@@ -151,6 +151,7 @@ void dma_ch14_isr(void) __attribute__ ((weak, alias("unused_isr")));
void dma_ch15_isr(void) __attribute__ ((weak, alias("unused_isr")));
void dma_error_isr(void) __attribute__ ((weak, alias("unused_isr")));
void mcm_isr(void) __attribute__ ((weak, alias("unused_isr")));
void randnum_isr(void) __attribute__ ((weak, alias("unused_isr")));
void flash_cmd_isr(void) __attribute__ ((weak, alias("unused_isr")));
void flash_error_isr(void) __attribute__ ((weak, alias("unused_isr")));
void low_voltage_isr(void) __attribute__ ((weak, alias("unused_isr")));
@@ -159,16 +160,27 @@ void watchdog_isr(void) __attribute__ ((weak, alias("unused_isr")));
void i2c0_isr(void) __attribute__ ((weak, alias("unused_isr")));
void i2c1_isr(void) __attribute__ ((weak, alias("unused_isr")));
void i2c2_isr(void) __attribute__ ((weak, alias("unused_isr")));
void i2c3_isr(void) __attribute__ ((weak, alias("unused_isr")));
void spi0_isr(void) __attribute__ ((weak, alias("unused_isr")));
void spi1_isr(void) __attribute__ ((weak, alias("unused_isr")));
void spi2_isr(void) __attribute__ ((weak, alias("unused_isr")));
void sdhc_isr(void) __attribute__ ((weak, alias("unused_isr")));
void enet_timer_isr(void) __attribute__ ((weak, alias("unused_isr")));
void enet_tx_isr(void) __attribute__ ((weak, alias("unused_isr")));
void enet_rx_isr(void) __attribute__ ((weak, alias("unused_isr")));
void enet_error_isr(void) __attribute__ ((weak, alias("unused_isr")));
void can0_message_isr(void) __attribute__ ((weak, alias("unused_isr")));
void can0_bus_off_isr(void) __attribute__ ((weak, alias("unused_isr")));
void can0_error_isr(void) __attribute__ ((weak, alias("unused_isr")));
void can0_tx_warn_isr(void) __attribute__ ((weak, alias("unused_isr")));
void can0_rx_warn_isr(void) __attribute__ ((weak, alias("unused_isr")));
void can0_wakeup_isr(void) __attribute__ ((weak, alias("unused_isr")));
void can1_message_isr(void) __attribute__ ((weak, alias("unused_isr")));
void can1_bus_off_isr(void) __attribute__ ((weak, alias("unused_isr")));
void can1_error_isr(void) __attribute__ ((weak, alias("unused_isr")));
void can1_tx_warn_isr(void) __attribute__ ((weak, alias("unused_isr")));
void can1_rx_warn_isr(void) __attribute__ ((weak, alias("unused_isr")));
void can1_wakeup_isr(void) __attribute__ ((weak, alias("unused_isr")));
void i2s0_tx_isr(void) __attribute__ ((weak, alias("unused_isr")));
void i2s0_rx_isr(void) __attribute__ ((weak, alias("unused_isr")));
void i2s0_isr(void) __attribute__ ((weak, alias("unused_isr")));
@@ -185,15 +197,20 @@ void uart4_status_isr(void) __attribute__ ((weak, alias("unused_isr")));
void uart4_error_isr(void) __attribute__ ((weak, alias("unused_isr")));
void uart5_status_isr(void) __attribute__ ((weak, alias("unused_isr")));
void uart5_error_isr(void) __attribute__ ((weak, alias("unused_isr")));
void lpuart0_status_isr(void) __attribute__ ((weak, alias("unused_isr")));
void adc0_isr(void) __attribute__ ((weak, alias("unused_isr")));
void adc1_isr(void) __attribute__ ((weak, alias("unused_isr")));
void cmp0_isr(void) __attribute__ ((weak, alias("unused_isr")));
void cmp1_isr(void) __attribute__ ((weak, alias("unused_isr")));
void cmp2_isr(void) __attribute__ ((weak, alias("unused_isr")));
void cmp3_isr(void) __attribute__ ((weak, alias("unused_isr")));
void ftm0_isr(void) __attribute__ ((weak, alias("unused_isr")));
void ftm1_isr(void) __attribute__ ((weak, alias("unused_isr")));
void ftm2_isr(void) __attribute__ ((weak, alias("unused_isr")));
void ftm3_isr(void) __attribute__ ((weak, alias("unused_isr")));
void tpm0_isr(void) __attribute__ ((weak, alias("unused_isr")));
void tpm1_isr(void) __attribute__ ((weak, alias("unused_isr")));
void tpm2_isr(void) __attribute__ ((weak, alias("unused_isr")));
void cmt_isr(void) __attribute__ ((weak, alias("unused_isr")));
void rtc_alarm_isr(void) __attribute__ ((weak, alias("unused_isr")));
void rtc_seconds_isr(void) __attribute__ ((weak, alias("unused_isr")));
@@ -205,6 +222,8 @@ void pit3_isr(void) __attribute__ ((weak, alias("unused_isr")));
void pdb_isr(void) __attribute__ ((weak, alias("unused_isr")));
void usb_isr(void) __attribute__ ((weak, alias("unused_isr")));
void usb_charge_isr(void) __attribute__ ((weak, alias("unused_isr")));
void usbhs_isr(void) __attribute__ ((weak, alias("unused_isr")));
void usbhs_phy_isr(void) __attribute__ ((weak, alias("unused_isr")));
void dac0_isr(void) __attribute__ ((weak, alias("unused_isr")));
void dac1_isr(void) __attribute__ ((weak, alias("unused_isr")));
void tsi0_isr(void) __attribute__ ((weak, alias("unused_isr")));
@@ -224,6 +243,8 @@ __attribute__ ((section(".dmabuffers"), used, aligned(256)))
__attribute__ ((section(".dmabuffers"), used, aligned(512)))
#elif defined(__MKL26Z64__)
__attribute__ ((section(".dmabuffers"), used, aligned(256)))
#elif defined(__MK66FX1M0__)
__attribute__ ((section(".dmabuffers"), used, aligned(512)))
#endif
void (* _VectorsRam[NVIC_NUM_INTERRUPTS+16])(void);

@@ -305,11 +326,11 @@ void (* const _VectorsFlash[NVIC_NUM_INTERRUPTS+16])(void) =
dma_ch8_isr, // 24 DMA channel 8 transfer complete
dma_ch9_isr, // 25 DMA channel 9 transfer complete
dma_ch10_isr, // 26 DMA channel 10 transfer complete
dma_ch11_isr, // 27 DMA channel 10 transfer complete
dma_ch12_isr, // 28 DMA channel 10 transfer complete
dma_ch13_isr, // 29 DMA channel 10 transfer complete
dma_ch14_isr, // 30 DMA channel 10 transfer complete
dma_ch15_isr, // 31 DMA channel 10 transfer complete
dma_ch11_isr, // 27 DMA channel 11 transfer complete
dma_ch12_isr, // 28 DMA channel 12 transfer complete
dma_ch13_isr, // 29 DMA channel 13 transfer complete
dma_ch14_isr, // 30 DMA channel 14 transfer complete
dma_ch15_isr, // 31 DMA channel 15 transfer complete
dma_error_isr, // 32 DMA error interrupt channel
unused_isr, // 33 --
flash_cmd_isr, // 34 Flash Memory Command complete
@@ -422,6 +443,107 @@ void (* const _VectorsFlash[NVIC_NUM_INTERRUPTS+16])(void) =
software_isr, // 45 Software interrupt
porta_isr, // 46 Pin detect (Port A)
portcd_isr, // 47 Pin detect (Port C and D)
#elif defined(__MK66FX1M0__)
dma_ch0_isr, // 16 DMA channel 0 transfer complete
dma_ch1_isr, // 17 DMA channel 1 transfer complete
dma_ch2_isr, // 18 DMA channel 2 transfer complete
dma_ch3_isr, // 19 DMA channel 3 transfer complete
dma_ch4_isr, // 20 DMA channel 4 transfer complete
dma_ch5_isr, // 21 DMA channel 5 transfer complete
dma_ch6_isr, // 22 DMA channel 6 transfer complete
dma_ch7_isr, // 23 DMA channel 7 transfer complete
dma_ch8_isr, // 24 DMA channel 8 transfer complete
dma_ch9_isr, // 25 DMA channel 9 transfer complete
dma_ch10_isr, // 26 DMA channel 10 transfer complete
dma_ch11_isr, // 27 DMA channel 11 transfer complete
dma_ch12_isr, // 28 DMA channel 12 transfer complete
dma_ch13_isr, // 29 DMA channel 13 transfer complete
dma_ch14_isr, // 30 DMA channel 14 transfer complete
dma_ch15_isr, // 31 DMA channel 15 transfer complete
dma_error_isr, // 32 DMA error interrupt channel
mcm_isr, // 33 MCM
flash_cmd_isr, // 34 Flash Memory Command complete
flash_error_isr, // 35 Flash Read collision
low_voltage_isr, // 36 Low-voltage detect/warning
wakeup_isr, // 37 Low Leakage Wakeup
watchdog_isr, // 38 Both EWM and WDOG interrupt
randnum_isr, // 39 Random Number Generator
i2c0_isr, // 40 I2C0
i2c1_isr, // 41 I2C1
spi0_isr, // 42 SPI0
spi1_isr, // 43 SPI1
i2s0_tx_isr, // 44 I2S0 Transmit
i2s0_rx_isr, // 45 I2S0 Receive
unused_isr, // 46 --
uart0_status_isr, // 47 UART0 status
uart0_error_isr, // 48 UART0 error
uart1_status_isr, // 49 UART1 status
uart1_error_isr, // 50 UART1 error
uart2_status_isr, // 51 UART2 status
uart2_error_isr, // 52 UART2 error
uart3_status_isr, // 53 UART3 status
uart3_error_isr, // 54 UART3 error
adc0_isr, // 55 ADC0
cmp0_isr, // 56 CMP0
cmp1_isr, // 57 CMP1
ftm0_isr, // 58 FTM0
ftm1_isr, // 59 FTM1
ftm2_isr, // 60 FTM2
cmt_isr, // 61 CMT
rtc_alarm_isr, // 62 RTC Alarm interrupt
rtc_seconds_isr, // 63 RTC Seconds interrupt
pit0_isr, // 64 PIT Channel 0
pit1_isr, // 65 PIT Channel 1
pit2_isr, // 66 PIT Channel 2
pit3_isr, // 67 PIT Channel 3
pdb_isr, // 68 PDB Programmable Delay Block
usb_isr, // 69 USB OTG
usb_charge_isr, // 70 USB Charger Detect
unused_isr, // 71 --
dac0_isr, // 72 DAC0
mcg_isr, // 73 MCG
lptmr_isr, // 74 Low Power Timer
porta_isr, // 75 Pin detect (Port A)
portb_isr, // 76 Pin detect (Port B)
portc_isr, // 77 Pin detect (Port C)
portd_isr, // 78 Pin detect (Port D)
porte_isr, // 79 Pin detect (Port E)
software_isr, // 80 Software interrupt
spi2_isr, // 81 SPI2
uart4_status_isr, // 82 UART4 status
uart4_error_isr, // 83 UART4 error
unused_isr, // 84 --
unused_isr, // 85 --
cmp2_isr, // 86 CMP2
ftm3_isr, // 87 FTM3
dac1_isr, // 88 DAC1
adc1_isr, // 89 ADC1
i2c2_isr, // 90 I2C2
can0_message_isr, // 91 CAN OR'ed Message buffer (0-15)
can0_bus_off_isr, // 92 CAN Bus Off
can0_error_isr, // 93 CAN Error
can0_tx_warn_isr, // 94 CAN Transmit Warning
can0_rx_warn_isr, // 95 CAN Receive Warning
can0_wakeup_isr, // 96 CAN Wake Up
sdhc_isr, // 97 SDHC
enet_timer_isr, // 98 Ethernet IEEE1588 Timers
enet_tx_isr, // 99 Ethernet Transmit
enet_rx_isr, // 100 Ethernet Receive
enet_error_isr, // 101 Ethernet Error
lpuart0_status_isr, // 102 ADC1
tsi0_isr, // 103 TSI0
tpm1_isr, // 104 FTM1
tpm2_isr, // 105 FTM2
usbhs_phy_isr, // 106 USB-HS Phy
i2c3_isr, // 107 I2C3
cmp3_isr, // 108 CMP3
usbhs_isr, // 109 USB-HS
can1_message_isr, // 110 CAN OR'ed Message buffer (0-15)
can1_bus_off_isr, // 111 CAN Bus Off
can1_error_isr, // 112 CAN Error
can1_tx_warn_isr, // 113 CAN Transmit Warning
can1_rx_warn_isr, // 114 CAN Receive Warning
can1_wakeup_isr, // 115 CAN Wake Up
#endif
};


+ 2
- 2
teensy3/pins_teensy.c Просмотреть файл

@@ -175,7 +175,7 @@ void detachInterrupt(uint8_t pin)
__enable_irq();
}

#if defined(__MK20DX128__) || defined(__MK20DX256__)
#if defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK66FX1M0__)

static void porta_interrupt(void)
{
@@ -490,7 +490,7 @@ void _init_Teensyduino_internal_(void)
#define FTM0_CH7_PIN 5
#define FTM1_CH0_PIN 3
#define FTM1_CH1_PIN 4
#elif defined(__MK20DX256__)
#elif defined(__MK20DX256__) || defined(__MK66FX1M0__)
#define FTM0_CH0_PIN 22
#define FTM0_CH1_PIN 23
#define FTM0_CH2_PIN 9

+ 1
- 1
teensy3/touch.c Просмотреть файл

@@ -31,7 +31,7 @@
#include "core_pins.h"
//#include "HardwareSerial.h"

#if defined(__MK20DX128__) || defined(__MK20DX256__)
#if defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK66FX1M0__)
// These settings give approx 0.02 pF sensitivity and 1200 pF range
// Lower current, higher number of scans, and higher prescaler
// increase sensitivity, but the trade-off is longer measurement

Загрузка…
Отмена
Сохранить