Contiki 2.5
Data Structures | Macros | Functions
flash-at45db.h File Reference

    Atmel Flash EEPROM AT45DB interface definitions
More...

#include "../drv/mspi-drv.h"
#include <stdio.h>
#include <util/delay.h>

Go to the source code of this file.

Data Structures

struct  bufmgr_t
 

Macros

#define AT45DB_CS   1
 
#define AT45DB_STATUS_REG   0xD7
 
#define AT45DB_BLOCK_ERASE   0x50
 
#define AT45DB_PAGE_ERASE   0x81
 
#define AT45DB_PAGE_PROGRAM_1   0x82
 
#define AT45DB_PAGE_PROGRAM_2   0x85
 
#define AT45DB_BUFFER_1   0x84
 
#define AT45DB_BUFFER_2   0x87
 
#define AT45DB_BUF_1_TO_PAGE   0x83
 
#define AT45DB_BUF_2_TO_PAGE   0x86
 
#define AT45DB_PAGE_READ   0xD2
 
#define AT45DB_PAGE_TO_BUF   0x55
 
#define AT45DB_READ_BUFFER   0xD6
 

Functions

int8_t at45db_init (void)
 Initialize the AT45DBxx1 Flash EEPROM. More...
 
void at45db_erase_chip (void)
 This function erases the whole chip. More...
 
void at45db_erase_block (uint16_t addr)
 This function erases one block (4 Kbytes) More...
 
void at45db_erase_page (uint16_t addr)
 This function erases one page e.g. More...
 
void at45db_write_buffer (uint16_t addr, uint8_t *buffer, uint16_t bytes)
 This function writes bytes to the active buffer, while the buffer management is done automatically. More...
 
void at45db_buffer_to_page (uint16_t addr)
 This function copies the active buffer into the Flash EEPROM page. More...
 
void at45db_write_page (uint16_t p_addr, uint16_t b_addr, uint8_t *buffer, uint16_t bytes)
 This function copies the data from the the pointer into the buffer, erases the EEPROM page and flashes the new content directly into the page. More...
 
void at45db_read_page_buffered (uint16_t p_addr, uint16_t b_addr, uint8_t *buffer, uint16_t bytes)
 Bytes can be read via buffer from a Flash EEPROM page. More...
 
void at45db_read_page_bypassed (uint16_t p_addr, uint16_t b_addr, uint8_t *buffer, uint16_t bytes)
 Bytes can be read direct (bypassed) from a Flash EEPROM page. More...
 
void at45db_page_to_buf (uint16_t addr)
 Copies the given page into the buffer 2. More...
 
void at45db_read_buffer (uint16_t b_addr, uint8_t *buffer, uint16_t bytes)
 This function readouts the buffer 2 data. More...
 
void at45db_write_cmd (uint8_t *cmd)
 The command word of the AT45DBxx1 normally consists of 4 bytes. More...
 
void at45db_busy_wait (void)
 This function waits until the busy flag of the status register is set, to detect when the AT45DBxx1 device is ready to receive new commands.
 

Detailed Description

    Atmel Flash EEPROM AT45DB interface definitions
Author
Ulf Kulau kulau.nosp@m.@ibr.nosp@m..cs.t.nosp@m.u-bs.nosp@m..de

Definition in file flash-at45db.h.