drivers/sensors: fix style issues in function headers

fix style issues in function headers, add missing new lines
This commit is contained in:
raiden00pl
2024-11-14 15:08:08 +01:00
committed by Xiang Xiao
parent 6fcfe7cf03
commit 547cbf3ba6
20 changed files with 97 additions and 20 deletions
+13
View File
@@ -324,6 +324,7 @@ static int ds18b20_isalarm(FAR struct onewire_master_s *master,
*
* Return:
* OK - on success
*
****************************************************************************/
static int ds18b20_measure(FAR struct ds18b20_dev_s *dev)
@@ -354,6 +355,7 @@ static int ds18b20_measure(FAR struct ds18b20_dev_s *dev)
*
* Return:
* OK - on success
*
****************************************************************************/
static int ds18b20_write_spad(FAR struct ds18b20_dev_s *dev, int8_t th,
@@ -387,6 +389,7 @@ static int ds18b20_write_spad(FAR struct ds18b20_dev_s *dev, int8_t th,
*
* Return:
* OK - on success
*
****************************************************************************/
static int ds18b20_read_spad(FAR struct ds18b20_dev_s *dev,
@@ -444,6 +447,7 @@ static int ds18b20_read_spad(FAR struct ds18b20_dev_s *dev,
*
* Return:
* OK - on success
*
****************************************************************************/
static int ds18b20_set_res(FAR struct ds18b20_dev_s *dev, uint8_t res)
@@ -495,6 +499,7 @@ static int ds18b20_set_res(FAR struct ds18b20_dev_s *dev, uint8_t res)
*
* Return:
* OK - on success
*
****************************************************************************/
static int ds18b20_set_alarm(FAR struct ds18b20_dev_s *dev,
@@ -549,6 +554,7 @@ static int ds18b20_set_alarm(FAR struct ds18b20_dev_s *dev,
*
* Return:
* Timestamp in nsec
*
****************************************************************************/
static unsigned long ds18b20_curtime(void)
@@ -596,6 +602,7 @@ static void ds18b20_notify(FAR struct ds18b20_dev_s *dev,
*
* Return:
* OK - on success
*
****************************************************************************/
static int ds18b20_measure_read(FAR struct ds18b20_dev_s *dev,
@@ -635,6 +642,7 @@ static int ds18b20_measure_read(FAR struct ds18b20_dev_s *dev,
*
* Return:
* OK - on success
*
****************************************************************************/
static int ds18b20_fetch(FAR struct sensor_lowerhalf_s *lower,
@@ -677,6 +685,7 @@ static int ds18b20_fetch(FAR struct sensor_lowerhalf_s *lower,
*
* Return:
* OK - on success
*
****************************************************************************/
static int ds18b20_control(FAR struct sensor_lowerhalf_s *lower,
@@ -745,6 +754,7 @@ static int ds18b20_control(FAR struct sensor_lowerhalf_s *lower,
*
* Return:
* OK - on success
*
****************************************************************************/
static int ds18b20_active(FAR struct sensor_lowerhalf_s *lower,
@@ -783,6 +793,7 @@ static int ds18b20_active(FAR struct sensor_lowerhalf_s *lower,
*
* Return:
* OK - on success
*
****************************************************************************/
#ifdef CONFIG_SENSORS_DS18B20_POLL
@@ -805,6 +816,7 @@ static int ds18b20_set_interval(FAR struct sensor_lowerhalf_s *lower,
* Parameter:
* argc - Number of arguments
* argv - Pointer to argument list
*
****************************************************************************/
#ifdef CONFIG_SENSORS_DS18B20_POLL
@@ -909,6 +921,7 @@ static int ds18b20_thread(int argc, char** argv)
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
int ds18b20_register(int devno, FAR struct onewire_master_s *onewire,
+1
View File
@@ -392,6 +392,7 @@ static int fakesensor_thread(int argc, char** argv)
* ...
* devno - The user specifies which device of this type, from 0.
* batch_number- The maximum number of batch
*
****************************************************************************/
int fakesensor_init(int type, FAR const char *file_name,
+1
View File
@@ -858,6 +858,7 @@ gnss_err:
* instance is bound to the GNSS driver and must persists as long
* as the driver persists.
* devno - The user specifies which device of this type, from 0.
*
****************************************************************************/
void gnss_unregister(FAR struct gnss_lowerhalf_s *lower, int devno)
+16
View File
@@ -153,6 +153,7 @@ static const struct sensor_ops_s g_hyt271_ops =
* Parameter:
* data - Pointer to internal datat structure for measured data
* temp - Pointer to sensor data structure for humidity
*
****************************************************************************/
static void hyt271_humi_from_rawdata(FAR struct hyt271_sensor_data_s *data,
@@ -170,6 +171,7 @@ static void hyt271_humi_from_rawdata(FAR struct hyt271_sensor_data_s *data,
* Parameter:
* data - Pointer to internal datat structure for measured data
* temp - Pointer to sensor data structure for temperature
*
****************************************************************************/
static void hyt271_temp_from_rawdata(FAR struct hyt271_sensor_data_s *data,
@@ -186,6 +188,7 @@ static void hyt271_temp_from_rawdata(FAR struct hyt271_sensor_data_s *data,
*
* Return:
* Timestamp in nsec
*
****************************************************************************/
static unsigned long hyt271_curtime(void)
@@ -205,6 +208,7 @@ static unsigned long hyt271_curtime(void)
* buffer - Pointer to the buffers memory region
* cmd - The command to set in the buffer
* size - The buffer size
*
****************************************************************************/
static void hyt271_init_rw_buffer(FAR uint8_t *buffer, uint8_t cmd,
@@ -233,6 +237,7 @@ static void hyt271_init_rw_buffer(FAR uint8_t *buffer, uint8_t cmd,
*
* Return:
* OK - on success
*
****************************************************************************/
static int hyt271_df(FAR struct hyt271_dev_s *dev,
@@ -264,6 +269,7 @@ static int hyt271_df(FAR struct hyt271_dev_s *dev,
*
* Return:
* OK - on success
*
****************************************************************************/
static int hyt271_mr(FAR struct hyt271_dev_s *dev,
@@ -306,6 +312,7 @@ static int hyt271_mr(FAR struct hyt271_dev_s *dev,
*
* Return:
* OK - on success
*
****************************************************************************/
static int hyt271_cmd(FAR struct hyt271_dev_s *dev,
@@ -341,6 +348,7 @@ static int hyt271_cmd(FAR struct hyt271_dev_s *dev,
*
* Return:
* OK - on success
*
****************************************************************************/
static int hyt271_cmd_response(FAR struct hyt271_dev_s *dev,
@@ -393,6 +401,7 @@ static int hyt271_cmd_response(FAR struct hyt271_dev_s *dev,
*
* Return:
* OK - on success
*
****************************************************************************/
static int hyt271_change_addr(FAR struct hyt271_dev_s *dev, uint8_t addr)
@@ -538,6 +547,7 @@ err_unlock:
* Return:
* OK - on success
*
****************************************************************************/
static int hyt271_measure_read(FAR struct hyt271_dev_s *dev,
@@ -612,6 +622,7 @@ err_unlock:
*
* Return:
* OK - on success
*
****************************************************************************/
static int hyt271_fetch(FAR struct sensor_lowerhalf_s *lower,
@@ -667,6 +678,7 @@ static int hyt271_fetch(FAR struct sensor_lowerhalf_s *lower,
*
* Return:
* OK - on success
*
****************************************************************************/
static int hyt271_control(FAR struct sensor_lowerhalf_s *lower,
@@ -716,6 +728,7 @@ static int hyt271_control(FAR struct sensor_lowerhalf_s *lower,
*
* Return:
* OK - on success
*
****************************************************************************/
static int hyt271_active(FAR struct sensor_lowerhalf_s *lower,
@@ -754,6 +767,7 @@ static int hyt271_active(FAR struct sensor_lowerhalf_s *lower,
*
* Return:
* OK - on success
*
****************************************************************************/
#ifdef CONFIG_SENSORS_HYT271_POLL
@@ -776,6 +790,7 @@ static int hyt271_set_interval(FAR struct sensor_lowerhalf_s *lower,
* Parameter:
* argc - Number of arguments
* argv - Pointer to argument list
*
****************************************************************************/
#ifdef CONFIG_SENSORS_HYT271_POLL
@@ -871,6 +886,7 @@ static int hyt271_thread(int argc, char** argv)
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
int hyt271_register(int devno, FAR struct i2c_master_s *i2c, uint8_t addr,
+16 -2
View File
@@ -982,7 +982,7 @@ static inline int mpu9250_write_fifo_en(FAR struct mpu9250_dev_s *dev,
}
/****************************************************************************
* mpu9250_write_gyro_range() :
* Name: mpu9250_write_gyro_range()
*
* Sets the @fs_sel bit in GYRO_CONFIG to the value provided. Per the
* datasheet, the meaning of @fs_sel is as follows:
@@ -997,6 +997,7 @@ static inline int mpu9250_write_fifo_en(FAR struct mpu9250_dev_s *dev,
* 1 -> ± 500 deg/sec
* 2 -> ± 1000 deg/sec
* 3 -> ± 2000 deg/sec
*
****************************************************************************/
static inline int mpu9250_write_gyro_range(FAR struct mpu9250_dev_s *dev,
@@ -1007,7 +1008,7 @@ static inline int mpu9250_write_gyro_range(FAR struct mpu9250_dev_s *dev,
}
/****************************************************************************
* mpu9250_write_accel_range() :
* Name: mpu9250_write_accel_range()
*
* Sets the @afs_sel bit in ACCEL_CONFIG to the value provided. Per
* the datasheet, the meaning of @afs_sel is as follows:
@@ -1022,6 +1023,7 @@ static inline int mpu9250_write_gyro_range(FAR struct mpu9250_dev_s *dev,
* 1 -> ± 4 g
* 2 -> ± 8 g
* 3 -> ± 16 g
*
****************************************************************************/
static inline int mpu9250_write_accel_range(FAR struct mpu9250_dev_s *dev,
@@ -1036,6 +1038,7 @@ static inline int mpu9250_write_accel_range(FAR struct mpu9250_dev_s *dev,
*
* EXT_SYNC_SET : frame sync bit position
* DLPF_CFG : digital low-pass filter bandwidth
*
****************************************************************************/
static inline int mpu9250_write_config(FAR struct mpu9250_dev_s *dev,
@@ -1051,6 +1054,7 @@ static inline int mpu9250_write_config(FAR struct mpu9250_dev_s *dev,
*
* accel_fchoice_b : he inverted version of accel_fchoice
* A_DLPF_CFG : Accelerometer low pass filter setting
*
****************************************************************************/
static inline int mpu9250_write_config2(FAR struct mpu9250_dev_s *dev,
@@ -1071,6 +1075,7 @@ static inline int mpu9250_write_config2(FAR struct mpu9250_dev_s *dev,
*
* Return:
* OK - on success
*
****************************************************************************/
static int mpu9250_initialize(FAR struct mpu9250_dev_s *dev)
@@ -1283,6 +1288,7 @@ errout:
*
* Return:
* OK - on success
*
****************************************************************************/
static int ak8963_initialize(FAR struct mpu9250_dev_s *dev,
@@ -1438,6 +1444,7 @@ static int ak8963_initialize(FAR struct mpu9250_dev_s *dev,
*
* Return:
* OK - on success
*
****************************************************************************/
static int get_mag_adjustment(FAR struct mpu9250_dev_s *dev)
@@ -1516,6 +1523,7 @@ static int get_mag_adjustment(FAR struct mpu9250_dev_s *dev)
*
* Return:
* OK - on success
*
****************************************************************************/
static int read_ak8963_reg(FAR struct mpu9250_dev_s *dev,
@@ -1608,6 +1616,7 @@ static int read_ak8963_reg(FAR struct mpu9250_dev_s *dev,
*
* Return:
* OK - on success
*
****************************************************************************/
static int write_ak8963_reg(FAR struct mpu9250_dev_s *dev,
@@ -1700,6 +1709,7 @@ static int write_ak8963_reg(FAR struct mpu9250_dev_s *dev,
*
* Return:
* do nothing if Big endian, swap H and L byte if little endian
*
****************************************************************************/
static uint16_t swap16(uint16_t val)
@@ -1722,6 +1732,7 @@ static uint16_t swap16(uint16_t val)
*
* Return:
* OK - on success
*
****************************************************************************/
static void mpu9250_accel_data(FAR struct mpu9250_sensor_s *priv,
@@ -1760,6 +1771,7 @@ static void mpu9250_accel_data(FAR struct mpu9250_sensor_s *priv,
*
* Return:
* OK - on success
*
****************************************************************************/
static void mpu9250_gyro_data(FAR struct mpu9250_sensor_s *priv,
@@ -1798,6 +1810,7 @@ static void mpu9250_gyro_data(FAR struct mpu9250_sensor_s *priv,
*
* Return:
* OK - on success
*
****************************************************************************/
static void mpu9250_mag_data(FAR struct mpu9250_sensor_s *priv,
@@ -1849,6 +1862,7 @@ static void mpu9250_mag_data(FAR struct mpu9250_sensor_s *priv,
* Parameter:
* argc - Number of arguments
* argv - Pointer to argument list
*
****************************************************************************/
static int mpu9250_thread(int argc, FAR char **argv)
+2
View File
@@ -159,6 +159,7 @@ static const struct sensor_ops_s g_sensor_ops =
*
* Return:
* Timestamp in microseconds
*
****************************************************************************/
static unsigned long ms56xx_curtime(void)
@@ -371,6 +372,7 @@ static inline void baro_measure_read(FAR struct ms56xx_dev_s *priv,
* Parameter:
* argc - Number of arguments
* argv - Pointer to argument list
*
****************************************************************************/
static int ms56xx_thread(int argc, char **argv)
+2
View File
@@ -1387,6 +1387,7 @@ rpmsg_err:
* instance is bound to the sensor driver and must persists as long
* as the driver persists.
* devno - The user specifies which device of this type, from 0.
*
****************************************************************************/
void sensor_unregister(FAR struct sensor_lowerhalf_s *lower, int devno)
@@ -1419,6 +1420,7 @@ void sensor_unregister(FAR struct sensor_lowerhalf_s *lower, int devno)
* instance is bound to the sensor driver and must persists as long
* as the driver persists.
* path - The user specifies path of device, ex: /dev/uorb/xxx
*
****************************************************************************/
void sensor_custom_unregister(FAR struct sensor_lowerhalf_s *lower,
+3
View File
@@ -1446,6 +1446,7 @@ static void sensor_rpmsg_device_created(FAR struct rpmsg_device *rdev,
*
* Returned Value:
* The takeover rpmsg lowerhalf returned on success, NULL on failure.
*
****************************************************************************/
FAR struct sensor_lowerhalf_s *
@@ -1512,6 +1513,7 @@ sensor_rpmsg_register(FAR struct sensor_lowerhalf_s *lower,
*
* Input Parameters:
* lower - The instance of lower half sensor driver.
*
****************************************************************************/
void sensor_rpmsg_unregister(FAR struct sensor_lowerhalf_s *lower)
@@ -1539,6 +1541,7 @@ void sensor_rpmsg_unregister(FAR struct sensor_lowerhalf_s *lower)
*
* Returned Value:
* OK on success; A negated errno value is returned on any failure.
*
****************************************************************************/
int sensor_rpmsg_initialize(void)
+10 -10
View File
@@ -51,11 +51,11 @@
#define SHT4X_TEMP_UNIT "F"
#else
#define SHT4X_TEMP_UNIT "C"
#endif // defined(CONFIG_SHT4X_FAHRENHEIT)
#endif
#ifndef CONFIG_SHT4X_I2C_FREQUENCY
#define CONFIG_SHT4X_I2C_FREQUENCY 400000
#endif // CONFIG_SHT4X_I2C_FREQUENCY
#endif
#define SHT4X_CRC_INIT 0xFF /* Initial value of the calculated CRC. */
#define SHT4X_CRC_POLY 0x31 /* CRC calculation polynomial. */
@@ -82,12 +82,12 @@ struct sht4x_dev_s
uint8_t addr; /* I2C address. */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
bool unlinked; /* True, driver has been unlinked. */
#endif // CONFIG_DISABLE_PSEUDOFS_OPERATIONS
#endif
struct timespec last_heat; /* Last time heater was active. */
enum sht4x_precision_e precision; /* The precision for read operations. */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
int16_t crefs; /* Number of open references. */
#endif // CONFIG_DISABLE_PSEUDOFS_OPERATIONS
#endif
mutex_t devlock;
};
@@ -147,7 +147,7 @@ static const uint8_t g_crc_lookup[] =
0xe0, 0xd1, 0x46, 0x77, 0x24, 0x15, 0x3b, 0xa, 0x59, 0x68, 0xff,
0xce, 0x9d, 0xac,
}
#endif // CONFIG_SHT4X_CRC_LOOKUP
#endif
/* Measurement times for the various precisions, in microseconds. */
@@ -423,7 +423,7 @@ static int32_t sht4x_calc_temp(uint16_t temp)
return -49000 + 315 * ((temp * 1000) / 65535);
#else
return -45000 + 175 * ((temp * 1000) / 65535); /* Millidegrees Celsius */
#endif // CONFIG_SHT4X_FAHRENHEIT
#endif
}
/****************************************************************************
@@ -450,7 +450,7 @@ static int16_t sht4x_calc_hum(uint16_t humidity)
hum = 10000;
}
#endif // CONFIG_SHT4X_LIMIT_HUMIDITY
#endif
return hum;
}
@@ -598,7 +598,7 @@ static ssize_t sht4x_read(FAR struct file *filep, FAR char *buffer,
{
#ifdef CONFIG_SHT4X_DEBUG
sht4x_dbg("Could not read device: %d\n", err);
#endif // CONFIG_SHT4X_DEBUG
#endif
nxmutex_unlock(&priv->devlock);
return err;
}
@@ -732,7 +732,7 @@ static int sht4x_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
priv->precision = arg;
#ifdef CONFIG_SHT4X_DEBUG
sht4x_dbg("Precision set to %d\n", priv->precision);
#endif // CONFIG_SHT4X_DEBUG
#endif
break;
@@ -798,7 +798,7 @@ static int sht4x_unlink(FAR struct inode *inode)
* i2c - An instance of the I2C interface to use to communicate with
* the SHT4X
* addr - The I2C address of the SHT4X. The I2C address is one of 0x44,
*0x45 and 0x46.
* 0x45 and 0x46.
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
+1
View File
@@ -264,6 +264,7 @@ static int usensor_control(FAR struct sensor_lowerhalf_s *lower,
* This function registers usensor character node "/dev/usensor", so that
* application can register user sensor by this node. The node will
* manager all user sensors in this character driver.
*
****************************************************************************/
int usensor_initialize(void)
+1
View File
@@ -79,6 +79,7 @@ extern "C"
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
#ifndef CONFIG_SENSORS_BMP180_UORB
int bmp180_register(FAR const char *devpath, FAR struct i2c_master_s *i2c);
#else
+1
View File
@@ -83,6 +83,7 @@ extern "C"
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
int ds18b20_register(int devno, FAR struct onewire_master_s *dev,
+1
View File
@@ -59,6 +59,7 @@ extern "C"
* ...
* devno - The user specifies which device of this type, from 0.
* batch_number- The maximum number of batch
*
****************************************************************************/
int fakesensor_init(int type, FAR const char *file_name,
+1
View File
@@ -224,6 +224,7 @@ int gnss_register(FAR struct gnss_lowerhalf_s *dev, int devno,
* instance is bound to the GNSS driver and must persists as long
* as the driver persists.
* devno - The user specifies which device of this type, from 0.
*
****************************************************************************/
void gnss_unregister(FAR struct gnss_lowerhalf_s *dev, int devno);
+1
View File
@@ -98,6 +98,7 @@ extern "C"
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
int hyt271_register(int devno, FAR struct i2c_master_s *i2c, uint8_t addr,
+8 -3
View File
@@ -105,11 +105,16 @@ struct mpu_config_s
* Public Function Prototypes
****************************************************************************/
/* Declares the existence of an mpu60x0 chip, wired according to
* config; creates an interface to it at path.
/****************************************************************************
* Name: mpu60x0_register
*
* Description:
* Declares the existence of an mpu60x0 chip, wired according to
* config; creates an interface to it at path.
*
* Returns 0 on success, or negative errno.
*/
*
****************************************************************************/
int mpu60x0_register(FAR const char *path, FAR struct mpu_config_s *config);
+8 -3
View File
@@ -158,11 +158,16 @@ struct mpu9250_config_s
* Public Function Prototypes
****************************************************************************/
/* Declares the existence of an mpu9250 chip, wired according to
* config; creates an interface to it at path.
/****************************************************************************
* Name: mpu60x0_register
*
* Description:
* Declares the existence of an mpu9250 chip, wired according to
* config; creates an interface to it at path.
*
* Returns 0 on success, or negative errno.
*/
*
****************************************************************************/
int mpu9250_register(int devno, FAR struct mpu9250_config_s *config);
+1 -2
View File
@@ -151,8 +151,7 @@ extern "C"
****************************************************************************/
int msa301_sensor_register(FAR const char *devpath,
FAR struct i2c_master_s *i2c
);
FAR struct i2c_master_s *i2c);
#ifdef __cplusplus
}
+9
View File
@@ -560,6 +560,7 @@ struct sensor_lowerhalf_s
* Returned Value:
* The bytes of push is returned when success;
* A negated errno value is returned on any failure.
*
**********************************************************************/
sensor_push_event_t push_event;
@@ -576,6 +577,7 @@ struct sensor_lowerhalf_s
*
* Input Parameters:
* priv - Upper half driver handle
*
**********************************************************************/
sensor_notify_event_t notify_event;
@@ -589,6 +591,7 @@ struct sensor_lowerhalf_s
*
* Input Parameters:
* priv - Upper half driver handle
*
****************************************************************************/
CODE void (*sensor_lock)(FAR void * priv);
@@ -707,6 +710,7 @@ int sensor_custom_register(FAR struct sensor_lowerhalf_s *dev,
* instance is bound to the sensor driver and must persists as long
* as the driver persists.
* devno - The user specifies which device of this type, from 0.
*
****************************************************************************/
void sensor_unregister(FAR struct sensor_lowerhalf_s *dev, int devno);
@@ -723,6 +727,7 @@ void sensor_unregister(FAR struct sensor_lowerhalf_s *dev, int devno);
* instance is bound to the sensor driver and must persists as long
* as the driver persists.
* path - The user specifies path of device, ex: /dev/uorb/xxx
*
****************************************************************************/
void sensor_custom_unregister(FAR struct sensor_lowerhalf_s *dev,
@@ -735,6 +740,7 @@ void sensor_custom_unregister(FAR struct sensor_lowerhalf_s *dev,
* This function registers usensor character node "/dev/usensor", so that
* application can register user sensor by this node. The node will
* manager all user sensor in this character dirver.
*
****************************************************************************/
#ifdef CONFIG_USENSOR
@@ -754,6 +760,7 @@ int usensor_initialize(void);
*
* Returned Value:
* The takeover rpmsg lowerhalf returned on success, NULL on failure.
*
****************************************************************************/
#ifdef CONFIG_SENSORS_RPMSG
@@ -772,6 +779,7 @@ FAR struct sensor_lowerhalf_s *sensor_rpmsg_register(
*
* Input Parameters:
* lower - The instance of lower half sensor driver.
*
****************************************************************************/
#ifdef CONFIG_SENSORS_RPMSG
@@ -787,6 +795,7 @@ void sensor_rpmsg_unregister(FAR struct sensor_lowerhalf_s *lower);
*
* Returned Value:
* OK on success; A negated errno value is returned on any failure.
*
****************************************************************************/
#ifdef CONFIG_SENSORS_RPMSG
+1
View File
@@ -54,6 +54,7 @@ extern "C"
* Returned Value:
* OK if the driver was successfully initialize; A negated errno value is
* returned on any failure.
*
****************************************************************************/
int wtgahrs2_initialize(FAR const char *path, int devno);