2014-08-27 18:47:31 +02:00
|
|
|
/*
|
2014-05-07 13:23:41 +02:00
|
|
|
* Copyright 2014, Freie Universitaet Berlin (FUB). All rights reserved.
|
2013-08-16 10:20:23 +02:00
|
|
|
*
|
2014-08-23 15:43:13 +02:00
|
|
|
* 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.
|
2014-08-27 18:47:31 +02:00
|
|
|
*/
|
2013-05-02 08:45:47 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
2014-07-31 20:49:35 +02:00
|
|
|
* @ingroup CC2420
|
|
|
|
* @brief CC2420 dependend functions
|
2013-05-02 08:45:47 +02:00
|
|
|
*
|
2014-07-31 20:49:35 +02:00
|
|
|
* @author Heiko Will <hwill@inf.fu-berlin.de>
|
2013-05-02 08:45:47 +02:00
|
|
|
* @author Milan Babel <babel@inf.fu-berlin.de>
|
2014-05-07 13:23:41 +02:00
|
|
|
* @author Kévin Roussel <Kevin.Roussel@inria.fr>
|
2013-05-02 08:45:47 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2014-10-13 15:49:17 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2013-05-02 08:45:47 +02:00
|
|
|
/**
|
|
|
|
* @brief SPI tx and rx function.
|
|
|
|
*
|
|
|
|
* @param[in] c byte which should be transmitted.
|
|
|
|
*
|
|
|
|
* @return Byte which was received after transmitting.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
uint8_t cc2420_txrx(uint8_t c);
|
|
|
|
|
|
|
|
/**
|
2014-05-07 13:23:41 +02:00
|
|
|
* @brief Gets the status of the FIFOP pin.
|
|
|
|
*
|
|
|
|
* @return Status of the FIFOP pin.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
uint8_t cc2420_get_fifop(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Gets the status of the SFD pin.
|
2013-05-02 08:45:47 +02:00
|
|
|
*
|
2014-05-07 13:23:41 +02:00
|
|
|
* @return Status of the SFD pin.
|
2013-05-02 08:45:47 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
uint8_t cc2420_get_sfd(void);
|
|
|
|
|
2014-03-25 14:27:00 +01:00
|
|
|
/**
|
2014-05-07 13:23:41 +02:00
|
|
|
* @brief Gets the status of the CCA pin
|
2014-03-25 14:27:00 +01:00
|
|
|
*
|
2014-05-07 13:23:41 +02:00
|
|
|
* @return Status of the CCA pin.
|
2014-03-25 14:27:00 +01:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
uint8_t cc2420_get_cca(void);
|
|
|
|
|
2013-05-02 08:45:47 +02:00
|
|
|
/**
|
2014-05-07 13:23:41 +02:00
|
|
|
* @brief Does a hardware reset of the CC2420.
|
2013-05-02 08:45:47 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
void cc2420_reset(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Init the SPI interface.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void cc2420_spi_init(void);
|
|
|
|
|
|
|
|
/**
|
2014-05-07 13:23:41 +02:00
|
|
|
* @brief Selects the CC2420 on the spi bus.
|
2013-05-02 08:45:47 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
void cc2420_spi_select(void);
|
|
|
|
|
|
|
|
/**
|
2014-05-07 13:23:41 +02:00
|
|
|
* @brief Unselects the CC2420 on the spi bus.
|
2013-05-02 08:45:47 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
void cc2420_spi_unselect(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Enable interrupts on the GDO0 pin.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void cc2420_gdo0_enable(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Disable interrupts on the GDO0 pin.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void cc2420_gdo0_disable(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Enable interrupts on the GDO2 pin.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void cc2420_gdo2_enable(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Disable interrupts on the GDO2 pin.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void cc2420_gdo2_disable(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Init interrupts.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void cc2420_init_interrupts(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Function called before send to disable interrupts.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void cc2420_before_send(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Function called after send to reenable interrupts.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void cc2420_after_send(void);
|
2014-10-13 15:49:17 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|