Prusa MINI Firmware overview
|
Go to the documentation of this file.
24 #include "../core/macros.h"
34 #define TWIBUS_BUFFER_SIZE 32
190 #if I2C_SLAVE_ADDRESS > 0
220 void reply(
char str[]=
nullptr);
221 inline void reply(
const char str[]) { reply((
char*)str); }
225 #if ENABLED(DEBUG_TWIBUS)
231 static void prefix(
const char func[]);
232 static void debug(
const char func[], uint32_t adr);
233 static void debug(
const char func[],
char c);
234 static void debug(
const char func[],
char adr[]);
235 static inline void debug(
const char func[],
uint8_t v) { debug(func, (uint32_t)v); }
#define I2C_SLAVE_ADDRESS
Definition: Configuration_A3ides_2209_MINI_adv.h:1883
#define WITHIN(N, L, H)
Definition: macros.h:195
#define SERIAL_CHAR(x)
Definition: serial.h:69
void(* twiRequestFunc_t)()
Definition: twibus.h:32
void address(const uint8_t adr)
Set the target slave address.
uint8_t addr
Target device address @description The target device address. Persists until changed.
Definition: twibus.h:73
void reset()
Reset the buffer.
void beginTransmission(uint8_t)
Definition: Wire.cpp:16
#define I2C_ADDRESS(A)
Definition: macros.h:292
void addbyte(const char c)
Add one byte to the buffer.
#define SERIAL_ECHOPAIR(V...)
Definition: serial.h:114
uint8_t requestFrom(uint8_t, uint8_t)
Definition: Wire.cpp:24
uint8_t i
Definition: screen_test_graph.c:72
#define SERIAL_ECHO_START()
Definition: serial.h:179
#define SERIAL_ECHOLN(x)
Definition: serial.h:72
void(* twiReceiveFunc_t)(int bytes)
Definition: twibus.h:31
#define SERIAL_ECHO_MSG(S)
Definition: serial.h:183
#define PSTR(str)
Definition: pgmspace.h:31
virtual size_t write(uint8_t)
Definition: Wire.cpp:32
uint8_t capture(char *dst, const uint8_t bytes)
Capture data from the bus into the buffer.
TwoWire Wire
Definition: Wire.cpp:60
#define COUNT(a)
Definition: macros.h:200
virtual int read(void)
Definition: Wire.cpp:49
void begin(void)
Definition: Wire.cpp:13
void
Definition: png.h:1083
#define SERIAL_ECHOPGM(S)
Definition: serial.h:173
static void echodata(uint8_t bytes, const char prefix[], uint8_t adr)
Echo data on the bus to serial.
const uint8_t[]
Definition: 404_html.c:3
void addbytes(char src[], uint8_t bytes)
Add some bytes to the buffer.
static void flush()
Flush the i2c bus.
bool request(const uint8_t bytes)
Request data from the slave device and wait.
void echobuffer(const char prefix[], uint8_t adr)
Echo data in the buffer to serial.
#define DEBUGGING(F)
Definition: serial.h:47
void addstring(char str[])
Add a null-terminated string to the buffer.
#define SERIAL_EOL()
Definition: serial.h:181
#define TWIBUS_BUFFER_SIZE
Definition: twibus.h:34
uint8_t endTransmission(void)
Definition: Wire.cpp:20
virtual int available(void)
Definition: Wire.cpp:45
void relay(const uint8_t bytes)
Request data from the slave device, echo to serial.
TWIBus()
Class constructor.
void serialprintPGM(PGM_P str)
Definition: serial.cpp:35
void send()
Send the buffer data to the bus.
static void echoprefix(uint8_t bytes, const char prefix[], uint8_t adr)
Prefix for echo to serial.