Skip to content

File MotorController.cpp

FileList > fw > rbcx-coprocessor > src > MotorController.cpp

Go to the source code of this file.

  • #include "MotorController.hpp"
  • #include "Bsp.hpp"
  • #include "ControlLink.hpp"
  • #include "Dispatcher.hpp"
  • #include "Motor.hpp"
  • #include "utils/Debug.hpp"
  • #include "utils/MutexWrapper.hpp"
  • #include "utils/TaskWrapper.hpp"
  • #include "stm32f1xx_ll_tim.h"
  • #include <cstdlib>
  • #include <mutex>
  • #include <stdint.h>

Public Static Attributes

Type Name
constexpr uint32_t encoderFilter = = LL_TIM_IC_FILTER_FDIV32_N8
constexpr uint16_t maxPwm = = 2000
std::array< Motor, 4 > motor
MutexWrapper motorMut
TaskWrapper< 1024 > motorTask

Public Functions

Type Name
void motorDispatch (const CoprocReq_MotorReq & request)
void motorInit ()
void motorReset ()

Public Static Functions

Type Name
void setMotorPower (uint8_t motorIndex, int32_t power, bool brake)
void setPwmValue (TIM_TypeDef * timer, uint8_t motorIndex, uint16_t value)
void taskFunc ()

Public Static Attributes Documentation

variable encoderFilter

constexpr uint32_t encoderFilter;

variable maxPwm

constexpr uint16_t maxPwm;

variable motor

std::array<Motor, 4> motor;

variable motorMut

MutexWrapper motorMut;

variable motorTask

TaskWrapper<1024> motorTask;

Public Functions Documentation

function motorDispatch

void motorDispatch (
    const CoprocReq_MotorReq & request

function motorInit

void motorInit () 

function motorReset

void motorReset () 

Public Static Functions Documentation

function setMotorPower

static void setMotorPower (
    uint8_t motorIndex,
    int32_t power,
    bool brake

function setPwmValue

static void setPwmValue (
    TIM_TypeDef * timer,
    uint8_t motorIndex,
    uint16_t value

function taskFunc

static void taskFunc () 

The documentation for this class was generated from the following file fw/rbcx-coprocessor/src/MotorController.cpp