40#include "contiki-net.h"
47#define AT86RF215_SPI_CSN_PORT_BASE GPIO_PORT_TO_BASE(AT86RF215_SPI_CSN_PORT)
48#define AT86RF215_SPI_CSN_PIN_MASK GPIO_PIN_MASK(AT86RF215_SPI_CSN_PIN)
49#define AT86RF215_RSTN_PORT_BASE GPIO_PORT_TO_BASE(AT86RF215_RSTN_PORT)
50#define AT86RF215_RSTN_PIN_MASK GPIO_PIN_MASK(AT86RF215_RSTN_PIN)
51#define AT86RF215_PWR_PORT_BASE GPIO_PORT_TO_BASE(AT86RF215_PWR_PORT)
52#define AT86RF215_PWR_PIN_MASK GPIO_PIN_MASK(AT86RF215_PWR_PIN)
53#define AT86RF215_IRQ_PORT_BASE GPIO_PORT_TO_BASE(AT86RF215_IRQ_PORT)
54#define AT86RF215_IRQ_PIN_MASK GPIO_PIN_MASK(AT86RF215_IRQ_PIN)
66 .handler = at86rf215_interrupt_handler,
74 NVIC_EnableIRQ(AT86RF215_GPIOx_VECTOR);
86 GPIO_CLR_PIN(AT86RF215_RSTN_PORT_BASE, AT86RF215_RSTN_PIN_MASK);
92 GPIO_SET_PIN(AT86RF215_RSTN_PORT_BASE, AT86RF215_RSTN_PIN_MASK);
98 GPIO_CLR_PIN(AT86RF215_SPI_CSN_PORT_BASE, AT86RF215_SPI_CSN_PIN_MASK);
104 GPIO_SET_PIN(AT86RF215_SPI_CSN_PORT_BASE, AT86RF215_SPI_CSN_PIN_MASK);
110 SPIX_WAITFORTxREADY(AT86RF215_SPI_INSTANCE);
111 SPIX_BUF(AT86RF215_SPI_INSTANCE) = b;
112 SPIX_WAITFOREOTx(AT86RF215_SPI_INSTANCE);
113 SPIX_WAITFOREORx(AT86RF215_SPI_INSTANCE);
114 return SPIX_BUF(AT86RF215_SPI_INSTANCE);;
129 GPIO_CLR_PIN(AT86RF215_PWR_PORT_BASE , AT86RF215_PWR_PIN_MASK );
130 GPIO_CLR_PIN(AT86RF215_RSTN_PORT_BASE ,AT86RF215_RSTN_PIN_MASK );
133 GPIO_SET_PIN(AT86RF215_PWR_PORT_BASE , AT86RF215_PWR_PIN_MASK );
140 spix_cs_init(AT86RF215_SPI_CSN_PORT, AT86RF215_SPI_CSN_PIN);
163 NVIC_SetPriority(AT86RF215_GPIOx_VECTOR, 0);
void at86rf215_arch_clear_RSTN(void)
Release the radio from the reset mode.
void at86rf215_arch_enable_EXTI(void)
Enable the radio's IRQ line.
void at86rf215_arch_spi_select(void)
Select the radio's SPI chip select.
void at86rf215_isr(void)
Interrupt service routine for the AT86RF215.
void at86rf215_arch_disable_EXTI(void)
Disable the radio's IRQ line.
void at86rf215_arch_init(void)
Initialize the radio's I/O periphery.
uint8_t at86rf215_arch_spi_txrx(uint8_t b)
Transfer and receive a single byte over SPI.
void at86rf215_arch_set_RSTN(void)
Reset the radio.
void at86rf215_arch_spi_deselect(void)
Deselect the radio's SPI chip select.
Header file for the GPIO HAL.
Header file with register and macro declarations for the cc2538 GPIO module.
@ SSI0_IRQn
SSI0 Interrupt.
@ SMT_IRQn
SM Timer Interrupt.
@ GPT1A_IRQn
GPTimer 1A Interrupt.
#define GPIO_DETECT_FALLING(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE to trigger an interrupt on falling edge.
#define GPIO_SOFTWARE_CONTROL(PORT_BASE, PIN_MASK)
Configure the pin to be software controlled with PIN_MASK of port with PORT_BASE.
#define GPIO_DISABLE_INTERRUPT(PORT_BASE, PIN_MASK)
Disable interrupt triggering for pins with PIN_MASK of port with PORT_BASE.
#define GPIO_SET_INPUT(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE to input.
#define GPIO_DETECT_EDGE(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE to detect edge.
#define GPIO_SET_PIN(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE high.
#define GPIO_CLR_PIN(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE low.
#define GPIO_TRIGGER_SINGLE_EDGE(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE to trigger an interrupt on single edge (controlled by G...
#define GPIO_SET_OUTPUT(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE to output.
#define GPIO_ENABLE_INTERRUPT(PORT_BASE, PIN_MASK)
Enable interrupt triggering for pins with PIN_MASK of port with PORT_BASE.
void ioc_set_over(uint8_t port, uint8_t pin, uint8_t over)
Set Port:Pin override function.
#define IOC_OVERRIDE_PUE
Pull Up Enable.
void spix_set_mode(uint8_t spi, uint32_t frame_format, uint32_t clock_polarity, uint32_t clock_phase, uint32_t data_size)
Configure the SPI data and clock polarity and the data size for the instance given.
#define SSI_CR0_FRF_MOTOROLA
Motorola frame format.
void spix_init(uint8_t spi)
Initialize the SPI bus for the instance given.
#define SSI_IM
Interrupt mask.
void spix_cs_init(uint8_t port, uint8_t pin)
Configure a GPIO to be the chip select pin.
#define SSI0_BASE
Base address for SSI0.
void spix_set_clock_freq(uint8_t spi, uint32_t freq)
Sets the SPI clock frequency of the given SSI instance.
void gpio_hal_register_handler(gpio_hal_event_handler_t *handler)
Register a function to be called whenever a pin triggers an event.
uint32_t gpio_hal_pin_mask_t
GPIO pin mask representation.
#define gpio_hal_pin_to_mask(pin)
Convert a pin to a pin mask.
Header file with declarations for the I/O Control module.
Header file for the cc2538 SPI driver, including macros for the implementation of the low-level SPI p...
Datatype for GPIO event handlers.