Vehicle Control Unit 0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
Classes | Enumerations | Functions
Sensor.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include "../Utils/Updateable.h"
Include dependency graph for Sensor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Sensor
 

Enumerations

enum  SensorType { ANALOG , DIGITAL }
 

Functions

void initSensor (Sensor *sensor, const char *name, int hz, SensorType type)
 Initializes a sensor with the given parameters. More...
 

Enumeration Type Documentation

◆ SensorType

enum SensorType
Enumerator
ANALOG 
DIGITAL 

Definition at line 9 of file Sensor.h.

9 {
10 ANALOG,
11 DIGITAL,
SensorType
Definition: Sensor.h:9
@ DIGITAL
Definition: Sensor.h:11
@ ANALOG
Definition: Sensor.h:10

Function Documentation

◆ initSensor()

void initSensor ( Sensor sensor,
const char *  name,
int  hz,
SensorType  type 
)

Initializes a sensor with the given parameters.

Parameters
sensorPointer to the Sensor structure to initialize.
namePointer to a string containing the name of the sensor.
hzThe frequency in Hertz at which the sensor operates.
typeThe type of the sensor as defined by the SensorType enum.

Definition at line 4 of file Sensor.c.

4 {
5 initUpdateable(&sensor->updateable, name, hz);
6 sensor->type = type;
7}
type
Definition: Updateable.h:17
void initUpdateable(Updateable *updateable, const char *name, int hz)
Definition: Updateable.c:6
SensorType type
Definition: Sensor.h:16
Updateable updateable
Definition: Sensor.h:15
Here is the call graph for this function:
Here is the caller graph for this function: