mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-10-24 05:58:43 +00:00
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:
parent
00d9af873d
commit
b93c947608
7 changed files with 243 additions and 0 deletions
41
system/uorb/sensor/current.c
Normal file
41
system/uorb/sensor/current.c
Normal 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);
|
||||
Loading…
Add table
Add a link
Reference in a new issue