[riot-notifications] [RIOT] ng_at86rf2xx: Implement CSMA en/disable and setting retries (#3138)

Oleg Hahm notifications at github.com
Tue Jun 30 23:17:13 CEST 2015


> @@ -249,6 +249,56 @@ void ng_at86rf2xx_set_max_retries(ng_at86rf2xx_t *dev, uint8_t max)
>      ng_at86rf2xx_reg_write(dev, NG_AT86RF2XX_REG__XAH_CTRL_0, tmp);
>  }
>  
> +uint8_t ng_at86rf2xx_get_csma_max_retries(ng_at86rf2xx_t *dev)
> +{
> +    uint8_t tmp;
> +    tmp  = ng_at86rf2xx_reg_read(dev, NG_AT86RF2XX_REG__XAH_CTRL_0);
> +    tmp &= NG_AT86RF2XX_XAH_CTRL_0__MAX_CSMA_RETRIES;
> +    tmp >>= 1;
> +    return tmp;
> +}
> +
> +void ng_at86rf2xx_set_csma_max_retries(ng_at86rf2xx_t *dev, int8_t retries)
> +{
> +    retries = (retries > 5) ? 5 : retries; // valid values: 0-5
> +    retries = (retries < 0) ? 7 : retries; // max < 0 => disable CSMA (set to 7)

No C++ comments, please.

---
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/3138/files#r33624771
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20150630/7c151666/attachment-0001.html>


More information about the notifications mailing list