#include #include #include #include #include #include /* Support for M25P16 2Mbyte flash RAM requires definitions of ATMEL ports: SPI_PORT Port for the SPI signals eg PORTB SPI_DDR DDR for the SPI signals eg DDRB SPI_PIN Input Port for the SPI signals eg PINB SPI_SCK Clock from master to slave SPI_MOSI Data from Master to slave SPI_MISO Data from slave to master RAM_PORT PORT for the RAM CS signal RAM_CS and RAM registers RAM_RDID RAM_WREN RAM_BE RAM_PP RAM_RDSR and of functions: write_spi_byte read_spi_byte Additionally, RAM_CS must be defined as an output on the appropriate DDR */ void read_ram_id(uint8_t* mem_ptr) { SPI_PORT &= ~(1<