sample and play see http://mbed.org/users/okini3939/notebook/I2S_TLV320AIC23B/

Dependencies:   I2SSlave TLV320 mbed

Fork of i2s_audio_echo by Suga koubou

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers PRAM.h Source File

PRAM.h

00001 #include "mbed.h"
00002 
00003 #define CMD_WREN    0x06    // Write enable
00004 #define CMD_WRDI    0x04    // Write disable
00005 #define CMD_RDID    0x9f    // Read identification 
00006 #define CMD_RDSR    0x05    // Read status register
00007 #define CMD_WRSR    0x01    // Write status registe
00008 #define CMD_READ    0x03    // Read data bytes
00009 #define CMD_FREAD   0x0b    // Read data bytes at higher speed
00010 #define CMD_PP      0x02    // Page program (legacy program)
00011 #define CMD_PP_BA   0x22    // Page program (bit-alterable write)
00012 #define CMD_PP_1S   0xd1    // Page program (On all 1s)
00013 #define CMD_SE      0xd8    // Sector erase
00014 
00015 class PRAM {
00016 public:
00017     PRAM (PinName mosi, PinName miso, PinName sclk, PinName cs);
00018     PRAM (SPI &spi, PinName cs);
00019     
00020     int status ();
00021     int write (int addr, char *buf, int len);
00022     int read (int addr, char *buf, int len);
00023 
00024 private:
00025     SPI _spi;
00026     DigitalOut _cs;
00027 };