incubator-nuttx/include/nuttx
Jiuzhu Dong 032a5c75a4 drivers/sensors/: Add coordinate conversion function
convert from body coordinate system to right-hand
coordinate system.

Example:
Compared to the standard coordinate system,
the x-axis and y-axis are interchanged and have opposite directions,
the z-axis remains normal.

  body coordinate   ---->     right-hand coordinate
              +x               +y
               |                |
               |                |
               |                |
               |                |
     -y<-------.                .------>+x
              /                /
             /                /
            /                /
           /                /
         +z                +z

So for the above conversion, using "P3" to represent transformation relationships
The front is 1 0 2, which represents the y x z axis.
The standard order is 0 1 2, so y and x are interchanged.

The following -1 1 1 indicates the direction of the axis.
The standard is 1 1 1. Because the current y-axis is opposite to
the standard x-axis, it is -1.

static const struct sensor_axis_map_s g_remap_tbl[] =
{
  { 0, 1, 2,  1,  1,  1 }, /* P0 */
  { 1, 0, 2,  1, -1,  1 }, /* P1 */
  { 0, 1, 2, -1, -1,  1 }, /* P2 */
  { 1, 0, 2, -1,  1,  1 }, /* P3 */
  { 0, 1, 2, -1,  1, -1 }, /* P4 */
  { 1, 0, 2, -1, -1, -1 }, /* P5 */
  { 0, 1, 2,  1, -1, -1 }, /* P6 */
  { 1, 0, 2,  1,  1, -1 }, /* P7 */
};

you can call the function sensor_remap_vector_raw16 and pass P3 parameters
to perform the conversion.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2023-09-24 11:01:08 +08:00
..
1wire include: Haltian Ltd: update licenses to Apache 2021-11-15 06:49:32 -06:00
analog drivers: remove redundant parentheses 2023-07-31 18:56:40 -07:00
audio audio:add 24K sample rate support 2023-09-15 02:26:03 +08:00
binfmt Exec: Support run exec in current task 2023-09-20 16:53:30 +08:00
can include: Fix nxstyle errors 2023-05-04 02:07:01 +08:00
clk clk:fix some issues when use rpmsg clk 2023-09-22 08:47:23 +08:00
contactless author: OffCode Ltd : update licenses to Apache 2021-09-13 22:43:36 +08:00
crypto Added NXP SE05x support (secure element) 2023-09-09 15:54:08 +08:00
dma include/dma: support to config dst/src drq for every dma channel 2023-04-22 01:02:51 +08:00
drivers drivers: fix devascii_register warning 2023-08-11 21:20:13 +08:00
eeprom include: fix double include pre-processor guards 2022-01-16 11:11:14 -03:00
efuse Add ATSAMA5D2/D4 Secure Fuse Controller (SFC) driver 2023-05-12 16:29:48 -03:00
fs fs:add syncfs api for sync whole fs data 2023-09-23 15:58:00 +08:00
himem include: himem: Add Apache license to files 2022-04-20 21:05:45 +08:00
hwspinlock hwspinlock: Fix typo error(spin_lock_restore to spin_unlock_irqrestore) 2023-07-25 13:03:31 +02:00
i2c Added I2C Slave to RP2040 2022-07-16 01:56:52 +08:00
input input/touchscreen: Bring up TSIOC_[SET|GET]CALIB macro 2023-09-20 20:51:38 +08:00
ioexpander ioexpander: add support for ISO1I813T expander 2023-08-29 17:35:59 +08:00
lcd drivers/lcd : add ioctl passthrough for LCD driver 2023-08-19 01:50:41 +08:00
leds drivers/userled: add an interface to support LED effects. 2023-06-27 14:44:00 -03:00
lib Fix loading of ET_DYN type of shared objects 2023-09-20 09:35:28 -04:00
math cordic API add scale parameter 2023-08-22 12:51:36 +02:00
mbox drivers/mbox: Don't reference the nonexistent CONFIG_MBOX 2022-11-07 10:14:20 +01:00
mm mm: rewrite the memdump code for more readable 2023-09-24 10:39:18 +08:00
modem cxd56/alt1250: Change power on sequence 2023-07-06 13:18:57 +08:00
motor motor: Add calibration and selftest 2023-01-28 19:54:35 +02:00
mtd mtd:add dhara compatiblity layer 2023-08-22 23:16:14 +08:00
net include: nuttx: Re-allocate SIOCDENYINETSOCK 2023-09-21 01:08:11 +08:00
note note: directly returns the taskname pointer 2023-08-11 13:27:17 +08:00
nx Indent the define statement by two spaces 2023-05-21 09:52:08 -03:00
power support pm runtime base function 2023-09-16 14:44:08 +08:00
rc Replece clock_gettime(CLOCK_MONOTONIC) with clock_systime_timespec 2022-02-24 01:06:36 +08:00
reset Fixed the reset format error 2023-08-11 20:39:16 +08:00
rf include: fix double include pre-processor guards 2022-01-16 11:11:14 -03:00
rptun nuttx: change RPTUNIOC_START and RPTUNIOC_STOP to synchronous 2023-09-20 00:42:02 +08:00
segger c++ compatibility: rename reserved c++ keywords 'public' and 'this' 2023-09-16 19:45:02 +08:00
sensors drivers/sensors/: Add coordinate conversion function 2023-09-24 11:01:08 +08:00
serial drivers/serial: add ram uart driver 2023-09-19 09:41:07 +08:00
spi driver/spi_slave: support spi_slave asynchronous 2023-07-28 19:11:16 +03:00
syslog syslog: add syslog channel filtering function 2023-07-13 01:04:07 +08:00
timers pwm: add option to set channel output polarity with IOCTL command 2023-08-24 18:25:47 -03:00
usb usbdev/mtp: support mtp class driver 2023-09-16 14:40:08 +08:00
usrsock move usrsock to kernel space 2023-01-11 15:14:03 +08:00
video video/fb: add vsync queue 2023-09-12 22:10:10 +08:00
virtio virtio: add virtio framework in NuttX 2023-08-10 03:39:39 +08:00
wireless include/nuttx/wireless/lte/lte.h: add fw_version field to lte_version_t 2023-07-23 19:56:38 +08:00
.gitignore
addrenv.h mm_heap: mm dump and panic only valid for the heap own by OS 2023-08-02 06:11:59 -07:00
allsyms.h libc/symtab: Don't include symtab.h in the header files 2023-07-10 23:03:17 +03:00
arch.h sched: return 0 from clock_systime_ticks if failed 2023-09-19 16:17:08 +08:00
ascii.h
atexit.h libc: Implement quick_exit and at_quick_exit 2023-01-25 14:31:37 +02:00
bits.h nuttx/bits.h: support GENMASK and GENMASK_ULL 2023-07-29 16:41:31 -03:00
board.h assert: add regs parameter to board_crashdump function 2023-06-13 09:42:27 +08:00
cache.h armv7/8 cache: add up_get_xcache_size() support 2023-07-15 15:11:07 +08:00
can.h stm32h7: socket CAN error handling. 2023-01-30 11:22:49 +08:00
cancelpt.h fs:add syncfs api for sync whole fs data 2023-09-23 15:58:00 +08:00
clock.h sched/clock/clock_getcpuclockid: add clock_getcpuclockid implementation 2023-07-05 00:32:11 +08:00
compiler.h kasan: add builtin_return_address(0) to kasan 2023-09-24 03:48:39 +08:00
crc8.h libc/crc: Add full suffix to avoid the the penitential symbol collision 2022-08-29 18:06:53 +02:00
crc16.h arm64/a64: Add driver for MIPI DSI 2022-12-14 22:37:32 +08:00
crc32.h libc/crc: Add full suffix to avoid the the penitential symbol collision 2022-08-29 18:06:53 +02:00
crc64.h libc/crc: Add full suffix to avoid the the penitential symbol collision 2022-08-29 18:06:53 +02:00
elf.h binfmt: Always include arch/elf.h in include/nuttx/elf.h 2023-06-25 19:02:53 -03:00
environ.h
envpath.h
fdcheck.h libc/fdcheck: add fdcheck module 2023-06-10 02:19:58 +08:00
fdt.h fdt: Add initial FDT support and procfs for userspace export 2023-08-05 12:41:06 -07:00
gdbstub.h libs/libc:Support gdb rsp protocol 2023-07-15 01:57:11 +08:00
hashtable.h hashtable.h: Added a hashtable implementation 2022-12-22 20:20:12 +08:00
init.h support stm32f429i-disco run open flash loader 2023-08-05 12:40:02 -07:00
ipcc.h stm32wl5: fix unbuffered mode and other possible bugs 2022-08-18 11:46:38 +08:00
irq.h Indent the include statement by two spaces 2023-05-16 12:34:32 -03:00
kmalloc.h mm: include malloc.h in mm/mm.h 2023-06-11 19:37:04 +03:00
kthread.h sched/spawn: Support task_spawnattr_[set|get]stackaddr 2022-10-31 12:46:58 +09:00
lirc.h
list.h include/nuttx/list.h: Restore the origin copyright notice 2023-08-23 23:00:08 +03:00
mmcsd.h mmcsd: Rename mmc_rpmb_frame_s to rpmb_frame 2023-09-10 23:10:42 +08:00
module.h
mqueue.h Indent the define statement by two spaces 2023-05-21 09:52:08 -03:00
mutex.h misc/mutex: fix assertion if nxmutex_reset() before nxmutex_unlock() 2023-02-04 02:13:15 +08:00
notifier.h notifier: add BLOCKING_INIT_NOTIFIER_HEAD support 2023-09-19 09:32:17 +08:00
nuttx.h
page.h PAGESIZE and PAGEMASK seems as common macro 2023-09-10 18:18:15 +08:00
panic_notifier.h assert: add more information to panic notifier 2023-08-03 03:17:22 -07:00
pgalloc.h
progmem.h progmem: eliminate PROGMEM_ERASESTATE configuration option 2022-03-22 10:01:41 -03:00
pthread.h sched/tls: remove PTHREAD_CLEANUP from Kconfig 2023-06-14 12:00:48 +08:00
queue.h queue.h: Implement double link list queue split 2023-09-12 22:09:00 +08:00
random.h include: Haltian Ltd: update licenses to Apache 2021-11-15 06:49:32 -06:00
reboot_notifier.h reboot: Remove SYS_DOWN to avoid the confusion 2023-04-21 20:37:59 +03:00
sched.h fix wait after vfork return error 2023-09-08 00:53:56 +03:00
sched_note.h libs/libc: currect usage of getpid/gettid in library 2023-09-20 10:08:24 +08:00
scsi.h
sdio.h mmcsd/sdio: fix potential race condition in sdio 2023-03-21 14:40:44 -03:00
sdio_slave.h Add the module of SDIO Slave 2023-08-22 20:28:24 +08:00
semaphore.h semaphore: Optimize priority inheritance with only one holder 2023-06-17 08:26:46 +03:00
signal.h style: fix multiple style issues and remove unused 2023-09-16 14:17:47 +08:00
spawn.h sched/spawn: remove spawn proxy thread to simplify task/posix_spawn() 2023-04-27 17:35:58 +08:00
spinlock.h drivers/net/netdev: improve granularity of 'quota' locking 2023-07-01 15:27:09 -03:00
streams.h c++ compatibility: rename reserved c++ keywords 'public' and 'this' 2023-09-16 19:45:02 +08:00
symtab.h libc/symtab: Move SYMTAB_XXX from unistd/Kconfig to symtab/Kconfig 2023-07-10 13:09:47 -03:00
tls.h tls: Move task_tls_alloc and task_tls_destruct to libc 2023-08-28 11:02:18 +03:00
trace.h trace: replace SCHED_NOTE_BEGIN to sched_note_begin 2023-04-19 02:53:34 +08:00
userspace.h
vt100.h
wdog.h libc: Move queue.h from include to include/nuttx 2022-09-26 08:04:58 +02:00
wqueue.h wqueue: add work_cancel_sync() support 2023-09-19 15:52:48 +08:00
zoneinfo.h