[riot-notifications] [RIOT-OS/RIOT] board: add support for SAMR34-XPRO (#11250)

Alexandre Abadie notifications at github.com
Mon Mar 25 08:48:17 CET 2019


aabadie requested changes on this pull request.

Codewise looks good in general, just minor stuff. Unfortunately I don't have the board for testing. Any chance that you could lend me one ? ;)

> @@ -0,0 +1,7 @@
+ifneq (,$(filter semtech-loramac,$(USEMODULE)))

Like for the b-l072z-lrwan1, I would replace this block with the following:
```suggestion
ifneq (,$(filter netdev_default,$(USEMODULE)))
  USEMODULE += sx1276
endif
```

You may also want to add the board to the variable `BOARD_PROVIDES_NETIF` in `examples/default`

> +void led_init(void);
+
+void board_init(void)
+{
+    /* initialize the CPU */
+    cpu_init();
+
+    /* initialize the boards LEDs */
+    led_init();
+
+    /* initialize board specific pins for LoRa */
+#ifdef MODULE_SX127X
+    gpio_init(TXCO_PWR_PIN, GPIO_OUT);
+    gpio_set(TXCO_PWR_PIN);
+    gpio_init(TX_OUTPUT_SEL_PIN, GPIO_OUT);
+    gpio_write(TX_OUTPUT_SEL_PIN, !sx127x_params[0].paselect);

Why not directly use `SX127X_PARAM_PASELECT` define instead of `sx127x_params[0].paselect`? That would be cleaner.

> +#endif
+
+/**
+ * @name Semtech SX1276 configuration
+ * @{
+ */
+#define SX127X_PARAM_SPI                    (SPI_DEV(0))
+#define SX127X_PARAM_SPI_NSS                GPIO_PIN(1, 31)       /* D10 */
+#define SX127X_PARAM_RESET                  GPIO_PIN(1, 15)       /* A0 */
+#define SX127X_PARAM_DIO0                   GPIO_PIN(1, 16)      /* D2 */
+#define SX127X_PARAM_DIO1                   GPIO_PIN(0, 11)       /* D3 */
+#define SX127X_PARAM_DIO2                   GPIO_PIN(0, 12)       /* D4 */
+#define SX127X_PARAM_DIO3                   GPIO_PIN(1, 17)       /* D5 */
+#define SX127X_PARAM_PASELECT               (SX127X_PA_RFO)
+
+#define SX127X_PARAMS                   {   .spi       = SX127X_PARAM_SPI,     \

You don't need to redefine this one since other defines below will be use in `sx127x_params.h`.

-- 
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/11250#pullrequestreview-218177583
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190325/eba91358/attachment.html>


More information about the notifications mailing list