A library for observing RAM utilization with an oscilloscope.

Committer:
altasoul
Date:
Tue Nov 12 07:35:11 2013 +0000
Revision:
1:b6905730f836
Parent:
0:e996e4a4c783
for publication (no docs yet)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
altasoul 1:b6905730f836 1 /*
altasoul 1:b6905730f836 2 * Copyright (c) 2013 Tom Soulanille
altasoul 1:b6905730f836 3 *
altasoul 1:b6905730f836 4 *
altasoul 1:b6905730f836 5 * Licensed under the Apache License, Version 2.0 (the "License");
altasoul 1:b6905730f836 6 * you may not use this file except in compliance with the License.
altasoul 1:b6905730f836 7 * You may obtain a copy of the License at
altasoul 1:b6905730f836 8 *
altasoul 1:b6905730f836 9 * http://www.apache.org/licenses/LICENSE-2.0
altasoul 1:b6905730f836 10 *
altasoul 1:b6905730f836 11 * Unless required by applicable law or agreed to in writing, software
altasoul 1:b6905730f836 12 * distributed under the License is distributed on an "AS IS" BASIS,
altasoul 1:b6905730f836 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
altasoul 1:b6905730f836 14 * See the License for the specific language governing permissions and
altasoul 1:b6905730f836 15 * limitations under the License.
altasoul 1:b6905730f836 16 */
altasoul 1:b6905730f836 17
altasoul 0:e996e4a4c783 18 #ifndef SCOPE_RAM_H
altasoul 0:e996e4a4c783 19 #define SCOPE_RAM_H
altasoul 0:e996e4a4c783 20 #include "rtos.h"
altasoul 0:e996e4a4c783 21
altasoul 0:e996e4a4c783 22 #define WATERMARK 0xaa
altasoul 0:e996e4a4c783 23
altasoul 0:e996e4a4c783 24 class RAMscope {
altasoul 0:e996e4a4c783 25
altasoul 0:e996e4a4c783 26 public:
altasoul 0:e996e4a4c783 27 RAMscope(PinName trigger_pin, PinName value_pin);
altasoul 0:e996e4a4c783 28 void watermark(unsigned char *start, int length);
altasoul 0:e996e4a4c783 29 void scope(unsigned char *start, int length=128, int period=10);
altasoul 0:e996e4a4c783 30 void stop();
altasoul 0:e996e4a4c783 31
altasoul 0:e996e4a4c783 32 private:
altasoul 0:e996e4a4c783 33 DigitalOut trigger_output, value_output;
altasoul 0:e996e4a4c783 34 RtosTimer scope_ram_timer;
altasoul 0:e996e4a4c783 35 static void scope_ram(const void *arg);
altasoul 0:e996e4a4c783 36 void output_to_scope(void);
altasoul 0:e996e4a4c783 37 unsigned char *start;
altasoul 0:e996e4a4c783 38 int length;
altasoul 0:e996e4a4c783 39 };
altasoul 0:e996e4a4c783 40
altasoul 0:e996e4a4c783 41 #endif