#ifndef _IDIBUS_SLAVE_H_ #define _IDIBUS_SLAVE_H_ #ifdef __cplusplus extern "C" { #endif #include #include #include "config.h" #include "idibus_hw.h" //============================================================================= // DEVICE DEFINITIONS // Add your devices here: ADC, Counter, 1wire, etc. Naming doesn't matter // Share enums and defines with MASTER CODE //============================================================================= #define IDIBUS_XXX_NAME_CH_NUM 4 //Add commands to the slave enum { XXX_NAME_DUMMY_CMD, XXX_NAME_GET_CMD, XXX_NAME_SET_CMD, XXX_NAME_STATUS_CMD, }; //Enumerate all devices attached enum { XXX_NAME_DEV, XXX_NAME_DEVICES_NUMBER }; //Place custom ERR codes here enum { XXX_NAME_OK = 0, XXX_NAME_NO_DATA, //No data from XXX XXX_NAME_OUT_OF_BOUNDS, //Data is out of MIN/MAX }; typedef struct { uint8_t status; //Place your custom struct for data here uint8_t ch_data; }XXX_NAME_channel_data_t; extern XXX_NAME_channel_data_t XXX_NAME_channels_data[]; void SlaveInit(); void SlaveLoop(); #ifdef __cplusplus } #endif #endif