1
0
Fork 0
forked from nuttx/nuttx-update

drivers: nxstyle fixes

Fixes for errors reported by nxstyle

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This commit is contained in:
Alin Jerpelea 2021-04-04 11:58:11 +02:00 committed by Xiang Xiao
parent dd1d980c3a
commit e1d361eddf
75 changed files with 1883 additions and 1518 deletions

View file

@ -1559,7 +1559,8 @@ static int mcp2515_ioctl(FAR struct can_dev_s *dev, int cmd,
* PHSEG1 == PHSEG2 (PHSEG2 = TSEG2) * PHSEG1 == PHSEG2 (PHSEG2 = TSEG2)
* *
* See more at: * See more at:
* http://www.analog.com/en/analog-dialogue/articles/configure-can-bit-timing.html * http://www.analog.com/en/analog-dialogue/articles/
* configure-can-bit-timing.html
* *
*/ */

View file

@ -93,7 +93,8 @@
*/ */
/* Page 0: Commands and status */ /* Page 0: Commands and status */
/* 0x00 - reserved for future use */
/* 0x00 - reserved for future use */
#define MFRC522_COMMAND_REG (0x01 << 1) /* starts/stops command execution */ #define MFRC522_COMMAND_REG (0x01 << 1) /* starts/stops command execution */
#define MFRC522_COM_IEN_REG (0x02 << 1) /* dis/enable int. req. ctrl bits */ #define MFRC522_COM_IEN_REG (0x02 << 1) /* dis/enable int. req. ctrl bits */
#define MFRC522_DIV_IEN_REG (0x03 << 1) /* dis/enable int. req. ctrl bits */ #define MFRC522_DIV_IEN_REG (0x03 << 1) /* dis/enable int. req. ctrl bits */
@ -109,8 +110,10 @@
#define MFRC522_BIT_FRAMING_REG (0x0D << 1) /* adjustments for bit-oriented frames */ #define MFRC522_BIT_FRAMING_REG (0x0D << 1) /* adjustments for bit-oriented frames */
#define MFRC522_COLL_REG (0x0E << 1) /* bit position of first bit-collision detected */ #define MFRC522_COLL_REG (0x0E << 1) /* bit position of first bit-collision detected */
/* 0x0F - reserved for future use */ /* 0x0F - reserved for future use */
/* Page 1: Commands */ /* Page 1: Commands */
/* 0x10 - reserved for future use */
/* 0x10 - reserved for future use */
#define MFRC522_MODE_REG (0x11 << 1) /* defines general modes for transmit/receive */ #define MFRC522_MODE_REG (0x11 << 1) /* defines general modes for transmit/receive */
#define MFRC522_TX_MODE_REG (0x12 << 1) /* defines transmission data rate and framing */ #define MFRC522_TX_MODE_REG (0x12 << 1) /* defines transmission data rate and framing */
#define MFRC522_RX_MODE_REG (0x13 << 1) /* defines reception data rate and framing */ #define MFRC522_RX_MODE_REG (0x13 << 1) /* defines reception data rate and framing */
@ -128,7 +131,8 @@
#define MFRC522_SERIAL_SPD_REG (0x1F << 1) /* selects the speed of the serial UART */ #define MFRC522_SERIAL_SPD_REG (0x1F << 1) /* selects the speed of the serial UART */
/* Page 2: Configuration */ /* Page 2: Configuration */
/* 0x20 - reserved for future use */
/* 0x20 - reserved for future use */
#define MFRC522_CRC_RESULT_REGH (0x21 << 1) /* shows the MSB values of CRC calc. */ #define MFRC522_CRC_RESULT_REGH (0x21 << 1) /* shows the MSB values of CRC calc. */
#define MFRC522_CRC_RESULT_REGL (0x22 << 1) /* shows the LSB values of CRC calc. */ #define MFRC522_CRC_RESULT_REGL (0x22 << 1) /* shows the LSB values of CRC calc. */
/* 0x23 - reserved for future use */ /* 0x23 - reserved for future use */
@ -146,7 +150,8 @@
#define MFRC522_TCOUNT_VAL_REGL (0x2F << 1) /* shows the 16-bit timer value */ #define MFRC522_TCOUNT_VAL_REGL (0x2F << 1) /* shows the 16-bit timer value */
/* Page 3: Test Registers */ /* Page 3: Test Registers */
/* 0x30 - reserved for future use */
/* 0x30 - reserved for future use */
#define MFRC522_TEST_SEL1_REG (0x31 << 1) /* general test signal configuration */ #define MFRC522_TEST_SEL1_REG (0x31 << 1) /* general test signal configuration */
#define MFRC522_TEST_SEL2_REG (0x32 << 1) /* general test signal configuration */ #define MFRC522_TEST_SEL2_REG (0x32 << 1) /* general test signal configuration */
#define MFRC522_TEST_PIN_EN_REG (0x33 << 1) /* enables pin output driver on pins D1 to D7 */ #define MFRC522_TEST_PIN_EN_REG (0x33 << 1) /* enables pin output driver on pins D1 to D7 */
@ -172,6 +177,7 @@
# define MFRC522_TRANSCV_CMD 0x0C /* transmits data from FIFO and receive automatically */ # define MFRC522_TRANSCV_CMD 0x0C /* transmits data from FIFO and receive automatically */
# define MFRC522_MF_AUTH_CMD 0x0E /* performs the MIFARE stand authentication as a reader */ # define MFRC522_MF_AUTH_CMD 0x0E /* performs the MIFARE stand authentication as a reader */
# define MFRC522_SOFTRST_CMD 0x0F /* resets the MFRC522 */ # define MFRC522_SOFTRST_CMD 0x0F /* resets the MFRC522 */
#define MFRC522_POWER_DOWN (1 << 4) /* soft power-down mode entered */ #define MFRC522_POWER_DOWN (1 << 4) /* soft power-down mode entered */
#define MFRC522_RCV_OFF (1 << 5) /* turns off analog part of receiver */ #define MFRC522_RCV_OFF (1 << 5) /* turns off analog part of receiver */
@ -212,11 +218,11 @@
/* Section 9.3.1.7: ErrorReg register */ /* Section 9.3.1.7: ErrorReg register */
#define MFRC522_PROTO_ERR (1 << 0) /* set if the SOF is incorrect or during MFAuthent if data is incorrect */ #define MFRC522_PROTO_ERR (1 << 0) /* set if the SOF is incorrect or during MFAuthent if data is incorrect */
#define MFRC522_PARITY_ERR (1 << 1) /* parity check failed */ #define MFRC522_PARITY_ERR (1 << 1) /* parity check failed */
#define MFRC522_CRC_ERR (1 << 2) /* the RxCRCEn bit is set and the CRC calculation fails */ #define MFRC522_CRC_ERR (1 << 2) /* the RxCRCEn bit is set and the CRC calculation fails */
#define MFRC522_COLL_ERR (1 << 3) /* a bit-collision is detected */ #define MFRC522_COLL_ERR (1 << 3) /* a bit-collision is detected */
#define MFRC522_BUF_OVFL_ERR (1 << 4) /* FIFO is full and the host or internal state machine try to write data */ #define MFRC522_BUF_OVFL_ERR (1 << 4) /* FIFO is full and the host or internal state machine try to write data */
#define MFRC522_TEMP_ERR (1 << 6) /* internal temperature sensor detects overheating */ #define MFRC522_TEMP_ERR (1 << 6) /* internal temperature sensor detects overheating */
#define MFRC522_WR_ERR (1 << 7) /* data write error in the FIFO, host writing to FIFO at the wrong time */ #define MFRC522_WR_ERR (1 << 7) /* data write error in the FIFO, host writing to FIFO at the wrong time */
@ -281,6 +287,7 @@
#define MFRC522_CRC_PRESET_6363 (0x1) /* 6363h CRC preset value */ #define MFRC522_CRC_PRESET_6363 (0x1) /* 6363h CRC preset value */
#define MFRC522_CRC_PRESET_A671 (0x2) /* A671h CRC preset value */ #define MFRC522_CRC_PRESET_A671 (0x2) /* A671h CRC preset value */
#define MFRC522_CRC_PRESET_FFFF (0x3) /* FFFFh CRC preset value */ #define MFRC522_CRC_PRESET_FFFF (0x3) /* FFFFh CRC preset value */
#define MFRC522_POL_MFIN (1 << 3) /* defines the polarity of pin MFIN */ #define MFRC522_POL_MFIN (1 << 3) /* defines the polarity of pin MFIN */
#define MFRC522_TX_WAIT_RF (1 << 5) /* transmitter can only be started if an RF field is generated */ #define MFRC522_TX_WAIT_RF (1 << 5) /* transmitter can only be started if an RF field is generated */
#define MFRC522_MSB_FIRST (1 << 7) /* CRC coprocessor calculates the CRC with MSB first */ #define MFRC522_MSB_FIRST (1 << 7) /* CRC coprocessor calculates the CRC with MSB first */
@ -352,7 +359,7 @@
/* Section 9.3.2.9: RxThresholdReg register */ /* Section 9.3.2.9: RxThresholdReg register */
#define MFRC522_COLL_LEVEL_MASK (7) /* the minimum signal strength to generate a bit-collision */ #define MFRC522_COLL_LEVEL_MASK (7) /* the minimum signal strength to generate a bit-collision */
#define MFRC522_MIN_LEVEL_MASK (0xF << 4) /* the minimum signal strength that will be accepted */ #define MFRC522_MIN_LEVEL_MASK (0xF << 4) /* the minimum signal strength that will be accepted */
/* Section 9.3.2.10: DemodReg register */ /* Section 9.3.2.10: DemodReg register */

View file

@ -122,7 +122,8 @@
* EPF: 0 65k color format for RGB interface, not used set to default * EPF: 0 65k color format for RGB interface, not used set to default
* MDT: 0 Display data transfer mode, not used * MDT: 0 Display data transfer mode, not used
* *
* Note! If RGB666 and 16-bit 8080-I interface supported by the driver, MDT must * Note!
* If RGB666 and 16-bit 8080-I interface supported by the driver, MDT must
* be defined for each selected driver instance. Leave it empty for now. * be defined for each selected driver instance. Leave it empty for now.
*/ */
@ -131,7 +132,6 @@
#define ILI9341_IFCTL_PARAM2 ILI9341_IFCTL_EPF | ILI9341_IFCTL_MDT #define ILI9341_IFCTL_PARAM2 ILI9341_IFCTL_EPF | ILI9341_IFCTL_MDT
/* Parameter 3: 0x0000/0x0020 /* Parameter 3: 0x0000/0x0020
* *
* ENDIAN: 0/1 Depending on endian mode of the mcu? * ENDIAN: 0/1 Depending on endian mode of the mcu?
@ -153,7 +153,6 @@
#define ILI9341_IFCTL_PARAM3 ILI9341_IFCTL_RIM | ILI9341_IFCTL_RM | \ #define ILI9341_IFCTL_PARAM3 ILI9341_IFCTL_RIM | ILI9341_IFCTL_RM | \
ILI9341_IFCTL_DM | ILI9341_IFCTL_ENDIAN ILI9341_IFCTL_DM | ILI9341_IFCTL_ENDIAN
/* Memory access control (MADCTL) */ /* Memory access control (MADCTL) */
/* Landscape: 00100000 / 00101000 / h28 /* Landscape: 00100000 / 00101000 / h28
@ -299,13 +298,11 @@
#define ILI9341_PIXSET_18BITMCU_PARAM1 (ILI9341_PIXSET_18BITDPI | \ #define ILI9341_PIXSET_18BITMCU_PARAM1 (ILI9341_PIXSET_18BITDPI | \
ILI9341_PIXSET_18BITDBI) ILI9341_PIXSET_18BITDBI)
/* General fix display resolution */ /* General fix display resolution */
#define ILI9341_XRES 240 #define ILI9341_XRES 240
#define ILI9341_YRES 320 #define ILI9341_YRES 320
/* Validate configuration */ /* Validate configuration */
#if CONFIG_LCD_ILI9341_NINTERFACES < 1 #if CONFIG_LCD_ILI9341_NINTERFACES < 1
@ -314,7 +311,6 @@
# undef CONFIG_LCD_ILI9341_IFACE1 # undef CONFIG_LCD_ILI9341_IFACE1
#endif #endif
/* First LCD display */ /* First LCD display */
#ifdef CONFIG_LCD_ILI9341_IFACE0 #ifdef CONFIG_LCD_ILI9341_IFACE0
@ -416,7 +412,6 @@ struct ili9341_dev_s
uint8_t power; uint8_t power;
}; };
/**************************************************************************** /****************************************************************************
* Private Function Protototypes * Private Function Protototypes
****************************************************************************/ ****************************************************************************/
@ -462,9 +457,10 @@ static int ili9341_getrun1(fb_coord_t row, fb_coord_t col,
/* lcd configuration */ /* lcd configuration */
static int ili9341_getvideoinfo(FAR struct lcd_dev_s *dev, static int ili9341_getvideoinfo(FAR struct lcd_dev_s *dev,
FAR struct fb_videoinfo_s *vinfo); FAR struct fb_videoinfo_s *vinfo);
static int ili9341_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno, static int ili9341_getplaneinfo(FAR struct lcd_dev_s *dev,
FAR struct lcd_planeinfo_s *pinfo); unsigned int planeno,
FAR struct lcd_planeinfo_s *pinfo);
/* lcd specific controls */ /* lcd specific controls */
@ -541,7 +537,7 @@ static struct ili9341_dev_s g_lcddev[CONFIG_LCD_ILI9341_NINTERFACES] =
static inline uint16_t ili9341_getxres(FAR struct ili9341_dev_s *dev) static inline uint16_t ili9341_getxres(FAR struct ili9341_dev_s *dev)
{ {
if (dev->orient == ILI9341_MADCTL_LANDSCAPE_PARAM1 || if (dev->orient == ILI9341_MADCTL_LANDSCAPE_PARAM1 ||
dev->orient == ILI9341_MADCTL_RLANDSCAPE_PARAM1) dev->orient == ILI9341_MADCTL_RLANDSCAPE_PARAM1)
{ {
return ILI9341_YRES; return ILI9341_YRES;
} }
@ -549,7 +545,6 @@ static inline uint16_t ili9341_getxres(FAR struct ili9341_dev_s *dev)
return ILI9341_XRES; return ILI9341_XRES;
} }
/**************************************************************************** /****************************************************************************
* Name: ili9341_getyres * Name: ili9341_getyres
* *
@ -577,7 +572,6 @@ static inline uint16_t ili9341_getyres(FAR struct ili9341_dev_s *dev)
return ILI9341_YRES; return ILI9341_YRES;
} }
/**************************************************************************** /****************************************************************************
* Name: ili9341_selectarea * Name: ili9341_selectarea
* *
@ -594,7 +588,8 @@ static inline uint16_t ili9341_getyres(FAR struct ili9341_dev_s *dev)
****************************************************************************/ ****************************************************************************/
static void ili9341_selectarea(FAR struct ili9341_lcd_s *lcd, static void ili9341_selectarea(FAR struct ili9341_lcd_s *lcd,
uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1) uint16_t x0, uint16_t y0,
uint16_t x1, uint16_t y1)
{ {
/* Select column */ /* Select column */
@ -613,7 +608,6 @@ static void ili9341_selectarea(FAR struct ili9341_lcd_s *lcd,
lcd->sendparam(lcd, (y1 & 0xff)); lcd->sendparam(lcd, (y1 & 0xff));
} }
/**************************************************************************** /****************************************************************************
* Name: ili9341_putrun * Name: ili9341_putrun
* *
@ -645,6 +639,7 @@ static int ili9341_putrun(int devno, fb_coord_t row, fb_coord_t col,
DEBUGASSERT(buffer && ((uintptr_t)buffer & 1) == 0); DEBUGASSERT(buffer && ((uintptr_t)buffer & 1) == 0);
/* Check if position outside of area */ /* Check if position outside of area */
if (col + npixels > ili9341_getxres(dev) || row > ili9341_getyres(dev)) if (col + npixels > ili9341_getxres(dev) || row > ili9341_getyres(dev))
{ {
return -EINVAL; return -EINVAL;
@ -673,7 +668,6 @@ static int ili9341_putrun(int devno, fb_coord_t row, fb_coord_t col,
return OK; return OK;
} }
/**************************************************************************** /****************************************************************************
* Name: ili9341_getrun * Name: ili9341_getrun
* *
@ -706,6 +700,7 @@ static int ili9341_getrun(int devno, fb_coord_t row, fb_coord_t col,
DEBUGASSERT(buffer && ((uintptr_t)buffer & 1) == 0); DEBUGASSERT(buffer && ((uintptr_t)buffer & 1) == 0);
/* Check if position outside of area */ /* Check if position outside of area */
if (col + npixels > ili9341_getxres(dev) || row > ili9341_getyres(dev)) if (col + npixels > ili9341_getxres(dev) || row > ili9341_getyres(dev))
{ {
return -EINVAL; return -EINVAL;
@ -785,7 +780,8 @@ static int ili9341_hwinitialize(FAR struct ili9341_dev_s *dev)
lcd->sendcmd(lcd, ILI9341_SOFTWARE_RESET); lcd->sendcmd(lcd, ILI9341_SOFTWARE_RESET);
up_mdelay(5); up_mdelay(5);
lcdinfo("ili9341 LCD driver: set Memory Access Control: %04x\n", dev->orient); lcdinfo("ili9341 LCD driver: set Memory Access Control: %04x\n",
dev->orient);
lcd->sendcmd(lcd, ILI9341_MEMORY_ACCESS_CONTROL); lcd->sendcmd(lcd, ILI9341_MEMORY_ACCESS_CONTROL);
lcd->sendparam(lcd, dev->orient); lcd->sendparam(lcd, dev->orient);
@ -828,7 +824,6 @@ static int ili9341_hwinitialize(FAR struct ili9341_dev_s *dev)
return OK; return OK;
} }
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@ -869,7 +864,6 @@ static int ili9341_putrun1(fb_coord_t row, fb_coord_t col,
} }
#endif #endif
/**************************************************************************** /****************************************************************************
* Name: ili9341_getrunx * Name: ili9341_getrunx
* *
@ -908,7 +902,6 @@ static int ili9341_getrun1(fb_coord_t row, fb_coord_t col,
# endif # endif
#endif #endif
/**************************************************************************** /****************************************************************************
* Name: ili9341_getvideoinfo * Name: ili9341_getvideoinfo
* *
@ -965,8 +958,9 @@ static int ili9341_getvideoinfo(FAR struct lcd_dev_s *dev,
* *
****************************************************************************/ ****************************************************************************/
static int ili9341_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno, static int ili9341_getplaneinfo(FAR struct lcd_dev_s *dev,
FAR struct lcd_planeinfo_s *pinfo) unsigned int planeno,
FAR struct lcd_planeinfo_s *pinfo)
{ {
if (dev && pinfo && planeno == 0) if (dev && pinfo && planeno == 0)
{ {
@ -991,7 +985,8 @@ static int ili9341_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno,
* Name: ili9341_getpower * Name: ili9341_getpower
* *
* Description: * Description:
* Get the LCD panel power status (0: full off - CONFIG_LCD_MAXPOWER: full on. * Get the LCD panel power status
* (0: full off - CONFIG_LCD_MAXPOWER: full on.
* On backlit LCDs, this setting may correspond to the backlight setting. * On backlit LCDs, this setting may correspond to the backlight setting.
* *
* Input Parameters: * Input Parameters:
@ -1022,7 +1017,8 @@ static int ili9341_getpower(FAR struct lcd_dev_s *dev)
* Name: ili9341_setpower * Name: ili9341_setpower
* *
* Description: * Description:
* Enable/disable LCD panel power (0: full off - CONFIG_LCD_MAXPOWER: full on). * Enable/disable LCD panel power
* (0: full off - CONFIG_LCD_MAXPOWER: full on).
* On backlight LCDs, this setting may correspond to the backlight setting. * On backlight LCDs, this setting may correspond to the backlight setting.
* *
* Input Parameters: * Input Parameters:
@ -1119,7 +1115,6 @@ static int ili9341_setcontrast(struct lcd_dev_s *dev, unsigned int contrast)
return -ENOSYS; return -ENOSYS;
} }
/**************************************************************************** /****************************************************************************
* Name: ili9341_initialize * Name: ili9341_initialize
* *
@ -1131,15 +1126,15 @@ static int ili9341_setcontrast(struct lcd_dev_s *dev, unsigned int contrast)
* *
* Input Parameters: * Input Parameters:
* *
* lcd - A reference to the platform specific driver instance to control the * lcd - A reference to the platform specific driver instance to control
* ili9341 display driver. * the ili9341 display driver.
* devno - A value in the range of 0 through CONFIG_ILI9341_NINTERFACES-1. * devno - A value in the range of 0 through CONFIG_ILI9341_NINTERFACES-1.
* This allows support for multiple LCD devices. * This allows support for multiple LCD devices.
* *
* Returned Value: * Returned Value:
* *
* On success, this function returns a reference to the LCD driver object for * On success, this function returns a reference to the LCD driver object
* the specified LCD driver. NULL is returned on any failure. * for the specified LCD driver. NULL is returned on any failure.
* *
****************************************************************************/ ****************************************************************************/
@ -1186,9 +1181,9 @@ FAR struct lcd_dev_s *
* *
* Description: * Description:
* This is a non-standard LCD interface. Because of the various rotations, * This is a non-standard LCD interface. Because of the various rotations,
* clearing the display in the normal way by writing a sequences of runs that * clearing the display in the normal way by writing a sequences of runs
* covers the entire display can be very slow. Here the display is cleared by * that covers the entire display can be very slow. Here the display is
* simply setting all GRAM memory to the specified color. * cleared by simply setting all GRAM memory to the specified color.
* *
* Input Parameters: * Input Parameters:
* dev - A reference to the lcd driver structure * dev - A reference to the lcd driver structure

View file

@ -396,7 +396,7 @@ struct ssd1351_dev_s
*/ */
#ifdef CONFIG_SSD1351_SPI3WIRE #ifdef CONFIG_SSD1351_SPI3WIRE
uint16_t rowbuffer[SSD1351_STRIDE+1]; uint16_t rowbuffer[SSD1351_STRIDE + 1];
#endif #endif
}; };
@ -617,12 +617,12 @@ static void ssd1351_write(FAR struct ssd1351_dev_s *priv, uint8_t cmd,
for (i = 0; i < datlen; i++) for (i = 0; i < datlen; i++)
{ {
priv->rowbuffer[i+1] = (uint16_t)data[i] | SSD1351_SPIDATA; priv->rowbuffer[i + 1] = (uint16_t)data[i] | SSD1351_SPIDATA;
} }
/* Send the line buffer */ /* Send the line buffer */
SPI_SNDBLOCK(priv->spi, priv->rowbuffer, datlen+1); SPI_SNDBLOCK(priv->spi, priv->rowbuffer, datlen + 1);
} }
#elif defined(CONFIG_SSD1351_SPI4WIRE) #elif defined(CONFIG_SSD1351_SPI4WIRE)
static void ssd1351_write(FAR struct ssd1351_dev_s *priv, uint8_t cmd, static void ssd1351_write(FAR struct ssd1351_dev_s *priv, uint8_t cmd,
@ -721,7 +721,7 @@ static int ssd1351_putrun(fb_coord_t row, fb_coord_t col,
/* Sanity check */ /* Sanity check */
DEBUGASSERT(buffer != NULL && ((uintptr_t)buffer & 1) == 0 && DEBUGASSERT(buffer != NULL && ((uintptr_t)buffer & 1) == 0 &&
col >= 0 && col+npixels <= SSD1351_XRES && col >= 0 && col + npixels <= SSD1351_XRES &&
row >= 0 && row < SSD1351_YRES); row >= 0 && row < SSD1351_YRES);
/* Select and lock the device */ /* Select and lock the device */
@ -768,7 +768,7 @@ static int ssd1351_getrun(fb_coord_t row, fb_coord_t col,
/* Sanity check */ /* Sanity check */
DEBUGASSERT(buffer != NULL && ((uintptr_t)buffer & 1) == 0 && DEBUGASSERT(buffer != NULL && ((uintptr_t)buffer & 1) == 0 &&
col >= 0 && col+npixels <= SSD1351_XRES && col >= 0 && col + npixels <= SSD1351_XRES &&
row >= 0 && row < SSD1351_YRES); row >= 0 && row < SSD1351_YRES);
/* Select and lock the device */ /* Select and lock the device */

View file

@ -70,9 +70,9 @@
/* Single-Byte Instructions */ /* Single-Byte Instructions */
/* Because all single byte instructions are fixed length with no optional /* Because all single byte instructions are fixed length with no optional
* parameters, it is possible to execute any instruction immediately following * parameters, it is possible to execute any instruction immediately
* the execution of any single byte instruction without deasserting the chip * following the execution of any single byte instruction without deasserting
* select line in between. * the chip select line in between.
*/ */
#define ENC_B0SEL (0xc0) /* Selects SFR Bank 0 */ #define ENC_B0SEL (0xc0) /* Selects SFR Bank 0 */
@ -342,8 +342,8 @@
/* Unbanked Register Addresses */ /* Unbanked Register Addresses */
#if 0 #if 0
/* Disabled to prevent accidental use. All unbanked operations are implemented /* Disabled to prevent accidental use. All unbanked operations are
* using the specific manipulation commands. * implemented using the specific manipulation commands.
*/ */
#define ENC_EGPDATA 0x80 #define ENC_EGPDATA 0x80
#define ENC_ERXDATA 0x82 #define ENC_ERXDATA 0x82

View file

@ -320,11 +320,13 @@ static int aht10_read_values(FAR struct aht10_dev_s *priv, FAR int *temp,
/* Humidity data (20bits). */ /* Humidity data (20bits). */
rh20 = ((buf[1] << 12) | (buf[2] << 4) | ((buf[3] & 0xf0) >> 4)) & 0x000fffff; rh20 = ((buf[1] << 12) | (buf[2] << 4) |
((buf[3] & 0xf0) >> 4)) & 0x000fffff;
/* Temperature data (20bits). */ /* Temperature data (20bits). */
temp20 = (((buf[3] & 0x0f) << 16) | (buf[4] << 8) | buf[5]) & 0x000fffff; temp20 = (((buf[3] & 0x0f) << 16) |
(buf[4] << 8) | buf[5]) & 0x000fffff;
add_sensor_randomness((int)temp20 << 16 | rh20); add_sensor_randomness((int)temp20 << 16 | rh20);
@ -431,7 +433,8 @@ static int aht10_close(FAR struct file *filep)
* Name: aht10_read * Name: aht10_read
****************************************************************************/ ****************************************************************************/
static ssize_t aht10_read(FAR struct file *filep, FAR char *buffer, size_t buflen) static ssize_t aht10_read(FAR struct file *filep,
FAR char *buffer, size_t buflen)
{ {
FAR struct inode *inode = filep->f_inode; FAR struct inode *inode = filep->f_inode;
FAR struct aht10_dev_s *priv = inode->i_private; FAR struct aht10_dev_s *priv = inode->i_private;

View file

@ -78,16 +78,20 @@ static int as5048b_readu16(FAR struct as5048b_dev_s *priv, uint8_t regaddrhi,
uint8_t regaddrlo, FAR uint16_t *regval); uint8_t regaddrlo, FAR uint16_t *regval);
static int as5048b_writeu8(FAR struct as5048b_dev_s *priv, uint8_t regaddr, static int as5048b_writeu8(FAR struct as5048b_dev_s *priv, uint8_t regaddr,
uint8_t regval); uint8_t regval);
static int as5048b_writeu16(FAR struct as5048b_dev_s *priv, uint8_t regaddrhi, static int as5048b_writeu16(FAR struct as5048b_dev_s *priv,
uint8_t regaddrhi,
uint8_t regaddrlo, uint16_t regval); uint8_t regaddrlo, uint16_t regval);
static int as5048b_readzero(FAR struct as5048b_dev_s *priv, static int as5048b_readzero(FAR struct as5048b_dev_s *priv,
FAR uint16_t *zero); FAR uint16_t *zero);
static int as5048b_writezero(FAR struct as5048b_dev_s *priv, uint16_t zero); static int as5048b_writezero(FAR struct as5048b_dev_s *priv, uint16_t zero);
static int as5048b_readagc(FAR struct as5048b_dev_s *priv, FAR uint8_t *agc); static int as5048b_readagc(FAR struct as5048b_dev_s *priv,
FAR uint8_t *agc);
static int as5048b_readdiag(FAR struct as5048b_dev_s *priv, static int as5048b_readdiag(FAR struct as5048b_dev_s *priv,
FAR uint8_t *diag); FAR uint8_t *diag);
static int as5048b_readmag(FAR struct as5048b_dev_s *priv, FAR uint16_t *mag); static int as5048b_readmag(FAR struct as5048b_dev_s *priv,
static int as5048b_readang(FAR struct as5048b_dev_s *priv, FAR uint16_t *ang); FAR uint16_t *mag);
static int as5048b_readang(FAR struct as5048b_dev_s *priv,
FAR uint16_t *ang);
/* Character Driver Methods */ /* Character Driver Methods */
@ -244,7 +248,8 @@ static int as5048b_writeu8(FAR struct as5048b_dev_s *priv, uint8_t regaddr,
* *
****************************************************************************/ ****************************************************************************/
static int as5048b_writeu16(FAR struct as5048b_dev_s *priv, uint8_t regaddrhi, static int as5048b_writeu16(FAR struct as5048b_dev_s *priv,
uint8_t regaddrhi,
uint8_t regaddrlo, uint16_t regval) uint8_t regaddrlo, uint16_t regval)
{ {
int ret; int ret;
@ -350,7 +355,8 @@ static int as5048b_readagc(FAR struct as5048b_dev_s *priv, FAR uint8_t *agc)
* *
****************************************************************************/ ****************************************************************************/
static int as5048b_readdiag(FAR struct as5048b_dev_s *priv, FAR uint8_t *diag) static int as5048b_readdiag(FAR struct as5048b_dev_s *priv,
FAR uint8_t *diag)
{ {
int ret; int ret;
@ -373,7 +379,8 @@ static int as5048b_readdiag(FAR struct as5048b_dev_s *priv, FAR uint8_t *diag)
* *
****************************************************************************/ ****************************************************************************/
static int as5048b_readmag(FAR struct as5048b_dev_s *priv, FAR uint16_t *mag) static int as5048b_readmag(FAR struct as5048b_dev_s *priv,
FAR uint16_t *mag)
{ {
int ret; int ret;
@ -396,7 +403,8 @@ static int as5048b_readmag(FAR struct as5048b_dev_s *priv, FAR uint16_t *mag)
* *
****************************************************************************/ ****************************************************************************/
static int as5048b_readang(FAR struct as5048b_dev_s *priv, FAR uint16_t *ang) static int as5048b_readang(FAR struct as5048b_dev_s *priv,
FAR uint16_t *ang)
{ {
int ret; int ret;
@ -529,7 +537,9 @@ static int as5048b_ioctl(FAR struct qe_lowerhalf_s *lower, int cmd,
} }
break; break;
/* Read from the automatic gain control register. Arg: uint8_t* pointer. */ /* Read from the automatic gain control register.
* Arg: uint8_t* pointer.
*/
case QEIOC_AUTOGAINCTL: case QEIOC_AUTOGAINCTL:
{ {
@ -592,13 +602,15 @@ static int as5048b_ioctl(FAR struct qe_lowerhalf_s *lower, int cmd,
* addr - The I2C address of the AS5048B. * addr - The I2C address of the AS5048B.
* *
* Returned Value: * Returned Value:
* A new lower half quadrature encoder interface for the AS5048B on success; * A new lower half quadrature encoder interface for the AS5048B on
* success;
* NULL on failure. * NULL on failure.
* *
****************************************************************************/ ****************************************************************************/
FAR struct qe_lowerhalf_s *as5048b_initialize(FAR struct i2c_master_s *i2c, FAR struct qe_lowerhalf_s *as5048b_initialize(FAR struct i2c_master_s *i2c,
uint8_t addr, uint32_t frequency) uint8_t addr,
uint32_t frequency)
{ {
FAR struct as5048b_dev_s *priv; FAR struct as5048b_dev_s *priv;

View file

@ -481,7 +481,7 @@ int as726x_register(FAR const char *devpath, FAR struct i2c_master_s *i2c)
} }
value = ret; value = ret;
value &= 0b11001111; /* Clear GAIN bits */ value &= 0b11001111; /* Clear GAIN bits */
value |= (AS726X_GAIN << 4); /* Set GAIN bits with user's choice */ value |= (AS726X_GAIN << 4); /* Set GAIN bits with user's choice */
as726x_write8(priv, AS726x_CONTROL_SETUP, value); as726x_write8(priv, AS726x_CONTROL_SETUP, value);
@ -494,7 +494,7 @@ int as726x_register(FAR const char *devpath, FAR struct i2c_master_s *i2c)
} }
value = ret; value = ret;
value &= 0b11110011; /* Clear BANK bits */ value &= 0b11110011; /* Clear BANK bits */
value |= (AS726X_MEASURMENT_MODE << 2); /* Set BANK bits with user's value |= (AS726X_MEASURMENT_MODE << 2); /* Set BANK bits with user's
* choice */ * choice */

View file

@ -113,9 +113,11 @@ struct ina3221_dev_s
/* I2C Helpers */ /* I2C Helpers */
static int ina3221_write16(FAR struct ina3221_dev_s *priv, uint8_t regaddr, static int ina3221_write16(FAR struct ina3221_dev_s *priv,
FAR uint16_t regvalue); uint8_t regaddr,
static int ina3221_read16(FAR struct ina3221_dev_s *priv, uint8_t regaddr, FAR uint16_t regvalue);
static int ina3221_read16(FAR struct ina3221_dev_s *priv,
uint8_t regaddr,
FAR uint16_t *regvalue); FAR uint16_t *regvalue);
static int ina3221_readpower(FAR struct ina3221_dev_s *priv, static int ina3221_readpower(FAR struct ina3221_dev_s *priv,
FAR struct ina3221_s *buffer); FAR struct ina3221_s *buffer);
@ -160,15 +162,18 @@ static int ina3221_access(FAR struct ina3221_dev_s *priv,
struct i2c_msg_s msg[I2C_NOSTARTSTOP_MSGS]; struct i2c_msg_s msg[I2C_NOSTARTSTOP_MSGS];
int ret; int ret;
msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].frequency = CONFIG_INA3221_I2C_FREQUENCY; msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].frequency =
CONFIG_INA3221_I2C_FREQUENCY;
msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].addr = priv->addr; msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].addr = priv->addr;
msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].flags = 0; msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].flags = 0;
msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].buffer = &start_register_address; msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].buffer = &start_register_address;
msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].length = 1; msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].length = 1;
msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].addr = msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].addr; msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].addr =
msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].flags = reading ? I2C_M_READ : 0; msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].addr;
msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].flags =
reading ? I2C_M_READ : 0;
msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].buffer = register_value; msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].buffer = register_value;
msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].length = data_length; msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].length = data_length;
@ -399,7 +404,8 @@ static int ina3221_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
* *
* Input Parameters: * Input Parameters:
* devpath - The full path to the driver to register. E.g., "/dev/pwrmntr0" * devpath - The full path to the driver to register. E.g., "/dev/pwrmntr0"
* i2c - An instance of the I2C interface to use to communicate with INA3221 * i2c - An instance of the I2C interface to use to communicate with
* INA3221
* config - Configuration including I2C address, shunt values, and INA3221 * config - Configuration including I2C address, shunt values, and INA3221
* configuration mask. * configuration mask.
* *
@ -420,7 +426,8 @@ int ina3221_register(FAR const char *devpath, FAR struct i2c_master_s *i2c,
/* Initialize the ina3221 device structure */ /* Initialize the ina3221 device structure */
priv = (FAR struct ina3221_dev_s *)kmm_malloc(sizeof(struct ina3221_dev_s)); priv = (FAR struct ina3221_dev_s *)
kmm_malloc(sizeof(struct ina3221_dev_s));
if (priv == NULL) if (priv == NULL)
{ {
snerr("ERROR: Failed to allocate instance\n"); snerr("ERROR: Failed to allocate instance\n");

View file

@ -148,7 +148,8 @@ static int lis2dh_read_temp(FAR struct lis2dh_dev_s *dev,
static int lis2dh_clear_interrupts(FAR struct lis2dh_dev_s *priv, static int lis2dh_clear_interrupts(FAR struct lis2dh_dev_s *priv,
uint8_t interrupts); uint8_t interrupts);
static unsigned int lis2dh_get_fifo_readings(FAR struct lis2dh_dev_s *priv, static unsigned int lis2dh_get_fifo_readings(FAR struct lis2dh_dev_s *priv,
FAR struct lis2dh_result *res, unsigned int readcount, FAR struct lis2dh_result *res,
unsigned int readcount,
FAR int *perr); FAR int *perr);
#ifdef CONFIG_LIS2DH_DRIVER_SELFTEST #ifdef CONFIG_LIS2DH_DRIVER_SELFTEST
static int lis2dh_handle_selftest(FAR struct lis2dh_dev_s *priv); static int lis2dh_handle_selftest(FAR struct lis2dh_dev_s *priv);
@ -214,8 +215,8 @@ static int lis2dh_open(FAR struct file *filep)
if (lis2dh_access(priv, ST_LIS2DH_WHOAMI_REG, &regval, 1) > 0) if (lis2dh_access(priv, ST_LIS2DH_WHOAMI_REG, &regval, 1) > 0)
{ {
/* Check chip identification, in the future several more compatible parts /* Check chip identification, in the future several more compatible
* may be added here. * parts may be added here.
*/ */
if (regval == ST_LIS2DH_WHOAMI_VALUE) if (regval == ST_LIS2DH_WHOAMI_VALUE)
@ -382,7 +383,8 @@ static ssize_t lis2dh_read(FAR struct file *filep, FAR char *buffer,
} }
else /* FIFO modes */ else /* FIFO modes */
{ {
uint8_t fifo_mode = priv->setup->fifo_mode & ST_LIS2DH_FIFOCR_MODE_MASK; uint8_t fifo_mode = priv->setup->fifo_mode &
ST_LIS2DH_FIFOCR_MODE_MASK;
bool fifo_empty = false; bool fifo_empty = false;
uint8_t fifo_num_samples; uint8_t fifo_num_samples;
@ -468,8 +470,8 @@ static ssize_t lis2dh_read(FAR struct file *filep, FAR char *buffer,
} }
} }
/* Make sure interrupt will get cleared (by reading this register) in case of /* Make sure interrupt will get cleared (by reading this register) in case
* latched configuration. * of latched configuration.
*/ */
buf = 0; buf = 0;
@ -491,8 +493,8 @@ static ssize_t lis2dh_read(FAR struct file *filep, FAR char *buffer,
ptr->header.int1_occurred = false; ptr->header.int1_occurred = false;
} }
/* Make sure interrupt will get cleared (by reading this register) in case of /* Make sure interrupt will get cleared (by reading this register) in case
* latched configuration. * of latched configuration.
*/ */
buf = 0; buf = 0;
@ -574,7 +576,8 @@ static int lis2dh_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
/* Write to the configuration registers. */ /* Write to the configuration registers. */
ret = lis2dh_setup(priv, (struct lis2dh_setup *)arg); ret = lis2dh_setup(priv, (struct lis2dh_setup *)arg);
lis2dh_dbg("lis2dh: conf: %p ret: %d\n", (struct lis2dh_setup *)arg, ret); lis2dh_dbg("lis2dh: conf: %p ret: %d\n",
(struct lis2dh_setup *)arg, ret);
/* Make sure interrupt will get cleared in /* Make sure interrupt will get cleared in
* case of latched configuration. * case of latched configuration.
@ -757,10 +760,10 @@ static void lis2dh_notify(FAR struct lis2dh_dev_s *priv)
int i; int i;
/* If there are threads waiting on poll() for LIS2DH data to become available, /* If there are threads waiting on poll() for LIS2DH data to become
* then wake them up now. NOTE: we wake up all waiting threads because we * available, then wake them up now. NOTE: we wake up all waiting threads
* do not know that they are going to do. If they all try to read the data, * because we do not know that they are going to do. If they all try to
* then some make end up blocking after all. * read the data, then some make end up blocking after all.
*/ */
for (i = 0; i < CONFIG_LIS2DH_NPOLLWAITERS; i++) for (i = 0; i < CONFIG_LIS2DH_NPOLLWAITERS; i++)
@ -830,7 +833,8 @@ static int lis2dh_clear_registers(FAR struct lis2dh_dev_s *priv)
{ {
/* Skip read only registers */ /* Skip read only registers */
if ((i <= 0x1e) || (i >= 0x27 && i <= 0x2d) || (i == 0x2f) || (i == 0x31)) if ((i <= 0x1e) || (i >= 0x27 && i <= 0x2d) ||
(i == 0x2f) || (i == 0x31))
{ {
continue; continue;
} }
@ -887,7 +891,8 @@ static int lis2dh_write_register(FAR struct lis2dh_dev_s *priv, uint8_t reg,
* reg - register to read * reg - register to read
* *
* Returned Value: * Returned Value:
* Returns positive register value in case of success, otherwise ERROR ( < 0) * Returns positive register value in case of success,
* otherwise ERROR ( < 0)
****************************************************************************/ ****************************************************************************/
static int lis2dh_read_register(FAR struct lis2dh_dev_s *priv, uint8_t reg) static int lis2dh_read_register(FAR struct lis2dh_dev_s *priv, uint8_t reg)
@ -1266,9 +1271,12 @@ static FAR const struct lis2dh_vector_s *
if (lis2dh_access(dev, ST_LIS2DH_OUT_X_L_REG, retval, if (lis2dh_access(dev, ST_LIS2DH_OUT_X_L_REG, retval,
sizeof(retval)) == sizeof(retval)) sizeof(retval)) == sizeof(retval))
{ {
dev->vector_data.x = lis2dh_raw_convert_to_12bit(retval[1], retval[0]); dev->vector_data.x = lis2dh_raw_convert_to_12bit(retval[1],
dev->vector_data.y = lis2dh_raw_convert_to_12bit(retval[3], retval[2]); retval[0]);
dev->vector_data.z = lis2dh_raw_convert_to_12bit(retval[5], retval[4]); dev->vector_data.y = lis2dh_raw_convert_to_12bit(retval[3],
retval[2]);
dev->vector_data.z = lis2dh_raw_convert_to_12bit(retval[5],
retval[4]);
return &dev->vector_data; return &dev->vector_data;
} }
@ -1422,7 +1430,8 @@ static unsigned int lis2dh_get_fifo_readings(FAR struct lis2dh_dev_s *priv,
return 0; return 0;
} }
if (lis2dh_access(priv, ST_LIS2DH_OUT_X_L_REG, (void *)buf, buflen) != buflen) if (lis2dh_access(priv, ST_LIS2DH_OUT_X_L_REG,
(void *)buf, buflen) != buflen)
{ {
lis2dh_dbg("lis2dh: Failed to read FIFO (%d bytes, %d samples)\n", lis2dh_dbg("lis2dh: Failed to read FIFO (%d bytes, %d samples)\n",
buflen, readcount); buflen, readcount);
@ -1475,7 +1484,8 @@ static unsigned int lis2dh_get_fifo_readings(FAR struct lis2dh_dev_s *priv,
* *
****************************************************************************/ ****************************************************************************/
static inline int16_t lis2dh_raw_to_mg(uint8_t raw_hibyte, uint8_t raw_lobyte, static inline int16_t lis2dh_raw_to_mg(uint8_t raw_hibyte,
uint8_t raw_lobyte,
int scale) int scale)
{ {
int16_t value; int16_t value;
@ -1500,7 +1510,8 @@ static inline int16_t lis2dh_raw_to_mg(uint8_t raw_hibyte, uint8_t raw_lobyte,
* *
****************************************************************************/ ****************************************************************************/
static int lis2dh_read_temp(FAR struct lis2dh_dev_s *dev, FAR int16_t *temper) static int lis2dh_read_temp(FAR struct lis2dh_dev_s *dev,
FAR int16_t *temper)
{ {
int ret; int ret;
uint8_t buf[2] = uint8_t buf[2] =
@ -1574,7 +1585,8 @@ static int lis2dh_access(FAR struct lis2dh_dev_s *dev, uint8_t subaddr,
} }
} }
else if (subaddr >= ST_LIS2DH_TEMP_CFG_REG && subaddr <= ST_LIS2DH_ACT_DUR_REG) else if (subaddr >= ST_LIS2DH_TEMP_CFG_REG &&
subaddr <= ST_LIS2DH_ACT_DUR_REG)
{ {
if (subaddr == ST_LIS2DH_OUT_X_L_REG) if (subaddr == ST_LIS2DH_OUT_X_L_REG)
{ {
@ -1817,9 +1829,12 @@ static int lis2dh_setup(FAR struct lis2dh_dev_s * dev,
/* CTRL_REG5 */ /* CTRL_REG5 */
value = dev->setup->reboot | dev->setup->fifo_enable | dev->setup->int1_latch | value = dev->setup->reboot |
dev->setup->int1_4d_enable | dev->setup->int2_latch | dev->setup->fifo_enable |
dev->setup->int2_4d_enable; dev->setup->int1_latch |
dev->setup->int1_4d_enable |
dev->setup->int2_latch |
dev->setup->int2_4d_enable;
if (lis2dh_access(dev, ST_LIS2DH_CTRL_REG5, &value, -1) != 1) if (lis2dh_access(dev, ST_LIS2DH_CTRL_REG5, &value, -1) != 1)
{ {
goto error; goto error;
@ -1915,9 +1930,12 @@ static int lis2dh_setup(FAR struct lis2dh_dev_s * dev,
/* CLICK_CFG */ /* CLICK_CFG */
value = dev->setup->z_double_click_enable | dev->setup->z_single_click_enable | value = dev->setup->z_double_click_enable |
dev->setup->y_double_click_enable | dev->setup->y_single_click_enable | dev->setup->z_single_click_enable |
dev->setup->x_double_click_enable | dev->setup->x_single_click_enable; dev->setup->y_double_click_enable |
dev->setup->y_single_click_enable |
dev->setup->x_double_click_enable |
dev->setup->x_single_click_enable;
if (lis2dh_access(dev, ST_LIS2DH_CLICK_CFG_REG, &value, -1) != 1) if (lis2dh_access(dev, ST_LIS2DH_CLICK_CFG_REG, &value, -1) != 1)
{ {
goto error; goto error;
@ -2020,10 +2038,11 @@ error:
* *
* Input Parameters: * Input Parameters:
* devpath - The full path to the driver to register. E.g., "/dev/acc0" * devpath - The full path to the driver to register. E.g., "/dev/acc0"
* i2c - An instance of the I2C interface to use to communicate with LIS2DH * i2c - An instance of the I2C interface to use to communicate with
* addr - The I2C address of the LIS2DH. The base I2C address of the LIS2DH * LIS2DH
* is 0x18. Bit 0 can be controlled via SA0 pad - when connected to * addr - The I2C address of the LIS2DH. The base I2C address of the
* voltage supply the address is 0x19. * LIS2DH is 0x18. Bit 0 can be controlled via SA0 pad - when
* connected to voltage supply the address is 0x19.
* config - Pointer to LIS2DH configuration * config - Pointer to LIS2DH configuration
* *
* Returned Value: * Returned Value:

View file

@ -105,7 +105,8 @@ static ssize_t lm92_read(FAR struct file *filep, FAR char *buffer,
size_t buflen); size_t buflen);
static ssize_t lm92_write(FAR struct file *filep, FAR const char *buffer, static ssize_t lm92_write(FAR struct file *filep, FAR const char *buffer,
size_t buflen); size_t buflen);
static int lm92_ioctl(FAR struct file *filep, int cmd, unsigned long arg); static int lm92_ioctl(FAR struct file *filep,
int cmd, unsigned long arg);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@ -215,7 +216,8 @@ static int lm92_readb16(FAR struct lm92_dev_s *priv, uint8_t regaddr,
return ret; return ret;
} }
/* Data format is: TTTTTTTT TTTTTxxx where TTTTTTTTTTTTT is a thirteen-bit, /* Data format is:
* TTTTTTTT TTTTTxxx where TTTTTTTTTTTTT is a thirteen-bit,
* signed temperature value with LSB = 0.0625 degrees Centigrade. * signed temperature value with LSB = 0.0625 degrees Centigrade.
*/ */
@ -230,7 +232,8 @@ static int lm92_readb16(FAR struct lm92_dev_s *priv, uint8_t regaddr,
* Name: lm92_writeb16 * Name: lm92_writeb16
* *
* Description: * Description:
* Write to a 16-bit register (LM92_TEMP_REG, LM92_THYS_REG, LM92_TCRIT_REG, * Write to a 16-bit register
* (LM92_TEMP_REG, LM92_THYS_REG, LM92_TCRIT_REG,
* LM92_TLOW_REG, LM92_THIGH_REG, or LM92_ID_REG) * LM92_TLOW_REG, LM92_THIGH_REG, or LM92_ID_REG)
* *
****************************************************************************/ ****************************************************************************/

View file

@ -202,6 +202,7 @@
# define LSM9DS1_CTRL_REG1_G_FS_G_245DPS (0 << LSM9DS1_CTRL_REG1_G_FS_G_SHIFT) /* 245 dps */ # define LSM9DS1_CTRL_REG1_G_FS_G_245DPS (0 << LSM9DS1_CTRL_REG1_G_FS_G_SHIFT) /* 245 dps */
# define LSM9DS1_CTRL_REG1_G_FS_G_500DPS (1 << LSM9DS1_CTRL_REG1_G_FS_G_SHIFT) /* 500 dps */ # define LSM9DS1_CTRL_REG1_G_FS_G_500DPS (1 << LSM9DS1_CTRL_REG1_G_FS_G_SHIFT) /* 500 dps */
# define LSM9DS1_CTRL_REG1_G_FS_G_2000DPS (3 << LSM9DS1_CTRL_REG1_G_FS_G_SHIFT) /* 2000 dps */ # define LSM9DS1_CTRL_REG1_G_FS_G_2000DPS (3 << LSM9DS1_CTRL_REG1_G_FS_G_SHIFT) /* 2000 dps */
#define LSM9DS1_CTRL_REG1_G_ODR_G_SHIFT 5 /* Gyroscope bandwidth selection */ #define LSM9DS1_CTRL_REG1_G_ODR_G_SHIFT 5 /* Gyroscope bandwidth selection */
#define LSM9DS1_CTRL_REG1_G_ODR_G_MASK (7 << LSM9DS1_CTRL_REG1_G_ODR_G_SHIFT) #define LSM9DS1_CTRL_REG1_G_ODR_G_MASK (7 << LSM9DS1_CTRL_REG1_G_ODR_G_SHIFT)
# define LSM9DS1_CTRL_REG1_G_ODR_G_POWERDOWN (0 << LSM9DS1_CTRL_REG1_G_ODR_G_SHIFT) /* Power-down mode */ # define LSM9DS1_CTRL_REG1_G_ODR_G_POWERDOWN (0 << LSM9DS1_CTRL_REG1_G_ODR_G_SHIFT) /* Power-down mode */
@ -267,6 +268,7 @@
#define LSM9DS1_CTRL_REG5_XL_XEN_XL (1 << 3) /* Accelerometer's X-axis output enable */ #define LSM9DS1_CTRL_REG5_XL_XEN_XL (1 << 3) /* Accelerometer's X-axis output enable */
#define LSM9DS1_CTRL_REG5_XL_YEN_XL (1 << 4) /* Accelerometer's Y-axis output enable */ #define LSM9DS1_CTRL_REG5_XL_YEN_XL (1 << 4) /* Accelerometer's Y-axis output enable */
#define LSM9DS1_CTRL_REG5_XL_ZEN_XL (1 << 5) /* Accelerometer's Z-axis output enable */ #define LSM9DS1_CTRL_REG5_XL_ZEN_XL (1 << 5) /* Accelerometer's Z-axis output enable */
#define LSM9DS1_CTRL_REG5_XL_DEC_SHIFT 6 /* Decimation of acceleration data on OUT REG and FIFO */ #define LSM9DS1_CTRL_REG5_XL_DEC_SHIFT 6 /* Decimation of acceleration data on OUT REG and FIFO */
#define LSM9DS1_CTRL_REG5_XL_DEC_MASK (3 << LSM9DS1_CTRL_REG5_XL_DEC_SHIFT) #define LSM9DS1_CTRL_REG5_XL_DEC_MASK (3 << LSM9DS1_CTRL_REG5_XL_DEC_SHIFT)
# define LSM9DS1_CTRL_REG5_XL_DEC_NODEC (0 << LSM9DS1_CTRL_REG5_XL_DEC_SHIFT) /* No decimation */ # define LSM9DS1_CTRL_REG5_XL_DEC_NODEC (0 << LSM9DS1_CTRL_REG5_XL_DEC_SHIFT) /* No decimation */
@ -282,13 +284,16 @@
# define LSM9DS1_CTRL_REG6_XL_BW_XL_211HZ (1 << LSM9DS1_CTRL_REG6_XL_BW_XL_SHIFT) /* 211 Hz */ # define LSM9DS1_CTRL_REG6_XL_BW_XL_211HZ (1 << LSM9DS1_CTRL_REG6_XL_BW_XL_SHIFT) /* 211 Hz */
# define LSM9DS1_CTRL_REG6_XL_BW_XL_105HZ (2 << LSM9DS1_CTRL_REG6_XL_BW_XL_SHIFT) /* 105 Hz */ # define LSM9DS1_CTRL_REG6_XL_BW_XL_105HZ (2 << LSM9DS1_CTRL_REG6_XL_BW_XL_SHIFT) /* 105 Hz */
# define LSM9DS1_CTRL_REG6_XL_BW_XL_50HZ (3 << LSM9DS1_CTRL_REG6_XL_BW_XL_SHIFT) /* 50 Hz */ # define LSM9DS1_CTRL_REG6_XL_BW_XL_50HZ (3 << LSM9DS1_CTRL_REG6_XL_BW_XL_SHIFT) /* 50 Hz */
#define LSM9DS1_CTRL_REG6_XL_BW_SCAL_ODR (1 << 2) /* Bandwidth selection */ #define LSM9DS1_CTRL_REG6_XL_BW_SCAL_ODR (1 << 2) /* Bandwidth selection */
#define LSM9DS1_CTRL_REG6_XL_FS_XL_SHIFT 3 /* Accelerometer full-scale selection */ #define LSM9DS1_CTRL_REG6_XL_FS_XL_SHIFT 3 /* Accelerometer full-scale selection */
#define LSM9DS1_CTRL_REG6_XL_FS_XL_MASK (3 << LSM9DS1_CTRL_REG6_XL_FS_XL_SHIFT) #define LSM9DS1_CTRL_REG6_XL_FS_XL_MASK (3 << LSM9DS1_CTRL_REG6_XL_FS_XL_SHIFT)
# define LSM9DS1_CTRL_REG6_XL_FS_XL_2G (0 << LSM9DS1_CTRL_REG6_XL_FS_XL_SHIFT) /* +/- 2 g */ # define LSM9DS1_CTRL_REG6_XL_FS_XL_2G (0 << LSM9DS1_CTRL_REG6_XL_FS_XL_SHIFT) /* +/- 2 g */
# define LSM9DS1_CTRL_REG6_XL_FS_XL_16G (1 << LSM9DS1_CTRL_REG6_XL_FS_XL_SHIFT) /* +/- 16 g */ # define LSM9DS1_CTRL_REG6_XL_FS_XL_16G (1 << LSM9DS1_CTRL_REG6_XL_FS_XL_SHIFT) /* +/- 16 g */
# define LSM9DS1_CTRL_REG6_XL_FS_XL_4G (2 << LSM9DS1_CTRL_REG6_XL_FS_XL_SHIFT) /* +/- 4 g */ # define LSM9DS1_CTRL_REG6_XL_FS_XL_4G (2 << LSM9DS1_CTRL_REG6_XL_FS_XL_SHIFT) /* +/- 4 g */
# define LSM9DS1_CTRL_REG6_XL_FS_XL_8G (3 << LSM9DS1_CTRL_REG6_XL_FS_XL_SHIFT) /* +/- 8 g */ # define LSM9DS1_CTRL_REG6_XL_FS_XL_8G (3 << LSM9DS1_CTRL_REG6_XL_FS_XL_SHIFT) /* +/- 8 g */
#define LSM9DS1_CTRL_REG6_XL_ODR_XL_SHIFT 5 /* Output data rate and power mode selection */ #define LSM9DS1_CTRL_REG6_XL_ODR_XL_SHIFT 5 /* Output data rate and power mode selection */
#define LSM9DS1_CTRL_REG6_XL_ODR_XL_MASK (7 << LSM9DS1_CTRL_REG6_XL_ODR_XL_SHIFT) #define LSM9DS1_CTRL_REG6_XL_ODR_XL_MASK (7 << LSM9DS1_CTRL_REG6_XL_ODR_XL_SHIFT)
# define LSM9DS1_CTRL_REG6_XL_ODR_XL_POWERDOWN (0 << LSM9DS1_CTRL_REG6_XL_ODR_XL_SHIFT) /* Power-down mode */ # define LSM9DS1_CTRL_REG6_XL_ODR_XL_POWERDOWN (0 << LSM9DS1_CTRL_REG6_XL_ODR_XL_SHIFT) /* Power-down mode */
@ -303,6 +308,7 @@
#define LSM9DS1_CTRL_REG7_XL_HPIS1 (1 << 0) /* High-pass filter enabled */ #define LSM9DS1_CTRL_REG7_XL_HPIS1 (1 << 0) /* High-pass filter enabled */
#define LSM9DS1_CTRL_REG7_XL_FDS (1 << 2) /* Filtered data selection */ #define LSM9DS1_CTRL_REG7_XL_FDS (1 << 2) /* Filtered data selection */
#define LSM9DS1_CTRL_REG7_XL_DCF_SHIFT 5 /* Accelerometer digital filter cutoff frequency selection */ #define LSM9DS1_CTRL_REG7_XL_DCF_SHIFT 5 /* Accelerometer digital filter cutoff frequency selection */
#define LSM9DS1_CTRL_REG7_XL_DCF_MASK (3 << LSM9DS1_CTRL_REG7_XL_DCF_SHIFT) #define LSM9DS1_CTRL_REG7_XL_DCF_MASK (3 << LSM9DS1_CTRL_REG7_XL_DCF_SHIFT)
# define LSM9DS1_CTRL_REG7_XL_DCF_ODR_DIV50 (0 << LSM9DS1_CTRL_REG7_XL_DCF_SHIFT) # define LSM9DS1_CTRL_REG7_XL_DCF_ODR_DIV50 (0 << LSM9DS1_CTRL_REG7_XL_DCF_SHIFT)
@ -406,6 +412,7 @@
#define LSM9DS1_CTRL_REG1_M_ST (1 << 0) /* Self-test enable */ #define LSM9DS1_CTRL_REG1_M_ST (1 << 0) /* Self-test enable */
#define LSM9DS1_CTRL_REG1_M_FAST_ODR (1 << 1) /* Enable data rates higher than 80 Hz */ #define LSM9DS1_CTRL_REG1_M_FAST_ODR (1 << 1) /* Enable data rates higher than 80 Hz */
#define LSM9DS1_CTRL_REG1_M_DO_SHIFT 2 /* Output data rate selection */ #define LSM9DS1_CTRL_REG1_M_DO_SHIFT 2 /* Output data rate selection */
#define LSM9DS1_CTRL_REG1_M_DO_MASK (7 << LSM9DS1_CTRL_REG1_M_DO_SHIFT) #define LSM9DS1_CTRL_REG1_M_DO_MASK (7 << LSM9DS1_CTRL_REG1_M_DO_SHIFT)
# define LSM9DS1_CTRL_REG1_M_DO_0p625HZ (0 << LSM9DS1_CTRL_REG1_M_DO_SHIFT) /* 0.625 Hz */ # define LSM9DS1_CTRL_REG1_M_DO_0p625HZ (0 << LSM9DS1_CTRL_REG1_M_DO_SHIFT) /* 0.625 Hz */
@ -416,18 +423,21 @@
# define LSM9DS1_CTRL_REG1_M_DO_20HZ (5 << LSM9DS1_CTRL_REG1_M_DO_SHIFT) /* 20 Hz */ # define LSM9DS1_CTRL_REG1_M_DO_20HZ (5 << LSM9DS1_CTRL_REG1_M_DO_SHIFT) /* 20 Hz */
# define LSM9DS1_CTRL_REG1_M_DO_40HZ (6 << LSM9DS1_CTRL_REG1_M_DO_SHIFT) /* 40 Hz */ # define LSM9DS1_CTRL_REG1_M_DO_40HZ (6 << LSM9DS1_CTRL_REG1_M_DO_SHIFT) /* 40 Hz */
# define LSM9DS1_CTRL_REG1_M_DO_80HZ (7 << LSM9DS1_CTRL_REG1_M_DO_SHIFT) /* 80 Hz */ # define LSM9DS1_CTRL_REG1_M_DO_80HZ (7 << LSM9DS1_CTRL_REG1_M_DO_SHIFT) /* 80 Hz */
#define LSM9DS1_CTRL_REG1_M_OM_SHIFT 5 /* X and Y axes operative mode selection */ #define LSM9DS1_CTRL_REG1_M_OM_SHIFT 5 /* X and Y axes operative mode selection */
#define LSM9DS1_CTRL_REG1_M_OM_MASK (3 << LSM9DS1_CTRL_REG1_M_OM_SHIFT) #define LSM9DS1_CTRL_REG1_M_OM_MASK (3 << LSM9DS1_CTRL_REG1_M_OM_SHIFT)
# define LSM9DS1_CTRL_REG1_M_OM_LOW (0 << LSM9DS1_CTRL_REG1_M_OM_SHIFT) /* Low-power mode */ # define LSM9DS1_CTRL_REG1_M_OM_LOW (0 << LSM9DS1_CTRL_REG1_M_OM_SHIFT) /* Low-power mode */
# define LSM9DS1_CTRL_REG1_M_OM_MEDIUM (1 << LSM9DS1_CTRL_REG1_M_OM_SHIFT) /* Medium-performance mode */ # define LSM9DS1_CTRL_REG1_M_OM_MEDIUM (1 << LSM9DS1_CTRL_REG1_M_OM_SHIFT) /* Medium-performance mode */
# define LSM9DS1_CTRL_REG1_M_OM_HIGH (2 << LSM9DS1_CTRL_REG1_M_OM_SHIFT) /* High-performance mode */ # define LSM9DS1_CTRL_REG1_M_OM_HIGH (2 << LSM9DS1_CTRL_REG1_M_OM_SHIFT) /* High-performance mode */
# define LSM9DS1_CTRL_REG1_M_OM_ULTRAHIGH (3 << LSM9DS1_CTRL_REG1_M_OM_SHIFT) /* Ultra-high performance mode */ # define LSM9DS1_CTRL_REG1_M_OM_ULTRAHIGH (3 << LSM9DS1_CTRL_REG1_M_OM_SHIFT) /* Ultra-high performance mode */
#define LSM9DS1_CTRL_REG1_M_TEMP_COMP (1 << 7) /* Temperature compensation enable */ #define LSM9DS1_CTRL_REG1_M_TEMP_COMP (1 << 7) /* Temperature compensation enable */
/* Magnetometer control register 2 */ /* Magnetometer control register 2 */
#define LSM9DS1_CTRL_REG2_M_SOFT_RST (1 << 2) /* Configuration register and user register reset */ #define LSM9DS1_CTRL_REG2_M_SOFT_RST (1 << 2) /* Configuration register and user register reset */
#define LSM9DS1_CTRL_REG2_M_REBOOT (1 << 3) /* Reboot memory content */ #define LSM9DS1_CTRL_REG2_M_REBOOT (1 << 3) /* Reboot memory content */
#define LSM9DS1_CTRL_REG2_M_FS_SHIFT 5 /* Full-scale configuration */ #define LSM9DS1_CTRL_REG2_M_FS_SHIFT 5 /* Full-scale configuration */
#define LSM9DS1_CTRL_REG2_M_FS_MASK (3 << LSM9DS1_CTRL_REG2_M_FS_SHIFT) #define LSM9DS1_CTRL_REG2_M_FS_MASK (3 << LSM9DS1_CTRL_REG2_M_FS_SHIFT)
# define LSM9DS1_CTRL_REG2_M_FS_4GAUSS (0 << LSM9DS1_CTRL_REG2_M_FS_SHIFT) /* +/- 4 gauss */ # define LSM9DS1_CTRL_REG2_M_FS_4GAUSS (0 << LSM9DS1_CTRL_REG2_M_FS_SHIFT) /* +/- 4 gauss */
@ -443,6 +453,7 @@
# define LSM9DS1_CTRL_REG3_M_MD_SINGLE (1 << LSM9DS1_CTRL_REG3_M_MD_SHIFT) /* Single-conversion mode */ # define LSM9DS1_CTRL_REG3_M_MD_SINGLE (1 << LSM9DS1_CTRL_REG3_M_MD_SHIFT) /* Single-conversion mode */
# define LSM9DS1_CTRL_REG3_M_MD_POWERDOWN (2 << LSM9DS1_CTRL_REG3_M_MD_SHIFT) /* Power-down mode */ # define LSM9DS1_CTRL_REG3_M_MD_POWERDOWN (2 << LSM9DS1_CTRL_REG3_M_MD_SHIFT) /* Power-down mode */
# define LSM9DS1_CTRL_REG3_M_MD_POWERDOWN2 (3 << LSM9DS1_CTRL_REG3_M_MD_SHIFT) /* Power-down mode */ # define LSM9DS1_CTRL_REG3_M_MD_POWERDOWN2 (3 << LSM9DS1_CTRL_REG3_M_MD_SHIFT) /* Power-down mode */
#define LSM9DS1_CTRL_REG3_M_SIM (1 << 2) /* SPI serial interface mode selection */ #define LSM9DS1_CTRL_REG3_M_SIM (1 << 2) /* SPI serial interface mode selection */
#define LSM9DS1_CTRL_REG3_M_LP (1 << 5) /* Low-power mode configuration */ #define LSM9DS1_CTRL_REG3_M_LP (1 << 5) /* Low-power mode configuration */
#define LSM9DS1_CTRL_REG3_M_I2C_DISABLE (1 << 7) /* Disable I2C interface */ #define LSM9DS1_CTRL_REG3_M_I2C_DISABLE (1 << 7) /* Disable I2C interface */
@ -450,6 +461,7 @@
/* Magnetometer control register 4 */ /* Magnetometer control register 4 */
#define LSM9DS1_CTRL_REG4_M_BLE (1 << 1) /* Big/little endian data selection */ #define LSM9DS1_CTRL_REG4_M_BLE (1 << 1) /* Big/little endian data selection */
#define LSM9DS1_CTRL_REG4_M_OMZ_SHIFT 2 /* Z-axis operative mode selection */ #define LSM9DS1_CTRL_REG4_M_OMZ_SHIFT 2 /* Z-axis operative mode selection */
#define LSM9DS1_CTRL_REG4_M_OMZ_MASK (3 << LSM9DS1_CTRL_REG4_M_OMZ_SHIFT) #define LSM9DS1_CTRL_REG4_M_OMZ_MASK (3 << LSM9DS1_CTRL_REG4_M_OMZ_SHIFT)
# define LSM9DS1_CTRL_REG4_M_OMZ_LOW (0 << LSM9DS1_CTRL_REG4_M_OMZ_SHIFT) /* Low-power mode */ # define LSM9DS1_CTRL_REG4_M_OMZ_LOW (0 << LSM9DS1_CTRL_REG4_M_OMZ_SHIFT) /* Low-power mode */
@ -730,8 +742,10 @@ static int lsm9ds1_writereg8(FAR struct lsm9ds1_dev_s *priv, uint8_t regaddr,
* *
****************************************************************************/ ****************************************************************************/
static int lsm9ds1_modifyreg8(FAR struct lsm9ds1_dev_s *priv, uint8_t regaddr, static int lsm9ds1_modifyreg8(FAR struct lsm9ds1_dev_s *priv,
uint8_t clearbits, uint8_t setbits) uint8_t regaddr,
uint8_t clearbits,
uint8_t setbits)
{ {
int ret; int ret;
uint8_t regval; uint8_t regval;
@ -770,7 +784,8 @@ static int lsm9ds1_modifyreg8(FAR struct lsm9ds1_dev_s *priv, uint8_t regaddr,
static uint32_t lsm9ds1_midpoint(uint32_t a, uint32_t b) static uint32_t lsm9ds1_midpoint(uint32_t a, uint32_t b)
{ {
return (uint32_t)(((uint64_t)a + (uint64_t)b + (uint64_t)1) / (uint64_t)2); return (uint32_t)(((uint64_t)a +
(uint64_t)b + (uint64_t)1) / (uint64_t)2);
} }
/**************************************************************************** /****************************************************************************
@ -1517,7 +1532,8 @@ static int lsm9ds1_register(FAR const char *devpath,
* *
****************************************************************************/ ****************************************************************************/
int lsm9ds1accel_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, int lsm9ds1accel_register(FAR const char *devpath,
FAR struct i2c_master_s *i2c,
uint8_t addr) uint8_t addr)
{ {
/* Sanity check */ /* Sanity check */
@ -1544,7 +1560,8 @@ int lsm9ds1accel_register(FAR const char *devpath, FAR struct i2c_master_s *i2c,
* *
****************************************************************************/ ****************************************************************************/
int lsm9ds1gyro_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, int lsm9ds1gyro_register(FAR const char *devpath,
FAR struct i2c_master_s *i2c,
uint8_t addr) uint8_t addr)
{ {
/* Sanity check */ /* Sanity check */
@ -1571,7 +1588,8 @@ int lsm9ds1gyro_register(FAR const char *devpath, FAR struct i2c_master_s *i2c,
* *
****************************************************************************/ ****************************************************************************/
int lsm9ds1mag_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, int lsm9ds1mag_register(FAR const char *devpath,
FAR struct i2c_master_s *i2c,
uint8_t addr) uint8_t addr)
{ {
/* Sanity check */ /* Sanity check */

View file

@ -81,7 +81,8 @@ struct ltc4151_dev_s
/* I2C Helpers */ /* I2C Helpers */
static int ltc4151_read16(FAR struct ltc4151_dev_s *priv, uint8_t regaddr, static int ltc4151_read16(FAR struct ltc4151_dev_s *priv,
uint8_t regaddr,
FAR uint16_t *regvalue); FAR uint16_t *regvalue);
static int ltc4151_readpower(FAR struct ltc4151_dev_s *priv, static int ltc4151_readpower(FAR struct ltc4151_dev_s *priv,
FAR struct ltc4151_s *buffer); FAR struct ltc4151_s *buffer);
@ -126,12 +127,14 @@ static int ltc4151_read_reg(FAR struct ltc4151_dev_s *priv,
struct i2c_msg_s msg[I2C_NOSTARTSTOP_MSGS]; struct i2c_msg_s msg[I2C_NOSTARTSTOP_MSGS];
int ret; int ret;
msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].frequency = CONFIG_LTC4151_I2C_FREQUENCY; msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].frequency =
CONFIG_LTC4151_I2C_FREQUENCY;
msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].addr = priv->addr; msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].addr = priv->addr;
msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].flags = 0; msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].flags = 0;
msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].buffer = &start_register_address; msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].buffer = &start_register_address;
msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].length = 1; msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].length = 1;
msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].addr = msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].addr; msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].addr =
msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].addr;
msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].flags = I2C_M_READ; msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].flags = I2C_M_READ;
msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].buffer = register_value; msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].buffer = register_value;
msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].length = data_length; msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].length = data_length;
@ -245,7 +248,8 @@ static int ltc4151_close(FAR struct file *filep)
* Name: ltc4151_read * Name: ltc4151_read
****************************************************************************/ ****************************************************************************/
static ssize_t ltc4151_read(FAR struct file *filep, FAR char *buffer, size_t buflen) static ssize_t ltc4151_read(FAR struct file *filep,
FAR char *buffer, size_t buflen)
{ {
FAR struct inode *inode = filep->f_inode; FAR struct inode *inode = filep->f_inode;
FAR struct ltc4151_dev_s *priv = inode->i_private; FAR struct ltc4151_dev_s *priv = inode->i_private;
@ -315,10 +319,11 @@ static int ltc4151_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
* *
* Input Parameters: * Input Parameters:
* devpath - The full path to the driver to register. E.g., "/dev/pwrmntr0" * devpath - The full path to the driver to register. E.g., "/dev/pwrmntr0"
* i2c - An instance of the I2C interface to use to communicate with LTC4151 * i2c - An instance of the I2C interface to use to communicate with
* addr - The I2C address of the LTC4151. The base I2C address of the LTC4151 * LTC4151
* is 0x6f. Bits 0-3 can be controlled to get 10 unique addresses from 0x66 * addr - The I2C address of the LTC4151. The base I2C address of the
* through 0x6f. * LTC4151 is 0x6f. Bits 0-3 can be controlled to get 10 unique
* addresses from 0x66 through 0x6f.
* *
* Returned Value: * Returned Value:
* Zero (OK) on success; a negated errno value on failure. * Zero (OK) on success; a negated errno value on failure.
@ -342,7 +347,8 @@ int ltc4151_register(FAR const char *devpath, FAR struct i2c_master_s *i2c,
/* Initialize the ltc4151 device structure */ /* Initialize the ltc4151 device structure */
priv = (FAR struct ltc4151_dev_s *)kmm_malloc(sizeof(struct ltc4151_dev_s)); priv = (FAR struct ltc4151_dev_s *)
kmm_malloc(sizeof(struct ltc4151_dev_s));
if (priv == NULL) if (priv == NULL)
{ {
snerr("ERROR: Failed to allocate instance\n"); snerr("ERROR: Failed to allocate instance\n");

View file

@ -142,7 +142,9 @@ struct ms58xx_dev_s
/* CRC Calculation */ /* CRC Calculation */
static uint8_t ms58xx_crc(FAR uint16_t *src, uint8_t crcndx, uint16_t crcmask); static uint8_t ms58xx_crc(FAR uint16_t *src,
uint8_t crcndx,
uint16_t crcmask);
/* I2C Helpers */ /* I2C Helpers */
@ -201,7 +203,9 @@ static const struct file_operations g_fops =
* *
****************************************************************************/ ****************************************************************************/
static uint8_t ms58xx_crc(FAR uint16_t *src, uint8_t crcndx, uint16_t crcmask) static uint8_t ms58xx_crc(FAR uint16_t *src,
uint8_t crcndx,
uint16_t crcmask)
{ {
uint16_t cnt; uint16_t cnt;
uint16_t n_rem; uint16_t n_rem;

View file

@ -159,7 +159,7 @@ static const struct dfu_cfgdesc_s g_dfu_cfgdesc =
.ifno = 0, .ifno = 0,
.alt = 0, .alt = 0,
.neps = 0, .neps = 0,
.classid = 0xFE, .classid = 0xfe,
.subclass = 0x01, .subclass = 0x01,
.protocol = 0x01, /* DFU runtime protocol */ .protocol = 0x01, /* DFU runtime protocol */
.iif = 0 .iif = 0
@ -167,10 +167,22 @@ static const struct dfu_cfgdesc_s g_dfu_cfgdesc =
{ {
.len = sizeof(struct dfu_funcdesc_s), .len = sizeof(struct dfu_funcdesc_s),
.type = 0x21, .type = 0x21,
.attributes = 0x0B, .attributes = 0x0b,
.detach_timeout = { LSBYTE(DFU_MAX_TIMEOUT), MSBYTE(DFU_MAX_TIMEOUT) }, .detach_timeout =
.transfer_size = { LSBYTE(DFU_MAX_TRANSFER), MSBYTE(DFU_MAX_TRANSFER) }, {
.dfu_version = { LSBYTE(DFU_VERSION), MSBYTE(DFU_VERSION) } LSBYTE(DFU_MAX_TIMEOUT),
MSBYTE(DFU_MAX_TIMEOUT)
},
.transfer_size =
{
LSBYTE(DFU_MAX_TRANSFER),
MSBYTE(DFU_MAX_TRANSFER)
},
.dfu_version =
{
LSBYTE(DFU_VERSION),
MSBYTE(DFU_VERSION)
}
} }
}; };
@ -315,6 +327,7 @@ static int dfu_make_msft_extprop_desc(FAR uint8_t *buf)
*payload++ = LSBYTE(namelen); /* wPropertyNameLength */ *payload++ = LSBYTE(namelen); /* wPropertyNameLength */
*payload++ = MSBYTE(namelen); *payload++ = MSBYTE(namelen);
payload += convert_to_utf16(payload, propname); /* bPropertyName */ payload += convert_to_utf16(payload, propname); /* bPropertyName */
*payload++ = 0; /* Null terminator */ *payload++ = 0; /* Null terminator */
*payload++ = 0; *payload++ = 0;
*payload++ = LSBYTE(valuelen); /* dwPropertyDataLength */ *payload++ = LSBYTE(valuelen); /* dwPropertyDataLength */
@ -365,7 +378,7 @@ static int usbclass_setup(FAR struct usbdevclass_driver_s *driver,
else if (ctrl->value[1] == USB_DESC_TYPE_STRING) else if (ctrl->value[1] == USB_DESC_TYPE_STRING)
{ {
ret = usbclass_mkstrdesc(ctrl->value[0], ret = usbclass_mkstrdesc(ctrl->value[0],
(FAR struct usb_strdesc_s *)ctrlreq->buf); (FAR struct usb_strdesc_s *)ctrlreq->buf);
} }
} }
else if (ctrl->req == USB_REQ_SETCONFIGURATION) else if (ctrl->req == USB_REQ_SETCONFIGURATION)
@ -395,7 +408,8 @@ static int usbclass_setup(FAR struct usbdevclass_driver_s *driver,
* we can send the USB reply packet first. * we can send the USB reply packet first.
*/ */
work_queue(HPWORK, &priv->work_item, dfu_workqueue_callback, NULL, 1); work_queue(HPWORK, &priv->work_item,
dfu_workqueue_callback, NULL, 1);
ret = 0; ret = 0;
} }
else if (ctrl->req == USB_REQ_DFU_GETSTATUS) else if (ctrl->req == USB_REQ_DFU_GETSTATUS)

View file

@ -34,7 +34,6 @@
* *
****************************************************************************/ ****************************************************************************/
#ifndef __NUTTX_DRIVERS_USBDEV_RNDIS_STD_H #ifndef __NUTTX_DRIVERS_USBDEV_RNDIS_STD_H
#define __NUTTX_DRIVERS_USBDEV_RNDIS_STD_H #define __NUTTX_DRIVERS_USBDEV_RNDIS_STD_H
@ -44,8 +43,10 @@
/* Definitions for Microsoft RNDIS protocol. /* Definitions for Microsoft RNDIS protocol.
* Documentation: * Documentation:
* https://docs.microsoft.com/en-us/windows-hardware/drivers/network/remote-ndis--rndis-2 * https://docs.microsoft.com/en-us/windows-hardware/
* https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/WinArchive/[MS-RNDIS].pdf * drivers/network/remote-ndis--rndis-2
* https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/
* WinArchive/[MS-RNDIS].pdf
*/ */
#define RNDIS_MAJOR_VERSION 1 #define RNDIS_MAJOR_VERSION 1

View file

@ -154,7 +154,9 @@ static int usbhost_connect(FAR struct usbhost_class_s *usbclass,
FAR const uint8_t *configdesc, int desclen); FAR const uint8_t *configdesc, int desclen);
static int usbhost_disconnected(FAR struct usbhost_class_s *usbclass); static int usbhost_disconnected(FAR struct usbhost_class_s *usbclass);
/* Driver methods -- depend upon the type of NuttX driver interface exported */ /* Driver methods --
* depend upon the type of NuttX driver interface exported
*/
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@ -913,11 +915,15 @@ static FAR struct usbhost_class_s *
priv->usbclass.connect = usbhost_connect; priv->usbclass.connect = usbhost_connect;
priv->usbclass.disconnected = usbhost_disconnected; priv->usbclass.disconnected = usbhost_disconnected;
/* The initial reference count is 1... One reference is held by the driver */ /* The initial reference count is 1...
* One reference is held by the driver
*/
priv->crefs = 1; priv->crefs = 1;
/* Initialize semaphores (this works okay in the interrupt context) */ /* Initialize semaphores
* (this works okay in the interrupt context)
*/
nxsem_init(&priv->exclsem, 0, 1); nxsem_init(&priv->exclsem, 0, 1);

View file

@ -489,7 +489,8 @@ static int fusb301_open(FAR struct file *filep)
ret = fusb301_getreg(priv, FUSB301_DEV_ID_REG); ret = fusb301_getreg(priv, FUSB301_DEV_ID_REG);
if (ret < 0) if (ret < 0)
{ {
fusb301_err("ERROR: No response at given address 0x%02X\n", priv->addr); fusb301_err("ERROR: No response at given address 0x%02X\n",
priv->addr);
ret = -EFAULT; ret = -EFAULT;
} }
else else
@ -529,7 +530,9 @@ static int fusb301_close(FAR struct file *filep)
* This routine is called when the FUSB301 device is read. * This routine is called when the FUSB301 device is read.
****************************************************************************/ ****************************************************************************/
static ssize_t fusb301_read(FAR struct file *filep, FAR char *buffer, size_t buflen) static ssize_t fusb301_read(FAR struct file *filep,
FAR char *buffer,
size_t buflen)
{ {
FAR struct inode *inode = filep->f_inode; FAR struct inode *inode = filep->f_inode;
FAR struct fusb301_dev_s *priv = inode->i_private; FAR struct fusb301_dev_s *priv = inode->i_private;
@ -660,7 +663,9 @@ static int fusb301_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
* This routine is called during FUSB301 device poll * This routine is called during FUSB301 device poll
****************************************************************************/ ****************************************************************************/
static int fusb301_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup) static int fusb301_poll(FAR struct file *filep,
FAR struct pollfd *fds,
bool setup)
{ {
FAR struct inode *inode; FAR struct inode *inode;
FAR struct fusb301_dev_s *priv; FAR struct fusb301_dev_s *priv;
@ -755,10 +760,10 @@ static void fusb301_notify(FAR struct fusb301_dev_s *priv)
int i; int i;
/* If there are threads waiting on poll() for FUSB301 data to become available, /* If there are threads waiting on poll() for FUSB301 data to become
* then wake them up now. NOTE: we wake up all waiting threads because we * available, then wake them up now. NOTE: we wake up all waiting threads
* do not know that they are going to do. If they all try to read the data, * because we do not know that they are going to do. If they all try to
* then some make end up blocking after all. * read the data, then some make end up blocking after all.
*/ */
for (i = 0; i < CONFIG_FUSB301_NPOLLWAITERS; i++) for (i = 0; i < CONFIG_FUSB301_NPOLLWAITERS; i++)
@ -811,7 +816,8 @@ int fusb301_register(FAR const char *devpath, FAR struct i2c_master_s *i2c,
/* Initialize the FUSB301 device structure */ /* Initialize the FUSB301 device structure */
priv = (FAR struct fusb301_dev_s *)kmm_zalloc(sizeof(struct fusb301_dev_s)); priv = (FAR struct fusb301_dev_s *)
kmm_zalloc(sizeof(struct fusb301_dev_s));
if (!priv) if (!priv)
{ {
fusb301_err("ERROR: Failed to allocate instance\n"); fusb301_err("ERROR: Failed to allocate instance\n");

View file

@ -660,7 +660,8 @@ static int fusb303_open(FAR struct file *filep)
ret = fusb303_read_device_id(priv, &dev_id, &dev_type); ret = fusb303_read_device_id(priv, &dev_id, &dev_type);
if (ret < 0) if (ret < 0)
{ {
fusb303_err("ERROR: No response at given address 0x%02X\n", priv->addr); fusb303_err("ERROR: No response at given address 0x%02X\n",
priv->addr);
ret = -EFAULT; ret = -EFAULT;
} }
else else
@ -1004,7 +1005,8 @@ int fusb303_register(FAR const char *devpath, FAR struct i2c_master_s *i2c,
/* Initialize the FUSB303 device structure */ /* Initialize the FUSB303 device structure */
priv = (FAR struct fusb303_dev_s *)kmm_zalloc(sizeof(struct fusb303_dev_s)); priv = (FAR struct fusb303_dev_s *)
kmm_zalloc(sizeof(struct fusb303_dev_s));
if (!priv) if (!priv)
{ {
fusb303_err("ERROR: Failed to allocate instance\n"); fusb303_err("ERROR: Failed to allocate instance\n");

View file

@ -28,19 +28,19 @@
* Public Data * Public Data
****************************************************************************/ ****************************************************************************/
/** Settings for 868 MHz, GFSK at 100kbps /* Settings for 868 MHz, GFSK at 100kbps
* *
* ISM Region 1 (Europe) only, Band 868870 MHz * ISM Region 1 (Europe) only, Band 868870 MHz
* *
* Frequency ERP Duty Cycle Bandwidth Remarks * Frequency ERP Duty Cycle Bandwidth Remarks
* 868 868.6 MHz +14 dBm < 1% No limits * 868 868.6 MHz +14 dBm < 1% No limits
* 868.7 869.2 MHz +14 dBm < 0.1% No limits * 868.7 869.2 MHz +14 dBm < 0.1% No limits
* 869.3 869.4 MHz +10 dBm No limits < 25 kHz Appropriate access * 869.3 869.4 MHz +10 dBm No limits < 25 kHz Appropriate access
* protocol required * protocol required
* 869.4 869.65 MHz +27 dBm < 10% < 25 kHz Channels may be * 869.4 869.65 MHz +27 dBm < 10% < 25 kHz Channels may be
* combined to one * combined to one
* high speed channel * high speed channel
* 869.7 -870 MHz +7 dBm No limits No limits * 869.7 -870 MHz +7 dBm No limits No limits
* *
* Deviation = 46.142578 * Deviation = 46.142578
* Base frequency = 867.999985 * Base frequency = 867.999985
@ -57,7 +57,8 @@
* Data rate = 99.9069 * Data rate = 99.9069
* RX filter BW = 210.937500 * RX filter BW = 210.937500
* Data format = Normal mode * Data format = Normal mode
* Length config = Fixed packet length mode. Length configured in PKTLEN register * Length config = Fixed packet length mode.
* Length configured in PKTLEN register
* CRC enable = true * CRC enable = true
* Packet length = 62 * Packet length = 62
* Device address = 00 * Device address = 00
@ -109,3 +110,7 @@ const struct c1101_rfsettings_s cc1101_rfsettings_ISM1_868MHzGFSK100kbps =
0x03, 0x0f, 0x1e, 0x27, 0x67, 0x50, 0x81, 0xc2 0x03, 0x0f, 0x1e, 0x27, 0x67, 0x50, 0x81, 0xc2
} }
}; };
/****************************************************************************
* Public Functions
****************************************************************************/

View file

@ -113,3 +113,7 @@ const struct c1101_rfsettings_s cc1101_rfsettings_ISM2_433MHzMSK500kbps =
0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
} }
}; };
/****************************************************************************
* Public Functions
****************************************************************************/

View file

@ -105,3 +105,7 @@ const struct c1101_rfsettings_s cc1101_rfsettings_ISM2_905MHzGFSK250kbps =
0x03, 0x0e, 0x1e, 0x27, 0x39, 0x8e, 0xcd, 0xc0 0x03, 0x0e, 0x1e, 0x27, 0x39, 0x8e, 0xcd, 0xc0
} }
}; };
/****************************************************************************
* Public Functions
****************************************************************************/

View file

@ -66,7 +66,8 @@ struct __attribute__((packed)) bcmf_event_s
/* Event callback handler */ /* Event callback handler */
typedef void (*event_handler_t)(FAR struct bcmf_dev_s *priv, typedef void (*event_handler_t)(FAR struct bcmf_dev_s *priv,
struct bcmf_event_s *event, unsigned int len); struct bcmf_event_s *event,
unsigned int len);
/**************************************************************************** /****************************************************************************
* Public Function Prototypes * Public Function Prototypes

View file

@ -50,16 +50,18 @@
/* Send safe cdc request */ /* Send safe cdc request */
int bcmf_cdc_iovar_request(FAR struct bcmf_dev_s *priv, uint32_t ifidx, int bcmf_cdc_iovar_request(FAR struct bcmf_dev_s *priv,
bool set, char *name, uint8_t *data, uint32_t *len); uint32_t ifidx, bool set, char *name,
uint8_t *data, uint32_t *len);
int bcmf_cdc_ioctl(FAR struct bcmf_dev_s *priv, uint32_t ifidx, bool set, int bcmf_cdc_ioctl(FAR struct bcmf_dev_s *priv, uint32_t ifidx, bool set,
uint32_t cmd, uint8_t *data, uint32_t *len); uint32_t cmd, uint8_t *data, uint32_t *len);
/* Send cdc request without locking control_mutex */ /* Send cdc request without locking control_mutex */
int bcmf_cdc_iovar_request_unsafe(FAR struct bcmf_dev_s *priv, uint32_t ifidx, int bcmf_cdc_iovar_request_unsafe(FAR struct bcmf_dev_s *priv,
bool set, char *name, uint8_t *data, uint32_t *len); uint32_t ifidx, bool set, char *name,
uint8_t *data, uint32_t *len);
/* Callback used by bus layer to notify cdc response frame is available */ /* Callback used by bus layer to notify cdc response frame is available */

View file

@ -91,3 +91,7 @@ const struct bcmf_sdio_chip bcmf_43362_config_sdio =
.firmware_image_size = (FAR unsigned int *)&bcm43362_firmware_image_len, .firmware_image_size = (FAR unsigned int *)&bcm43362_firmware_image_len,
#endif #endif
}; };
/****************************************************************************
* Public Functions
****************************************************************************/

View file

@ -97,3 +97,7 @@ const struct bcmf_sdio_chip bcmf_43438_config_sdio =
.clm_blob_image_size = (FAR unsigned int *)&ap6212_clm_blob_len, .clm_blob_image_size = (FAR unsigned int *)&ap6212_clm_blob_len,
#endif #endif
}; };
/****************************************************************************
* Public Functions
****************************************************************************/

View file

@ -36,11 +36,19 @@
#ifndef __DRIVERS_WIRELESS_IEEE80211_BCMF_CORE_H #ifndef __DRIVERS_WIRELESS_IEEE80211_BCMF_CORE_H
#define __DRIVERS_WIRELESS_IEEE80211_BCMF_CORE_H #define __DRIVERS_WIRELESS_IEEE80211_BCMF_CORE_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include "bcmf_sdio.h" #include "bcmf_sdio.h"
/****************************************************************************
* Public Functions Prototypes
****************************************************************************/
int bcmf_read_sbreg(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_read_sbreg(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address,
uint8_t *reg, unsigned int len); uint8_t *reg, unsigned int len);

View file

@ -2,35 +2,39 @@
* drivers/wireless/ieee80211/bcm43xxx/bcmf_ioctl.h * drivers/wireless/ieee80211/bcm43xxx/bcmf_ioctl.h
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, this * 1. Redistributions of source code must retain the above copyright
* list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, this * 2. Redistributions in binary form must reproduce the above copyright
* list of conditions and the following disclaimer in the documentation and/or * notice, this list of conditions and the following disclaimer in the
* other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* *
* 3. Neither the name of Broadcom nor the names of other contributors to this * 3. Neither the name of Broadcom nor the names of other contributors to
* software may be used to endorse or promote products derived from this software * this software may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* 4. This software may not be used as a standalone product, and may only be used as * 4. This software may not be used as a standalone product, and may only
* incorporated in your product or device that incorporates Broadcom wireless connectivity * be used as incorporated in your product or device that incorporates
* products and solely for the purpose of enabling the functionalities of such Broadcom products. * Broadcom wireless connectivity products and solely for the purpose of
* enabling the functionalities of such Broadcom products.
* *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ANY WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * "AS IS" AND ANY WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING,
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT, ARE * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR * FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* *
****************************************************************************/ ****************************************************************************/
@ -41,6 +45,10 @@
#ifndef __DRIVERS_WIRELESS_IEEE80211_BCMF_IOCTL_H #ifndef __DRIVERS_WIRELESS_IEEE80211_BCMF_IOCTL_H
#define __DRIVERS_WIRELESS_IEEE80211_BCMF_IOCTL_H #define __DRIVERS_WIRELESS_IEEE80211_BCMF_IOCTL_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <stdint.h> #include <stdint.h>
#include <net/ethernet.h> #include <net/ethernet.h>
@ -103,7 +111,9 @@ typedef struct wl_bss_info
uint16_t ie_offset; /* offset at which IEs start, from beginning */ uint16_t ie_offset; /* offset at which IEs start, from beginning */
uint32_t ie_length; /* byte length of Information Elements */ uint32_t ie_length; /* byte length of Information Elements */
int16_t SNR; /* average SNR of during frame reception */ int16_t SNR; /* average SNR of during frame reception */
/* Add new fields here */ /* Add new fields here */
/* variable length Information Elements */ /* variable length Information Elements */
} wl_bss_info_t; } wl_bss_info_t;
@ -204,7 +214,7 @@ typedef struct wl_iscan_results
typedef struct wl_rateset typedef struct wl_rateset
{ {
uint32_t count; /* # rates in this set */ uint32_t count; /* # rates in this set */
uint8_t rates[WL_MAXRATES_IN_SET]; /* rates in 500kbps units w/hi bit set if basic */ uint8_t rates[WL_MAXRATES_IN_SET]; /* rates in 500kbps units w/hi bit set if basic */
} wl_rateset_t; } wl_rateset_t;
@ -1427,26 +1437,26 @@ typedef struct
/* receive stat counters */ /* receive stat counters */
uint32_t rxframe; /* rx data frames */ uint32_t rxframe; /* rx data frames */
uint32_t rxbyte; /* rx data bytes */ uint32_t rxbyte; /* rx data bytes */
uint32_t rxerror; /* rx data errors (derived: sum of others) */ uint32_t rxerror; /* rx data errors (derived: sum of others) */
uint32_t rxctl; /* rx management frames */ uint32_t rxctl; /* rx management frames */
uint32_t rxnobuf; /* rx out of buffers errors */ uint32_t rxnobuf; /* rx out of buffers errors */
uint32_t rxnondata; /* rx non data frames in the data channel errors */ uint32_t rxnondata; /* rx non data frames in the data channel errors */
uint32_t rxbadds; /* rx bad DS errors */ uint32_t rxbadds; /* rx bad DS errors */
uint32_t rxbadcm; /* rx bad control or management frames */ uint32_t rxbadcm; /* rx bad control or management frames */
uint32_t rxfragerr; /* rx fragmentation errors */ uint32_t rxfragerr; /* rx fragmentation errors */
uint32_t rxrunt; /* rx runt frames */ uint32_t rxrunt; /* rx runt frames */
uint32_t rxgiant; /* rx giant frames */ uint32_t rxgiant; /* rx giant frames */
uint32_t rxnoscb; /* rx no scb error */ uint32_t rxnoscb; /* rx no scb error */
uint32_t rxbadproto; /* rx invalid frames */ uint32_t rxbadproto; /* rx invalid frames */
uint32_t rxbadsrcmac; /* rx frames with Invalid Src Mac */ uint32_t rxbadsrcmac; /* rx frames with Invalid Src Mac */
uint32_t rxbadda; /* rx frames tossed for invalid da */ uint32_t rxbadda; /* rx frames tossed for invalid da */
uint32_t rxfilter; /* rx frames filtered out */ uint32_t rxfilter; /* rx frames filtered out */
/* receive chip error counters */ /* receive chip error counters */
uint32_t rxoflo; /* rx fifo overflow errors */ uint32_t rxoflo; /* rx fifo overflow errors */
uint32_t rxuflo[NFIFO]; /* rx dma descriptor underflow errors */ uint32_t rxuflo[NFIFO]; /* rx dma descriptor underflow errors */
uint32_t d11cnt_txrts_off; /* d11cnt txrts value when reset d11cnt */ uint32_t d11cnt_txrts_off; /* d11cnt txrts value when reset d11cnt */
@ -1455,19 +1465,18 @@ typedef struct
/* misc counters */ /* misc counters */
uint32_t dmade; /* tx/rx dma descriptor errors */ uint32_t dmade; /* tx/rx dma descriptor errors */
uint32_t dmada; /* tx/rx dma data errors */ uint32_t dmada; /* tx/rx dma data errors */
uint32_t dmape; /* tx/rx dma descriptor protocol errors */ uint32_t dmape; /* tx/rx dma descriptor protocol errors */
uint32_t reset; /* reset count */ uint32_t reset; /* reset count */
uint32_t tbtt; /* cnts the TBTT int's */ uint32_t tbtt; /* cnts the TBTT int's */
uint32_t txdmawar; /* # occurrences of PR15420 workaround */ uint32_t txdmawar; /* # occurrences of PR15420 workaround */
uint32_t pkt_callback_reg_fail; /* callbacks register failure */ uint32_t pkt_callback_reg_fail; /* callbacks register failure */
/* MAC counters: 32-bit version of d11.h's macstat_t */ /* MAC counters: 32-bit version of d11.h's macstat_t */
uint32_t txallfrm; /* total number of frames sent, incl. Data, ACK, RTS, CTS, uint32_t txallfrm; /* total number of frames sent, incl. Data, ACK, RTS, CTS,
* Control Management (includes retransmissions) * Control Management (includes retransmissions) */
*/
uint32_t txrtsfrm; /* number of RTS sent out by the MAC */ uint32_t txrtsfrm; /* number of RTS sent out by the MAC */
uint32_t txctsfrm; /* number of CTS sent out by the MAC */ uint32_t txctsfrm; /* number of CTS sent out by the MAC */
uint32_t txackfrm; /* number of ACK frames sent out */ uint32_t txackfrm; /* number of ACK frames sent out */
@ -1475,46 +1484,45 @@ typedef struct
uint32_t txbcnfrm; /* beacons transmitted */ uint32_t txbcnfrm; /* beacons transmitted */
uint32_t txfunfl[8]; /* per-fifo tx underflows */ uint32_t txfunfl[8]; /* per-fifo tx underflows */
uint32_t txtplunfl; /* Template underflows (mac was too slow to transmit ACK/CTS uint32_t txtplunfl; /* Template underflows (mac was too slow to transmit ACK/CTS
* or BCN) * or BCN) */
*/
uint32_t txphyerror; /* Transmit phy error, type of error is reported in tx-status for uint32_t txphyerror; /* Transmit phy error, type of error is reported in tx-status for
* driver enqueued frames * driver enqueued frames */
*/
uint32_t rxfrmtoolong; /* Received frame longer than legal limit (2346 bytes) */ uint32_t rxfrmtoolong; /* Received frame longer than legal limit (2346 bytes) */
uint32_t rxfrmtooshrt; /* Received frame did not contain enough bytes for its frame type */ uint32_t rxfrmtooshrt; /* Received frame did not contain enough bytes for its frame type */
uint32_t rxinvmachdr; /* Either the protocol version != 0 or frame type not uint32_t rxinvmachdr; /* Either the protocol version != 0 or frame type not
* data/control/management * data/control/management */
*/
uint32_t rxbadfcs; /* number of frames for which the CRC check failed in the MAC */ uint32_t rxbadfcs; /* number of frames for which the CRC check failed in the MAC */
uint32_t rxbadplcp; /* parity check of the PLCP header failed */ uint32_t rxbadplcp; /* parity check of the PLCP header failed */
uint32_t rxcrsglitch; /* PHY was able to correlate the preamble but not the header */ uint32_t rxcrsglitch; /* PHY was able to correlate the preamble but not the header */
uint32_t rxstrt; /* Number of received frames with a good PLCP uint32_t rxstrt; /* Number of received frames with a good PLCP
* (i.e. passing parity check) * (i.e. passing parity check) */
*/
uint32_t rxdfrmucastmbss; /* Number of received DATA frames with good FCS and matching RA */ uint32_t rxdfrmucastmbss; /* Number of received DATA frames with good FCS and matching RA */
uint32_t rxmfrmucastmbss; /* number of received mgmt frames with good FCS and matching RA */ uint32_t rxmfrmucastmbss; /* number of received mgmt frames with good FCS and matching RA */
uint32_t rxcfrmucast; /* number of received CNTRL frames with good FCS and matching RA */ uint32_t rxcfrmucast; /* number of received CNTRL frames with good FCS and matching RA */
uint32_t rxrtsucast; /* number of unicast RTS addressed to the MAC (good FCS) */ uint32_t rxrtsucast; /* number of unicast RTS addressed to the MAC (good FCS) */
uint32_t rxctsucast; /* number of unicast CTS addressed to the MAC (good FCS) */ uint32_t rxctsucast; /* number of unicast CTS addressed to the MAC (good FCS) */
uint32_t rxackucast; /* number of ucast ACKS received (good FCS) */ uint32_t rxackucast; /* number of ucast ACKS received (good FCS) */
uint32_t rxdfrmocast; /* number of received DATA frames (good FCS and not matching RA) */ uint32_t rxdfrmocast; /* number of received DATA frames (good FCS and not matching RA) */
uint32_t rxmfrmocast; /* number of received MGMT frames (good FCS and not matching RA) */ uint32_t rxmfrmocast; /* number of received MGMT frames (good FCS and not matching RA) */
uint32_t rxcfrmocast; /* number of received CNTRL frame (good FCS and not matching RA) */ uint32_t rxcfrmocast; /* number of received CNTRL frame (good FCS and not matching RA) */
uint32_t rxrtsocast; /* number of received RTS not addressed to the MAC */ uint32_t rxrtsocast; /* number of received RTS not addressed to the MAC */
uint32_t rxctsocast; /* number of received CTS not addressed to the MAC */ uint32_t rxctsocast; /* number of received CTS not addressed to the MAC */
uint32_t rxdfrmmcast; /* number of RX Data multicast frames received by the MAC */ uint32_t rxdfrmmcast; /* number of RX Data multicast frames received by the MAC */
uint32_t rxmfrmmcast; /* number of RX Management multicast frames received by the MAC */ uint32_t rxmfrmmcast; /* number of RX Management multicast frames received by the MAC */
uint32_t rxcfrmmcast; /* number of RX Control multicast frames received by the MAC uint32_t rxcfrmmcast; /* number of RX Control multicast frames received by the MAC
* (unlikely to see these) * (unlikely to see these) */
*/
uint32_t rxbeaconmbss; /* beacons received from member of BSS */ uint32_t rxbeaconmbss; /* beacons received from member of BSS */
uint32_t rxdfrmucastobss; /* number of unicast frames addressed to the MAC from uint32_t rxdfrmucastobss; /* number of unicast frames addressed to the MAC from
* other BSS (WDS FRAME) * other BSS (WDS FRAME) */
*/
uint32_t rxbeaconobss; /* beacons received from other BSS */ uint32_t rxbeaconobss; /* beacons received from other BSS */
uint32_t rxrsptmout; /* Number of response timeouts for transmitted frames uint32_t rxrsptmout; /* Number of response timeouts for transmitted frames
* expecting a response * expecting a response */
*/
uint32_t bcntxcancl; /* transmit beacons canceled due to receipt of beacon (IBSS) */ uint32_t bcntxcancl; /* transmit beacons canceled due to receipt of beacon (IBSS) */
uint32_t rxf0ovfl; /* Number of receive fifo 0 overflows */ uint32_t rxf0ovfl; /* Number of receive fifo 0 overflows */
uint32_t rxf1ovfl; /* Number of receive fifo 1 overflows (obsolete) */ uint32_t rxf1ovfl; /* Number of receive fifo 1 overflows (obsolete) */
@ -1522,24 +1530,24 @@ typedef struct
uint32_t txsfovfl; /* Number of transmit status fifo overflows (obsolete) */ uint32_t txsfovfl; /* Number of transmit status fifo overflows (obsolete) */
uint32_t pmqovfl; /* Number of PMQ overflows */ uint32_t pmqovfl; /* Number of PMQ overflows */
uint32_t rxcgprqfrm; /* Number of received Probe requests that made it into uint32_t rxcgprqfrm; /* Number of received Probe requests that made it into
* the PRQ fifo * the PRQ fifo */
*/
uint32_t rxcgprsqovfl; /* Rx Probe Request Queue overflow in the AP */ uint32_t rxcgprsqovfl; /* Rx Probe Request Queue overflow in the AP */
uint32_t txcgprsfail; /* Tx Probe Response Fail. AP sent probe response but did uint32_t txcgprsfail; /* Tx Probe Response Fail. AP sent probe response but did
* not get ACK * not get ACK */
*/
uint32_t txcgprssuc; /* Tx Probe Response Success (ACK was received) */ uint32_t txcgprssuc; /* Tx Probe Response Success (ACK was received) */
uint32_t prs_timeout; /* Number of probe requests that were dropped from the PRQ uint32_t prs_timeout; /* Number of probe requests that were dropped from the PRQ
* fifo because a probe response could not be sent out within * fifo because a probe response could not be sent out within
* the time limit defined in M_PRS_MAXTIME * the time limit defined in M_PRS_MAXTIME */
*/
uint32_t rxnack; /* XXX Number of NACKS received (Afterburner) */ uint32_t rxnack; /* XXX Number of NACKS received (Afterburner) */
uint32_t frmscons; /* XXX Number of frames completed without transmission because of an uint32_t frmscons; /* XXX Number of frames completed without transmission because of an
* Afterburner re-queue * Afterburner re-queue */
*/
uint32_t txnack; /* XXX Number of NACKs transmitted (Afterburner) */ uint32_t txnack; /* XXX Number of NACKs transmitted (Afterburner) */
uint32_t txglitch_nack; /* obsolete */ uint32_t txglitch_nack; /* obsolete */
uint32_t txburst; /* obsolete */ uint32_t txburst; /* obsolete */
/* 802.11 MIB counters, pp. 614 of 802.11 reaff doc. */ /* 802.11 MIB counters, pp. 614 of 802.11 reaff doc. */
@ -1560,50 +1568,50 @@ typedef struct
/* WPA2 counters (see rxundec for DecryptFailureCount) */ /* WPA2 counters (see rxundec for DecryptFailureCount) */
uint32_t tkipmicfaill; /* TKIPLocalMICFailures */ uint32_t tkipmicfaill; /* TKIPLocalMICFailures */
uint32_t tkipcntrmsr; /* TKIPCounterMeasuresInvoked */ uint32_t tkipcntrmsr; /* TKIPCounterMeasuresInvoked */
uint32_t tkipreplay; /* TKIPReplays */ uint32_t tkipreplay; /* TKIPReplays */
uint32_t ccmpfmterr; /* CCMPFormatErrors */ uint32_t ccmpfmterr; /* CCMPFormatErrors */
uint32_t ccmpreplay; /* CCMPReplays */ uint32_t ccmpreplay; /* CCMPReplays */
uint32_t ccmpundec; /* CCMPDecryptErrors */ uint32_t ccmpundec; /* CCMPDecryptErrors */
uint32_t fourwayfail; /* FourWayHandshakeFailures */ uint32_t fourwayfail; /* FourWayHandshakeFailures */
uint32_t wepundec; /* dot11WEPUndecryptableCount */ uint32_t wepundec; /* dot11WEPUndecryptableCount */
uint32_t wepicverr; /* dot11WEPICVErrorCount */ uint32_t wepicverr; /* dot11WEPICVErrorCount */
uint32_t decsuccess; /* DecryptSuccessCount */ uint32_t decsuccess; /* DecryptSuccessCount */
uint32_t tkipicverr; /* TKIPICVErrorCount */ uint32_t tkipicverr; /* TKIPICVErrorCount */
uint32_t wepexcluded; /* dot11WEPExcludedCount */ uint32_t wepexcluded; /* dot11WEPExcludedCount */
uint32_t rxundec_mcst; /* dot11WEPUndecryptableCount */ uint32_t rxundec_mcst; /* dot11WEPUndecryptableCount */
/* WPA2 counters (see rxundec for DecryptFailureCount) */ /* WPA2 counters (see rxundec for DecryptFailureCount) */
uint32_t tkipmicfaill_mcst; /* TKIPLocalMICFailures */ uint32_t tkipmicfaill_mcst; /* TKIPLocalMICFailures */
uint32_t tkipcntrmsr_mcst; /* TKIPCounterMeasuresInvoked */ uint32_t tkipcntrmsr_mcst; /* TKIPCounterMeasuresInvoked */
uint32_t tkipreplay_mcst; /* TKIPReplays */ uint32_t tkipreplay_mcst; /* TKIPReplays */
uint32_t ccmpfmterr_mcst; /* CCMPFormatErrors */ uint32_t ccmpfmterr_mcst; /* CCMPFormatErrors */
uint32_t ccmpreplay_mcst; /* CCMPReplays */ uint32_t ccmpreplay_mcst; /* CCMPReplays */
uint32_t ccmpundec_mcst; /* CCMPDecryptErrors */ uint32_t ccmpundec_mcst; /* CCMPDecryptErrors */
uint32_t fourwayfail_mcst; /* FourWayHandshakeFailures */ uint32_t fourwayfail_mcst; /* FourWayHandshakeFailures */
uint32_t wepundec_mcst; /* dot11WEPUndecryptableCount */ uint32_t wepundec_mcst; /* dot11WEPUndecryptableCount */
uint32_t wepicverr_mcst; /* dot11WEPICVErrorCount */ uint32_t wepicverr_mcst; /* dot11WEPICVErrorCount */
uint32_t decsuccess_mcst; /* DecryptSuccessCount */ uint32_t decsuccess_mcst; /* DecryptSuccessCount */
uint32_t tkipicverr_mcst; /* TKIPICVErrorCount */ uint32_t tkipicverr_mcst; /* TKIPICVErrorCount */
uint32_t wepexcluded_mcst; /* dot11WEPExcludedCount */ uint32_t wepexcluded_mcst; /* dot11WEPExcludedCount */
uint32_t txchanrej; /* Tx frames suppressed due to channel rejection */ uint32_t txchanrej; /* Tx frames suppressed due to channel rejection */
uint32_t txexptime; /* Tx frames suppressed due to timer expiration */ uint32_t txexptime; /* Tx frames suppressed due to timer expiration */
uint32_t psmwds; /* Count PSM watchdogs */ uint32_t psmwds; /* Count PSM watchdogs */
uint32_t phywatchdog; /* Count Phy watchdogs (triggered by ucode) */ uint32_t phywatchdog; /* Count Phy watchdogs (triggered by ucode) */
/* MBSS counters, AP only */ /* MBSS counters, AP only */
uint32_t prq_entries_handled; /* PRQ entries read in */ uint32_t prq_entries_handled; /* PRQ entries read in */
uint32_t prq_undirected_entries; /* which were bcast bss & ssid */ uint32_t prq_undirected_entries; /* which were bcast bss & ssid */
uint32_t prq_bad_entries; /* which could not be translated to info */ uint32_t prq_bad_entries; /* which could not be translated to info */
uint32_t atim_suppress_count; /* TX suppressions on ATIM fifo */ uint32_t atim_suppress_count; /* TX suppressions on ATIM fifo */
uint32_t bcn_template_not_ready; /* Template marked in use on send bcn ... */ uint32_t bcn_template_not_ready; /* Template marked in use on send bcn ... */
uint32_t bcn_template_not_ready_done; /* ...but "DMA done" interrupt rcvd */ uint32_t bcn_template_not_ready_done; /* ...but "DMA done" interrupt rcvd */
uint32_t late_tbtt_dpc; /* TBTT DPC did not happen in time */ uint32_t late_tbtt_dpc; /* TBTT DPC did not happen in time */
/* per-rate receive stat counters */ /* per-rate receive stat counters */
@ -1634,13 +1642,13 @@ typedef struct
uint32_t pktengrxducast; /* unicast frames rxed by the pkteng code */ uint32_t pktengrxducast; /* unicast frames rxed by the pkteng code */
uint32_t pktengrxdmcast; /* multicast frames rxed by the pkteng code */ uint32_t pktengrxdmcast; /* multicast frames rxed by the pkteng code */
uint32_t rfdisable; /* count of radio disables */ uint32_t rfdisable; /* count of radio disables */
uint32_t bphy_rxcrsglitch; /* PHY count of bphy glitches */ uint32_t bphy_rxcrsglitch; /* PHY count of bphy glitches */
uint32_t txmpdu_sgi; /* count for sgi transmit */ uint32_t txmpdu_sgi; /* count for sgi transmit */
uint32_t rxmpdu_sgi; /* count for sgi received */ uint32_t rxmpdu_sgi; /* count for sgi received */
uint32_t txmpdu_stbc; /* count for stbc transmit */ uint32_t txmpdu_stbc; /* count for stbc transmit */
uint32_t rxmpdu_stbc; /* count for stbc received */ uint32_t rxmpdu_stbc; /* count for stbc received */
} wl_cnt_ver_six_t; } wl_cnt_ver_six_t;
typedef struct typedef struct
@ -1671,26 +1679,26 @@ typedef struct
/* receive stat counters */ /* receive stat counters */
uint32_t rxframe; /* rx data frames */ uint32_t rxframe; /* rx data frames */
uint32_t rxbyte; /* rx data bytes */ uint32_t rxbyte; /* rx data bytes */
uint32_t rxerror; /* rx data errors (derived: sum of others) */ uint32_t rxerror; /* rx data errors (derived: sum of others) */
uint32_t rxctl; /* rx management frames */ uint32_t rxctl; /* rx management frames */
uint32_t rxnobuf; /* rx out of buffers errors */ uint32_t rxnobuf; /* rx out of buffers errors */
uint32_t rxnondata; /* rx non data frames in the data channel errors */ uint32_t rxnondata; /* rx non data frames in the data channel errors */
uint32_t rxbadds; /* rx bad DS errors */ uint32_t rxbadds; /* rx bad DS errors */
uint32_t rxbadcm; /* rx bad control or management frames */ uint32_t rxbadcm; /* rx bad control or management frames */
uint32_t rxfragerr; /* rx fragmentation errors */ uint32_t rxfragerr; /* rx fragmentation errors */
uint32_t rxrunt; /* rx runt frames */ uint32_t rxrunt; /* rx runt frames */
uint32_t rxgiant; /* rx giant frames */ uint32_t rxgiant; /* rx giant frames */
uint32_t rxnoscb; /* rx no scb error */ uint32_t rxnoscb; /* rx no scb error */
uint32_t rxbadproto; /* rx invalid frames */ uint32_t rxbadproto; /* rx invalid frames */
uint32_t rxbadsrcmac; /* rx frames with Invalid Src Mac */ uint32_t rxbadsrcmac; /* rx frames with Invalid Src Mac */
uint32_t rxbadda; /* rx frames tossed for invalid da */ uint32_t rxbadda; /* rx frames tossed for invalid da */
uint32_t rxfilter; /* rx frames filtered out */ uint32_t rxfilter; /* rx frames filtered out */
/* receive chip error counters */ /* receive chip error counters */
uint32_t rxoflo; /* rx fifo overflow errors */ uint32_t rxoflo; /* rx fifo overflow errors */
uint32_t rxuflo[NFIFO]; /* rx dma descriptor underflow errors */ uint32_t rxuflo[NFIFO]; /* rx dma descriptor underflow errors */
uint32_t d11cnt_txrts_off; /* d11cnt txrts value when reset d11cnt */ uint32_t d11cnt_txrts_off; /* d11cnt txrts value when reset d11cnt */
@ -1699,19 +1707,18 @@ typedef struct
/* misc counters */ /* misc counters */
uint32_t dmade; /* tx/rx dma descriptor errors */ uint32_t dmade; /* tx/rx dma descriptor errors */
uint32_t dmada; /* tx/rx dma data errors */ uint32_t dmada; /* tx/rx dma data errors */
uint32_t dmape; /* tx/rx dma descriptor protocol errors */ uint32_t dmape; /* tx/rx dma descriptor protocol errors */
uint32_t reset; /* reset count */ uint32_t reset; /* reset count */
uint32_t tbtt; /* cnts the TBTT int's */ uint32_t tbtt; /* cnts the TBTT int's */
uint32_t txdmawar; /* # occurrences of PR15420 workaround */ uint32_t txdmawar; /* # occurrences of PR15420 workaround */
uint32_t pkt_callback_reg_fail; /* callbacks register failure */ uint32_t pkt_callback_reg_fail; /* callbacks register failure */
/* MAC counters: 32-bit version of d11.h's macstat_t */ /* MAC counters: 32-bit version of d11.h's macstat_t */
uint32_t txallfrm; /* total number of frames sent, incl. Data, ACK, RTS, CTS, uint32_t txallfrm; /* total number of frames sent, incl. Data, ACK, RTS, CTS,
* Control Management (includes retransmissions) * Control Management (includes retransmissions) */
*/
uint32_t txrtsfrm; /* number of RTS sent out by the MAC */ uint32_t txrtsfrm; /* number of RTS sent out by the MAC */
uint32_t txctsfrm; /* number of CTS sent out by the MAC */ uint32_t txctsfrm; /* number of CTS sent out by the MAC */
uint32_t txackfrm; /* number of ACK frames sent out */ uint32_t txackfrm; /* number of ACK frames sent out */
@ -1719,46 +1726,43 @@ typedef struct
uint32_t txbcnfrm; /* beacons transmitted */ uint32_t txbcnfrm; /* beacons transmitted */
uint32_t txfunfl[8]; /* per-fifo tx underflows */ uint32_t txfunfl[8]; /* per-fifo tx underflows */
uint32_t txtplunfl; /* Template underflows (mac was too slow to transmit ACK/CTS uint32_t txtplunfl; /* Template underflows (mac was too slow to transmit ACK/CTS
* or BCN) * or BCN) */
*/
uint32_t txphyerror; /* Transmit phy error, type of error is reported in tx-status for uint32_t txphyerror; /* Transmit phy error, type of error is reported in tx-status for
* driver enqueued frames * driver enqueued frames */
*/
uint32_t rxfrmtoolong; /* Received frame longer than legal limit (2346 bytes) */ uint32_t rxfrmtoolong; /* Received frame longer than legal limit (2346 bytes) */
uint32_t rxfrmtooshrt; /* Received frame did not contain enough bytes for its frame type */ uint32_t rxfrmtooshrt; /* Received frame did not contain enough bytes for its frame type */
uint32_t rxinvmachdr; /* Either the protocol version != 0 or frame type not uint32_t rxinvmachdr; /* Either the protocol version != 0 or frame type not
* data/control/management * data/control/management */
*/
uint32_t rxbadfcs; /* number of frames for which the CRC check failed in the MAC */ uint32_t rxbadfcs; /* number of frames for which the CRC check failed in the MAC */
uint32_t rxbadplcp; /* parity check of the PLCP header failed */ uint32_t rxbadplcp; /* parity check of the PLCP header failed */
uint32_t rxcrsglitch; /* PHY was able to correlate the preamble but not the header */ uint32_t rxcrsglitch; /* PHY was able to correlate the preamble but not the header */
uint32_t rxstrt; /* Number of received frames with a good PLCP uint32_t rxstrt; /* Number of received frames with a good PLCP
* (i.e. passing parity check) * (i.e. passing parity check) */
*/
uint32_t rxdfrmucastmbss; /* Number of received DATA frames with good FCS and matching RA */ uint32_t rxdfrmucastmbss; /* Number of received DATA frames with good FCS and matching RA */
uint32_t rxmfrmucastmbss; /* number of received mgmt frames with good FCS and matching RA */ uint32_t rxmfrmucastmbss; /* number of received mgmt frames with good FCS and matching RA */
uint32_t rxcfrmucast; /* number of received CNTRL frames with good FCS and matching RA */ uint32_t rxcfrmucast; /* number of received CNTRL frames with good FCS and matching RA */
uint32_t rxrtsucast; /* number of unicast RTS addressed to the MAC (good FCS) */ uint32_t rxrtsucast; /* number of unicast RTS addressed to the MAC (good FCS) */
uint32_t rxctsucast; /* number of unicast CTS addressed to the MAC (good FCS) */ uint32_t rxctsucast; /* number of unicast CTS addressed to the MAC (good FCS) */
uint32_t rxackucast; /* number of ucast ACKS received (good FCS) */ uint32_t rxackucast; /* number of ucast ACKS received (good FCS) */
uint32_t rxdfrmocast; /* number of received DATA frames (good FCS and not matching RA) */ uint32_t rxdfrmocast; /* number of received DATA frames (good FCS and not matching RA) */
uint32_t rxmfrmocast; /* number of received MGMT frames (good FCS and not matching RA) */ uint32_t rxmfrmocast; /* number of received MGMT frames (good FCS and not matching RA) */
uint32_t rxcfrmocast; /* number of received CNTRL frame (good FCS and not matching RA) */ uint32_t rxcfrmocast; /* number of received CNTRL frame (good FCS and not matching RA) */
uint32_t rxrtsocast; /* number of received RTS not addressed to the MAC */ uint32_t rxrtsocast; /* number of received RTS not addressed to the MAC */
uint32_t rxctsocast; /* number of received CTS not addressed to the MAC */ uint32_t rxctsocast; /* number of received CTS not addressed to the MAC */
uint32_t rxdfrmmcast; /* number of RX Data multicast frames received by the MAC */ uint32_t rxdfrmmcast; /* number of RX Data multicast frames received by the MAC */
uint32_t rxmfrmmcast; /* number of RX Management multicast frames received by the MAC */ uint32_t rxmfrmmcast; /* number of RX Management multicast frames received by the MAC */
uint32_t rxcfrmmcast; /* number of RX Control multicast frames received by the MAC uint32_t rxcfrmmcast; /* number of RX Control multicast frames received by the MAC
* (unlikely to see these) * (unlikely to see these) */
*/ uint32_t rxbeaconmbss; /* beacons received from member of BSS */
uint32_t rxbeaconmbss; /* beacons received from member of BSS */
uint32_t rxdfrmucastobss; /* number of unicast frames addressed to the MAC from uint32_t rxdfrmucastobss; /* number of unicast frames addressed to the MAC from
* other BSS (WDS FRAME) * other BSS (WDS FRAME) */
*/ uint32_t rxbeaconobss; /* beacons received from other BSS */
uint32_t rxbeaconobss; /* beacons received from other BSS */ uint32_t rxrsptmout; /* Number of response timeouts for transmitted frames
uint32_t rxrsptmout; /* Number of response timeouts for transmitted frames * expecting a response */
* expecting a response
*/
uint32_t bcntxcancl; /* transmit beacons canceled due to receipt of beacon (IBSS) */ uint32_t bcntxcancl; /* transmit beacons canceled due to receipt of beacon (IBSS) */
uint32_t rxf0ovfl; /* Number of receive fifo 0 overflows */ uint32_t rxf0ovfl; /* Number of receive fifo 0 overflows */
uint32_t rxf1ovfl; /* Number of receive fifo 1 overflows (obsolete) */ uint32_t rxf1ovfl; /* Number of receive fifo 1 overflows (obsolete) */
@ -1766,22 +1770,20 @@ typedef struct
uint32_t txsfovfl; /* Number of transmit status fifo overflows (obsolete) */ uint32_t txsfovfl; /* Number of transmit status fifo overflows (obsolete) */
uint32_t pmqovfl; /* Number of PMQ overflows */ uint32_t pmqovfl; /* Number of PMQ overflows */
uint32_t rxcgprqfrm; /* Number of received Probe requests that made it into uint32_t rxcgprqfrm; /* Number of received Probe requests that made it into
* the PRQ fifo * the PRQ fifo */
*/
uint32_t rxcgprsqovfl; /* Rx Probe Request Queue overflow in the AP */ uint32_t rxcgprsqovfl; /* Rx Probe Request Queue overflow in the AP */
uint32_t txcgprsfail; /* Tx Probe Response Fail. AP sent probe response but did uint32_t txcgprsfail; /* Tx Probe Response Fail. AP sent probe response but did
* not get ACK * not get ACK */
*/ uint32_t txcgprssuc; /* Tx Probe Response Success (ACK was received) */
uint32_t txcgprssuc; /* Tx Probe Response Success (ACK was received) */
uint32_t prs_timeout; /* Number of probe requests that were dropped from the PRQ uint32_t prs_timeout; /* Number of probe requests that were dropped from the PRQ
* fifo because a probe response could not be sent out within * fifo because a probe response could not be sent out within
* the time limit defined in M_PRS_MAXTIME * the time limit defined in M_PRS_MAXTIME */
*/ uint32_t rxnack; /* obsolete */
uint32_t rxnack; /* obsolete */ uint32_t frmscons; /* obsolete */
uint32_t frmscons; /* obsolete */ uint32_t txnack; /* obsolete */
uint32_t txnack; /* obsolete */
uint32_t txglitch_nack; /* obsolete */ uint32_t txglitch_nack; /* obsolete */
uint32_t txburst; /* obsolete */ uint32_t txburst; /* obsolete */
/* 802.11 MIB counters, pp. 614 of 802.11 reaff doc. */ /* 802.11 MIB counters, pp. 614 of 802.11 reaff doc. */
@ -1802,32 +1804,32 @@ typedef struct
/* WPA2 counters (see rxundec for DecryptFailureCount) */ /* WPA2 counters (see rxundec for DecryptFailureCount) */
uint32_t tkipmicfaill; /* TKIPLocalMICFailures */ uint32_t tkipmicfaill; /* TKIPLocalMICFailures */
uint32_t tkipcntrmsr; /* TKIPCounterMeasuresInvoked */ uint32_t tkipcntrmsr; /* TKIPCounterMeasuresInvoked */
uint32_t tkipreplay; /* TKIPReplays */ uint32_t tkipreplay; /* TKIPReplays */
uint32_t ccmpfmterr; /* CCMPFormatErrors */ uint32_t ccmpfmterr; /* CCMPFormatErrors */
uint32_t ccmpreplay; /* CCMPReplays */ uint32_t ccmpreplay; /* CCMPReplays */
uint32_t ccmpundec; /* CCMPDecryptErrors */ uint32_t ccmpundec; /* CCMPDecryptErrors */
uint32_t fourwayfail; /* FourWayHandshakeFailures */ uint32_t fourwayfail; /* FourWayHandshakeFailures */
uint32_t wepundec; /* dot11WEPUndecryptableCount */ uint32_t wepundec; /* dot11WEPUndecryptableCount */
uint32_t wepicverr; /* dot11WEPICVErrorCount */ uint32_t wepicverr; /* dot11WEPICVErrorCount */
uint32_t decsuccess; /* DecryptSuccessCount */ uint32_t decsuccess; /* DecryptSuccessCount */
uint32_t tkipicverr; /* TKIPICVErrorCount */ uint32_t tkipicverr; /* TKIPICVErrorCount */
uint32_t wepexcluded; /* dot11WEPExcludedCount */ uint32_t wepexcluded; /* dot11WEPExcludedCount */
uint32_t txchanrej; /* Tx frames suppressed due to channel rejection */ uint32_t txchanrej; /* Tx frames suppressed due to channel rejection */
uint32_t psmwds; /* Count PSM watchdogs */ uint32_t psmwds; /* Count PSM watchdogs */
uint32_t phywatchdog; /* Count Phy watchdogs (triggered by ucode) */ uint32_t phywatchdog; /* Count Phy watchdogs (triggered by ucode) */
/* MBSS counters, AP only */ /* MBSS counters, AP only */
uint32_t prq_entries_handled; /* PRQ entries read in */ uint32_t prq_entries_handled; /* PRQ entries read in */
uint32_t prq_undirected_entries; /* which were bcast bss & ssid */ uint32_t prq_undirected_entries; /* which were bcast bss & ssid */
uint32_t prq_bad_entries; /* which could not be translated to info */ uint32_t prq_bad_entries; /* which could not be translated to info */
uint32_t atim_suppress_count; /* TX suppressions on ATIM fifo */ uint32_t atim_suppress_count; /* TX suppressions on ATIM fifo */
uint32_t bcn_template_not_ready; /* Template marked in use on send bcn ... */ uint32_t bcn_template_not_ready; /* Template marked in use on send bcn ... */
uint32_t bcn_template_not_ready_done; /* ...but "DMA done" interrupt rcvd */ uint32_t bcn_template_not_ready_done; /* ...but "DMA done" interrupt rcvd */
uint32_t late_tbtt_dpc; /* TBTT DPC did not happen in time */ uint32_t late_tbtt_dpc; /* TBTT DPC did not happen in time */
/* per-rate receive stat counters */ /* per-rate receive stat counters */
@ -1858,17 +1860,17 @@ typedef struct
uint32_t pktengrxducast; /* unicast frames rxed by the pkteng code */ uint32_t pktengrxducast; /* unicast frames rxed by the pkteng code */
uint32_t pktengrxdmcast; /* multicast frames rxed by the pkteng code */ uint32_t pktengrxdmcast; /* multicast frames rxed by the pkteng code */
uint32_t rfdisable; /* count of radio disables */ uint32_t rfdisable; /* count of radio disables */
uint32_t bphy_rxcrsglitch; /* PHY count of bphy glitches */ uint32_t bphy_rxcrsglitch; /* PHY count of bphy glitches */
uint32_t txexptime; /* Tx frames suppressed due to timer expiration */ uint32_t txexptime; /* Tx frames suppressed due to timer expiration */
uint32_t txmpdu_sgi; /* count for sgi transmit */ uint32_t txmpdu_sgi; /* count for sgi transmit */
uint32_t rxmpdu_sgi; /* count for sgi received */ uint32_t rxmpdu_sgi; /* count for sgi received */
uint32_t txmpdu_stbc; /* count for stbc transmit */ uint32_t txmpdu_stbc; /* count for stbc transmit */
uint32_t rxmpdu_stbc; /* count for stbc received */ uint32_t rxmpdu_stbc; /* count for stbc received */
uint32_t rxundec_mcst; /* dot11WEPUndecryptableCount */ uint32_t rxundec_mcst; /* dot11WEPUndecryptableCount */
/* WPA2 counters (see rxundec for DecryptFailureCount) */ /* WPA2 counters (see rxundec for DecryptFailureCount) */
@ -1877,10 +1879,10 @@ typedef struct
uint32_t tkipreplay_mcst; /* TKIPReplays */ uint32_t tkipreplay_mcst; /* TKIPReplays */
uint32_t ccmpfmterr_mcst; /* CCMPFormatErrors */ uint32_t ccmpfmterr_mcst; /* CCMPFormatErrors */
uint32_t ccmpreplay_mcst; /* CCMPReplays */ uint32_t ccmpreplay_mcst; /* CCMPReplays */
uint32_t ccmpundec_mcst; /* CCMPDecryptErrors */ uint32_t ccmpundec_mcst; /* CCMPDecryptErrors */
uint32_t fourwayfail_mcst; /* FourWayHandshakeFailures */ uint32_t fourwayfail_mcst; /* FourWayHandshakeFailures */
uint32_t wepundec_mcst; /* dot11WEPUndecryptableCount */ uint32_t wepundec_mcst; /* dot11WEPUndecryptableCount */
uint32_t wepicverr_mcst; /* dot11WEPICVErrorCount */ uint32_t wepicverr_mcst; /* dot11WEPICVErrorCount */
uint32_t decsuccess_mcst; /* DecryptSuccessCount */ uint32_t decsuccess_mcst; /* DecryptSuccessCount */
uint32_t tkipicverr_mcst; /* TKIPICVErrorCount */ uint32_t tkipicverr_mcst; /* TKIPICVErrorCount */
uint32_t wepexcluded_mcst; /* dot11WEPExcludedCount */ uint32_t wepexcluded_mcst; /* dot11WEPExcludedCount */
@ -1916,26 +1918,26 @@ typedef struct
/* receive stat counters */ /* receive stat counters */
uint32_t rxframe; /* rx data frames */ uint32_t rxframe; /* rx data frames */
uint32_t rxbyte; /* rx data bytes */ uint32_t rxbyte; /* rx data bytes */
uint32_t rxerror; /* rx data errors (derived: sum of others) */ uint32_t rxerror; /* rx data errors (derived: sum of others) */
uint32_t rxctl; /* rx management frames */ uint32_t rxctl; /* rx management frames */
uint32_t rxnobuf; /* rx out of buffers errors */ uint32_t rxnobuf; /* rx out of buffers errors */
uint32_t rxnondata; /* rx non data frames in the data channel errors */ uint32_t rxnondata; /* rx non data frames in the data channel errors */
uint32_t rxbadds; /* rx bad DS errors */ uint32_t rxbadds; /* rx bad DS errors */
uint32_t rxbadcm; /* rx bad control or management frames */ uint32_t rxbadcm; /* rx bad control or management frames */
uint32_t rxfragerr; /* rx fragmentation errors */ uint32_t rxfragerr; /* rx fragmentation errors */
uint32_t rxrunt; /* rx runt frames */ uint32_t rxrunt; /* rx runt frames */
uint32_t rxgiant; /* rx giant frames */ uint32_t rxgiant; /* rx giant frames */
uint32_t rxnoscb; /* rx no scb error */ uint32_t rxnoscb; /* rx no scb error */
uint32_t rxbadproto; /* rx invalid frames */ uint32_t rxbadproto; /* rx invalid frames */
uint32_t rxbadsrcmac; /* rx frames with Invalid Src Mac */ uint32_t rxbadsrcmac; /* rx frames with Invalid Src Mac */
uint32_t rxbadda; /* rx frames tossed for invalid da */ uint32_t rxbadda; /* rx frames tossed for invalid da */
uint32_t rxfilter; /* rx frames filtered out */ uint32_t rxfilter; /* rx frames filtered out */
/* receive chip error counters */ /* receive chip error counters */
uint32_t rxoflo; /* rx fifo overflow errors */ uint32_t rxoflo; /* rx fifo overflow errors */
uint32_t rxuflo[NFIFO]; /* rx dma descriptor underflow errors */ uint32_t rxuflo[NFIFO]; /* rx dma descriptor underflow errors */
uint32_t d11cnt_txrts_off; /* d11cnt txrts value when reset d11cnt */ uint32_t d11cnt_txrts_off; /* d11cnt txrts value when reset d11cnt */
@ -1944,19 +1946,18 @@ typedef struct
/* misc counters */ /* misc counters */
uint32_t dmade; /* tx/rx dma descriptor errors */ uint32_t dmade; /* tx/rx dma descriptor errors */
uint32_t dmada; /* tx/rx dma data errors */ uint32_t dmada; /* tx/rx dma data errors */
uint32_t dmape; /* tx/rx dma descriptor protocol errors */ uint32_t dmape; /* tx/rx dma descriptor protocol errors */
uint32_t reset; /* reset count */ uint32_t reset; /* reset count */
uint32_t tbtt; /* cnts the TBTT int's */ uint32_t tbtt; /* cnts the TBTT int's */
uint32_t txdmawar; /* # occurrences of PR15420 workaround */ uint32_t txdmawar; /* # occurrences of PR15420 workaround */
uint32_t pkt_callback_reg_fail; /* callbacks register failure */ uint32_t pkt_callback_reg_fail; /* callbacks register failure */
/* MAC counters: 32-bit version of d11.h's macstat_t */ /* MAC counters: 32-bit version of d11.h's macstat_t */
uint32_t txallfrm; /* total number of frames sent, incl. Data, ACK, RTS, CTS, uint32_t txallfrm; /* total number of frames sent, incl. Data, ACK, RTS, CTS,
* Control Management (includes retransmissions) * Control Management (includes retransmissions) */
*/
uint32_t txrtsfrm; /* number of RTS sent out by the MAC */ uint32_t txrtsfrm; /* number of RTS sent out by the MAC */
uint32_t txctsfrm; /* number of CTS sent out by the MAC */ uint32_t txctsfrm; /* number of CTS sent out by the MAC */
uint32_t txackfrm; /* number of ACK frames sent out */ uint32_t txackfrm; /* number of ACK frames sent out */
@ -1966,46 +1967,45 @@ typedef struct
uint32_t rxtoolate; /* receive too late */ uint32_t rxtoolate; /* receive too late */
uint32_t txfbw; /* transmit at fallback bw (dynamic bw) */ uint32_t txfbw; /* transmit at fallback bw (dynamic bw) */
uint32_t txtplunfl; /* Template underflows (mac was too slow to transmit ACK/CTS uint32_t txtplunfl; /* Template underflows (mac was too slow to transmit ACK/CTS
* or BCN) * or BCN) */
*/
uint32_t txphyerror; /* Transmit phy error, type of error is reported in tx-status for uint32_t txphyerror; /* Transmit phy error, type of error is reported in tx-status for
* driver enqueued frames * driver enqueued frames */
*/
uint32_t rxfrmtoolong; /* Received frame longer than legal limit (2346 bytes) */ uint32_t rxfrmtoolong; /* Received frame longer than legal limit (2346 bytes) */
uint32_t rxfrmtooshrt; /* Received frame did not contain enough bytes for its frame type */ uint32_t rxfrmtooshrt; /* Received frame did not contain enough bytes for its frame type */
uint32_t rxinvmachdr; /* Either the protocol version != 0 or frame type not uint32_t rxinvmachdr; /* Either the protocol version != 0 or frame type not
* data/control/management * data/control/management */
*/
uint32_t rxbadfcs; /* number of frames for which the CRC check failed in the MAC */ uint32_t rxbadfcs; /* number of frames for which the CRC check failed in the MAC */
uint32_t rxbadplcp; /* parity check of the PLCP header failed */ uint32_t rxbadplcp; /* parity check of the PLCP header failed */
uint32_t rxcrsglitch; /* PHY was able to correlate the preamble but not the header */ uint32_t rxcrsglitch; /* PHY was able to correlate the preamble but not the header */
uint32_t rxstrt; /* Number of received frames with a good PLCP uint32_t rxstrt; /* Number of received frames with a good PLCP
* (i.e. passing parity check) * (i.e. passing parity check)
*/ */
uint32_t rxdfrmucastmbss; /* Number of received DATA frames with good FCS and matching RA */ uint32_t rxdfrmucastmbss; /* Number of received DATA frames with good FCS and matching RA */
uint32_t rxmfrmucastmbss; /* number of received mgmt frames with good FCS and matching RA */ uint32_t rxmfrmucastmbss; /* number of received mgmt frames with good FCS and matching RA */
uint32_t rxcfrmucast; /* number of received CNTRL frames with good FCS and matching RA */ uint32_t rxcfrmucast; /* number of received CNTRL frames with good FCS and matching RA */
uint32_t rxrtsucast; /* number of unicast RTS addressed to the MAC (good FCS) */ uint32_t rxrtsucast; /* number of unicast RTS addressed to the MAC (good FCS) */
uint32_t rxctsucast; /* number of unicast CTS addressed to the MAC (good FCS) */ uint32_t rxctsucast; /* number of unicast CTS addressed to the MAC (good FCS) */
uint32_t rxackucast; /* number of ucast ACKS received (good FCS) */ uint32_t rxackucast; /* number of ucast ACKS received (good FCS) */
uint32_t rxdfrmocast; /* number of received DATA frames (good FCS and not matching RA) */ uint32_t rxdfrmocast; /* number of received DATA frames (good FCS and not matching RA) */
uint32_t rxmfrmocast; /* number of received MGMT frames (good FCS and not matching RA) */ uint32_t rxmfrmocast; /* number of received MGMT frames (good FCS and not matching RA) */
uint32_t rxcfrmocast; /* number of received CNTRL frame (good FCS and not matching RA) */ uint32_t rxcfrmocast; /* number of received CNTRL frame (good FCS and not matching RA) */
uint32_t rxrtsocast; /* number of received RTS not addressed to the MAC */ uint32_t rxrtsocast; /* number of received RTS not addressed to the MAC */
uint32_t rxctsocast; /* number of received CTS not addressed to the MAC */ uint32_t rxctsocast; /* number of received CTS not addressed to the MAC */
uint32_t rxdfrmmcast; /* number of RX Data multicast frames received by the MAC */ uint32_t rxdfrmmcast; /* number of RX Data multicast frames received by the MAC */
uint32_t rxmfrmmcast; /* number of RX Management multicast frames received by the MAC */ uint32_t rxmfrmmcast; /* number of RX Management multicast frames received by the MAC */
uint32_t rxcfrmmcast; /* number of RX Control multicast frames received by the MAC uint32_t rxcfrmmcast; /* number of RX Control multicast frames received by the MAC
* (unlikely to see these) * (unlikely to see these) */
*/ uint32_t rxbeaconmbss; /* beacons received from member of BSS */
uint32_t rxbeaconmbss; /* beacons received from member of BSS */
uint32_t rxdfrmucastobss; /* number of unicast frames addressed to the MAC from uint32_t rxdfrmucastobss; /* number of unicast frames addressed to the MAC from
* other BSS (WDS FRAME) * other BSS (WDS FRAME) */
*/
uint32_t rxbeaconobss; /* beacons received from other BSS */ uint32_t rxbeaconobss; /* beacons received from other BSS */
uint32_t rxrsptmout; /* Number of response timeouts for transmitted frames uint32_t rxrsptmout; /* Number of response timeouts for transmitted frames
* expecting a response * expecting a response */
*/
uint32_t bcntxcancl; /* transmit beacons canceled due to receipt of beacon (IBSS) */ uint32_t bcntxcancl; /* transmit beacons canceled due to receipt of beacon (IBSS) */
uint32_t rxf0ovfl; /* Number of receive fifo 0 overflows */ uint32_t rxf0ovfl; /* Number of receive fifo 0 overflows */
uint32_t rxf1ovfl; /* Number of receive fifo 1 overflows (obsolete) */ uint32_t rxf1ovfl; /* Number of receive fifo 1 overflows (obsolete) */
@ -2013,17 +2013,17 @@ typedef struct
uint32_t txsfovfl; /* Number of transmit status fifo overflows (obsolete) */ uint32_t txsfovfl; /* Number of transmit status fifo overflows (obsolete) */
uint32_t pmqovfl; /* Number of PMQ overflows */ uint32_t pmqovfl; /* Number of PMQ overflows */
uint32_t rxcgprqfrm; /* Number of received Probe requests that made it into uint32_t rxcgprqfrm; /* Number of received Probe requests that made it into
* the PRQ fifo * the PRQ fifo */
*/
uint32_t rxcgprsqovfl; /* Rx Probe Request Queue overflow in the AP */ uint32_t rxcgprsqovfl; /* Rx Probe Request Queue overflow in the AP */
uint32_t txcgprsfail; /* Tx Probe Response Fail. AP sent probe response but did uint32_t txcgprsfail; /* Tx Probe Response Fail. AP sent probe response but did
* not get ACK * not get ACK */
*/
uint32_t txcgprssuc; /* Tx Probe Response Success (ACK was received) */ uint32_t txcgprssuc; /* Tx Probe Response Success (ACK was received) */
uint32_t prs_timeout; /* Number of probe requests that were dropped from the PRQ uint32_t prs_timeout; /* Number of probe requests that were dropped from the PRQ
* fifo because a probe response could not be sent out within * fifo because a probe response could not be sent out within
* the time limit defined in M_PRS_MAXTIME * the time limit defined in M_PRS_MAXTIME */
*/
uint32_t rxnack; /* obsolete */ uint32_t rxnack; /* obsolete */
uint32_t frmscons; /* obsolete */ uint32_t frmscons; /* obsolete */
uint32_t txnack; /* obsolete */ uint32_t txnack; /* obsolete */
@ -2051,30 +2051,30 @@ typedef struct
uint32_t tkipmicfaill; /* TKIPLocalMICFailures */ uint32_t tkipmicfaill; /* TKIPLocalMICFailures */
uint32_t tkipcntrmsr; /* TKIPCounterMeasuresInvoked */ uint32_t tkipcntrmsr; /* TKIPCounterMeasuresInvoked */
uint32_t tkipreplay; /* TKIPReplays */ uint32_t tkipreplay; /* TKIPReplays */
uint32_t ccmpfmterr; /* CCMPFormatErrors */ uint32_t ccmpfmterr; /* CCMPFormatErrors */
uint32_t ccmpreplay; /* CCMPReplays */ uint32_t ccmpreplay; /* CCMPReplays */
uint32_t ccmpundec; /* CCMPDecryptErrors */ uint32_t ccmpundec; /* CCMPDecryptErrors */
uint32_t fourwayfail; /* FourWayHandshakeFailures */ uint32_t fourwayfail; /* FourWayHandshakeFailures */
uint32_t wepundec; /* dot11WEPUndecryptableCount */ uint32_t wepundec; /* dot11WEPUndecryptableCount */
uint32_t wepicverr; /* dot11WEPICVErrorCount */ uint32_t wepicverr; /* dot11WEPICVErrorCount */
uint32_t decsuccess; /* DecryptSuccessCount */ uint32_t decsuccess; /* DecryptSuccessCount */
uint32_t tkipicverr; /* TKIPICVErrorCount */ uint32_t tkipicverr; /* TKIPICVErrorCount */
uint32_t wepexcluded; /* dot11WEPExcludedCount */ uint32_t wepexcluded; /* dot11WEPExcludedCount */
uint32_t txchanrej; /* Tx frames suppressed due to channel rejection */ uint32_t txchanrej; /* Tx frames suppressed due to channel rejection */
uint32_t psmwds; /* Count PSM watchdogs */ uint32_t psmwds; /* Count PSM watchdogs */
uint32_t phywatchdog; /* Count Phy watchdogs (triggered by ucode) */ uint32_t phywatchdog; /* Count Phy watchdogs (triggered by ucode) */
/* MBSS counters, AP only */ /* MBSS counters, AP only */
uint32_t prq_entries_handled; /* PRQ entries read in */ uint32_t prq_entries_handled; /* PRQ entries read in */
uint32_t prq_undirected_entries; /* which were bcast bss & ssid */ uint32_t prq_undirected_entries; /* which were bcast bss & ssid */
uint32_t prq_bad_entries; /* which could not be translated to info */ uint32_t prq_bad_entries; /* which could not be translated to info */
uint32_t atim_suppress_count; /* TX suppressions on ATIM fifo */ uint32_t atim_suppress_count; /* TX suppressions on ATIM fifo */
uint32_t bcn_template_not_ready; /* Template marked in use on send bcn ... */ uint32_t bcn_template_not_ready; /* Template marked in use on send bcn ... */
uint32_t bcn_template_not_ready_done; /* ...but "DMA done" interrupt rcvd */ uint32_t bcn_template_not_ready_done; /* ...but "DMA done" interrupt rcvd */
uint32_t late_tbtt_dpc; /* TBTT DPC did not happen in time */ uint32_t late_tbtt_dpc; /* TBTT DPC did not happen in time */
/* per-rate receive stat counters */ /* per-rate receive stat counters */
@ -2105,14 +2105,14 @@ typedef struct
uint32_t pktengrxducast; /* unicast frames rxed by the pkteng code */ uint32_t pktengrxducast; /* unicast frames rxed by the pkteng code */
uint32_t pktengrxdmcast; /* multicast frames rxed by the pkteng code */ uint32_t pktengrxdmcast; /* multicast frames rxed by the pkteng code */
uint32_t rfdisable; /* count of radio disables */ uint32_t rfdisable; /* count of radio disables */
uint32_t bphy_rxcrsglitch; /* PHY count of bphy glitches */ uint32_t bphy_rxcrsglitch; /* PHY count of bphy glitches */
uint32_t bphy_badplcp; uint32_t bphy_badplcp;
uint32_t txexptime; /* Tx frames suppressed due to timer expiration */ uint32_t txexptime; /* Tx frames suppressed due to timer expiration */
uint32_t txmpdu_sgi; /* count for sgi transmit */ uint32_t txmpdu_sgi; /* count for sgi transmit */
uint32_t rxmpdu_sgi; /* count for sgi received */ uint32_t rxmpdu_sgi; /* count for sgi received */
uint32_t txmpdu_stbc; /* count for stbc transmit */ uint32_t txmpdu_stbc; /* count for stbc transmit */
uint32_t rxmpdu_stbc; /* count for stbc received */ uint32_t rxmpdu_stbc; /* count for stbc received */
@ -2125,10 +2125,10 @@ typedef struct
uint32_t tkipreplay_mcst; /* TKIPReplays */ uint32_t tkipreplay_mcst; /* TKIPReplays */
uint32_t ccmpfmterr_mcst; /* CCMPFormatErrors */ uint32_t ccmpfmterr_mcst; /* CCMPFormatErrors */
uint32_t ccmpreplay_mcst; /* CCMPReplays */ uint32_t ccmpreplay_mcst; /* CCMPReplays */
uint32_t ccmpundec_mcst; /* CCMPDecryptErrors */ uint32_t ccmpundec_mcst; /* CCMPDecryptErrors */
uint32_t fourwayfail_mcst; /* FourWayHandshakeFailures */ uint32_t fourwayfail_mcst; /* FourWayHandshakeFailures */
uint32_t wepundec_mcst; /* dot11WEPUndecryptableCount */ uint32_t wepundec_mcst; /* dot11WEPUndecryptableCount */
uint32_t wepicverr_mcst; /* dot11WEPICVErrorCount */ uint32_t wepicverr_mcst; /* dot11WEPICVErrorCount */
uint32_t decsuccess_mcst; /* DecryptSuccessCount */ uint32_t decsuccess_mcst; /* DecryptSuccessCount */
uint32_t tkipicverr_mcst; /* TKIPICVErrorCount */ uint32_t tkipicverr_mcst; /* TKIPICVErrorCount */
uint32_t wepexcluded_mcst; /* dot11WEPExcludedCount */ uint32_t wepexcluded_mcst; /* dot11WEPExcludedCount */
@ -2139,22 +2139,20 @@ typedef struct
uint32_t pstatxucast; /* count of ucast frames xmitted on all psta assoc */ uint32_t pstatxucast; /* count of ucast frames xmitted on all psta assoc */
uint32_t pstatxnoassoc; /* count of txnoassoc frames xmitted on all psta assoc */ uint32_t pstatxnoassoc; /* count of txnoassoc frames xmitted on all psta assoc */
uint32_t pstarxucast; /* count of ucast frames received on all psta assoc */ uint32_t pstarxucast; /* count of ucast frames received on all psta assoc */
uint32_t pstarxbcmc; /* count of bcmc frames received on all psta */ uint32_t pstarxbcmc; /* count of bcmc frames received on all psta */
uint32_t pstatxbcmc; /* count of bcmc frames transmitted on all psta */ uint32_t pstatxbcmc; /* count of bcmc frames transmitted on all psta */
uint32_t cso_passthrough; /* hw cso required but passthrough */ uint32_t cso_passthrough; /* hw cso required but passthrough */
uint32_t cso_normal; /* hw cso hdr for normal process */ uint32_t cso_normal; /* hw cso hdr for normal process */
uint32_t chained; /* number of frames chained */ uint32_t chained; /* number of frames chained */
uint32_t chainedsz1; /* number of chain size 1 frames */ uint32_t chainedsz1; /* number of chain size 1 frames */
uint32_t unchained; /* number of frames not chained */ uint32_t unchained; /* number of frames not chained */
uint32_t maxchainsz; /* max chain size so far */ uint32_t maxchainsz; /* max chain size so far */
uint32_t currchainsz; /* current chain size */ uint32_t currchainsz; /* current chain size */
uint32_t rxdrop20s; /* drop secondary cnt */ uint32_t rxdrop20s; /* drop secondary cnt */
} wl_cnt_ver_eight_t; } wl_cnt_ver_eight_t;
typedef struct typedef struct
{ {
uint16_t version; uint16_t version;
@ -2737,7 +2735,8 @@ struct edcf_acparam
uint8_t ACI; uint8_t ACI;
uint8_t ECW; uint8_t ECW;
uint16_t TXOP; /* stored in network order (ls octet first) */ uint16_t TXOP; /* stored in network order (ls octet first) */
} ; };
typedef struct edcf_acparam edcf_acparam_t; typedef struct edcf_acparam edcf_acparam_t;
/* Stop packing structures */ /* Stop packing structures */
@ -2819,7 +2818,7 @@ typedef enum
WLC_E_WAI_STA_EVENT = 67, /* WAI stations event */ WLC_E_WAI_STA_EVENT = 67, /* WAI stations event */
WLC_E_WAI_MSG = 68, /* event encapsulating an WAI message */ WLC_E_WAI_MSG = 68, /* event encapsulating an WAI message */
WLC_E_ESCAN_RESULT = 69, /* escan result event */ WLC_E_ESCAN_RESULT = 69, /* escan result event */
WLC_E_ACTION_FRAME_OFF_CHAN_COMPLETE = 70, /* action frame off channel complete */ /* NOTE - This used to be WLC_E_WAKE_EVENT */ WLC_E_ACTION_FRAME_OFF_CHAN_COMPLETE = 70, /* action frame off channel complete. NOTE - This used to be WLC_E_WAKE_EVENT */
WLC_E_PROBRESP_MSG = 71, /* probe response received */ WLC_E_PROBRESP_MSG = 71, /* probe response received */
WLC_E_P2P_PROBREQ_MSG = 72, /* P2P Probe request received */ WLC_E_P2P_PROBREQ_MSG = 72, /* P2P Probe request received */
WLC_E_DCS_REQUEST = 73, WLC_E_DCS_REQUEST = 73,
@ -2880,7 +2879,7 @@ typedef enum
WLC_E_PSTA_PRIMARY_INTF_IND = 128, /* psta primary interface indication */ WLC_E_PSTA_PRIMARY_INTF_IND = 128, /* psta primary interface indication */
WLC_E_LAST = 129, /* highest val + 1 for range checking */ WLC_E_LAST = 129, /* highest val + 1 for range checking */
WLC_E_FORCE_32_BIT = 0x7FFFFFFE /* Force enum to be stored in 32 bit variable */ WLC_E_FORCE_32_BIT = 0x7ffffffe /* Force enum to be stored in 32 bit variable */
} wl_event_num_t; } wl_event_num_t;
#define BCMF_EVENT_COUNT WLC_E_LAST #define BCMF_EVENT_COUNT WLC_E_LAST
@ -2959,7 +2958,7 @@ typedef enum
WLC_DOT11_SC_INVALID_MDID = 54 + WLC_DOT11_SC_STATUS_OFFSET, /* Association denied due to invalid MDID */ WLC_DOT11_SC_INVALID_MDID = 54 + WLC_DOT11_SC_STATUS_OFFSET, /* Association denied due to invalid MDID */
WLC_DOT11_SC_INVALID_FTIE = 55 + WLC_DOT11_SC_STATUS_OFFSET, /* Association denied due to invalid FTIE */ WLC_DOT11_SC_INVALID_FTIE = 55 + WLC_DOT11_SC_STATUS_OFFSET, /* Association denied due to invalid FTIE */
WLC_E_STATUS_FORCE_32_BIT = 0x7FFFFFFE /* Force enum to be stored in 32 bit variable */ WLC_E_STATUS_FORCE_32_BIT = 0x7ffffffe /* Force enum to be stored in 32 bit variable */
} wl_event_status_t; } wl_event_status_t;
#define WLC_E_PRUNE_REASON_OFFSET (256) #define WLC_E_PRUNE_REASON_OFFSET (256)
@ -3051,7 +3050,7 @@ typedef enum
DOT11_RC_TIMEOUT = 39 + WLC_E_DOT11_RC_REASON_OFFSET, /* timeout */ DOT11_RC_TIMEOUT = 39 + WLC_E_DOT11_RC_REASON_OFFSET, /* timeout */
DOT11_RC_MAX = 23 + WLC_E_DOT11_RC_REASON_OFFSET, /* Reason codes > 23 are reserved */ DOT11_RC_MAX = 23 + WLC_E_DOT11_RC_REASON_OFFSET, /* Reason codes > 23 are reserved */
WLC_E_REASON_FORCE_32_BIT = 0x7FFFFFFE /* Force enum to be stored in 32 bit variable */ WLC_E_REASON_FORCE_32_BIT = 0x7ffffffe /* Force enum to be stored in 32 bit variable */
} wl_event_reason_t; } wl_event_reason_t;
#endif /* __DRIVERS_WIRELESS_IEEE80211_BCMF_IOCTL_H */ #endif /* __DRIVERS_WIRELESS_IEEE80211_BCMF_IOCTL_H */

View file

@ -36,8 +36,16 @@
#ifndef __DRIVERS_WIRELESS_IEEE80211_BCMF_NETDEV_H #ifndef __DRIVERS_WIRELESS_IEEE80211_BCMF_NETDEV_H
#define __DRIVERS_WIRELESS_IEEE80211_BCMF_NETDEV_H #define __DRIVERS_WIRELESS_IEEE80211_BCMF_NETDEV_H
/****************************************************************************
* Included Files
****************************************************************************/
#include "bcmf_driver.h" #include "bcmf_driver.h"
/****************************************************************************
* Public Functions Prototypes
****************************************************************************/
int bcmf_netdev_register(FAR struct bcmf_dev_s *priv); int bcmf_netdev_register(FAR struct bcmf_dev_s *priv);
void bcmf_netdev_notify_rx(FAR struct bcmf_dev_s *priv); void bcmf_netdev_notify_rx(FAR struct bcmf_dev_s *priv);

View file

@ -7,19 +7,27 @@
* *
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* *
****************************************************************************/ ****************************************************************************/
#ifndef __DRIVERS_WIRELESS_IEEE80211_BCMF_SDIO_CORE_H #ifndef __DRIVERS_WIRELESS_IEEE80211_BCMF_SDIO_CORE_H
#define __DRIVERS_WIRELESS_IEEE80211_BCMF_SDIO_CORE_H #define __DRIVERS_WIRELESS_IEEE80211_BCMF_SDIO_CORE_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <stdint.h> #include <stdint.h>
/****************************************************************************
* Public Data
****************************************************************************/
#ifndef PAD #ifndef PAD
#define _PADLINE(line) pad ## line #define _PADLINE(line) pad ## line
#define _XSTR(line) _PADLINE(line) #define _XSTR(line) _PADLINE(line)
@ -143,6 +151,7 @@ struct sdpcmd_regs
uint32_t biststatus; /* rev8 */ uint32_t biststatus; /* rev8 */
/* PCMCIA access */ /* PCMCIA access */
uint16_t pcmciamesportaladdr; /* 0x010, rev8 */ uint16_t pcmciamesportaladdr; /* 0x010, rev8 */
uint16_t PAD[1]; uint16_t PAD[1];
uint16_t pcmciamesportalmask; /* rev8 */ uint16_t pcmciamesportalmask; /* rev8 */
@ -153,6 +162,7 @@ struct sdpcmd_regs
uint16_t PAD[1]; uint16_t PAD[1];
/* interrupt */ /* interrupt */
uint32_t intstatus; /* 0x020, rev8 */ uint32_t intstatus; /* 0x020, rev8 */
uint32_t hostintmask; /* rev8 */ uint32_t hostintmask; /* rev8 */
uint32_t intmask; /* rev8 */ uint32_t intmask; /* rev8 */
@ -166,20 +176,24 @@ struct sdpcmd_regs
uint32_t tohostmailboxdata; /* rev8 */ uint32_t tohostmailboxdata; /* rev8 */
/* synchronized access to registers in SDIO clock domain */ /* synchronized access to registers in SDIO clock domain */
uint32_t sdioaccess; /* 0x050, rev8 */ uint32_t sdioaccess; /* 0x050, rev8 */
uint32_t PAD[3]; uint32_t PAD[3];
/* PCMCIA frame control */ /* PCMCIA frame control */
uint8_t pcmciaframectrl; /* 0x060, rev8 */ uint8_t pcmciaframectrl; /* 0x060, rev8 */
uint8_t PAD[3]; uint8_t PAD[3];
uint8_t pcmciawatermark; /* rev8 */ uint8_t pcmciawatermark; /* rev8 */
uint8_t PAD[155]; uint8_t PAD[155];
/* interrupt batching control */ /* interrupt batching control */
uint32_t intrcvlazy; /* 0x100, rev8 */ uint32_t intrcvlazy; /* 0x100, rev8 */
uint32_t PAD[3]; uint32_t PAD[3];
/* counters */ /* counters */
uint32_t cmd52rd; /* 0x110, rev8 */ uint32_t cmd52rd; /* 0x110, rev8 */
uint32_t cmd52wr; /* rev8 */ uint32_t cmd52wr; /* rev8 */
uint32_t cmd53rd; /* rev8 */ uint32_t cmd53rd; /* rev8 */
@ -199,13 +213,16 @@ struct sdpcmd_regs
uint32_t PAD[128]; /* DMA engines */ uint32_t PAD[128]; /* DMA engines */
/* SDIO/PCMCIA CIS region */ /* SDIO/PCMCIA CIS region */
char cis[512]; /* 0x400-0x5ff, rev6 */ char cis[512]; /* 0x400-0x5ff, rev6 */
/* PCMCIA function control registers */ /* PCMCIA function control registers */
char pcmciafcr[256]; /* 0x600-6ff, rev6 */ char pcmciafcr[256]; /* 0x600-6ff, rev6 */
uint16_t PAD[55]; uint16_t PAD[55];
/* PCMCIA backplane access */ /* PCMCIA backplane access */
uint16_t backplanecsr; /* 0x76E, rev6 */ uint16_t backplanecsr; /* 0x76E, rev6 */
uint16_t backplaneaddr0; /* rev6 */ uint16_t backplaneaddr0; /* rev6 */
uint16_t backplaneaddr1; /* rev6 */ uint16_t backplaneaddr1; /* rev6 */
@ -218,10 +235,15 @@ struct sdpcmd_regs
uint16_t PAD[31]; uint16_t PAD[31];
/* sprom "size" & "blank" info */ /* sprom "size" & "blank" info */
uint16_t spromstatus; /* 0x7BE, rev2 */ uint16_t spromstatus; /* 0x7BE, rev2 */
uint32_t PAD[464]; uint32_t PAD[464];
uint16_t PAD[0x80]; uint16_t PAD[0x80];
}; };
/****************************************************************************
* Public Functions Prototypes
****************************************************************************/
#endif /* __DRIVERS_WIRELESS_IEEE80211_BCMF_SDIO_CORE_H */ #endif /* __DRIVERS_WIRELESS_IEEE80211_BCMF_SDIO_CORE_H */

View file

@ -7,11 +7,11 @@
* *
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* *
****************************************************************************/ ****************************************************************************/
@ -140,7 +140,6 @@
#define SFC_ABORTALL (1 << 3) #define SFC_ABORTALL (1 << 3)
/* ChipClockCSR (ALP/HT ctl/status) */ /* ChipClockCSR (ALP/HT ctl/status) */
#define SBSDIO_FUNC1_CHIPCLKCSR 0x1000E #define SBSDIO_FUNC1_CHIPCLKCSR 0x1000E
@ -242,7 +241,9 @@
#define SBSDIO_SBADDRLOW_MASK 0x80 /* Valid bits in SBADDRLOW */ #define SBSDIO_SBADDRLOW_MASK 0x80 /* Valid bits in SBADDRLOW */
#define SBSDIO_SBADDRMID_MASK 0xff /* Valid bits in SBADDRMID */ #define SBSDIO_SBADDRMID_MASK 0xff /* Valid bits in SBADDRMID */
#define SBSDIO_SBADDRHIGH_MASK 0xffU /* Valid bits in SBADDRHIGH */ #define SBSDIO_SBADDRHIGH_MASK 0xffU /* Valid bits in SBADDRHIGH */
/* Address bits from SBADDR regs */ /* Address bits from SBADDR regs */
#define SBSDIO_SBWINDOW_MASK 0xffff8000 #define SBSDIO_SBWINDOW_MASK 0xffff8000
#endif /* __DRIVERS_WIRELESS_IEEE80211_BCMF_SDIO_REGS_H */ #endif /* __DRIVERS_WIRELESS_IEEE80211_BCMF_SDIO_REGS_H */

View file

@ -205,7 +205,8 @@ int bcmf_sdpcm_readframe(FAR struct bcmf_dev_s *priv)
/* Read remaining frame data */ /* Read remaining frame data */
ret = bcmf_transfer_bytes(sbus, false, 2, 0, (uint8_t *)header + 4, len - 4); ret = bcmf_transfer_bytes(sbus, false, 2, 0,
(uint8_t *)header + 4, len - 4);
if (ret != OK) if (ret != OK)
{ {
ret = -EIO; ret = -EIO;
@ -377,7 +378,8 @@ int bcmf_sdpcm_queue_frame(FAR struct bcmf_dev_s *priv,
{ {
FAR struct bcmf_sdio_dev_s *sbus = (FAR struct bcmf_sdio_dev_s *)priv->bus; FAR struct bcmf_sdio_dev_s *sbus = (FAR struct bcmf_sdio_dev_s *)priv->bus;
struct bcmf_sdio_frame *sframe = (struct bcmf_sdio_frame *)frame; struct bcmf_sdio_frame *sframe = (struct bcmf_sdio_frame *)frame;
struct bcmf_sdpcm_header *header = (struct bcmf_sdpcm_header *)sframe->data; struct bcmf_sdpcm_header *header =
(struct bcmf_sdpcm_header *)sframe->data;
/* Prepare sw header */ /* Prepare sw header */

View file

@ -53,7 +53,8 @@ int bcmf_sdpcm_sendframe(FAR struct bcmf_dev_s *priv);
int bcmf_sdpcm_queue_frame(FAR struct bcmf_dev_s *priv, int bcmf_sdpcm_queue_frame(FAR struct bcmf_dev_s *priv,
struct bcmf_frame_s *frame, bool control); struct bcmf_frame_s *frame, bool control);
void bcmf_sdpcm_free_frame(FAR struct bcmf_dev_s *priv, struct bcmf_frame_s *frame); void bcmf_sdpcm_free_frame(FAR struct bcmf_dev_s *priv,
struct bcmf_frame_s *frame);
struct bcmf_frame_s *bcmf_sdpcm_alloc_frame(FAR struct bcmf_dev_s *priv, struct bcmf_frame_s *bcmf_sdpcm_alloc_frame(FAR struct bcmf_dev_s *priv,
unsigned int len, bool block, unsigned int len, bool block,

View file

@ -345,7 +345,8 @@ static uint8_t at86rf23x_getregbits(FAR struct spi_dev_s *spi, uint8_t addr,
* *
****************************************************************************/ ****************************************************************************/
static int at86rf23x_writeframe(FAR struct spi_dev_s *spi, FAR uint8_t *frame, static int at86rf23x_writeframe(FAR struct spi_dev_s *spi,
FAR uint8_t *frame,
uint8_t len) uint8_t len)
{ {
uint8_t reg = RF23X_SPI_FRAME_WRITE; uint8_t reg = RF23X_SPI_FRAME_WRITE;
@ -432,7 +433,9 @@ static int at86rf23x_set_trxstate(FAR struct at86rf23x_dev_s *dev,
int ret = OK; int ret = OK;
/* TODO I don't have every state included verify this will work with SLEEP */ /* TODO
* I don't have every state included verify this will work with SLEEP
*/
if ((status != TRX_STATUS_TRXOFF) && if ((status != TRX_STATUS_TRXOFF) &&
(status != TRX_STATUS_RXON) && (status != TRX_STATUS_RXON) &&
@ -614,7 +617,9 @@ static int at86rf23x_set_trxstate(FAR struct at86rf23x_dev_s *dev,
break; break;
case TRX_STATUS_SLEEP: case TRX_STATUS_SLEEP:
at86rf23x_setregbits(dev->spi, RF23X_TRXCMD_STATE, TRX_CMD_FORCETRXOFF); at86rf23x_setregbits(dev->spi,
RF23X_TRXCMD_STATE,
TRX_CMD_FORCETRXOFF);
up_udelay(RF23X_TIME_CMD_FORCE_TRX_OFF); up_udelay(RF23X_TIME_CMD_FORCE_TRX_OFF);
dev->lower->slptr(dev->lower, true); dev->lower->slptr(dev->lower, true);
@ -975,7 +980,9 @@ static int at86rf23x_settxpower(FAR struct ieee802154_radio_s *ieee,
{ {
FAR struct at86rf23x_dev_s *dev = (struct at86rf23x_dev_s *)ieee; FAR struct at86rf23x_dev_s *dev = (struct at86rf23x_dev_s *)ieee;
/* TODO: this needs a lot of work to make sure all chips can share this function */ /* TODO:
* this needs a lot of work to make sure all chips can share this function
*/
/* Right now we only set tx power to 0 */ /* Right now we only set tx power to 0 */
@ -1229,8 +1236,9 @@ static int at86rf23x_resetrf(FAR struct at86rf23x_dev_s *dev)
* *
****************************************************************************/ ****************************************************************************/
static int at86rf23x_rxenable(FAR struct ieee802154_radio_s *ieee, bool state, static int
FAR struct ieee802154_packet_s *packet) at86rf23x_rxenable(FAR struct ieee802154_radio_s *ieee, bool state,
FAR struct ieee802154_packet_s *packet)
{ {
FAR struct at86rf23x_dev_s *dev = (FAR struct at86rf23x_dev_s *)ieee; FAR struct at86rf23x_dev_s *dev = (FAR struct at86rf23x_dev_s *)ieee;
@ -1327,7 +1335,9 @@ static int at86rf23x_regdump(FAR struct at86rf23x_dev_s *dev)
} }
} }
/* TODO: I have a few more regs that are not consecutive. Will print later */ /* TODO:
* I have a few more regs that are not consecutive. Will print later
*/
return 0; return 0;
} }

View file

@ -42,11 +42,14 @@ int mrf24j40_setrxmode(FAR struct mrf24j40_radio_s *dev, int mode);
int mrf24j40_setchannel(FAR struct mrf24j40_radio_s *dev, uint8_t chan); int mrf24j40_setchannel(FAR struct mrf24j40_radio_s *dev, uint8_t chan);
int mrf24j40_setpanid(FAR struct mrf24j40_radio_s *dev, FAR const uint8_t *panid); int mrf24j40_setpanid(FAR struct mrf24j40_radio_s *dev,
FAR const uint8_t *panid);
int mrf24j40_setsaddr(FAR struct mrf24j40_radio_s *dev, FAR const uint8_t *saddr); int mrf24j40_setsaddr(FAR struct mrf24j40_radio_s *dev,
FAR const uint8_t *saddr);
int mrf24j40_seteaddr(FAR struct mrf24j40_radio_s *dev, FAR const uint8_t *eaddr); int mrf24j40_seteaddr(FAR struct mrf24j40_radio_s *dev,
FAR const uint8_t *eaddr);
int mrf24j40_setcoordsaddr(FAR struct mrf24j40_radio_s *dev, int mrf24j40_setcoordsaddr(FAR struct mrf24j40_radio_s *dev,
FAR const uint8_t *saddr); FAR const uint8_t *saddr);

View file

@ -97,10 +97,10 @@ static void mrf24j40_irqwork_txnorm(FAR struct mrf24j40_radio_s *dev)
if (reg & MRF24J40_TXSTAT_TXNSTAT) if (reg & MRF24J40_TXSTAT_TXNSTAT)
{ {
/* The number of retries of the most recent transmission is contained in the /* The number of retries of the most recent transmission is contained
* TXNRETRY (TXSTAT 0x24<7:6>) bits. The CCAFAIL (TXSTAT 0x24<5>) bit = 1 * in the TXNRETRY (TXSTAT 0x24<7:6>) bits.
* indicates if the failed transmission was due to the channel busy * The CCAFAIL (TXSTAT 0x24<5>) bit = 1 indicates if the failed
* (CSMA-CA timed out). * transmission was due to the channel busy (CSMA-CA timed out).
*/ */
if (reg & MRF24J40_TXSTAT_CCAFAIL) if (reg & MRF24J40_TXSTAT_CCAFAIL)
@ -214,7 +214,6 @@ static void mrf24j40_irqwork_txgts(FAR struct mrf24j40_radio_s *dev,
****************************************************************************/ ****************************************************************************/
static void mrf24j40_irqwork_rx(FAR struct mrf24j40_radio_s *dev) static void mrf24j40_irqwork_rx(FAR struct mrf24j40_radio_s *dev)
{ {
FAR struct ieee802154_primitive_s *primitive; FAR struct ieee802154_primitive_s *primitive;
FAR struct ieee802154_data_ind_s *ind; FAR struct ieee802154_data_ind_s *ind;
@ -344,8 +343,8 @@ void mrf24j40_irqworker(FAR void *arg)
if ((intstat & MRF24J40_INTSTAT_HSYMTMRIF)) if ((intstat & MRF24J40_INTSTAT_HSYMTMRIF))
{ {
/* As of now the only use for the MAC timer is for delayed transactions. /* As of now the only use for the MAC timer is for delayed
* Therefore, all we do here is trigger the TX norm FIFO * transactions. Therefore, all we do here is trigger the TX norm FIFO
*/ */
mrf24j40_norm_trigger(dev); mrf24j40_norm_trigger(dev);
@ -366,21 +365,21 @@ void mrf24j40_irqworker(FAR void *arg)
if ((intstat & MRF24J40_INTSTAT_TXNIF)) if ((intstat & MRF24J40_INTSTAT_TXNIF))
{ {
/* A packet was transmitted or failed*/ /* A packet was transmitted or failed */
mrf24j40_irqwork_txnorm(dev); mrf24j40_irqwork_txnorm(dev);
} }
if ((intstat & MRF24J40_INTSTAT_TXG1IF)) if ((intstat & MRF24J40_INTSTAT_TXG1IF))
{ {
/* A packet was transmitted or failed*/ /* A packet was transmitted or failed */
mrf24j40_irqwork_txgts(dev, 0); mrf24j40_irqwork_txgts(dev, 0);
} }
if ((intstat & MRF24J40_INTSTAT_TXG1IF)) if ((intstat & MRF24J40_INTSTAT_TXG1IF))
{ {
/* A packet was transmitted or failed*/ /* A packet was transmitted or failed */
mrf24j40_irqwork_txgts(dev, 1); mrf24j40_irqwork_txgts(dev, 1);
} }
@ -404,10 +403,10 @@ void mrf24j40_irqworker(FAR void *arg)
if (dev->devmode != IEEE802154_DEVMODE_ENDPOINT) if (dev->devmode != IEEE802154_DEVMODE_ENDPOINT)
{ {
/* This is right before the beacon, we set the bsn here, since the MAC /* This is right before the beacon, we set the bsn here, since the
* uses the SLPIF (end of active portion of superframe). to make any * MAC uses the SLPIF (end of active portion of superframe). to
* changes to the beacon. This assumes that any changes to the beacon * make any changes to the beacon. This assumes that any changes
* be in by the time that this interrupt fires. * to the beacon be in by the time that this interrupt fires.
*/ */
mrf24j40_setreg(dev->spi, MRF24J40_BEACON_FIFO + 4, dev->bsn++); mrf24j40_setreg(dev->spi, MRF24J40_BEACON_FIFO + 4, dev->bsn++);
@ -463,5 +462,6 @@ int mrf24j40_interrupt(int irq, FAR void *context, FAR void *arg)
*/ */
dev->lower->enable(dev->lower, false); dev->lower->enable(dev->lower, false);
return work_queue(HPWORK, &dev->irqwork, mrf24j40_irqworker, (FAR void *)dev, 0); return work_queue(HPWORK, &dev->irqwork,
mrf24j40_irqworker, (FAR void *)dev, 0);
} }

View file

@ -156,7 +156,7 @@ static void mrf24j40_setorder(FAR struct mrf24j40_radio_s *dev, uint8_t bo,
/* Program the Main Counter, MAINCNT (0x229<1:0>, 0x228, 0x227, /* Program the Main Counter, MAINCNT (0x229<1:0>, 0x228, 0x227,
* 0x226), and Remain Counter, REMCNT (0x225, 0x224), according to BO * 0x226), and Remain Counter, REMCNT (0x225, 0x224), according to BO
* and SO values. Refer to Section 3.15.1.3 Sleep Mode * Counters * and SO values. Refer to Section 3.15.1.3 "Sleep Mode * Counters"
*/ */
mrf24j40_setreg(dev->spi, MRF24J40_REMCNTL, (remcnt & 0xff)); mrf24j40_setreg(dev->spi, MRF24J40_REMCNTL, (remcnt & 0xff));
@ -172,7 +172,8 @@ static void mrf24j40_setorder(FAR struct mrf24j40_radio_s *dev, uint8_t bo,
* After configuring BO and SO, the beacon frame will be sent immediately. * After configuring BO and SO, the beacon frame will be sent immediately.
*/ */
mrf24j40_setreg(dev->spi, MRF24J40_ORDER, ((bo << 4) & 0xf0) | (so & 0x0f)); mrf24j40_setreg(dev->spi, MRF24J40_ORDER,
((bo << 4) & 0xf0) | (so & 0x0f));
} }
static void mrf24j40_slpclkcal(FAR struct mrf24j40_radio_s *dev) static void mrf24j40_slpclkcal(FAR struct mrf24j40_radio_s *dev)
@ -264,7 +265,8 @@ int mrf24j40_txnotify(FAR struct ieee802154_radio_s *radio, bool gts)
{ {
/* Schedule to serialize the poll on the worker thread. */ /* Schedule to serialize the poll on the worker thread. */
work_queue(HPWORK, &dev->gts_pollwork, mrf24j40_dopoll_gts, dev, 0); work_queue(HPWORK, &dev->gts_pollwork,
mrf24j40_dopoll_gts, dev, 0);
} }
} }
else else
@ -424,7 +426,8 @@ int mrf24j40_rxenable(FAR struct ieee802154_radio_s *radio, bool enable)
return OK; return OK;
} }
int mrf24j40_energydetect(FAR struct ieee802154_radio_s *radio, uint32_t nsymbols) int mrf24j40_energydetect(FAR struct ieee802154_radio_s *radio,
uint32_t nsymbols)
{ {
return -ENOTTY; return -ENOTTY;
} }
@ -657,13 +660,17 @@ int mrf24j40_beaconstart(FAR struct ieee802154_radio_s *radio,
if (sfspec->pancoord) if (sfspec->pancoord)
{ {
/* Set the PANCOORD (RXMCR 0x00<3>) bit = 1to configure as PAN coordinator */ /* Set the PANCOORD (RXMCR 0x00<3>) bit = 1to configure as
* PAN coordinator
*/
reg = mrf24j40_getreg(dev->spi, MRF24J40_RXMCR); reg = mrf24j40_getreg(dev->spi, MRF24J40_RXMCR);
reg |= MRF24J40_RXMCR_PANCOORD; reg |= MRF24J40_RXMCR_PANCOORD;
mrf24j40_setreg(dev->spi, MRF24J40_RXMCR, reg); mrf24j40_setreg(dev->spi, MRF24J40_RXMCR, reg);
/* Set the SLOTTED (TXMCR 0x11<5>) bit = 1 to use Slotted CSMA-CA mode */ /* Set the SLOTTED (TXMCR 0x11<5>) bit = 1 to use
* Slotted CSMA-CA mode
*/
reg = mrf24j40_getreg(dev->spi, MRF24J40_TXMCR); reg = mrf24j40_getreg(dev->spi, MRF24J40_TXMCR);
reg |= MRF24J40_TXMCR_SLOTTED; reg |= MRF24J40_TXMCR_SLOTTED;
@ -679,8 +686,8 @@ int mrf24j40_beaconstart(FAR struct ieee802154_radio_s *radio,
dev->bsn = 0; dev->bsn = 0;
mrf24j40_setreg(dev->spi, MRF24J40_BEACON_FIFO + 4, dev->bsn++); mrf24j40_setreg(dev->spi, MRF24J40_BEACON_FIFO + 4, dev->bsn++);
/* Set the TXBMSK (TXBCON1 0x25<7>) bit = 1 to mask the beacon interrupt /* Set the TXBMSK (TXBCON1 0x25<7>) bit = 1 to mask the beacon
* mask * interrupt mask
*/ */
reg = mrf24j40_getreg(dev->spi, MRF24J40_TXBCON1); reg = mrf24j40_getreg(dev->spi, MRF24J40_TXBCON1);

View file

@ -57,11 +57,12 @@ int mrf24j40_txdelayed(FAR struct ieee802154_radio_s *radio,
int mrf24j40_rxenable(FAR struct ieee802154_radio_s *radio, bool enable); int mrf24j40_rxenable(FAR struct ieee802154_radio_s *radio, bool enable);
int mrf24j40_energydetect(FAR struct ieee802154_radio_s *radio, uint32_t nsymbols); int mrf24j40_energydetect(FAR struct ieee802154_radio_s *radio,
uint32_t nsymbols);
int mrf24j40_beaconstart(FAR struct ieee802154_radio_s *radio, int mrf24j40_beaconstart(FAR struct ieee802154_radio_s *radio,
FAR const struct ieee802154_superframespec_s *sfspec, FAR const struct ieee802154_superframespec_s *sfspec,
FAR struct ieee802154_beaconframe_s *beacon); FAR struct ieee802154_beaconframe_s *beacon);
int mrf24j40_beaconupdate(FAR struct ieee802154_radio_s *radio, int mrf24j40_beaconupdate(FAR struct ieee802154_radio_s *radio,
FAR struct ieee802154_beaconframe_s *beacon); FAR struct ieee802154_beaconframe_s *beacon);

View file

@ -170,6 +170,7 @@
/* RXMCR bits */ /* RXMCR bits */
#define MRF24J40_RXMCR_PROMI (1 << 0) /* Enable promisc mode (rx all valid packets) */ #define MRF24J40_RXMCR_PROMI (1 << 0) /* Enable promisc mode (rx all valid packets) */
#define MRF24J40_RXMCR_ERRPKT 0x02 /* Do not check CRC */ #define MRF24J40_RXMCR_ERRPKT 0x02 /* Do not check CRC */
#define MRF24J40_RXMCR_COORD 0x04 /* Enable coordinator mode ??? DIFFERENCE ??? - not used in datasheet! */ #define MRF24J40_RXMCR_COORD 0x04 /* Enable coordinator mode ??? DIFFERENCE ??? - not used in datasheet! */
#define MRF24J40_RXMCR_PANCOORD 0x08 /* Enable PAN coordinator mode ??? DIFFERENCE ??? */ #define MRF24J40_RXMCR_PANCOORD 0x08 /* Enable PAN coordinator mode ??? DIFFERENCE ??? */
@ -214,6 +215,7 @@
/* TXNCON bits */ /* TXNCON bits */
#define MRF24J40_TXNCON_TXNTRIG (1 << 0) /* Trigger packet tx, automatically cleared */ #define MRF24J40_TXNCON_TXNTRIG (1 << 0) /* Trigger packet tx, automatically cleared */
#define MRF24J40_TXNCON_TXNSECEN 0x02 /* Enable security */ #define MRF24J40_TXNCON_TXNSECEN 0x02 /* Enable security */
#define MRF24J40_TXNCON_TXNACKREQ 0x04 /* An ACK is requested for this pkt */ #define MRF24J40_TXNCON_TXNACKREQ 0x04 /* An ACK is requested for this pkt */
#define MRF24J40_TXNCON_INDIRECT 0x08 /* Activate indirect tx bit (for coordinators) */ #define MRF24J40_TXNCON_INDIRECT 0x08 /* Activate indirect tx bit (for coordinators) */

View file

@ -69,15 +69,16 @@ struct xbee_maccb_s
FAR struct xbee_maccb_s *flink; /* Implements a singly linked list */ FAR struct xbee_maccb_s *flink; /* Implements a singly linked list */
uint8_t prio; /* RX frame callback priority */ uint8_t prio; /* RX frame callback priority */
/* Callback for various MLME or MCPS service events. Return value represents /* Callback for various MLME or MCPS service events. Return value
* whether the callback accepts the primitive. >= 0 means the callback has * represents whether the callback accepts the primitive. >= 0 means the
* accepted the primitive and is responsible for calling * callback has accepted the primitive and is responsible for calling
* ieee802154_primitive_free(). In the case of DATA.indication primitive, only * ieee802154_primitive_free(). In the case of DATA.indication primitive,
* one callback can accept the frame. The callbacks are stored in order of * only one callback can accept the frame. The callbacks are stored in
* receiver priority defined by the 'prio' field above. All other * order of receiver priority defined by the 'prio' field above. All other
* notifications are offered to all callbacks and all can accept and free * notifications are offered to all callbacks and all can accept and free
* separately since the primitive will not be freed until the nclients count * separately since the primitive will not be freed until the nclients
* reaches 0. */ * count reaches 0.
*/
CODE int (*notify)(FAR struct xbee_maccb_s *maccb, CODE int (*notify)(FAR struct xbee_maccb_s *maccb,
FAR struct ieee802154_primitive_s *primitive); FAR struct ieee802154_primitive_s *primitive);
@ -95,7 +96,7 @@ struct xbee_maccb_s
* Public Function Prototypes * Public Function Prototypes
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: xbee_bind * Name: xbee_bind
* *
* Description: * Description:
@ -138,14 +139,15 @@ int xbee_ioctl(XBEEHANDLE xbee, int cmd, unsigned long arg);
* Name: xbee_get_mhrlen * Name: xbee_get_mhrlen
* *
* Description: * Description:
* Calculate the MAC header length given the frame meta-data. For the XBee, * Calculate the MAC header length given the frame meta-data. For the
* we use the header to store the entire API frame for the TX request. The * XBee, we use the header to store the entire API frame for the TX
* size we need is fixed based on the address mode we are using as it changes * request. The size we need is fixed based on the address mode we are
* which API frame we need to issue. * using as it changes which API frame we need to issue.
* *
****************************************************************************/ ****************************************************************************/
int xbee_get_mhrlen(XBEEHANDLE xbee, FAR const struct ieee802154_frame_meta_s *meta); int xbee_get_mhrlen(XBEEHANDLE xbee,
FAR const struct ieee802154_frame_meta_s *meta);
/**************************************************************************** /****************************************************************************
* Name: xbee_req_data * Name: xbee_req_data
@ -158,7 +160,8 @@ int xbee_get_mhrlen(XBEEHANDLE xbee, FAR const struct ieee802154_frame_meta_s *m
* *
****************************************************************************/ ****************************************************************************/
int xbee_req_data(XBEEHANDLE xbee, FAR const struct ieee802154_frame_meta_s *meta, int xbee_req_data(XBEEHANDLE xbee,
FAR const struct ieee802154_frame_meta_s *meta,
FAR struct iob_s *frame); FAR struct iob_s *frame);
/**************************************************************************** /****************************************************************************
@ -170,8 +173,8 @@ int xbee_req_data(XBEEHANDLE xbee, FAR const struct ieee802154_frame_meta_s *met
* *
* NOTE: The standard specifies that the attribute value should be returned * NOTE: The standard specifies that the attribute value should be returned
* via the asynchronous MLME-GET.confirm primitive. However, in our * via the asynchronous MLME-GET.confirm primitive. However, in our
* implementation, we synchronously return the value immediately.Therefore, we * implementation, we synchronously return the value immediately.Therefore,
* merge the functionality of the MLME-GET.request and MLME-GET.confirm * we merge the functionality of the MLME-GET.request and MLME-GET.confirm
* primitives together. * primitives together.
* *
****************************************************************************/ ****************************************************************************/
@ -186,11 +189,12 @@ int xbee_req_get(XBEEHANDLE xbee, enum ieee802154_attr_e attr,
* The MLME-SET.request primitive attempts to write the given value to the * The MLME-SET.request primitive attempts to write the given value to the
* indicated MAC PIB attribute. * indicated MAC PIB attribute.
* *
* NOTE: The standard specifies that confirmation should be indicated via * NOTE:
* the asynchronous MLME-SET.confirm primitive. However, in our implementation * The standard specifies that confirmation should be indicated via the
* we synchronously return the status from the request. Therefore, we do merge * asynchronous MLME-SET.confirm primitive. However, in our implementation
* the functionality of the MLME-SET.request and MLME-SET.confirm primitives * we synchronously return the status from the request. Therefore, we do
* together. * merge the functionality of the MLME-SET.request and MLME-SET.confirm
* primitives together.
* *
****************************************************************************/ ****************************************************************************/
@ -223,7 +227,8 @@ int xbee_req_start(XBEEHANDLE xbee, FAR struct ieee802154_start_req_s *req);
* *
****************************************************************************/ ****************************************************************************/
int xbee_req_associate(XBEEHANDLE xbee, FAR struct ieee802154_assoc_req_s *req); int xbee_req_associate(XBEEHANDLE xbee,
FAR struct ieee802154_assoc_req_s *req);
/**************************************************************************** /****************************************************************************
* Name: xbee_req_reset * Name: xbee_req_reset
@ -234,7 +239,8 @@ int xbee_req_associate(XBEEHANDLE xbee, FAR struct ieee802154_assoc_req_s *req);
* *
* Input Parameters: * Input Parameters:
* xbee - Handle to the XBee instance * xbee - Handle to the XBee instance
* resetattr - Whether or not to reset the MAC PIB attributes to defaults * resetattr - Whether or not to reset the MAC PIB attributes to
* defaults
* *
****************************************************************************/ ****************************************************************************/

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -102,7 +104,6 @@ enum spirit_vcoselect_e
enum spirit_vcowin_e enum spirit_vcowin_e
{ {
CALIB_TIME_7_33_US_24MHZ = 0x00, /* Calibration window of 7.33 us CALIB_TIME_7_33_US_24MHZ = 0x00, /* Calibration window of 7.33 us
* with XTAL=24MHz */ * with XTAL=24MHz */
CALIB_TIME_14_67_US_24MHZ, /* Calibration window of 14.67 us CALIB_TIME_14_67_US_24MHZ, /* Calibration window of 14.67 us
@ -365,6 +366,7 @@ int spirit_calib_select_vco(FAR struct spirit_library_s *spirit,
* *
******************************************************************************/ ******************************************************************************/
enum spirit_vcoselect_e spirit_calib_get_vco(FAR struct spirit_library_s *spirit); enum spirit_vcoselect_e spirit_calib_get_vco(
FAR struct spirit_library_s *spirit);
#endif /* __DRIVERS_WIRELESS_SPIRIT_INCLUDE_SPIRIT_CALIBRAITON_H */ #endif /* __DRIVERS_WIRELESS_SPIRIT_INCLUDE_SPIRIT_CALIBRAITON_H */

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -115,7 +117,9 @@ enum spirit_cmd_e
/* Autoretransmission: Reload the /* Autoretransmission: Reload the
* Packet sequence counter with the * Packet sequence counter with the
* value stored in the PROTOCOL[2] * value stored in the PROTOCOL[2]
* register valid from all states */ * register valid from all states
*/
CMD_AES_ENC = COMMAND_AES_ENC, /* Commands: Start the encryption CMD_AES_ENC = COMMAND_AES_ENC, /* Commands: Start the encryption
* routine; valid from all states; * routine; valid from all states;
* valid from all states */ * valid from all states */

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -38,7 +40,8 @@
#define __DRUVERS_WIRELESS_SPIRIT_INCLUDE_SPIRIT_CSMA_H #define __DRUVERS_WIRELESS_SPIRIT_INCLUDE_SPIRIT_CSMA_H
/* The Spirit CSMA feature, when configured and enabled, is transparent /* The Spirit CSMA feature, when configured and enabled, is transparent
* for the user. It means the user has only to call the spirit_csma_initialize() * for the user.
* It means the user has only to call the spirit_csma_initialize()
* function on a filled structure and then enable the CSMA policy using the * function on a filled structure and then enable the CSMA policy using the
* SpiritCsma() function. * SpiritCsma() function.
* *
@ -108,7 +111,7 @@ extern "C"
enum spirit_cca_period_e enum spirit_cca_period_e
{ {
TBIT_TIME_64 = CSMA_CCA_PERIOD_64TBIT, /* CSMA/CA: Sets CCA period TBIT_TIME_64 = CSMA_CCA_PERIOD_64TBIT, /* CSMA/CA: Sets CCA period
* to 64*TBIT */ * to 64*TBIT */
TBIT_TIME_128 = CSMA_CCA_PERIOD_128TBIT, /* CSMA/CA: Sets CCA period TBIT_TIME_128 = CSMA_CCA_PERIOD_128TBIT, /* CSMA/CA: Sets CCA period
* to 128*TBIT */ * to 128*TBIT */
@ -118,7 +121,9 @@ enum spirit_cca_period_e
* to 512*TBIT */ * to 512*TBIT */
}; };
/* Multiplier of Tcca time enumeration to obtain Tlisten (Tlisten = [1...15]*Tcca). */ /* Multiplier of Tcca time enumeration to obtain Tlisten
* (Tlisten = [1...15]*Tcca).
*/
enum spirit_csmalen_e enum spirit_csmalen_e
{ {
@ -280,7 +285,8 @@ enum spirit_functional_state_e
* *
* Description: * Description:
* Enables or Disables the seed reload mode (if enabled it reloads the back- * Enables or Disables the seed reload mode (if enabled it reloads the back-
* off generator seed using the value written in the BU_COUNTER_SEED register). * off generator seed using the value written in the BU_COUNTER_SEED
* register).
* *
* Input Parameters: * Input Parameters:
* spirit - Reference to a Spirit library state structure instance * spirit - Reference to a Spirit library state structure instance

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -87,7 +89,6 @@ enum spirit_directtx_e
* generated internally */ * generated internally */
}; };
/* Direct receive mode enumeration for SPIRIT. */ /* Direct receive mode enumeration for SPIRIT. */
enum spirit_directrx_e enum spirit_directrx_e

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -115,8 +117,8 @@ enum packet_type_e
enum spirit_version_e enum spirit_version_e
{ {
SPIRIT_VERSION_2_1 = 0x01, /* Deprecated */ SPIRIT_VERSION_2_1 = 0x01, /* Deprecated */
SPIRIT_VERSION_3_0, /* The only version of SPIRIT1 */ SPIRIT_VERSION_3_0, /* The only version of SPIRIT1 */
}; };
/****************************************************************************** /******************************************************************************

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -69,7 +71,6 @@
#include "spirit_regs.h" #include "spirit_regs.h"
#include "spirit_types.h" #include "spirit_types.h"
/****************************************************************************** /******************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
******************************************************************************/ ******************************************************************************/
@ -189,8 +190,10 @@ enum spirit_gpio_io_e
SPIRIT_GPIO_DIG_OUT_TX_STATE = 0x28, /* TX state indication: "1" SPIRIT_GPIO_DIG_OUT_TX_STATE = 0x28, /* TX state indication: "1"
* when Spirit1 is passing in * when Spirit1 is passing in
* the TX state */ * the TX state */
SPIRIT_GPIO_DIG_OUT_TX_FIFO_ALMOST_EMPTY = 0x30, /* TX FIFO Almost Empty Flag */ SPIRIT_GPIO_DIG_OUT_TX_FIFO_ALMOST_EMPTY = 0x30, /* TX FIFO Almost Empty Flag */
SPIRIT_GPIO_DIG_OUT_TX_FIFO_ALMOST_FULL = 0x38, /* TX FIFO Almost Full Flag */ SPIRIT_GPIO_DIG_OUT_TX_FIFO_ALMOST_FULL = 0x38, /* TX FIFO Almost Full Flag */
SPIRIT_GPIO_DIG_OUT_RX_DATA = 0x40, /* RX data output */ SPIRIT_GPIO_DIG_OUT_RX_DATA = 0x40, /* RX data output */
SPIRIT_GPIO_DIG_OUT_RX_CLOCK = 0x48, /* RX clock output SPIRIT_GPIO_DIG_OUT_RX_CLOCK = 0x48, /* RX clock output
* (recovered from received * (recovered from received
@ -198,8 +201,10 @@ enum spirit_gpio_io_e
SPIRIT_GPIO_DIG_OUT_RX_STATE = 0x50, /* RX state indication: "1" SPIRIT_GPIO_DIG_OUT_RX_STATE = 0x50, /* RX state indication: "1"
* when Spirit1 is passing in * when Spirit1 is passing in
* the RX state */ * the RX state */
SPIRIT_GPIO_DIG_OUT_RX_FIFO_ALMOST_FULL = 0x58, /* RX FIFO Almost Full Flag */ SPIRIT_GPIO_DIG_OUT_RX_FIFO_ALMOST_FULL = 0x58, /* RX FIFO Almost Full Flag */
SPIRIT_GPIO_DIG_OUT_RX_FIFO_ALMOST_EMPTY = 0x60, /* RX FIFO Almost Empty Flag */ SPIRIT_GPIO_DIG_OUT_RX_FIFO_ALMOST_EMPTY = 0x60, /* RX FIFO Almost Empty Flag */
SPIRIT_GPIO_DIG_OUT_ANTENNA_SWITCH = 0x68, /* Antenna switch used for SPIRIT_GPIO_DIG_OUT_ANTENNA_SWITCH = 0x68, /* Antenna switch used for
* antenna diversity */ * antenna diversity */
SPIRIT_GPIO_DIG_OUT_VALID_PREAMBLE = 0x70, /* Valid Preamble Detected Flag */ SPIRIT_GPIO_DIG_OUT_VALID_PREAMBLE = 0x70, /* Valid Preamble Detected Flag */
@ -271,7 +276,7 @@ enum spirit_clockoutput_xoprescaler_e
XO_RATIO_1_3 = 0x06, /* XO Clock signal available on the GPIO divided by 1/3 */ XO_RATIO_1_3 = 0x06, /* XO Clock signal available on the GPIO divided by 1/3 */
XO_RATIO_1_4 = 0x08, /* XO Clock signal available on the GPIO divided by 1/4 */ XO_RATIO_1_4 = 0x08, /* XO Clock signal available on the GPIO divided by 1/4 */
XO_RATIO_1_6 = 0x0a, /* XO Clock signal available on the GPIO divided by 1/6 */ XO_RATIO_1_6 = 0x0a, /* XO Clock signal available on the GPIO divided by 1/6 */
XO_RATIO_1_8 = 0x0C, /* XO Clock signal available on the GPIO divided by 1/8 */ XO_RATIO_1_8 = 0x0c, /* XO Clock signal available on the GPIO divided by 1/8 */
XO_RATIO_1_12 = 0x0e, /* XO Clock signal available on the GPIO divided by 1/12 */ XO_RATIO_1_12 = 0x0e, /* XO Clock signal available on the GPIO divided by 1/12 */
XO_RATIO_1_16 = 0x10, /* XO Clock signal available on the GPIO divided by 1/16 */ XO_RATIO_1_16 = 0x10, /* XO Clock signal available on the GPIO divided by 1/16 */
XO_RATIO_1_24 = 0x12, /* XO Clock signal available on the GPIO divided by 1/24 */ XO_RATIO_1_24 = 0x12, /* XO Clock signal available on the GPIO divided by 1/24 */
@ -347,7 +352,6 @@ struct spirit_clockoutput_init_s
int spirit_gpio_initialize(FAR struct spirit_library_s *spirit, int spirit_gpio_initialize(FAR struct spirit_library_s *spirit,
FAR const struct spirit_gpio_init_s *gpioinit); FAR const struct spirit_gpio_init_s *gpioinit);
/****************************************************************************** /******************************************************************************
* Name: spirit_gpio_enable_tempsensor * Name: spirit_gpio_enable_tempsensor
* *
@ -446,7 +450,8 @@ int spirit_gpio_enable_clockoutput(FAR struct spirit_library_s *spirit,
* Initializes the SPIRIT Clock Output according to the specified parameters * Initializes the SPIRIT Clock Output according to the specified parameters
* in the xClockOutputInitStruct. * in the xClockOutputInitStruct.
* *
* NOTE: The function spirit_gpio_enable_clockoutput() must be called in order to * NOTE:
* The function spirit_gpio_enable_clockoutput() must be called in order to
* enable or disable the MCU clock dividers. * enable or disable the MCU clock dividers.
* *
* Input Parameters: * Input Parameters:
@ -461,7 +466,7 @@ int spirit_gpio_enable_clockoutput(FAR struct spirit_library_s *spirit,
******************************************************************************/ ******************************************************************************/
int spirit_gpio_clockoutput_initialize(FAR struct spirit_library_s *spirit, int spirit_gpio_clockoutput_initialize(FAR struct spirit_library_s *spirit,
FAR const struct spirit_clockoutput_init_s *clockoutput); FAR const struct spirit_clockoutput_init_s *clockoutput);
/****************************************************************************** /******************************************************************************
* Name: spirit_gpio_set_xoprescaler * Name: spirit_gpio_set_xoprescaler
@ -481,7 +486,7 @@ int spirit_gpio_clockoutput_initialize(FAR struct spirit_library_s *spirit,
******************************************************************************/ ******************************************************************************/
int spirit_gpio_set_xoprescaler(FAR struct spirit_library_s *spirit, int spirit_gpio_set_xoprescaler(FAR struct spirit_library_s *spirit,
enum spirit_clockoutput_xoprescaler_e xoprescaler); enum spirit_clockoutput_xoprescaler_e xoprescaler);
/****************************************************************************** /******************************************************************************
* Name: spirit_gpio_get_xoprescaler * Name: spirit_gpio_get_xoprescaler
@ -518,7 +523,7 @@ enum spirit_clockoutput_xoprescaler_e
******************************************************************************/ ******************************************************************************/
int spirit_gpio_set_rcoprescaler(FAR struct spirit_library_s *spirit, int spirit_gpio_set_rcoprescaler(FAR struct spirit_library_s *spirit,
enum spirit_clockoutput_rcoprescaler_e rcoprescaler); enum spirit_clockoutput_rcoprescaler_e rcoprescaler);
/****************************************************************************** /******************************************************************************
* Name: spirit_gpio_get_rcoprescaler * Name: spirit_gpio_get_rcoprescaler

View file

@ -9,43 +9,47 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
#ifndef __DRIVERS_WIRELESS_SPIRIT_INCLUDE_SPIRIT_IRQ_H #ifndef __DRIVERS_WIRELESS_SPIRIT_INCLUDE_SPIRIT_IRQ_H
#define __DRIVERS_WIRELESS_SPIRIT_INCLUDE_SPIRIT_IRQ_H #define __DRIVERS_WIRELESS_SPIRIT_INCLUDE_SPIRIT_IRQ_H
/* On the Spirit side specific IRQs can be enabled by setting a specific bitmask. /* On the Spirit side specific IRQs can be enabled by setting a specific
* bitmask.
* The Spirit libraries allow the user to do this in two different ways: * The Spirit libraries allow the user to do this in two different ways:
* *
* The first enables the IRQs one by one, i.e. using an SPI transaction for each * The first enables the IRQs one by one, i.e. using an SPI transaction for
* IRQ to enable. * each IRQ to enable.
* *
* Example: * Example:
* *
* spirit_irq_disableall(spirit); # this call is used to reset the IRQ mask registers * spirit_irq_disableall(spirit); # this call is used to reset the IRQ mask
* registers
* spirit_irq_enable(spirit, RX_DATA_READY , S_ENABLE); * spirit_irq_enable(spirit, RX_DATA_READY , S_ENABLE);
* spirit_irq_enable(spirit, VALID_SYNC , S_ENABLE); * spirit_irq_enable(spirit, VALID_SYNC , S_ENABLE);
* spirit_irq_enable(spirit, RX_TIMEOUT , S_ENABLE); * spirit_irq_enable(spirit, RX_TIMEOUT , S_ENABLE);

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived
* without specific prior written permission. * from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -63,7 +65,8 @@
* *
******************************************************************************/ ******************************************************************************/
uint8_t spirit_managment_wavco_calibration(FAR struct spirit_library_s *spirit); uint8_t spirit_managment_wavco_calibration(
FAR struct spirit_library_s *spirit);
/****************************************************************************** /******************************************************************************
* Name: spirit_management_txstrobe * Name: spirit_management_txstrobe

View file

@ -9,41 +9,44 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
#ifndef __DRIVERS_WIRELESS_SPIRIT_INCLUDE_SPIRIT_PKTBASIC_H #ifndef __DRIVERS_WIRELESS_SPIRIT_INCLUDE_SPIRIT_PKTBASIC_H
#define __DRIVERS_WIRELESS_SPIRIT_INCLUDE_SPIRIT_PKTBASIC_H #define __DRIVERS_WIRELESS_SPIRIT_INCLUDE_SPIRIT_PKTBASIC_H
/* This module can be used to manage the configuration of Spirit Basic packets. /* This module can be used to manage the configuration of Spirit Basic
* packets.
* The user can obtain a packet configuration filling the structure struct * The user can obtain a packet configuration filling the structure struct
* spirit_pktbasic_init_s, defining in it some general parameters for the Spirit Basic * spirit_pktbasic_init_s, defining in it some general parameters for the
* packet format. Another structure the user can fill is struct spirit_pktbasic_addr_s * Spirit Basic packet format. Another structure the user can fill is struct
* to define the addresses which will be used during the communication. In * spirit_pktbasic_addr_s to define the addresses which will be used during
* addition, functions to set the payload length and the destination address * the communication. In addition, functions to set the payload length and
* are provided. * the destination address are provided.
* *
* Example: * Example:
* *
@ -53,7 +56,8 @@
* PKT_SYNC_LENGTH_4BYTES, # sync word length in bytes * PKT_SYNC_LENGTH_4BYTES, # sync word length in bytes
* 0x1A2635A8, # sync word * 0x1A2635A8, # sync word
* PKT_LENGTH_VAR, # variable or fixed payload length * PKT_LENGTH_VAR, # variable or fixed payload length
* 7, # length field width in bits (used only for variable length) * 7, # length field width in bits
* (used only for variable length)
* PKT_NO_CRC, # CRC mode * PKT_NO_CRC, # CRC mode
* PKT_CONTROL_LENGTH_0BYTES, # control field length * PKT_CONTROL_LENGTH_0BYTES, # control field length
* S_ENABLE, # address field * S_ENABLE, # address field
@ -63,12 +67,12 @@
* *
* struct spirit_pktbasic_addr_s g_pktbasic_addrinit = * struct spirit_pktbasic_addr_s g_pktbasic_addrinit =
* { * {
* S_ENABLE, # enable/disable filtering on my address * S_ENABLE, # enable/disable filtering on my address
* 0x34, # my address (address of the current node) * 0x34, # my address (address of the current node)
* S_DISABLE, # enable/disable filtering on multicast address * S_DISABLE, # enable/disable filtering on multicast address
* 0xee, # multicast address * 0xee, # multicast address
* S_DISABLE, # enable/disable filtering on broadcast address * S_DISABLE, # enable/disable filtering on broadcast address
* 0xff # broadcast address * 0xff # broadcast address
* }; * };
* *
* ... * ...
@ -194,7 +198,7 @@ struct spirit_pktbasic_addr_s
******************************************************************************/ ******************************************************************************/
int spirit_pktbasic_initialize(FAR struct spirit_library_s *spirit, int spirit_pktbasic_initialize(FAR struct spirit_library_s *spirit,
FAR const struct spirit_pktbasic_init_s *pktbasic); FAR const struct spirit_pktbasic_init_s *pktbasic);
/****************************************************************************** /******************************************************************************
* Name: spirit_pktbasic_get_setup * Name: spirit_pktbasic_get_setup
@ -232,7 +236,7 @@ int spirit_pktbasic_get_setup(FAR struct spirit_library_s *spirit,
******************************************************************************/ ******************************************************************************/
int spirit_pktbasic_addr_initialize(FAR struct spirit_library_s *spirit, int spirit_pktbasic_addr_initialize(FAR struct spirit_library_s *spirit,
FAR struct spirit_pktbasic_addr_s *basicaddr); FAR struct spirit_pktbasic_addr_s *basicaddr);
/****************************************************************************** /******************************************************************************
* Name: spirit_pktbasic_get_addrsetup * Name: spirit_pktbasic_get_addrsetup
@ -251,7 +255,7 @@ int spirit_pktbasic_addr_initialize(FAR struct spirit_library_s *spirit,
******************************************************************************/ ******************************************************************************/
int spirit_pktbasic_get_addrsetup(FAR struct spirit_library_s *spirit, int spirit_pktbasic_get_addrsetup(FAR struct spirit_library_s *spirit,
FAR struct spirit_pktbasic_addr_s *basicaddr); FAR struct spirit_pktbasic_addr_s *basicaddr);
/****************************************************************************** /******************************************************************************
* Name: spirit_pktbasic_set_format * Name: spirit_pktbasic_set_format

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -530,7 +532,7 @@ uint8_t spirit_pktcommon_get_syncword(FAR struct spirit_library_s *spirit,
******************************************************************************/ ******************************************************************************/
int spirit_pktcommon_set_syncwords(FAR struct spirit_library_s *spirit, int spirit_pktcommon_set_syncwords(FAR struct spirit_library_s *spirit,
uint32_t syncwords, enum pkt_synlen_e synclen); uint32_t syncwords, enum pkt_synlen_e synclen);
/****************************************************************************** /******************************************************************************
* Name: spirit_pktcommon_get_syncwords * Name: spirit_pktcommon_get_syncwords
@ -545,7 +547,8 @@ int spirit_pktcommon_set_syncwords(FAR struct spirit_library_s *spirit,
* synclen has been stored. * synclen has been stored.
* *
* Returned Value: * Returned Value:
* Sync words. The format of the read 32 bit word is 0x|SYNC1|SYNC2|SYNC3|SYNC4|. * Sync words.
* The format of the read 32 bit word is 0x|SYNC1|SYNC2|SYNC3|SYNC4|.
* *
******************************************************************************/ ******************************************************************************/
@ -833,8 +836,9 @@ uint32_t spirit_pktcommon_get_txctrl(FAR struct spirit_library_s *spirit);
* *
******************************************************************************/ ******************************************************************************/
int spirit_pktcommon_enable_destaddr_filter(FAR struct spirit_library_s *spirit, int spirit_pktcommon_enable_destaddr_filter(
enum spirit_functional_state_e newstate); FAR struct spirit_library_s *spirit,
enum spirit_functional_state_e newstate);
/****************************************************************************** /******************************************************************************
* Name: spirit_pktcommon_enable_mcastaddr_filter * Name: spirit_pktcommon_enable_mcastaddr_filter
@ -852,8 +856,9 @@ int spirit_pktcommon_enable_destaddr_filter(FAR struct spirit_library_s *spirit,
* *
******************************************************************************/ ******************************************************************************/
int spirit_pktcommon_enable_mcastaddr_filter(FAR struct spirit_library_s *spirit, int spirit_pktcommon_enable_mcastaddr_filter(
enum spirit_functional_state_e newstate); FAR struct spirit_library_s *spirit,
enum spirit_functional_state_e newstate);
/****************************************************************************** /******************************************************************************
* Name: spirit_pktcommon_enable_bcastaddr_filter * Name: spirit_pktcommon_enable_bcastaddr_filter
@ -871,8 +876,9 @@ int spirit_pktcommon_enable_mcastaddr_filter(FAR struct spirit_library_s *spirit
* *
******************************************************************************/ ******************************************************************************/
int spirit_pktcommon_enable_bcastaddr_filter(FAR struct spirit_library_s *spirit, int spirit_pktcommon_enable_bcastaddr_filter(
enum spirit_functional_state_e newstate); FAR struct spirit_library_s *spirit,
enum spirit_functional_state_e newstate);
/****************************************************************************** /******************************************************************************
* Name: spirit_pktcommon_isenabled_destaddr_filter * Name: spirit_pktcommon_isenabled_destaddr_filter
@ -888,8 +894,8 @@ int spirit_pktcommon_enable_bcastaddr_filter(FAR struct spirit_library_s *spirit
* *
******************************************************************************/ ******************************************************************************/
enum spirit_functional_state_e enum spirit_functional_state_e spirit_pktcommon_isenabled_destaddr_filter(
spirit_pktcommon_isenabled_destaddr_filter(FAR struct spirit_library_s *spirit); FAR struct spirit_library_s *spirit);
/****************************************************************************** /******************************************************************************
* Name: spirit_pktcommon_isenabled_mcastaddr_filter * Name: spirit_pktcommon_isenabled_mcastaddr_filter
@ -905,8 +911,8 @@ enum spirit_functional_state_e
* *
******************************************************************************/ ******************************************************************************/
enum spirit_functional_state_e enum spirit_functional_state_e spirit_pktcommon_isenabled_mcastaddr_filter(
spirit_pktcommon_isenabled_mcastaddr_filter(FAR struct spirit_library_s *spirit); FAR struct spirit_library_s *spirit);
/****************************************************************************** /******************************************************************************
* Name: spirit_pktcommon_isenabled_bcastaddr_filter * Name: spirit_pktcommon_isenabled_bcastaddr_filter
@ -922,8 +928,8 @@ enum spirit_functional_state_e
* *
******************************************************************************/ ******************************************************************************/
enum spirit_functional_state_e enum spirit_functional_state_e spirit_pktcommon_isenabled_bcastaddr_filter(
spirit_pktcommon_isenabled_bcastaddr_filter(FAR struct spirit_library_s *spirit); FAR struct spirit_library_s *spirit);
/****************************************************************************** /******************************************************************************
* Name: spirit_pktcommon_get_rxdestaddr * Name: spirit_pktcommon_get_rxdestaddr
@ -998,8 +1004,8 @@ int spirit_pktcommon_get_rxcrc(FAR struct spirit_library_s *spirit,
******************************************************************************/ ******************************************************************************/
int spirit_pktcommon_enable_rxautoack(FAR struct spirit_library_s *spirit, int spirit_pktcommon_enable_rxautoack(FAR struct spirit_library_s *spirit,
enum spirit_functional_state_e autoack, enum spirit_functional_state_e autoack,
enum spirit_functional_state_e piggyback); enum spirit_functional_state_e piggyback);
/****************************************************************************** /******************************************************************************
* Name: spirit_pktcommon_enable_txautoack * Name: spirit_pktcommon_enable_txautoack
@ -1195,7 +1201,7 @@ uint8_t spirit_pktcommon_get_nretx(FAR struct spirit_library_s *spirit);
******************************************************************************/ ******************************************************************************/
int spirit_pktcommon_enable_ctrl_filter(FAR struct spirit_library_s *spirit, int spirit_pktcommon_enable_ctrl_filter(FAR struct spirit_library_s *spirit,
enum spirit_functional_state_e newstate); enum spirit_functional_state_e newstate);
/****************************************************************************** /******************************************************************************
* Name: spirit_pktcommon_isenabled_ctrl_filter * Name: spirit_pktcommon_isenabled_ctrl_filter

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -39,9 +41,9 @@
/* This module can be used to manage the configuration of Spirit MBUS packets. /* This module can be used to manage the configuration of Spirit MBUS packets.
* The user can obtain a packet configuration filling the structure * The user can obtain a packet configuration filling the structure
* struct spirit_pktmbus_init_s, defining in it some general parameters for the Spirit MBUS * struct spirit_pktmbus_init_s, defining in it some general parameters for the
* packet format. Since the MBUS protocol is a standard, the configuration * Spirit MBUS packet format. Since the MBUS protocol is a standard, the
* of a MBUS* packet is very simple to do. * configuration of a MBUS* packet is very simple to do.
* *
* Example: * Example:
* *
@ -111,7 +113,8 @@ enum spirit_mbus_submode_e
* Sync word = 0x7696 (length 18 bits) * Sync word = 0x7696 (length 18 bits)
*/ */
MBUS_SUBMODE_S1_M_S2_T2_OTHER_TO_METER = MBUS_CTRL_MBUS_SUBMODE_S2_S1M_T2_OTHER, MBUS_SUBMODE_S1_M_S2_T2_OTHER_TO_METER =
MBUS_CTRL_MBUS_SUBMODE_S2_S1M_T2_OTHER,
/* MBUS submode T1, T2 (meter to other): /* MBUS submode T1, T2 (meter to other):
* Header length = mbus_prmbl_ctrl + 19 (in "01" bit pairs): * Header length = mbus_prmbl_ctrl + 19 (in "01" bit pairs):
@ -166,7 +169,7 @@ struct spirit_pktmbus_init_s
******************************************************************************/ ******************************************************************************/
int spirit_pktmbus_initialize(FAR struct spirit_library_s *spirit, int spirit_pktmbus_initialize(FAR struct spirit_library_s *spirit,
FAR const struct spirit_pktmbus_init_s *mbusinit); FAR const struct spirit_pktmbus_init_s *mbusinit);
/****************************************************************************** /******************************************************************************
* Name: spirit_pktmbus_get_setup * Name: spirit_pktmbus_get_setup
@ -207,7 +210,7 @@ int spirit_pktmbus_set_format(FAR struct spirit_library_s *spirit);
* Name: spirit_pktmbus_set_preamble * Name: spirit_pktmbus_set_preamble
* *
* Description: * Description:
* Sets how many chip sequence 01 shall be added in the preamble respect * Sets how many chip sequence "02" shall be added in the preamble respect
* to the minimum value as defined according to the specified sub-mode. * to the minimum value as defined according to the specified sub-mode.
* *
* Input Parameters: * Input Parameters:

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -62,7 +64,8 @@
* PKT_PREAMBLE_LENGTH_08BYTES, # preamble length in bytes * PKT_PREAMBLE_LENGTH_08BYTES, # preamble length in bytes
* PKT_SYNC_LENGTH_4BYTES, # sync word length in bytes * PKT_SYNC_LENGTH_4BYTES, # sync word length in bytes
* PKT_LENGTH_VAR, # variable or fixed payload length * PKT_LENGTH_VAR, # variable or fixed payload length
* 7, # length field width in bits (used only for variable length) * 7, # length field width in bits
* (used only for variable length)
* PKT_NO_CRC, # CRC mode * PKT_NO_CRC, # CRC mode
* PKT_CONTROL_LENGTH_0BYTES, # control field length * PKT_CONTROL_LENGTH_0BYTES, # control field length
* S_DISABLE, # FEC * S_DISABLE, # FEC
@ -71,19 +74,19 @@
* *
* struct spirit_pktstack_address_s g_pktstack_addrinit = * struct spirit_pktstack_address_s g_pktstack_addrinit =
* { * {
* S_ENABLE, # enable/disable filtering on my address * S_ENABLE, # enable/disable filtering on my address
* 0x34, # my address (address of the current node) * 0x34, # my address (address of the current node)
* S_DISABLE, # enable/disable filtering on multicast address * S_DISABLE, # enable/disable filtering on multicast address
* 0xee, # multicast address * 0xee, # multicast address
* S_DISABLE, # enable/disable filtering on broadcast address * S_DISABLE, # enable/disable filtering on broadcast address
* 0xff # broadcast address * 0xff # broadcast address
* }; * };
* *
* struct spirit_pktstack_llp_s g_pktstack_llpinit = * struct spirit_pktstack_llp_s g_pktstack_llpinit =
* { * {
* S_DISABLE, # enable/disable the autoack feature * S_DISABLE, # enable/disable the autoack feature
* S_DISABLE, # enable/disable the piggybacking feature * S_DISABLE, # enable/disable the piggybacking feature
* PKT_DISABLE_RETX # set the max number of retransmissions or disable them * PKT_DISABLE_RETX # set the max number of retransmissions or disable them
* }; * };
* ... * ...
* *
@ -152,8 +155,8 @@ struct spirit_pktstack_init_s
}; };
/* SPIRIT STack packet address structure definition. This structure allows /* SPIRIT STack packet address structure definition. This structure allows
* users to specify the node/multicast/broadcast addresses and the correspondent * users to specify the node/multicast/broadcast addresses and the
* filtering options. * correspondent filtering options.
*/ */
struct spirit_pktstack_address_s struct spirit_pktstack_address_s
@ -211,7 +214,7 @@ struct spirit_pktstack_llp_s
******************************************************************************/ ******************************************************************************/
int spirit_pktstack_initialize(FAR struct spirit_library_s *spirit, int spirit_pktstack_initialize(FAR struct spirit_library_s *spirit,
FAR const struct spirit_pktstack_init_s *pktstack); FAR const struct spirit_pktstack_init_s *pktstack);
/****************************************************************************** /******************************************************************************
* Name: spirit_pktstack_get_setup * Name: spirit_pktstack_get_setup
@ -248,7 +251,7 @@ int spirit_pktstack_get_setup(FAR struct spirit_library_s *spirit,
******************************************************************************/ ******************************************************************************/
int spirit_pktstack_address_initialize(FAR struct spirit_library_s *spirit, int spirit_pktstack_address_initialize(FAR struct spirit_library_s *spirit,
FAR const struct spirit_pktstack_address_s *addrinit); FAR const struct spirit_pktstack_address_s *addrinit);
/****************************************************************************** /******************************************************************************
* Name: spirit_pktstack_get_addrsetup * Name: spirit_pktstack_get_addrsetup
@ -267,7 +270,7 @@ int spirit_pktstack_address_initialize(FAR struct spirit_library_s *spirit,
******************************************************************************/ ******************************************************************************/
int spirit_pktstack_get_addrsetup(FAR struct spirit_library_s *spirit, int spirit_pktstack_get_addrsetup(FAR struct spirit_library_s *spirit,
FAR struct spirit_pktstack_address_s *addrinit); FAR struct spirit_pktstack_address_s *addrinit);
/****************************************************************************** /******************************************************************************
* Name: spirit_pktstack_llp_initialize * Name: spirit_pktstack_llp_initialize
@ -286,7 +289,7 @@ int spirit_pktstack_get_addrsetup(FAR struct spirit_library_s *spirit,
******************************************************************************/ ******************************************************************************/
int spirit_pktstack_llp_initialize(FAR struct spirit_library_s *spirit, int spirit_pktstack_llp_initialize(FAR struct spirit_library_s *spirit,
FAR const struct spirit_pktstack_llp_s *llpinit); FAR const struct spirit_pktstack_llp_s *llpinit);
/****************************************************************************** /******************************************************************************
* Name: spirit_pktstack_get_llpsetup * Name: spirit_pktstack_get_llpsetup
@ -433,7 +436,8 @@ int spirit_pkstack_set_rxsource_addrmask(FAR struct spirit_library_s *spirit,
* *
******************************************************************************/ ******************************************************************************/
uint8_t spirit_pktstack_get_rxsource_addrmask(FAR struct spirit_library_s *spirit); uint8_t
spirit_pktstack_get_rxsource_addrmask(FAR struct spirit_library_s *spirit);
/****************************************************************************** /******************************************************************************
* Name: spirit_pktstack_get_rxpktlen * Name: spirit_pktstack_get_rxpktlen
@ -474,8 +478,9 @@ uint16_t spirit_pktstack_get_rxpktlen(FAR struct spirit_library_s *spirit);
* *
******************************************************************************/ ******************************************************************************/
int spirit_pkstack_enable_rxsource_addrfilter(FAR struct spirit_library_s *spirit, int spirit_pkstack_enable_rxsource_addrfilter(
enum spirit_functional_state_e newstate); FAR struct spirit_library_s *spirit,
enum spirit_functional_state_e newstate);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -223,7 +225,6 @@ int spirit_qi_enable_pqicheck(FAR struct spirit_library_s *spirit,
int spirit_qi_enable_sqicheck(FAR struct spirit_library_s *spirit, int spirit_qi_enable_sqicheck(FAR struct spirit_library_s *spirit,
enum spirit_functional_state_e newstate); enum spirit_functional_state_e newstate);
/****************************************************************************** /******************************************************************************
* Name: spirit_qi_set_pqithreshold * Name: spirit_qi_set_pqithreshold
* *
@ -363,7 +364,8 @@ uint8_t spirit_qi_get_lqi(FAR struct spirit_library_s *spirit);
* *
******************************************************************************/ ******************************************************************************/
enum spirit_flag_status_e spirit_qi_get_cs(FAR struct spirit_library_s *spirit); enum
spirit_flag_status_e spirit_qi_get_cs(FAR struct spirit_library_s *spirit);
/****************************************************************************** /******************************************************************************
* Name: spirit_qi_get_rssi * Name: spirit_qi_get_rssi

View file

@ -10,28 +10,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -403,7 +405,8 @@ int spirit_radio_initialize(FAR struct spirit_library_s *spirit,
* Input Parameters: * Input Parameters:
* spirit - Reference to a Spirit library state structure instance * spirit - Reference to a Spirit library state structure instance
* radioinit pointer to a struct radio_init_s that * radioinit pointer to a struct radio_init_s that
* contains the configuration information for the analog radio part of SPIRIT. * contains the configuration information for the analog radio part
* of SPIRIT.
* *
* Returned Value: * Returned Value:
* Zero (OK) returned on success; a negated errno value is returned on any * Zero (OK) returned on success; a negated errno value is returned on any
@ -448,7 +451,8 @@ int spirit_radio_set_xtalflag(FAR struct spirit_library_s *spirit,
* *
******************************************************************************/ ******************************************************************************/
enum xtal_flag_e spirit_radio_get_xtalflag(FAR struct spirit_library_s *spirit); enum
xtal_flag_e spirit_radio_get_xtalflag(FAR struct spirit_library_s *spirit);
/****************************************************************************** /******************************************************************************
* Name: spirit_radio_search_wcp * Name: spirit_radio_search_wcp
@ -650,7 +654,8 @@ int spirit_radio_set_channel(FAR struct spirit_library_s *spirit,
* Name: spirit_radio_set_foffset_hz * Name: spirit_radio_set_foffset_hz
* *
* Description: * Description:
* Sets the FC OFFSET register starting from frequency offset expressed in Hz. * Sets the FC OFFSET register starting from frequency offset expressed in
* Hz.
* *
* Input Parameters: * Input Parameters:
* spirit - Reference to a Spirit library state structure instance * spirit - Reference to a Spirit library state structure instance
@ -718,8 +723,9 @@ int spirit_radio_set_basefrequency(FAR struct spirit_library_s *spirit,
* *
******************************************************************************/ ******************************************************************************/
void spirit_radio_enable_wavco_calibration(FAR struct spirit_library_s *spirit, void
enum spirit_functional_state_e newstate); spirit_radio_enable_wavco_calibration(FAR struct spirit_library_s *spirit,
enum spirit_functional_state_e newstate);
/****************************************************************************** /******************************************************************************
* Name: spirit_radio_get_basefrequency * Name: spirit_radio_get_basefrequency
@ -762,7 +768,8 @@ uint32_t spirit_radio_get_centerfreq(FAR struct spirit_library_s *spirit);
* *
* Input Parameters: * Input Parameters:
* spirit - Reference to a Spirit library state structure instance * spirit - Reference to a Spirit library state structure instance
* datarate - datarate expressed in bps. This parameter ranging between 100 and 500000. * datarate - datarate expressed in bps. This parameter ranging between
* 100 and 500000.
* pcm - pointer to the returned mantissa value. * pcm - pointer to the returned mantissa value.
* pce - pointer to the returned exponent value. * pce - pointer to the returned exponent value.
* *
@ -837,8 +844,8 @@ int spirit_radio_convert_freqdev(FAR struct spirit_library_s *spirit,
* [100 500000]. * [100 500000].
* *
* Returned Value: * Returned Value:
* Zero (OK) is returned on success; a negated errnor value is returned on any * Zero (OK) is returned on success; a negated errnor value is returned on
* failure. * any failure.
* *
******************************************************************************/ ******************************************************************************/
@ -873,8 +880,8 @@ uint32_t spirit_radio_get_datarate(FAR struct spirit_library_s *spirit);
* is in the correct range [F_Xo*8/2^18, F_Xo*7680/2^18] Hz. * is in the correct range [F_Xo*8/2^18, F_Xo*7680/2^18] Hz.
* *
* Returned Value: * Returned Value:
* Zero (OK) is returned on success; a negated errnor value is returned on any * Zero (OK) is returned on success; a negated errnor value is returned on
* failure. * any failure.
* *
******************************************************************************/ ******************************************************************************/
@ -914,8 +921,8 @@ uint32_t spirit_radio_get_freqdev(FAR struct spirit_library_s *spirit);
* spirit_radio_get_chfilterbw() API. * spirit_radio_get_chfilterbw() API.
* *
* Returned Value: * Returned Value:
* Zero (OK) is returned on success; a negated errnor value is returned on any * Zero (OK) is returned on success; a negated errnor value is returned on
* failure. * any failure.
* *
******************************************************************************/ ******************************************************************************/
@ -949,8 +956,8 @@ uint32_t spirit_radio_get_chfilterbw(FAR struct spirit_library_s *spirit);
* modulation - Modulation to set. * modulation - Modulation to set.
* *
* Returned Value: * Returned Value:
* Zero (OK) is returned on success; a negated errnor value is returned on any * Zero (OK) is returned on success; a negated errnor value is returned on
* failure. * any failure.
* *
******************************************************************************/ ******************************************************************************/
@ -986,8 +993,8 @@ enum modulation_select_e
* or S_DISABLE . * or S_DISABLE .
* *
* Returned Value: * Returned Value:
* Zero (OK) is returned on success; a negated errnor value is returned on any * Zero (OK) is returned on success; a negated errnor value is returned on
* failure. * any failure.
* *
******************************************************************************/ ******************************************************************************/
@ -1005,8 +1012,8 @@ int spirit_radio_enable_cwtxmode(FAR struct spirit_library_s *spirit,
* ookdelay - Peak decay control for OOK. * ookdelay - Peak decay control for OOK.
* *
* Returned Value: * Returned Value:
* Zero (OK) is returned on success; a negated errnor value is returned on any * Zero (OK) is returned on success; a negated errnor value is returned on
* failure. * any failure.
* *
******************************************************************************/ ******************************************************************************/
@ -1114,16 +1121,18 @@ int spirit_radio_config_patable_dbm(FAR struct spirit_library_s *spirit,
* Name: spirit_radio_get_patable_dbm * Name: spirit_radio_get_patable_dbm
* *
* Description: * Description:
* Returns the Power Amplifier Table and registers, returning values in dBm. * Returns the Power Amplifier Table and registers, returning values in
* dBm.
* *
* Input Parameters: * Input Parameters:
* spirit - Reference to a Spirit library state structure instance * spirit - Reference to a Spirit library state structure instance
* nlevels - Pointer to the number of levels settled. This parameter must * nlevels - Pointer to the number of levels settled. This parameter must
* be in the range [0:7]. * be in the range [0:7].
* table - Pointer to an array of 8 elements containing the PA value in dbm. * table - Pointer to an array of 8 elements containing the PA value in
* dbm.
* The first element will be the PA_LEVEL_0 and the last element * The first element will be the PA_LEVEL_0 and the last element
* will be PA_LEVEL_7. Any value higher than PA_UPPER_LIMIT implies * will be PA_LEVEL_7. Any value higher than PA_UPPER_LIMIT
( no output power (output stage is in high impedance). * implies no output power (output stage is in high impedance).
* *
* Returned Value: * Returned Value:
* Zero (OK) on success. A negated errno value is returned on any failure. * Zero (OK) on success. A negated errno value is returned on any failure.
@ -1139,7 +1148,8 @@ int spirit_radio_get_patable_dbm(FAR struct spirit_library_s *spirit,
* Description: * Description:
* Sets a specific PA_LEVEL register, with a value given in dBm. * Sets a specific PA_LEVEL register, with a value given in dBm.
* *
* NOTE: This function makes use of the spirit_radio_convert_power2reg function * NOTE:
* This function makes use of the spirit_radio_convert_power2reg function
* to interpolate the power value. * to interpolate the power value.
* *
* Input Parameters: * Input Parameters:
@ -1162,7 +1172,8 @@ int spirit_radio_set_palevel_dbm(FAR struct spirit_library_s *spirit,
* Description: * Description:
* Returns a specific PA_LEVEL register, returning a value in dBm. * Returns a specific PA_LEVEL register, returning a value in dBm.
* *
* NOTE: This function makes use of the @ref spirit_radio_convert_reg2power fcn to * NOTE:
* This function makes use of the @ref spirit_radio_convert_reg2power fcn to
* interpolate the power value. * interpolate the power value.
* *
* Input Parameters: * Input Parameters:
@ -1284,7 +1295,8 @@ uint8_t spirit_radio_get_palevel(FAR struct spirit_library_s *spirit,
* *
* Input Parameters: * Input Parameters:
* spirit - Reference to a Spirit library state structure instance * spirit - Reference to a Spirit library state structure instance
* load one of the possible value of the enum type enum spirit_paload_capacitor_e. * load one of the possible value of the enum type
* enum spirit_paload_capacitor_e.
* LOAD_0_PF No additional PA load capacitor * LOAD_0_PF No additional PA load capacitor
* LOAD_1_2_PF 1.2pF additional PA load capacitor * LOAD_1_2_PF 1.2pF additional PA load capacitor
* LOAD_2_4_PF 2.4pF additional PA load capacitor * LOAD_2_4_PF 2.4pF additional PA load capacitor
@ -1764,7 +1776,7 @@ enum spirit_agcmode_e
******************************************************************************/ ******************************************************************************/
int spirit_radio_enable_agcfreeze_steady(FAR struct spirit_library_s *spirit, int spirit_radio_enable_agcfreeze_steady(FAR struct spirit_library_s *spirit,
enum spirit_functional_state_e newstate); enum spirit_functional_state_e newstate);
/****************************************************************************** /******************************************************************************
* Name: spirit_radio_enable_agcfreeze_sync * Name: spirit_radio_enable_agcfreeze_sync
@ -1782,7 +1794,7 @@ int spirit_radio_enable_agcfreeze_steady(FAR struct spirit_library_s *spirit,
******************************************************************************/ ******************************************************************************/
int spirit_radio_enable_agcfreeze_sync(FAR struct spirit_library_s *spirit, int spirit_radio_enable_agcfreeze_sync(FAR struct spirit_library_s *spirit,
enum spirit_functional_state_e newstate); enum spirit_functional_state_e newstate);
/****************************************************************************** /******************************************************************************
* Name: spirit_radio_enable_agcfreeze_maxatten * Name: spirit_radio_enable_agcfreeze_maxatten
@ -1800,7 +1812,7 @@ int spirit_radio_enable_agcfreeze_sync(FAR struct spirit_library_s *spirit,
******************************************************************************/ ******************************************************************************/
int spirit_radio_enable_agcfreeze_maxatten(FAR struct spirit_library_s *spirit, int spirit_radio_enable_agcfreeze_maxatten(FAR struct spirit_library_s *spirit,
enum spirit_functional_state_e newstate); enum spirit_functional_state_e newstate);
/****************************************************************************** /******************************************************************************
* Name: spirit_radio_set_agcmeasure_us * Name: spirit_radio_set_agcmeasure_us

View file

@ -1,4 +1,4 @@
/****************************************************************************** /****************************************************************************
* drivers/wireless/spirit/include/spirit_spi.h * drivers/wireless/spirit/include/spirit_spi.h
* Header file for NuttX SPIRIT SPI driver interface. * Header file for NuttX SPIRIT SPI driver interface.
* *
@ -39,20 +39,20 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ****************************************************************************/
#ifndef __DRIVERS_WIRELESS_SPIRIT_INCLUDE_SPIRIT_SPI_H #ifndef __DRIVERS_WIRELESS_SPIRIT_INCLUDE_SPIRIT_SPI_H
#define __DRIVERS_WIRELESS_SPIRIT_INCLUDE_SPIRIT_SPI_H #define __DRIVERS_WIRELESS_SPIRIT_INCLUDE_SPIRIT_SPI_H
/****************************************************************************** /****************************************************************************
* Included Files * Included Files
******************************************************************************/ ****************************************************************************/
#include "spirit_types.h" #include "spirit_types.h"
/****************************************************************************** /****************************************************************************
* Pre-processor Defintiions * Pre-processor Defintiions
******************************************************************************/ ****************************************************************************/
/* SPIRIT1 SPI Headers */ /* SPIRIT1 SPI Headers */
@ -69,9 +69,9 @@
#define READ_HEADER __MKHEADER(HEADER_ADDRESS_MASK, HEADER_READ_MASK) #define READ_HEADER __MKHEADER(HEADER_ADDRESS_MASK, HEADER_READ_MASK)
#define COMMAND_HEADER __MKHEADER(HEADER_COMMAND_MASK, HEADER_WRITE_MASK) #define COMMAND_HEADER __MKHEADER(HEADER_COMMAND_MASK, HEADER_WRITE_MASK)
/****************************************************************************** /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
******************************************************************************/ ****************************************************************************/
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
@ -80,7 +80,7 @@ extern "C"
struct spi_dev_s; /* Forward reference */ struct spi_dev_s; /* Forward reference */
/****************************************************************************** /****************************************************************************
* Name: spirit_reg_read * Name: spirit_reg_read
* *
* Description: * Description:
@ -95,12 +95,12 @@ struct spi_dev_s; /* Forward reference */
* Zero (OK) is returned on success. A negated errno value is returned on * Zero (OK) is returned on success. A negated errno value is returned on
* any failure. On success, spirit->state is updated. * any failure. On success, spirit->state is updated.
* *
******************************************************************************/ ****************************************************************************/
int spirit_reg_read(FAR struct spirit_library_s *spirit, uint8_t regaddr, int spirit_reg_read(FAR struct spirit_library_s *spirit, uint8_t regaddr,
FAR uint8_t *buffer, unsigned int buflen); FAR uint8_t *buffer, unsigned int buflen);
/****************************************************************************** /****************************************************************************
* Name: spirit_reg_write * Name: spirit_reg_write
* *
* Description: * Description:
@ -116,12 +116,12 @@ int spirit_reg_read(FAR struct spirit_library_s *spirit, uint8_t regaddr,
* Zero (OK) is returned on success. A negated errno value is returned on * Zero (OK) is returned on success. A negated errno value is returned on
* any failure. On success, spirit->state is updated. * any failure. On success, spirit->state is updated.
* *
******************************************************************************/ ****************************************************************************/
int spirit_reg_write(FAR struct spirit_library_s *spirit, uint8_t regaddr, int spirit_reg_write(FAR struct spirit_library_s *spirit, uint8_t regaddr,
FAR const uint8_t *buffer, unsigned int buflen); FAR const uint8_t *buffer, unsigned int buflen);
/****************************************************************************** /****************************************************************************
* Name: spirit_reg_modify * Name: spirit_reg_modify
* *
* Description: * Description:
@ -139,12 +139,12 @@ int spirit_reg_write(FAR struct spirit_library_s *spirit, uint8_t regaddr,
* Zero (OK) is returned on success. A negated errno value is returned on * Zero (OK) is returned on success. A negated errno value is returned on
* any failure. On success, spirit->state is updated. * any failure. On success, spirit->state is updated.
* *
******************************************************************************/ ****************************************************************************/
int spirit_reg_modify(FAR struct spirit_library_s *spirit, uint8_t regaddr, int spirit_reg_modify(FAR struct spirit_library_s *spirit, uint8_t regaddr,
uint8_t setbits, uint8_t clrbits); uint8_t setbits, uint8_t clrbits);
/****************************************************************************** /****************************************************************************
* Name: spirit_command * Name: spirit_command
* *
* Description: * Description:
@ -158,11 +158,11 @@ int spirit_reg_modify(FAR struct spirit_library_s *spirit, uint8_t regaddr,
* Zero (OK) is returned on success. A negated errno value is returned on * Zero (OK) is returned on success. A negated errno value is returned on
* any failure. On success, spirit->state is updated. * any failure. On success, spirit->state is updated.
* *
******************************************************************************/ ****************************************************************************/
int spirit_command(FAR struct spirit_library_s *spirit, uint8_t cmd); int spirit_command(FAR struct spirit_library_s *spirit, uint8_t cmd);
/****************************************************************************** /****************************************************************************
* Name: spirit_fifo_read * Name: spirit_fifo_read
* *
* Description: * Description:
@ -177,12 +177,13 @@ int spirit_command(FAR struct spirit_library_s *spirit, uint8_t cmd);
* Zero (OK) is returned on success. A negated errno value is returned on * Zero (OK) is returned on success. A negated errno value is returned on
* any failure. On success, spirit->state is updated. * any failure. On success, spirit->state is updated.
* *
******************************************************************************/ ****************************************************************************/
int spirit_fifo_read(FAR struct spirit_library_s *spirit, FAR uint8_t *buffer, int spirit_fifo_read(FAR struct spirit_library_s *spirit,
FAR uint8_t *buffer,
unsigned int buflen); unsigned int buflen);
/****************************************************************************** /****************************************************************************
* Name: spirit_fifo_write * Name: spirit_fifo_write
* *
* Description: * Description:
@ -197,12 +198,12 @@ int spirit_fifo_read(FAR struct spirit_library_s *spirit, FAR uint8_t *buffer,
* Zero (OK) is returned on success. A negated errno value is returned on * Zero (OK) is returned on success. A negated errno value is returned on
* any failure. On success, spirit->state is updated. * any failure. On success, spirit->state is updated.
* *
******************************************************************************/ ****************************************************************************/
int spirit_fifo_write(FAR struct spirit_library_s *spirit, int spirit_fifo_write(FAR struct spirit_library_s *spirit,
FAR const uint8_t *buffer, unsigned int buflen); FAR const uint8_t *buffer, unsigned int buflen);
/****************************************************************************** /****************************************************************************
* Name: spirit_update_status * Name: spirit_update_status
* *
* Description: * Description:
@ -216,7 +217,7 @@ int spirit_fifo_write(FAR struct spirit_library_s *spirit,
* Zero (OK) is returned on success. A negated errno value is returned on * Zero (OK) is returned on success. A negated errno value is returned on
* any failure. On success, spirit->state is updated. * any failure. On success, spirit->state is updated.
* *
******************************************************************************/ ****************************************************************************/
int spirit_update_status(FAR struct spirit_library_s *spirit); int spirit_update_status(FAR struct spirit_library_s *spirit);

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -321,7 +323,8 @@ int spirit_timer_get_rxtimeout_setup(FAR struct spirit_library_s *spirit,
* *
* Description: * Description:
* Sets the LDCR wake up timer initialization registers with the values of * Sets the LDCR wake up timer initialization registers with the values of
* COUNTER and PRESCALER according to the formula: Twu=(PRESCALER +1)*(COUNTER+1)*Tck, * COUNTER and PRESCALER according to the formula:
* Twu=(PRESCALER +1)*(COUNTER+1)*Tck,
* where Tck = 28.818 us. The minimum vale of the wakeup timeout is 28.818us * where Tck = 28.818 us. The minimum vale of the wakeup timeout is 28.818us
* (PRESCALER and COUNTER equals to 0) and the maximum value is about 1.89 s * (PRESCALER and COUNTER equals to 0) and the maximum value is about 1.89 s
* (PRESCALER anc COUNTER equals to 255). * (PRESCALER anc COUNTER equals to 255).
@ -498,8 +501,9 @@ int spirit_timer_wakeuptimer_reload(FAR struct spirit_library_s *spirit,
* *
******************************************************************************/ ******************************************************************************/
int spirit_timer_set_wakeuptimer_reloadcounter(FAR struct spirit_library_s *spirit, int spirit_timer_set_wakeuptimer_reloadcounter(
uint8_t counter); FAR struct spirit_library_s *spirit,
uint8_t counter);
/****************************************************************************** /******************************************************************************
* Name: spirit_timer_set_wakeuptimer_reloadprescaler * Name: spirit_timer_set_wakeuptimer_reloadprescaler
@ -521,8 +525,9 @@ int spirit_timer_set_wakeuptimer_reloadcounter(FAR struct spirit_library_s *spir
* *
******************************************************************************/ ******************************************************************************/
int spirit_timer_set_wakeuptimer_reloadprescaler(FAR struct spirit_library_s *spirit, int spirit_timer_set_wakeuptimer_reloadprescaler(
uint8_t prescaler); FAR struct spirit_library_s *spirit,
uint8_t prescaler);
/****************************************************************************** /******************************************************************************
* Name: spirit_timer_get_wakeuptimer_reload_setup * Name: spirit_timer_get_wakeuptimer_reload_setup
@ -548,10 +553,11 @@ int spirit_timer_set_wakeuptimer_reloadprescaler(FAR struct spirit_library_s *sp
* *
******************************************************************************/ ******************************************************************************/
int spirit_timer_get_wakeuptimer_reload_setup(FAR struct spirit_library_s *spirit, int spirit_timer_get_wakeuptimer_reload_setup(
FAR float *reload, FAR struct spirit_library_s *spirit,
FAR uint8_t *counter, FAR float *reload,
FAR uint8_t *prescaler); FAR uint8_t *counter,
FAR uint8_t *prescaler);
/****************************************************************************** /******************************************************************************
* Name: spirit_timer_get_rcofrequency * Name: spirit_timer_get_rcofrequency
@ -577,7 +583,8 @@ uint16_t spirit_timer_get_rcofrequency(FAR struct spirit_library_s *spirit);
* Computes the values of the wakeup timer counter and prescaler from the * Computes the values of the wakeup timer counter and prescaler from the
* user time expressed in millisecond. The prescaler and the counter values * user time expressed in millisecond. The prescaler and the counter values
* are computed maintaining the prescaler value as small as possible in * are computed maintaining the prescaler value as small as possible in
* order to obtain the best resolution, and in the meantime minimizing the error. * order to obtain the best resolution, and in the meantime minimizing the
* error.
* *
* Input Parameters: * Input Parameters:
* spirit - Reference to a Spirit library state structure instance * spirit - Reference to a Spirit library state structure instance
@ -642,9 +649,10 @@ void spirit_timer_calc_rxtimeout_values(FAR struct spirit_library_s *spirit,
* *
******************************************************************************/ ******************************************************************************/
int spirit_timer_set_rxtimeout_stopcondition(FAR struct spirit_library_s *spirit, int spirit_timer_set_rxtimeout_stopcondition(
enum spirit_rxtimeout_stopcondition_e FAR struct spirit_library_s *spirit,
stopcondition); enum spirit_rxtimeout_stopcondition_e
stopcondition);
/****************************************************************************** /******************************************************************************
* Name: spirit_timer_cmd_reload * Name: spirit_timer_cmd_reload

View file

@ -9,28 +9,30 @@
* Adapted and extended for NuttX by: * Adapted and extended for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -107,13 +109,16 @@ enum spirit_state_e
}; };
/* SPIRIT Status. This definition represents the single field of the SPIRIT /* SPIRIT Status. This definition represents the single field of the SPIRIT
* status returned on each SPI transaction, equal also to the MC_STATE registers. * status returned on each SPI transaction, equal also to the MC_STATE
* This field-oriented structure allows user to address in simple way the single * registers.
* field of the SPIRIT status. * This field-oriented structure allows user to address in simple way
* The user shall define a variable of SpiritStatus type to access on SPIRIT status fields. * the single field of the SPIRIT status.
* NOTE: The fields order in the structure depends on used endianness (little or big * The user shall define a variable of SpiritStatus type to access on
* endian). The actual definition is valid ONLY for LITTLE ENDIAN mode. Be sure to * SPIRIT status fields.
* change opportunely the fields order when use a different endianness. * NOTE: The fields order in the structure depends on used endianness
* (little or big endian). The actual definition is valid ONLY for
* LITTLE ENDIAN mode. Be sure to change opportunely the fields order
* when use a different endianness.
*/ */
#ifndef CONFIG_ENDIAN_BIG #ifndef CONFIG_ENDIAN_BIG

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -591,7 +593,8 @@ int spirit_calib_select_vco(FAR struct spirit_library_s *spirit,
* *
******************************************************************************/ ******************************************************************************/
enum spirit_vcoselect_e spirit_calib_get_vco(FAR struct spirit_library_s *spirit) enum spirit_vcoselect_e spirit_calib_get_vco(
FAR struct spirit_library_s *spirit)
{ {
uint8_t regval; uint8_t regval;

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -370,8 +372,9 @@ enum spirit_functional_state_e
* Name: spirit_csma_set_seedreload * Name: spirit_csma_set_seedreload
* *
* Description: * Description:
* Enables or Disables the seed reload mode (if enabled it reloads the back- * Enables or Disables the seed reload mode (if enabled it reloads the
* off generator seed using the value written in the BU_COUNTER_SEED register). * back- off generator seed using the value written in the BU_COUNTER_SEED
* register).
* *
* Input Parameters: * Input Parameters:
* spirit - Reference to a Spirit library state structure instance * spirit - Reference to a Spirit library state structure instance

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/

View file

@ -9,28 +9,29 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -311,7 +313,8 @@ int spirit_gpio_enable_clockoutput(FAR struct spirit_library_s *spirit,
* Initializes the SPIRIT Clock Output according to the specified parameters * Initializes the SPIRIT Clock Output according to the specified parameters
* in the xClockOutputInitStruct. * in the xClockOutputInitStruct.
* *
* NOTE: The function spirit_gpio_enable_clockoutput() must be called in order to * NOTE:
* The function spirit_gpio_enable_clockoutput() must be called in order to
* enable or disable the MCU clock dividers. * enable or disable the MCU clock dividers.
* *
* Input Parameters: * Input Parameters:
@ -325,8 +328,9 @@ int spirit_gpio_enable_clockoutput(FAR struct spirit_library_s *spirit,
* *
******************************************************************************/ ******************************************************************************/
int spirit_gpio_clockoutput_initialize(FAR struct spirit_library_s *spirit, int spirit_gpio_clockoutput_initialize(
FAR const struct spirit_clockoutput_init_s *clockoutput) FAR struct spirit_library_s *spirit,
FAR const struct spirit_clockoutput_init_s *clockoutput)
{ {
uint8_t regval = 0; uint8_t regval = 0;
@ -367,7 +371,7 @@ int spirit_gpio_clockoutput_initialize(FAR struct spirit_library_s *spirit,
******************************************************************************/ ******************************************************************************/
int spirit_gpio_set_xoprescaler(FAR struct spirit_library_s *spirit, int spirit_gpio_set_xoprescaler(FAR struct spirit_library_s *spirit,
enum spirit_clockoutput_xoprescaler_e xoprescaler) enum spirit_clockoutput_xoprescaler_e xoprescaler)
{ {
uint8_t regval = 0; uint8_t regval = 0;
int ret; int ret;
@ -440,7 +444,7 @@ enum spirit_clockoutput_xoprescaler_e
******************************************************************************/ ******************************************************************************/
int spirit_gpio_set_rcoprescaler(FAR struct spirit_library_s *spirit, int spirit_gpio_set_rcoprescaler(FAR struct spirit_library_s *spirit,
enum spirit_clockoutput_rcoprescaler_e rcoprescaler) enum spirit_clockoutput_rcoprescaler_e rcoprescaler)
{ {
uint8_t regval = 0; uint8_t regval = 0;
int ret; int ret;

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -253,7 +255,8 @@ int spirit_irq_get_pending(FAR struct spirit_library_s *spirit,
{ {
/* Reads IRQ_STATUS registers */ /* Reads IRQ_STATUS registers */
return spirit_reg_read(spirit, IRQ_STATUS3_BASE, (FAR uint8_t *)pirqstatus, 4); return spirit_reg_read(spirit, IRQ_STATUS3_BASE,
(FAR uint8_t *)pirqstatus, 4);
} }
#endif #endif

View file

@ -9,28 +9,29 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -274,7 +275,9 @@ int spirit_fifo_set_txalmostfull(FAR struct spirit_library_s *spirit,
regval &= 0x80; regval &= 0x80;
regval |= threshold; regval |= threshold;
/* Writes the Almost Full threshold for Tx in the corresponding register */ /* Writes the Almost Full threshold for Tx in the corresponding
* register
*/
ret = spirit_reg_write(spirit, FIFO_CONFIG1_TXAFTHR_BASE, &regval, 1); ret = spirit_reg_write(spirit, FIFO_CONFIG1_TXAFTHR_BASE, &regval, 1);
} }
@ -350,7 +353,9 @@ int spirit_fifo_set_txalmostempty(FAR struct spirit_library_s *spirit,
regval &= 0x80; regval &= 0x80;
regval |= threshold; regval |= threshold;
/* Writes the Almost Empty threshold for Tx in the corresponding register */ /* Writes the Almost Empty threshold for Tx in the corresponding
* register
*/
ret = spirit_reg_write(spirit, FIFO_CONFIG0_TXAETHR_BASE, &regval, 1); ret = spirit_reg_write(spirit, FIFO_CONFIG0_TXAETHR_BASE, &regval, 1);
} }

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -208,7 +210,8 @@ static int
anaregs[0] = (uint8_t)(((synthword >> 21) & 0x0000001f) | (wcp << 5)); anaregs[0] = (uint8_t)(((synthword >> 21) & 0x0000001f) | (wcp << 5));
anaregs[1] = (uint8_t)((synthword >> 13) & 0x000000ff); anaregs[1] = (uint8_t)((synthword >> 13) & 0x000000ff);
anaregs[2] = (uint8_t)((synthword >> 5) & 0x000000ff); anaregs[2] = (uint8_t)((synthword >> 5) & 0x000000ff);
anaregs[3] = (uint8_t)(((synthword & 0x0000001f) << 3) | g_vectc_bandreg[band]); anaregs[3] = (uint8_t)(((synthword & 0x0000001f) << 3) |
g_vectc_bandreg[band]);
/* Configures the needed Analog Radio registers */ /* Configures the needed Analog Radio registers */

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -68,7 +70,7 @@
******************************************************************************/ ******************************************************************************/
int spirit_pktbasic_initialize(FAR struct spirit_library_s *spirit, int spirit_pktbasic_initialize(FAR struct spirit_library_s *spirit,
FAR const struct spirit_pktbasic_init_s *pktpasic) FAR const struct spirit_pktbasic_init_s *pktpasic)
{ {
uint8_t regval[4]; uint8_t regval[4];
uint8_t pktlenwidth; uint8_t pktlenwidth;
@ -313,7 +315,7 @@ int spirit_pktbasic_get_setup(FAR struct spirit_library_s *spirit,
******************************************************************************/ ******************************************************************************/
int spirit_pktbasic_addr_initialize(FAR struct spirit_library_s *spirit, int spirit_pktbasic_addr_initialize(FAR struct spirit_library_s *spirit,
FAR struct spirit_pktbasic_addr_s *basicaddr) FAR struct spirit_pktbasic_addr_s *basicaddr)
{ {
uint8_t regval[3]; uint8_t regval[3];
int ret; int ret;

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -683,7 +685,8 @@ uint8_t spirit_pktcommon_get_syncword(FAR struct spirit_library_s *spirit,
******************************************************************************/ ******************************************************************************/
int spirit_pktcommon_set_syncwords(FAR struct spirit_library_s *spirit, int spirit_pktcommon_set_syncwords(FAR struct spirit_library_s *spirit,
uint32_t syncwords, enum pkt_synlen_e synclen) uint32_t syncwords,
enum pkt_synlen_e synclen)
{ {
uint8_t regval[4]; uint8_t regval[4];
int i; int i;
@ -720,7 +723,8 @@ int spirit_pktcommon_set_syncwords(FAR struct spirit_library_s *spirit,
* synclen has been stored. * synclen has been stored.
* *
* Returned Value: * Returned Value:
* Sync words. The format of the read 32 bit word is 0x|SYNC1|SYNC2|SYNC3|SYNC4|. * Sync words. The format of the read 32 bit word is
* 0x|SYNC1|SYNC2|SYNC3|SYNC4|.
* *
******************************************************************************/ ******************************************************************************/
@ -797,7 +801,8 @@ int spirit_pktcommon_set_txdestaddr(FAR struct spirit_library_s *spirit,
{ {
/* Write value to PCKT_FLT_GOALS_SOURCE_ADDR register */ /* Write value to PCKT_FLT_GOALS_SOURCE_ADDR register */
return spirit_reg_write(spirit, PCKT_FLT_GOALS_SOURCE_ADDR_BASE, &txdestaddr, 1); return spirit_reg_write(spirit,
PCKT_FLT_GOALS_SOURCE_ADDR_BASE, &txdestaddr, 1);
} }
/****************************************************************************** /******************************************************************************
@ -902,7 +907,8 @@ int spirit_pktcommon_set_bcastaddr(FAR struct spirit_library_s *spirit,
{ {
/* Write value to the PCKT_FLT_GOALS_BROADCAST register */ /* Write value to the PCKT_FLT_GOALS_BROADCAST register */
return spirit_reg_write(spirit, PCKT_FLT_GOALS_BROADCAST_BASE, &bcastaddr, 1); return spirit_reg_write(spirit,
PCKT_FLT_GOALS_BROADCAST_BASE, &bcastaddr, 1);
} }
/****************************************************************************** /******************************************************************************
@ -954,7 +960,8 @@ int spirit_pktcommon_set_mcastaddr(FAR struct spirit_library_s *spirit,
{ {
/* Write value to the PCKT_FLT_GOALS_MULTICAST register */ /* Write value to the PCKT_FLT_GOALS_MULTICAST register */
return spirit_reg_write(spirit, PCKT_FLT_GOALS_MULTICAST_BASE, &mcastaddr, 1); return spirit_reg_write(spirit,
PCKT_FLT_GOALS_MULTICAST_BASE, &mcastaddr, 1);
} }
/****************************************************************************** /******************************************************************************
@ -1014,7 +1021,8 @@ int spirit_pktcommon_set_ctrlmask(FAR struct spirit_library_s *spirit,
/* Write values to the CKT_FLT_GOALS_CONTROLx_MASK registers */ /* Write values to the CKT_FLT_GOALS_CONTROLx_MASK registers */
return spirit_reg_write(spirit, PCKT_FLT_GOALS_CONTROL0_MASK_BASE, regval, 4); return spirit_reg_write(spirit,
PCKT_FLT_GOALS_CONTROL0_MASK_BASE, regval, 4);
} }
/****************************************************************************** /******************************************************************************
@ -1085,7 +1093,8 @@ int spirit_pktcommon_set_ctrlref(FAR struct spirit_library_s *spirit,
/* Write values to the CKT_FLT_GOALS_CONTROLx_FIELD registers */ /* Write values to the CKT_FLT_GOALS_CONTROLx_FIELD registers */
return spirit_reg_write(spirit, PCKT_FLT_GOALS_CONTROL0_FIELD_BASE, regval, 4); return spirit_reg_write(spirit,
PCKT_FLT_GOALS_CONTROL0_FIELD_BASE, regval, 4);
} }
/****************************************************************************** /******************************************************************************
@ -1208,8 +1217,9 @@ uint32_t spirit_pktcommon_get_txctrl(FAR struct spirit_library_s *spirit)
* *
******************************************************************************/ ******************************************************************************/
int spirit_pktcommon_enable_destaddr_filter(FAR struct spirit_library_s *spirit, int spirit_pktcommon_enable_destaddr_filter(
enum spirit_functional_state_e newstate) FAR struct spirit_library_s *spirit,
enum spirit_functional_state_e newstate)
{ {
uint8_t regval; uint8_t regval;
int ret; int ret;
@ -1258,8 +1268,9 @@ int spirit_pktcommon_enable_destaddr_filter(FAR struct spirit_library_s *spirit,
* *
******************************************************************************/ ******************************************************************************/
int spirit_pktcommon_enable_mcastaddr_filter(FAR struct spirit_library_s *spirit, int spirit_pktcommon_enable_mcastaddr_filter(
enum spirit_functional_state_e newstate) FAR struct spirit_library_s *spirit,
enum spirit_functional_state_e newstate)
{ {
uint8_t regval; uint8_t regval;
int ret; int ret;
@ -1308,8 +1319,9 @@ int spirit_pktcommon_enable_mcastaddr_filter(FAR struct spirit_library_s *spirit
* *
******************************************************************************/ ******************************************************************************/
int spirit_pktcommon_enable_bcastaddr_filter(FAR struct spirit_library_s *spirit, int spirit_pktcommon_enable_bcastaddr_filter(
enum spirit_functional_state_e newstate) FAR struct spirit_library_s *spirit,
enum spirit_functional_state_e newstate)
{ {
uint8_t regval; uint8_t regval;
int ret; int ret;
@ -1357,7 +1369,8 @@ int spirit_pktcommon_enable_bcastaddr_filter(FAR struct spirit_library_s *spirit
******************************************************************************/ ******************************************************************************/
enum spirit_functional_state_e enum spirit_functional_state_e
spirit_pktcommon_isenabled_destaddr_filter(FAR struct spirit_library_s *spirit) spirit_pktcommon_isenabled_destaddr_filter(
FAR struct spirit_library_s *spirit)
{ {
uint8_t regval; uint8_t regval;
@ -1365,7 +1378,9 @@ enum spirit_functional_state_e
spirit_reg_read(spirit, PCKT_FLT_OPTIONS_BASE, &regval, 1); spirit_reg_read(spirit, PCKT_FLT_OPTIONS_BASE, &regval, 1);
/* Gets the enable/disable bit in form of enum spirit_functional_state_e type */ /* Gets the enable/disable bit in form of enum spirit_functional_state_e
* type
*/
if (regval & 0x08) if (regval & 0x08)
{ {
@ -1392,7 +1407,8 @@ enum spirit_functional_state_e
******************************************************************************/ ******************************************************************************/
enum spirit_functional_state_e enum spirit_functional_state_e
spirit_pktcommon_isenabled_mcastaddr_filter(FAR struct spirit_library_s *spirit) spirit_pktcommon_isenabled_mcastaddr_filter(
FAR struct spirit_library_s *spirit)
{ {
uint8_t regval; uint8_t regval;
@ -1400,7 +1416,9 @@ enum spirit_functional_state_e
spirit_reg_read(spirit, PCKT_FLT_OPTIONS_BASE, &regval, 1); spirit_reg_read(spirit, PCKT_FLT_OPTIONS_BASE, &regval, 1);
/* Get the enable/disable bit in form of enum spirit_functional_state_e type */ /* Get the enable/disable bit in form of enum spirit_functional_state_e
* type
*/
if (regval & 0x04) if (regval & 0x04)
{ {
@ -1427,7 +1445,8 @@ enum spirit_functional_state_e
******************************************************************************/ ******************************************************************************/
enum spirit_functional_state_e enum spirit_functional_state_e
spirit_pktcommon_isenabled_bcastaddr_filter(FAR struct spirit_library_s *spirit) spirit_pktcommon_isenabled_bcastaddr_filter(
FAR struct spirit_library_s *spirit)
{ {
uint8_t regval; uint8_t regval;
@ -1435,7 +1454,9 @@ enum spirit_functional_state_e
spirit_reg_read(spirit, PCKT_FLT_OPTIONS_BASE, &regval, 1); spirit_reg_read(spirit, PCKT_FLT_OPTIONS_BASE, &regval, 1);
/* Get the enable/disable bit in form of enum spirit_functional_state_e type */ /* Get the enable/disable bit in form of enum spirit_functional_state_e
* type
*/
if (regval & 0x02) if (regval & 0x02)
{ {
@ -1837,7 +1858,8 @@ enum spirit_functional_state_e
/* Build the value to be written */ /* Build the value to be written */
return (enum spirit_functional_state_e) ((regval & TX_PCKT_INFO_NACK_RX) >> 2); return (enum spirit_functional_state_e)
((regval & TX_PCKT_INFO_NACK_RX) >> 2);
} }
/****************************************************************************** /******************************************************************************
@ -1998,7 +2020,7 @@ uint8_t spirit_pktcommon_get_nretx(FAR struct spirit_library_s *spirit)
******************************************************************************/ ******************************************************************************/
int spirit_pktcommon_enable_ctrl_filter(FAR struct spirit_library_s *spirit, int spirit_pktcommon_enable_ctrl_filter(FAR struct spirit_library_s *spirit,
enum spirit_functional_state_e newstate) enum spirit_functional_state_e newstate)
{ {
uint8_t regval; uint8_t regval;
int ret; int ret;
@ -2054,7 +2076,9 @@ enum spirit_functional_state_e
spirit_reg_read(spirit, PCKT_FLT_OPTIONS_BASE, &regval, 1); spirit_reg_read(spirit, PCKT_FLT_OPTIONS_BASE, &regval, 1);
/* Gets the enable/disable bit in form of enum spirit_functional_state_e type */ /* Gets the enable/disable bit in form of enum spirit_functional_state_e
* type
*/
if (regval & PCKT_FLT_OPTIONS_CONTROL_FILTERING_MASK) if (regval & PCKT_FLT_OPTIONS_CONTROL_FILTERING_MASK)
{ {

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -66,7 +68,7 @@
******************************************************************************/ ******************************************************************************/
int spirit_pktstack_initialize(FAR struct spirit_library_s *spirit, int spirit_pktstack_initialize(FAR struct spirit_library_s *spirit,
FAR const struct spirit_pktstack_init_s *pktstack) FAR const struct spirit_pktstack_init_s *pktstack)
{ {
uint8_t regval[4]; uint8_t regval[4];
uint8_t pktlenwidth; uint8_t pktlenwidth;
@ -298,7 +300,7 @@ int spirit_pktstack_get_setup(FAR struct spirit_library_s *spirit,
******************************************************************************/ ******************************************************************************/
int spirit_pktstack_address_initialize(FAR struct spirit_library_s *spirit, int spirit_pktstack_address_initialize(FAR struct spirit_library_s *spirit,
FAR const struct spirit_pktstack_address_s *addrinit) FAR const struct spirit_pktstack_address_s *addrinit)
{ {
uint8_t regval[3]; uint8_t regval[3];
int ret; int ret;
@ -360,7 +362,8 @@ int spirit_pktstack_address_initialize(FAR struct spirit_library_s *spirit,
/* Write them to the addresses registers */ /* Write them to the addresses registers */
ret = spirit_reg_write(spirit, PCKT_FLT_GOALS_BROADCAST_BASE, regval, 3); ret = spirit_reg_write(spirit,
PCKT_FLT_GOALS_BROADCAST_BASE, regval, 3);
} }
} }
@ -384,7 +387,7 @@ int spirit_pktstack_address_initialize(FAR struct spirit_library_s *spirit,
******************************************************************************/ ******************************************************************************/
int spirit_pktstack_get_addrsetup(FAR struct spirit_library_s *spirit, int spirit_pktstack_get_addrsetup(FAR struct spirit_library_s *spirit,
FAR struct spirit_pktstack_address_s *addrinit) FAR struct spirit_pktstack_address_s *addrinit)
{ {
uint8_t regval[3]; uint8_t regval[3];
int ret; int ret;
@ -421,8 +424,8 @@ int spirit_pktstack_get_addrsetup(FAR struct spirit_library_s *spirit,
* Name: spirit_pktstack_llp_initialize * Name: spirit_pktstack_llp_initialize
* *
* Description: * Description:
* Initializes the SPIRIT STack packet LLP options according to the specified * Initializes the SPIRIT STack packet LLP options according to the
* parameters in the struct spirit_pktstack_llp_s struct. * specified parameters in the struct spirit_pktstack_llp_s struct.
* *
* Input Parameters: * Input Parameters:
* spirit - Reference to a Spirit library state structure instance * spirit - Reference to a Spirit library state structure instance
@ -434,7 +437,7 @@ int spirit_pktstack_get_addrsetup(FAR struct spirit_library_s *spirit,
******************************************************************************/ ******************************************************************************/
int spirit_pktstack_llp_initialize(FAR struct spirit_library_s *spirit, int spirit_pktstack_llp_initialize(FAR struct spirit_library_s *spirit,
FAR const struct spirit_pktstack_llp_s *llpinit) FAR const struct spirit_pktstack_llp_s *llpinit)
{ {
uint8_t regval[2]; uint8_t regval[2];
int ret; int ret;
@ -817,7 +820,8 @@ int spirit_pkstack_set_rxsource_addrmask(FAR struct spirit_library_s *spirit,
* *
******************************************************************************/ ******************************************************************************/
uint8_t spirit_pktstack_get_rxsource_addrmask(FAR struct spirit_library_s *spirit) uint8_t spirit_pktstack_get_rxsource_addrmask(
FAR struct spirit_library_s *spirit)
{ {
uint8_t regval; uint8_t regval;
@ -887,8 +891,9 @@ uint16_t spirit_pktstack_get_rxpktlen(FAR struct spirit_library_s *spirit)
* *
******************************************************************************/ ******************************************************************************/
int spirit_pkstack_enable_rxsource_addrfilter(FAR struct spirit_library_s *spirit, int spirit_pkstack_enable_rxsource_addrfilter(
enum spirit_functional_state_e newstate) FAR struct spirit_library_s *spirit,
enum spirit_functional_state_e newstate)
{ {
uint8_t regval; uint8_t regval;
int ret; int ret;

View file

@ -9,28 +9,29 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/

View file

@ -10,28 +10,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -101,13 +103,13 @@ static const uint16_t g_vectn_bandwidth[90] =
8001, 7951, 7684, 7368, 7051, 6709, 6423, 5867, 5414, 8001, 7951, 7684, 7368, 7051, 6709, 6423, 5867, 5414,
4509, 4259, 4032, 3808, 3621, 3417, 3254, 2945, 2703, 4509, 4259, 4032, 3808, 3621, 3417, 3254, 2945, 2703,
2247, 2124, 2015, 1900, 1807, 1706, 1624, 1471, 1350, 2247, 2124, 2015, 1900, 1807, 1706, 1624, 1471, 1350,
1123, 1062, 1005, 950, 903, 853, 812, 735, 675, 1123, 1062, 1005, 950, 903, 853, 812, 735, 675,
561, 530, 502, 474, 451, 426, 406, 367, 337, 561, 530, 502, 474, 451, 426, 406, 367, 337,
280, 265, 251, 237, 226, 213, 203, 184, 169, 280, 265, 251, 237, 226, 213, 203, 184, 169,
140, 133, 126, 119, 113, 106, 101, 92, 84, 140, 133, 126, 119, 113, 106, 101, 92, 84,
70, 66, 63, 59, 56, 53, 51, 46, 42, 70, 66, 63, 59, 56, 53, 51, 46, 42,
35, 33, 31, 30, 28, 27, 25, 23, 21, 35, 33, 31, 30, 28, 27, 25, 23, 21,
18, 17, 16, 15, 14, 13, 13, 12, 11 18, 17, 16, 15, 14, 13, 13, 12, 11
}; };
/* These values are used to interpolate the power curves. Interpolation /* These values are used to interpolate the power curves. Interpolation
@ -246,7 +248,8 @@ int spirit_radio_initialize(FAR struct spirit_library_s *spirit,
else else
{ {
ret = spirit_radio_enable_digdivider(spirit, S_ENABLE); ret = spirit_radio_enable_digdivider(spirit, S_ENABLE);
DEBUGASSERT(IS_CH_BW(radioinit->bandwidth, (spirit->xtal_frequency >> 1))); DEBUGASSERT(IS_CH_BW(radioinit->bandwidth,
(spirit->xtal_frequency >> 1)));
} }
if (ret < 0) if (ret < 0)
@ -490,8 +493,9 @@ int spirit_radio_initialize(FAR struct spirit_library_s *spirit,
* *
* Input Parameters: * Input Parameters:
* spirit - Reference to a Spirit library state structure instance * spirit - Reference to a Spirit library state structure instance
* radioinit pointer to a struct radio_init_s that * radioinit pointer to a struct radio_init_s thatcontains the
* contains the configuration information for the analog radio part of SPIRIT. * configuration information for the analog radio part of
* SPIRIT.
* *
* Returned Value: * Returned Value:
* Zero (OK) returned on success; a negated errno value is returned on any * Zero (OK) returned on success; a negated errno value is returned on any
@ -1165,7 +1169,8 @@ int spirit_radio_set_foffset_ppm(FAR struct spirit_library_s *spirit,
* Name: spirit_radio_set_foffset_hz * Name: spirit_radio_set_foffset_hz
* *
* Description: * Description:
* Sets the FC OFFSET register starting from frequency offset expressed in Hz. * Sets the FC OFFSET register starting from frequency offset expressed in
* Hz.
* *
* Input Parameters: * Input Parameters:
* spirit - Reference to a Spirit library state structure instance * spirit - Reference to a Spirit library state structure instance
@ -1374,7 +1379,8 @@ int spirit_radio_set_basefrequency(FAR struct spirit_library_s *spirit,
anaregs[0] = (uint8_t)(((synthword >> 21) & 0x0000001f) | (wcp << 5)); anaregs[0] = (uint8_t)(((synthword >> 21) & 0x0000001f) | (wcp << 5));
anaregs[1] = (uint8_t)((synthword >> 13) & 0x000000ff); anaregs[1] = (uint8_t)((synthword >> 13) & 0x000000ff);
anaregs[2] = (uint8_t)((synthword >> 5) & 0x000000ff); anaregs[2] = (uint8_t)((synthword >> 5) & 0x000000ff);
anaregs[3] = (uint8_t)(((synthword & 0x0000001f) << 3) | g_vectc_bandval[band]); anaregs[3] = (uint8_t)(((synthword & 0x0000001f) << 3) |
g_vectc_bandval[band]);
/* Configures the needed Analog Radio registers */ /* Configures the needed Analog Radio registers */
@ -1411,7 +1417,7 @@ int spirit_radio_set_basefrequency(FAR struct spirit_library_s *spirit,
******************************************************************************/ ******************************************************************************/
void spirit_radio_enable_wavco_calibration(FAR struct spirit_library_s *spirit, void spirit_radio_enable_wavco_calibration(FAR struct spirit_library_s *spirit,
enum spirit_functional_state_e newstate) enum spirit_functional_state_e newstate)
{ {
spirit->vcocalib = newstate; spirit->vcocalib = newstate;
} }
@ -1749,8 +1755,8 @@ int spirit_radio_convert_freqdev(FAR struct spirit_library_s *spirit,
* [100 500000]. * [100 500000].
* *
* Returned Value: * Returned Value:
* Zero (OK) is returned on success; a negated errnor value is returned on any * Zero (OK) is returned on success; a negated errnor value is returned on
* failure. * any failure.
* *
******************************************************************************/ ******************************************************************************/
@ -1830,8 +1836,8 @@ uint32_t spirit_radio_get_datarate(FAR struct spirit_library_s *spirit)
* is in the correct range [F_Xo*8/2^18, F_Xo*7680/2^18] Hz. * is in the correct range [F_Xo*8/2^18, F_Xo*7680/2^18] Hz.
* *
* Returned Value: * Returned Value:
* Zero (OK) is returned on success; a negated errnor value is returned on any * Zero (OK) is returned on success; a negated errnor value is returned on
* failure. * any failure.
* *
******************************************************************************/ ******************************************************************************/
@ -1924,8 +1930,8 @@ uint32_t spirit_radio_get_freqdev(FAR struct spirit_library_s *spirit)
* spirit_radio_get_chfilterbw() API. * spirit_radio_get_chfilterbw() API.
* *
* Returned Value: * Returned Value:
* Zero (OK) is returned on success; a negated errnor value is returned on any * Zero (OK) is returned on success; a negated errnor value is returned on
* failure. * any failure.
* *
******************************************************************************/ ******************************************************************************/
@ -2006,8 +2012,8 @@ uint32_t spirit_radio_get_chfilterbw(FAR struct spirit_library_s *spirit)
* modulation - Modulation to set. * modulation - Modulation to set.
* *
* Returned Value: * Returned Value:
* Zero (OK) is returned on success; a negated errnor value is returned on any * Zero (OK) is returned on success; a negated errnor value is returned on
* failure. * any failure.
* *
******************************************************************************/ ******************************************************************************/
@ -2074,8 +2080,8 @@ enum modulation_select_e
* or S_DISABLE . * or S_DISABLE .
* *
* Returned Value: * Returned Value:
* Zero (OK) is returned on success; a negated errnor value is returned on any * Zero (OK) is returned on success; a negated errnor value is returned on
* failure. * any failure.
* *
******************************************************************************/ ******************************************************************************/
@ -2122,8 +2128,8 @@ int spirit_radio_enable_cwtxmode(FAR struct spirit_library_s *spirit,
* ookdelay - Peak decay control for OOK. * ookdelay - Peak decay control for OOK.
* *
* Returned Value: * Returned Value:
* Zero (OK) is returned on success; a negated errnor value is returned on any * Zero (OK) is returned on success; a negated errnor value is returned on
* failure. * any failure.
* *
******************************************************************************/ ******************************************************************************/
@ -2405,10 +2411,11 @@ int spirit_radio_config_patable_dbm(FAR struct spirit_library_s *spirit,
* spirit - Reference to a Spirit library state structure instance * spirit - Reference to a Spirit library state structure instance
* nlevels - Pointer to the number of levels settled. This parameter must * nlevels - Pointer to the number of levels settled. This parameter must
* be in the range [0:7]. * be in the range [0:7].
* table - Pointer to an array of 8 elements containing the PA value in dbm. * table - Pointer to an array of 8 elements containing the PA value in
* dbm.
* The first element will be the PA_LEVEL_0 and the last element * The first element will be the PA_LEVEL_0 and the last element
* will be PA_LEVEL_7. Any value higher than PA_UPPER_LIMIT implies * will be PA_LEVEL_7. Any value higher than PA_UPPER_LIMIT
* no output power (output stage is in high impedance). * implies no output power (output stage is in high impedance).
* *
* Returned Value: * Returned Value:
* Zero (OK) on success. A negated errno value is returned on any failure. * Zero (OK) on success. A negated errno value is returned on any failure.
@ -2495,8 +2502,9 @@ int spirit_radio_set_palevel_dbm(FAR struct spirit_library_s *spirit,
* Description: * Description:
* Returns a specific PA_LEVEL register, returning a value in dBm. * Returns a specific PA_LEVEL register, returning a value in dBm.
* *
* NOTE: This function makes use of the @ref spirit_radio_convert_reg2power fcn to * NOTE:
* interpolate the power value. * This function makes use of the @ref spirit_radio_convert_reg2power fcn
* to interpolate the power value.
* *
* Input Parameters: * Input Parameters:
* spirit - Reference to a Spirit library state structure instance * spirit - Reference to a Spirit library state structure instance
@ -2527,8 +2535,8 @@ float spirit_radio_get_palevel_dbm(FAR struct spirit_library_s *spirit,
spirit_reg_read(spirit, regaddr, &value, 1); spirit_reg_read(spirit, regaddr, &value, 1);
return spirit_radio_convert_reg2power(spirit, return spirit_radio_convert_reg2power(spirit,
spirit_radio_get_basefrequency(spirit), spirit_radio_get_basefrequency(spirit),
value); value);
} }
/****************************************************************************** /******************************************************************************
@ -2726,7 +2734,8 @@ uint8_t spirit_radio_get_palevel(FAR struct spirit_library_s *spirit,
* *
* Input Parameters: * Input Parameters:
* spirit - Reference to a Spirit library state structure instance * spirit - Reference to a Spirit library state structure instance
* load one of the possible value of the enum type enum spirit_paload_capacitor_e. * load one of the possible value of the enum type enum
* spirit_paload_capacitor_e.
* LOAD_0_PF No additional PA load capacitor * LOAD_0_PF No additional PA load capacitor
* LOAD_1_2_PF 1.2pF additional PA load capacitor * LOAD_1_2_PF 1.2pF additional PA load capacitor
* LOAD_2_4_PF 2.4pF additional PA load capacitor * LOAD_2_4_PF 2.4pF additional PA load capacitor
@ -3641,7 +3650,9 @@ enum spirit_agcmode_e
{ {
uint8_t regval; uint8_t regval;
/* Read the AGCCTRL_0 register, mask the AGC Mode field and return the value */ /* Read the AGCCTRL_0 register, mask the AGC Mode field and return the
* value
*/
spirit_reg_read(spirit, AGCCTRL0_BASE, &regval, 1); spirit_reg_read(spirit, AGCCTRL0_BASE, &regval, 1);
@ -3664,7 +3675,7 @@ enum spirit_agcmode_e
******************************************************************************/ ******************************************************************************/
int spirit_radio_enable_agcfreeze_steady(FAR struct spirit_library_s *spirit, int spirit_radio_enable_agcfreeze_steady(FAR struct spirit_library_s *spirit,
enum spirit_functional_state_e newstate) enum spirit_functional_state_e newstate)
{ {
uint8_t regval = 0; uint8_t regval = 0;
int ret; int ret;
@ -3758,7 +3769,7 @@ int spirit_radio_enable_agcfreeze_sync(FAR struct spirit_library_s *spirit,
******************************************************************************/ ******************************************************************************/
int spirit_radio_enable_agcfreeze_maxatten(FAR struct spirit_library_s *spirit, int spirit_radio_enable_agcfreeze_maxatten(FAR struct spirit_library_s *spirit,
enum spirit_functional_state_e newstate) enum spirit_functional_state_e newstate)
{ {
uint8_t regval = 0; uint8_t regval = 0;
int ret; int ret;
@ -3875,7 +3886,8 @@ uint16_t spirit_radio_get_agcmeasure_us(FAR struct spirit_library_s *spirit)
/* Calculates the measure time value to write in the register */ /* Calculates the measure time value to write in the register */
return (uint16_t)((12.0 / spirit->xtal_frequency) * (float)pow(2, measure) * 1e6); return (uint16_t)((12.0 / spirit->xtal_frequency) *
(float)pow(2, measure) * 1e6);
} }
/****************************************************************************** /******************************************************************************

View file

@ -9,28 +9,30 @@
* Adapted for NuttX by: * Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without
* are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are
* met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright
* this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright
* this list of conditions and the following disclaimer in the documentation * notice, this list of conditions and the following disclaimer in the
* and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors * 3. Neither the name of STMicroelectronics nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
******************************************************************************/ ******************************************************************************/
@ -205,7 +207,8 @@ int spirit_timer_setup_rxtimeout(FAR struct spirit_library_s *spirit,
* register. * register.
*/ */
return spirit_reg_write(spirit, TIMERS5_RX_TIMEOUT_PRESCALER_BASE, regval, 2); return spirit_reg_write(spirit,
TIMERS5_RX_TIMEOUT_PRESCALER_BASE, regval, 2);
} }
/****************************************************************************** /******************************************************************************
@ -238,7 +241,8 @@ int spirit_timer_set_rxtimeout(FAR struct spirit_library_s *spirit,
* register. * register.
*/ */
return spirit_reg_write(spirit, TIMERS5_RX_TIMEOUT_PRESCALER_BASE, regval, 2); return spirit_reg_write(spirit,
TIMERS5_RX_TIMEOUT_PRESCALER_BASE, regval, 2);
} }
/****************************************************************************** /******************************************************************************
@ -262,7 +266,8 @@ int spirit_timer_set_rxtimeout_counter(FAR struct spirit_library_s *spirit,
{ {
/* Writes the counter value for RX timeout in the corresponding register */ /* Writes the counter value for RX timeout in the corresponding register */
return spirit_reg_write(spirit, TIMERS4_RX_TIMEOUT_COUNTER_BASE, &counter, 1); return spirit_reg_write(spirit,
TIMERS4_RX_TIMEOUT_COUNTER_BASE, &counter, 1);
} }
/****************************************************************************** /******************************************************************************
@ -286,7 +291,8 @@ int spirit_timer_set_rxtimeout_prescaler(FAR struct spirit_library_s *spirit,
{ {
/* Writes the prescaler value for RX timeout in the corresponding register */ /* Writes the prescaler value for RX timeout in the corresponding register */
return spirit_reg_write(spirit, TIMERS5_RX_TIMEOUT_PRESCALER_BASE, &prescaler, 1); return spirit_reg_write(spirit,
TIMERS5_RX_TIMEOUT_PRESCALER_BASE, &prescaler, 1);
} }
/****************************************************************************** /******************************************************************************
@ -336,7 +342,8 @@ int spirit_timer_get_rxtimeout_setup(FAR struct spirit_library_s *spirit,
} }
xtal_frequency /= 1000.0; xtal_frequency /= 1000.0;
*mstimeout = (float)((regval[0] + 1) * regval[1] * (1210.0 / xtal_frequency)); *mstimeout = (float)((regval[0] + 1) *
regval[1] * (1210.0 / xtal_frequency));
} }
return ret; return ret;
@ -550,7 +557,8 @@ int spirit_timer_setup_wakeuptimer_reload(FAR struct spirit_library_s *spirit,
* corresponding register * corresponding register
*/ */
return spirit_reg_write(spirit, TIMERS1_LDC_RELOAD_PRESCALER_BASE, regval, 2); return spirit_reg_write(spirit,
TIMERS1_LDC_RELOAD_PRESCALER_BASE, regval, 2);
} }
/****************************************************************************** /******************************************************************************
@ -588,7 +596,8 @@ int spirit_timer_wakeuptimer_reload(FAR struct spirit_library_s *spirit,
* corresponding register. * corresponding register.
*/ */
return spirit_reg_write(spirit, TIMERS1_LDC_RELOAD_PRESCALER_BASE, regval, 2); return spirit_reg_write(spirit,
TIMERS1_LDC_RELOAD_PRESCALER_BASE, regval, 2);
} }
/****************************************************************************** /******************************************************************************
@ -611,14 +620,16 @@ int spirit_timer_wakeuptimer_reload(FAR struct spirit_library_s *spirit,
* *
******************************************************************************/ ******************************************************************************/
int spirit_timer_set_wakeuptimer_reloadcounter(FAR struct spirit_library_s *spirit, int spirit_timer_set_wakeuptimer_reloadcounter(
uint8_t counter) FAR struct spirit_library_s *spirit,
uint8_t counter)
{ {
/* Write the counter value for reload Wake_Up timer in the corresponding /* Write the counter value for reload Wake_Up timer in the corresponding
* register. * register.
*/ */
return spirit_reg_write(spirit, TIMERS0_LDC_RELOAD_COUNTER_BASE, &counter, 1); return spirit_reg_write(spirit,
TIMERS0_LDC_RELOAD_COUNTER_BASE, &counter, 1);
} }
/****************************************************************************** /******************************************************************************
@ -641,14 +652,16 @@ int spirit_timer_set_wakeuptimer_reloadcounter(FAR struct spirit_library_s *spir
* *
******************************************************************************/ ******************************************************************************/
int spirit_timer_set_wakeuptimer_reloadprescaler(FAR struct spirit_library_s *spirit, int spirit_timer_set_wakeuptimer_reloadprescaler(
uint8_t prescaler) FAR struct spirit_library_s *spirit,
uint8_t prescaler)
{ {
/* Writes the prescaler value for reload Wake_Up timer in the corresponding /* Writes the prescaler value for reload Wake_Up timer in the corresponding
* register. * register.
*/ */
return spirit_reg_write(spirit, TIMERS1_LDC_RELOAD_PRESCALER_BASE, &prescaler, 1); return spirit_reg_write(spirit,
TIMERS1_LDC_RELOAD_PRESCALER_BASE, &prescaler, 1);
} }
/****************************************************************************** /******************************************************************************
@ -675,10 +688,11 @@ int spirit_timer_set_wakeuptimer_reloadprescaler(FAR struct spirit_library_s *sp
* *
******************************************************************************/ ******************************************************************************/
int spirit_timer_get_wakeuptimer_reload_setup(FAR struct spirit_library_s *spirit, int spirit_timer_get_wakeuptimer_reload_setup(
FAR float *reload, FAR struct spirit_library_s *spirit,
FAR uint8_t *counter, FAR float *reload,
FAR uint8_t *prescaler) FAR uint8_t *counter,
FAR uint8_t *prescaler)
{ {
uint8_t regval[2]; uint8_t regval[2];
float rco_freq; float rco_freq;
@ -688,7 +702,8 @@ int spirit_timer_get_wakeuptimer_reload_setup(FAR struct spirit_library_s *spiri
/* Reads the reload Wake_Up timer registers value */ /* Reads the reload Wake_Up timer registers value */
ret = spirit_reg_read(spirit, TIMERS1_LDC_RELOAD_PRESCALER_BASE, regval, 2); ret = spirit_reg_read(spirit,
TIMERS1_LDC_RELOAD_PRESCALER_BASE, regval, 2);
if (ret >= 0) if (ret >= 0)
{ {
/* Returns values */ /* Returns values */
@ -753,7 +768,8 @@ uint16_t spirit_timer_get_rcofrequency(FAR struct spirit_library_s *spirit)
* Computes the values of the wakeup timer counter and prescaler from the * Computes the values of the wakeup timer counter and prescaler from the
* user time expressed in millisecond. The prescaler and the counter values * user time expressed in millisecond. The prescaler and the counter values
* are computed maintaining the prescaler value as small as possible in * are computed maintaining the prescaler value as small as possible in
* order to obtain the best resolution, and in the meantime minimizing the error. * order to obtain the best resolution, and in the meantime minimizing the
* error.
* *
* Input Parameters: * Input Parameters:
* spirit - Reference to a Spirit library state structure instance * spirit - Reference to a Spirit library state structure instance
@ -787,8 +803,8 @@ void spirit_timer_calc_wakeup_values(FAR struct spirit_library_s *spirit,
n = (uint32_t)(desired * rco_freq); n = (uint32_t)(desired * rco_freq);
/* check if it is possible to reach that target with prescaler and counter of /* check if it is possible to reach that target with prescaler and counter
* spirit1. * of spirit1.
*/ */
if (n / 0xff > 0xfd) if (n / 0xff > 0xfd)
@ -811,7 +827,8 @@ void spirit_timer_calc_wakeup_values(FAR struct spirit_library_s *spirit,
if ((*counter) <= 254) if ((*counter) <= 254)
{ {
if (S_ABS((float)((*counter) + 1) * (*prescaler) / rco_freq - desired) < err) if (S_ABS((float)((*counter) + 1) *
(*prescaler) / rco_freq - desired) < err)
{ {
(*counter)++; (*counter)++;
} }
@ -940,9 +957,10 @@ void spirit_timer_calc_rxtimeout_values(FAR struct spirit_library_s *spirit,
* *
******************************************************************************/ ******************************************************************************/
int spirit_timer_set_rxtimeout_stopcondition(FAR struct spirit_library_s *spirit, int spirit_timer_set_rxtimeout_stopcondition(
enum spirit_rxtimeout_stopcondition_e FAR struct spirit_library_s *spirit,
stopcondition) enum spirit_rxtimeout_stopcondition_e
stopcondition)
{ {
uint8_t regval[2]; uint8_t regval[2];
int ret; int ret;