LoRa-BLE-Sensor
Loading...
Searching...
No Matches
Functions | Variables
sensor_names.c File Reference

This is a library for sensor names, converting between strings and enum values to make configurations human readable. More...

#include <zephyr/logging/log.h>
#include <zephyr/kernel.h>
#include "sensor_names.h"
Include dependency graph for sensor_names.c:

Functions

 LOG_MODULE_REGISTER (SENSOR_NAMES, LOG_LEVEL_INF)
 
int get_sensor_voltage_name_from_index (char *voltage_name, enum sensor_voltage voltage)
 Get the name for the selected sensor voltage.
 
int get_sensor_voltage_index_from_name (char *voltage_name)
 Get the index for the selected sensor voltage.
 
int get_sensor_type_name_from_index (char *sensor_type_name, enum sensor_types sensor_type)
 Get the name for the selected sensor type.
 
int get_sensor_type_index_from_name (char *sensor_type_name)
 Get the index for the selected sensor type.
 

Variables

const char * sensor_voltage_names []
 
const char * sensor_type_names []
 

Detailed Description

This is a library for sensor names, converting between strings and enum values to make configurations human readable.

Author
Tyler Garcia
Version
0.1
Date
2025-06-06

Function Documentation

◆ get_sensor_voltage_index_from_name()

int get_sensor_voltage_index_from_name ( char *  voltage_name)

Get the index for the selected sensor voltage.

Parameters
voltage_namechar array for the name to be saved to
Returns
int index of the selected sensor voltage

◆ get_sensor_voltage_name_from_index()

int get_sensor_voltage_name_from_index ( char *  voltage_name,
enum sensor_voltage  voltage 
)

Get the name for the selected sensor voltage.

Parameters
voltage_namechar array for the name to be saved to
voltageenum sensor_voltage setting selected
Returns
int 0 if successful, -1 if invalid input

Variable Documentation

◆ sensor_type_names

const char* sensor_type_names[]
Initial value:
= {
[NULL_SENSOR] = "NULL_SENSOR",
[VOLTAGE_SENSOR] = "VOLTAGE_SENSOR",
[CURRENT_SENSOR] = "CURRENT_SENSOR",
[PULSE_SENSOR] = "PULSE_SENSOR",
}

◆ sensor_voltage_names

const char* sensor_voltage_names[]
Initial value:
= {
[SENSOR_VOLTAGE_OFF] = "SENSOR_VOLTAGE_OFF",
[SENSOR_VOLTAGE_3V3] = "SENSOR_VOLTAGE_3V3",
[SENSOR_VOLTAGE_5V] = "SENSOR_VOLTAGE_5V",
[SENSOR_VOLTAGE_6V] = "SENSOR_VOLTAGE_6V",
[SENSOR_VOLTAGE_12V] = "SENSOR_VOLTAGE_12V",
[SENSOR_VOLTAGE_24V] = "SENSOR_VOLTAGE_24V",
}