Vehicle Control Unit 0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
Functions
Sensor.c File Reference
#include "../../Inc/Sensors/Sensor.h"
#include "../../Inc/Utils/Updateable.h"
Include dependency graph for Sensor.c:

Go to the source code of this file.

Functions

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

Function Documentation

◆ initSensor()

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

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.
childPointer to the child struct.

Definition at line 4 of file Sensor.c.

4 {
5 initUpdateable(&sensor->updateable, name, hz, SENSOR, sensor);
6 sensor->type = type;
7 sensor->child = child;
8}
void initUpdateable(Updateable *updateable, const char *name, int hz, UpdateableType utype, void *child)
Definition: Updateable.c:6
@ SENSOR
Definition: Updateable.h:19
void * child
Definition: Sensor.h:17
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: