10 #include "poppy-com/inc/i2c_master.h"
11 #include "test/inc/test_mngmnt.h"
20 TEST_REGISTER = PROTOCOL_REGISTER_NB,
27 test_value = ((int)msg->
data[0] << 8) | (int)msg->
data[1];
49 unsigned char test_init(
void) {
50 printf(
"\nInitialisation :\n");
59 unsigned char id_gc(
void) {
60 printf(
"\nWrite ID GC :\n");
61 if (test(!set_extern_id(0x00, 0x0A)))
return 1;
62 if (test(ctx.
id == 0x0A))
return 1;
66 unsigned char id(
void) {
67 printf(
"\nWrite ID :\n");
68 if (test(!set_extern_id(0x01, 0x0B)))
return 1;
69 if (test(ctx.
id == 0x0B))
return 1;
73 unsigned char get_module(
void) {
74 printf(
"\nGet extern module type\n");
75 unsigned char extrn_type;
76 if (test(!get_extern_module_type(0x0B, &extrn_type)))
return 1;
77 if (test(extrn_type == DEV_BOARD))
return 1;
81 unsigned char write(
void) {
82 printf(
"\nWrite message :\n");
83 msg_t msg = {.
reg = TEST_REGISTER, .size = 2, .data[0] = 0xCA,
86 if (test(test_value == 0xCAFE))
return 1;
91 printf(
"test sequences :\n");
93 test_sequences(test_init);
94 test_sequences(id_gc);
96 test_sequences(get_module);
97 test_sequences(write);
unsigned char poppyNetwork_write(unsigned char addr, msg_t *msg)
Master mode write function.
void tx_cb(msg_t *msg)
Callback function for Slave mode messages transmission.
void poppyNetwork_init(TX_CB tx_cb, RX_CB rx_cb, RX_CB rxgc_cb)
Initialisation of the Poppy communication lib.
void rxgc_cb(msg_dir_t dir, msg_t *msg)
Callback function for Slave mode messages reception with general call.
Poppy communication main include file.
int main(void)
Your main module application process.
void rx_cb(msg_dir_t dir, msg_t *msg)
Callback function for Slave mode messages reception.
msg_dir_t
Message direction enum.