Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: NeuroShield_SimpleScript NeuroShield_andIMU NeuroShield_Gesture_Recognition
Diff: NeuroShield.h
- Revision:
- 1:0c6bf23f2fc8
- Parent:
- 0:529602524696
- Child:
- 2:2812bcbcaaea
diff -r 529602524696 -r 0c6bf23f2fc8 NeuroShield.h
--- a/NeuroShield.h Thu Aug 17 23:31:15 2017 +0000
+++ b/NeuroShield.h Thu Jan 25 02:20:37 2018 +0000
@@ -31,6 +31,14 @@
*
*/
+/*
+ * Revision History (v1.1.3)
+ * 2018/01/03 v1.1.3 Add burst-mode read
+ * 2017/12/20 v1.1.2 Modify the structure of neurondata
+ * 2017/12/11 v1.1.1 Add Powersave command and Minor changes to the library
+ * 2017/08/17 v1.0.0 First Release
+ */
+
#ifndef _NEUROSHIELD_H
#define _NEUROSHIELD_H
@@ -57,6 +65,8 @@
#define NEURON_SIZE 256 // memory capacity of each neuron in byte
+#define POWERSAVE spi.write(NM_POWERSAVE, 1)
+
class NeuroShield
{
public:
@@ -105,10 +115,12 @@
uint16_t classify(uint8_t vector[], uint16_t length, uint16_t* distance, uint16_t* category, uint16_t* nid);
uint16_t classify(uint8_t vector[], uint16_t length, uint16_t k, uint16_t distance[], uint16_t category[], uint16_t nid[]);
- void readNeuron(uint16_t nid, uint8_t model[], uint16_t* ncr, uint16_t* aif, uint16_t* cat);
- void readNeuron(uint16_t nid, uint8_t nuerons[]);
- uint16_t readNeurons(uint8_t neurons[]);
- uint16_t writeNeurons(uint8_t neurons[]);
+ void readNeuron(uint16_t nid, uint16_t model[], uint16_t* ncr, uint16_t* aif, uint16_t* cat);
+ void readNeuron(uint16_t nid, uint16_t nuerons[]);
+ uint16_t readNeurons(uint16_t neurons[]);
+ void readCompVector(uint16_t* data, uint16_t size);
+ void writeNeurons(uint16_t neurons[], uint16_t ncount);
+ void writeCompVector(uint16_t* data, uint16_t size);
uint16_t testCommand(uint8_t read_write, uint8_t reg, uint16_t data);
@@ -116,8 +128,9 @@
void nm500Reset();
void ledSelect(uint8_t data);
- void displayNeurons(uint16_t length);
+ uint16_t total_neurons;
- uint16_t total_neurons;
+ private:
+ uint16_t support_burst_read;
};
#endif
\ No newline at end of file