A library for observing RAM utilization with an oscilloscope.
scope_RAM.h@0:e996e4a4c783, 2013-11-12 (annotated)
- Committer:
- altasoul
- Date:
- Tue Nov 12 07:16:15 2013 +0000
- Revision:
- 0:e996e4a4c783
- Child:
- 1:b6905730f836
first light
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
altasoul | 0:e996e4a4c783 | 1 | #ifndef SCOPE_RAM_H |
altasoul | 0:e996e4a4c783 | 2 | #define SCOPE_RAM_H |
altasoul | 0:e996e4a4c783 | 3 | #include "rtos.h" |
altasoul | 0:e996e4a4c783 | 4 | |
altasoul | 0:e996e4a4c783 | 5 | #define WATERMARK 0xaa |
altasoul | 0:e996e4a4c783 | 6 | |
altasoul | 0:e996e4a4c783 | 7 | class RAMscope { |
altasoul | 0:e996e4a4c783 | 8 | |
altasoul | 0:e996e4a4c783 | 9 | public: |
altasoul | 0:e996e4a4c783 | 10 | RAMscope(PinName trigger_pin, PinName value_pin); |
altasoul | 0:e996e4a4c783 | 11 | void watermark(unsigned char *start, int length); |
altasoul | 0:e996e4a4c783 | 12 | void scope(unsigned char *start, int length=128, int period=10); |
altasoul | 0:e996e4a4c783 | 13 | void stop(); |
altasoul | 0:e996e4a4c783 | 14 | |
altasoul | 0:e996e4a4c783 | 15 | private: |
altasoul | 0:e996e4a4c783 | 16 | DigitalOut trigger_output, value_output; |
altasoul | 0:e996e4a4c783 | 17 | RtosTimer scope_ram_timer; |
altasoul | 0:e996e4a4c783 | 18 | static void scope_ram(const void *arg); |
altasoul | 0:e996e4a4c783 | 19 | void output_to_scope(void); |
altasoul | 0:e996e4a4c783 | 20 | unsigned char *start; |
altasoul | 0:e996e4a4c783 | 21 | int length; |
altasoul | 0:e996e4a4c783 | 22 | }; |
altasoul | 0:e996e4a4c783 | 23 | |
altasoul | 0:e996e4a4c783 | 24 | #endif |