#define RS_DMM_BUFSIZE 256
-/* Byte 1 of the packet, and the modes it represents */
-#define RS_22_812_IND1_HZ 0x80
-#define RS_22_812_IND1_OHM 0x40
-#define RS_22_812_IND1_KILO 0x20
-#define RS_22_812_IND1_MEGA 0x10
-#define RS_22_812_IND1_FARAD 0x08
-#define RS_22_812_IND1_AMP 0x04
-#define RS_22_812_IND1_VOLT 0x02
-#define RS_22_812_IND1_MILI 0x01
-/* Byte 2 of the packet, and the modes it represents */
-#define RS_22_812_IND2_MICRO 0x80
-#define RS_22_812_IND2_NANO 0x40
-#define RS_22_812_IND2_DBM 0x20
-#define RS_22_812_IND2_SEC 0x10
-#define RS_22_812_IND2_DUTY 0x08
-#define RS_22_812_IND2_HFE 0x04
-#define RS_22_812_IND2_REL 0x02
-#define RS_22_812_IND2_MIN 0x01
-/* Byte 7 of the packet, and the modes it represents */
-#define RS_22_812_INFO_BEEP 0x80
-#define RS_22_812_INFO_DIODE 0x30
-#define RS_22_812_INFO_BAT 0x20
-#define RS_22_812_INFO_HOLD 0x10
-#define RS_22_812_INFO_NEG 0x08
-#define RS_22_812_INFO_AC 0x04
-#define RS_22_812_INFO_RS232 0x02
-#define RS_22_812_INFO_AUTO 0x01
-/* Instead of a decimal point, digit 4 carries the MAX flag */
-#define RS_22_812_DIG4_MAX 0x08
-/* Mask to remove the decimal point from a digit */
-#define RS_22_812_DP_MASK 0x08
-
-/* What the LCD values represent */
-#define RS_22_812_LCD_0 0xd7
-#define RS_22_812_LCD_1 0x50
-#define RS_22_812_LCD_2 0xb5
-#define RS_22_812_LCD_3 0xf1
-#define RS_22_812_LCD_4 0x72
-#define RS_22_812_LCD_5 0xe3
-#define RS_22_812_LCD_6 0xe7
-#define RS_22_812_LCD_7 0x51
-#define RS_22_812_LCD_8 0xf7
-#define RS_22_812_LCD_9 0xf3
-
-#define RS_22_812_LCD_C 0x87
-#define RS_22_812_LCD_E
-#define RS_22_812_LCD_F
-#define RS_22_812_LCD_h 0x66
-#define RS_22_812_LCD_H 0x76
-#define RS_22_812_LCD_I
-#define RS_22_812_LCD_n
-#define RS_22_812_LCD_P 0x37
-#define RS_22_812_LCD_r
-
#define RS_22_812_PACKET_SIZE 9
struct rs_22_812_packet {
uint8_t checksum;
};
-enum {
- RS_22_812_MODE_DC_V = 0,
- RS_22_812_MODE_AC_V = 1,
- RS_22_812_MODE_DC_UA = 2,
- RS_22_812_MODE_DC_MA = 3,
- RS_22_812_MODE_DC_A = 4,
- RS_22_812_MODE_AC_UA = 5,
- RS_22_812_MODE_AC_MA = 6,
- RS_22_812_MODE_AC_A = 7,
- RS_22_812_MODE_OHM = 8,
- RS_22_812_MODE_FARAD = 9,
- RS_22_812_MODE_HZ = 10,
- RS_22_812_MODE_VOLT_HZ = 11,
- RS_22_812_MODE_AMP_HZ = 12,
- RS_22_812_MODE_DUTY = 13,
- RS_22_812_MODE_VOLT_DUTY = 14,
- RS_22_812_MODE_AMP_DUTY = 15,
- RS_22_812_MODE_WIDTH = 16,
- RS_22_812_MODE_VOLT_WIDTH = 17,
- RS_22_812_MODE_AMP_WIDTH = 18,
- RS_22_812_MODE_DIODE = 19,
- RS_22_812_MODE_CONT = 20,
- RS_22_812_MODE_HFE = 21,
- RS_22_812_MODE_LOGIC = 22,
- RS_22_812_MODE_DBM = 23,
- // RS_22_812_MODE_EF = 24,
- RS_22_812_MODE_TEMP = 25,
- RS_22_812_MODE_INVALID = 26,
-};
-
-SR_PRIV gboolean rs_22_812_packet_valid(const struct rs_22_812_packet *rs_packet);
-
/* Private, per-device-instance driver context. */
struct dev_context {
uint64_t limit_samples;
};
SR_PRIV int radioshack_dmm_receive_data(int fd, int revents, void *cb_data);
+SR_PRIV gboolean rs_22_812_packet_valid(const struct rs_22_812_packet *rs_packet);
#endif