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-05 07:31:45 -05:00
committed by Xiang Xiao
parent dd1d980c3a
commit e1d361eddf
75 changed files with 1883 additions and 1518 deletions
+2 -1
View File
@@ -1559,7 +1559,8 @@ static int mcp2515_ioctl(FAR struct can_dev_s *dev, int cmd,
* PHSEG1 == PHSEG2 (PHSEG2 = TSEG2)
*
* 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
*
*/
+14 -7
View File
@@ -93,7 +93,8 @@
*/
/* 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_COM_IEN_REG (0x02 << 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_COLL_REG (0x0E << 1) /* bit position of first bit-collision detected */
/* 0x0F - reserved for future use */
/* 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_TX_MODE_REG (0x12 << 1) /* defines transmission 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 */
/* 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_REGL (0x22 << 1) /* shows the LSB values of CRC calc. */
/* 0x23 - reserved for future use */
@@ -146,7 +150,8 @@
#define MFRC522_TCOUNT_VAL_REGL (0x2F << 1) /* shows the 16-bit timer value */
/* 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_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 */
@@ -172,6 +177,7 @@
# 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_SOFTRST_CMD 0x0F /* resets the MFRC522 */
#define MFRC522_POWER_DOWN (1 << 4) /* soft power-down mode entered */
#define MFRC522_RCV_OFF (1 << 5) /* turns off analog part of receiver */
@@ -212,11 +218,11 @@
/* 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_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_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_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_A671 (0x2) /* A671h 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_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 */
@@ -352,7 +359,7 @@
/* 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 */
/* Section 9.3.2.10: DemodReg register */
+27 -32
View File
@@ -122,7 +122,8 @@
* EPF: 0 65k color format for RGB interface, not used set to default
* 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.
*/
@@ -131,7 +132,6 @@
#define ILI9341_IFCTL_PARAM2 ILI9341_IFCTL_EPF | ILI9341_IFCTL_MDT
/* Parameter 3: 0x0000/0x0020
*
* ENDIAN: 0/1 Depending on endian mode of the mcu?
@@ -153,7 +153,6 @@
#define ILI9341_IFCTL_PARAM3 ILI9341_IFCTL_RIM | ILI9341_IFCTL_RM | \
ILI9341_IFCTL_DM | ILI9341_IFCTL_ENDIAN
/* Memory access control (MADCTL) */
/* Landscape: 00100000 / 00101000 / h28
@@ -299,13 +298,11 @@
#define ILI9341_PIXSET_18BITMCU_PARAM1 (ILI9341_PIXSET_18BITDPI | \
ILI9341_PIXSET_18BITDBI)
/* General fix display resolution */
#define ILI9341_XRES 240
#define ILI9341_YRES 320
/* Validate configuration */
#if CONFIG_LCD_ILI9341_NINTERFACES < 1
@@ -314,7 +311,6 @@
# undef CONFIG_LCD_ILI9341_IFACE1
#endif
/* First LCD display */
#ifdef CONFIG_LCD_ILI9341_IFACE0
@@ -416,7 +412,6 @@ struct ili9341_dev_s
uint8_t power;
};
/****************************************************************************
* Private Function Protototypes
****************************************************************************/
@@ -462,9 +457,10 @@ static int ili9341_getrun1(fb_coord_t row, fb_coord_t col,
/* lcd configuration */
static int ili9341_getvideoinfo(FAR struct lcd_dev_s *dev,
FAR struct fb_videoinfo_s *vinfo);
static int ili9341_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno,
FAR struct lcd_planeinfo_s *pinfo);
FAR struct fb_videoinfo_s *vinfo);
static int ili9341_getplaneinfo(FAR struct lcd_dev_s *dev,
unsigned int planeno,
FAR struct lcd_planeinfo_s *pinfo);
/* 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)
{
if (dev->orient == ILI9341_MADCTL_LANDSCAPE_PARAM1 ||
dev->orient == ILI9341_MADCTL_RLANDSCAPE_PARAM1)
dev->orient == ILI9341_MADCTL_RLANDSCAPE_PARAM1)
{
return ILI9341_YRES;
}
@@ -549,7 +545,6 @@ static inline uint16_t ili9341_getxres(FAR struct ili9341_dev_s *dev)
return ILI9341_XRES;
}
/****************************************************************************
* Name: ili9341_getyres
*
@@ -577,7 +572,6 @@ static inline uint16_t ili9341_getyres(FAR struct ili9341_dev_s *dev)
return ILI9341_YRES;
}
/****************************************************************************
* 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,
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 */
@@ -613,7 +608,6 @@ static void ili9341_selectarea(FAR struct ili9341_lcd_s *lcd,
lcd->sendparam(lcd, (y1 & 0xff));
}
/****************************************************************************
* 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);
/* Check if position outside of area */
if (col + npixels > ili9341_getxres(dev) || row > ili9341_getyres(dev))
{
return -EINVAL;
@@ -673,7 +668,6 @@ static int ili9341_putrun(int devno, fb_coord_t row, fb_coord_t col,
return OK;
}
/****************************************************************************
* 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);
/* Check if position outside of area */
if (col + npixels > ili9341_getxres(dev) || row > ili9341_getyres(dev))
{
return -EINVAL;
@@ -785,7 +780,8 @@ static int ili9341_hwinitialize(FAR struct ili9341_dev_s *dev)
lcd->sendcmd(lcd, ILI9341_SOFTWARE_RESET);
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->sendparam(lcd, dev->orient);
@@ -828,7 +824,6 @@ static int ili9341_hwinitialize(FAR struct ili9341_dev_s *dev)
return OK;
}
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -869,7 +864,6 @@ static int ili9341_putrun1(fb_coord_t row, fb_coord_t col,
}
#endif
/****************************************************************************
* Name: ili9341_getrunx
*
@@ -908,7 +902,6 @@ static int ili9341_getrun1(fb_coord_t row, fb_coord_t col,
# endif
#endif
/****************************************************************************
* 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,
FAR struct lcd_planeinfo_s *pinfo)
static int ili9341_getplaneinfo(FAR struct lcd_dev_s *dev,
unsigned int planeno,
FAR struct lcd_planeinfo_s *pinfo)
{
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
*
* 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.
*
* Input Parameters:
@@ -1022,7 +1017,8 @@ static int ili9341_getpower(FAR struct lcd_dev_s *dev)
* Name: ili9341_setpower
*
* 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.
*
* Input Parameters:
@@ -1119,7 +1115,6 @@ static int ili9341_setcontrast(struct lcd_dev_s *dev, unsigned int contrast)
return -ENOSYS;
}
/****************************************************************************
* Name: ili9341_initialize
*
@@ -1131,15 +1126,15 @@ static int ili9341_setcontrast(struct lcd_dev_s *dev, unsigned int contrast)
*
* Input Parameters:
*
* lcd - A reference to the platform specific driver instance to control the
* ili9341 display driver.
* lcd - A reference to the platform specific driver instance to control
* the ili9341 display driver.
* devno - A value in the range of 0 through CONFIG_ILI9341_NINTERFACES-1.
* This allows support for multiple LCD devices.
*
* Returned Value:
*
* On success, this function returns a reference to the LCD driver object for
* the specified LCD driver. NULL is returned on any failure.
* On success, this function returns a reference to the LCD driver object
* for the specified LCD driver. NULL is returned on any failure.
*
****************************************************************************/
@@ -1186,9 +1181,9 @@ FAR struct lcd_dev_s *
*
* Description:
* 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
* covers the entire display can be very slow. Here the display is cleared by
* simply setting all GRAM memory to the specified color.
* clearing the display in the normal way by writing a sequences of runs
* that covers the entire display can be very slow. Here the display is
* cleared by simply setting all GRAM memory to the specified color.
*
* Input Parameters:
* dev - A reference to the lcd driver structure
+5 -5
View File
@@ -396,7 +396,7 @@ struct ssd1351_dev_s
*/
#ifdef CONFIG_SSD1351_SPI3WIRE
uint16_t rowbuffer[SSD1351_STRIDE+1];
uint16_t rowbuffer[SSD1351_STRIDE + 1];
#endif
};
@@ -617,12 +617,12 @@ static void ssd1351_write(FAR struct ssd1351_dev_s *priv, uint8_t cmd,
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 */
SPI_SNDBLOCK(priv->spi, priv->rowbuffer, datlen+1);
SPI_SNDBLOCK(priv->spi, priv->rowbuffer, datlen + 1);
}
#elif defined(CONFIG_SSD1351_SPI4WIRE)
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 */
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);
/* Select and lock the device */
@@ -768,7 +768,7 @@ static int ssd1351_getrun(fb_coord_t row, fb_coord_t col,
/* Sanity check */
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);
/* Select and lock the device */
+5 -5
View File
@@ -70,9 +70,9 @@
/* Single-Byte Instructions */
/* Because all single byte instructions are fixed length with no optional
* parameters, it is possible to execute any instruction immediately following
* the execution of any single byte instruction without deasserting the chip
* select line in between.
* parameters, it is possible to execute any instruction immediately
* following the execution of any single byte instruction without deasserting
* the chip select line in between.
*/
#define ENC_B0SEL (0xc0) /* Selects SFR Bank 0 */
@@ -342,8 +342,8 @@
/* Unbanked Register Addresses */
#if 0
/* Disabled to prevent accidental use. All unbanked operations are implemented
* using the specific manipulation commands.
/* Disabled to prevent accidental use. All unbanked operations are
* implemented using the specific manipulation commands.
*/
#define ENC_EGPDATA 0x80
#define ENC_ERXDATA 0x82
+6 -3
View File
@@ -320,11 +320,13 @@ static int aht10_read_values(FAR struct aht10_dev_s *priv, FAR int *temp,
/* 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). */
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);
@@ -431,7 +433,8 @@ static int aht10_close(FAR struct file *filep)
* 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 aht10_dev_s *priv = inode->i_private;
+23 -11
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);
static int as5048b_writeu8(FAR struct as5048b_dev_s *priv, uint8_t regaddr,
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);
static int as5048b_readzero(FAR struct as5048b_dev_s *priv,
FAR 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,
FAR uint8_t *diag);
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_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);
/* 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)
{
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;
@@ -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;
@@ -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;
@@ -529,7 +537,9 @@ static int as5048b_ioctl(FAR struct qe_lowerhalf_s *lower, int cmd,
}
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:
{
@@ -592,13 +602,15 @@ static int as5048b_ioctl(FAR struct qe_lowerhalf_s *lower, int cmd,
* addr - The I2C address of the AS5048B.
*
* 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.
*
****************************************************************************/
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;
+2 -2
View File
@@ -481,7 +481,7 @@ int as726x_register(FAR const char *devpath, FAR struct i2c_master_s *i2c)
}
value = ret;
value &= 0b11001111; /* Clear GAIN bits */
value &= 0b11001111; /* Clear GAIN bits */
value |= (AS726X_GAIN << 4); /* Set GAIN bits with user's choice */
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 &= 0b11110011; /* Clear BANK bits */
value &= 0b11110011; /* Clear BANK bits */
value |= (AS726X_MEASURMENT_MODE << 2); /* Set BANK bits with user's
* choice */
+15 -8
View File
@@ -113,9 +113,11 @@ struct ina3221_dev_s
/* I2C Helpers */
static int ina3221_write16(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,
static int ina3221_write16(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);
static int ina3221_readpower(FAR struct ina3221_dev_s *priv,
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];
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].flags = 0;
msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].buffer = &start_register_address;
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].flags = reading ? I2C_M_READ : 0;
msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].addr =
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].length = data_length;
@@ -399,7 +404,8 @@ static int ina3221_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
*
* Input Parameters:
* 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
* configuration mask.
*
@@ -420,7 +426,8 @@ int ina3221_register(FAR const char *devpath, FAR struct i2c_master_s *i2c,
/* 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)
{
snerr("ERROR: Failed to allocate instance\n");
+51 -32
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,
uint8_t interrupts);
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);
#ifdef CONFIG_LIS2DH_DRIVER_SELFTEST
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)
{
/* Check chip identification, in the future several more compatible parts
* may be added here.
/* Check chip identification, in the future several more compatible
* parts may be added here.
*/
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 */
{
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;
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
* latched configuration.
/* Make sure interrupt will get cleared (by reading this register) in case
* of latched configuration.
*/
buf = 0;
@@ -491,8 +493,8 @@ static ssize_t lis2dh_read(FAR struct file *filep, FAR char *buffer,
ptr->header.int1_occurred = false;
}
/* Make sure interrupt will get cleared (by reading this register) in case of
* latched configuration.
/* Make sure interrupt will get cleared (by reading this register) in case
* of latched configuration.
*/
buf = 0;
@@ -574,7 +576,8 @@ static int lis2dh_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
/* Write to the configuration registers. */
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
* case of latched configuration.
@@ -757,10 +760,10 @@ static void lis2dh_notify(FAR struct lis2dh_dev_s *priv)
int i;
/* If there are threads waiting on poll() for LIS2DH data to become available,
* then wake them up now. NOTE: we wake up all waiting threads because we
* do not know that they are going to do. If they all try to read the data,
* then some make end up blocking after all.
/* If there are threads waiting on poll() for LIS2DH data to become
* available, then wake them up now. NOTE: we wake up all waiting threads
* because we do not know that they are going to do. If they all try to
* read the data, then some make end up blocking after all.
*/
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 */
if ((i <= 0x1e) || (i >= 0x27 && i <= 0x2d) || (i == 0x2f) || (i == 0x31))
if ((i <= 0x1e) || (i >= 0x27 && i <= 0x2d) ||
(i == 0x2f) || (i == 0x31))
{
continue;
}
@@ -887,7 +891,8 @@ static int lis2dh_write_register(FAR struct lis2dh_dev_s *priv, uint8_t reg,
* reg - register to read
*
* 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)
@@ -1266,9 +1271,12 @@ static FAR const struct lis2dh_vector_s *
if (lis2dh_access(dev, ST_LIS2DH_OUT_X_L_REG, retval,
sizeof(retval)) == sizeof(retval))
{
dev->vector_data.x = lis2dh_raw_convert_to_12bit(retval[1], retval[0]);
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]);
dev->vector_data.x = lis2dh_raw_convert_to_12bit(retval[1],
retval[0]);
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;
}
@@ -1422,7 +1430,8 @@ static unsigned int lis2dh_get_fifo_readings(FAR struct lis2dh_dev_s *priv,
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",
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)
{
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;
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)
{
@@ -1817,9 +1829,12 @@ static int lis2dh_setup(FAR struct lis2dh_dev_s * dev,
/* CTRL_REG5 */
value = dev->setup->reboot | dev->setup->fifo_enable | dev->setup->int1_latch |
dev->setup->int1_4d_enable | dev->setup->int2_latch |
dev->setup->int2_4d_enable;
value = dev->setup->reboot |
dev->setup->fifo_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)
{
goto error;
@@ -1915,9 +1930,12 @@ static int lis2dh_setup(FAR struct lis2dh_dev_s * dev,
/* CLICK_CFG */
value = dev->setup->z_double_click_enable | dev->setup->z_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;
value = dev->setup->z_double_click_enable |
dev->setup->z_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)
{
goto error;
@@ -2020,10 +2038,11 @@ error:
*
* Input Parameters:
* 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
* addr - The I2C address of the LIS2DH. The base I2C address of the LIS2DH
* is 0x18. Bit 0 can be controlled via SA0 pad - when connected to
* voltage supply the address is 0x19.
* i2c - An instance of the I2C interface to use to communicate with
* LIS2DH
* addr - The I2C address of the LIS2DH. The base I2C address of the
* 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
*
* Returned Value:
+6 -3
View File
@@ -105,7 +105,8 @@ static ssize_t lm92_read(FAR struct file *filep, FAR char *buffer,
size_t buflen);
static ssize_t lm92_write(FAR struct file *filep, FAR const char *buffer,
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
@@ -215,7 +216,8 @@ static int lm92_readb16(FAR struct lm92_dev_s *priv, uint8_t regaddr,
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.
*/
@@ -230,7 +232,8 @@ static int lm92_readb16(FAR struct lm92_dev_s *priv, uint8_t regaddr,
* Name: lm92_writeb16
*
* 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)
*
****************************************************************************/
+24 -6
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_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_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_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_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_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_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_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_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_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_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_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_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 */
@@ -303,6 +308,7 @@
#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_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_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_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_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 */
@@ -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_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_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_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_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_TEMP_COMP (1 << 7) /* Temperature compensation enable */
/* Magnetometer control register 2 */
#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_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_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_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_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_I2C_DISABLE (1 << 7) /* Disable I2C interface */
@@ -450,6 +461,7 @@
/* Magnetometer control register 4 */
#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_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 */
@@ -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,
uint8_t clearbits, uint8_t setbits)
static int lsm9ds1_modifyreg8(FAR struct lsm9ds1_dev_s *priv,
uint8_t regaddr,
uint8_t clearbits,
uint8_t setbits)
{
int ret;
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)
{
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)
{
/* 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)
{
/* 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)
{
/* Sanity check */
+15 -9
View File
@@ -81,7 +81,8 @@ struct ltc4151_dev_s
/* 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);
static int ltc4151_readpower(FAR struct ltc4151_dev_s *priv,
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];
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].flags = 0;
msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].buffer = &start_register_address;
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].buffer = register_value;
msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].length = data_length;
@@ -245,7 +248,8 @@ static int ltc4151_close(FAR struct file *filep)
* 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 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:
* 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
* addr - The I2C address of the LTC4151. The base I2C address of the LTC4151
* is 0x6f. Bits 0-3 can be controlled to get 10 unique addresses from 0x66
* through 0x6f.
* i2c - An instance of the I2C interface to use to communicate with
* LTC4151
* addr - The I2C address of the LTC4151. The base I2C address of the
* LTC4151 is 0x6f. Bits 0-3 can be controlled to get 10 unique
* addresses from 0x66 through 0x6f.
*
* Returned Value:
* 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 */
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)
{
snerr("ERROR: Failed to allocate instance\n");
+6 -2
View File
@@ -142,7 +142,9 @@ struct ms58xx_dev_s
/* 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 */
@@ -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 n_rem;
+21 -7
View File
@@ -159,7 +159,7 @@ static const struct dfu_cfgdesc_s g_dfu_cfgdesc =
.ifno = 0,
.alt = 0,
.neps = 0,
.classid = 0xFE,
.classid = 0xfe,
.subclass = 0x01,
.protocol = 0x01, /* DFU runtime protocol */
.iif = 0
@@ -167,10 +167,22 @@ static const struct dfu_cfgdesc_s g_dfu_cfgdesc =
{
.len = sizeof(struct dfu_funcdesc_s),
.type = 0x21,
.attributes = 0x0B,
.detach_timeout = { 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) }
.attributes = 0x0b,
.detach_timeout =
{
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++ = MSBYTE(namelen);
payload += convert_to_utf16(payload, propname); /* bPropertyName */
*payload++ = 0; /* Null terminator */
*payload++ = 0;
*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)
{
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)
@@ -395,7 +408,8 @@ static int usbclass_setup(FAR struct usbdevclass_driver_s *driver,
* 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;
}
else if (ctrl->req == USB_REQ_DFU_GETSTATUS)
+4 -3
View File
@@ -34,7 +34,6 @@
*
****************************************************************************/
#ifndef __NUTTX_DRIVERS_USBDEV_RNDIS_STD_H
#define __NUTTX_DRIVERS_USBDEV_RNDIS_STD_H
@@ -44,8 +43,10 @@
/* Definitions for Microsoft RNDIS protocol.
* Documentation:
* https://docs.microsoft.com/en-us/windows-hardware/drivers/network/remote-ndis--rndis-2
* https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/WinArchive/[MS-RNDIS].pdf
* https://docs.microsoft.com/en-us/windows-hardware/
* drivers/network/remote-ndis--rndis-2
* https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/
* WinArchive/[MS-RNDIS].pdf
*/
#define RNDIS_MAJOR_VERSION 1
+9 -3
View File
@@ -154,7 +154,9 @@ static int usbhost_connect(FAR struct usbhost_class_s *usbclass,
FAR const uint8_t *configdesc, int desclen);
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
@@ -913,11 +915,15 @@ static FAR struct usbhost_class_s *
priv->usbclass.connect = usbhost_connect;
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;
/* Initialize semaphores (this works okay in the interrupt context) */
/* Initialize semaphores
* (this works okay in the interrupt context)
*/
nxsem_init(&priv->exclsem, 0, 1);
+14 -8
View File
@@ -489,7 +489,8 @@ static int fusb301_open(FAR struct file *filep)
ret = fusb301_getreg(priv, FUSB301_DEV_ID_REG);
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;
}
else
@@ -529,7 +530,9 @@ static int fusb301_close(FAR struct file *filep)
* 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 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
****************************************************************************/
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 fusb301_dev_s *priv;
@@ -755,10 +760,10 @@ static void fusb301_notify(FAR struct fusb301_dev_s *priv)
int i;
/* If there are threads waiting on poll() for FUSB301 data to become available,
* then wake them up now. NOTE: we wake up all waiting threads because we
* do not know that they are going to do. If they all try to read the data,
* then some make end up blocking after all.
/* If there are threads waiting on poll() for FUSB301 data to become
* available, then wake them up now. NOTE: we wake up all waiting threads
* because we do not know that they are going to do. If they all try to
* read the data, then some make end up blocking after all.
*/
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 */
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)
{
fusb301_err("ERROR: Failed to allocate instance\n");
+4 -2
View File
@@ -660,7 +660,8 @@ static int fusb303_open(FAR struct file *filep)
ret = fusb303_read_device_id(priv, &dev_id, &dev_type);
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;
}
else
@@ -1004,7 +1005,8 @@ int fusb303_register(FAR const char *devpath, FAR struct i2c_master_s *i2c,
/* 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)
{
fusb303_err("ERROR: Failed to allocate instance\n");
+16 -11
View File
@@ -28,19 +28,19 @@
* Public Data
****************************************************************************/
/** Settings for 868 MHz, GFSK at 100kbps
/* Settings for 868 MHz, GFSK at 100kbps
*
* ISM Region 1 (Europe) only, Band 868870 MHz
*
* Frequency ERP Duty Cycle Bandwidth Remarks
* 868 868.6 MHz +14 dBm < 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
* protocol required
* 869.4 869.65 MHz +27 dBm < 10% < 25 kHz Channels may be
* combined to one
* high speed channel
* 869.7 -870 MHz +7 dBm No limits No limits
* Frequency ERP Duty Cycle Bandwidth Remarks
* 868 868.6 MHz +14 dBm < 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
* protocol required
* 869.4 869.65 MHz +27 dBm < 10% < 25 kHz Channels may be
* combined to one
* high speed channel
* 869.7 -870 MHz +7 dBm No limits No limits
*
* Deviation = 46.142578
* Base frequency = 867.999985
@@ -57,7 +57,8 @@
* Data rate = 99.9069
* RX filter BW = 210.937500
* 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
* Packet length = 62
* Device address = 00
@@ -109,3 +110,7 @@ const struct c1101_rfsettings_s cc1101_rfsettings_ISM1_868MHzGFSK100kbps =
0x03, 0x0f, 0x1e, 0x27, 0x67, 0x50, 0x81, 0xc2
}
};
/****************************************************************************
* Public Functions
****************************************************************************/
+4
View File
@@ -113,3 +113,7 @@ const struct c1101_rfsettings_s cc1101_rfsettings_ISM2_433MHzMSK500kbps =
0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}
};
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -105,3 +105,7 @@ const struct c1101_rfsettings_s cc1101_rfsettings_ISM2_905MHzGFSK250kbps =
0x03, 0x0e, 0x1e, 0x27, 0x39, 0x8e, 0xcd, 0xc0
}
};
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -66,7 +66,8 @@ struct __attribute__((packed)) bcmf_event_s
/* Event callback handler */
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
@@ -50,16 +50,18 @@
/* Send safe cdc request */
int bcmf_cdc_iovar_request(FAR struct bcmf_dev_s *priv, uint32_t ifidx,
bool set, char *name, uint8_t *data, uint32_t *len);
int bcmf_cdc_iovar_request(FAR struct bcmf_dev_s *priv,
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,
uint32_t cmd, uint8_t *data, uint32_t *len);
/* Send cdc request without locking control_mutex */
int bcmf_cdc_iovar_request_unsafe(FAR struct bcmf_dev_s *priv, uint32_t ifidx,
bool set, char *name, uint8_t *data, uint32_t *len);
int bcmf_cdc_iovar_request_unsafe(FAR struct bcmf_dev_s *priv,
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 */
@@ -91,3 +91,7 @@ const struct bcmf_sdio_chip bcmf_43362_config_sdio =
.firmware_image_size = (FAR unsigned int *)&bcm43362_firmware_image_len,
#endif
};
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -97,3 +97,7 @@ const struct bcmf_sdio_chip bcmf_43438_config_sdio =
.clm_blob_image_size = (FAR unsigned int *)&ap6212_clm_blob_len,
#endif
};
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -36,11 +36,19 @@
#ifndef __DRIVERS_WIRELESS_IEEE80211_BCMF_CORE_H
#define __DRIVERS_WIRELESS_IEEE80211_BCMF_CORE_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <stdint.h>
#include <stdbool.h>
#include "bcmf_sdio.h"
/****************************************************************************
* Public Functions Prototypes
****************************************************************************/
int bcmf_read_sbreg(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address,
uint8_t *reg, unsigned int len);
File diff suppressed because it is too large Load Diff
@@ -36,8 +36,16 @@
#ifndef __DRIVERS_WIRELESS_IEEE80211_BCMF_NETDEV_H
#define __DRIVERS_WIRELESS_IEEE80211_BCMF_NETDEV_H
/****************************************************************************
* Included Files
****************************************************************************/
#include "bcmf_driver.h"
/****************************************************************************
* Public Functions Prototypes
****************************************************************************/
int bcmf_netdev_register(FAR struct bcmf_dev_s *priv);
void bcmf_netdev_notify_rx(FAR struct bcmf_dev_s *priv);
@@ -7,19 +7,27 @@
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
****************************************************************************/
#ifndef __DRIVERS_WIRELESS_IEEE80211_BCMF_SDIO_CORE_H
#define __DRIVERS_WIRELESS_IEEE80211_BCMF_SDIO_CORE_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <stdint.h>
/****************************************************************************
* Public Data
****************************************************************************/
#ifndef PAD
#define _PADLINE(line) pad ## line
#define _XSTR(line) _PADLINE(line)
@@ -143,6 +151,7 @@ struct sdpcmd_regs
uint32_t biststatus; /* rev8 */
/* PCMCIA access */
uint16_t pcmciamesportaladdr; /* 0x010, rev8 */
uint16_t PAD[1];
uint16_t pcmciamesportalmask; /* rev8 */
@@ -153,6 +162,7 @@ struct sdpcmd_regs
uint16_t PAD[1];
/* interrupt */
uint32_t intstatus; /* 0x020, rev8 */
uint32_t hostintmask; /* rev8 */
uint32_t intmask; /* rev8 */
@@ -166,20 +176,24 @@ struct sdpcmd_regs
uint32_t tohostmailboxdata; /* rev8 */
/* synchronized access to registers in SDIO clock domain */
uint32_t sdioaccess; /* 0x050, rev8 */
uint32_t PAD[3];
/* PCMCIA frame control */
uint8_t pcmciaframectrl; /* 0x060, rev8 */
uint8_t PAD[3];
uint8_t pcmciawatermark; /* rev8 */
uint8_t PAD[155];
/* interrupt batching control */
uint32_t intrcvlazy; /* 0x100, rev8 */
uint32_t PAD[3];
/* counters */
uint32_t cmd52rd; /* 0x110, rev8 */
uint32_t cmd52wr; /* rev8 */
uint32_t cmd53rd; /* rev8 */
@@ -199,13 +213,16 @@ struct sdpcmd_regs
uint32_t PAD[128]; /* DMA engines */
/* SDIO/PCMCIA CIS region */
char cis[512]; /* 0x400-0x5ff, rev6 */
/* PCMCIA function control registers */
char pcmciafcr[256]; /* 0x600-6ff, rev6 */
uint16_t PAD[55];
/* PCMCIA backplane access */
uint16_t backplanecsr; /* 0x76E, rev6 */
uint16_t backplaneaddr0; /* rev6 */
uint16_t backplaneaddr1; /* rev6 */
@@ -218,10 +235,15 @@ struct sdpcmd_regs
uint16_t PAD[31];
/* sprom "size" & "blank" info */
uint16_t spromstatus; /* 0x7BE, rev2 */
uint32_t PAD[464];
uint16_t PAD[0x80];
};
/****************************************************************************
* Public Functions Prototypes
****************************************************************************/
#endif /* __DRIVERS_WIRELESS_IEEE80211_BCMF_SDIO_CORE_H */
@@ -7,11 +7,11 @@
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
****************************************************************************/
@@ -140,7 +140,6 @@
#define SFC_ABORTALL (1 << 3)
/* ChipClockCSR (ALP/HT ctl/status) */
#define SBSDIO_FUNC1_CHIPCLKCSR 0x1000E
@@ -242,7 +241,9 @@
#define SBSDIO_SBADDRLOW_MASK 0x80 /* Valid bits in SBADDRLOW */
#define SBSDIO_SBADDRMID_MASK 0xff /* Valid bits in SBADDRMID */
#define SBSDIO_SBADDRHIGH_MASK 0xffU /* Valid bits in SBADDRHIGH */
/* Address bits from SBADDR regs */
#define SBSDIO_SBWINDOW_MASK 0xffff8000
#endif /* __DRIVERS_WIRELESS_IEEE80211_BCMF_SDIO_REGS_H */
@@ -205,7 +205,8 @@ int bcmf_sdpcm_readframe(FAR struct bcmf_dev_s *priv)
/* 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)
{
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;
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 */
@@ -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,
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,
unsigned int len, bool block,
@@ -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 reg = RF23X_SPI_FRAME_WRITE;
@@ -432,7 +433,9 @@ static int at86rf23x_set_trxstate(FAR struct at86rf23x_dev_s *dev,
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) &&
(status != TRX_STATUS_RXON) &&
@@ -614,7 +617,9 @@ static int at86rf23x_set_trxstate(FAR struct at86rf23x_dev_s *dev,
break;
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);
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;
/* 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 */
@@ -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,
FAR struct ieee802154_packet_s *packet)
static int
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;
@@ -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;
}
@@ -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_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,
FAR const uint8_t *saddr);
@@ -97,10 +97,10 @@ static void mrf24j40_irqwork_txnorm(FAR struct mrf24j40_radio_s *dev)
if (reg & MRF24J40_TXSTAT_TXNSTAT)
{
/* The number of retries of the most recent transmission is contained in the
* TXNRETRY (TXSTAT 0x24<7:6>) bits. The CCAFAIL (TXSTAT 0x24<5>) bit = 1
* indicates if the failed transmission was due to the channel busy
* (CSMA-CA timed out).
/* The number of retries of the most recent transmission is contained
* in the TXNRETRY (TXSTAT 0x24<7:6>) bits.
* The CCAFAIL (TXSTAT 0x24<5>) bit = 1 indicates if the failed
* transmission was due to the channel busy (CSMA-CA timed out).
*/
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)
{
FAR struct ieee802154_primitive_s *primitive;
FAR struct ieee802154_data_ind_s *ind;
@@ -344,8 +343,8 @@ void mrf24j40_irqworker(FAR void *arg)
if ((intstat & MRF24J40_INTSTAT_HSYMTMRIF))
{
/* As of now the only use for the MAC timer is for delayed transactions.
* Therefore, all we do here is trigger the TX norm FIFO
/* As of now the only use for the MAC timer is for delayed
* transactions. Therefore, all we do here is trigger the TX norm FIFO
*/
mrf24j40_norm_trigger(dev);
@@ -366,21 +365,21 @@ void mrf24j40_irqworker(FAR void *arg)
if ((intstat & MRF24J40_INTSTAT_TXNIF))
{
/* A packet was transmitted or failed*/
/* A packet was transmitted or failed */
mrf24j40_irqwork_txnorm(dev);
}
if ((intstat & MRF24J40_INTSTAT_TXG1IF))
{
/* A packet was transmitted or failed*/
/* A packet was transmitted or failed */
mrf24j40_irqwork_txgts(dev, 0);
}
if ((intstat & MRF24J40_INTSTAT_TXG1IF))
{
/* A packet was transmitted or failed*/
/* A packet was transmitted or failed */
mrf24j40_irqwork_txgts(dev, 1);
}
@@ -404,10 +403,10 @@ void mrf24j40_irqworker(FAR void *arg)
if (dev->devmode != IEEE802154_DEVMODE_ENDPOINT)
{
/* This is right before the beacon, we set the bsn here, since the MAC
* uses the SLPIF (end of active portion of superframe). to make any
* changes to the beacon. This assumes that any changes to the beacon
* be in by the time that this interrupt fires.
/* This is right before the beacon, we set the bsn here, since the
* MAC uses the SLPIF (end of active portion of superframe). to
* make any changes to the beacon. This assumes that any changes
* to the beacon be in by the time that this interrupt fires.
*/
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);
return work_queue(HPWORK, &dev->irqwork, mrf24j40_irqworker, (FAR void *)dev, 0);
return work_queue(HPWORK, &dev->irqwork,
mrf24j40_irqworker, (FAR void *)dev, 0);
}
@@ -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,
* 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));
@@ -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.
*/
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)
@@ -264,7 +265,8 @@ int mrf24j40_txnotify(FAR struct ieee802154_radio_s *radio, bool gts)
{
/* 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
@@ -424,7 +426,8 @@ int mrf24j40_rxenable(FAR struct ieee802154_radio_s *radio, bool enable)
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;
}
@@ -657,13 +660,17 @@ int mrf24j40_beaconstart(FAR struct ieee802154_radio_s *radio,
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_RXMCR_PANCOORD;
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_TXMCR_SLOTTED;
@@ -679,8 +686,8 @@ int mrf24j40_beaconstart(FAR struct ieee802154_radio_s *radio,
dev->bsn = 0;
mrf24j40_setreg(dev->spi, MRF24J40_BEACON_FIFO + 4, dev->bsn++);
/* Set the TXBMSK (TXBCON1 0x25<7>) bit = 1 to mask the beacon interrupt
* mask
/* Set the TXBMSK (TXBCON1 0x25<7>) bit = 1 to mask the beacon
* interrupt mask
*/
reg = mrf24j40_getreg(dev->spi, MRF24J40_TXBCON1);
@@ -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_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,
FAR const struct ieee802154_superframespec_s *sfspec,
FAR struct ieee802154_beaconframe_s *beacon);
FAR const struct ieee802154_superframespec_s *sfspec,
FAR struct ieee802154_beaconframe_s *beacon);
int mrf24j40_beaconupdate(FAR struct ieee802154_radio_s *radio,
FAR struct ieee802154_beaconframe_s *beacon);
@@ -170,6 +170,7 @@
/* RXMCR bits */
#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_COORD 0x04 /* Enable coordinator mode ??? DIFFERENCE ??? - not used in datasheet! */
#define MRF24J40_RXMCR_PANCOORD 0x08 /* Enable PAN coordinator mode ??? DIFFERENCE ??? */
@@ -214,6 +215,7 @@
/* TXNCON bits */
#define MRF24J40_TXNCON_TXNTRIG (1 << 0) /* Trigger packet tx, automatically cleared */
#define MRF24J40_TXNCON_TXNSECEN 0x02 /* Enable security */
#define MRF24J40_TXNCON_TXNACKREQ 0x04 /* An ACK is requested for this pkt */
#define MRF24J40_TXNCON_INDIRECT 0x08 /* Activate indirect tx bit (for coordinators) */
+30 -24
View File
@@ -69,15 +69,16 @@ struct xbee_maccb_s
FAR struct xbee_maccb_s *flink; /* Implements a singly linked list */
uint8_t prio; /* RX frame callback priority */
/* Callback for various MLME or MCPS service events. Return value represents
* whether the callback accepts the primitive. >= 0 means the callback has
* accepted the primitive and is responsible for calling
* ieee802154_primitive_free(). In the case of DATA.indication primitive, only
* one callback can accept the frame. The callbacks are stored in order of
* receiver priority defined by the 'prio' field above. All other
/* Callback for various MLME or MCPS service events. Return value
* represents whether the callback accepts the primitive. >= 0 means the
* callback has accepted the primitive and is responsible for calling
* ieee802154_primitive_free(). In the case of DATA.indication primitive,
* only one callback can accept the frame. The callbacks are stored in
* order of receiver priority defined by the 'prio' field above. All other
* notifications are offered to all callbacks and all can accept and free
* separately since the primitive will not be freed until the nclients count
* reaches 0. */
* separately since the primitive will not be freed until the nclients
* count reaches 0.
*/
CODE int (*notify)(FAR struct xbee_maccb_s *maccb,
FAR struct ieee802154_primitive_s *primitive);
@@ -95,7 +96,7 @@ struct xbee_maccb_s
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
/****************************************************************************
* Name: xbee_bind
*
* Description:
@@ -138,14 +139,15 @@ int xbee_ioctl(XBEEHANDLE xbee, int cmd, unsigned long arg);
* Name: xbee_get_mhrlen
*
* Description:
* Calculate the MAC header length given the frame meta-data. For the XBee,
* we use the header to store the entire API frame for the TX request. The
* size we need is fixed based on the address mode we are using as it changes
* which API frame we need to issue.
* Calculate the MAC header length given the frame meta-data. For the
* XBee, we use the header to store the entire API frame for the TX
* request. The size we need is fixed based on the address mode we are
* 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
@@ -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);
/****************************************************************************
@@ -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
* via the asynchronous MLME-GET.confirm primitive. However, in our
* implementation, we synchronously return the value immediately.Therefore, we
* merge the functionality of the MLME-GET.request and MLME-GET.confirm
* implementation, we synchronously return the value immediately.Therefore,
* we merge the functionality of the MLME-GET.request and MLME-GET.confirm
* 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
* indicated MAC PIB attribute.
*
* NOTE: The standard specifies that confirmation should be indicated via
* the asynchronous MLME-SET.confirm primitive. However, in our implementation
* we synchronously return the status from the request. Therefore, we do merge
* the functionality of the MLME-SET.request and MLME-SET.confirm primitives
* together.
* NOTE:
* The standard specifies that confirmation should be indicated via the
* asynchronous MLME-SET.confirm primitive. However, in our implementation
* we synchronously return the status from the request. Therefore, we do
* 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
@@ -234,7 +239,8 @@ int xbee_req_associate(XBEEHANDLE xbee, FAR struct ieee802154_assoc_req_s *req);
*
* Input Parameters:
* 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
*
****************************************************************************/
@@ -9,28 +9,30 @@
* Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT 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.
*
******************************************************************************/
@@ -102,7 +104,6 @@ enum spirit_vcoselect_e
enum spirit_vcowin_e
{
CALIB_TIME_7_33_US_24MHZ = 0x00, /* Calibration window of 7.33 us
* with XTAL=24MHz */
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 */
@@ -9,28 +9,30 @@
* Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT 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.
*
******************************************************************************/
@@ -115,7 +117,9 @@ enum spirit_cmd_e
/* Autoretransmission: Reload the
* Packet sequence counter with the
* 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
* routine; valid from all states;
* valid from all states */
+22 -20
View File
@@ -9,28 +9,30 @@
* Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT 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.
*
******************************************************************************/
+30 -24
View File
@@ -9,28 +9,30 @@
* Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT 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.
*
******************************************************************************/
@@ -38,7 +40,8 @@
#define __DRUVERS_WIRELESS_SPIRIT_INCLUDE_SPIRIT_CSMA_H
/* 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
* SpiritCsma() function.
*
@@ -108,7 +111,7 @@ extern "C"
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 */
TBIT_TIME_128 = CSMA_CCA_PERIOD_128TBIT, /* CSMA/CA: Sets CCA period
* to 128*TBIT */
@@ -118,7 +121,9 @@ enum spirit_cca_period_e
* 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
{
@@ -280,7 +285,8 @@ enum spirit_functional_state_e
*
* Description:
* 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:
* spirit - Reference to a Spirit library state structure instance
@@ -9,28 +9,30 @@
* Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT 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.
*
******************************************************************************/
@@ -87,7 +89,6 @@ enum spirit_directtx_e
* generated internally */
};
/* Direct receive mode enumeration for SPIRIT. */
enum spirit_directrx_e
@@ -9,28 +9,30 @@
* Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT 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.
*
******************************************************************************/
@@ -115,8 +117,8 @@ enum packet_type_e
enum spirit_version_e
{
SPIRIT_VERSION_2_1 = 0x01, /* Deprecated */
SPIRIT_VERSION_3_0, /* The only version of SPIRIT1 */
SPIRIT_VERSION_2_1 = 0x01, /* Deprecated */
SPIRIT_VERSION_3_0, /* The only version of SPIRIT1 */
};
/******************************************************************************
+32 -27
View File
@@ -9,28 +9,30 @@
* Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT 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.
*
******************************************************************************/
@@ -69,7 +71,6 @@
#include "spirit_regs.h"
#include "spirit_types.h"
/******************************************************************************
* Pre-processor Definitions
******************************************************************************/
@@ -189,8 +190,10 @@ enum spirit_gpio_io_e
SPIRIT_GPIO_DIG_OUT_TX_STATE = 0x28, /* TX state indication: "1"
* when Spirit1 is passing in
* the TX state */
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_RX_DATA = 0x40, /* RX data output */
SPIRIT_GPIO_DIG_OUT_RX_CLOCK = 0x48, /* RX clock output
* (recovered from received
@@ -198,8 +201,10 @@ enum spirit_gpio_io_e
SPIRIT_GPIO_DIG_OUT_RX_STATE = 0x50, /* RX state indication: "1"
* when Spirit1 is passing in
* the RX state */
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_ANTENNA_SWITCH = 0x68, /* Antenna switch used for
* antenna diversity */
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_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_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_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 */
@@ -347,7 +352,6 @@ struct spirit_clockoutput_init_s
int spirit_gpio_initialize(FAR struct spirit_library_s *spirit,
FAR const struct spirit_gpio_init_s *gpioinit);
/******************************************************************************
* 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
* 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.
*
* 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,
FAR const struct spirit_clockoutput_init_s *clockoutput);
FAR const struct spirit_clockoutput_init_s *clockoutput);
/******************************************************************************
* 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,
enum spirit_clockoutput_xoprescaler_e xoprescaler);
enum spirit_clockoutput_xoprescaler_e 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,
enum spirit_clockoutput_rcoprescaler_e rcoprescaler);
enum spirit_clockoutput_rcoprescaler_e rcoprescaler);
/******************************************************************************
* Name: spirit_gpio_get_rcoprescaler
+28 -24
View File
@@ -9,43 +9,47 @@
* Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT 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.
*
******************************************************************************/
#ifndef __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 first enables the IRQs one by one, i.e. using an SPI transaction for each
* IRQ to enable.
* The first enables the IRQs one by one, i.e. using an SPI transaction for
* each IRQ to enable.
*
* 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, VALID_SYNC , S_ENABLE);
* spirit_irq_enable(spirit, RX_TIMEOUT , S_ENABLE);
@@ -9,28 +9,30 @@
* Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT 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.
*
******************************************************************************/
@@ -9,28 +9,30 @@
* Adapted for NuttX by:
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT 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.
*
******************************************************************************/
@@ -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

Some files were not shown because too many files have changed in this diff Show More