Cosmetic changes to comments and README

This commit is contained in:
Gregory Nutt 2014-04-07 15:28:04 -06:00
parent ac3865fd89
commit 27811d28f9
5 changed files with 47 additions and 32 deletions

View File

@ -204,6 +204,7 @@ static inline uint8_t tiva_gpioport(int port)
int tiva_dumpgpio(uint32_t pinset, const char *msg) int tiva_dumpgpio(uint32_t pinset, const char *msg)
{ {
#ifdef CONFIG_DEBUG
irqstate_t flags; irqstate_t flags;
unsigned int port = (pinset & GPIO_PORT_MASK) >> GPIO_PORT_SHIFT; unsigned int port = (pinset & GPIO_PORT_MASK) >> GPIO_PORT_SHIFT;
uintptr_t base; uintptr_t base;
@ -242,6 +243,9 @@ int tiva_dumpgpio(uint32_t pinset, const char *msg)
getreg32(base + TIVA_GPIO_PUR_OFFSET), getreg32(base + TIVA_GPIO_PDR_OFFSET), getreg32(base + TIVA_GPIO_PUR_OFFSET), getreg32(base + TIVA_GPIO_PDR_OFFSET),
getreg32(base + TIVA_GPIO_SLR_OFFSET)); getreg32(base + TIVA_GPIO_SLR_OFFSET));
} }
irqrestore(flags); irqrestore(flags);
#endif /* CONFIG_DEBUG */
return OK; return OK;
} }

View File

@ -834,6 +834,7 @@ static int ssi_transfer(struct tiva_ssidev_s *priv, const void *txbuffer,
ssi_getreg(priv, TIVA_SSI_SR_OFFSET)); ssi_getreg(priv, TIVA_SSI_SR_OFFSET));
ntxd = ssi_performtx(priv); ntxd = ssi_performtx(priv);
UNUSED(ntxd);
/* For the case where nwords < Tx FIFO size, ssi_performrx will /* For the case where nwords < Tx FIFO size, ssi_performrx will
* configure interrupts correctly for the final phase of the * configure interrupts correctly for the final phase of the
@ -873,6 +874,7 @@ static int ssi_transfer(struct tiva_ssidev_s *priv, const void *txbuffer,
/* Handle outgoing Tx FIFO transfers */ /* Handle outgoing Tx FIFO transfers */
ntxd = ssi_performtx(priv); ntxd = ssi_performtx(priv);
UNUSED(ntxd);
/* Handle incoming Rx FIFO transfers */ /* Handle incoming Rx FIFO transfers */
@ -886,6 +888,7 @@ static int ssi_transfer(struct tiva_ssidev_s *priv, const void *txbuffer,
} }
while (priv->nrxwords < priv->nwords); while (priv->nrxwords < priv->nwords);
#endif #endif
return OK; return OK;
} }
@ -996,6 +999,7 @@ static int ssi_interrupt(int irq, void *context)
ssidbg("Transfer complete\n"); ssidbg("Transfer complete\n");
ssi_semgive(&priv->xfrsem); ssi_semgive(&priv->xfrsem);
} }
return OK; return OK;
} }
#endif #endif
@ -1043,6 +1047,7 @@ static int ssi_lock(FAR struct spi_dev_s *dev, bool lock)
{ {
(void)sem_post(&priv->exclsem); (void)sem_post(&priv->exclsem);
} }
return OK; return OK;
} }
#endif #endif
@ -1160,8 +1165,10 @@ static uint32_t ssi_setfrequencyinternal(struct tiva_ssidev_s *priv,
priv->frequency = frequency; priv->frequency = frequency;
priv->actual = actual; priv->actual = actual;
} }
return priv->actual; return priv->actual;
#else #else
return actual; return actual;
#endif #endif
} }

View File

@ -473,43 +473,43 @@ Serial Console
By default, all configurations use UART0 which connects to the USB VCOM By default, all configurations use UART0 which connects to the USB VCOM
on the DEBUG port on the LM4F120 LaunchPad: on the DEBUG port on the LM4F120 LaunchPad:
UART0 RX - PA.0 UART0 RX - PA.0
UART0 TX - PA.1 UART0 TX - PA.1
However, if you use an external RS232 driver, then other options are However, if you use an external RS232 driver, then other options are
available. UART1 has option pin settings and flow control capabilities available. UART1 has option pin settings and flow control capabilities
that are not available with the other UARTS:: that are not available with the other UARTS::
UART1 RX - PB.0 or PC.4 (Need disambiguation in board.h) UART1 RX - PB.0 or PC.4 (Need disambiguation in board.h)
UART1 TX - PB.1 or PC.5 (" " " " "" " ") UART1 TX - PB.1 or PC.5 (" " " " "" " ")
UART1_RTS - PF.0 or PC.4 UART1_RTS - PF.0 or PC.4
UART1_CTS - PF.1 or PC.5 UART1_CTS - PF.1 or PC.5
NOTE: board.h currently selects PB.0, PB.1, PF.0 and PF.1 for UART1, but NOTE: board.h currently selects PB.0, PB.1, PF.0 and PF.1 for UART1, but
that can be changed by editting board.h that can be changed by editing board.h
UART2-5, 7 are also available, UART2 is not recommended because it shares UART2-5, 7 are also available, UART2 is not recommended because it shares
some pin usage with USB device mode. UART6 is not available because its some pin usage with USB device mode. UART6 is not available because its
only RX/TX pin options are dedicated to USB support. only RX/TX pin options are dedicated to USB support.
UART2 RX - PD.6 UART2 RX - PD.6
UART2 TX - PD.7 (Also used for USB VBUS detection) UART2 TX - PD.7 (Also used for USB VBUS detection)
UART3 RX - PC.6 UART3 RX - PC.6
UART3 TX - PC.7 UART3 TX - PC.7
UART4 RX - PC.4 UART4 RX - PC.4
UART4 TX - PC.5 UART4 TX - PC.5
UART5 RX - PE.4 UART5 RX - PE.4
UART5 TX - PE.5 UART5 TX - PE.5
UART6 RX - PD.4, Not available. Dedicated for USB_DM UART6 RX - PD.4, Not available. Dedicated for USB_DM
UART6 TX - PD.5, Not available. Dedicated for USB_DP UART6 TX - PD.5, Not available. Dedicated for USB_DP
UART7 RX - PE.0 UART7 RX - PE.0
UART7 TX - PE.1 UART7 TX - PE.1
USB Device Controller Functions USB Device Controller Functions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -77,7 +77,7 @@
*/ */
#define TIVA_RCC_VALUE (SYSCON_RCC_OSCSRC | SYSCON_RCC_XTAL | \ #define TIVA_RCC_VALUE (SYSCON_RCC_OSCSRC | SYSCON_RCC_XTAL | \
SYSCON_RCC_USESYSDIV | SYSCON_RCC_SYSDIV(TIVA_SYSDIV)) SYSCON_RCC_USESYSDIV | SYSCON_RCC_SYSDIV(TIVA_SYSDIV))
/* RCC2 settings /* RCC2 settings
* *

View File

@ -146,20 +146,20 @@
struct mmcsd_slot_s struct mmcsd_slot_s
{ {
FAR struct spi_dev_s *spi; /* SPI port bound to this slot */ FAR struct spi_dev_s *spi; /* SPI port bound to this slot */
sem_t sem; /* Assures mutually exclusive accesss to card and SPI */ sem_t sem; /* Assures mutually exclusive accesss to card and SPI */
uint8_t state; /* State of the slot (see MMCSD_SLOTSTATUS_* definitions) */ uint8_t state; /* State of the slot (see MMCSD_SLOTSTATUS_* definitions) */
uint8_t type; /* Disk type */ uint8_t type; /* Disk type */
uint8_t csd[16]; /* Copy of card CSD */ uint8_t csd[16]; /* Copy of card CSD */
#ifndef CONFIG_MMCSD_SECTOR512 #ifndef CONFIG_MMCSD_SECTOR512
uint16_t sectorsize; /* Media block size (in bytes) */ uint16_t sectorsize; /* Media block size (in bytes) */
#endif #endif
uint32_t nsectors; /* Number of blocks on the media */ uint32_t nsectors; /* Number of blocks on the media */
uint32_t taccess; /* Card access time */ uint32_t taccess; /* Card access time */
uint32_t twrite; /* Card write time */ uint32_t twrite; /* Card write time */
uint32_t ocr; /* Last 4 bytes of OCR (R3) */ uint32_t ocr; /* Last 4 bytes of OCR (R3) */
uint32_t r7; /* Last 4 bytes of R7 */ uint32_t r7; /* Last 4 bytes of R7 */
#ifndef CONFIG_SPI_OWNBUS #ifndef CONFIG_SPI_OWNBUS
uint32_t spispeed; /* Speed to use for SPI in data mode */ uint32_t spispeed; /* Speed to use for SPI in data mode */
#endif #endif
}; };
@ -1035,6 +1035,7 @@ static int mmcsd_xmitblock(FAR struct mmcsd_slot_s *slot, const uint8_t *buffer,
fdbg("Bad data response: %02x\n", response); fdbg("Bad data response: %02x\n", response);
return -EIO; return -EIO;
} }
return OK; return OK;
} }
#endif /* CONFIG_FS_WRITABLE && !CONFIG_MMCSD_READONLY */ #endif /* CONFIG_FS_WRITABLE && !CONFIG_MMCSD_READONLY */
@ -1089,7 +1090,7 @@ static int mmcsd_open(FAR struct inode *inode)
if (slot->type == MMCSD_CARDTYPE_UNKNOWN) if (slot->type == MMCSD_CARDTYPE_UNKNOWN)
{ {
/* Ininitialize for the media in the slot */ /* Initialize for the media in the slot */
ret = mmcsd_mediainitialize(slot); ret = mmcsd_mediainitialize(slot);
if (ret < 0) if (ret < 0)
@ -1188,6 +1189,8 @@ static ssize_t mmcsd_read(FAR struct inode *inode, unsigned char *buffer,
/* Convert sector and nsectors to nbytes and byte offset */ /* Convert sector and nsectors to nbytes and byte offset */
nbytes = nsectors * SECTORSIZE(slot); nbytes = nsectors * SECTORSIZE(slot);
UNUSED(nbytes);
if (IS_BLOCK(slot->type)) if (IS_BLOCK(slot->type))
{ {
offset = start_sector; offset = start_sector;
@ -1402,7 +1405,7 @@ static ssize_t mmcsd_write(FAR struct inode *inode, const unsigned char *buffer,
} }
/* Send CMD25: Continuously write blocks of data until the /* Send CMD25: Continuously write blocks of data until the
* tranmission is stopped. * transmission is stopped.
*/ */
response = mmcsd_sendcmd(slot, &g_cmd25, offset); response = mmcsd_sendcmd(slot, &g_cmd25, offset);
@ -1850,6 +1853,7 @@ static void mmcsd_mediachanged(void *arg)
return; return;
} }
#endif #endif
spi = slot->spi; spi = slot->spi;
/* Save the current slot state and reassess the new state */ /* Save the current slot state and reassess the new state */
@ -1957,7 +1961,7 @@ int mmcsd_spislotinitialize(int minor, int slotno, FAR struct spi_dev_s *spi)
mmcsd_semtake(slot); mmcsd_semtake(slot);
mmcsd_spiinit(slot); mmcsd_spiinit(slot);
/* Ininitialize for the media in the slot (if any) */ /* Initialize for the media in the slot (if any) */
ret = mmcsd_mediainitialize(slot); ret = mmcsd_mediainitialize(slot);
mmcsd_semgive(slot); mmcsd_semgive(slot);