[riot-notifications] [RIOT-OS/RIOT] drivers/sm_pwm_01c: initial import (#16217)

Leandro Lanzieri notifications at github.com
Wed Apr 7 10:24:14 CEST 2021


@leandrolanzieri commented on this pull request.

Some minor comments @fjmolinas, also can you check some warnings from the static tests that appear in the code view? Feel free to squash directly.

> +    sm_pwm_01c_params_t params;     /**< Device driver parameters */
+    sm_pwm_01c_values_t _values;    /**< Internal data to calculate concentration
+                                         from tsl/tsp low Pulse Output Occupancy */
+    ztimer_t _sampler;              /**< internal sampling timer */
+} sm_pwm_01c_t;
+
+/**
+ * @brief       Initialize the given SM_PWM_01C device
+ *
+ * @param[out]  dev         Initialized device descriptor of SM_PWM_01C device
+ * @param[in]   params      The parameters for the SM_PWM_01C device
+ *
+ * @retval                    0 on success
+ * @retval                   -EIO GPIO error
+ */
+int sm_pwm_01c_init(sm_pwm_01c_t* dev, const sm_pwm_01c_params_t* params);

Just a nitpick, but I think we usually mostly write:
```suggestion
int sm_pwm_01c_init(sm_pwm_01c_t *dev, const sm_pwm_01c_params_t *params);
```

> + * @author      Francisco Molina <francois-xavier.molina at inria.fr>
+ * @}
+ */
+
+#include <assert.h>
+#include <string.h>
+
+#include "log.h"
+#include "ztimer.h"
+
+#include "periph/gpio.h"
+
+#include "sm_pwm_01c.h"
+#include "sm_pwm_01c_params.h"
+
+#define ENABLE_DEBUG (0)

```suggestion
#define ENABLE_DEBUG 0
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16217#pullrequestreview-629718583
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210407/eb884b4e/attachment-0001.htm>


More information about the notifications mailing list