Merge pull request #12190 from jbubik/XDRV53-ACER

XDRV53 - add Acer projector support
This commit is contained in:
Theo Arends 2021-05-25 20:08:55 +02:00 committed by GitHub
commit 3151babb83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 2 deletions

View File

@ -65,6 +65,35 @@ static const struct projector_ctrl_command_info_s projector_ctrl_commands[] = {
#define PROJECTOR_CTRL_QRYPWR_WARMING 0x31 //placebo
#elif defined(USE_PROJECTOR_CTRL_ACER)
/* see the serial codes in
* http://global-download.acer.com/GDFiles/Document/RS232%20Command%20Table/RS232%20Command%20Table_Acer_1.0_A_A.zip?acerid=636791605984811687
* tested with ACER P1500
* every command is first acknowledged by "*000\r" (success) or "*001\r" (failure) followed by an optional response
* most commands fail in stand-by mode
*/
#define PROJECTOR_CTRL_LOGNAME "DLP[ACER]"
//static const uint8_t projector_ctrl_msg_qry_typ[] = { '*',' ','0',' ','I','R',' ','0','3','5', 0x0d }; //line50 - responds *000\rModel Model P1500E\r [fails in stand-by mode]
static const uint8_t projector_ctrl_msg_qry_typ[] = { '*',' ','0',' ','L','a','m','p',' ','?', 0x0d }; //cannot query type, so query Lamp status instead
static const uint8_t projector_ctrl_msg_qry_pwr[] = { '*',' ','0',' ','L','a','m','p',' ','?', 0x0d }; //line97 - responds *000\rLamp 0\r
static const uint8_t projector_ctrl_msg_pwr_on[] = { '*',' ','0',' ','I','R',' ','0','0','1', 0x0d }; //line18 - responds *000\r
static const uint8_t projector_ctrl_msg_pwr_off[] = { '*',' ','0',' ','I','R',' ','0','0','2', 0x0d }; //line19 - responds *000\r
static const struct projector_ctrl_command_info_s projector_ctrl_commands[] = {
{PROJECTOR_CTRL_S_QRY_TYPE, &projector_ctrl_msg_qry_typ[0], sizeof(projector_ctrl_msg_qry_typ),
PROJECTOR_CTRL_SERIAL_TIMEOUT, '*', 12, 10, 1, '?', 1, 0, 1},
{PROJECTOR_CTRL_S_QRY_PWR, &projector_ctrl_msg_qry_pwr[0], sizeof(projector_ctrl_msg_qry_pwr),
PROJECTOR_CTRL_SERIAL_TIMEOUT, '*', 12, 10, 1, '?', 1, 0, 1},
{PROJECTOR_CTRL_S_PWR_ON, &projector_ctrl_msg_pwr_on[0], sizeof(projector_ctrl_msg_pwr_on),
PROJECTOR_CTRL_SERIAL_TIMEOUT, '*', 5, 0, 1, '?', 1, 0, 1},
{PROJECTOR_CTRL_S_PWR_OFF, &projector_ctrl_msg_pwr_off[0], sizeof(projector_ctrl_msg_pwr_off),
PROJECTOR_CTRL_SERIAL_TIMEOUT, '*', 5, 0, 1, '?', 1, 0, 1}
};
#define PROJECTOR_CTRL_QRYPWR_ON '1'
#define PROJECTOR_CTRL_QRYPWR_COOLING '1' //placebo
#define PROJECTOR_CTRL_QRYPWR_STARTING '1' //placebo
#define PROJECTOR_CTRL_QRYPWR_WARMING '1' //placebo
#else
#error USE_PROJECTOR_CTRL: No projector type defined
#endif

View File

@ -23,11 +23,12 @@
* LCD/DLP Projector Control via serial interface
* https://www.sharpnecdisplays.eu/p/download/v/5e14a015e26cacae3ae64a422f7f8af4/cp/Products/Projectors/Shared/CommandLists/PDF-ExternalControlManual-english.pdf#page=5
* https://www.optoma.co.uk/uploads/manuals/hd36-m-en-gb.pdf#page=56
* http://global-download.acer.com/GDFiles/Document/RS232%20Command%20Table/RS232%20Command%20Table_Acer_1.0_A_A.zip?acerid=636791605984811687
\*********************************************************************************************/
#define XDRV_53 53
#if !defined(USE_PROJECTOR_CTRL_NEC) && !defined(USE_PROJECTOR_CTRL_OPTOMA)
#if !defined(USE_PROJECTOR_CTRL_NEC) && !defined(USE_PROJECTOR_CTRL_OPTOMA) && !defined(USE_PROJECTOR_CTRL_ACER)
#define USE_PROJECTOR_CTRL_NEC // Use at least one projector
#endif
@ -153,12 +154,18 @@ projector_ctrl_write(struct projector_ctrl_softc_s *sc, const uint8_t *bytes, co
}
#ifdef USE_PROJECTOR_CTRL_NEC
serial->write(cksum);
#endif
#ifdef DEBUG_PROJECTOR_CTRL
char hex_b[(len + 1) * 2];
AddLog_P(LOG_LEVEL_DEBUG,PSTR(PROJECTOR_CTRL_LOGNAME ": RAW bytes %s %02x"),
ToHex_P((uint8_t *)bytes, len, hex_b, sizeof(hex_b)), cksum);
#endif //DEBUG_PROJECTOR_CTRL
#else //!USE_PROJECTOR_CTRL_NEC
#ifdef DEBUG_PROJECTOR_CTRL
char hex_b[(len + 1) * 2];
AddLog_P(LOG_LEVEL_DEBUG,PSTR(PROJECTOR_CTRL_LOGNAME ": RAW bytes %s"),
ToHex_P((uint8_t *)bytes, len, hex_b, sizeof(hex_b)));
#endif //DEBUG_PROJECTOR_CTRL
#endif //!USE_PROJECTOR_CTRL_NEC
serial->flush();
return;