diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-10-23 09:12:09 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-10-23 09:12:09 -0600 |
commit | cec0c918e5e111f32888590751e821e3f07135d5 (patch) | |
tree | 768566b93249a3242ea133babfccb5a027d6ac5b | |
parent | 956003a63a2abff830bbcf00d6c735976afae521 (diff) | |
download | px4-nuttx-cec0c918e5e111f32888590751e821e3f07135d5.tar.gz px4-nuttx-cec0c918e5e111f32888590751e821e3f07135d5.tar.bz2 px4-nuttx-cec0c918e5e111f32888590751e821e3f07135d5.zip |
CC3000 driver updates from David Sidrane
-rw-r--r-- | nuttx/include/nuttx/wireless/cc3000/include/cc3000_upif.h | 8 | ||||
-rw-r--r-- | nuttx/include/nuttx/wireless/cc3000/include/sys/socket.h | 29 |
2 files changed, 21 insertions, 16 deletions
diff --git a/nuttx/include/nuttx/wireless/cc3000/include/cc3000_upif.h b/nuttx/include/nuttx/wireless/cc3000/include/cc3000_upif.h index 3341e1a0a..918d781d3 100644 --- a/nuttx/include/nuttx/wireless/cc3000/include/cc3000_upif.h +++ b/nuttx/include/nuttx/wireless/cc3000/include/cc3000_upif.h @@ -80,7 +80,7 @@ * See http://processors.wiki.ti.com/index.php/CC3000_Serial_Port_Interface_(SPI) */ -# define CONFIG_CC3000_SPIMODE SPIDEV_MODE0 +# define CONFIG_CC3000_SPIMODE SPIDEV_MODE1 #endif /* Check for some required settings. This can save the user a lot of time @@ -91,9 +91,6 @@ # error "Signals are required. CONFIG_DISABLE_SIGNALS must not be selected." #endif -#ifndef CONFIG_SCHED_WORKQUEUE -# error "Work queue support required. CONFIG_SCHED_WORKQUEUE must be selected." -#endif /**************************************************************************** * Public Types @@ -146,7 +143,8 @@ struct cc3000_config_s void (*irq_clear)(FAR struct cc3000_config_s *state); void (*power_enable)(FAR struct cc3000_config_s *state,bool enable); void (*chip_select)(FAR struct cc3000_config_s *state,bool enable); - bool (*busy)(FAR struct cc3000_config_s *state); + bool (*irq_read)(FAR struct cc3000_config_s *state); + }; /**************************************************************************** diff --git a/nuttx/include/nuttx/wireless/cc3000/include/sys/socket.h b/nuttx/include/nuttx/wireless/cc3000/include/sys/socket.h index 9ac4ecc9d..9ba965513 100644 --- a/nuttx/include/nuttx/wireless/cc3000/include/sys/socket.h +++ b/nuttx/include/nuttx/wireless/cc3000/include/sys/socket.h @@ -39,6 +39,9 @@ * Pre-processor Definitions *****************************************************************************/ +#define CC3000_SOCKETS /* Indicate using CC3000 sockets */ +#define CC3000_SOCKETS_ST /* Indicate single threaded version */ + #define HOSTNAME_MAX_LENGTH (230) /* 230 bytes + header shouldn't exceed 8 * bit value */ @@ -47,6 +50,10 @@ #define AF_INET 2 #define AF_INET6 23 +#define PF_INET AF_INET /* IPv4 Internet protocols */ +#define PF_INET6 AF_INET6 /* IPv6 Internet protocols */ + + /*------------ Socket Types ------------*/ #define SOCK_STREAM 1 @@ -112,12 +119,12 @@ * the array isn't too big. */ -#define __FD_ZERO(set) \ - do { \ - unsigned int __i; \ - TICC3000fd_set *__arr = (set); \ +#define __FD_ZERO(set) \ + do { \ + unsigned int __i; \ + TICC3000fd_set *__arr = (set); \ for (__i = 0; __i < sizeof (TICC3000fd_set) / sizeof (__fd_mask); ++__i) \ - __FDS_BITS (__arr)[__i] = 0; \ + __FDS_BITS (__arr)[__i] = 0; \ } while (0) #define __FD_SET(d, set) (__FDS_BITS (set)[__FDELT (d)] |= __FDMASK (d)) #define __FD_CLR(d, set) (__FDS_BITS (set)[__FDELT (d)] &= ~__FDMASK (d)) @@ -149,11 +156,11 @@ /* mDNS port - 5353 mDNS multicast address - 224.0.0.251 */ #define SET_mDNS_ADD(sockaddr) sockaddr.sa_data[0] = 0x14; \ - sockaddr.sa_data[1] = 0xe9; \ - sockaddr.sa_data[2] = 0xe0; \ - sockaddr.sa_data[3] = 0x0; \ - sockaddr.sa_data[4] = 0x0; \ - sockaddr.sa_data[5] = 0xfb; + sockaddr.sa_data[1] = 0xe9; \ + sockaddr.sa_data[2] = 0xe0; \ + sockaddr.sa_data[3] = 0x0; \ + sockaddr.sa_data[4] = 0x0; \ + sockaddr.sa_data[5] = 0xfb; /***************************************************************************** * Public Types @@ -164,7 +171,7 @@ typedef struct _in_addr_t unsigned long s_addr; /* load with inet_aton() */ } in_addr; -typedef struct _sockaddr_t +typedef struct sockaddr { uint16_t sa_family; uint8_t sa_data[14]; |