📄 ps_8h.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>BlueLab: ps.h File Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.8 --><div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a></div><h1>ps.h File Reference</h1>Access to persistent store. <a href="#_details">More...</a><p><h2>Functions</h2><ul><li><a class="el" href="csrtypes_8h.html#a4">uint16</a> <a class="el" href="ps_8h.html#a0">PsStore</a> (<a class="el" href="csrtypes_8h.html#a4">uint16</a> key, const void *buff, <a class="el" href="csrtypes_8h.html#a4">uint16</a> words)<dl class="el"><dd class="mdescRight">Copy the specified memory buffer to persistent store. <a href="#a0"></a><br></dl><li><a class="el" href="csrtypes_8h.html#a4">uint16</a> <a class="el" href="ps_8h.html#a1">PsRetrieve</a> (<a class="el" href="csrtypes_8h.html#a4">uint16</a> key, void *buff, <a class="el" href="csrtypes_8h.html#a4">uint16</a> words)<dl class="el"><dd class="mdescRight">Copy to specified memory buffer from persistent store. <a href="#a1"></a><br></dl><li>void <a class="el" href="ps_8h.html#a2">PsFlood</a> (void)<dl class="el"><dd class="mdescRight">Flood fill the store so a defrag must happen at next boot. <a href="#a2"></a><br></dl><li><a class="el" href="csrtypes_8h.html#a4">uint16</a> <a class="el" href="ps_8h.html#a3">PsFreeCount</a> (<a class="el" href="csrtypes_8h.html#a4">uint16</a> len)<dl class="el"><dd class="mdescRight">Return how many keys of this size we could write. <a href="#a3"></a><br></dl><li><a class="el" href="csrtypes_8h.html#a4">uint16</a> <a class="el" href="ps_8h.html#a4">PsFullRetrieve</a> (<a class="el" href="csrtypes_8h.html#a4">uint16</a> key, void *buff, <a class="el" href="csrtypes_8h.html#a4">uint16</a> words)<dl class="el"><dd class="mdescRight">Read any persistent store key which could be accessed from off-chip using BCCMD. <a href="#a4"></a><br></dl></ul><hr><a name="_details"></a><h2>Detailed Description</h2>Access to persistent store. <p>A user application running on the VM can access the persistent store on BlueCore which provides a small amount of non-volatile storage.<p>Up to fifty keys can be used,0 to 49. There are no predefined meanings for these keys; they can be used for any purpose required by the user application. However, the total amount of data associated with all the keys should be kept as small as possible, at most 1024 words.<p>The first twenty-five, 0 to 24 are protected against upload and modification via DFU (Device Firmware Upgrade) unless accompanied by a valid signature. Hence, they should be used for sensitive data such as cryptographic keys.<p><dl compact><dt><b>Notes</b></dt><dd>The persistent store is normally held in flash memory. This means that only a finite number of changes can be made to values held in persistent store without performing a defragment of the flash. The defragment is a time and memory intensice operation that is only performed at boot time. Hence the number of changes to the value of a key should be kept to a minimum. If the return code from <a class="el" href="ps_8h.html#a0">PsStore()</a> indicates a failure then the chip needs to be reset for a defragment to occur.</dd></dl>Persistent store keys can be erased by writing a zero-length value to them.<hr><h2>Function Documentation</h2><a class="anchor" name="a0" doxytag="ps.h::PsStore" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="csrtypes_8h.html#a4">uint16</a> PsStore </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="csrtypes_8h.html#a4">uint16</a> </td> <td class="mdname" nowrap> <em>key</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td></td> <td class="md" nowrap>const void * </td> <td class="mdname" nowrap> <em>buff</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td></td> <td class="md" nowrap><a class="el" href="csrtypes_8h.html#a4">uint16</a> </td> <td class="mdname" nowrap> <em>words</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Copy the specified memory buffer to persistent store. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign=top><em>key</em> </td><td>The persistent store key to copy data to. </td></tr> <tr><td></td><td valign=top><em>buff</em> </td><td>The memory buffer to copy data from. </td></tr> <tr><td></td><td valign=top><em>words</em> </td><td>The number of words to copy.</td></tr> </table></dl>Zero will be returned is either 'words' is zero or the store failed.<p>Note that the key is interpreted as an index into PSKEY_USR0, ... PSKEY_USR49. No other keys can be written from an application. </td> </tr></table><a class="anchor" name="a1" doxytag="ps.h::PsRetrieve" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="csrtypes_8h.html#a4">uint16</a> PsRetrieve </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="csrtypes_8h.html#a4">uint16</a> </td> <td class="mdname" nowrap> <em>key</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td></td> <td class="md" nowrap>void * </td> <td class="mdname" nowrap> <em>buff</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td></td> <td class="md" nowrap><a class="el" href="csrtypes_8h.html#a4">uint16</a> </td> <td class="mdname" nowrap> <em>words</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Copy to specified memory buffer from persistent store. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign=top><em>key</em> </td><td>The persistent store key to copy data from. </td></tr> <tr><td></td><td valign=top><em>buff</em> </td><td>The memory buffer to copy data to. </td></tr> <tr><td></td><td valign=top><em>words</em> </td><td>The number of words to copy.</td></tr> </table></dl>Zero will be returned if the key does not exist or the key is longer than words.<p>Note that the key is interpreted as an index into PSKEY_USR0, ... PSKEY_USR49. To read other keys from an application, see PsFullRetrieve. </td> </tr></table><a class="anchor" name="a2" doxytag="ps.h::PsFlood" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void PsFlood </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Flood fill the store so a defrag must happen at next boot. <p> </td> </tr></table><a class="anchor" name="a3" doxytag="ps.h::PsFreeCount" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="csrtypes_8h.html#a4">uint16</a> PsFreeCount </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="csrtypes_8h.html#a4">uint16</a> </td> <td class="mdname1" valign="top" nowrap> <em>len</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Return how many keys of this size we could write. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign=top><em>len</em> </td><td>The key size to use. </td></tr> </table></dl> </td> </tr></table><a class="anchor" name="a4" doxytag="ps.h::PsFullRetrieve" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="csrtypes_8h.html#a4">uint16</a> PsFullRetrieve </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="csrtypes_8h.html#a4">uint16</a> </td> <td class="mdname" nowrap> <em>key</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td></td> <td class="md" nowrap>void * </td> <td class="mdname" nowrap> <em>buff</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td></td> <td class="md" nowrap><a class="el" href="csrtypes_8h.html#a4">uint16</a> </td> <td class="mdname" nowrap> <em>words</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Read any persistent store key which could be accessed from off-chip using BCCMD. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign=top><em>key</em> </td><td>The persistent store key to copy data from. </td></tr> <tr><td></td><td valign=top><em>buff</em> </td><td>The memory buffer to copy data to. </td></tr> <tr><td></td><td valign=top><em>words</em> </td><td>The number of words to copy.</td></tr> </table></dl>Note that this uses full CSR PS key numbering, not the 0..49 space used by the other Ps functions which are restricted to accessing the VM specific keys.<p>Zero will be returned if the key does not exist or the key is longer than words. </td> </tr></table></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -