1
0
mirror of https://github.com/Oleg-Stepanenko-owo/IEBUS synced 2025-06-30 03:06:21 +00:00
2016-03-12 21:17:29 +02:00

120 lines
2.7 KiB
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
*/
#ifndef AVCLanHonda_h
#define AVCLanHonda_h
#include <avr/pgmspace.h>
#include "AVCLanDrv.h"
#include "Arduino.h"
//--------------------------------------------------------------------------------
// timer1 overflow every 1 sec
#define TI1_H (((word)-(F_CPU / 1024)) >> 8)
#define TI1_L (((word)-(F_CPU / 1024)) & 0xff )
#if defined(__AVR_ATmega8__)
#define ENABLE_TIMER1_INT (sbi(TIMSK, TOIE1));
#define DISABLE_TIMER1_INT (cbi(TIMSK, TOIE1));
#else
#define ENABLE_TIMER1_INT (sbi(TIMSK1, TOIE1));
#define DISABLE_TIMER1_INT (cbi(TIMSK1, TOIE1));
#endif
// Р аРТвЂ<D0B2>СЂРеСРСР В РВ° eeprom
#define E_MASTER1 0
#define E_MASTER2 1
#define E_READONLY 2
#define E_INIT 3
#define AVCLANDEVICE_NAME " Honda Kb1"
#define AVCLANDEVICE_VERSION "0.0.8"
#define BUTT_WAIT 1000
#define LOCK_TIME 700
//--------------------------------------------------------------------------------
typedef enum {
ACT_CAM_ON = 1,
ACT_CAM_OFF,
// ACT_DISP_HULF,
ACT_DISP_OFF,
ACT_BUTTON_PRESS,
ACT_B_DISPOFF,
ACT_B_DISPFULL,
ACT_B_DISPHULF,
ACT_TEL,
ACT_TEL_CANCEL
// ACT_VOL
} AvcActionID;
//--------------------------------------------------------------------------------
class AVCLanHonda
{
public:
void begin (); // initialisation, obligatory method
void getActionID(); // get action id by recieved message, obligatory method
void processAction(AvcActionID); // process action, obligatory method
byte sendStatus(); // send CD-changer status to head
bool getCommute();
void tryToShowHondaDisp();
void setWaitTime( const unsigned long mTime );
inline unsigned long getWaitTime() const;
// void setLockTime( const unsigned long mTime );
// inline unsigned long getLockTime() const;
// bool isLockTime();
inline bool isWait() const;
inline bool isShowRearCam() const;
inline bool isShowHondaDisp() const;
void checkWait();
void checkLock();
void falseHondaDis();
bool bFirstStart_20;
private:
unsigned long waitTime;
// unsigned long lockTime;
bool bWait;
bool bLock;
bool bShowRearCam;
bool bShowHondaDisp;
bool bTimeSwitch;
bool isHondaDisLast;
};
//unsigned long AVCLanHonda::getLockTime() const {
// return lockTime;
//}
unsigned long AVCLanHonda::getWaitTime() const {
return waitTime;
}
bool AVCLanHonda::isWait() const {
return bWait;
};
bool AVCLanHonda::isShowRearCam() const {
return bShowRearCam;
};
bool AVCLanHonda::isShowHondaDisp() const {
return bShowHondaDisp;
}
extern AVCLanHonda avclanHonda;
#endif