[riot-notifications] [RIOT] drivers: add driver for encx24j600 ethernet chips (#2800)

Hauke Petersen notifications at github.com
Tue Jun 16 03:01:54 CEST 2015


> +    unlock(dev);
> +}
> +
> +static inline void enc_spi_transfer(encx24j600_t *dev, char *out, char *in, int len)
> +{
> +    gpio_clear(dev->cs);
> +    spi_transfer_bytes(dev->spi, out, in, len);
> +    gpio_set(dev->cs);
> +}
> +
> +static inline uint16_t reg_get(encx24j600_t *dev, uint8_t reg)
> +{
> +    char cmd[4] = { RCRU, reg, 0, 0 };
> +    char result[4];
> +
> +    enc_spi_transfer(dev, cmd, result, 4);

lock the bus before transfer

---
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/2800/files#r32483154
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20150615/2c7597be/attachment.html>


More information about the notifications mailing list