Skip to content

File DebugLink.cpp

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

Go to the source code of this file.

  • #include <array>
  • #include <string.h>
  • #include "FreeRTOS.h"
  • #include "stream_buffer.h"
  • #include "task.h"
  • #include "stm32f1xx_hal.h"
  • #include "stm32f1xx_hal_dma.h"
  • #include "stm32f1xx_ll_usart.h"
  • #include "Bsp.hpp"
  • #include "ButtonController.hpp"
  • #include "BuzzerController.hpp"
  • #include "Dispatcher.hpp"
  • #include "I2cController.hpp"
  • #include "Mpu6050.hpp"
  • #include "OledController.hpp"
  • #include "MpuController.hpp"
  • #include "Power.hpp"
  • #include "UsbCdcLink.h"
  • #include "coproc_codec.h"
  • #include "coproc_link_parser.h"
  • #include "rbcx.pb.h"
  • #include "utils/BasePriorityRaiser.hpp"
  • #include "utils/ByteFifo.hpp"
  • #include "utils/Debug.hpp"
  • #include "utils/MessageBufferWrapper.hpp"
  • #include "utils/MutexWrapper.hpp"
  • #include "utils/QueueWrapper.hpp"
  • #include "utils/StreamBufferWrapper.hpp"
  • #include "utils/TickTimer.hpp"

Public Static Attributes

Type Name
constexpr size_t MaxLineLength = = 128
DMA_HandleTypeDef dmaRxHandle
DMA_HandleTypeDef dmaTxHandle
MessageBufferWrapper< MaxLineLength+4 > rxLineBuffer
std::array< uint8_t, 256 > txDmaBuf
StreamBufferWrapper< txDmaBuf.size() *4 > txUartStreamBuf
ByteFifo< MaxLineLength > uartRxFifo
std::array< uint8_t, CDC_DATA_SZ > usbFrameBuf
BasePriorityRaiser< usbLpIRQnPrio > usbIrqPrioRaise
ByteFifo< MaxLineLength > usbRxFifo
ByteFifo< MaxLineLength *4 > usbTxFifo

Public Functions

Type Name
void DEBUGUART_HANDLER (void)
void DEBUGUART_TX_DMA_HANDLER ()
int _write (int fd, char * data, int len)
void debugLinkPoll ()
ssize_t debugLinkTx (const uint8_t * data, size_t len)
void debugUartInit ()

Public Static Functions

Type Name
void debugDownstreamHandler ()
void debugLinkHandleCommand (const char * cmd)
void debugUpstreamHandler ()
BaseType_t processRxBuf (ByteFifo< Size > & fifo)

Macros

Type Name
define COMMAND (name, ...)

Public Static Attributes Documentation

variable MaxLineLength

constexpr size_t MaxLineLength;

variable dmaRxHandle

DMA_HandleTypeDef dmaRxHandle;

variable dmaTxHandle

DMA_HandleTypeDef dmaTxHandle;

variable rxLineBuffer

MessageBufferWrapper<MaxLineLength + 4> rxLineBuffer;

variable txDmaBuf

std::array<uint8_t, 256> txDmaBuf;

variable txUartStreamBuf

StreamBufferWrapper<txDmaBuf.size() * 4> txUartStreamBuf;

variable uartRxFifo

ByteFifo<MaxLineLength> uartRxFifo;

variable usbFrameBuf

std::array<uint8_t, CDC_DATA_SZ> usbFrameBuf;

variable usbIrqPrioRaise

BasePriorityRaiser<usbLpIRQnPrio> usbIrqPrioRaise;

variable usbRxFifo

ByteFifo<MaxLineLength> usbRxFifo;

variable usbTxFifo

ByteFifo<MaxLineLength * 4> usbTxFifo;

Public Functions Documentation

function DEBUGUART_HANDLER

void DEBUGUART_HANDLER (
    void
) 

function DEBUGUART_TX_DMA_HANDLER

void DEBUGUART_TX_DMA_HANDLER () 

function _write

int _write (
    int fd,
    char * data,
    int len
) 

function debugLinkPoll

void debugLinkPoll () 

function debugLinkTx

ssize_t debugLinkTx (
    const uint8_t * data,
    size_t len
) 

function debugUartInit

void debugUartInit () 

Public Static Functions Documentation

function debugDownstreamHandler

static void debugDownstreamHandler () 

function debugLinkHandleCommand

static void debugLinkHandleCommand (
    const char * cmd
) 

function debugUpstreamHandler

static void debugUpstreamHandler () 

function processRxBuf

template<int Size>
static BaseType_t processRxBuf (
    ByteFifo < Size > & fifo
) 

Macro Definition Documentation

define COMMAND

#define COMMAND (
    name,
    ...
) if (strncmp(cmd, name " ", sizeof(name)) == 0) {                           \
        cmd += sizeof(name);                                                   \
        __VA_ARGS__                                                            \
    }

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