diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-12-27 20:07:17 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-12-27 20:07:17 +0000 |
commit | 815dcf2d24ce8b8b00a637fbeb5f0d56fdc583cf (patch) | |
tree | e56731c6fd8ab4493b3d056a589b0c83052a1577 /nuttx/configs | |
parent | 8deca84debb66a97f9d57ed0299659196e31b5f2 (diff) | |
download | px4-nuttx-815dcf2d24ce8b8b00a637fbeb5f0d56fdc583cf.tar.gz px4-nuttx-815dcf2d24ce8b8b00a637fbeb5f0d56fdc583cf.tar.bz2 px4-nuttx-815dcf2d24ce8b8b00a637fbeb5f0d56fdc583cf.zip |
Updates for PIC32MX USB driver
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4233 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs')
-rw-r--r-- | nuttx/configs/sure-pic32mx/src/Makefile | 4 | ||||
-rw-r--r-- | nuttx/configs/sure-pic32mx/src/sure-internal.h | 16 | ||||
-rw-r--r-- | nuttx/configs/sure-pic32mx/src/up_boot.c | 9 | ||||
-rw-r--r-- | nuttx/configs/sure-pic32mx/src/up_spi.c | 24 |
4 files changed, 39 insertions, 14 deletions
diff --git a/nuttx/configs/sure-pic32mx/src/Makefile b/nuttx/configs/sure-pic32mx/src/Makefile index 0a5849d97..fa8dc47cf 100644 --- a/nuttx/configs/sure-pic32mx/src/Makefile +++ b/nuttx/configs/sure-pic32mx/src/Makefile @@ -48,6 +48,10 @@ ifeq ($(CONFIG_ARCH_BUTTONS),y) CSRCS += up_buttons.c endif +ifeq ($(CONFIG_PIC32MX_USBDEV),y) +CSRCS += up_usbdev.c +endif + ifeq ($(CONFIG_NSH_ARCHINIT),y) CSRCS += up_nsh.c endif diff --git a/nuttx/configs/sure-pic32mx/src/sure-internal.h b/nuttx/configs/sure-pic32mx/src/sure-internal.h index 3a3cebbe4..826c05efa 100644 --- a/nuttx/configs/sure-pic32mx/src/sure-internal.h +++ b/nuttx/configs/sure-pic32mx/src/sure-internal.h @@ -2,7 +2,7 @@ * configs/sure-pic32mx/src/sure-internal.h * * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -81,7 +81,7 @@ extern "C" { * Name: pic32mx_spiinitialize * * Description: - * Called to configure SPI chip select GPIO pins for the PCB Logic board. + * Called to configure SPI chip select GPIO pins for the Sure PIC32MX Logic board. * ************************************************************************************/ @@ -90,6 +90,18 @@ EXTERN void weak_function pic32mx_spiinitialize(void); #endif /************************************************************************************ + * Name: pic32mx_usdbinitialize + * + * Description: + * Called to configure the mini-B PHY on the Sure PIC32MX board for the USB device + * + ************************************************************************************/ + +#if defined(CONFIG_PIC32MX_USBDEV) +EXTERN void weak_function pic32mx_usdbinitialize(void); +#endif + +/************************************************************************************ * Name: pic32mx_ledinit * * Description: diff --git a/nuttx/configs/sure-pic32mx/src/up_boot.c b/nuttx/configs/sure-pic32mx/src/up_boot.c index f3cf49052..fe633abd4 100644 --- a/nuttx/configs/sure-pic32mx/src/up_boot.c +++ b/nuttx/configs/sure-pic32mx/src/up_boot.c @@ -85,6 +85,15 @@ void pic32mx_boardinitialize(void) } #endif + /* Configure the mini-B PHY on the Sure PIC32MX board for the USB device */ + +#if defined(CONFIG_PIC32MX_USBDEV) + if (pic32mx_usbdevinitialize) + { + pic32mx_usbdevinitialize(); + } +#endif + /* Configure on-board LEDs if LED support has been selected. */ #ifdef CONFIG_ARCH_LEDS diff --git a/nuttx/configs/sure-pic32mx/src/up_spi.c b/nuttx/configs/sure-pic32mx/src/up_spi.c index 5d03dcb2a..67ce64dec 100644 --- a/nuttx/configs/sure-pic32mx/src/up_spi.c +++ b/nuttx/configs/sure-pic32mx/src/up_spi.c @@ -1,9 +1,9 @@ /************************************************************************************ - * configs/sure-pic32mx/src/up_ssp.c - * arch/arm/src/board/up_ssp.c + * configs/sure-pic32mx/src/up_spi.c + * arch/arm/src/board/up_spi.c * * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -65,16 +65,16 @@ */ #ifdef CONFIG_SPI_DEBUG -# define sspdbg lldbg +# define spidbg lldbg # ifdef CONFIG_SPI_VERBOSE -# define sspvdbg lldbg +# define spivdbg lldbg # else -# define sspvdbg(x...) +# define spivdbg(x...) # endif #else # undef CONFIG_SPI_VERBOSE -# define sspdbg(x...) -# define sspvdbg(x...) +# define spidbg(x...) +# define spivdbg(x...) #endif /************************************************************************************ @@ -86,14 +86,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: pic32mx_sspinitialize + * Name: pic32mx_spiinitialize * * Description: * Called to configure SPI chip select GPIO pins for the Sure PIC32MX board. * ************************************************************************************/ -void weak_function pic32mx_sspinitialize(void) +void weak_function pic32mx_spiinitialize(void) { /* Configure the SPI2 chip select GPIOs */ @@ -130,13 +130,13 @@ void weak_function pic32mx_sspinitialize(void) #ifdef CONFIG_PIC32MX_SPI2 void pic32mx_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #warning "Missing logic" } uint8_t pic32mx_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - sspdbg("Returning nothing\n"); + spidbg("Returning nothing\n"); #warning "Missing logic" return 0; } |