rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
link_msg.h File Reference

What crosses the link, independent of the transport: an op, a page, an offset, a count and up to a page of registers. More...

#include <stdint.h>

Go to the source code of this file.

Data Structures

 One link message: the op, the register window and its values. More...

Macros

#define LINK_MAX_REGS   32
 Registers in a page, and therefore in the largest transfer.

Enumerations

enum  link_op_t {
  LINK_OP_READ = 0x01 , LINK_OP_WRITE = 0x02 , LINK_OP_DATA = 0x03 , LINK_OP_ACK = 0x04 ,
  LINK_OP_NACK = 0x05
}
 The operation a link message carries. More...
enum  link_nack_t {
  LINK_NACK_BAD_PAGE = 1 , LINK_NACK_BAD_RANGE = 2 , LINK_NACK_READ_ONLY = 3 , LINK_NACK_BAD_VALUE = 4 ,
  LINK_NACK_NOT_ARMED = 5 , LINK_NACK_BUSY = 6
}
 Reasons a NACK (negative acknowledge) carries. More...

Detailed Description

What crosses the link, independent of the transport: an op, a page, an offset, a count and up to a page of registers.

The dispatcher and the poller work on this struct; link_can.h maps it onto CAN (Controller Area Network) frames.

SPDX-License-Identifier: MIT

Enumeration Type Documentation

◆ link_nack_t

Reasons a NACK (negative acknowledge) carries.

Enumerator
LINK_NACK_BAD_RANGE 

offset + count runs off the end of a page

LINK_NACK_BUSY 

The value is good and something else holds what it names: a pin another page or an output has, or a resource the wiring needs.

Freed, the same write is taken. TONE only, since 4.17 (LINK_MINOR_TONE_BUSY); an older IOmcu says BAD_VALUE.

◆ link_op_t

enum link_op_t

The operation a link message carries.

Enumerator
LINK_OP_READ 

host asks for COUNT registers from PAGE:OFFS

LINK_OP_WRITE 

host sets them

LINK_OP_DATA 

IOmcu answers a read

LINK_OP_ACK 

IOmcu accepted a write

LINK_OP_NACK 

IOmcu refused it; regs[0] says why