raiden00pl commented on code in PR #15789: URL: https://github.com/apache/nuttx/pull/15789#discussion_r1948572792
########## include/nuttx/sensors/lsm6dso32.h: ########## @@ -0,0 +1,109 @@ +/**************************************************************************** + * include/nuttx/sensors/lsm6dso32.h + * + * Contributed by Carleton University InSpace + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#ifndef __INCLUDE_NUTTX_SENSORS_LSM6DSO32_H +#define __INCLUDE_NUTTX_SENSORS_LSM6DSO32_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/irq.h> +#include <nuttx/i2c/i2c_master.h> +#include <nuttx/sensors/ioctl.h> + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/* Gyroscope FSRs */ + +enum lsm6dso32_fsr_gyro_e +{ + LSM6DSO32_FSR_GY_250DPS = 0x0, /* +-250dps */ + LSM6DSO32_FSR_GY_125DPS = 0x1, /* +-125dps */ + LSM6DSO32_FSR_GY_500DPS = 0x2, /* +-500dps */ + LSM6DSO32_FSR_GY_1000DPS = 0x4, /* +-1000dps */ + LSM6DSO32_FSR_GY_2000DPS = 0x6, /* +-2000dps */ +}; + +/* Accelerometer FSRs */ + +enum lsm6dso32_fsr_xl_e +{ + LSM6DSO32_FSR_XL_4G = 0x0, /* +-4g */ + LSM6DSO32_FSR_XL_32G = 0x1, /* +-32g */ + LSM6DSO32_FSR_XL_8G = 0x2, /* +-8g */ + LSM6DSO32_FSR_XL_16G = 0x3, /* +-16g */ +}; Review Comment: > This is a good point. Do you think it would be worthwhile compiling some of these standard ways of doing things into a guide for writing new sensor drivers? I.e. use uORB, minimize device specific arguments, etc? Certainly, guide on how to write portable sensor drivers would be useful. What's more, without such an instruction, it's hard to expect from new contributors that new sensors will be compatible with each other. Many of definitions in `sensors/ioctl.h` are remnant of the old method of writing sensors. One day we have to clean it up because now it's a total mess. Maybe even a dedicated header file for uorb sensors would be better, so the user would know right away which ioctls are used by uorb sensors and which are worth implementing. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org