sam7fc/include/board.h
2008-06-23 15:16:52 +02:00

44 lines
1.0 KiB
C

#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 */
#define LED_ORANGE AT91C_PIO_PA24
#define LED_GREEN AT91C_PIO_PA23
/* Taster PIOs */
#define TAST1 AT91C_PIO_PA0
#define TAST2 AT91C_PIO_PA1
/* USB PIOs */
#define UDP_VBUS_MON AT91C_PIO_PA8
#define UDP_PULLUP AT91C_PIO_PA16
/* 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 */
#define IRQPRIO_TC1 5 /* ppm capturing */
/* 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_*/