a test program for my SPI_IS25LQ032B library. please set local-echo on for the terminal program.
Dependencies: SPI_IS25LQ032B mbed vt100
At start up the program show the list of available commands
起動すると、使用出来るコマンドの一覧が表示されます。
To see the contents of the first 256 bytes of memory, type
dump 0x00
最初の256バイトを表示させるのには dump 0x00 と入力してください。
Let's write a value 0xA5 to address 0x10
write 0x10 0xA5
Then see the result with
dump 0x00
先ず、アドレス 0x10 に 0xA5 を書き込みます。 write 0x10 0xA5
その結果を再度 dump 0x00 コマンドで表示させると
To erase the entire memory, use command
cer
メモリ全体を初期化するのには cer コマンドを使用してください。
Revision 2:05ddb1d95e2a, committed 2017-03-28
- Comitter:
- Rhyme
- Date:
- Tue Mar 28 01:24:40 2017 +0000
- Parent:
- 1:c92b1fb10573
- Commit message:
- support of quattro-II & f-shaft II added
Changed in this revision
diff -r c92b1fb10573 -r 05ddb1d95e2a main.cpp --- a/main.cpp Tue Mar 28 00:48:14 2017 +0000 +++ b/main.cpp Tue Mar 28 01:24:40 2017 +0000 @@ -1,20 +1,24 @@ #include <ctype.h> #include "mbed.h" -#include "serial_api.h" +// #include "serial_api.h" +#include "vt100.h" #include "SPI_IS25LQ032B.h" +vt100 *tty = 0 ; + // SPI_IS25LQ032B(PinName mosi, PinName miso, PinName sclk, PinName cs) ; -// FRDM_KL25Z -// D13 SPI0_SCK (PTD1) -// D12 SPI0_MISO (PTD3) -// D11 SPI0_MOSI (PTD2) -// D10 SPI0_PCS0 (PTD0) -#if FRDM_KL25Z -SPI_IS25LQ032B spi_mem(PTD2, PTD3, PTD1, PTD0) ; +#if defined (TARGET_KL25Z) +#define SPI1_SCLK PTD1 +#define SPI1_MISO PTD3 +#define SPI1_MOSI PTD2 +#define SPI1_PCS0 PTD0 +#elif defined (TARGET_K22F) +#define SPI1_SCLK PTD5 +#define SPI1_MISO PTD7 +#define SPI1_MOSI PTD6 +#define SPI1_PCS0 PTC0 #endif -#if FSHAFT_II -SPI_IS25LQ032B spi_mem(PTD5, PTD7, PTD6, PTC0) ; -#endif +SPI_IS25LQ032B spi_mem(SPI1_MOSI, SPI1_MISO, SPI1_SCLK, SPI1_PCS0) ; void usage(void) { @@ -70,8 +74,10 @@ unsigned long address = 0 ; unsigned char data[256] ; - extern serial_t stdio_uart ; - serial_baud(&stdio_uart, 115200) ; +// extern serial_t stdio_uart ; +// serial_baud(&stdio_uart, 115200) ; + tty = new vt100() ; + tty->cls() ; printf("\n\r============================\n\r") ; printf("IS25LQ032B test program\n\r") ;
diff -r c92b1fb10573 -r 05ddb1d95e2a mbed.bld --- a/mbed.bld Tue Mar 28 00:48:14 2017 +0000 +++ b/mbed.bld Tue Mar 28 01:24:40 2017 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/9bcdf88f62b0 \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/093f2bd7b9eb \ No newline at end of file
diff -r c92b1fb10573 -r 05ddb1d95e2a vt100.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vt100.lib Tue Mar 28 01:24:40 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/Rhyme/code/vt100/#b7229a9eae1c