Hi,
I am writing code for memmory read and write using spi in TWR-K65F180. I am writing code by referring the code for spi in mqx examples folder. In that example I found these defnitons, SPI serial memmory instructions. But I didn't understand the hexadecimal numbers used for defining like 0x01,0x02... please anybody explain what are this numbers or what is the use of these numbers in my code.
/* The SPI serial memory instructions */
#define SPI_MEMORY_WRITE_STATUS 0x01
#define SPI_MEMORY_WRITE_DATA 0x02
#define SPI_MEMORY_READ_DATA 0x03
#define SPI_MEMORY_WRITE_LATCH_DISABLE 0x04
#define SPI_MEMORY_READ_STATUS 0x05
#define SPI_MEMORY_WRITE_LATCH_ENABLE 0x06
#define SPI_MEMORY_CHIP_ERASE 0xC7
Hi,
The MQX SPI example shows the usage of the SPI driver to perform the basic operation including reading data from, writing data to and erasing the memory of a SPI serial flash memory chip. The SPI serial flash memory used is the SST25VF032B, the numbers you refer are the instructions used to read, write (Erase and Program), and configure the SST25VF032B device. You can find more information about the instructions in datasheet of the SST25VF032B device.
http://ww1.microchip.com/downloads/en/DeviceDoc/20005071B.pdf
Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------