Loading...
Searching...
No Matches
sds011_internal.h File Reference

Internal constants etc. More...

Detailed Description

Internal constants etc.

for the SDS011 laser dust sensor

Author
Michel Rottleuthner miche.nosp@m.l.ro.nosp@m.ttleu.nosp@m.thne.nosp@m.r@haw.nosp@m.-ham.nosp@m.burg..nosp@m.de

Definition in file sds011_internal.h.

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

#define SDS011_UART_BAUDRATE   (9600U)
 SDS011 baud rate.
 

SDS011 frame lengths

#define SDS011_FRAME_SEND_LEN   (19U)
 
#define SDS011_FRAME_RECV_LEN   (10U)
 

SDS011 command values

#define SDS011_CMD_DB1_SET_DR_MODE   (2U)
 
#define SDS011_CMD_DB1_QUERY_DATA   (4U)
 
#define SDS011_CMD_DB1_SET_DEV_ID   (5U)
 
#define SDS011_CMD_DB1_SET_SLEEP_WORK   (6U)
 
#define SDS011_CMD_DB1_CHECK_FIRMWARE   (7U)
 
#define SDS011_CMD_DB1_SET_WORK_PERIOD   (8U)
 

SDS011 command option values

#define SDS011_CMD_OPT_QUERY   (0U)
 
#define SDS011_CMD_OPT_SET   (1U)
 
#define SDS011_CMD_OPT_REPORT_ACTIVE   (0U)
 
#define SDS011_CMD_OPT_REPORT_QUERY   (1U)
 
#define SDS011_CMD_OPT_SLEEP   (0U)
 
#define SDS011_CMD_OPT_WORK   (1U)
 

SDS011 frame constants

#define SDS011_CMDID_QUERY   (0xB4)
 
#define SDS011_RCMDID_REPLY   (0xC5)
 
#define SDS011_RCMDID_DATA   (0xC0)
 
#define SDS011_FRAME_TAIL   (0xAB)
 
#define SDS011_FRAME_HEAD   (0xAA)
 
#define SDS011_FRAME_CSUM_MSK   (0xFF)
 

SDS011 frame value indexes

#define SDS011_FRAME_HEAD_IDX   (0U)
 
#define SDS011_CMDID_IDX   (1U)
 
#define SDS011_DB1_IDX   (2U)
 
#define SDS011_DB2_IDX   (3U)
 
#define SDS011_DB3_IDX   (4U)
 
#define SDS011_DB4_IDX   (5U)
 
#define SDS011_DB5_IDX   (6U)
 
#define SDS011_DB6_IDX   (7U)
 
#define SDS011_DEVID1_IDX   (15U)
 
#define SDS011_DEVID2_IDX   (16U)
 
#define SDS011_FRAME_SEND_TAIL_IDX   (SDS011_FRAME_SEND_LEN - 1)
 
#define SDS011_FRAME_RECV_TAIL_IDX   (SDS011_FRAME_RECV_LEN - 1)
 
#define SDS011_FRAME_SEND_CSUM_IDX   (SDS011_FRAME_SEND_LEN - 2)
 
#define SDS011_FRAME_RECV_CSUM_IDX   (SDS011_FRAME_RECV_LEN - 2)
 

Macro Definition Documentation

◆ SDS011_CMD_DB1_CHECK_FIRMWARE

#define SDS011_CMD_DB1_CHECK_FIRMWARE   (7U)

Definition at line 46 of file sds011_internal.h.

◆ SDS011_CMD_DB1_QUERY_DATA

#define SDS011_CMD_DB1_QUERY_DATA   (4U)

Definition at line 43 of file sds011_internal.h.

◆ SDS011_CMD_DB1_SET_DEV_ID

#define SDS011_CMD_DB1_SET_DEV_ID   (5U)

Definition at line 44 of file sds011_internal.h.

◆ SDS011_CMD_DB1_SET_DR_MODE

#define SDS011_CMD_DB1_SET_DR_MODE   (2U)

Definition at line 42 of file sds011_internal.h.

◆ SDS011_CMD_DB1_SET_SLEEP_WORK

#define SDS011_CMD_DB1_SET_SLEEP_WORK   (6U)

Definition at line 45 of file sds011_internal.h.

◆ SDS011_CMD_DB1_SET_WORK_PERIOD

#define SDS011_CMD_DB1_SET_WORK_PERIOD   (8U)

Definition at line 47 of file sds011_internal.h.

◆ SDS011_CMD_OPT_QUERY

#define SDS011_CMD_OPT_QUERY   (0U)

Definition at line 54 of file sds011_internal.h.

◆ SDS011_CMD_OPT_REPORT_ACTIVE

#define SDS011_CMD_OPT_REPORT_ACTIVE   (0U)

Definition at line 56 of file sds011_internal.h.

◆ SDS011_CMD_OPT_REPORT_QUERY

#define SDS011_CMD_OPT_REPORT_QUERY   (1U)

Definition at line 57 of file sds011_internal.h.

◆ SDS011_CMD_OPT_SET

#define SDS011_CMD_OPT_SET   (1U)

Definition at line 55 of file sds011_internal.h.

◆ SDS011_CMD_OPT_SLEEP

#define SDS011_CMD_OPT_SLEEP   (0U)

Definition at line 58 of file sds011_internal.h.

◆ SDS011_CMD_OPT_WORK

#define SDS011_CMD_OPT_WORK   (1U)

Definition at line 59 of file sds011_internal.h.

◆ SDS011_CMDID_IDX

#define SDS011_CMDID_IDX   (1U)

Definition at line 79 of file sds011_internal.h.

◆ SDS011_CMDID_QUERY

#define SDS011_CMDID_QUERY   (0xB4)

Definition at line 66 of file sds011_internal.h.

◆ SDS011_DB1_IDX

#define SDS011_DB1_IDX   (2U)

Definition at line 80 of file sds011_internal.h.

◆ SDS011_DB2_IDX

#define SDS011_DB2_IDX   (3U)

Definition at line 81 of file sds011_internal.h.

◆ SDS011_DB3_IDX

#define SDS011_DB3_IDX   (4U)

Definition at line 82 of file sds011_internal.h.

◆ SDS011_DB4_IDX

#define SDS011_DB4_IDX   (5U)

Definition at line 83 of file sds011_internal.h.

◆ SDS011_DB5_IDX

#define SDS011_DB5_IDX   (6U)

Definition at line 84 of file sds011_internal.h.

◆ SDS011_DB6_IDX

#define SDS011_DB6_IDX   (7U)

Definition at line 85 of file sds011_internal.h.

◆ SDS011_DEVID1_IDX

#define SDS011_DEVID1_IDX   (15U)

Definition at line 86 of file sds011_internal.h.

◆ SDS011_DEVID2_IDX

#define SDS011_DEVID2_IDX   (16U)

Definition at line 87 of file sds011_internal.h.

◆ SDS011_FRAME_CSUM_MSK

#define SDS011_FRAME_CSUM_MSK   (0xFF)

Definition at line 71 of file sds011_internal.h.

◆ SDS011_FRAME_HEAD

#define SDS011_FRAME_HEAD   (0xAA)

Definition at line 70 of file sds011_internal.h.

◆ SDS011_FRAME_HEAD_IDX

#define SDS011_FRAME_HEAD_IDX   (0U)

Definition at line 78 of file sds011_internal.h.

◆ SDS011_FRAME_RECV_CSUM_IDX

#define SDS011_FRAME_RECV_CSUM_IDX   (SDS011_FRAME_RECV_LEN - 2)

Definition at line 91 of file sds011_internal.h.

◆ SDS011_FRAME_RECV_LEN

#define SDS011_FRAME_RECV_LEN   (10U)

Definition at line 35 of file sds011_internal.h.

◆ SDS011_FRAME_RECV_TAIL_IDX

#define SDS011_FRAME_RECV_TAIL_IDX   (SDS011_FRAME_RECV_LEN - 1)

Definition at line 89 of file sds011_internal.h.

◆ SDS011_FRAME_SEND_CSUM_IDX

#define SDS011_FRAME_SEND_CSUM_IDX   (SDS011_FRAME_SEND_LEN - 2)

Definition at line 90 of file sds011_internal.h.

◆ SDS011_FRAME_SEND_LEN

#define SDS011_FRAME_SEND_LEN   (19U)

Definition at line 34 of file sds011_internal.h.

◆ SDS011_FRAME_SEND_TAIL_IDX

#define SDS011_FRAME_SEND_TAIL_IDX   (SDS011_FRAME_SEND_LEN - 1)

Definition at line 88 of file sds011_internal.h.

◆ SDS011_FRAME_TAIL

#define SDS011_FRAME_TAIL   (0xAB)

Definition at line 69 of file sds011_internal.h.

◆ SDS011_RCMDID_DATA

#define SDS011_RCMDID_DATA   (0xC0)

Definition at line 68 of file sds011_internal.h.

◆ SDS011_RCMDID_REPLY

#define SDS011_RCMDID_REPLY   (0xC5)

Definition at line 67 of file sds011_internal.h.

◆ SDS011_UART_BAUDRATE

#define SDS011_UART_BAUDRATE   (9600U)

SDS011 baud rate.

Definition at line 28 of file sds011_internal.h.