2008-02-03 21:41:39 +01:00
|
|
|
#ifndef BOARD_H_
|
|
|
|
#define BOARD_H_
|
|
|
|
|
|
|
|
#include "AT91SAM7S256.h"
|
|
|
|
|
|
|
|
/* keep in sync with at91_init1.c */
|
|
|
|
#define MAINCK 18432000
|
|
|
|
#define PLLCK (MAINCK / 24 * 125) /* 96MHz */
|
|
|
|
#define MCK (PLLCK / 2) /* 48MHz */
|
|
|
|
|
|
|
|
/* DBGU UART Baudrate calculation */
|
|
|
|
#define BAUD_TO_DIV(BAUD) (MCK / (16 * BAUD))
|
|
|
|
|
|
|
|
/* LED PIOs */
|
2008-02-29 19:50:08 +01:00
|
|
|
#define LED_ORANGE AT91C_PIO_PA24
|
|
|
|
#define LED_GREEN AT91C_PIO_PA23
|
2008-02-03 21:41:39 +01:00
|
|
|
|
|
|
|
/* Taster PIOs */
|
2008-02-29 19:50:08 +01:00
|
|
|
#define TAST1 AT91C_PIO_PA0
|
|
|
|
#define TAST2 AT91C_PIO_PA1
|
2008-02-03 21:41:39 +01:00
|
|
|
|
|
|
|
/* USB PIOs */
|
2008-02-29 19:50:08 +01:00
|
|
|
#define UDP_VBUS_MON AT91C_PIO_PA8
|
|
|
|
#define UDP_PULLUP AT91C_PIO_PA16
|
2008-02-03 21:41:39 +01:00
|
|
|
|
|
|
|
/* ATMEL IDs */
|
|
|
|
#define USB_VENDOR_ID 0x03EB
|
|
|
|
#define USB_PRODUCT_ID 0x6124
|
|
|
|
|
|
|
|
/* Interrupt Priorities (7 = highest) */
|
|
|
|
#define IRQPRIO_SYSC 6 /* pitc */
|
|
|
|
#define IRQPRIO_PIOA 1 /* pinchange interrupts */
|
|
|
|
#define IRQPRIO_ADC 2
|
|
|
|
#define IRQPRIO_TWI 7 /* twi must be fast! */
|
|
|
|
#define IRQPRIO_UDP 4 /* usb */
|
2008-02-04 18:19:25 +01:00
|
|
|
#define IRQPRIO_TC1 5 /* ppm capturing */
|
2008-02-03 21:41:39 +01:00
|
|
|
|
|
|
|
/* TODO: find better place */
|
|
|
|
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*x))
|
|
|
|
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
|
|
|
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
|
|
|
|
|
|
|
#endif /*BOARD_H_*/
|