diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-05-02 21:58:00 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-05-02 21:58:00 +0000 |
commit | 56317916d45ed401e3e6f33caff39a7d72726407 (patch) | |
tree | cf0875aa80be06e5815fc5892588400b807e8f9e /nuttx/configs/olimex-strp711 | |
parent | 08b4a61636f1289a773ac4cb67f07a758f852c19 (diff) | |
download | px4-nuttx-56317916d45ed401e3e6f33caff39a7d72726407.tar.gz px4-nuttx-56317916d45ed401e3e6f33caff39a7d72726407.tar.bz2 px4-nuttx-56317916d45ed401e3e6f33caff39a7d72726407.zip |
Add XTI support
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2645 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/olimex-strp711')
-rwxr-xr-x | nuttx/configs/olimex-strp711/nettest/defconfig | 2 | ||||
-rwxr-xr-x | nuttx/configs/olimex-strp711/src/up_enc28j60.c | 30 |
2 files changed, 23 insertions, 9 deletions
diff --git a/nuttx/configs/olimex-strp711/nettest/defconfig b/nuttx/configs/olimex-strp711/nettest/defconfig index 80c48d7ac..256f81665 100755 --- a/nuttx/configs/olimex-strp711/nettest/defconfig +++ b/nuttx/configs/olimex-strp711/nettest/defconfig @@ -118,7 +118,7 @@ CONFIG_STR71X_CAN=n CONFIG_STR71X_BSPI0=y CONFIG_STR71X_BSPI1=n CONFIG_STR71X_HDLC=n -CONFIG_STR71X_XTI=n +CONFIG_STR71X_XTI=y CONFIG_STR71X_GPIO0=y CONFIG_STR71X_GPIO1=y CONFIG_STR71X_GPIO2=n diff --git a/nuttx/configs/olimex-strp711/src/up_enc28j60.c b/nuttx/configs/olimex-strp711/src/up_enc28j60.c index cc285a3dc..8d80e4d34 100755 --- a/nuttx/configs/olimex-strp711/src/up_enc28j60.c +++ b/nuttx/configs/olimex-strp711/src/up_enc28j60.c @@ -71,6 +71,7 @@ * UART3, I2C cannot be used with SPI0. The GPIOs selected for the ENC28J60 * interrupt conflict with TMR1. */ +#warning "Need to select differnt interrupt pin.. XTI doesn't support this one" /**************************************************************************** * Included Files @@ -90,6 +91,7 @@ #include "chip.h" #include "up_arch.h" #include "up_internal.h" +#include "str71x_internal.h" #ifdef CONFIG_NET_ENC28J60 @@ -105,6 +107,10 @@ # error "Need CONFIG_STR71X_BSPI0 in the configuration" #endif +#ifndef CONFIG_STR71X_XTI +# error "Need CONFIG_STR71X_XTI in the configuration" +#endif + /* UART3, I2C cannot be used with SPI0. The GPIOs selected for the ENC28J60 * interrupt conflict with TIM1. */ @@ -123,7 +129,7 @@ #define ENC28J60_DEVNO 0 /* Only one ENC28J60 */ #define ENC28J60_IRQ 0 /* NEEDED!!!!!!!!!!!!!!!! */ -/* Debug ********************************************************************/ +#warning "Eventually need to fix XTI IRQ number!" /**************************************************************************** * Private Data @@ -148,34 +154,42 @@ void up_netinitialize(void) /* Get the SPI port */ - nvdbg("up_netinitialize: Initializing SPI port %d\n", ENC28J60_SPI_PORTNO); + nvdbg("Initializing SPI port %d\n", ENC28J60_SPI_PORTNO); spi = up_spiinitialize(ENC28J60_SPI_PORTNO); if (!spi) { - ndbg("up_netinitialize: Failed to initialize SPI port %d\n", + ndbg("Failed to initialize SPI port %d\n", ENC28J60_SPI_PORTNO); return; } - nvdbg("up_netinitialize: Successfully initialized SPI port %d\n", + /* Configure the XTI for the ENC28J60 interrupt. */ + + ret = str7x_xticonfig(ENC28J60_IRQ, false); + if (ret < 0) + { + ndbg("Failed configure interrupt for IRQ %d: %d\n", ENC28J60_IRQ, ret); + return; + } + + nvdbg("Successfully initialized SPI port %d\n", ENC28J60_SPI_PORTNO); /* Bind the SPI port to the ENC28J60 driver */ - nvdbg("up_netinitialize: Binding SPI port %d to ENC28J60 device %d\n", + nvdbg("Binding SPI port %d to ENC28J60 device %d\n", ENC28J60_SPI_PORTNO, ENC28J60_DEVNO); -#warning "Need to implement IRQ interrupt before we can use this" ret = enc_initialize(spi, ENC28J60_DEVNO, ENC28J60_IRQ); if (ret < 0) { - ndbg("up_netinitialize: Failed to bind SPI port %d ENC28J60 device %d: %d\n", + ndbg("Failed to bind SPI port %d ENC28J60 device %d: %d\n", ENC28J60_SPI_PORTNO, ENC28J60_DEVNO, ret); return; } - nvdbg("up_netinitialize: Successfuly bound SPI port %d ENC28J60 device %d\n", + nvdbg("Successfuly bound SPI port %d ENC28J60 device %d\n", ENC28J60_SPI_PORTNO, ENC28J60_DEVNO); } #endif /* CONFIG_NET_ENC28J60 */ |