From 59ec83c253ed8d24d6da0caf83284b2ff3fc86b6 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 20 Jun 2011 02:35:20 +0000 Subject: Preparing for AVR USB driver git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3725 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/configs/teensy/README.txt | 50 +++++++++++++++++++++++++++++++++++++- nuttx/configs/teensy/src/up_leds.c | 32 ++++++++++++------------ 2 files changed, 65 insertions(+), 17 deletions(-) (limited to 'nuttx/configs') diff --git a/nuttx/configs/teensy/README.txt b/nuttx/configs/teensy/README.txt index ad0cd3695..7dedaedf8 100644 --- a/nuttx/configs/teensy/README.txt +++ b/nuttx/configs/teensy/README.txt @@ -12,6 +12,7 @@ Contents o Pin Usage o Halfkey Bootloader o Serial Console + o SD Connection o Toolchains o Windows Native Toolchains o NuttX buildroot Toolchain @@ -51,7 +52,7 @@ Pin Usage 10 (SS/PCINT0) PB0 Pad B0 11 (PCINT1/SCLK) PB1 Pad B1 12 (PDI/PCINT2/MOSI) PB2 Pad B2 - 13 (PDO/PCINT3/MISO) PB3 Pad1 B3 + 13 (PDO/PCINT3/MISO) PB3 Pad B3 14 (PCINT4/OC.2A) PB4 Pad B4 15 (PCINT5/OC.1A) PB5 Pad B5 16 (PCINT6/OC.1B) PB6 Pad B6 @@ -145,6 +146,53 @@ Serial Console Plus power and ground. There are numerous ground points and both USB 5V and Vcc are available. +SD Connection +^^^^^^^^^^^^^ + +I have the SD-ADP SD/MMC Card Adaptor from www.gravitech.com +(http://www.gravitech.us/sdcaad.html). Features: + + o On-board 3.3V regulator + o Connect directly to 3.3V or 5.0V microcontroller + o Card detect LED + o Includes 11-pin male header + o Board dimension: 2.0”x1.3” + +SD-ADP Pinout / SD Connection + + -- ---- ----------- ------------------------------------------------------- + J2 NAME SD CARD DESCRIPTION + -- ---- ----------- ------------------------------------------------------- + 1 VIN (reguator) Input power to the SD card (3.3V to 6.0V) + 2 GND 3,6,12,13 Common (Connects to the housing of the SD socket) + 3 3V3 4 3.3V Output voltage from the on-board 3.3V regulator (250mA) + 4 NC 9 NC Connect to pin 9 on the SD card (not used in SPI mode) + 5 CS 1 DAT3/CS Chip select * + 6 DI 2 CMD/DI Serial input data * + 7 SCK 5 SCK Serial clock * + 8 DO 7 DAT0/DO Serial output data + 9 IRQ 8 DAT1/IRQ Interrupt request, connect to pin 8 on the SD card (not used in SPI mode) + 10 CD 10 CD Card detect (active low) + 11 WP 11 WP Write protect + -- ---- ----------- ------------------------------------------------------- + + * Via a 74LCX245 level translator / buff + +Teensy SPI Connection + + J2 NAME PIN NAME PAD + 1 VIN + 2 GND + 3 3V3 + 4 NC + 5 CS 10 (SS/PCINT0) PB0 Pad B0 + 6 DI 12 (PDI/PCINT2/MOSI) PB2 Pad B2 + 7 SCK 11 (PCINT1/SCLK) PB1 Pad B1 + 8 DO 13 (PDO/PCINT3/MISO) PB3 Pad B3 + 9 IRQ + 10 CD + 11 WP + Toolchains ^^^^^^^^^^ diff --git a/nuttx/configs/teensy/src/up_leds.c b/nuttx/configs/teensy/src/up_leds.c index 9ca1499f0..7aabae5c3 100755 --- a/nuttx/configs/teensy/src/up_leds.c +++ b/nuttx/configs/teensy/src/up_leds.c @@ -126,7 +126,7 @@ void up_ledon(int led) switch (led) { - case 0: + case 0: /* The steady state is OFF */ g_ncoff = true; @@ -135,18 +135,18 @@ void up_ledon(int led) /* Turn the LED off */ PORTD &= ~(1 << 6); - break; + break; - case 1: - /* Turn the LED on */ + case 1: + /* The steady state is ON */ PORTD |= (1 << 6); g_ncoff = false; - break; + break; - default: - return; - } + default: + return; + } } /**************************************************************************** @@ -168,7 +168,7 @@ void up_ledoff(int led) switch (led) { - case 2: + case 2: /* If the "no-change" state is OFF, then turn the LED off */ if (g_ncoff) @@ -177,18 +177,18 @@ void up_ledoff(int led) break; } - /* Otherwise, fall through to turn the LED ON */ + /* Otherwise, fall through to turn the LED ON */ - case 0: - case 1: + case 0: + case 1: /* Turn the LED on */ PORTD |= (1 << 6); - break; + break; - default: - return; - } + default: + return; + } } #endif /* CONFIG_ARCH_LEDS */ -- cgit v1.2.3