Skip to content

File ControlLink.cpp

FileList > demo-projets > stm32 > src > ControlLink.cpp

Go to the source code of this file.

  • #include <array>
  • #include "stm32f1xx_hal.h"
  • #include "stm32f1xx_hal_dma.h"
  • #include "stm32f1xx_ll_usart.h"
  • #include "Bsp.hpp"
  • #include "Esp32Manager.hpp"
  • #include "coproc_codec.h"
  • #include "coproc_link_parser.h"
  • #include "rbcx.pb.h"
  • #include "utils/ByteFifo.hpp"
  • #include "utils/MessageBufferWrapper.hpp"

Public Static Attributes

Type Name
rb::CoprocCodec codec
DMA_HandleTypeDef dmaRxHandle
DMA_HandleTypeDef dmaTxHandle
ByteFifo< 512 > rxFifo
std::array< uint8_t, codec.MaxFrameSize > txDmaBuf
std::array< uint8_t, codec.MaxFrameSize > txEncodeBuf
MessageBufferWrapper< 512 > txMessageBuf

Public Functions

Type Name
void CONTROLUART_TX_DMA_HANDLER ()
void controlLinkReset ()
bool controlLinkRx (CoprocReq & incoming)
void controlLinkTx (const CoprocStat & outgoing)
void controlUartInit ()

Public Static Functions

Type Name
void controlLinkUpdateRxFifo ()
rb::CoprocLinkParser< CoprocReq, &CoprocReq_msg > parser (codec)

Public Static Attributes Documentation

variable codec

rb::CoprocCodec codec;

variable dmaRxHandle

DMA_HandleTypeDef dmaRxHandle;

Implements control frame exchange. Frame byte layout: [0x00 LEN_BYTE COBS_DATA...] COBS is used to avoid having zero bytes present on UART except as packet beginnings. https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing

variable dmaTxHandle

DMA_HandleTypeDef dmaTxHandle;

variable rxFifo

ByteFifo<512> rxFifo;

variable txDmaBuf

std::array<uint8_t, codec.MaxFrameSize> txDmaBuf;

variable txEncodeBuf

std::array<uint8_t, codec.MaxFrameSize> txEncodeBuf;

variable txMessageBuf

MessageBufferWrapper<512> txMessageBuf;

Public Functions Documentation

function CONTROLUART_TX_DMA_HANDLER

void CONTROLUART_TX_DMA_HANDLER () 

function controlLinkReset

void controlLinkReset () 

function controlLinkRx

bool controlLinkRx (
    CoprocReq & incoming
) 

function controlLinkTx

void controlLinkTx (
    const CoprocStat & outgoing
) 

function controlUartInit

void controlUartInit () 

Public Static Functions Documentation

function controlLinkUpdateRxFifo

static void controlLinkUpdateRxFifo () 

function parser

static rb::CoprocLinkParser< CoprocReq, &CoprocReq_msg > parser (
    codec
) 

The documentation for this class was generated from the following file demo-projets/stm32/src/ControlLink.cpp