OpenCores
URL https://opencores.org/ocsvn/gecko3/gecko3/trunk

Subversion Repositories gecko3

[/] [gecko3/] [trunk/] [GECKO3COM/] [gecko3com-fw/] [firmware/] [src/] [spi_flash.c] - Diff between revs 35 and 36

Show entire file | Details | Blame | View Log

Rev 35 Rev 36
Line 77... Line 77...
    bitSPI_CLK = 0; //make shure spi_clk is low before we activate a device
    bitSPI_CLK = 0; //make shure spi_clk is low before we activate a device
    SPI_OE |= bmSPI_OE_MASK;  //activate spi bus
    SPI_OE |= bmSPI_OE_MASK;  //activate spi bus
    enables &= bmSPI_CS_MASK;
    enables &= bmSPI_CS_MASK;
    SPI_CS_PORT |= bmSPI_CS_MASK;   //disable all chipselect signals
    SPI_CS_PORT |= bmSPI_CS_MASK;   //disable all chipselect signals
    SPI_CS_PORT &= ~enables;
    SPI_CS_PORT &= ~enables;
    SPI_CS_OE |= enables;
    //SPI_CS_OE |= enables;
    SPI_CS_OE |= bmSPI_CS_MASK;
    SPI_CS_OE |= bmSPI_CS_MASK;
  }
  }
}
}
 
 
  //    setup_enables (0); SPI_CS_PORT |= bmSPI_CS_MASK; \                                              \
  //    setup_enables (0); SPI_CS_PORT |= bmSPI_CS_MASK; \                                              \
/** disables all SPI devices and sets the SPI and SPI CS signals to tri-state */
/** disables all SPI devices and sets the SPI and SPI CS signals to tri-state */
 
/*#define disable_all() {        \
 
    setup_enables (0);           \
 
    SPI_CS_OE &= ~bmSPI_CS_MASK; \
 
    SPI_OE &= ~bmSPI_OE_MASK;    \
 
    }*/
 
 
#define disable_all()   {        \
#define disable_all()   {        \
    setup_enables (0);           \
    SPI_CS_PORT |= bmSPI_CS_MASK;               \
    SPI_CS_OE &= ~bmSPI_CS_MASK; \
    SPI_CS_OE &= ~bmSPI_CS_MASK; \
    SPI_OE &= ~bmSPI_OE_MASK;    \
    SPI_OE &= ~bmSPI_OE_MASK;    \
}
}
 
 
 
 
/** \brief Internal: Writes one byte to the SPI bus
/** \brief Internal: Writes one byte to the SPI bus
 *
 *
 * \param[in] data to write to the bus
 * \param[in] data to write to the bus
 */
 */
static void
static void

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.