/*************************************************************************** * Copyright (C) 01/2008 by Olaf Rempel * * razzor@kopf-tisch.de * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; version 2 of the License * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "AT91SAM7S256.h" #include "at91_sysc.h" #include "at91_dbgu.h" #include "at91_pitc.h" #include "at91_tests.h" #include "at91_udp.h" #include "at91_pio.h" #include "at91_twi.h" #include "at91_tc1.h" #include "static_alloc.h" #include "board.h" #include #include AT91S_AIC *aic = AT91C_BASE_AIC; AT91S_TWI *twi = AT91C_BASE_TWI; AT91S_UDP *udp = AT91C_BASE_UDP; static uint32_t pitc_test(struct pitc_timer *timer) { static uint32_t i; *AT91C_PIOA_SODR = i; i = i ^ LED_GREEN; *AT91C_PIOA_CODR = i; /* struct rc_values rc; uint32_t valid = rc_ppm_getvalues(&rc); if (!valid) rc.count = 0; printf("%d channels: ", rc.count); uint32_t j; for (j = 0; j < rc.count; j++) printf("%+3d ", rc.ch[j]); printf("\n\r"); */ return 0; } int main(void) { /* trigger pinchange-isrs */ at91_pio_init(); /* LED outputs */ *AT91C_PIOA_PER = LED_GREEN | LED_ORANGE; *AT91C_PIOA_OER = LED_GREEN | LED_ORANGE; /* needed for dbgu */ at91_sysc_init(); at91_dbgu_init(); at91_dbgu_puts("==========================================================\n\rGood morning Dave\n\r"); /* timer */ at91_pitc_init(); at91_rttc_test_init(); at91_tc1_init(); /* adc, need timer */ at91_adc_test_init(); /* twi */ at91_twi_init(); /* usb */ at91_udp_init(); struct pitc_timer *pitc_test_timer = alloc_pitc_timer(10, &pitc_test, NULL); pitc_schedule_timer(pitc_test_timer); printf("static alloc: %5ld bytes\n\r", static_alloc_used()); at91_twi_test(); while (1); }