CC3000 driver updates from David Sidrane

This commit is contained in:
Gregory Nutt 2013-10-23 09:12:09 -06:00
parent 4cf9540563
commit 5053d803e7
2 changed files with 21 additions and 16 deletions

View File

@ -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);
};
/****************************************************************************

View File

@ -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];