| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- /**
- ******************************************************************************
- * @file nbus_cmd.h
- * @author Juraj Dudak
- * @version v.1
- * @date 27-October-2023
- * @brief Deklaracie kodov funckií protokolu nBUS.
- ******************************************************************************
- * @attention
- *
- *
- ******************************************************************************
- */
- #ifndef NBUS_CMD_H
- #define NBUS_CMD_H
- #define CMD_ECHO 0x01
- #define CMD_STOP 0x02
- #define CMD_START 0x03
- #define CMD_PARAM 0x04
- #define CMD_SENSOR_CNT 0x05
- #define CMD_SLEEP 0x06
- #define CMD_WAKEUP 0x07
- #define CMD_CALIBRATE 0x08
- #define CMD_RESET 0x09
- #define CMD_STORE 0x0A
- #define CMD_DATA 0x0B
- #define CMD_SYNC 0x0C
- #define CMD_SENSOR_TYPE 0x0D
- #define CMD_INFO 0x0E
- // Command parameters
- #define INFO_MODULE_NAME 0xE1
- #define INFO_MODULE_TYPE 0xE2
- #define INFO_MODULE_UUID 0xE3
- #define INFO_MODULE_HW 0xE4
- #define INFO_MODULE_FW 0xE5 // ?
- #define INFO_MODULE_MEMORY_ID 0xE6
- #define PARAM_SENSOR_SAMPLERATE 0x41
- #define PARAM_SENSOR_LPF 0x42
- #define PARAM_SENSOR_FULL_SCALE 0x43
- #define PARAM_SENSOR_GAIN 0x44
- #define OK_CODE (0x00)
- #define ILLEGAL_FUNCTION (0x01)
- #define ILLEGAL_DEVICE_ADDRESS (0x02) // ?
- #define ILLEGAL_DATA_VALUE (0x03)
- #define SLAVE_DEVICE_FAILURE (0x04)
- #define ACKNOWLEDGE (0x05)
- #define DEVICE_BUSY (0x06)
- #define DEVICE_NOT_READY (0x07)
- #define PARAM_NOT_IMPLEMENTED (0x10)
- /**
- * Chyba pri vykonaní príkazu v subslave, napr. ak senzor nie je pripojený.
- * Scope: subslave
- */
- #define GENERIC_SUBSLAVE_ERROR (0x13)
- /**
- * Chyba pri inicializácii. Je potrebné resetnúť senzor.
- * Scope: subslave
- */
- #define ERR_SUBSLAVE_INIT_FAIL (0x14)
- /**
- * Vlastná chyba subslave.
- * Scope: subslave
- */
- #define SUBSLAVE_CUSTOM_ERR_1 (0x1A)
- /**
- * Vlastná chyba subslave.
- * Scope: subslave
- */
- #define SUBSLAVE_CUSTOM_ERR_2 (0x1B)
- /**
- * Vlastná chyba subslave.
- * Scope: subslave
- */
- #define SUBSLAVE_CUSTOM_ERR_3 (0x1C)
- /**
- * Vlastná chyba subslave.
- * Scope: subslave
- */
- #define SUBSLAVE_CUSTOM_ERR_4 (0x1D)
- /**
- * Vlastná chyba subslave.
- * Scope: subslave
- */
- #define SUBSLAVE_CUSTOM_ERR_5 (0x1E)
- /**
- * Vlastná chyba subslave.
- * Scope: subslave
- */
- #define SUBSLAVE_CUSTOM_ERR_6 (0x1F)
- /**
- * Chyba pri načítaní údajov - zariadenie je výstupné.
- * Scope: uBus
- */
- #define ERR_OUTPUT_ONLY (0x21)
- /**
- * Chyba pri nastavení údajov - zariadenie je vstupné.
- * Scope: uBus
- */
- #define ERR_INPUT_ONLY (0x22)
- #endif
|