/* * Copyright (C) 2013 Alaeddine Weslati * Copyright (C) 2015 Freie Universität Berlin * * This file is subject to the terms and conditions of the GNU Lesser General * Public License v2.1. See the file LICENSE in the top level directory for more * details. */ /** * @ingroup drivers_ng_at86rf2xx * @{ * * @file * @brief Internal interfaces for AT86RF2xx drivers * * @author Alaeddine Weslati * @author Thomas Eichinger * @author Hauke Petersen */ #ifndef NG_AT86RF2XX_INTERNAL_H_ #define NG_AT86RF2XX_INTERNAL_H_ #include #include "ng_at86rf2xx.h" #ifdef __cplusplus extern "C" { #endif /** * @brief Read from a register at address `addr` from device `dev`. * * @param[in] dev device to read from * @param[in] addr address of the register to read * * @return the value of the specified register */ uint8_t ng_at86rf2xx_reg_read(const ng_at86rf2xx_t *dev, const uint8_t addr); /** * @brief Write to a register at address `addr` from device `dev`. * * @param[in] dev device to write to * @param[in] addr address of the register to write * @param[in] value value to write to the given register */ void ng_at86rf2xx_reg_write(const ng_at86rf2xx_t *dev, const uint8_t addr, const uint8_t value); /** * @brief Read a chunk of data from the SRAM of the given device * * @param[in] dev device to read from * @param[in] offset starting address to read from [valid 0x00-0x7f] * @param[out] data buffer to read data into * @param[in] len number of bytes to read from SRAM */ void ng_at86rf2xx_sram_read(const ng_at86rf2xx_t *dev, const uint8_t offset, uint8_t *data, const size_t len); /** * @brief Write a chunk of data into the SRAM of the given device * * @param[in] dev device to write to * @param[in] offset address in the SRAM to write to [valid 0x00-0x7f] * @param[in] data data to copy into SRAM * @param[in] len number of bytes to write to SRAM */ void ng_at86rf2xx_sram_write(const ng_at86rf2xx_t *dev, const uint8_t offset, const uint8_t *data, const size_t len); /** * @brief Read the internal frame buffer of the given device * * Reading the frame buffer returns some extra bytes that are not accessible * through reading the RAM directly. * * @param[in] dev device to read from * @param[out] data buffer to copy the data to * @param[in] len number of bytes to read from the frame buffer */ void ng_at86rf2xx_fb_read(const ng_at86rf2xx_t *dev, uint8_t *data, const size_t len); /** * @brief Convenience function for reading the status of the given device * * @param[in] dev device to read the status from * * @return internal status of the given device */ uint8_t ng_at86rf2xx_get_status(const ng_at86rf2xx_t *dev); #ifdef __cplusplus } #endif #endif /* NG_AT86RF2XX_INTERNAL_H_ */ /** @} */