version 1.11, 2007/11/24 17:10:07 |
version 1.14, 2007/12/16 23:16:09 |
|
|
extern struct driver saapbus_dr; |
extern struct driver saapbus_dr; |
extern struct driver sapio_dr; |
extern struct driver sapio_dr; |
extern struct driver gpioled_dr; |
extern struct driver gpioled_dr; |
|
extern struct driver saaic_dr; |
|
extern struct driver sartt_dr; |
|
extern struct driver gpiobtn_dr; |
|
|
|
|
extern void (*putchar)(char); |
extern void (*putchar)(char); |
|
|
*/ |
*/ |
struct attachinfo config_attachinfo[] = { |
struct attachinfo config_attachinfo[] = { |
/* child, parent, pminor, loc, intrno, flags */ |
/* child, parent, pminor, loc, intrno, flags */ |
{ "cpu" , "root", 0, 0, 0, 0 }, |
{ "cpu" , "root", 0, 0, -1, 0 }, |
{ "saapbus","root", 0, 0, 0, 0 }, |
{ "saapbus","root", 0, 0, -1, 0 }, |
{ "sapio", "saapbus", 0, 0, 0, 0 }, |
{ "sapio", "saapbus", 0, 0, -1, 0 }, |
{ "gpioled","sapio", 0, 17, 0, 0 }, |
{ "gpioled","sapio", 0, 17, -1, 0 }, |
{ "gpioled","sapio", 0, 18, 0, 0 }, |
{ "gpioled","sapio", 0, 18, -1, 0 }, |
{ NULL, NULL, 0, 0, 0, 0 } |
{ "gpiobtn","sapio", 0, 19, 0, 0 /*controls gpioled/0*/}, |
|
{ "gpiobtn","sapio", 0, 20, 30, 0 /*controls gpioled/1*/}, |
|
// { "sartt", "saapbus", 0, 0, 1, 0 }, |
|
{ "saaic", "saapbus", 0, 0, -1, 0 }, |
|
{ NULL, NULL, 0, 0, -1, 0 } |
}; |
}; |
|
|
|
|
|
|
{ "saapbus" , &saapbus_dr, -1 }, |
{ "saapbus" , &saapbus_dr, -1 }, |
{ "sapio", &sapio_dr, -1 }, |
{ "sapio", &sapio_dr, -1 }, |
{ "gpioled", &gpioled_dr, -1 }, |
{ "gpioled", &gpioled_dr, -1 }, |
|
{ "saaic", &saaic_dr, -1 }, |
|
{ "sartt", &sartt_dr, -1 }, |
|
{ "gpiobtn", &gpiobtn_dr, -1 }, |
{ NULL, NULL, 0 } |
{ NULL, NULL, 0 } |
}; |
}; |
|
|
|
|
while(!(*AT91C_PMC_SR & AT91C_PMC_MCKRDY)) |
while(!(*AT91C_PMC_SR & AT91C_PMC_MCKRDY)) |
; |
; |
|
|
/* enable clock to PIO and USART0 */ |
/* enable clock to all modules */ |
//*AT91C_PMC_PCER = AT91C_ID_PIOA | AT91C_ID_US0; |
|
*AT91C_PMC_PCER = AT91C_ALL_INT; |
*AT91C_PMC_PCER = AT91C_ALL_INT; |
|
|
*AT91C_PIOA_PER = (1 << 17 | 1 << 18); |
|
*AT91C_PIOA_OER = (1 << 17 | 1 << 18); |
|
*AT91C_PIOA_CODR= (1 << 17 | 1 << 18); |
|
|
|
/* initialize USART0 (we clock it in PMC above) */ |
/* initialize USART0 (we clock it in PMC above) */ |
|
|
*AT91C_PIOA_PDR = AT91C_PA5_RXD0 | /* Enable RxD0 Pin */ |
*AT91C_PIOA_PDR = AT91C_PA5_RXD0 | /* Enable RxD0 Pin */ |