system/uorb: add voltage, current and power topics

Declare and define the uORB metadata for the voltage, current and power
types, and register them in g_sensor_list[] so that orb_get_meta() and
uorb_listener can resolve them by name.

Signed-off-by: likun17 <likun17@xiaomi.com>
This commit is contained in:
likun17 2026-09-09 19:58:03 +08:00 • committed by Xiang Xiao
parent 00d9af873d
commit b93c947608
7 changed files with 243 additions and 0 deletions

View file

@ -0,0 +1,41 @@
/****************************************************************************
* apps/system/uorb/sensor/current.c
*
* 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <sensor/current.h>
/****************************************************************************
* Private Functions
****************************************************************************/
#ifdef CONFIG_UORB_FORMAT
static const char sensor_current_format[] =
"timestamp:%" PRIu64 ",current:%hf";
#endif
/****************************************************************************
* Public Data
****************************************************************************/
ORB_DEFINE(sensor_current, struct sensor_current,
sensor_current_format);