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 { s_ANALOG , s_DIGITAL }
 

Functions

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

Enumeration Type Documentation

◆ SensorType

enum SensorType
Enumerator
s_ANALOG 
s_DIGITAL 

Definition at line 9 of file Sensor.h.

9 {
SensorType
Definition: Sensor.h:9
@ s_DIGITAL
Definition: Sensor.h:11
@ s_ANALOG
Definition: Sensor.h:10

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: