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

What sense_link.c and sense_link_view.c share and nobody else sees: the set-up's frame layout, the status register index, and three names the two files cross. More...

#include <stdbool.h>
#include <stdint.h>
#include "sense_link.h"

Go to the source code of this file.

Macros

#define FRAME_N   4u
#define BUS_AT   ((uint8_t)LINK_SN_ENABLE)
#define I228_AT   ((uint8_t)LINK_SN_I228_ADDR)
#define I3221_AT   ((uint8_t)LINK_SN_I3221_ADDR)
#define ST(reg)

Functions

sense_link_op_kind_t sense_link_write_owed (const sense_link_t *s, uint16_t *regs)
 The write owed now, or NONE, with its registers in regs.
unsigned sense_link_status_count (const sense_link_t *s)
 The registers a SENSE status read takes.

Variables

const uint16_t sense_link_en_bit [2]

Detailed Description

What sense_link.c and sense_link_view.c share and nobody else sees: the set-up's frame layout, the status register index, and three names the two files cross.

Not part of the module's interface (sense_link.h).

SPDX-License-Identifier: MIT

Macro Definition Documentation

◆ ST

#define ST ( reg)
Value:
((unsigned)(reg) - (unsigned)LINK_SN_FLAGS)

Function Documentation

◆ sense_link_status_count()

unsigned sense_link_status_count ( const sense_link_t * s)

The registers a SENSE status read takes.

Parameters
sThe link state.
Returns
SENSE_LINK_STATUS_COUNT when the AS5600 part is enabled or the INA3221 windows come from SERVO_WIN, else SENSE_LINK_STATUS_COUNT_V48.

◆ sense_link_write_owed()

sense_link_op_kind_t sense_link_write_owed ( const sense_link_t * s,
uint16_t * regs )

The write owed now, or NONE, with its registers in regs.

Parameters
sThe link state.
regsReceives the registers of the write.
Returns
The write owed, or NONE, as sense_link_op_kind_t.