RS232 control for TVOne products

Dependents:   SPK-DVIMXR

Committer:
tobyspark
Date:
Sun Oct 07 23:35:41 2012 +0000
Revision:
7:c73d4c68a13b
Parent:
3:03e7e7b7a870
Child:
9:42c83cac2f6d
Using MODSERIAL. In tests earlier, this seemed to fix. Now applying to clean commit (#3), no difference in behaviour: hang on rx while tx. FFSx1000.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tobyspark 0:533cfae24a1b 1 // *spark audio-visual
tobyspark 0:533cfae24a1b 2 // RS232 Control for TV-One products
tobyspark 0:533cfae24a1b 3 // Good for 1T-C2-750, others will need some extra work
tobyspark 1:349d6da461df 4
tobyspark 1:349d6da461df 5 /* Copyright (c) 2011 Toby Harris, MIT License
tobyspark 1:349d6da461df 6 *
tobyspark 1:349d6da461df 7 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
tobyspark 1:349d6da461df 8 * and associated documentation files (the "Software"), to deal in the Software without restriction,
tobyspark 1:349d6da461df 9 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
tobyspark 1:349d6da461df 10 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
tobyspark 1:349d6da461df 11 * furnished to do so, subject to the following conditions:
tobyspark 1:349d6da461df 12 *
tobyspark 1:349d6da461df 13 * The above copyright notice and this permission notice shall be included in all copies or
tobyspark 1:349d6da461df 14 * substantial portions of the Software.
tobyspark 1:349d6da461df 15 *
tobyspark 1:349d6da461df 16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
tobyspark 1:349d6da461df 17 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
tobyspark 1:349d6da461df 18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
tobyspark 1:349d6da461df 19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
tobyspark 1:349d6da461df 20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
tobyspark 1:349d6da461df 21 */
tobyspark 0:533cfae24a1b 22
tobyspark 0:533cfae24a1b 23 #ifndef SPKTVOne_mBed_h
tobyspark 0:533cfae24a1b 24 #define SPKTVOne_mBed_h
tobyspark 0:533cfae24a1b 25
tobyspark 0:533cfae24a1b 26 #include "spk_tvone.h"
tobyspark 0:533cfae24a1b 27 #include "mbed.h"
tobyspark 7:c73d4c68a13b 28 #include "MODSERIAL.h"
tobyspark 0:533cfae24a1b 29
tobyspark 0:533cfae24a1b 30 class SPKTVOne
tobyspark 0:533cfae24a1b 31 {
tobyspark 0:533cfae24a1b 32 public:
tobyspark 0:533cfae24a1b 33 SPKTVOne(PinName txPin, PinName rxPin, PinName signWritePin = NC, PinName signErrorPin = NC, Serial *debugSerial = NULL);
tobyspark 0:533cfae24a1b 34
tobyspark 0:533cfae24a1b 35 bool command(uint8_t channel, uint8_t window, int32_t func, int32_t payload);
tobyspark 0:533cfae24a1b 36
tobyspark 0:533cfae24a1b 37 void setCustomResolutions();
tobyspark 3:03e7e7b7a870 38 bool setHDCPOn(bool state);
tobyspark 0:533cfae24a1b 39
tobyspark 0:533cfae24a1b 40 private:
tobyspark 0:533cfae24a1b 41 void set1920x480(int resStoreNumber);
tobyspark 0:533cfae24a1b 42 void set1600x600(int resStoreNumber);
tobyspark 2:af9e9ab63b23 43 void set2048x768(int resStoreNumber);
tobyspark 0:533cfae24a1b 44
tobyspark 7:c73d4c68a13b 45 MODSERIAL *serial;
tobyspark 0:533cfae24a1b 46 Serial *debug;
tobyspark 0:533cfae24a1b 47
tobyspark 0:533cfae24a1b 48 DigitalOut *writeDO;
tobyspark 0:533cfae24a1b 49 DigitalOut *errorDO;
tobyspark 0:533cfae24a1b 50 Timeout signErrorTimeout;
tobyspark 0:533cfae24a1b 51 void signErrorOff();
tobyspark 0:533cfae24a1b 52 };
tobyspark 0:533cfae24a1b 53
tobyspark 0:533cfae24a1b 54 #endif