#include #include #include #include #include #include /* Support for M25P16 2Mbyte flash RAM AWOOGA Programming can only set bits to zero. IT CANNOT CHANGE A ZERO TO A ONE You MUST execute an erase cycle before programming 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_SEND Data from Master to slave SPI_RECV 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 LED_coded_flash Additionally, RAM_CS must be defined as an output on the appropriate DDR */ void read_ram_id(uint8_t* mem_ptr) { SPI_PORT &= ~(1<