main
John Lauer
Publish assumption-based R11 assembly study, locked firmware and new review footage
d61d6cb
#ifndef ADOM_LOAD_PROTOCOL_H
#define ADOM_LOAD_PROTOCOL_H
#include "load_core.h"
#include <stddef.h>
#define LOAD_REQUEST_BYTES 256
#define LOAD_REPLY_BYTES 1024
/* Callbacks must synchronously deassert MCU_ENABLE. DAC zero follows; they must
* not wait for USB output. MCU/HAL integration and physical timing are unverified. */
typedef void (*load_hard_off)(void *context);
typedef struct {
load_core *core; load_hard_off hard_off; void *context;
char serial[33], boot[33], owner[25], frame[LOAD_REQUEST_BYTES];
uint32_t sequence, lease_ms, frame_started_ms;
size_t used; bool owned, dropping, ready;
} load_protocol;
bool load_protocol_init(load_protocol *,load_core *,const char *serial,const char *boot,
load_hard_off,void *context);
/* Feed bytes in arrival order. Newline completes one request. No command queue.
* Returns response byte count, zero if incomplete; output buffer >= LOAD_REPLY_BYTES.
* HAL must bound ingress work per control cycle and call poll even without input. */
size_t load_protocol_byte(load_protocol *,unsigned char,const load_sample *,char *,size_t);
void load_protocol_poll(load_protocol *,const load_sample *);
void load_protocol_disconnect(load_protocol *);
#endif