Revision: 1458
Author: [email protected]
Date: Tue Nov 3 08:43:23 2009
Log: fixed 23k256 lib var typo
http://code.google.com/p/jallib/source/detail?r=1458
Modified:
/trunk/include/external/storage/ram/23k256/sram_23k256.jal
=======================================
--- /trunk/include/external/storage/ram/23k256/sram_23k256.jal Sun Nov 1
20:34:10 2009
+++ /trunk/include/external/storage/ram/23k256/sram_23k256.jal Tue Nov 3
08:43:23 2009
@@ -41,7 +41,7 @@
-- If you are using a procedure that reads/write more then one byte you
must
-- set SEQUENTIAL_MODE & must use the chip select pin.
--
--- Set mode before each read/write. Must be TRUE if more then one
component is
+-- Set mode before each read/write. Must be TRUE if more then one device is
-- on bus using different spi modes.
--
const byte SRAM_23K256_ALWAYS_SET_SPI_MODE = TRUE
@@ -70,7 +70,7 @@
SSPCON_CKP = 0
SSPSTAT_CKE = 1
- sram_23k236_chip_select = low -- enable the chip
+ sram_23k256_chip_select = low -- enable the chip
-- choose the 23k256 read & write mode depending on mode input
if sram_23k256_mode == SRAM_23K256_BYTE_MODE then
@@ -86,7 +86,7 @@
spi_master_hw = 0x80 + SRAM_23K256_HOLD_DISABLE
end if
- sram_23k236_chip_select = high -- disable the chip
+ sram_23k256_chip_select = high -- disable the chip
end procedure
--
----------------------------------------------------------------------------
@@ -103,10 +103,10 @@
SSPSTAT_CKE = 1
end if
- sram_23k236_chip_select = low -- enable the chip
+ sram_23k256_chip_select = low -- enable the chip
spi_master_hw = SRAM_23K256_READ_STATUS -- send read status command
settings = spi_master_hw -- get the status byte
- sram_23k236_chip_select = high -- disable the chip
+ sram_23k256_chip_select = high -- disable the chip
var bit read_hold at settings : 0 -- get bit "hold is disabled"
from 23k256 status register byte
hold_is_disabled = read_hold
@@ -132,13 +132,13 @@
var byte addr[4] at address
- sram_23k236_chip_select = low -- enable the chip
+ sram_23k256_chip_select = low -- enable the chip
spi_master_hw = SRAM_23K256_WRITE_COMMAND -- send the write command
spi_master_hw = addr[1] -- send the address
spi_master_hw = addr[0]
spi_master_hw = data -- send the data byte
- sram_23k236_chip_select = high -- disable the chip
+ sram_23k256_chip_select = high -- disable the chip
end procedure
--
----------------------------------------------------------------------------
@@ -153,12 +153,12 @@
var byte addr[4] at address
- sram_23k236_chip_select = low -- enable the chip
+ sram_23k256_chip_select = low -- enable the chip
spi_master_hw = SRAM_23K256_READ_COMMAND -- send the read command
spi_master_hw = addr[1] -- send the address
spi_master_hw = addr[0]
data = spi_master_hw -- get the data
- sram_23k236_chip_select = high -- disable the chip
+ sram_23k256_chip_select = high -- disable the chip
end procedure
--
----------------------------------------------------------------------------
@@ -173,13 +173,13 @@
var byte addr[4] at address
- sram_23k236_chip_select = low -- enable the chip
+ sram_23k256_chip_select = low -- enable the chip
spi_master_hw = SRAM_23K256_WRITE_COMMAND -- send the write command
spi_master_hw = addr[1] -- send the address
spi_master_hw = addr[0]
spi_master_hw = data -- send the data byte
- sram_23k236_chip_select = high -- disable the chip
+ sram_23k256_chip_select = high -- disable the chip
end procedure
--
----------------------------------------------------------------------------
@@ -196,12 +196,12 @@
var byte addr[4] at address
- sram_23k236_chip_select = low -- enable the chip
+ sram_23k256_chip_select = low -- enable the chip
spi_master_hw = SRAM_23K256_READ_COMMAND -- send the read command
spi_master_hw = addr[1] -- send the address
spi_master_hw = addr[0]
data = spi_master_hw -- get the data
- sram_23k236_chip_select = high -- disable the chip
+ sram_23k256_chip_select = high -- disable the chip
return data -- return the byte data
end function
@@ -222,7 +222,7 @@
var byte addr[4] at address
- sram_23k236_chip_select = low -- enable the chip
+ sram_23k256_chip_select = low -- enable the chip
spi_master_hw = SRAM_23K256_WRITE_COMMAND -- send the write command
spi_master_hw = addr[1] -- send the address
spi_master_hw = addr[0]
@@ -230,7 +230,7 @@
spi_master_hw = full_data[1] -- send byte 1
spi_master_hw = full_data[0] -- send byte 0
- sram_23k236_chip_select = high -- disable the chip
+ sram_23k256_chip_select = high -- disable the chip
end procedure
--
----------------------------------------------------------------------------
@@ -251,7 +251,7 @@
var byte addr[4] at address
- sram_23k236_chip_select = low -- enable the chip
+ sram_23k256_chip_select = low -- enable the chip
spi_master_hw = SRAM_23K256_READ_COMMAND -- send the read command
spi_master_hw = addr[1] -- send the address
spi_master_hw = addr[0]
@@ -259,7 +259,7 @@
full_data[1] = spi_master_hw -- get byte 1
full_data[0] = spi_master_hw -- get byte 0
- sram_23k236_chip_select = high -- disable the chip
+ sram_23k256_chip_select = high -- disable the chip
return data -- return the word data
end function
@@ -280,7 +280,7 @@
var byte addr[4] at address
- sram_23k236_chip_select = low -- enable the chip
+ sram_23k256_chip_select = low -- enable the chip
spi_master_hw = SRAM_23K256_WRITE_COMMAND -- send the write command
spi_master_hw = addr[1] -- send the address
spi_master_hw = addr[0]
@@ -290,7 +290,7 @@
spi_master_hw = full_data[1] -- send byte 1
spi_master_hw = full_data[0] -- send byte 0
- sram_23k236_chip_select = high -- disable the chip
+ sram_23k256_chip_select = high -- disable the chip
end procedure
--
----------------------------------------------------------------------------
@@ -311,7 +311,7 @@
var byte addr[4] at address
- sram_23k236_chip_select = low -- enable the chip
+ sram_23k256_chip_select = low -- enable the chip
spi_master_hw = SRAM_23K256_READ_COMMAND -- send the read command
spi_master_hw = addr[1] -- send the address
spi_master_hw = addr[0]
@@ -321,14 +321,14 @@
full_data[1] = spi_master_hw -- get byte 1
full_data[0] = spi_master_hw -- get byte 0
- sram_23k236_chip_select = high -- disable the chip
+ sram_23k256_chip_select = high -- disable the chip
return data -- return the dword data
end function
--
----------------------------------------------------------------------------
-- get 23K256 ready for writing and select a address to start from (fast
writes)
--- do not interupt read process by switching to another spi component
+-- do not interupt read process by switching to another spi device
--
----------------------------------------------------------------------------
procedure sram_23k256_start_write(word in address) is
-- put spi into mode 00
@@ -339,7 +339,7 @@
var byte addr[2] at address
- sram_23k236_chip_select = low -- enable the chip
+ sram_23k256_chip_select = low -- enable the chip
spi_master_hw = SRAM_23K256_WRITE_COMMAND -- send the write command
spi_master_hw = addr[1] -- send the address
spi_master_hw = addr[0]
@@ -357,12 +357,12 @@
-- tell 23K256 you are finished writing
--
----------------------------------------------------------------------------
procedure sram_23k256_stop_write() is
- sram_23k236_chip_select = high -- disable the chip
+ sram_23k256_chip_select = high -- disable the chip
end procedure
--
----------------------------------------------------------------------------
-- get 23K256 ready for reading and select a address to start from (fast
reads)
--- do not interupt read process by switching to another spi component
+-- do not interupt read process by switching to another spi device
--
----------------------------------------------------------------------------
procedure sram_23k256_start_read(word in address) is
-- put spi into mode 00
@@ -373,7 +373,7 @@
var byte addr[2] at address
- sram_23k236_chip_select = low -- enable the chip
+ sram_23k256_chip_select = low -- enable the chip
spi_master_hw = SRAM_23K256_READ_COMMAND -- send the read command
spi_master_hw = addr[1] -- send the address
spi_master_hw = addr[0]
@@ -390,6 +390,6 @@
-- tell 23K256 you are finished reading
--
----------------------------------------------------------------------------
procedure sram_23k256_stop_read() is
- sram_23k236_chip_select = high -- disable the chip
+ sram_23k256_chip_select = high -- disable the chip
end procedure
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---