found 180 bytes in pin init

This commit is contained in:
schneider 2011-12-18 04:11:47 +01:00
parent 0ce2fca5a3
commit 5a4fde88fc
1 changed files with 15 additions and 49 deletions

View File

@ -41,18 +41,18 @@ void rbInit() {
// prepare LEDs // prepare LEDs
IOCON_JTAG_TDI_PIO0_11 &= ~IOCON_JTAG_TDI_PIO0_11_FUNC_MASK; IOCON_JTAG_TDI_PIO0_11 &= ~IOCON_JTAG_TDI_PIO0_11_FUNC_MASK;
IOCON_JTAG_TDI_PIO0_11 |= IOCON_JTAG_TDI_PIO0_11_FUNC_GPIO; IOCON_JTAG_TDI_PIO0_11 |= IOCON_JTAG_TDI_PIO0_11_FUNC_GPIO;
gpioSetDir(RB_LED0, gpioDirection_Output);
gpioSetValue (RB_LED0, 0);
gpioSetDir(RB_LED1, gpioDirection_Output); uint8_t ports[] = { RB_LED0, RB_LED1, RB_LED2, RB_LED3,
gpioSetValue (RB_LED1, 0); RB_SPI_SS0, RB_SPI_SS1, RB_SPI_SS2,
RB_SPI_SS3, RB_SPI_SS4, RB_SPI_SS5,
RB_HB0, RB_HB1, RB_HB2,
RB_HB3, RB_HB4, RB_HB5};
gpioSetDir(RB_LED2, gpioDirection_Output); int i = 0;
gpioSetValue (RB_LED2, 0); while( i<8 ){
gpioSetDir(ports[i],ports[i+1], gpioDirection_Output);
gpioSetDir(RB_LED3, gpioDirection_Output); gpioSetValue (ports[i++], ports[i++], 0);
gpioSetValue (RB_LED3, 0); }
// Set LED3 to ? // Set LED3 to ?
IOCON_PIO1_11 = 0x41; IOCON_PIO1_11 = 0x41;
@ -73,47 +73,13 @@ void rbInit() {
i2cInit(I2CMASTER); // TODO FIXME via define ? i2cInit(I2CMASTER); // TODO FIXME via define ?
#endif #endif
// prepare SPI/SS // prepare SPI/SS
// TODO FIXME init miso/mosi/sck somehow ? // TODO FIXME init miso/mosi/sck somehow ?
gpioSetDir(RB_SPI_SS0, gpioDirection_Output);
gpioSetValue (RB_SPI_SS0, 1);
gpioSetDir(RB_SPI_SS1, gpioDirection_Output);
gpioSetValue (RB_SPI_SS1, 1);
gpioSetDir(RB_SPI_SS2, gpioDirection_Output);
gpioSetValue (RB_SPI_SS2, 1);
gpioSetDir(RB_SPI_SS3, gpioDirection_Output);
gpioSetValue (RB_SPI_SS3, 1);
gpioSetDir(RB_SPI_SS4, gpioDirection_Output);
gpioSetValue (RB_SPI_SS4, 1);
gpioSetDir(RB_SPI_SS5, gpioDirection_Output);
gpioSetValue (RB_SPI_SS5, 1);
// prepare hackerbus // prepare hackerbus
gpioSetDir(RB_HB0, gpioDirection_Output); while(i<sizeof(ports)){
gpioSetValue (RB_HB0, 1); gpioSetDir(ports[i],ports[i+1], gpioDirection_Output);
gpioSetValue (ports[i++], ports[i++], 1);
gpioSetDir(RB_HB1, gpioDirection_Output); }
gpioSetValue (RB_HB1, 1);
gpioSetDir(RB_HB2, gpioDirection_Output);
gpioSetValue (RB_HB2, 1);
gpioSetDir(RB_HB3, gpioDirection_Output);
gpioSetValue (RB_HB3, 1);
gpioSetDir(RB_HB4, gpioDirection_Output);
gpioSetValue (RB_HB4, 1);
gpioSetDir(RB_HB5, gpioDirection_Output);
gpioSetValue (RB_HB5, 1);
// prepare BUSINT interrupt // prepare BUSINT interrupt
//gpioSetDir(RB_BUSINT, gpioDirection_Input); //gpioSetDir(RB_BUSINT, gpioDirection_Input);