Elevator v2.0
Elevator Documenation
Loading...
Searching...
No Matches
pressure_sensor.h File Reference

Hardware Application Layer for Pressure Sensor. More...

#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/adc.h"
Include dependency graph for pressure_sensor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  PressureSensor
 PressureSensor structure for Force-Sensitive Sensor. More...
 

Macros

#define PRESSURE_SENSOR_ADC_WIDTH   (adc_bits_width_t)(ADC_WIDTH_BIT_12)
 
#define PRESSURE_SENSOR_CH   ADC1_CHANNEL_5
 
#define PRESSURE_SENSOR_ADC_ATTEN   (adc_atten_t)(ADC_ATTEN_DB_11)
 
#define PRESSURE_SENSOR_THRESHOLD   2500
 

Functions

void pressureSensorInit (PressureSensor *ps)
 PressureSensor initialization for force-sensitive sensor. More...
 
int read_pressure_sensor (PressureSensor *ps)
 Read channel of the PressureSensor. More...
 

Detailed Description

Hardware Application Layer for Pressure Sensor.

Author
Jesus Minjares (https://github.com/jminjares4)
Version
0.1
Date
2021-11-27

Macro Definition Documentation

◆ PRESSURE_SENSOR_ADC_ATTEN

#define PRESSURE_SENSOR_ADC_ATTEN   (adc_atten_t)(ADC_ATTEN_DB_11)

◆ PRESSURE_SENSOR_ADC_WIDTH

#define PRESSURE_SENSOR_ADC_WIDTH   (adc_bits_width_t)(ADC_WIDTH_BIT_12)

◆ PRESSURE_SENSOR_CH

#define PRESSURE_SENSOR_CH   ADC1_CHANNEL_5

◆ PRESSURE_SENSOR_THRESHOLD

#define PRESSURE_SENSOR_THRESHOLD   2500

Function Documentation

◆ pressureSensorInit()

void pressureSensorInit ( PressureSensor ps)

PressureSensor initialization for force-sensitive sensor.

Parameters
pspass a PressureSensor by reference
Parameters
pspass a PressureSensor by reference

◆ read_pressure_sensor()

int read_pressure_sensor ( PressureSensor ps)

Read channel of the PressureSensor.

Parameters
pspass a PressureSensor by reference
Returns
int adc raw from the sensor
Parameters
pspass a PressureSensor by reference
Returns
int adc raw from the sensor