Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions drivers/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,11 @@ ifneq (,$(filter soft_spi,$(USEMODULE)))
USEMODULE += xtimer
endif

ifneq (,$(filter sps30,$(USEMODULE)))
FEATURES_REQUIRED += periph_i2c
USEMODULE += checksum
endif

ifneq (,$(filter srf02,$(USEMODULE)))
FEATURES_REQUIRED += periph_i2c
USEMODULE += xtimer
Expand Down
4 changes: 4 additions & 0 deletions drivers/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,10 @@ ifneq (,$(filter soft_spi,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/drivers/soft_spi/include
endif

ifneq (,$(filter sps30,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/drivers/sps30/include
endif

ifneq (,$(filter srf04,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/drivers/srf04/include
endif
Expand Down
105 changes: 71 additions & 34 deletions drivers/include/saul.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ enum {
SAUL_SENSE_ID_VOLTAGE, /**< sensor: voltage */
SAUL_SENSE_ID_PH, /**< sensor: pH */
SAUL_SENSE_ID_POWER, /**< sensor: power */
SAUL_SENSE_ID_SIZE, /**< sensor: size */
SAUL_SENSE_NUMOF /**< Number of actuators supported */
/* Extend this list as needed, but keep SAUL_SENSE_ID_ANY the first and
* SAUL_SENSE_NUMOF the last entry
Expand All @@ -147,40 +148,76 @@ enum {
* and the SAUL intra-category ID (six least significant bits).
*/
enum {
SAUL_ACT_ANY = SAUL_CAT_ACT | SAUL_ACT_ID_ANY, /**< any actuator - wildcard */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if we really want to change it this way, maybe its better to relax vera++ settings to allow 120 chars per line before error

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah damn coding conventions are strict for 100 char tops, and I don't want to start a lengthy discussion (now)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we leave it as is?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah for now, maybe we should discuss the 100 char line limit in our coding conventions and argue for 120. IIRC Python has 120 max, bc 80 is nice to have but often a bit to strict.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just compiled the doc, still looks good - so let's go for it, regardless of the 100 - 120 chars discussion.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the only thing I don't like about this change is that now there are two different styles of documentation for enums in this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah but I still favor same-line-comments if possible.

SAUL_ACT_LED_RGB = SAUL_CAT_ACT | SAUL_ACT_ID_LED_RGB, /**< actuator: RGB LED */
SAUL_ACT_SERVO = SAUL_CAT_ACT | SAUL_ACT_ID_SERVO, /**< actuator: servo motor */
SAUL_ACT_MOTOR = SAUL_CAT_ACT | SAUL_ACT_ID_MOTOR, /**< actuator: motor */
SAUL_ACT_SWITCH = SAUL_CAT_ACT | SAUL_ACT_ID_SWITCH, /**< actuator: simple on/off switch */
SAUL_ACT_DIMMER = SAUL_CAT_ACT | SAUL_ACT_ID_DIMMER, /**< actuator: dimmable switch */
SAUL_SENSE_ANY = SAUL_CAT_SENSE | SAUL_SENSE_ID_ANY, /**< any sensor - wildcard */
SAUL_SENSE_BTN = SAUL_CAT_SENSE | SAUL_SENSE_ID_BTN, /**< sensor: simple button */
SAUL_SENSE_TEMP = SAUL_CAT_SENSE | SAUL_SENSE_ID_TEMP, /**< sensor: temperature */
SAUL_SENSE_HUM = SAUL_CAT_SENSE | SAUL_SENSE_ID_HUM, /**< sensor: humidity */
SAUL_SENSE_LIGHT = SAUL_CAT_SENSE | SAUL_SENSE_ID_LIGHT, /**< sensor: light */
SAUL_SENSE_ACCEL = SAUL_CAT_SENSE | SAUL_SENSE_ID_ACCEL, /**< sensor: accelerometer */
SAUL_SENSE_MAG = SAUL_CAT_SENSE | SAUL_SENSE_ID_MAG, /**< sensor: magnetometer */
SAUL_SENSE_GYRO = SAUL_CAT_SENSE | SAUL_SENSE_ID_GYRO, /**< sensor: gyroscope */
SAUL_SENSE_COLOR = SAUL_CAT_SENSE | SAUL_SENSE_ID_COLOR, /**< sensor: (light) color */
SAUL_SENSE_PRESS = SAUL_CAT_SENSE | SAUL_SENSE_ID_PRESS, /**< sensor: pressure */
SAUL_SENSE_ANALOG = SAUL_CAT_SENSE | SAUL_SENSE_ID_ANALOG, /**< sensor: raw analog value */
SAUL_SENSE_UV = SAUL_CAT_SENSE | SAUL_SENSE_ID_UV, /**< sensor: UV index */
SAUL_SENSE_OBJTEMP = SAUL_CAT_SENSE | SAUL_SENSE_ID_OBJTEMP, /**< sensor: object temperature */
SAUL_SENSE_COUNT = SAUL_CAT_SENSE | SAUL_SENSE_ID_COUNT, /**< sensor: pulse counter */
SAUL_SENSE_DISTANCE = SAUL_CAT_SENSE | SAUL_SENSE_ID_DISTANCE, /**< sensor: distance */
SAUL_SENSE_CO2 = SAUL_CAT_SENSE | SAUL_SENSE_ID_CO2, /**< sensor: CO2 Gas */
SAUL_SENSE_TVOC = SAUL_CAT_SENSE | SAUL_SENSE_ID_TVOC, /**< sensor: TVOC Gas */
SAUL_SENSE_OCCUP = SAUL_CAT_SENSE | SAUL_SENSE_ID_OCCUP, /**< sensor: occupancy */
SAUL_SENSE_PROXIMITY = SAUL_CAT_SENSE | SAUL_SENSE_ID_PROXIMITY, /**< sensor: proximity */
SAUL_SENSE_RSSI = SAUL_CAT_SENSE | SAUL_SENSE_ID_RSSI, /**< sensor: RSSI */
SAUL_SENSE_CHARGE = SAUL_CAT_SENSE | SAUL_SENSE_ID_CHARGE, /**< sensor: coulomb counter */
SAUL_SENSE_CURRENT = SAUL_CAT_SENSE | SAUL_SENSE_ID_CURRENT, /**< sensor: ammeter */
SAUL_SENSE_PM = SAUL_CAT_SENSE | SAUL_SENSE_ID_PM, /**< sensor: particulate matter */
SAUL_SENSE_CAPACITANCE = SAUL_CAT_SENSE | SAUL_SENSE_ID_CAPACITANCE, /**< sensor: capacitance */
SAUL_SENSE_VOLTAGE = SAUL_CAT_SENSE | SAUL_SENSE_ID_VOLTAGE, /**< sensor: voltage */
SAUL_SENSE_PH = SAUL_CAT_SENSE | SAUL_SENSE_ID_PH, /**< sensor: pH */
SAUL_SENSE_POWER = SAUL_CAT_SENSE | SAUL_SENSE_ID_POWER, /**< sensor: power */
SAUL_CLASS_ANY = 0xff /**< any device - wildcard */
/** any actuator - wildcard */
SAUL_ACT_ANY = SAUL_CAT_ACT | SAUL_ACT_ID_ANY,
/** actuator: RGB LED */
SAUL_ACT_LED_RGB = SAUL_CAT_ACT | SAUL_ACT_ID_LED_RGB,
/** actuator: servo motor */
SAUL_ACT_SERVO = SAUL_CAT_ACT | SAUL_ACT_ID_SERVO,
/** actuator: motor */
SAUL_ACT_MOTOR = SAUL_CAT_ACT | SAUL_ACT_ID_MOTOR,
/** actuator: simple on/off switch */
SAUL_ACT_SWITCH = SAUL_CAT_ACT | SAUL_ACT_ID_SWITCH,
/** actuator: dimmable switch */
SAUL_ACT_DIMMER = SAUL_CAT_ACT | SAUL_ACT_ID_DIMMER,
/** any sensor - wildcard */
SAUL_SENSE_ANY = SAUL_CAT_SENSE | SAUL_SENSE_ID_ANY,
/** sensor: simple button */
SAUL_SENSE_BTN = SAUL_CAT_SENSE | SAUL_SENSE_ID_BTN,
/** sensor: temperature */
SAUL_SENSE_TEMP = SAUL_CAT_SENSE | SAUL_SENSE_ID_TEMP,
/** sensor: humidity */
SAUL_SENSE_HUM = SAUL_CAT_SENSE | SAUL_SENSE_ID_HUM,
/** sensor: light */
SAUL_SENSE_LIGHT = SAUL_CAT_SENSE | SAUL_SENSE_ID_LIGHT,
/** sensor: accelerometer */
SAUL_SENSE_ACCEL = SAUL_CAT_SENSE | SAUL_SENSE_ID_ACCEL,
/** sensor: magnetometer */
SAUL_SENSE_MAG = SAUL_CAT_SENSE | SAUL_SENSE_ID_MAG,
/** sensor: gyroscope */
SAUL_SENSE_GYRO = SAUL_CAT_SENSE | SAUL_SENSE_ID_GYRO,
/** sensor: (light) color */
SAUL_SENSE_COLOR = SAUL_CAT_SENSE | SAUL_SENSE_ID_COLOR,
/** sensor: pressure */
SAUL_SENSE_PRESS = SAUL_CAT_SENSE | SAUL_SENSE_ID_PRESS,
/** sensor: raw analog value */
SAUL_SENSE_ANALOG = SAUL_CAT_SENSE | SAUL_SENSE_ID_ANALOG,
/** sensor: UV index */
SAUL_SENSE_UV = SAUL_CAT_SENSE | SAUL_SENSE_ID_UV,
/** sensor: object temperature */
SAUL_SENSE_OBJTEMP = SAUL_CAT_SENSE | SAUL_SENSE_ID_OBJTEMP,
/** sensor: pulse counter */
SAUL_SENSE_COUNT = SAUL_CAT_SENSE | SAUL_SENSE_ID_COUNT,
/** sensor: distance */
SAUL_SENSE_DISTANCE = SAUL_CAT_SENSE | SAUL_SENSE_ID_DISTANCE,
/** sensor: CO2 Gas */
SAUL_SENSE_CO2 = SAUL_CAT_SENSE | SAUL_SENSE_ID_CO2,
/** sensor: TVOC Gas */
SAUL_SENSE_TVOC = SAUL_CAT_SENSE | SAUL_SENSE_ID_TVOC,
/** sensor: occupancy */
SAUL_SENSE_OCCUP = SAUL_CAT_SENSE | SAUL_SENSE_ID_OCCUP,
/** sensor: proximity */
SAUL_SENSE_PROXIMITY = SAUL_CAT_SENSE | SAUL_SENSE_ID_PROXIMITY,
/** sensor: RSSI */
SAUL_SENSE_RSSI = SAUL_CAT_SENSE | SAUL_SENSE_ID_RSSI,
/** sensor: coulomb counter */
SAUL_SENSE_CHARGE = SAUL_CAT_SENSE | SAUL_SENSE_ID_CHARGE,
/** sensor: ammeter */
SAUL_SENSE_CURRENT = SAUL_CAT_SENSE | SAUL_SENSE_ID_CURRENT,
/** sensor: particulate matter */
SAUL_SENSE_PM = SAUL_CAT_SENSE | SAUL_SENSE_ID_PM,
/** sensor: capacitance */
SAUL_SENSE_CAPACITANCE = SAUL_CAT_SENSE | SAUL_SENSE_ID_CAPACITANCE,
/** sensor: voltage */
SAUL_SENSE_VOLTAGE = SAUL_CAT_SENSE | SAUL_SENSE_ID_VOLTAGE,
/** sensor: pH */
SAUL_SENSE_PH = SAUL_CAT_SENSE | SAUL_SENSE_ID_PH,
/** sensor: power */
SAUL_SENSE_POWER = SAUL_CAT_SENSE | SAUL_SENSE_ID_POWER,
/** sensor: size */
SAUL_SENSE_SIZE = SAUL_CAT_SENSE | SAUL_SENSE_ID_SIZE,
/** any device - wildcard */
SAUL_CLASS_ANY = 0xff
/* extend this list as needed... */
};

Expand Down
Loading