ESP Line Following Buggy
2nd Year Embedded System Project (Group 48 - 2023/24)
Loading...
Searching...
No Matches
MotorDriverBoard Class Reference

Contains all the functionality of the ESP motor driver board. More...

#include <motor_driver_board.h>

Public Member Functions

 MotorDriverBoard (PinName enable_pin, PinName monitor_pin)
 Construct a new MotorDriverBoard object.
 
void update_measurements (void)
 updates the measurements of voltage and current values
 
void set_enable (bool expression)
 enable pin will be set to the boolean value in the paremeter
 
void enable (void)
 causes the enable pin to be set to HIGH
 
void disable (void)
 causes the enable pin to be set to LOW
 
float get_voltage (void)
 returns the actual voltage value
 
float get_current (void)
 returns the actual curent value
 
bool get_enable_state (void)
 returns the state of the enable pin
 

Protected Attributes

DigitalOut board_enable
 pin responsible for enabling the board
 
bool enable_state
 state of the enable pin
 
int VoltageReading
 
int CurrentReading
 gets the value of voltage and current as integers per unit value referred to in the ds2781.cpp in more detail
 
float Voltage
 
float Current
 actual value of the voltage and current
 

Detailed Description

Contains all the functionality of the ESP motor driver board.

Functionality:

  • enable/disable the board using the "enable" pin
  • read voltage and current used by the whole driver board

Uses this Library by Sam Walsh to interface with the current/voltage IC. https://os.mbed.com/users/EmbeddedSam/code/Nucleo_F401RE_DS271_Battery_Monitor/

Definition at line 26 of file motor_driver_board.h.

Constructor & Destructor Documentation

◆ MotorDriverBoard()

MotorDriverBoard::MotorDriverBoard ( PinName enable_pin,
PinName monitor_pin )

Construct a new MotorDriverBoard object.

Parameters
enable_pinmotor driver board enable (EN) pin
monitor_pinmotor driver board monitor (OneWire) pin

Definition at line 13 of file motor_driver_board.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ disable()

void MotorDriverBoard::disable ( void )

causes the enable pin to be set to LOW

Definition at line 26 of file motor_driver_board.cpp.

Here is the caller graph for this function:

◆ enable()

void MotorDriverBoard::enable ( void )

causes the enable pin to be set to HIGH

Definition at line 19 of file motor_driver_board.cpp.

◆ get_current()

float MotorDriverBoard::get_current ( void )

returns the actual curent value

Returns
float current

Definition at line 52 of file motor_driver_board.cpp.

Here is the caller graph for this function:

◆ get_enable_state()

bool MotorDriverBoard::get_enable_state ( void )

returns the state of the enable pin

Returns
true if pin is enabled
false if pin is disabled

Definition at line 58 of file motor_driver_board.cpp.

◆ get_voltage()

float MotorDriverBoard::get_voltage ( void )

returns the actual voltage value

Returns
float voltage

Definition at line 47 of file motor_driver_board.cpp.

Here is the caller graph for this function:

◆ set_enable()

void MotorDriverBoard::set_enable ( bool expression)

enable pin will be set to the boolean value in the paremeter

Parameters
expressionboolean value or operation to be applied

Definition at line 41 of file motor_driver_board.cpp.

Here is the caller graph for this function:

◆ update_measurements()

void MotorDriverBoard::update_measurements ( void )

updates the measurements of voltage and current values

Definition at line 33 of file motor_driver_board.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ board_enable

DigitalOut MotorDriverBoard::board_enable
protected

pin responsible for enabling the board

Definition at line 30 of file motor_driver_board.h.

◆ Current

float MotorDriverBoard::Current
protected

actual value of the voltage and current

Definition at line 34 of file motor_driver_board.h.

◆ CurrentReading

int MotorDriverBoard::CurrentReading
protected

gets the value of voltage and current as integers per unit value referred to in the ds2781.cpp in more detail

Definition at line 33 of file motor_driver_board.h.

◆ enable_state

bool MotorDriverBoard::enable_state
protected

state of the enable pin

Definition at line 31 of file motor_driver_board.h.

◆ Voltage

float MotorDriverBoard::Voltage
protected

Definition at line 34 of file motor_driver_board.h.

◆ VoltageReading

int MotorDriverBoard::VoltageReading
protected

Definition at line 33 of file motor_driver_board.h.


The documentation for this class was generated from the following files: