Elevator v2.0
Elevator Documenation
Loading...
Searching...
No Matches
HAL_driver.c File Reference
#include "inc/accelerometer.h"
#include "inc/elevator.h"
#include "inc/led.h"
#include "inc/pressure_sensor.h"
#include "inc/serial_communication.h"
#include "inc/servo.h"
#include "inc/button.h"
Include dependency graph for HAL_driver.c:

Functions

void elevatorButtonInterrupt (void *arg)
 elevatorButtonInterrupt interrupt routine that will update the elevator floor from the cart More...
 

Variables

Accelerometer acc
 
Led floorLed []
 
int floorLedSize = sizeof(floorLed)/sizeof(Led)
 
Led emergencyLed
 
Led arrow []
 
int arrowSize = sizeof(arrow)/sizeof(Led)
 
Button elevatorButton []
 
int elevatorButtonSize = sizeof(elevatorButton)/sizeof(Button)
 
Button emergencyButton
 
Button hc_sr501
 
Elevator myElevator
 
Servo SG90
 
Button dispatcherCallButton []
 
int dispatcherCallButtonSize = sizeof(dispatcherCallButton)/sizeof(Button)
 

Function Documentation

◆ elevatorButtonInterrupt()

void elevatorButtonInterrupt ( void *  arg)

elevatorButtonInterrupt interrupt routine that will update the elevator floor from the cart

Parameters
argarguments pass to the task

Variable Documentation

◆ acc

Initial value:
= {
.width = ACC_ADC_WIDTH,
.xaxis = X_AXIS,
.yaxis = Y_AXIS,
.zaxis = Z_AXIS,
.atten = ACC_ADC_ATTEN,
}
#define X_AXIS
Definition: accelerometer.h:23
#define ACC_ADC_WIDTH
Accelerometer Macros for modularity.
Definition: accelerometer.h:22
#define ACC_ADC_ATTEN
Definition: accelerometer.h:26
#define Z_AXIS
Definition: accelerometer.h:25
#define Y_AXIS
Definition: accelerometer.h:24

◆ arrow

Led arrow[]
Initial value:
= {
{
.gpio = 13,
.state = LED_OFF,
},
{
.gpio = 12,
.state = LED_OFF,
},
}
@ LED_OFF
Definition: led.h:45

◆ arrowSize

int arrowSize = sizeof(arrow)/sizeof(Led)

◆ dispatcherCallButton

Button dispatcherCallButton[]
Initial value:
= {
{
.gpio = 18,
.pull_sel.down = PULL_SEL_EN,
.func = NULL,
},
{
.gpio = 19,
.pull_sel.down = PULL_SEL_EN,
.func = NULL,
},
{
.gpio = 21,
.pull_sel.down = PULL_SEL_EN,
.func = NULL,
},
}
#define PULL_SEL_EN
Definition: button.h:20

◆ dispatcherCallButtonSize

int dispatcherCallButtonSize = sizeof(dispatcherCallButton)/sizeof(Button)

◆ elevatorButton

Button elevatorButton[]
Initial value:
= {
{
.gpio = 15,
.pull_sel.down = PULL_SEL_EN,
},
{
.gpio = 2,
.pull_sel.down = PULL_SEL_EN,
},
{
.gpio = 4,
.pull_sel.down = PULL_SEL_EN,
},
}
void elevatorButtonInterrupt(void *arg)
elevatorButtonInterrupt interrupt routine that will update the elevator floor from the cart
Definition: main.c:246

◆ elevatorButtonSize

int elevatorButtonSize = sizeof(elevatorButton)/sizeof(Button)

◆ emergencyButton

Button emergencyButton
Initial value:
= {
.gpio = 5,
.pull_sel.up = PULL_SEL_EN,
}

◆ emergencyLed

Led emergencyLed
Initial value:
= {
.gpio = 23,
.state = LED_OFF,
}

◆ floorLed

Led floorLed[]
Initial value:
= {
{
.gpio = 25,
.state = LED_OFF,
},
{
.gpio = 26,
.state = LED_OFF,
},
{
.gpio = 27,
.state = LED_OFF
},
}

◆ floorLedSize

int floorLedSize = sizeof(floorLed)/sizeof(Led)

◆ hc_sr501

Button hc_sr501
Initial value:
= {
.gpio = 39,
.pull_sel.down = PULL_SEL_EN,
.func = NULL,
}

◆ myElevator

Elevator myElevator
Initial value:
= {
.currFloor = 1,
.destination = 1,
.door = CLOSE,
.state = IDLE,
.prevState = IDLE,
.dir = NONE,
}
@ IDLE
Definition: elevator.h:34
@ CLOSE
Definition: elevator.h:82
@ NONE
Definition: elevator.h:61

◆ SG90

Servo SG90
Initial value:
= {
.timerNum = SERVO_TIMER,
.pwmUnit = SERVO_PWM_UNIT,
.signal = SERVO_PWM_SIGNAL,
.gpio = SERVO_GPIO,
.angle = 0}
#define SERVO_PWM_SIGNAL
Definition: servo.h:20
#define SERVO_PWM_UNIT
Definition: servo.h:19
#define SERVO_GPIO
Definition: servo.h:21
#define SERVO_TIMER
Definition: servo.h:23