1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-09-29 12:04:46 +03:00
ben-wpan/atusb/fw2/board.c
Werner Almesberger 3e9f9613cb atusb/fw2: added proper support for interrupt polling
- board.h (read_irq), board.c: return status of the RF IRQ
- board.h (PIN, PIN_1, PIN_2): macros to read port pins
- ep0.c (my_setup): make ATUSB_POLL_INT return the real interrupt
2011-02-10 07:42:34 -03:00

29 lines
382 B
C

#include <stdint.h>
#include <avr/io.h>
#define F_CPU 8000000UL
#include <util/delay.h>
#include "board.h"
void reset_rf(void)
{
/* AT86RF231 data sheet, 12.4.13, reset pulse width: 625 ns (min) */
CLR(nRST_RF);
_delay_us(1);
SET(nRST_RF);
/* 12.4.14: SPI access latency after reset: 625 ns (min) */
_delay_us(1);
}
uint8_t read_irq(void)
{
return PIN(IRQ_RF);
}