nm_write()


保存数据到指定NM(Non-volatile Memory)上

Description

int nm_write(int $nm_id, int $offset, int/string $wbuf [, int $wlen = MAX_STRING_LEN])

Parameters

Return Value

成功时保存数据大小(字节),失败时 0

Example

<?php
include "/lib/sd_340.php";
$wbuf = "abcde";
$rbuf = "";
nm_write(0, 0, $wbuf, 5);  // Writing 5 bytes of data to the address 0 of the NM0
nm_read(0, 0, $rbuf, 5);   // Reading 5 bytes of data from the address 0 of the NM0
hexdump($rbuf);            // Outputting the data
?>

See also