mirror of
https://github.com/rene-dev/stmbl.git
synced 2024-12-19 07:02:13 +00:00
29 lines
805 B
C
29 lines
805 B
C
#pragma once
|
|
#include <stdint.h>
|
|
|
|
#pragma pack(push, 1)
|
|
typedef struct {
|
|
uint32_t crc; // can be 0 for eth comm
|
|
uint8_t slave_addr; // calc from uid, overwrite in config
|
|
uint8_t len; // #data in byte
|
|
uint8_t conf_addr;
|
|
struct {
|
|
enum stmbl_talk_cmd_t {
|
|
NO_CMD,
|
|
WRITE_CONF, // conf[rx.header.conf_addr] = rx.header.config.u32, tx.header.config.u32 = conf[tx.header.conf_addr++]
|
|
READ_CONF, // tx.header.config.u32 = conf[rx.header.conf_addr]
|
|
DO_RESET,
|
|
BOOTLOADER,
|
|
// ENABLE,
|
|
// DISABLE, // proc / conf data = default
|
|
} cmd : 4;
|
|
uint8_t counter : 4; // packet counter, mosi: ++, miso: same as request
|
|
} flags;
|
|
union {
|
|
float f32;
|
|
uint32_t u32;
|
|
int32_t i32;
|
|
} config;
|
|
} stmbl_talk_header_t;
|
|
#pragma pack(pop)
|