1{# 2Copyright 2024 The Pigweed Authors 3 4Licensed under the Apache License, Version 2.0 (the "License"); you may not 5use this file except in compliance with the License. You may obtain a copy of 6the License at 7 8 https://www.apache.org/licenses/LICENSE-2.0 9 10Unless required by applicable law or agreed to in writing, software 11distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13License for the specific language governing permissions and limitations under 14the License. 15#} 16/* Auto-generated file, do not edit */ 17#pragma once 18 19#include "pw_sensor/types.h" 20namespace {{ package_name }} { 21 22namespace units { 23 24{% for unit_id, unit in spec.units.items() %} 25/// @brief {{ unit.name }} 26/// 27/// Measured in {{ unit.symbol }} 28PW_SENSOR_UNIT_TYPE( 29 {{ kid_from_name(unit_id) }}, 30 "PW_SENSOR_UNITS_TYPE", 31 "{{ unit.name }}", 32 "{{ unit.symbol }}" 33); 34{% endfor %} 35 36} // namespace units 37 38namespace channels { 39 40{% for channel_id, channel in spec.channels.items() %} 41/// @brief {{ channel.name }} 42/// 43/// {{ channel.description }} 44PW_SENSOR_MEASUREMENT_TYPE( 45 {{ kid_from_name(channel_id) }}, 46 "PW_SENSOR_MEASUREMENT_TYPE", 47 "{{ channel.name }}", 48 ::pw::sensor::units::{{ kid_from_name(channel.units) }} 49); 50{% endfor %} 51 52} // namespace channels 53 54namespace attributes { 55 56{% for attribute_id, attribute in spec.attributes.items() %} 57/// @brief {{ attribute.name }} 58/// 59/// {{ attribute.description }} 60PW_SENSOR_ATTRIBUTE_TYPE( 61 {{ kid_from_name(attribute_id) }}, 62 "PW_SENSOR_ATTRIBUTE_TYPE", 63 "{{ attribute.name }}" 64); 65{% endfor %} 66 67} // namespace attributes 68 69namespace triggers { 70 71{% for trigger_id, trigger in spec.triggers.items() %} 72/// @brief {{ trigger.name }} 73/// 74/// {{ trigger.description }} 75PW_SENSOR_TRIGGER_TYPE( 76 {{ kid_from_name(trigger_id) }}, 77 "PW_SENSOR_TRIGGER_TYPE", 78 "{{ trigger.name }}" 79); 80{% endfor %} 81 82} // namespace triggers 83 84} // namespace {{ package_name }} 85