puzzlebox
Loading...
Searching...
No Matches
pb-mod.h
1#pragma once
2
3#include "pb-types.h"
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
20extern const char * PB_MOD_NAME;
25extern const i2c_addr_t PB_MOD_ADDR;
26
28
55void pb_i2c_recv(const uint8_t * buf, size_t sz);
67void pb_i2c_send(i2c_addr_t i2c_addr, const uint8_t * buf, size_t sz);
68
70
99
101
120bool pb_hook_i2c_recv(const uint8_t * buf, size_t sz);
131bool pb_hook_i2c_send(i2c_addr_t i2c_addr, const uint8_t * buf, size_t sz);
132
134
135#ifdef __cplusplus
136}
137#endif
bool pb_hook_i2c_send(i2c_addr_t i2c_addr, const uint8_t *buf, size_t sz)
pb_i2c_send() hook
Definition pb-mod.c:37
bool pb_hook_i2c_recv(const uint8_t *buf, size_t sz)
pb_i2c_recv() hook
Definition pb-mod.c:35
pb_global_state_t pb_hook_mod_state_read()
Global state read hook.
Definition pb-mod.c:13
void pb_hook_mod_state_write(pb_global_state_t state)
Global state write hook.
Definition pb-mod.c:15
void pb_i2c_send(i2c_addr_t i2c_addr, const uint8_t *buf, size_t sz)
Send a message in master-mode on the I²C bus (puzzle bus)
Definition mod.cpp:49
void pb_i2c_recv(const uint8_t *buf, size_t sz)
Handle a received message from the I²C bus (puzzle bus)
Definition pb-mod.c:19
const i2c_addr_t PB_MOD_ADDR
Puzzle module bus address.
Definition mod.c:5
const char * PB_MOD_NAME
Puzzle module name.
Definition pb-mod.c:8
pb_global_state_t
Puzzle module global states.
Definition pb-types.h:73
uint16_t i2c_addr_t
I²C address (10 or 7 bit)
Definition pb-types.h:30