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.
Dependencies: USBDevice mbed FastAnalogIn FastIO FastPWM SimpleDMA
Diff: tls1410r.h
- Revision:
- 0:5acbbe3f4cf4
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tls1410r.h Fri Jul 11 03:26:11 2014 +0000
@@ -0,0 +1,41 @@
+/*
+ * TLS1410R interface class.
+ *
+ * This provides a high-level interface for the Taos TLS1410R linear CCD array sensor.
+ */
+
+ #include "mbed.h"
+
+ #ifndef TLS1410R_H
+ #define TLS1410R_H
+
+class TLS1410R
+{
+public:
+ // set up with the two DigitalOut ports (SI and clock), and the
+ // analog in port for reading the currently selected pixel value
+ TLS1410R(PinName siPort, PinName clockPort, PinName aoPort);
+
+ // Integrate light and read the pixels. Fills in pix[] with the pixel values,
+ // scaled 0-0xffff. n is the number of pixels to read; if this is less than
+ // the total number of pixels npix, we'll read every mth pixel, where m = npix/n.
+ // E.g., if you want 640 pixels out of 1280 on the sensor, we'll read every
+ // other pixel. If you want 320, we'll read every fourth pixel.
+ // Before reading, we'll pause for integrate_us additional microseconds during
+ // the integration phase; use 0 for no additional integration time.
+ void read(uint16_t *pix, int n, int integrate_us);
+
+ // clock through all pixels to clear the array
+ void clear();
+
+ // number of pixels in the array
+ static const int nPix = 1280;
+
+
+private:
+ DigitalOut si;
+ DigitalOut clock;
+ AnalogIn ao;
+};
+
+#endif /* TLS1410R_H */