From 08f2dd9d18830e4671dd99ac04569c6dd9895b98 Mon Sep 17 00:00:00 2001 From: ukw Date: Wed, 23 May 2012 12:49:52 +0000 Subject: [PATCH] version 2.1.0: corrected denon timing, new source structure git-svn-id: svn://mikrocontroller.net/irmp@96 aeb2e35e-bfc4-4214-b83c-9e8de998ed28 --- IR-Data/denon-15kHz.txt | 20 +- IR-Data/denon-rc-176-15kHz.txt | 58 ++++ IR-Data/denon.txt | 6 +- IR-Data/test-suite.sh | 12 +- README.txt | 4 +- irmp.aps | 2 +- irmp.c | 440 ++++------------------- irmp.h | 562 +++++------------------------- irmpconfig.h | 129 +++---- irmpextlog.c | 2 +- irmpprotocols.h | 487 ++++++++++++++++++++++++++ irmpsystem.h | 102 ++++++ irsnd.aps | 2 +- irsnd.c | 618 ++++++++++++++++++--------------- irsnd.h | 136 +++++--- irsndconfig.h | 136 +++----- irsndmain.c | 14 +- main.c | 11 +- makefile.lnx | 12 +- 19 files changed, 1375 insertions(+), 1378 deletions(-) create mode 100644 IR-Data/denon-rc-176-15kHz.txt create mode 100644 irmpprotocols.h create mode 100644 irmpsystem.h diff --git a/IR-Data/denon-15kHz.txt b/IR-Data/denon-15kHz.txt index b06c3a1..d53d59d 100644 --- a/IR-Data/denon-15kHz.txt +++ b/IR-Data/denon-15kHz.txt @@ -1,20 +1,20 @@ # 0008 030c -000001111111111100001111111111111111111111111110000011111111110000011111111111000011111111111100001111111111111111111111111110000111111111111111111111111110000011111111111000001111111111100001111111111100000111111111110000111111111111111111111111111000011111111111111111111111111100001111111111100000111111111110000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000011111111111000001111111111111111111111111100000111111111110000011111111110000011111111111000011111111111100000111111111100000111111111111111111111111110000011111111111111111111111111000001111111111111111111111111100000111111111111111111111111110000011111111111000011111111111000001111111111111111111111111110000111111111111111111111111110000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000011111111111000001111111111111111111111111110000111111111110000011111111111000001111111111000001111111111111111111111111100000111111111111111111111111111000011111111111000011111111111000001111111111100000111111111110000111111111111111111111111111000001111111111111111111111111100001111111111100000111111111110000111111111111111 +00000111111111110000111111111111111111111111111000001111111111000001111111111100001111111111110000111111111111111111111111111000011111111111111111111111111000001111111111100000111111111110000111111111110000011111111111000011111111111111111111111111100001111111111111111111111111110000111111111110000011111111111000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000001111111111100000111111111111111111111111110000011111111111000001111111111000001111111111100001111111111110000011111111110000011111111111111111111111111000001111111111111111111111111100000111111111111111111111111110000011111111111111111111111111000001111111111100001111111111100000111111111111111111111111111000011111111111111111111111111000001111111111 # 0008 008c -00001111111111100000111111111111111111111111111000011111111111000001111111111100001111111111100000111111111110000111111111111000011111111111111111111111111100001111111111100001111111111110000111111111110000011111111111111111111111111000001111111111111111111111111100000111111111110000111111111111000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000001111111111100001111111111111111111111111110000111111111110000011111111111000011111111111000001111111111111111111111111100000111111111111111111111111110000011111111111000001111111111111111111111111100001111111111111111111111111110000111111111111111111111111111000001111111111100001111111111100000111111111111111111111111110000011111111111111111111111111000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000001111111111100000111111111111111111111111110000011111111111000011111111111100001111111111100000111111111110000111111111110000011111111111111111111111111000001111111111100000111111111110000111111111110000111111111111111111111111111000001111111111111111111111111100000111111111110000111111111110000011111111111111 +00001111111111100000111111111111111111111111111000011111111111000001111111111100001111111111100000111111111110000111111111111000011111111111111111111111111100001111111111100001111111111110000111111111110000011111111111111111111111111000001111111111111111111111111100000111111111110000111111111111000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000001111111111100001111111111111111111111111110000111111111110000011111111111000011111111111000001111111111111111111111111100000111111111111111111111111110000011111111111000001111111111111111111111111100001111111111111111111111111110000111111111111111111111111111000001111111111100001111111111100000111111111111111111111111110000011111111111111111111111111000001111111111 # 0008 028c -000001111111111100000111111111111111111111111110000011111111111000011111111111000001111111111100001111111111111111111111111110000111111111111000011111111111111111111111111100001111111111100000111111111110000111111111110000011111111111111111111111111000001111111111111111111111111100000111111111110000111111111111000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000001111111111100001111111111111111111111111110000111111111110000011111111111000011111111111000001111111111100000111111111111111111111111110000111111111111000011111111111111111111111111100001111111111111111111111111110000111111111111111111111111111000011111111111000001111111111100001111111111111111111111111110000111111111111111111111111111000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000001111111111100000111111111111111111111111110000011111111111000011111111111000001111111111100001111111111111111111111111110000111111111110000011111111111111111111111111000001111111111100000111111111110000111111111110000011111111111111111111111111000001111111111111111111111111100000111111111110000111111111110000011111111111111 +00000111111111110000011111111111111111111111111000001111111111100001111111111100000111111111110000111111111111111111111111111000011111111111100001111111111111111111111111110000111111111110000011111111111000011111111111000001111111111111111111111111100000111111111111111111111111110000011111111111000011111111111100001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000111111111110000111111111111111111111111111000011111111111000001111111111100001111111111100000111111111110000011111111111111111111111111000011111111111100001111111111111111111111111110000111111111111111111111111111000011111111111111111111111111100001111111111100000111111111110000111111111111111111111111111000011111111111111111111111111100001111111111 # 0008 031c -000001111111111100001111111111111111111111111110000111111111110000011111111111000011111111111100001111111111111111111111111110000111111111111111111111111111000011111111111000001111111111100001111111111100000111111111111111111111111110000011111111111111111111111111000001111111111111111111111111100000111111111110000111111111111000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000001111111111100001111111111111111111111111110000111111111110000011111111111000011111111111000001111111111100000111111111110000111111111111111111111111111000011111111111111111111111111100001111111111111111111111111110000111111111110000011111111111000011111111111100001111111111111111111111111110000011111111111111111111111111000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000011111111111000001111111111111111111111111110000111111111110000011111111111000001111111111100001111111111111111111111111110000111111111111111111111111111000001111111111100001111111111110000111111111110000011111111111111111111111111100001111111111111111111111111110000111111111111111111111111111000001111111111100000111111111110000111111111111111 +00000111111111110000111111111111111111111111111000011111111111000001111111111100001111111111110000111111111111111111111111111000011111111111111111111111111100001111111111100000111111111110000111111111110000011111111111111111111111111000001111111111111111111111111100000111111111111111111111111110000011111111111000011111111111100001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000111111111110000111111111111111111111111111000011111111111000001111111111100001111111111100000111111111110000011111111111000011111111111111111111111111100001111111111111111111111111110000111111111111111111111111111000011111111111000001111111111100001111111111110000111111111111111111111111111000001111111111111111111111111100000111111111 # 0008 024c -000001111111111100001111111111111111111111111110000111111111110000011111111111000011111111111100001111111111111111111111111100000111111111110000011111111111000011111111111111111111111111100001111111111100000111111111110000111111111111111111111111111000011111111111111111111111111100001111111111100000111111111110000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000011111111111000001111111111111111111111111100000111111111110000111111111110000011111111111000011111111111100001111111111111111111111111100000111111111111111111111111110000011111111111000001111111111111111111111111100001111111111111111111111111110000011111111111000011111111111000001111111111111111111111111100000111111111111111111111111110000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000011111111111000001111111111111111111111111110000111111111110000111111111111000011111111111000001111111111111111111111111100000111111111110000111111111110000011111111111111111111111111000001111111111100000111111111110000111111111111111111111111111000011111111111111111111111111100001111111111100000111111111110000111111111111111 +00000111111111110000111111111111111111111111111000011111111111000001111111111100001111111111110000111111111111111111111111110000011111111111000001111111111100001111111111111111111111111110000111111111110000011111111111000011111111111111111111111111100001111111111111111111111111110000111111111110000011111111111000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000001111111111100000111111111111111111111111110000011111111111000011111111111000001111111111100001111111111110000111111111111111111111111110000011111111111111111111111111000001111111111100000111111111111111111111111110000111111111111111111111111111000001111111111100001111111111100000111111111111111111111111110000011111111111111111111111111000001111111111 # 0008 02cc -0000011111111111000011111111111111111111111111100001111111111100000111111111110000111111111111000011111111111111111111111111100001111111111100000111111111111111111111111110000011111111111111111111111111000001111111111100001111111111100000111111111111111111111111110000011111111111111111111111111100001111111111100001111111111110000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000111111111111000011111111111111111111111111100001111111111100000111111111110000111111111110000011111111111000001111111111111111111111111100001111111111110000111111111110000011111111111111111111111111000001111111111111111111111111100000111111111110000111111111110000011111111111111111111111111100001111111111111111111111111100000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000111111111111000011111111111111111111111111100001111111111100000111111111110000111111111110000011111111111111111111111111000001111111111100000111111111111111111111111110000111111111111111111111111111000001111111111100001111111111100000111111111111111111111111110000011111111111111111111111111000001111111111100001111111111110000111111111111111 +00000111111111110000111111111111111111111111111000011111111111000001111111111100001111111111110000111111111111111111111111111000011111111111000001111111111111111111111111100000111111111111111111111111110000011111111111000011111111111000001111111111111111111111111100000111111111111111111111111111000011111111111000011111111111100001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100001111111111110000111111111111111111111111111000011111111111000001111111111100001111111111100000111111111110000011111111111111111111111111000011111111111100001111111111100000111111111111111111111111110000011111111111111111111111111000001111111111100001111111111100000111111111111111111111111111000011111111111111111111111111000001111111111 # 0008 01cc -000001111111111100001111111111111111111111111110000011111111111000011111111111000001111111111100000111111111110000111111111111111111111111111000001111111111111111111111111110000111111111111111111111111111000011111111111100001111111111100000111111111111111111111111110000011111111111111111111111111100001111111111100000111111111110000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000111111111110000011111111111111111111111111000011111111111100001111111111100000111111111110000111111111111111111111111111000011111111111000001111111111100000111111111110000111111111111111111111111111000011111111111111111111111111100001111111111100000111111111110000111111111111111111111111111000011111111111111111111111111100001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000111111111110000011111111111111111111111111000001111111111100001111111111100000111111111110000111111111110000011111111111111111111111111000001111111111111111111111111100000111111111111111111111111111000011111111111000011111111111100001111111111111111111111111110000111111111111111111111111111000011111111111000001111111111100001111111111111111111 +00000111111111110000111111111111111111111111111000001111111111100001111111111100000111111111110000011111111111000011111111111111111111111111100000111111111111111111111111111000011111111111111111111111111100001111111111110000111111111110000011111111111111111111111111000001111111111111111111111111110000111111111110000011111111111000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000011111111111000001111111111111111111111111100001111111111110000111111111110000011111111111000011111111111111111111111111100001111111111100000111111111110000011111111111000011111111111111111111111111100001111111111111111111111111110000111111111110000011111111111000011111111111111111111111111100001111111111111111111111111110000111111 # 0008 00cc -000011111111111000001111111111111111111111111110000111111111110000011111111111000011111111111000001111111111100001111111111100000111111111111111111111111110000011111111111111111111111111000001111111111100000111111111110000111111111111111111111111111000011111111111111111111111111100001111111111100000111111111110000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000011111111111000011111111111111111111111111100001111111111110000111111111110000011111111111000011111111111111111111111111100001111111111111111111111111110000111111111110000011111111111000011111111111111111111111111100001111111111111111111111111110000011111111111000011111111111000011111111111111111111111111100000111111111111111111111111110000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000011111111111000001111111111111111111111111100000111111111110000111111111111000011111111111000001111111111100001111111111100000111111111111111111111111110000011111111111111111111111111000001111111111100001111111111100000111111111111111111111111111000011111111111111111111111111000001111111111100001111111111110000111111111111111 +00001111111111100000111111111111111111111111111000011111111111000001111111111100001111111111100000111111111110000111111111110000011111111111111111111111111000001111111111111111111111111100000111111111110000011111111111000011111111111111111111111111100001111111111111111111111111110000111111111110000011111111111000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000001111111111100001111111111111111111111111110000111111111111000011111111111000001111111111100001111111111111111111111111110000111111111111111111111111111000011111111111000001111111111100001111111111111111111111111110000111111111111111111111111111000001111111111100001111111111100001111111111111111111111111110000011111111111111111111111111000001111111111 # 0008 012c -000001111111111100001111111111111111111111111110000111111111110000011111111111000011111111111100001111111111100001111111111111111111111111110000011111111111000011111111111000001111111111111111111111111100000111111111110000111111111111111111111111111000011111111111111111111111111100001111111111100000111111111110000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000011111111111000001111111111111111111111111100000111111111110000111111111110000011111111111000011111111111111111111111111100001111111111100000111111111111111111111111111000011111111111111111111111111100001111111111100001111111111111111111111111110000011111111111000011111111111000001111111111111111111111111100000111111111111111111111111110000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000011111111111000001111111111111111111111111110000111111111110000111111111111000011111111111000001111111111100001111111111111111111111111110000111111111110000011111111111000001111111111111111111111111100000111111111110000111111111111111111111111111000011111111111111111111111111100001111111111100000111111111110000111111111111111 +00000111111111110000111111111111111111111111111000011111111111000001111111111100001111111111110000111111111110000111111111111111111111111111000001111111111100001111111111100000111111111111111111111111110000011111111111000011111111111111111111111111100001111111111111111111111111110000111111111110000011111111111000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000001111111111100000111111111111111111111111110000011111111111000011111111111000001111111111100001111111111111111111111111110000111111111110000011111111111111111111111111100001111111111111111111111111110000111111111110000111111111111111111111111111000001111111111100001111111111100000111111111111111111111111110000011111111111111111111111111000001111111111 # 0006 018c -000001111111111100001111111111111111111111111110000111111111110000011111111111000011111111111100001111111111100001111111111111111111111111110000011111111111111111111111111000001111111111100001111111111100000111111111110000111111111111111111111111111000011111111111111111111111111100001111111111100000111111111110000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000011111111111000001111111111111111111111111100001111111111110000111111111110000011111111111000011111111111111111111111111100001111111111100000111111111110000011111111111111111111111111000001111111111111111111111111100001111111111111111111111111110000011111111111000011111111111000001111111111111111111111111100000111111111111111111111111110000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000011111111111000001111111111111111111111111110000111111111110000111111111111000011111111111000001111111111100001111111111111111111111111110000111111111111111111111111111000011111111111000001111111111100000111111111110000111111111111111111111111111000011111111111111111111111111100001111111111100000111111111110000111111111111111 +00000111111111110000111111111111111111111111111000011111111111000001111111111100001111111111110000111111111110000111111111111111111111111111000001111111111111111111111111100000111111111110000111111111110000011111111111000011111111111111111111111111100001111111111111111111111111110000111111111110000011111111111000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000001111111111100000111111111111111111111111110000111111111111000011111111111000001111111111100001111111111111111111111111110000111111111110000011111111111000001111111111111111111111111100000111111111111111111111111110000111111111111111111111111111000001111111111100001111111111100000111111111111111111111111110000011111111111111111111111111000001111111111 diff --git a/IR-Data/denon-rc-176-15kHz.txt b/IR-Data/denon-rc-176-15kHz.txt new file mode 100644 index 0000000..58a2d9d --- /dev/null +++ b/IR-Data/denon-rc-176-15kHz.txt @@ -0,0 +1,58 @@ +# IRMP Scan +# DENON RC-176, 20KHz Interrupt-frequency +# Cassette Deck A/B +000000111111111100000111111111110000011111111111111111111111111100000111111111110000011111111110000001111111111111111111111111110000011111111111111111111111111100000001111111110000001111111111000001111111111111111111111111100000011111111110000001111111111111111111111111100000011111111110000011111111111000000111111111100000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000011111111110000011111111111000001111111111111111111111111110000001111111110000001111111111000000111111111110000011111111110000000111111111111111111111111100000111111111111111111111111111000000111111111100000011111111111111111111111111000000111111111100000111111111111111111111111111000001111111111111111111111111110000001111111111111111111111111100000011111111111111 +# Cassette Deck REC +0000001111111111000000111111111100000111111111111111111111111111000001111111111100000111111111100000001111111111111111111111111100000111111111111111111111111110000001111111111111111111111111100000011111111111111111111111111000000111111111111111111111111110000001111111111000000111111111111111111111111110000001111111111000001111111111100000011111111110000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000111111111100000011111111110000001111111111111111111111111100000011111111110000011111111111000001111111111100000111111111110000011111111110000000111111111000001111111111100000001111111111111111111111111000000111111111100000111111111111111111111111111000000111111111111111111111111110000001111111111111111111111111100000011111111111111 +# Cassette Deck Pause +00000011111111110000001111111111000001111111111111111111111111110000011111111111000000111111111100000111111111111111111111111111000000111111111100000111111111111111111111111111000001111111111111111111111111110000011111111111111111111111111100000011111111110000011111111111111111111111111100000011111111100000011111111110000001111111111100000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000001111111111100000111111111100000011111111111111111111111111000000111111111100000111111111110000011111111111000001111111111111111111111111110000011111111111000001111111111100000111111111110000011111111111111111111111111100000111111111100000011111111111111111111111111000001111111111111111111111111110000001111111111111111111111111110000011111111111111 +# Cassette Deck Stop +00000011111111110000011111111111000001111111111111111111111111110000011111111111000001111111111000001111111111100000111111111111111111111111111000000111111111111111111111111110000001111111111111111111111111100000011111111111111111111111111000000111111111100000111111111111111111111111111000001111111111100000011111111110000001111111111000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000011111111111000000111111111100000111111111111111111111111111000000111111111100000111111111110000111111111111111111111111111000000011111111100000011111111110000001111111111000001111111111100000011111111111111111111111111000001111111111100000011111111111111111111111111000001111111111111111111111111110000001111111111111111111111111100000011111111111111 +# Cassette Deck REW +00000011111111100000011111111110000001111111111111111111111111100000011111111110000001111111111000001111111111111111111111111110000011111111111111111111111111100000111111111110000001111111111111111111111111100000111111111111111111111111111000001111111111100000111111111111111111111111111000001111111111100000011111111110000011111111110000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000011111111110000001111111111000000111111111111111111111111110000011111111111000000111111111100000111111111110000011111111111000001111111111111111111111111110000011111111111000001111111111000000111111111111111111111111110000001111111111000000111111111111111111111111110000001111111111111111111111111100000011111111111111111111111111000000011111111111111 +# Cassette Deck FF +000000111111111100001111111111100000111111111111111111111111111000000111111111100000001111111110000001111111111000000111111111111111111111111110000001111111111000001111111111111111111111111110000011111111111111111111111111100000011111111110000011111111111111111111111111100000011111111110000011111111110000000111111111100000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000111111111100000011111111110000001111111111111111111111111100000011111111111000011111111111000001111111111111111111111111110000001111111111000001111111111111111111111111110000011111111111000001111111111100000111111111111111111111111110000001111111111000000111111111111111111111111111000001111111111111111111111111110000011111111111111111111111111100000111111111111111 +# Cassette Deck Play < +00001111111111110000011111111111000001111111111111111111111111110000111111111111000001111111111100000111111111111111111111111110000111111111111111111111111111110000111111111111111111111111111000000111111111100000011111111111111111111111111100011111111111110000111111111111111111111111111000001111111111100001111111111110000011111111111000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000011111111111000001111111111100001111111111111111111111111111000001111111111100001111111111100000011111111111000001111111111000000111111111110000111111111111111111111111111000001111111111100000111111111111111111111111111000011111111111100000111111111111111111111111111000001111111111111111111111111110000011111111111111111111111111100000111111111111111 +# Cassette Deck Play > +000011111111111000000111111111110000011111111111111111111111111100001111111111100000111111111110000011111111111000011111111111110001111111111111111111111111111000001111111111111111111111111110000011111111111111111111111111100001111111111110000111111111111111111111111111100000111111111110000111111111111000011111111111100001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000011111111111100000111111111111000011111111111111111111111111100000111111111110000011111111111000001111111111111111111111111110000111111111111111111111111111100000111111111100000011111111111000011111111111100001111111111111111111111111111000001111111111100000111111111111111111111111111000111111111111111111111111111100000011111111111111111111111111000000111111111111111 +# Cassette Deck CD |<< +000001111111111000000011111111100000001111111110000001111111111111111111111111100000011111111110000011111111111111111111111111100000011111111110000011111111111000001111111111111111111111111110000011111111111111111111111111100000011111111110000011111111111111111111111111100000111111111110000001111111110000000111111111000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000111111111100000011111111110000001111111111000000111111111111111111111111110000000111111111000001111111111100000011111111111111111111111111000001111111111111111111111111110000011111111111000000111111111000000111111111111111111111111111000001111111111000000011111111111111111111111110000001111111111111111111111111100000011111111111111111111111111100000111111111111111 +# CD >>| +0000011111111111000001111111111100000111111111110000011111111111111111111111111100000011111111110000111111111111000011111111111100000111111111110000011111111111111111111111111100000111111111111111111111111111000011111111111000001111111111111111111111111111000111111111111000000111111111100000111111111110000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000111111111100000011111111110000011111111111000001111111111111111111111111110000011111111111000001111111111111111111111111100000011111111111111111111111111000000111111111111111111111111111000001111111111100000111111111100000111111111111111111111111111000001111111111100000111111111111111111111111111000001111111111111111111111111110000011111111111111111111111111100000111111111111111 +# CD RANDOM +000001111111111100000011111111110000011111111111000001111111111111111111111111110000001111111111000001111111111000000111111111111111111111111111000001111111111000000111111111111111111111111110000001111111111000000111111111111111111111111110000001111111111111111111111111100000011111111110000011111111111000011111111111100000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000111111111110000011111111111000001111111111100000111111111111111111111111111000000111111111000000111111111111111111111111111000001111111111000000111111111111111111111111110000001111111111000000111111111111111111111111110000001111111111000000111111111100000011111111111111111111111111000001111111111111111111111111110000011111111111111111111111111100000111111111111111 +# CD REPEAT +0000011111111111000001111111111000000111111111100000011111111111111111111111111000000111111111100000011111111110000001111111111000001111111111111111111111111110000001111111111000000111111111111111111111111110000011111111111000001111111111111111111111111110000011111111111000001111111111000000111111111100000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000011111111111000001111111111100000011111111110000011111111111111111111111111100000111111111110000011111111111111111111111111100000111111111111111111111111111000001111111111100000111111111111111111111111111000000111111111100000111111111111111111111111111000001111111111100001111111111111111111111111110000001111111111111111111111111100000011111111111111111111111111100000111111111111111 +# CD DISC SKIP +00000011111111110000001111111111000001111111111100000111111111111111111111111111000001111111111100000111111111111111111111111111000001111111111111111111111111110000011111111111000001111111111111111111111111110000011111111111000001111111111111111111111111100000011111111111111111111111111000000111111111100000011111111110000001111111111000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000001111111111000000111111111100000111111111110000001111111111111111111111111100000001111111110000001111111111000001111111111100000111111111111111111111111111000011111111111000000111111111111111111111111110000001111111111000000111111111100000111111111111111111111111111000000111111111111111111111111110000001111111111111111111111111100000011111111111111 +# CD Pause +00000011111111110000001111111111000000111111111100000011111111111111111111111111000001111111111100000111111111111111111111111111000001111111111000000111111111111111111111111111000000111111111111111111111111110000001111111111111111111111111100000011111111110000011111111111111111111111111100000111111111110000011111111111000001111111111000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000001111111111000000111111111100000001111111110000001111111111111111111111111100000111111111110000001111111111000000111111111111111111111111110000011111111111000001111111111100000111111111110000001111111111111111111111111100000111111111110000011111111111111111111111111000000111111111111111111111111110000001111111111111111111111111100000011111111111111 +# CD Stop +00000011111111110000011111111111000001111111111100000011111111111111111111111111000000111111111100000111111111110000001111111111111111111111111100000011111111111111111111111111000001111111111111111111111111110000011111111111111111111111111100000011111111110000011111111111111111111111111100000011111111110000011111111111000001111111111000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000001111111111000001111111111100000011111111110000001111111111111111111111111100000011111111110000011111111111111111111111111100000011111111110000011111111111000001111111111100000111111111110000001111111111111111111111111000000111111111100000111111111111111111111111111000000111111111111111111111111111000000111111111111111111111111100000111111111111111 +# CD Play +000001111111111100000111111111110000111111111111000001111111111111111111111111110000011111111110000011111111111000001111111111100000111111111111111111111111111000001111111111111111111111111110000011111111111111111111111111100000011111111110000000111111111111111111111111100000011111111110000001111111111000001111111111100000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000111111111110000011111111111000001111111111100000011111111111111111111111110000001111111111000001111111111111111111111111110000011111111111111111111111111100000001111111110000001111111111000001111111111100000111111111111111111111111111000001111111111100000111111111111111111111111111000000111111111111111111111111110000011111111111111111111111111100000111111111111111 +# TUNER Preset Up +000011111111111000001111111111100000111111111111111111111111111100001111111111111111111111111110000011111111111000001111111111100001111111111111111111111111111100001111111111111111111111111110000011111111111000001111111111111111111111111111000111111111111000001111111111111111111111111110000011111111111111111111111111110000111111111110000011111111110000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000011111111100000011111111111000001111111111111111111111111110000111111111111111111111111111100001111111111110000111111111111111111111111111110001111111111100000111111111110000001111111111111111111111111110000111111111111000111111111111111111111111111100000011111111110000011111111111000011111111111111111111111111110000001111111111111111111111111100000111111111111111 +# TUNER Preset Down +000011111111111000011111111111110001111111111111111111111111111000001111111111111111111111111110000011111111111100011111111111111111111111111110000011111111111000001111111111111111111111111110000011111111111000011111111111111111111111111110000111111111111000011111111111111111111111111111000111111111111111111111111111000000011111111100000011111111110000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000111111111110000011111111111000011111111111111111111111111110000011111111111111111111111111100001111111111110000111111111111000011111111111111111111111111100000111111111110000111111111111111111111111111110000111111111110000011111111111111111111111111100001111111111111000011111111111100011111111111111111111111111100000111111111111111111111111111110001111111111111111 +# AMP Tape 2 +000011111111111100000111111111111111111111111111000011111111111000001111111111100001111111111110000011111111111000011111111111111111111111111110000001111111111000001111111111111111111111111110000111111111111111111111111111110001111111111110000111111111111000001111111111111111111111111110000111111111111000011111111111000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100001111111111110000111111111111111111111111111000001111111111100000111111111110000011111111111000011111111111111111111111111111000011111111111000011111111111111111111111111100000011111111111000011111111111100001111111111111111111111111110000011111111111111111111111111110000111111111111000011111111111111111111111111100000011111111111111111111111111100000111111111111111 +# AMP Tape 1 +000000111111111100000111111111111111111111111111000001111111111100000111111111110000011111111110000001111111111111111111111111100000011111111110000001111111111000000111111111111111111111111110000001111111111111111111111111100000011111111110000001111111111000001111111111111111111111111110000001111111111000001111111111100000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000011111111110000011111111111111111111111111100000111111111110000011111111110000001111111111000000111111111100000011111111111111111111111111000001111111111111111111111111110000001111111111000000111111111100000111111111111111111111111111000000111111111111111111111111110000001111111111000001111111111111111111111111110000001111111111111111111111111100000011111111111111 +# AMP Aux +00000111111111100000001111111111111111111111111100000111111111100000011111111110000001111111111000000111111111100000011111111110000011111111111111111111111111100000011111111110000001111111111000001111111111000000111111111110000011111111111111111111111111000000111111111100000011111111110000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000111111111110000011111111111111111111111111100000011111111110000011111111110000000111111111100000111111111111111111111111111000001111111111111111111111111110000011111111110000001111111111111111111111111110000011111111111111111111111111100000111111111111111111111111111000001111111111111111111111111100000011111111110000001111111111111111111111111110000011111111111111111111111111100000011111111111111 +# AMP Tuner +0000011111111111000001111111111111111111111111111000011111111111100001111111111100000111111111110000001111111111111111111111111110000111111111111111111111111111000000111111111100000111111111100000011111111110000011111111111100001111111111110000011111111111111111111111111000000111111111100000111111111111000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000001111111111100000111111111111111111111111111100011111111111100000111111111100000111111111110000111111111111100001111111111110000111111111111111111111111111000001111111111111111111111111110000001111111111111111111111111110000111111111111111111111111111000000111111111111111111111111111000011111111111100001111111111111111111111111110000011111111111111111111111111110001111111111111111 +# AMP CD +00000011111111100000011111111111111111111111111110000111111111110000111111111111000011111111111100000111111111100001111111111111111111111111111100001111111111100000011111111110000011111111111000001111111111100001111111111110000011111111111111111111111111100000111111111110000011111111110000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000011111111110000011111111111111111111111111110000111111111110000111111111111000011111111111000000111111111111111111111111111000011111111111100001111111111111111111111111111000001111111111111111111111111110000111111111111111111111111111100000111111111111111111111111111000001111111111111111111111111110000111111111110000011111111111111111111111111100000011111111111111111111111111100000111111111111111 +# AMP Phono +00000111111111110000011111111111111111111111111100000011111111110000111111111111000011111111111100001111111111111111111111111110000011111111111000001111111111100000011111111110000011111111111100001111111111100001111111111110000111111111111111111111111111100001111111111110000111111111110000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000111111111110000011111111111111111111111111100000011111111110000011111111111100001111111111110000111111111110000011111111111111111111111111100001111111111111111111111111111000011111111111111111111111111110000011111111111111111111111111100000111111111111111111111111111000011111111111111111111111111110000011111111111000011111111111111111111111111110000011111111111111111111111111000001111111111111111 +# AMP Volume Up +000000111111111110000111111111111111111111111111000001111111111100000111111111110000011111111111000011111111111111111111111111100000011111111110000011111111111111111111111111110000011111111111111111111111111100001111111111100000111111111110000011111111111000001111111111111111111111111111000011111111111000001111111111100001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000111111111110000011111111111111111111111111100000111111111100000001111111111000011111111111100001111111111100000111111111111111111111111111000001111111111100001111111111111000111111111111111111111111111100000111111111111111111111111111000000111111111111111111111111111000111111111111000001111111111111111111111111110000011111111111111111111111111110000111111111111111 +# AMP Volume Down +0000111111111111000011111111111111111111111111100000011111111110000011111111111100001111111111100000111111111110000011111111110000011111111111111111111111111110000111111111111111111111111111100000111111111100000111111111110000011111111111000011111111111111111111111111111000011111111111000001111111111100000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000111111111111000001111111111111111111111111110000011111111111000001111111111100001111111111100000011111111111111111111111111000001111111111111111111111111111000011111111111100000111111111100000111111111111111111111111111000000111111111111111111111111111000011111111111111111111111111100000111111111110000011111111111111111111111111110001111111111111111111111111111000001111111111111111 +# AMP Power +00000011111111110000011111111111111111111111111110000111111111111000111111111111000000111111111100000111111111110000011111111110000001111111111100001111111111110000111111111111111111111111111000000111111111100000111111111111000011111111111111111111111111100001111111111110000111111111111000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000111111111110000011111111111111111111111111110000111111111111000011111111111000000111111111100000111111111111111111111111111100001111111111111111111111111110000111111111111111111111111111100000111111111111111111111111111100001111111111100000011111111111111111111111111000001111111111111111111111111111000011111111111000001111111111111111111111111110000011111111111111111111111111110001111111111111111 +# AMP Mute +000000111111111100000111111111111111111111111111000001111111111100001111111111100000111111111110000111111111111111111111111111110001111111111111111111111111111000001111111111100000111111111111111111111111111100001111111111110001111111111110000111111111111000001111111111111111111111111110000011111111111000011111111111100001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000111111111100000111111111111111111111111111100001111111111100000011111111110000011111111111000001111111111110000111111111110000011111111111111111111111111100001111111111100000111111111111111111111111111100001111111111111111111111111111000001111111111111111111111111110000111111111111000011111111111111111111111111110000111111111111111111111111111100000111111111111111 diff --git a/IR-Data/denon.txt b/IR-Data/denon.txt index c0adc64..cbfaf4c 100644 --- a/IR-Data/denon.txt +++ b/IR-Data/denon.txt @@ -1,6 +1,4 @@ # 0x0002, code = 0x0220 : 000101000100000 + 1 stop bit + 000100111011111 + 1 stop bit -00011111111000111111110001111111100011111111111111111110001111111100011111111111111111110001111111100011111111000111111110001111111111111111111000111111110001111111100011111111000111111110001111111100011111111 -00011111111000111111110001111111100011111111111111111110001111111100011111111000111111111111111111100011111111111111111110001111111111111111111000111111110001111111111111111111000111111111111111111100011111111111111111110001111111111111111111000111111111111111111100011111111 +0001111111100011111111000111111110001111111111111111111000111111110001111111111111111111000111111110001111111100011111111000111111111111111111100011111111000111111110001111111100011111111000111111110001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100011111111000111111110001111111100011111111111111111110001111111100011111111000111111111111111111100011111111111111111110001111111111111111111000111111110001111111111111111111000111111111111111111100011111111111111111110001111111111111111111000111111111111111111100011111111 # Wiederholung: -00011111111000111111110001111111100011111111111111111110001111111100011111111111111111110001111111100011111111000111111110001111111111111111111000111111110001111111100011111111000111111110001111111100011111111 -00011111111000111111110001111111100011111111111111111110001111111100011111111000111111111111111111100011111111111111111110001111111111111111111000111111110001111111111111111111000111111111111111111100011111111111111111110001111111111111111111000111111111111111111100011111111 +0001111111100011111111000111111110001111111111111111111000111111110001111111111111111111000111111110001111111100011111111000111111111111111111100011111111000111111110001111111100011111111000111111110001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100011111111000111111110001111111100011111111111111111110001111111100011111111000111111111111111111100011111111111111111110001111111111111111111000111111110001111111111111111111000111111111111111111100011111111111111111110001111111111111111111000111111111111111111100011111111 diff --git a/IR-Data/test-suite.sh b/IR-Data/test-suite.sh index 3e68111..8ce239a 100644 --- a/IR-Data/test-suite.sh +++ b/IR-Data/test-suite.sh @@ -14,7 +14,7 @@ set -e # exit on error cd `dirname $0` mkdir -p tmpsrc -cp ../irmp.[ch] ../irmpconfig.h ../irsnd.[ch] ../irsndconfig.h ../makefile.lnx tmpsrc +cp ../irmp.[ch] ../irmpconfig.h ../irsnd.[ch] ../irsndconfig.h ../irmpsystem.h ../irmpprotocols.h ../makefile.lnx tmpsrc cd tmpsrc sed 's/#define \(IRMP_SUPPORT_[A-Z_0-9]* *\)[01]/#define \1 1/g' irmpconfig.new mv irmpconfig.new irmpconfig.h @@ -63,8 +63,6 @@ for j in \ rc5x.txt \ rc6-hold.txt \ rc6.txt \ - sharp-denon.txt \ - sharp-denon2.txt \ xbox360-10kHz.txt do echo "testing $j ..." @@ -76,16 +74,18 @@ do fi done +# t-home-mediareceiver-15kHz.txt (RUWIDO) conflicts with Denon + for j in \ - Siemens-Gigaset-M740AV-15kHz.txt \ bo_beolink1000-15kHz.txt \ denon-15kHz.txt \ + denon-rc-176-15kHz.txt \ irc-15kHz.txt \ kathrein-15kHz.txt \ recs80-15kHz.txt \ samsung32-15kHz.txt \ - t-home-mediareceiver-15kHz.txt \ - tp400vt-15kHz.txt \ + Siemens-Gigaset-M740AV-15kHz.txt \ + tp400vt-15kHz.txt \ universal-15kHz.txt \ xbox360-15kHz.txt do diff --git a/README.txt b/README.txt index 9b0c668..e666c5d 100644 --- a/README.txt +++ b/README.txt @@ -1,8 +1,8 @@ IRMP - Infrared Multi Protocol Decoder -------------------------------------- -Version IRMP: 2.0.4 27.02.2012 -Version IRSND: 2.0.4 27.02.2012 +Version IRMP: 2.2.0 23.05.2012 +Version IRSND: 2.2.0 23.05.2012 Dokumentation: diff --git a/irmp.aps b/irmp.aps index 97f2a39..1bb586d 100644 --- a/irmp.aps +++ b/irmp.aps @@ -1 +1 @@ -irmp07-Jan-2010 20:23:4916-Feb-2012 11:39:00241007-Jan-2010 20:23:4944, 18, 0, 670AVR GCCdefault\irmp.elfC:\avr\irmp\AVR SimulatorATmega88.xmlfalseR00R01R02R03R04R05R06R07R08R09R10R11R12R13R14R15R16R17R18R19R20R21R22R23R24R25R26R27R28R29R30R31Auto000main.cirmp.cirmpextlog.cirmp.hirmpconfig.hirmpextlog.hdefault\irmp.lssdefault\irmp.mapdefaultNOatmega88111irmp.elfdefault\0-Wall -gdwarf-2 -std=gnu99 -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enumsdefault1C:\Program Files\WinAVR-20100110\bin\avr-gcc.exeC:\Program Files\WinAVR-20100110\utils\bin\make.exe00000main.c100001irmp.c100002irmp.h100003irmpconfig.h100004irmpextlog.c100005irmpextlog.h1 +irmp07-Jan-2010 20:23:4922-May-2012 17:10:27241007-Jan-2010 20:23:4944, 18, 0, 670AVR GCCdefault\irmp.elfC:\avr\irmp\AVR SimulatorATmega88.xmlfalseR00R01R02R03R04R05R06R07R08R09R10R11R12R13R14R15R16R17R18R19R20R21R22R23R24R25R26R27R28R29R30R31Auto000main.cirmp.cirmp.hirmpconfig.hirmpprotocols.hirmpsystem.hdefault\irmp.lssdefault\irmp.mapdefaultNOatmega88111irmp.elfdefault\1-Wall -gdwarf-2 -std=gnu99 -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enumsdefault1C:\Program Files\WinAVR-20100110\bin\avr-gcc.exeC:\Program Files\WinAVR-20100110\utils\bin\make.exeC:\avr\irmp\irmp.hC:\avr\irmp\irmpconfig.hC:\avr\irmp\irmpprotocols.hC:\avr\irmp\irmpsystem.hC:\avr\irmp\main.cC:\avr\irmp\irmp.c00000main.c100001irmp.c100002irmp.h100003irmpconfig.h100004irmpsystem.h100005irmpprotocols.h1 diff --git a/irmp.c b/irmp.c index e31da17..ef42937 100644 --- a/irmp.c +++ b/irmp.c @@ -1,9 +1,9 @@ /*--------------------------------------------------------------------------------------------------------------------------------------------------- * irmp.c - infrared multi-protocol decoder, supports several remote control protocols * - * Copyright (c) 2009-2011 Frank Meyer - frank(at)fli4l.de + * Copyright (c) 2009-2012 Frank Meyer - frank(at)fli4l.de * - * $Id: irmp.c,v 1.116 2012/02/24 11:40:41 fm Exp $ + * $Id: irmp.c,v 1.121 2012/05/22 15:08:46 fm Exp $ * * ATMEGA88 @ 8 MHz * @@ -16,280 +16,6 @@ * ATmega164, ATmega324, ATmega644, ATmega644P, ATmega1284 * ATmega88, ATmega88P, ATmega168, ATmega168P, ATmega328P * - * Typical manufacturers of remote controls: - * - * SIRCS - Sony - * NEC - NEC, Yamaha, Canon, Tevion, Harman/Kardon, Hitachi, JVC, Pioneer, Toshiba, Xoro, Orion, and many other Japanese manufacturers - * SAMSUNG - Samsung - * SAMSUNG32 - Samsung - * MATSUSHITA - Matsushita - * KASEIKYO - Panasonic, Denon & other Japanese manufacturers (members of "Japan's Association for Electric Home Application") - * RECS80 - Philips, Nokia, Thomson, Nordmende, Telefunken, Saba - * RC5 - Philips and other European manufacturers - * DENON - Denon, Sharp - * RC6 - Philips and other European manufacturers - * APPLE - Apple - * NUBERT - Nubert Subwoofer System - * B&O - Bang & Olufsen - * PANASONIC - Panasonic (older, yet not implemented) - * GRUNDIG - Grundig - * NOKIA - Nokia - * SIEMENS - Siemens, e.g. Gigaset M740AV - * FDC - FDC IR keyboard - * RCCAR - IR remote control for RC cars - * JVC - JVC - * THOMSON - Thomson - * NIKON - Nikon cameras - * RUWIDO - T-Home - * KATHREIN - Kathrein - * LEGO - Lego Power Functions RC - * - *--------------------------------------------------------------------------------------------------------------------------------------------------- - * - * SIRCS - * ----- - * - * frame: 1 start bit + 12-20 data bits + no stop bit - * data: 7 command bits + 5 address bits + 0 to 8 additional bits - * - * start bit: data "0": data "1": stop bit: - * -----------------_________ ------_____ ------------______ - * 2400us 600us 600us 600us 1200us 600 us no stop bit - * - *--------------------------------------------------------------------------------------------------------------------------------------------------- - * - * NEC + extended NEC - * ------------------------- - * - * frame: 1 start bit + 32 data bits + 1 stop bit - * data NEC: 8 address bits + 8 inverted address bits + 8 command bits + 8 inverted command bits - * data extended NEC: 16 address bits + 8 command bits + 8 inverted command bits - * - * start bit: data "0": data "1": stop bit: - * -----------------_________ ------______ ------________________ ------______.... - * 9000us 4500us 560us 560us 560us 1690 us 560us - * - * - * Repetition frame: - * - * -----------------_________------______ .... ~100ms Pause, then repeat - * 9000us 2250us 560us - * - *--------------------------------------------------------------------------------------------------------------------------------------------------- - * - * SAMSUNG - * ------- - * - * frame: 1 start bit + 16 data(1) bits + 1 sync bit + additional 20 data(2) bits + 1 stop bit - * data(1): 16 address bits - * data(2): 4 ID bits + 8 command bits + 8 inverted command bits - * - * start bit: data "0": data "1": sync bit: stop bit: - * ----------______________ ------______ ------________________ ------______________ ------______.... - * 4500us 4500us 550us 450us 550us 1450us 550us 4500us 550us - * - *--------------------------------------------------------------------------------------------------------------------------------------------------- - * - * SAMSUNG32 - * ---------- - * - * frame: 1 start bit + 32 data bits + 1 stop bit - * data: 16 address bits + 16 command bits - * - * start bit: data "0": data "1": stop bit: - * ----------______________ ------______ ------________________ ------______.... - * 4500us 4500us 550us 450us 550us 1450us 550us - * - *--------------------------------------------------------------------------------------------------------------------------------------------------- - * - * MATSUSHITA - * ---------- - * - * frame: 1 start bit + 24 data bits + 1 stop bit - * data: 6 custom bits + 6 command bits + 12 address bits - * - * start bit: data "0": data "1": stop bit: - * ----------_________ ------______ ------________________ ------______.... - * 3488us 3488us 872us 872us 872us 2616us 872us - * - *--------------------------------------------------------------------------------------------------------------------------------------------------- - * - * KASEIKYO - * -------- - * - * frame: 1 start bit + 48 data bits + 1 stop bit - * data: 16 manufacturer bits + 4 parity bits + 4 genre1 bits + 4 genre2 bits + 10 command bits + 2 id bits + 8 parity bits - * - * start bit: data "0": data "1": stop bit: - * ----------______ ------______ ------________________ ------______.... - * 3380us 1690us 423us 423us 423us 1269us 423us - * - *--------------------------------------------------------------------------------------------------------------------------------------------------- - * - * RECS80 - * ------ - * - * frame: 2 start bits + 10 data bits + 1 stop bit - * data: 1 toggle bit + 3 address bits + 6 command bits - * - * start bit: data "0": data "1": stop bit: - * -----_____________________ -----____________ -----______________ ------_______.... - * 158us 7432us 158us 4902us 158us 7432us 158us - * - *--------------------------------------------------------------------------------------------------------------------------------------------------- - * - * RECS80EXT - * --------- - * - * frame: 2 start bits + 11 data bits + 1 stop bit - * data: 1 toggle bit + 4 address bits + 6 command bits - * - * start bit: data "0": data "1": stop bit: - * -----_____________________ -----____________ -----______________ ------_______.... - * 158us 3637us 158us 4902us 158us 7432us 158us - * - *--------------------------------------------------------------------------------------------------------------------------------------------------- - * - * RC5 + RC5X - * ---------- - * - * RC5 frame: 2 start bits + 12 data bits + no stop bit - * RC5 data: 1 toggle bit + 5 address bits + 6 command bits - * RC5X frame: 1 start bit + 13 data bits + no stop bit - * RC5X data: 1 inverted command bit + 1 toggle bit + 5 address bits + 6 command bits - * - * start bit: data "0": data "1": - * ______----- ------______ ______------ - * 889us 889us 889us 889us 889us 889us - * - *--------------------------------------------------------------------------------------------------------------------------------------------------- - * - * DENON - * ----- - * - * frame: 0 start bits + 16 data bits + stop bit + 65ms pause + 16 inverted data bits + stop bit - * data: 5 address bits + 10 command bits - * - * Theory: - * - * data "0": data "1": - * ------________________ ------______________ - * 275us 775us 275us 1900us - * - * Practice: - * - * data "0": data "1": - * ------________________ ------______________ - * 310us 745us 310us 1780us - * - *--------------------------------------------------------------------------------------------------------------------------------------------------- - * - * RC6 - * --- - * - * RC6 frame: 1 start bit + 1 bit "1" + 3 mode bits + 1 toggle bit + 16 data bits + 2666 us pause - * RC6 data: 8 address bits + 8 command bits - * - * start bit toggle bit "0": toggle bit "1": data/mode "0": data/mode "1": - * ____________------- _______------- -------_______ _______------- -------_______ - * 2666us 889us 889us 889us 889us 889us 444us 444us 444us 444us - * - *--------------------------------------------------------------------------------------------------------------------------------------------------- - * - * APPLE - * ----- - * - * frame: 1 start bit + 32 data bits + 1 stop bit - * data: 16 address bits + 11100000 + 8 command bits - * - * start bit: data "0": data "1": stop bit: - * -----------------_________ ------______ ------________________ ------______.... - * 9000us 4500us 560us 560us 560us 1690 us 560us - * - *--------------------------------------------------------------------------------------------------------------------------------------------------- - * - * NUBERT (subwoofer system) - * ------------------------- - * - * frame: 1 start bit + 10 data bits + 1 stop bit - * data: 0 address bits + 10 command bits ? - * - * start bit: data "0": data "1": stop bit: - * ----------_____ ------______ ------________________ ------______.... - * 1340us 340us 500us 1300us 1340us 340us 500us - * - *--------------------------------------------------------------------------------------------------------------------------------------------------- - * - * BANG_OLUFSEN - * ------------ - * - * frame: 4 start bits + 16 data bits + 1 trailer bit + 1 stop bit - * data: 0 address bits + 16 command bits - * - * 1st start bit: 2nd start bit: 3rd start bit: 4th start bit: - * -----________ -----________ -----_____________ -----________ - * 210us 3000us 210us 3000us 210us 15000us 210us 3000us - * - * data "0": data "1": data "repeat bit": trailer bit: stop bit: - * -----________ -----_____________ -----___________ -----_____________ -----____... - * 210us 3000us 210us 9000us 210us 6000us 210us 12000us 210us - * - *--------------------------------------------------------------------------------------------------------------------------------------------------- - * - * GRUNDIG - * ------- - * - * packet: 1 start frame + 19,968ms pause + N info frames + 117,76ms pause + 1 stop frame - * frame: 1 pre bit + 1 start bit + 9 data bits + no stop bit - * pause between info frames: 117,76ms - * - * data of start frame: 9 x 1 - * data of info frame: 9 command bits - * data of stop frame: 9 x 1 - * - * pre bit: start bit data "0": data "1": - * ------____________ ------______ ______------ ------______ - * 528us 2639us 528us 528us 528us 528us 528us 528us - * - *--------------------------------------------------------------------------------------------------------------------------------------------------- - * - * NOKIA: - * ------ - * - * Timing similar to Grundig, but 16 data bits: - * frame: 1 pre bit + 1 start bit + 8 command bits + 8 address bits + no stop bit - * - *--------------------------------------------------------------------------------------------------------------------------------------------------- - * - * SIEMENS or RUWIDO: - * ------------------ - * - * SIEMENS frame: 1 start bit + 22 data bits + no stop bit - * SIEMENS data: 13 address bits + 1 repeat bit + 7 data bits + 1 unknown bit - * - * start bit data "0": data "1": - * -------_______ _______------- -------_______ - * 250us 250us 250us 250us 250us 250us - * - *--------------------------------------------------------------------------------------------------------------------------------------------------- - * - * PANASONIC (older protocol, yet not implemented, see also MATSUSHITA, timing very similar) - * ----------------------------------------------------------------------------------------- - * - * frame: 1 start bit + 22 data bits + 1 stop bit - * 22 data bits = 5 custom bits + 6 data bits + 5 inverted custom bits + 6 inverted data bits - * - * European version: T = 456us - * USA & Canada version: T = 422us - * - * start bit: data "0": data "1": stop bit: - * 8T 8T 2T 2T 2T 6T 2T - * -------------____________ ------_____ ------_____________ ------_______.... - * 3648us 3648us 912us 912us 912us 2736us 912us (Europe) - * 3376us 3376us 844us 844us 844us 2532us 844us (US) - * - *--------------------------------------------------------------------------------------------------------------------------------------------------- - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -297,78 +23,18 @@ *--------------------------------------------------------------------------------------------------------------------------------------------------- */ -#if defined(__18CXX) -#define PIC_C18 // Microchip C18 Compiler -#endif - -#if defined(__PCM__) || defined(__PCB__) || defined(__PCH__) // CCS PIC Compiler instead of AVR -#define PIC_CCS_COMPILER -#endif - -#ifdef unix // test on linux/unix -#include -#include -#include -#include -#include - -#define ANALYZE -#define PROGMEM -#define memcpy_P memcpy - -#else // not unix: - -#ifdef WIN32 -#include -#include -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -#define ANALYZE -#define PROGMEM -#define memcpy_P memcpy - -#else - -#if defined (PIC_CCS_COMPILER) || defined(PIC_C18) - -#include -#define PROGMEM -#define memcpy_P memcpy - -#if defined (PIC_CCS_COMPILER) -typedef unsigned int8 uint8_t; -typedef unsigned int16 uint16_t; -#endif - -#else // AVR: - -#include -#include -#include -#include -#include -#include - -#endif // PIC_CCS_COMPILER or PIC_C18 - -#endif // windows -#endif // unix - -#ifndef IRMP_USE_AS_LIB -#include "irmpconfig.h" -#endif #include "irmp.h" #if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRMP_SUPPORT_NOKIA_PROTOCOL == 1 || IRMP_SUPPORT_IR60_PROTOCOL == 1 -#define IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL 1 +# define IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL 1 #else -#define IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL 0 +# define IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL 0 #endif #if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 || IRMP_SUPPORT_RUWIDO_PROTOCOL == 1 -#define IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL 1 +# define IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL 1 #else -#define IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL 0 +# define IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL 0 #endif #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || \ @@ -376,15 +42,15 @@ typedef unsigned int16 uint16_t; IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1 || \ IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1 || \ IRMP_SUPPORT_IR60_PROTOCOL -#define IRMP_SUPPORT_MANCHESTER 1 +# define IRMP_SUPPORT_MANCHESTER 1 #else -#define IRMP_SUPPORT_MANCHESTER 0 +# define IRMP_SUPPORT_MANCHESTER 0 #endif #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1 -#define IRMP_SUPPORT_SERIAL 1 +# define IRMP_SUPPORT_SERIAL 1 #else -#define IRMP_SUPPORT_SERIAL 0 +# define IRMP_SUPPORT_SERIAL 0 #endif #define IRMP_KEY_REPETITION_LEN (uint16_t)(F_INTERRUPTS * 150.0e-3 + 0.5) // autodetect key repetition within 150 msec @@ -423,9 +89,9 @@ typedef unsigned int16 uint16_t; #define SIRCS_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1) #define SIRCS_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1) #if IRMP_SUPPORT_NETBOX_PROTOCOL // only 5% to avoid conflict with NETBOX: -#define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5)) +# define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5)) #else // only 5% + 1 to avoid conflict with RC6: -#define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1) +# define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1) #endif #define SIRCS_1_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1) #define SIRCS_1_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1) @@ -505,15 +171,13 @@ typedef unsigned int16 uint16_t; #define RC5_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1) #define DENON_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1) -#define DENON_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1) +#define DENON_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1) #define DENON_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1) #define DENON_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1) -#if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1 -#define DENON_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5)) // no -1, avoid conflict with RUWIDO -#else -#define DENON_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1) // be more tolerant -#endif +// RUWIDO (see t-home-mediareceiver-15kHz.txt) conflicts here with DENON +#define DENON_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1) #define DENON_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1) +#define DENON_AUTO_REPETITION_PAUSE_LEN ((uint16_t)(F_INTERRUPTS * DENON_AUTO_REPETITION_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1) #define THOMSON_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1) #define THOMSON_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1) @@ -692,18 +356,18 @@ typedef unsigned int16 uint16_t; #define AUTO_FRAME_REPETITION_LEN (uint16_t)(F_INTERRUPTS * AUTO_FRAME_REPETITION_TIME + 0.5) // use uint16_t! #ifdef ANALYZE -#define ANALYZE_PUTCHAR(a) { if (! silent) { putchar (a); } } -#define ANALYZE_ONLY_NORMAL_PUTCHAR(a) { if (! silent && !verbose) { putchar (a); } } -#define ANALYZE_PRINTF(...) { if (verbose) { printf (__VA_ARGS__); } } -#define ANALYZE_NEWLINE() { if (verbose) { putchar ('\n'); } } +# define ANALYZE_PUTCHAR(a) { if (! silent) { putchar (a); } } +# define ANALYZE_ONLY_NORMAL_PUTCHAR(a) { if (! silent && !verbose) { putchar (a); } } +# define ANALYZE_PRINTF(...) { if (verbose) { printf (__VA_ARGS__); } } +# define ANALYZE_NEWLINE() { if (verbose) { putchar ('\n'); } } static int silent; static int time_counter; static int verbose; #else -#define ANALYZE_PUTCHAR(a) -#define ANALYZE_ONLY_NORMAL_PUTCHAR(a) -#define ANALYZE_PRINTF(...) -#define ANALYZE_NEWLINE() +# define ANALYZE_PUTCHAR(a) +# define ANALYZE_ONLY_NORMAL_PUTCHAR(a) +# define ANALYZE_PRINTF(...) +# define ANALYZE_NEWLINE() #endif #if IRMP_USE_CALLBACK == 1 @@ -1542,9 +1206,10 @@ static volatile uint16_t irmp_address; static volatile uint16_t irmp_command; static volatile uint16_t irmp_id; // only used for SAMSUNG protocol static volatile uint8_t irmp_flags; -// static volatile uint8_t irmp_busy_flag; +// static volatile uint8_t irmp_busy_flag; #ifdef ANALYZE +#define input(x) (x) static uint8_t IRMP_PIN; #endif @@ -1557,7 +1222,40 @@ static uint8_t IRMP_PIN; void irmp_init (void) { -#if !defined(PIC_CCS_COMPILER) && !defined(PIC_C18) // only AVR +#if defined(PIC_CCS) || defined(PIC_C18) // PIC: do nothing +#elif defined (ARM_STM32) // STM32 + GPIO_InitTypeDef GPIO_InitStructure; + + /* GPIOx clock enable */ + #if defined (ARM_STM32L1XX) + RCC_AHBPeriphClockCmd(IRMP_PORT_RCC, ENABLE); + #elif defined (ARM_STM32F10X) + RCC_APB2PeriphClockCmd(IRMP_PORT_RCC, ENABLE); + #elif defined (ARM_STM32F4XX) + RCC_AHB1PeriphClockCmd(IRMP_PORT_RCC, ENABLE); + #endif + + /* GPIO Configuration */ + GPIO_InitStructure.GPIO_Pin = IRMP_BIT; + #if defined (ARM_STM32L1XX) || defined (ARM_STM32F4XX) + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; + GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz; + GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; + GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; + #elif defined (ARM_STM32F10X) + GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz; + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; + #endif + GPIO_Init(IRMP_PORT, &GPIO_InitStructure); + + /* GPIO Configuration */ + GPIO_InitStructure.GPIO_Pin = IRMP_BIT; + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; + GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz; + GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; + GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; + GPIO_Init(IRMP_PORT, &GPIO_InitStructure); +#else // AVR IRMP_PORT &= ~(1<= DENON_AUTO_REPETITION_PAUSE_LEN && last_irmp_denon_command != 0) + { + ANALYZE_PRINTF ("%8.3fms error 6: did not receive inverted command repetition\n", + (double) (time_counter * 1000) / F_INTERRUPTS); + last_irmp_denon_command = 0; + } +#endif // IRMP_SUPPORT_DENON_PROTOCOL == 1 } } } @@ -3290,6 +3000,7 @@ irmp_ISR (void) if ((~irmp_tmp_command & 0x3FF) == last_irmp_denon_command) // command bits must be inverted { irmp_tmp_command = last_irmp_denon_command; // use command received before! + last_irmp_denon_command = 0; irmp_protocol = irmp_param.protocol; // store protocol irmp_address = irmp_tmp_address; // store address @@ -3297,9 +3008,10 @@ irmp_ISR (void) } else { - ANALYZE_PRINTF ("waiting for inverted command repetition\n"); + ANALYZE_PRINTF ("%8.3fms waiting for inverted command repetition\n", (double) (time_counter * 1000) / F_INTERRUPTS); irmp_ir_detected = FALSE; last_irmp_denon_command = irmp_tmp_command; + repetition_len = 0; } } else @@ -4038,7 +3750,7 @@ main (int argc, char ** argv) if (! analyze) { - for (i = 0; i < (int) ((8000.0 * F_INTERRUPTS) / 10000); i++) // newline: long pause of 800 msec + for (i = 0; i < (int) ((10000.0 * F_INTERRUPTS) / 10000); i++) // newline: long pause of 10000 msec { next_tick (); } diff --git a/irmp.h b/irmp.h index 9d0fac7..8427be5 100644 --- a/irmp.h +++ b/irmp.h @@ -1,9 +1,9 @@ /*--------------------------------------------------------------------------------------------------------------------------------------------------- * irmp.h * - * Copyright (c) 2009-2011 Frank Meyer - frank(at)fli4l.de + * Copyright (c) 2009-2012 Frank Meyer - frank(at)fli4l.de * - * $Id: irmp.h,v 1.73 2012/02/24 15:00:18 fm Exp $ + * $Id: irmp.h,v 1.79 2012/05/23 12:26:25 fm Exp $ * * ATMEGA88 @ 8 MHz * @@ -14,490 +14,108 @@ *--------------------------------------------------------------------------------------------------------------------------------------------------- */ -#ifndef _WC_IRMP_H_ -#define _WC_IRMP_H_ +#ifndef _IRMP_H_ +#define _IRMP_H_ -#if defined(__18CXX) // Microchip C18 declaration of missing typedef -typedef unsigned char uint8_t; -typedef unsigned int uint16_t; -#endif //Microchip C18 +#include "irmpsystem.h" -/*--------------------------------------------------------------------------------------------------------------------------------------------------- - * timing constants: - *--------------------------------------------------------------------------------------------------------------------------------------------------- - */ -// fm 22.09.2011: may not be more than 16000L, otherwise some JVC codes will not be accepted -#define IRMP_TIMEOUT_TIME 15500.0e-6 // timeout after 15.5 ms darkness -#define IRMP_TIMEOUT_TIME_MS 15500L // timeout after 15.5 ms darkness - -#if IRMP_SUPPORT_NIKON_PROTOCOL == 1 -#define IRMP_TIMEOUT_NIKON_TIME 29500.0e-6 // 2nd timeout after 29.5 ms darkness (only for NIKON!) -#define IRMP_TIMEOUT_NIKON_TIME_MS 29500L // 2nd timeout after 29.5 ms darkness -typedef uint16_t PAUSE_LEN; -#define IRMP_TIMEOUT_NIKON_LEN (PAUSE_LEN)(F_INTERRUPTS * IRMP_TIMEOUT_NIKON_TIME + 0.5) -#else -#if (F_INTERRUPTS * IRMP_TIMEOUT_TIME_MS) / 1000000 >= 254 -typedef uint16_t PAUSE_LEN; -#else -typedef uint8_t PAUSE_LEN; -#endif +#ifndef IRMP_USE_AS_LIB +# include "irmpconfig.h" #endif -#define IRMP_TIMEOUT_LEN (PAUSE_LEN)(F_INTERRUPTS * IRMP_TIMEOUT_TIME + 0.5) - -/*--------------------------------------------------------------------------------------------------------------------------------------------------- - * IR protocols - *--------------------------------------------------------------------------------------------------------------------------------------------------- - */ -#define IRMP_SIRCS_PROTOCOL 1 // Sony -#define IRMP_NEC_PROTOCOL 2 // NEC, Pioneer, JVC, Toshiba, NoName etc. -#define IRMP_SAMSUNG_PROTOCOL 3 // Samsung -#define IRMP_MATSUSHITA_PROTOCOL 4 // Matsushita -#define IRMP_KASEIKYO_PROTOCOL 5 // Kaseikyo (Panasonic etc) -#define IRMP_RECS80_PROTOCOL 6 // Philips, Thomson, Nordmende, Telefunken, Saba -#define IRMP_RC5_PROTOCOL 7 // Philips etc -#define IRMP_DENON_PROTOCOL 8 // Denon, Sharp -#define IRMP_RC6_PROTOCOL 9 // Philips etc -#define IRMP_SAMSUNG32_PROTOCOL 10 // Samsung32: no sync pulse at bit 16, length 32 instead of 37 -#define IRMP_APPLE_PROTOCOL 11 // Apple, very similar to NEC -#define IRMP_RECS80EXT_PROTOCOL 12 // Philips, Technisat, Thomson, Nordmende, Telefunken, Saba -#define IRMP_NUBERT_PROTOCOL 13 // Nubert -#define IRMP_BANG_OLUFSEN_PROTOCOL 14 // Bang & Olufsen -#define IRMP_GRUNDIG_PROTOCOL 15 // Grundig -#define IRMP_NOKIA_PROTOCOL 16 // Nokia -#define IRMP_SIEMENS_PROTOCOL 17 // Siemens, e.g. Gigaset -#define IRMP_FDC_PROTOCOL 18 // FDC keyboard -#define IRMP_RCCAR_PROTOCOL 19 // RC Car -#define IRMP_JVC_PROTOCOL 20 // JVC (NEC with 16 bits) -#define IRMP_RC6A_PROTOCOL 21 // RC6A, e.g. Kathrein, XBOX -#define IRMP_NIKON_PROTOCOL 22 // Nikon -#define IRMP_RUWIDO_PROTOCOL 23 // Ruwido, e.g. T-Home Mediareceiver -#define IRMP_IR60_PROTOCOL 24 // IR60 (SDA2008) -#define IRMP_KATHREIN_PROTOCOL 25 // Kathrein -#define IRMP_NETBOX_PROTOCOL 26 // Netbox keyboard (bitserial) -#define IRMP_NEC16_PROTOCOL 27 // NEC with 16 bits (incl. sync) -#define IRMP_NEC42_PROTOCOL 28 // NEC with 42 bits -#define IRMP_LEGO_PROTOCOL 29 // LEGO Power Functions RC -#define IRMP_THOMSON_PROTOCOL 30 // Thomson - -#define IRMP_N_PROTOCOLS 30 // number of supported protocols - -// some flags of struct IRMP_PARAMETER: -#define IRMP_PARAM_FLAG_IS_MANCHESTER 0x01 -#define IRMP_PARAM_FLAG_1ST_PULSE_IS_1 0x02 -#define IRMP_PARAM_FLAG_IS_SERIAL 0x04 - -#define SIRCS_START_BIT_PULSE_TIME 2400.0e-6 // 2400 usec pulse -#define SIRCS_START_BIT_PAUSE_TIME 600.0e-6 // 600 usec pause -#define SIRCS_1_PULSE_TIME 1200.0e-6 // 1200 usec pulse -#define SIRCS_0_PULSE_TIME 600.0e-6 // 600 usec pulse -#define SIRCS_PAUSE_TIME 600.0e-6 // 600 usec pause -#define SIRCS_FRAMES 3 // SIRCS sends each frame 3 times -#define SIRCS_AUTO_REPETITION_PAUSE_TIME 25.0e-3 // auto repetition after 25ms -#define SIRCS_FRAME_REPEAT_PAUSE_TIME 25.0e-3 // frame repeat after 25ms -#define SIRCS_ADDRESS_OFFSET 15 // skip 15 bits -#define SIRCS_ADDRESS_LEN 5 // read up to 5 address bits -#define SIRCS_COMMAND_OFFSET 0 // skip 0 bits -#define SIRCS_COMMAND_LEN 15 // read 12-15 command bits -#define SIRCS_MINIMUM_DATA_LEN 12 // minimum data length -#define SIRCS_COMPLETE_DATA_LEN 20 // complete length - may be up to 20 -#define SIRCS_STOP_BIT 0 // has no stop bit -#define SIRCS_LSB 1 // LSB...MSB -#define SIRCS_FLAGS 0 // flags - -#define NEC_START_BIT_PULSE_TIME 9000.0e-6 // 9000 usec pulse -#define NEC_START_BIT_PAUSE_TIME 4500.0e-6 // 4500 usec pause -#define NEC_REPEAT_START_BIT_PAUSE_TIME 2250.0e-6 // 2250 usec pause -#define NEC_PULSE_TIME 560.0e-6 // 560 usec pulse -#define NEC_1_PAUSE_TIME 1690.0e-6 // 1690 usec pause -#define NEC_0_PAUSE_TIME 560.0e-6 // 560 usec pause -#define NEC_FRAME_REPEAT_PAUSE_TIME 40.0e-3 // frame repeat after 40ms -#define NEC_ADDRESS_OFFSET 0 // skip 0 bits -#define NEC_ADDRESS_LEN 16 // read 16 address bits -#define NEC_COMMAND_OFFSET 16 // skip 16 bits (8 address + 8 /address) -#define NEC_COMMAND_LEN 16 // read 16 bits (8 command + 8 /command) -#define NEC_COMPLETE_DATA_LEN 32 // complete length -#define NEC_STOP_BIT 1 // has stop bit -#define NEC_LSB 1 // LSB...MSB -#define NEC_FLAGS 0 // flags - -#define NEC42_ADDRESS_OFFSET 0 // skip 0 bits -#define NEC42_ADDRESS_LEN 13 // read 13 address bits -#define NEC42_COMMAND_OFFSET 26 // skip 26 bits (2 x 13 address bits) -#define NEC42_COMMAND_LEN 8 // read 8 command bits -#define NEC42_COMPLETE_DATA_LEN 42 // complete length (2 x 13 + 2 x 8) - -#define NEC16_ADDRESS_OFFSET 0 // skip 0 bits -#define NEC16_ADDRESS_LEN 8 // read 8 address bits -#define NEC16_COMMAND_OFFSET 8 // skip 8 bits (8 address) -#define NEC16_COMMAND_LEN 8 // read 8 bits (8 command) -#define NEC16_COMPLETE_DATA_LEN 16 // complete length - -#define SAMSUNG_START_BIT_PULSE_TIME 4500.0e-6 // 4500 usec pulse -#define SAMSUNG_START_BIT_PAUSE_TIME 4500.0e-6 // 4500 usec pause -#define SAMSUNG_PULSE_TIME 550.0e-6 // 550 usec pulse -#define SAMSUNG_1_PAUSE_TIME 1650.0e-6 // 1650 usec pause -#define SAMSUNG_0_PAUSE_TIME 550.0e-6 // 550 usec pause - -#define SAMSUNG_FRAME_REPEAT_PAUSE_TIME 25.0e-3 // frame repeat after 25ms -#define SAMSUNG_ADDRESS_OFFSET 0 // skip 0 bits -#define SAMSUNG_ADDRESS_LEN 16 // read 16 address bits -#define SAMSUNG_ID_OFFSET 17 // skip 16 + 1 sync bit -#define SAMSUNG_ID_LEN 4 // read 4 id bits -#define SAMSUNG_COMMAND_OFFSET 21 // skip 16 + 1 sync + 4 data bits -#define SAMSUNG_COMMAND_LEN 16 // read 16 command bits -#define SAMSUNG_COMPLETE_DATA_LEN 37 // complete length -#define SAMSUNG_STOP_BIT 1 // has stop bit -#define SAMSUNG_LSB 1 // LSB...MSB? -#define SAMSUNG_FLAGS 0 // flags - -#define SAMSUNG32_COMMAND_OFFSET 16 // skip 16 bits -#define SAMSUNG32_COMMAND_LEN 16 // read 16 command bits -#define SAMSUNG32_COMPLETE_DATA_LEN 32 // complete length -#define SAMSUNG32_FRAMES 1 // SAMSUNG32 sends each frame 1 times -#define SAMSUNG32_AUTO_REPETITION_PAUSE_TIME 47.0e-3 // repetition after 47 ms -#define SAMSUNG32_FRAME_REPEAT_PAUSE_TIME 47.0e-3 // frame repeat after 47ms - -#define MATSUSHITA_START_BIT_PULSE_TIME 3488.0e-6 // 3488 usec pulse -#define MATSUSHITA_START_BIT_PAUSE_TIME 3488.0e-6 // 3488 usec pause -#define MATSUSHITA_PULSE_TIME 872.0e-6 // 872 usec pulse -#define MATSUSHITA_1_PAUSE_TIME 2616.0e-6 // 2616 usec pause -#define MATSUSHITA_0_PAUSE_TIME 872.0e-6 // 872 usec pause -#define MATSUSHITA_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms -#define MATSUSHITA_ADDRESS_OFFSET 12 // skip 12 bits -#define MATSUSHITA_ADDRESS_LEN 12 // read 12 address bits -#define MATSUSHITA_COMMAND_OFFSET 0 // skip 0 bits -#define MATSUSHITA_COMMAND_LEN 12 // read 12 bits (6 custom + 6 command) -#define MATSUSHITA_COMPLETE_DATA_LEN 24 // complete length -#define MATSUSHITA_STOP_BIT 1 // has stop bit -#define MATSUSHITA_LSB 1 // LSB...MSB? -#define MATSUSHITA_FLAGS 0 // flags - -#define KASEIKYO_START_BIT_PULSE_TIME 3380.0e-6 // 3380 usec pulse -#define KASEIKYO_START_BIT_PAUSE_TIME 1690.0e-6 // 1690 usec pause -#define KASEIKYO_PULSE_TIME 423.0e-6 // 525 usec pulse -#define KASEIKYO_1_PAUSE_TIME 1269.0e-6 // 525 usec pause -#define KASEIKYO_0_PAUSE_TIME 423.0e-6 // 1690 usec pause -#define KASEIKYO_AUTO_REPETITION_PAUSE_TIME 74.0e-3 // repetition after 74 ms -#define KASEIKYO_FRAME_REPEAT_PAUSE_TIME 74.0e-3 // frame repeat after 74 ms -#define KASEIKYO_ADDRESS_OFFSET 0 // skip 0 bits -#define KASEIKYO_ADDRESS_LEN 16 // read 16 address bits -#define KASEIKYO_COMMAND_OFFSET 28 // skip 28 bits (16 manufacturer & 4 parity & 8 genre) -#define KASEIKYO_COMMAND_LEN 12 // read 12 command bits (10 real command & 2 id) -#define KASEIKYO_COMPLETE_DATA_LEN 48 // complete length -#define KASEIKYO_STOP_BIT 1 // has stop bit -#define KASEIKYO_LSB 1 // LSB...MSB? -#define KASEIKYO_FRAMES 2 // KASEIKYO sends 1st frame 2 times -#define KASEIKYO_FLAGS 0 // flags - -#define RECS80_START_BIT_PULSE_TIME 158.0e-6 // 158 usec pulse -#define RECS80_START_BIT_PAUSE_TIME 7432.0e-6 // 7432 usec pause -#define RECS80_PULSE_TIME 158.0e-6 // 158 usec pulse -#define RECS80_1_PAUSE_TIME 7432.0e-6 // 7432 usec pause -#define RECS80_0_PAUSE_TIME 4902.0e-6 // 4902 usec pause -#define RECS80_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms -#define RECS80_ADDRESS_OFFSET 1 // skip 1 bit (toggle bit) -#define RECS80_ADDRESS_LEN 3 // read 3 address bits -#define RECS80_COMMAND_OFFSET 4 // skip 4 bits (1 toggle + 3 address) -#define RECS80_COMMAND_LEN 6 // read 6 command bits -#define RECS80_COMPLETE_DATA_LEN 10 // complete length -#define RECS80_STOP_BIT 1 // has stop bit -#define RECS80_LSB 0 // MSB...LSB -#define RECS80_FLAGS 0 // flags - -#define RC5_BIT_TIME 889.0e-6 // 889 usec pulse/pause -#define RC5_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms - -#define RC5_ADDRESS_OFFSET 1 // skip 1 bit (2nd start) -#define RC5_ADDRESS_LEN 6 // read 1 toggle bit (for key repetition detection) + 5 address bits -#define RC5_COMMAND_OFFSET 7 // skip 5 bits (2nd start + 1 toggle + 5 address) -#define RC5_COMMAND_LEN 6 // read 6 command bits -#define RC5_COMPLETE_DATA_LEN 13 // complete length -#define RC5_STOP_BIT 0 // has no stop bit -#define RC5_LSB 0 // MSB...LSB -#define RC5_FLAGS IRMP_PARAM_FLAG_IS_MANCHESTER // flags - -#define DENON_PULSE_TIME 310.0e-6 // 310 usec pulse in practice, 275 in theory -#define DENON_1_PAUSE_TIME 1780.0e-6 // 1780 usec pause in practice, 1900 in theory -#define DENON_0_PAUSE_TIME 745.0e-6 // 745 usec pause in practice, 775 in theory -#define DENON_FRAMES 2 // DENON sends each frame 2 times -#define DENON_AUTO_REPETITION_PAUSE_TIME 65.0e-3 // inverted repetition after 65ms -#define DENON_FRAME_REPEAT_PAUSE_TIME 65.0e-3 // frame repeat after 65ms -#define DENON_ADDRESS_OFFSET 0 // skip 0 bits -#define DENON_ADDRESS_LEN 5 // read 5 address bits -#define DENON_COMMAND_OFFSET 5 // skip 5 -#define DENON_COMMAND_LEN 10 // read 10 command bits -#define DENON_COMPLETE_DATA_LEN 15 // complete length -#define DENON_STOP_BIT 1 // has stop bit -#define DENON_LSB 0 // MSB...LSB -#define DENON_FLAGS 0 // flags - -#define RC6_START_BIT_PULSE_TIME 2666.0e-6 // 2.666 msec pulse -#define RC6_START_BIT_PAUSE_TIME 889.0e-6 // 889 usec pause -#define RC6_TOGGLE_BIT_TIME 889.0e-6 // 889 msec pulse/pause -#define RC6_BIT_TIME 444.0e-6 // 889 usec pulse/pause -#define RC6_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms -#define RC6_ADDRESS_OFFSET 5 // skip "1" + 3 mode bits + 1 toggle bit -#define RC6_ADDRESS_LEN 8 // read 8 address bits -#define RC6_COMMAND_OFFSET 13 // skip 12 bits ("1" + 3 mode + 1 toggle + 8 address) -#define RC6_COMMAND_LEN 8 // read 8 command bits -#define RC6_COMPLETE_DATA_LEN_SHORT 21 // complete length -#define RC6_COMPLETE_DATA_LEN_LONG 36 // complete length -#define RC6_STOP_BIT 0 // has no stop bit -#define RC6_LSB 0 // MSB...LSB -#define RC6_FLAGS (IRMP_PARAM_FLAG_IS_MANCHESTER | IRMP_PARAM_FLAG_1ST_PULSE_IS_1) // flags - -#define RECS80EXT_START_BIT_PULSE_TIME 158.0e-6 // 158 usec pulse -#define RECS80EXT_START_BIT_PAUSE_TIME 3637.0e-6 // 3637 usec pause -#define RECS80EXT_PULSE_TIME 158.0e-6 // 158 usec pulse -#define RECS80EXT_1_PAUSE_TIME 7432.0e-6 // 7432 usec pause -#define RECS80EXT_0_PAUSE_TIME 4902.0e-6 // 4902 usec pause -#define RECS80EXT_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms -#define RECS80EXT_ADDRESS_OFFSET 2 // skip 2 bits (2nd start + 1 toggle) -#define RECS80EXT_ADDRESS_LEN 4 // read 4 address bits -#define RECS80EXT_COMMAND_OFFSET 6 // skip 6 bits (2nd start + 1 toggle + 4 address) -#define RECS80EXT_COMMAND_LEN 6 // read 6 command bits -#define RECS80EXT_COMPLETE_DATA_LEN 12 // complete length -#define RECS80EXT_STOP_BIT 1 // has stop bit -#define RECS80EXT_LSB 0 // MSB...LSB -#define RECS80EXT_FLAGS 0 // flags - -#define NUBERT_START_BIT_PULSE_TIME 1340.0e-6 // 1340 usec pulse -#define NUBERT_START_BIT_PAUSE_TIME 340.0e-6 // 340 usec pause -#define NUBERT_1_PULSE_TIME 1340.0e-6 // 1340 usec pulse -#define NUBERT_1_PAUSE_TIME 340.0e-6 // 340 usec pause -#define NUBERT_0_PULSE_TIME 500.0e-6 // 500 usec pulse -#define NUBERT_0_PAUSE_TIME 1300.0e-6 // 1300 usec pause -#define NUBERT_FRAMES 2 // Nubert sends 2 frames -#define NUBERT_AUTO_REPETITION_PAUSE_TIME 35.0e-3 // auto repetition after 35ms -#define NUBERT_FRAME_REPEAT_PAUSE_TIME 35.0e-3 // frame repeat after 45ms -#define NUBERT_ADDRESS_OFFSET 0 // skip 0 bits -#define NUBERT_ADDRESS_LEN 0 // read 0 address bits -#define NUBERT_COMMAND_OFFSET 0 // skip 0 bits -#define NUBERT_COMMAND_LEN 10 // read 10 bits -#define NUBERT_COMPLETE_DATA_LEN 10 // complete length -#define NUBERT_STOP_BIT 1 // has stop bit -#define NUBERT_LSB 0 // MSB? -#define NUBERT_FLAGS 0 // flags - -#define BANG_OLUFSEN_START_BIT1_PULSE_TIME 200.0e-6 // 200 usec pulse -#define BANG_OLUFSEN_START_BIT1_PAUSE_TIME 3125.0e-6 // 3125 usec pause -#define BANG_OLUFSEN_START_BIT2_PULSE_TIME 200.0e-6 // 200 usec pulse -#define BANG_OLUFSEN_START_BIT2_PAUSE_TIME 3125.0e-6 // 3125 usec pause -#define BANG_OLUFSEN_START_BIT3_PULSE_TIME 200.0e-6 // 200 usec pulse -#define BANG_OLUFSEN_START_BIT3_PAUSE_TIME 15625.0e-6 // 15625 usec pause -#define BANG_OLUFSEN_START_BIT4_PULSE_TIME 200.0e-6 // 200 usec pulse -#define BANG_OLUFSEN_START_BIT4_PAUSE_TIME 3125.0e-6 // 3125 usec pause -#define BANG_OLUFSEN_PULSE_TIME 200.0e-6 // 200 usec pulse -#define BANG_OLUFSEN_1_PAUSE_TIME 9375.0e-6 // 9375 usec pause -#define BANG_OLUFSEN_0_PAUSE_TIME 3125.0e-6 // 3125 usec pause -#define BANG_OLUFSEN_R_PAUSE_TIME 6250.0e-6 // 6250 usec pause (repeat last bit) -#define BANG_OLUFSEN_TRAILER_BIT_PAUSE_TIME 12500.0e-6 // 12500 usec pause (trailer bit) -#define BANG_OLUFSEN_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms -#define BANG_OLUFSEN_ADDRESS_OFFSET 0 // no address bits -#define BANG_OLUFSEN_ADDRESS_LEN 0 // no address bits -#define BANG_OLUFSEN_COMMAND_OFFSET 3 // skip startbits 2, 3, 4 -#define BANG_OLUFSEN_COMMAND_LEN 16 // read 16 command bits -#define BANG_OLUFSEN_COMPLETE_DATA_LEN 20 // complete length: startbits 2, 3, 4 + 16 data bits + trailer bit -#define BANG_OLUFSEN_STOP_BIT 1 // has stop bit -#define BANG_OLUFSEN_LSB 0 // MSB...LSB -#define BANG_OLUFSEN_FLAGS 0 // flags - -#define GRUNDIG_NOKIA_IR60_BIT_TIME 528.0e-6 // 528 usec pulse/pause -#define GRUNDIG_NOKIA_IR60_PRE_PAUSE_TIME 2639.0e-6 // 2639 usec pause after pre bit -#define GRUNDIG_NOKIA_IR60_FRAME_REPEAT_PAUSE_TIME 117.76e-3 // info frame repeat after 117.76 ms -#define GRUNDIG_NOKIA_IR60_STOP_BIT 0 // has no stop bit -#define GRUNDIG_NOKIA_IR60_LSB 1 // MSB...LSB -#define GRUNDIG_NOKIA_IR60_FLAGS (IRMP_PARAM_FLAG_IS_MANCHESTER | IRMP_PARAM_FLAG_1ST_PULSE_IS_1) // flags - -#define GRUNDIG_FRAMES 2 // GRUNDIG sends each frame 1+1 times -#define GRUNDIG_AUTO_REPETITION_PAUSE_TIME 20.0e-3 // repetition after 20ms -#define GRUNDIG_ADDRESS_OFFSET 0 // no address -#define GRUNDIG_ADDRESS_LEN 0 // no address -#define GRUNDIG_COMMAND_OFFSET 1 // skip 1 start bit -#define GRUNDIG_COMMAND_LEN 9 // read 9 command bits -#define GRUNDIG_COMPLETE_DATA_LEN 10 // complete length: 1 start bit + 9 data bits - -#define NOKIA_FRAMES 3 // NOKIA sends each frame 1 + 1 + 1 times -#define NOKIA_AUTO_REPETITION_PAUSE_TIME 20.0e-3 // repetition after 20ms -#define NOKIA_ADDRESS_OFFSET 9 // skip 9 bits (1 start bit + 8 data bits) -#define NOKIA_ADDRESS_LEN 8 // 7 address bits -#define NOKIA_COMMAND_OFFSET 1 // skip 1 bit (1 start bit) -#define NOKIA_COMMAND_LEN 8 // read 8 command bits -#define NOKIA_COMPLETE_DATA_LEN 17 // complete length: 1 start bit + 8 address bits + 8 command bits - -#define IR60_FRAMES 2 // IR60 sends each frame 1+1 times -#define IR60_AUTO_REPETITION_PAUSE_TIME 22.2e-3 // repetition after 22.2ms -#define IR60_TIMEOUT_TIME 5000.0e-6 // timeout grundig frame, switch to IR60 -#define IR60_ADDRESS_OFFSET 0 // skip 1 bits -#define IR60_ADDRESS_LEN 0 // read 0 address bits -#define IR60_COMMAND_OFFSET 0 // skip 1 bit (start bit after pre bit, always 1) -#define IR60_COMMAND_LEN 7 // read 6 command bits -#define IR60_COMPLETE_DATA_LEN 7 // complete length - -#define SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME 275.0e-6 // 275 usec pulse -#define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_TIME 550.0e-6 // 550 usec pause -#define SIEMENS_OR_RUWIDO_BIT_PULSE_TIME 275.0e-6 // 275 usec short pulse -#define SIEMENS_OR_RUWIDO_BIT_PULSE_TIME_2 550.0e-6 // 550 usec long pulse -#define SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME 275.0e-6 // 275 usec short pause -#define SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME_2 550.0e-6 // 550 usec long pause -#define SIEMENS_OR_RUWIDO_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms -#define SIEMENS_OR_RUWIDO_STOP_BIT 0 // has no stop bit -#define SIEMENS_OR_RUWIDO_LSB 0 // MSB...LSB -#define SIEMENS_OR_RUWIDO_FLAGS (IRMP_PARAM_FLAG_IS_MANCHESTER | IRMP_PARAM_FLAG_1ST_PULSE_IS_1) // flags - -#define RUWIDO_ADDRESS_OFFSET 0 // skip 0 bits -#define RUWIDO_ADDRESS_LEN 9 // read 9 address bits -#define RUWIDO_COMMAND_OFFSET 9 // skip 9 bits -#define RUWIDO_COMMAND_LEN 8 // read 7 + 1 command bits, last bit is only check bit -#define RUWIDO_COMPLETE_DATA_LEN 17 // complete length - -#define SIEMENS_ADDRESS_OFFSET 0 // skip 0 bits -#define SIEMENS_ADDRESS_LEN 11 // read 11 bits -#define SIEMENS_COMMAND_OFFSET 11 // skip 11 bits -#define SIEMENS_COMMAND_LEN 11 // read 10 + 1 command bits, last bit is only check bit -#define SIEMENS_COMPLETE_DATA_LEN 22 // complete length +#if defined (ATMEL_AVR) +# define _CONCAT(a,b) a##b +# define CONCAT(a,b) _CONCAT(a,b) +# define IRMP_PORT CONCAT(PORT, IRMP_PORT_LETTER) +# define IRMP_DDR CONCAT(DDR, IRMP_PORT_LETTER) +# define IRMP_PIN CONCAT(PIN, IRMP_PORT_LETTER) +# define IRMP_BIT IRMP_BIT_NUMBER +# define input(x) ((x) & (1 << IRMP_BIT)) +#elif defined (PIC_C18) +# define input(x) (x) +#elif defined (PIC_CCS) +# define input(x) (x) +#elif defined (ARM_STM32) +# define _CONCAT(a,b) a##b +# define CONCAT(a,b) _CONCAT(a,b) +# define IRMP_PORT CONCAT(GPIO, IRMP_PORT_LETTER) +# if defined (ARM_STM32L1XX) +# define IRMP_PORT_RCC CONCAT(RCC_AHBPeriph_GPIO, IRMP_PORT_LETTER) +# elif defined (ARM_STM32F10X) +# define IRMP_PORT_RCC CONCAT(RCC_APB2Periph_GPIO, IRMP_PORT_LETTER) +# elif defined (ARM_STM32F4XX) +# define IRMP_PORT_RCC CONCAT(RCC_AHB1Periph_GPIO, IRMP_PORT_LETTER) +# endif +# define IRMP_BIT CONCAT(GPIO_Pin_, IRMP_BIT_NUMBER) +# define IRMP_PIN IRMP_PORT // for use with input(x) below +# define input(x) (GPIO_ReadInputDataBit(x, IRMP_BIT)) +# ifndef USE_STDPERIPH_DRIVER +# warning The STM32 port of IRMP uses the ST standard peripheral drivers which are not enabled in your build configuration. +# endif +#endif -#define FDC_START_BIT_PULSE_TIME 2085.0e-6 // 2085 usec pulse -#define FDC_START_BIT_PAUSE_TIME 966.0e-6 // 966 usec pause -#define FDC_PULSE_TIME 300.0e-6 // 300 usec pulse -#define FDC_1_PAUSE_TIME 715.0e-6 // 715 usec pause -#define FDC_0_PAUSE_TIME 220.0e-6 // 220 usec pause -#define FDC_FRAME_REPEAT_PAUSE_TIME 60.0e-3 // frame repeat after 60ms -#define FDC_ADDRESS_OFFSET 0 // skip 0 bits -#define FDC_ADDRESS_LEN 14 // read 14 address bits, but use only 6, shift 8 into command -#define FDC_COMMAND_OFFSET 20 // skip 20 bits -#define FDC_COMMAND_LEN 12 // read 12 bits -#define FDC_COMPLETE_DATA_LEN 40 // complete length -#define FDC_STOP_BIT 1 // has stop bit -#define FDC_LSB 1 // LSB...MSB -#define FDC_FLAGS 0 // flags +#if IRMP_SUPPORT_DENON_PROTOCOL == 1 && IRMP_SUPPORT_RUWIDO_PROTOCOL == 1 +# warning DENON protocol conflicts wih RUWIDO, please enable only one of both protocols +# warning RUWIDO protocol disabled +# undef IRMP_SUPPORT_RUWIDO_PROTOCOL +# define IRMP_SUPPORT_RUWIDO_PROTOCOL 0 +#endif -#define RCCAR_START_BIT_PULSE_TIME 2000.0e-6 // 2000 usec pulse -#define RCCAR_START_BIT_PAUSE_TIME 2000.0e-6 // 2000 usec pause -#define RCCAR_PULSE_TIME 600.0e-6 // 360 usec pulse -#define RCCAR_1_PAUSE_TIME 450.0e-6 // 650 usec pause -#define RCCAR_0_PAUSE_TIME 900.0e-6 // 180 usec pause -#define RCCAR_FRAME_REPEAT_PAUSE_TIME 40.0e-3 // frame repeat after 40ms -#define RCCAR_ADDRESS_OFFSET 0 // skip 0 bits -#define RCCAR_ADDRESS_LEN 0 // read 0 address bits -#define RCCAR_COMMAND_OFFSET 0 // skip 0 bits -#define RCCAR_COMMAND_LEN 13 // read 13 bits -#define RCCAR_COMPLETE_DATA_LEN 13 // complete length -#define RCCAR_STOP_BIT 1 // has stop bit -#define RCCAR_LSB 1 // LSB...MSB -#define RCCAR_FLAGS 0 // flags +#if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 && F_INTERRUPTS < 15000 +# warning F_INTERRUPTS too low, SIEMENS protocol disabled (should be at least 15000) +# undef IRMP_SUPPORT_SIEMENS_PROTOCOL +# define IRMP_SUPPORT_SIEMENS_PROTOCOL 0 +#endif -#define JVC_START_BIT_PULSE_TIME 9000.0e-6 // 9000 usec pulse -#define JVC_START_BIT_PAUSE_TIME 4500.0e-6 // 4500 usec pause -#define JVC_PULSE_TIME 560.0e-6 // 560 usec pulse -#define JVC_1_PAUSE_TIME 1690.0e-6 // 1690 usec pause -#define JVC_0_PAUSE_TIME 560.0e-6 // 560 usec pause -#define JVC_FRAME_REPEAT_PAUSE_TIME 22.0e-3 // frame repeat after 22ms -#define JVC_ADDRESS_OFFSET 0 // skip 0 bits -#define JVC_ADDRESS_LEN 4 // read 4 address bits -#define JVC_COMMAND_OFFSET 4 // skip 4 bits -#define JVC_COMMAND_LEN 12 // read 12 bits -#define JVC_COMPLETE_DATA_LEN 16 // complete length -#define JVC_STOP_BIT 1 // has stop bit -#define JVC_LSB 1 // LSB...MSB -#define JVC_FLAGS 0 // flags +#if IRMP_SUPPORT_RUWIDO_PROTOCOL == 1 && F_INTERRUPTS < 15000 +# warning F_INTERRUPTS too low, RUWIDO protocol disabled (should be at least 15000) +# undef IRMP_SUPPORT_RUWIDO_PROTOCOL +# define IRMP_SUPPORT_RUWIDO_PROTOCOL 0 +#endif -#define NIKON_START_BIT_PULSE_TIME 2200.0e-6 // 2200 usec pulse -#define NIKON_START_BIT_PAUSE_TIME 27100.0e-6 // 27100 usec pause -#define NIKON_PULSE_TIME 500.0e-6 // 500 usec pulse -#define NIKON_1_PAUSE_TIME 3500.0e-6 // 3500 usec pause -#define NIKON_0_PAUSE_TIME 1500.0e-6 // 1500 usec pause -#define NIKON_FRAME_REPEAT_PAUSE_TIME 60.0e-3 // frame repeat after 60ms -#define NIKON_ADDRESS_OFFSET 0 // skip 0 bits -#define NIKON_ADDRESS_LEN 0 // read 0 address bits -#define NIKON_COMMAND_OFFSET 0 // skip 0 bits -#define NIKON_COMMAND_LEN 2 // read 2 bits -#define NIKON_COMPLETE_DATA_LEN 2 // complete length -#define NIKON_STOP_BIT 1 // has stop bit -#define NIKON_LSB 0 // LSB...MSB -#define NIKON_FLAGS 0 // flags +#if IRMP_SUPPORT_RECS80_PROTOCOL == 1 && F_INTERRUPTS < 15000 +# warning F_INTERRUPTS too low, RECS80 protocol disabled (should be at least 15000) +# undef IRMP_SUPPORT_RECS80_PROTOCOL +# define IRMP_SUPPORT_RECS80_PROTOCOL 0 +#endif -#define KATHREIN_START_BIT_PULSE_TIME 210.0e-6 // 1340 usec pulse -#define KATHREIN_START_BIT_PAUSE_TIME 6218.0e-6 // 340 usec pause -#define KATHREIN_1_PULSE_TIME 210.0e-6 // 1340 usec pulse -#define KATHREIN_1_PAUSE_TIME 3000.0e-6 // 340 usec pause -#define KATHREIN_0_PULSE_TIME 210.0e-6 // 500 usec pulse -#define KATHREIN_0_PAUSE_TIME 1400.0e-6 // 1300 usec pause -#define KATHREIN_SYNC_BIT_PAUSE_LEN_TIME 4600.0e-6 // 4600 usec sync (on 6th and/or 8th bit) -#define KATHREIN_FRAMES 1 // Kathrein sends 1 frame -#define KATHREIN_AUTO_REPETITION_PAUSE_TIME 35.0e-3 // auto repetition after 35ms -#define KATHREIN_FRAME_REPEAT_PAUSE_TIME 35.0e-3 // frame repeat after 35ms -#define KATHREIN_ADDRESS_OFFSET 1 // skip 1 bits -#define KATHREIN_ADDRESS_LEN 4 // read 4 address bits -#define KATHREIN_COMMAND_OFFSET 5 // skip 5 bits -#define KATHREIN_COMMAND_LEN 7 // read 7 bits -#define KATHREIN_COMPLETE_DATA_LEN 13 // complete length -#define KATHREIN_STOP_BIT 1 // has stop bit -#define KATHREIN_LSB 0 // MSB -#define KATHREIN_FLAGS 0 // flags +#if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1 && F_INTERRUPTS < 15000 +# warning F_INTERRUPTS too low, RECS80EXT protocol disabled (should be at least 15000) +# undef IRMP_SUPPORT_RECS80EXT_PROTOCOL +# define IRMP_SUPPORT_RECS80EXT_PROTOCOL 0 +#endif -#define NETBOX_START_BIT_PULSE_TIME 2400.0e-6 // 2400 usec pulse -#define NETBOX_START_BIT_PAUSE_TIME 800.0e-6 // 800 usec pause -#define NETBOX_PULSE_TIME 800.0e-6 // 800 usec pulse -#define NETBOX_PAUSE_TIME 800.0e-6 // 800 usec pause -#define NETBOX_FRAMES 1 // Netbox sends 1 frame -#define NETBOX_AUTO_REPETITION_PAUSE_TIME 35.0e-3 // auto repetition after 35ms -#define NETBOX_FRAME_REPEAT_PAUSE_TIME 35.0e-3 // frame repeat after 35ms -#define NETBOX_ADDRESS_OFFSET 0 // skip 0 bits -#define NETBOX_ADDRESS_LEN 3 // read 3 address bits -#define NETBOX_COMMAND_OFFSET 3 // skip 3 bits -#define NETBOX_COMMAND_LEN 13 // read 13 bits -#define NETBOX_COMPLETE_DATA_LEN 16 // complete length -#define NETBOX_STOP_BIT 0 // has no stop bit -#define NETBOX_LSB 1 // LSB -#define NETBOX_FLAGS IRMP_PARAM_FLAG_IS_SERIAL // flags +#if IRMP_SUPPORT_LEGO_PROTOCOL == 1 && F_INTERRUPTS < 20000 +# warning F_INTERRUPTS too low, LEGO protocol disabled (should be at least 20000) +# undef IRMP_SUPPORT_LEGO_PROTOCOL +# define IRMP_SUPPORT_LEGO_PROTOCOL 0 +#endif -#define LEGO_START_BIT_PULSE_TIME 158.0e-6 // 158 usec pulse ( 6 x 1/38kHz) -#define LEGO_START_BIT_PAUSE_TIME 1026.0e-6 // 1026 usec pause (39 x 1/38kHz) -#define LEGO_PULSE_TIME 158.0e-6 // 158 usec pulse ( 6 x 1/38kHz) -#define LEGO_1_PAUSE_TIME 553.0e-6 // 553 usec pause (21 x 1/38kHz) -#define LEGO_0_PAUSE_TIME 263.0e-6 // 263 usec pause (10 x 1/38kHz) -#define LEGO_FRAME_REPEAT_PAUSE_TIME 40.0e-3 // frame repeat after 40ms -#define LEGO_ADDRESS_OFFSET 0 // skip 0 bits -#define LEGO_ADDRESS_LEN 0 // read 0 address bits -#define LEGO_COMMAND_OFFSET 0 // skip 0 bits -#define LEGO_COMMAND_LEN 16 // read 16 bits (12 command + 4 CRC) -#define LEGO_COMPLETE_DATA_LEN 16 // complete length -#define LEGO_STOP_BIT 1 // has stop bit -#define LEGO_LSB 0 // MSB...LSB -#define LEGO_FLAGS 0 // flags +#if IRMP_SUPPORT_JVC_PROTOCOL == 1 && IRMP_SUPPORT_NEC_PROTOCOL == 0 +# warning JVC protocol needs also NEC protocol, NEC protocol enabled +# undef IRMP_SUPPORT_NEC_PROTOCOL +# define IRMP_SUPPORT_NEC_PROTOCOL 1 +#endif -#define THOMSON_PULSE_TIME 550.0e-6 // 550 usec pulse -#define THOMSON_1_PAUSE_TIME 4500.0e-6 // 4500 usec pause -#define THOMSON_0_PAUSE_TIME 2000.0e-6 // 2000 usec pause -#define THOMSON_FRAMES 1 // THOMSON sends 1 frame -#define THOMSON_AUTO_REPETITION_PAUSE_TIME 65.0e-3 // repetition after 65ms -#define THOMSON_FRAME_REPEAT_PAUSE_TIME 65.0e-3 // frame repeat after 65ms -#define THOMSON_ADDRESS_OFFSET 0 // skip 0 bits -#define THOMSON_ADDRESS_LEN 4 // read 4 address bits -#define THOMSON_COMMAND_OFFSET 5 // skip 4 address bits + 1 toggle bit -#define THOMSON_COMMAND_LEN 7 // read 7 command bits -#define THOMSON_COMPLETE_DATA_LEN 12 // complete length -#define THOMSON_STOP_BIT 1 // has stop bit -#define THOMSON_LSB 0 // MSB...LSB -#define THOMSON_FLAGS 0 // flags +#if IRMP_SUPPORT_NEC16_PROTOCOL == 1 && IRMP_SUPPORT_NEC_PROTOCOL == 0 +# warning NEC16 protocol needs also NEC protocol, NEC protocol enabled +# undef IRMP_SUPPORT_NEC_PROTOCOL +# define IRMP_SUPPORT_NEC_PROTOCOL 1 +#endif -#define AUTO_FRAME_REPETITION_TIME 80.0e-3 // SIRCS/SAMSUNG32/NUBERT: automatic repetition after 25-50ms - // KASEIKYO: automatic repetition after 75ms +#if IRMP_SUPPORT_NEC42_PROTOCOL == 1 && IRMP_SUPPORT_NEC_PROTOCOL == 0 +# warning NEC42 protocol needs also NEC protocol, NEC protocol enabled +# undef IRMP_SUPPORT_NEC_PROTOCOL +# define IRMP_SUPPORT_NEC_PROTOCOL 1 +#endif -#define TRUE 1 -#define FALSE 0 +#if F_INTERRUPTS > 20000 +#error F_INTERRUPTS too high (should be not greater than 20000) +#endif -#define IRMP_FLAG_REPETITION 0x01 +#include "irmpprotocols.h" -typedef struct -{ - uint8_t protocol; // protocol, i.e. NEC_PROTOCOL - uint16_t address; // address - uint16_t command; // command - uint8_t flags; // flags, e.g. repetition -} IRMP_DATA; +#define IRMP_FLAG_REPETITION 0x01 extern void irmp_init (void); extern uint8_t irmp_get_data (IRMP_DATA *); @@ -510,6 +128,6 @@ extern char * irmp_protocol_names[IRMP_N_PROTOCOLS + 1 #if IRMP_USE_CALLBACK == 1 extern void irmp_set_callback_ptr (void (*cb)(uint8_t)); -#endif // IRSND_USE_CALLBACK == 1 +#endif // IRMP_USE_CALLBACK == 1 -#endif /* _WC_IRMP_H_ */ +#endif /* _IRMP_H_ */ diff --git a/irmpconfig.h b/irmpconfig.h index bc5e465..db0f5e4 100644 --- a/irmpconfig.h +++ b/irmpconfig.h @@ -1,9 +1,11 @@ /*--------------------------------------------------------------------------------------------------------------------------------------------------- * irmpconfig.h * - * Copyright (c) 2009-2011 Frank Meyer - frank(at)fli4l.de + * DO NOT INCLUDE THIS FILE, WILL BE INCLUDED BY IRMP.H! * - * $Id: irmpconfig.h,v 1.83 2012/02/24 15:00:18 fm Exp $ + * Copyright (c) 2009-2012 Frank Meyer - frank(at)fli4l.de + * + * $Id: irmpconfig.h,v 1.90 2012/05/23 12:26:26 fm Exp $ * * ATMEGA88 @ 8 MHz * @@ -17,6 +19,10 @@ #ifndef _IRMPCONFIG_H_ #define _IRMPCONFIG_H_ +#ifndef _IRMP_H_ +# error please include only irmp.h, not irmpconfig.h +#endif + /*--------------------------------------------------------------------------------------------------------------------------------------------------- * Change F_INTERRUPTS if you change the number of interrupts per second, * Normally, F_INTERRUPTS should be in the range from 10000 to 15000, typical is 15000 @@ -24,7 +30,7 @@ *--------------------------------------------------------------------------------------------------------------------------------------------------- */ #ifndef F_INTERRUPTS -#define F_INTERRUPTS 15000 // interrupts per second, min: 10000, max: 20000, typ: 15000 +# define F_INTERRUPTS 15000 // interrupts per second, min: 10000, max: 20000, typ: 15000 #endif /*--------------------------------------------------------------------------------------------------------------------------------------------------- @@ -39,6 +45,7 @@ * * If you want to use FDC or RCCAR simultaneous with RC5 protocol, additional program space is required. * If you don't need RC5 when using FDC/RCCAR, you should disable RC5. + * You cannot enable both DENON and RUWIDO, only enable one of them. *--------------------------------------------------------------------------------------------------------------------------------------------------- */ @@ -56,7 +63,7 @@ #define IRMP_SUPPORT_JVC_PROTOCOL 0 // JVC >= 10000 ~150 bytes #define IRMP_SUPPORT_NEC16_PROTOCOL 0 // NEC16 >= 10000 ~100 bytes #define IRMP_SUPPORT_NEC42_PROTOCOL 0 // NEC42 >= 10000 ~300 bytes -#define IRMP_SUPPORT_IR60_PROTOCOL 1 // IR60 (SDA2008) >= 10000 ~300 bytes +#define IRMP_SUPPORT_IR60_PROTOCOL 0 // IR60 (SDA2008) >= 10000 ~300 bytes #define IRMP_SUPPORT_GRUNDIG_PROTOCOL 0 // Grundig >= 10000 ~300 bytes #define IRMP_SUPPORT_SIEMENS_PROTOCOL 0 // Siemens Gigaset >= 15000 ~550 bytes #define IRMP_SUPPORT_NOKIA_PROTOCOL 0 // Nokia >= 10000 ~300 bytes @@ -76,108 +83,74 @@ #define IRMP_SUPPORT_LEGO_PROTOCOL 0 // LEGO Power RC >= 20000 ~150 bytes /*--------------------------------------------------------------------------------------------------------------------------------------------------- - * Change hardware pin here: + * Change hardware pin here for ATMEL AVR *--------------------------------------------------------------------------------------------------------------------------------------------------- */ -#if defined (PIC_C18) // Microchip C18 Compiler -#include // main PIC18 h file -#define IRMP_PIN PORTBbits.RB4 // use RB4 as IR input on PIC -#define input(x) (x) - -#elif defined (PIC_CCS_COMPILER) // PIC CCS Compiler: -#define IRMP_PIN PIN_B4 // use PB4 as IR input on PIC - -#else // AVR: -#define IRMP_PORT PORTB -#define IRMP_DDR DDRB -#define IRMP_PIN PINB -#define IRMP_BIT 6 // use PB6 as IR input on AVR -#define input(x) ((x) & (1 << IRMP_BIT)) -#endif +#if defined (ATMEL_AVR) // use PB6 as IR input on AVR +# define IRMP_PORT_LETTER B +# define IRMP_BIT_NUMBER 6 /*--------------------------------------------------------------------------------------------------------------------------------------------------- - * Set IRMP_LOGGING to 1 if want to log data to UART with 9600Bd + * Change hardware pin here for PIC C18 compiler *--------------------------------------------------------------------------------------------------------------------------------------------------- */ -#ifndef IRMP_LOGGING -#define IRMP_LOGGING 0 // 1: log IR signal (scan), 0: do not (default) -#endif +#elif defined (PIC_C18) // use RB4 as IR input on PIC +# define IRMP_PIN PORTBbits.RB4 /*--------------------------------------------------------------------------------------------------------------------------------------------------- - * Use external logging routines - * If you enable external logging, you have also to enable IRMP_LOGGING above + * Change hardware pin here for PIC CCS compiler *--------------------------------------------------------------------------------------------------------------------------------------------------- */ -#ifndef IRMP_EXT_LOGGING -#define IRMP_EXT_LOGGING 0 // 1:log, 0: do not log ; -#endif +#elif defined (PIC_CCS) +# define IRMP_PIN PIN_B4 // use PB4 as IR input on PIC /*--------------------------------------------------------------------------------------------------------------------------------------------------- - * Set IRMP_PROTOCOL_NAMES to 1 if want to access protocol names (for logging etc), costs ~300 bytes RAM! + * Change hardware pin here for ARM STM32 *--------------------------------------------------------------------------------------------------------------------------------------------------- */ -#define IRMP_PROTOCOL_NAMES 0 // 1: access protocol names, 0: do not (default), +#elif defined (ARM_STM32) // use C13 as IR input on STM32 +# define IRMP_PORT_LETTER C +# define IRMP_BIT_NUMBER 13 /*--------------------------------------------------------------------------------------------------------------------------------------------------- - * Use Callbacks to indicate input signal + * Handling of unknown target system: DON'T CHANGE *--------------------------------------------------------------------------------------------------------------------------------------------------- */ -#define IRMP_USE_CALLBACK 0 // flag: 0 = don't use callbacks, 1 = use callbacks, default is 0 +#elif !defined (UNIX_OR_WINDOWS) +# error target system not defined. +#endif /*--------------------------------------------------------------------------------------------------------------------------------------------------- - * DO NOT CHANGE THE FOLLOWING LINES ! + * Set IRMP_LOGGING to 1 if want to log data to UART with 9600Bd *--------------------------------------------------------------------------------------------------------------------------------------------------- */ -#if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 && F_INTERRUPTS < 15000 -# warning F_INTERRUPTS too low, SIEMENS protocol disabled (should be at least 15000) -# undef IRMP_SUPPORT_SIEMENS_PROTOCOL -# define IRMP_SUPPORT_SIEMENS_PROTOCOL 0 -#endif - -#if IRMP_SUPPORT_RUWIDO_PROTOCOL == 1 && F_INTERRUPTS < 15000 -# warning F_INTERRUPTS too low, RUWIDO protocol disabled (should be at least 15000) -# undef IRMP_SUPPORT_RUWIDO_PROTOCOL -# define IRMP_SUPPORT_RUWIDO_PROTOCOL 0 -#endif - -#if IRMP_SUPPORT_RECS80_PROTOCOL == 1 && F_INTERRUPTS < 15000 -# warning F_INTERRUPTS too low, RECS80 protocol disabled (should be at least 15000) -# undef IRMP_SUPPORT_RECS80_PROTOCOL -# define IRMP_SUPPORT_RECS80_PROTOCOL 0 -#endif - -#if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1 && F_INTERRUPTS < 15000 -# warning F_INTERRUPTS too low, RECS80EXT protocol disabled (should be at least 15000) -# undef IRMP_SUPPORT_RECS80EXT_PROTOCOL -# define IRMP_SUPPORT_RECS80EXT_PROTOCOL 0 -#endif - -#if IRMP_SUPPORT_LEGO_PROTOCOL == 1 && F_INTERRUPTS < 20000 -# warning F_INTERRUPTS too low, LEGO protocol disabled (should be at least 20000) -# undef IRMP_SUPPORT_LEGO_PROTOCOL -# define IRMP_SUPPORT_LEGO_PROTOCOL 0 -#endif - -#if IRMP_SUPPORT_JVC_PROTOCOL == 1 && IRMP_SUPPORT_NEC_PROTOCOL == 0 -# warning JVC protocol needs also NEC protocol, NEC protocol enabled -# undef IRMP_SUPPORT_NEC_PROTOCOL -# define IRMP_SUPPORT_NEC_PROTOCOL 1 +#ifndef IRMP_LOGGING +# define IRMP_LOGGING 0 // 1: log IR signal (scan), 0: do not. default is 0 #endif -#if IRMP_SUPPORT_NEC16_PROTOCOL == 1 && IRMP_SUPPORT_NEC_PROTOCOL == 0 -# warning NEC16 protocol needs also NEC protocol, NEC protocol enabled -# undef IRMP_SUPPORT_NEC_PROTOCOL -# define IRMP_SUPPORT_NEC_PROTOCOL 1 +/*--------------------------------------------------------------------------------------------------------------------------------------------------- + * Use external logging routines + * If you enable external logging, you have also to enable IRMP_LOGGING above + *--------------------------------------------------------------------------------------------------------------------------------------------------- + */ +#ifndef IRMP_EXT_LOGGING +# define IRMP_EXT_LOGGING 0 // 1: use external logging, 0: do not. default is 0 #endif -#if IRMP_SUPPORT_NEC42_PROTOCOL == 1 && IRMP_SUPPORT_NEC_PROTOCOL == 0 -# warning NEC42 protocol needs also NEC protocol, NEC protocol enabled -# undef IRMP_SUPPORT_NEC_PROTOCOL -# define IRMP_SUPPORT_NEC_PROTOCOL 1 +/*--------------------------------------------------------------------------------------------------------------------------------------------------- + * Set IRMP_PROTOCOL_NAMES to 1 if want to access protocol names (for logging etc), costs ~300 bytes RAM! + *--------------------------------------------------------------------------------------------------------------------------------------------------- + */ +#ifndef IRMP_PROTOCOL_NAMES +# define IRMP_PROTOCOL_NAMES 0 // 1: access protocol names, 0: do not. default is 0 #endif -#if F_INTERRUPTS > 20000 -#error F_INTERRUPTS too high (should be not greater than 20000) +/*--------------------------------------------------------------------------------------------------------------------------------------------------- + * Use Callbacks to indicate input signal + *--------------------------------------------------------------------------------------------------------------------------------------------------- + */ +#ifndef IRMP_USE_CALLBACK +# define IRMP_USE_CALLBACK 0 // 1: use callbacks. 0: do not. default is 0 #endif #endif /* _WC_IRMPCONFIG_H_ */ diff --git a/irmpextlog.c b/irmpextlog.c index 51d0afb..482a18d 100644 --- a/irmpextlog.c +++ b/irmpextlog.c @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------------------------------------------------------------- * irmpextlog.c - external logging * - * $Id: irmpextlog.c,v 1.1 2012/02/16 10:40:08 fm Exp $ + * $Id: irmpextlog.c,v 1.2 2012/02/27 09:04:21 fm Exp $ * * If you cannot use the internal UART logging routine, adapt the * source below for your application. The following implementation diff --git a/irmpprotocols.h b/irmpprotocols.h new file mode 100644 index 0000000..6544591 --- /dev/null +++ b/irmpprotocols.h @@ -0,0 +1,487 @@ +/*--------------------------------------------------------------------------------------------------------------------------------------------------- + * irmp-system.h - irmp target system definitions + * + * DO NOT INCLUDE THIS FILE, WILL BE INCLUDED BY IRMP.H or IRSND.H! + * + * Copyright (c) 2012 Frank Meyer - frank(at)fli4l.de + * + * $Id: irmpprotocols.h,v 1.4 2012/05/23 12:26:26 fm Exp $ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + *--------------------------------------------------------------------------------------------------------------------------------------------------- + */ + +#ifndef _IRMP_PROTOCOLS_H_ +#define _IRMP_PROTOCOLS_H_ + +#if !defined(_IRMP_H_) && !defined(_IRSND_H_) +# error please include only irmp.h or irsnd.h, not irmpprotocols.h +#endif + +/*--------------------------------------------------------------------------------------------------------------------------------------------------- + * IR protocols + *--------------------------------------------------------------------------------------------------------------------------------------------------- + */ +#define IRMP_SIRCS_PROTOCOL 1 // Sony +#define IRMP_NEC_PROTOCOL 2 // NEC, Pioneer, JVC, Toshiba, NoName etc. +#define IRMP_SAMSUNG_PROTOCOL 3 // Samsung +#define IRMP_MATSUSHITA_PROTOCOL 4 // Matsushita +#define IRMP_KASEIKYO_PROTOCOL 5 // Kaseikyo (Panasonic etc) +#define IRMP_RECS80_PROTOCOL 6 // Philips, Thomson, Nordmende, Telefunken, Saba +#define IRMP_RC5_PROTOCOL 7 // Philips etc +#define IRMP_DENON_PROTOCOL 8 // Denon, Sharp +#define IRMP_RC6_PROTOCOL 9 // Philips etc +#define IRMP_SAMSUNG32_PROTOCOL 10 // Samsung32: no sync pulse at bit 16, length 32 instead of 37 +#define IRMP_APPLE_PROTOCOL 11 // Apple, very similar to NEC +#define IRMP_RECS80EXT_PROTOCOL 12 // Philips, Technisat, Thomson, Nordmende, Telefunken, Saba +#define IRMP_NUBERT_PROTOCOL 13 // Nubert +#define IRMP_BANG_OLUFSEN_PROTOCOL 14 // Bang & Olufsen +#define IRMP_GRUNDIG_PROTOCOL 15 // Grundig +#define IRMP_NOKIA_PROTOCOL 16 // Nokia +#define IRMP_SIEMENS_PROTOCOL 17 // Siemens, e.g. Gigaset +#define IRMP_FDC_PROTOCOL 18 // FDC keyboard +#define IRMP_RCCAR_PROTOCOL 19 // RC Car +#define IRMP_JVC_PROTOCOL 20 // JVC (NEC with 16 bits) +#define IRMP_RC6A_PROTOCOL 21 // RC6A, e.g. Kathrein, XBOX +#define IRMP_NIKON_PROTOCOL 22 // Nikon +#define IRMP_RUWIDO_PROTOCOL 23 // Ruwido, e.g. T-Home Mediareceiver +#define IRMP_IR60_PROTOCOL 24 // IR60 (SDA2008) +#define IRMP_KATHREIN_PROTOCOL 25 // Kathrein +#define IRMP_NETBOX_PROTOCOL 26 // Netbox keyboard (bitserial) +#define IRMP_NEC16_PROTOCOL 27 // NEC with 16 bits (incl. sync) +#define IRMP_NEC42_PROTOCOL 28 // NEC with 42 bits +#define IRMP_LEGO_PROTOCOL 29 // LEGO Power Functions RC +#define IRMP_THOMSON_PROTOCOL 30 // Thomson + +#define IRMP_N_PROTOCOLS 30 // number of supported protocols + +/*--------------------------------------------------------------------------------------------------------------------------------------------------- + * timing constants: + *--------------------------------------------------------------------------------------------------------------------------------------------------- + */ +// fm 22.09.2011: may not be more than 16000L, otherwise some JVC codes will not be accepted +#define IRMP_TIMEOUT_TIME 15500.0e-6 // timeout after 15.5 ms darkness +#define IRMP_TIMEOUT_TIME_MS 15500L // timeout after 15.5 ms darkness + +#if IRMP_SUPPORT_NIKON_PROTOCOL == 1 +# define IRMP_TIMEOUT_NIKON_TIME 29500.0e-6 // 2nd timeout after 29.5 ms darkness (only for NIKON!) +# define IRMP_TIMEOUT_NIKON_TIME_MS 29500L // 2nd timeout after 29.5 ms darkness +typedef uint16_t PAUSE_LEN; +# define IRMP_TIMEOUT_NIKON_LEN (PAUSE_LEN)(F_INTERRUPTS * IRMP_TIMEOUT_NIKON_TIME + 0.5) +#else +# if (F_INTERRUPTS * IRMP_TIMEOUT_TIME_MS) / 1000000 >= 254 +typedef uint16_t PAUSE_LEN; +# else +typedef uint8_t PAUSE_LEN; +# endif +#endif + +#define IRMP_TIMEOUT_LEN (PAUSE_LEN)(F_INTERRUPTS * IRMP_TIMEOUT_TIME + 0.5) + +// some flags of struct IRMP_PARAMETER: +#define IRMP_PARAM_FLAG_IS_MANCHESTER 0x01 +#define IRMP_PARAM_FLAG_1ST_PULSE_IS_1 0x02 +#define IRMP_PARAM_FLAG_IS_SERIAL 0x04 + +#define SIRCS_START_BIT_PULSE_TIME 2400.0e-6 // 2400 usec pulse +#define SIRCS_START_BIT_PAUSE_TIME 600.0e-6 // 600 usec pause +#define SIRCS_1_PULSE_TIME 1200.0e-6 // 1200 usec pulse +#define SIRCS_0_PULSE_TIME 600.0e-6 // 600 usec pulse +#define SIRCS_PAUSE_TIME 600.0e-6 // 600 usec pause +#define SIRCS_FRAMES 3 // SIRCS sends each frame 3 times +#define SIRCS_AUTO_REPETITION_PAUSE_TIME 25.0e-3 // auto repetition after 25ms +#define SIRCS_FRAME_REPEAT_PAUSE_TIME 25.0e-3 // frame repeat after 25ms +#define SIRCS_ADDRESS_OFFSET 15 // skip 15 bits +#define SIRCS_ADDRESS_LEN 5 // read up to 5 address bits +#define SIRCS_COMMAND_OFFSET 0 // skip 0 bits +#define SIRCS_COMMAND_LEN 15 // read 12-15 command bits +#define SIRCS_MINIMUM_DATA_LEN 12 // minimum data length +#define SIRCS_COMPLETE_DATA_LEN 20 // complete length - may be up to 20 +#define SIRCS_STOP_BIT 0 // has no stop bit +#define SIRCS_LSB 1 // LSB...MSB +#define SIRCS_FLAGS 0 // flags + +#define NEC_START_BIT_PULSE_TIME 9000.0e-6 // 9000 usec pulse +#define NEC_START_BIT_PAUSE_TIME 4500.0e-6 // 4500 usec pause +#define NEC_REPEAT_START_BIT_PAUSE_TIME 2250.0e-6 // 2250 usec pause +#define NEC_PULSE_TIME 560.0e-6 // 560 usec pulse +#define NEC_1_PAUSE_TIME 1690.0e-6 // 1690 usec pause +#define NEC_0_PAUSE_TIME 560.0e-6 // 560 usec pause +#define NEC_FRAME_REPEAT_PAUSE_TIME 40.0e-3 // frame repeat after 40ms +#define NEC_ADDRESS_OFFSET 0 // skip 0 bits +#define NEC_ADDRESS_LEN 16 // read 16 address bits +#define NEC_COMMAND_OFFSET 16 // skip 16 bits (8 address + 8 /address) +#define NEC_COMMAND_LEN 16 // read 16 bits (8 command + 8 /command) +#define NEC_COMPLETE_DATA_LEN 32 // complete length +#define NEC_STOP_BIT 1 // has stop bit +#define NEC_LSB 1 // LSB...MSB +#define NEC_FLAGS 0 // flags + +#define NEC42_ADDRESS_OFFSET 0 // skip 0 bits +#define NEC42_ADDRESS_LEN 13 // read 13 address bits +#define NEC42_COMMAND_OFFSET 26 // skip 26 bits (2 x 13 address bits) +#define NEC42_COMMAND_LEN 8 // read 8 command bits +#define NEC42_COMPLETE_DATA_LEN 42 // complete length (2 x 13 + 2 x 8) + +#define NEC16_ADDRESS_OFFSET 0 // skip 0 bits +#define NEC16_ADDRESS_LEN 8 // read 8 address bits +#define NEC16_COMMAND_OFFSET 8 // skip 8 bits (8 address) +#define NEC16_COMMAND_LEN 8 // read 8 bits (8 command) +#define NEC16_COMPLETE_DATA_LEN 16 // complete length + +#define SAMSUNG_START_BIT_PULSE_TIME 4500.0e-6 // 4500 usec pulse +#define SAMSUNG_START_BIT_PAUSE_TIME 4500.0e-6 // 4500 usec pause +#define SAMSUNG_PULSE_TIME 550.0e-6 // 550 usec pulse +#define SAMSUNG_1_PAUSE_TIME 1650.0e-6 // 1650 usec pause +#define SAMSUNG_0_PAUSE_TIME 550.0e-6 // 550 usec pause + +#define SAMSUNG_FRAME_REPEAT_PAUSE_TIME 25.0e-3 // frame repeat after 25ms +#define SAMSUNG_ADDRESS_OFFSET 0 // skip 0 bits +#define SAMSUNG_ADDRESS_LEN 16 // read 16 address bits +#define SAMSUNG_ID_OFFSET 17 // skip 16 + 1 sync bit +#define SAMSUNG_ID_LEN 4 // read 4 id bits +#define SAMSUNG_COMMAND_OFFSET 21 // skip 16 + 1 sync + 4 data bits +#define SAMSUNG_COMMAND_LEN 16 // read 16 command bits +#define SAMSUNG_COMPLETE_DATA_LEN 37 // complete length +#define SAMSUNG_STOP_BIT 1 // has stop bit +#define SAMSUNG_LSB 1 // LSB...MSB? +#define SAMSUNG_FLAGS 0 // flags + +#define SAMSUNG32_COMMAND_OFFSET 16 // skip 16 bits +#define SAMSUNG32_COMMAND_LEN 16 // read 16 command bits +#define SAMSUNG32_COMPLETE_DATA_LEN 32 // complete length +#define SAMSUNG32_FRAMES 1 // SAMSUNG32 sends each frame 1 times +#define SAMSUNG32_AUTO_REPETITION_PAUSE_TIME 47.0e-3 // repetition after 47 ms +#define SAMSUNG32_FRAME_REPEAT_PAUSE_TIME 47.0e-3 // frame repeat after 47ms + +#define MATSUSHITA_START_BIT_PULSE_TIME 3488.0e-6 // 3488 usec pulse +#define MATSUSHITA_START_BIT_PAUSE_TIME 3488.0e-6 // 3488 usec pause +#define MATSUSHITA_PULSE_TIME 872.0e-6 // 872 usec pulse +#define MATSUSHITA_1_PAUSE_TIME 2616.0e-6 // 2616 usec pause +#define MATSUSHITA_0_PAUSE_TIME 872.0e-6 // 872 usec pause +#define MATSUSHITA_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms +#define MATSUSHITA_ADDRESS_OFFSET 12 // skip 12 bits +#define MATSUSHITA_ADDRESS_LEN 12 // read 12 address bits +#define MATSUSHITA_COMMAND_OFFSET 0 // skip 0 bits +#define MATSUSHITA_COMMAND_LEN 12 // read 12 bits (6 custom + 6 command) +#define MATSUSHITA_COMPLETE_DATA_LEN 24 // complete length +#define MATSUSHITA_STOP_BIT 1 // has stop bit +#define MATSUSHITA_LSB 1 // LSB...MSB? +#define MATSUSHITA_FLAGS 0 // flags + +#define KASEIKYO_START_BIT_PULSE_TIME 3380.0e-6 // 3380 usec pulse +#define KASEIKYO_START_BIT_PAUSE_TIME 1690.0e-6 // 1690 usec pause +#define KASEIKYO_PULSE_TIME 423.0e-6 // 525 usec pulse +#define KASEIKYO_1_PAUSE_TIME 1269.0e-6 // 525 usec pause +#define KASEIKYO_0_PAUSE_TIME 423.0e-6 // 1690 usec pause +#define KASEIKYO_AUTO_REPETITION_PAUSE_TIME 74.0e-3 // repetition after 74 ms +#define KASEIKYO_FRAME_REPEAT_PAUSE_TIME 74.0e-3 // frame repeat after 74 ms +#define KASEIKYO_ADDRESS_OFFSET 0 // skip 0 bits +#define KASEIKYO_ADDRESS_LEN 16 // read 16 address bits +#define KASEIKYO_COMMAND_OFFSET 28 // skip 28 bits (16 manufacturer & 4 parity & 8 genre) +#define KASEIKYO_COMMAND_LEN 12 // read 12 command bits (10 real command & 2 id) +#define KASEIKYO_COMPLETE_DATA_LEN 48 // complete length +#define KASEIKYO_STOP_BIT 1 // has stop bit +#define KASEIKYO_LSB 1 // LSB...MSB? +#define KASEIKYO_FRAMES 2 // KASEIKYO sends 1st frame 2 times +#define KASEIKYO_FLAGS 0 // flags + +#define RECS80_START_BIT_PULSE_TIME 158.0e-6 // 158 usec pulse +#define RECS80_START_BIT_PAUSE_TIME 7432.0e-6 // 7432 usec pause +#define RECS80_PULSE_TIME 158.0e-6 // 158 usec pulse +#define RECS80_1_PAUSE_TIME 7432.0e-6 // 7432 usec pause +#define RECS80_0_PAUSE_TIME 4902.0e-6 // 4902 usec pause +#define RECS80_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms +#define RECS80_ADDRESS_OFFSET 1 // skip 1 bit (toggle bit) +#define RECS80_ADDRESS_LEN 3 // read 3 address bits +#define RECS80_COMMAND_OFFSET 4 // skip 4 bits (1 toggle + 3 address) +#define RECS80_COMMAND_LEN 6 // read 6 command bits +#define RECS80_COMPLETE_DATA_LEN 10 // complete length +#define RECS80_STOP_BIT 1 // has stop bit +#define RECS80_LSB 0 // MSB...LSB +#define RECS80_FLAGS 0 // flags + +#define RC5_BIT_TIME 889.0e-6 // 889 usec pulse/pause +#define RC5_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms + +#define RC5_ADDRESS_OFFSET 1 // skip 1 bit (2nd start) +#define RC5_ADDRESS_LEN 6 // read 1 toggle bit (for key repetition detection) + 5 address bits +#define RC5_COMMAND_OFFSET 7 // skip 5 bits (2nd start + 1 toggle + 5 address) +#define RC5_COMMAND_LEN 6 // read 6 command bits +#define RC5_COMPLETE_DATA_LEN 13 // complete length +#define RC5_STOP_BIT 0 // has no stop bit +#define RC5_LSB 0 // MSB...LSB +#define RC5_FLAGS IRMP_PARAM_FLAG_IS_MANCHESTER // flags + +#define DENON_PULSE_TIME 310.0e-6 // 310 usec pulse in practice, 275 in theory +#define DENON_1_PAUSE_TIME 1780.0e-6 // 1780 usec pause in practice, 1900 in theory +#define DENON_0_PAUSE_TIME 745.0e-6 // 745 usec pause in practice, 775 in theory +#define DENON_FRAMES 2 // DENON sends each frame 2 times +#define DENON_AUTO_REPETITION_PAUSE_TIME 65.0e-3 // inverted repetition after 65ms +#define DENON_FRAME_REPEAT_PAUSE_TIME 130.0e-3 // frame repeat after 2 * 65ms +#define DENON_ADDRESS_OFFSET 0 // skip 0 bits +#define DENON_ADDRESS_LEN 5 // read 5 address bits +#define DENON_COMMAND_OFFSET 5 // skip 5 +#define DENON_COMMAND_LEN 10 // read 10 command bits +#define DENON_COMPLETE_DATA_LEN 15 // complete length +#define DENON_STOP_BIT 1 // has stop bit +#define DENON_LSB 0 // MSB...LSB +#define DENON_FLAGS 0 // flags + +#define RC6_START_BIT_PULSE_TIME 2666.0e-6 // 2.666 msec pulse +#define RC6_START_BIT_PAUSE_TIME 889.0e-6 // 889 usec pause +#define RC6_TOGGLE_BIT_TIME 889.0e-6 // 889 msec pulse/pause +#define RC6_BIT_TIME 444.0e-6 // 889 usec pulse/pause +#define RC6_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms +#define RC6_ADDRESS_OFFSET 5 // skip "1" + 3 mode bits + 1 toggle bit +#define RC6_ADDRESS_LEN 8 // read 8 address bits +#define RC6_COMMAND_OFFSET 13 // skip 12 bits ("1" + 3 mode + 1 toggle + 8 address) +#define RC6_COMMAND_LEN 8 // read 8 command bits +#define RC6_COMPLETE_DATA_LEN_SHORT 21 // complete length +#define RC6_COMPLETE_DATA_LEN_LONG 36 // complete length +#define RC6_STOP_BIT 0 // has no stop bit +#define RC6_LSB 0 // MSB...LSB +#define RC6_FLAGS (IRMP_PARAM_FLAG_IS_MANCHESTER | IRMP_PARAM_FLAG_1ST_PULSE_IS_1) // flags + +#define RECS80EXT_START_BIT_PULSE_TIME 158.0e-6 // 158 usec pulse +#define RECS80EXT_START_BIT_PAUSE_TIME 3637.0e-6 // 3637 usec pause +#define RECS80EXT_PULSE_TIME 158.0e-6 // 158 usec pulse +#define RECS80EXT_1_PAUSE_TIME 7432.0e-6 // 7432 usec pause +#define RECS80EXT_0_PAUSE_TIME 4902.0e-6 // 4902 usec pause +#define RECS80EXT_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms +#define RECS80EXT_ADDRESS_OFFSET 2 // skip 2 bits (2nd start + 1 toggle) +#define RECS80EXT_ADDRESS_LEN 4 // read 4 address bits +#define RECS80EXT_COMMAND_OFFSET 6 // skip 6 bits (2nd start + 1 toggle + 4 address) +#define RECS80EXT_COMMAND_LEN 6 // read 6 command bits +#define RECS80EXT_COMPLETE_DATA_LEN 12 // complete length +#define RECS80EXT_STOP_BIT 1 // has stop bit +#define RECS80EXT_LSB 0 // MSB...LSB +#define RECS80EXT_FLAGS 0 // flags + +#define NUBERT_START_BIT_PULSE_TIME 1340.0e-6 // 1340 usec pulse +#define NUBERT_START_BIT_PAUSE_TIME 340.0e-6 // 340 usec pause +#define NUBERT_1_PULSE_TIME 1340.0e-6 // 1340 usec pulse +#define NUBERT_1_PAUSE_TIME 340.0e-6 // 340 usec pause +#define NUBERT_0_PULSE_TIME 500.0e-6 // 500 usec pulse +#define NUBERT_0_PAUSE_TIME 1300.0e-6 // 1300 usec pause +#define NUBERT_FRAMES 2 // Nubert sends 2 frames +#define NUBERT_AUTO_REPETITION_PAUSE_TIME 35.0e-3 // auto repetition after 35ms +#define NUBERT_FRAME_REPEAT_PAUSE_TIME 35.0e-3 // frame repeat after 45ms +#define NUBERT_ADDRESS_OFFSET 0 // skip 0 bits +#define NUBERT_ADDRESS_LEN 0 // read 0 address bits +#define NUBERT_COMMAND_OFFSET 0 // skip 0 bits +#define NUBERT_COMMAND_LEN 10 // read 10 bits +#define NUBERT_COMPLETE_DATA_LEN 10 // complete length +#define NUBERT_STOP_BIT 1 // has stop bit +#define NUBERT_LSB 0 // MSB? +#define NUBERT_FLAGS 0 // flags + +#define BANG_OLUFSEN_START_BIT1_PULSE_TIME 200.0e-6 // 200 usec pulse +#define BANG_OLUFSEN_START_BIT1_PAUSE_TIME 3125.0e-6 // 3125 usec pause +#define BANG_OLUFSEN_START_BIT2_PULSE_TIME 200.0e-6 // 200 usec pulse +#define BANG_OLUFSEN_START_BIT2_PAUSE_TIME 3125.0e-6 // 3125 usec pause +#define BANG_OLUFSEN_START_BIT3_PULSE_TIME 200.0e-6 // 200 usec pulse +#define BANG_OLUFSEN_START_BIT3_PAUSE_TIME 15625.0e-6 // 15625 usec pause +#define BANG_OLUFSEN_START_BIT4_PULSE_TIME 200.0e-6 // 200 usec pulse +#define BANG_OLUFSEN_START_BIT4_PAUSE_TIME 3125.0e-6 // 3125 usec pause +#define BANG_OLUFSEN_PULSE_TIME 200.0e-6 // 200 usec pulse +#define BANG_OLUFSEN_1_PAUSE_TIME 9375.0e-6 // 9375 usec pause +#define BANG_OLUFSEN_0_PAUSE_TIME 3125.0e-6 // 3125 usec pause +#define BANG_OLUFSEN_R_PAUSE_TIME 6250.0e-6 // 6250 usec pause (repeat last bit) +#define BANG_OLUFSEN_TRAILER_BIT_PAUSE_TIME 12500.0e-6 // 12500 usec pause (trailer bit) +#define BANG_OLUFSEN_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms +#define BANG_OLUFSEN_ADDRESS_OFFSET 0 // no address bits +#define BANG_OLUFSEN_ADDRESS_LEN 0 // no address bits +#define BANG_OLUFSEN_COMMAND_OFFSET 3 // skip startbits 2, 3, 4 +#define BANG_OLUFSEN_COMMAND_LEN 16 // read 16 command bits +#define BANG_OLUFSEN_COMPLETE_DATA_LEN 20 // complete length: startbits 2, 3, 4 + 16 data bits + trailer bit +#define BANG_OLUFSEN_STOP_BIT 1 // has stop bit +#define BANG_OLUFSEN_LSB 0 // MSB...LSB +#define BANG_OLUFSEN_FLAGS 0 // flags + +#define GRUNDIG_NOKIA_IR60_BIT_TIME 528.0e-6 // 528 usec pulse/pause +#define GRUNDIG_NOKIA_IR60_PRE_PAUSE_TIME 2639.0e-6 // 2639 usec pause after pre bit +#define GRUNDIG_NOKIA_IR60_FRAME_REPEAT_PAUSE_TIME 117.76e-3 // info frame repeat after 117.76 ms +#define GRUNDIG_NOKIA_IR60_STOP_BIT 0 // has no stop bit +#define GRUNDIG_NOKIA_IR60_LSB 1 // MSB...LSB +#define GRUNDIG_NOKIA_IR60_FLAGS (IRMP_PARAM_FLAG_IS_MANCHESTER | IRMP_PARAM_FLAG_1ST_PULSE_IS_1) // flags + +#define GRUNDIG_FRAMES 2 // GRUNDIG sends each frame 1+1 times +#define GRUNDIG_AUTO_REPETITION_PAUSE_TIME 20.0e-3 // repetition after 20ms +#define GRUNDIG_ADDRESS_OFFSET 0 // no address +#define GRUNDIG_ADDRESS_LEN 0 // no address +#define GRUNDIG_COMMAND_OFFSET 1 // skip 1 start bit +#define GRUNDIG_COMMAND_LEN 9 // read 9 command bits +#define GRUNDIG_COMPLETE_DATA_LEN 10 // complete length: 1 start bit + 9 data bits + +#define NOKIA_FRAMES 3 // NOKIA sends each frame 1 + 1 + 1 times +#define NOKIA_AUTO_REPETITION_PAUSE_TIME 20.0e-3 // repetition after 20ms +#define NOKIA_ADDRESS_OFFSET 9 // skip 9 bits (1 start bit + 8 data bits) +#define NOKIA_ADDRESS_LEN 8 // 7 address bits +#define NOKIA_COMMAND_OFFSET 1 // skip 1 bit (1 start bit) +#define NOKIA_COMMAND_LEN 8 // read 8 command bits +#define NOKIA_COMPLETE_DATA_LEN 17 // complete length: 1 start bit + 8 address bits + 8 command bits + +#define IR60_FRAMES 2 // IR60 sends each frame 1+1 times +#define IR60_AUTO_REPETITION_PAUSE_TIME 22.2e-3 // repetition after 22.2ms +#define IR60_TIMEOUT_TIME 5000.0e-6 // timeout grundig frame, switch to IR60 +#define IR60_ADDRESS_OFFSET 0 // skip 1 bits +#define IR60_ADDRESS_LEN 0 // read 0 address bits +#define IR60_COMMAND_OFFSET 0 // skip 1 bit (start bit after pre bit, always 1) +#define IR60_COMMAND_LEN 7 // read 6 command bits +#define IR60_COMPLETE_DATA_LEN 7 // complete length + +#define SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME 275.0e-6 // 275 usec pulse +#define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_TIME 550.0e-6 // 550 usec pause +#define SIEMENS_OR_RUWIDO_BIT_PULSE_TIME 275.0e-6 // 275 usec short pulse +#define SIEMENS_OR_RUWIDO_BIT_PULSE_TIME_2 550.0e-6 // 550 usec long pulse +#define SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME 275.0e-6 // 275 usec short pause +#define SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME_2 550.0e-6 // 550 usec long pause +#define SIEMENS_OR_RUWIDO_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms +#define SIEMENS_OR_RUWIDO_STOP_BIT 0 // has no stop bit +#define SIEMENS_OR_RUWIDO_LSB 0 // MSB...LSB +#define SIEMENS_OR_RUWIDO_FLAGS (IRMP_PARAM_FLAG_IS_MANCHESTER | IRMP_PARAM_FLAG_1ST_PULSE_IS_1) // flags + +#define RUWIDO_ADDRESS_OFFSET 0 // skip 0 bits +#define RUWIDO_ADDRESS_LEN 9 // read 9 address bits +#define RUWIDO_COMMAND_OFFSET 9 // skip 9 bits +#define RUWIDO_COMMAND_LEN 8 // read 7 + 1 command bits, last bit is only check bit +#define RUWIDO_COMPLETE_DATA_LEN 17 // complete length + +#define SIEMENS_ADDRESS_OFFSET 0 // skip 0 bits +#define SIEMENS_ADDRESS_LEN 11 // read 11 bits +#define SIEMENS_COMMAND_OFFSET 11 // skip 11 bits +#define SIEMENS_COMMAND_LEN 11 // read 10 + 1 command bits, last bit is only check bit +#define SIEMENS_COMPLETE_DATA_LEN 22 // complete length + +#define FDC_START_BIT_PULSE_TIME 2085.0e-6 // 2085 usec pulse +#define FDC_START_BIT_PAUSE_TIME 966.0e-6 // 966 usec pause +#define FDC_PULSE_TIME 300.0e-6 // 300 usec pulse +#define FDC_1_PAUSE_TIME 715.0e-6 // 715 usec pause +#define FDC_0_PAUSE_TIME 220.0e-6 // 220 usec pause +#define FDC_FRAME_REPEAT_PAUSE_TIME 60.0e-3 // frame repeat after 60ms +#define FDC_ADDRESS_OFFSET 0 // skip 0 bits +#define FDC_ADDRESS_LEN 14 // read 14 address bits, but use only 6, shift 8 into command +#define FDC_COMMAND_OFFSET 20 // skip 20 bits +#define FDC_COMMAND_LEN 12 // read 12 bits +#define FDC_COMPLETE_DATA_LEN 40 // complete length +#define FDC_STOP_BIT 1 // has stop bit +#define FDC_LSB 1 // LSB...MSB +#define FDC_FLAGS 0 // flags + +#define RCCAR_START_BIT_PULSE_TIME 2000.0e-6 // 2000 usec pulse +#define RCCAR_START_BIT_PAUSE_TIME 2000.0e-6 // 2000 usec pause +#define RCCAR_PULSE_TIME 600.0e-6 // 360 usec pulse +#define RCCAR_1_PAUSE_TIME 450.0e-6 // 650 usec pause +#define RCCAR_0_PAUSE_TIME 900.0e-6 // 180 usec pause +#define RCCAR_FRAME_REPEAT_PAUSE_TIME 40.0e-3 // frame repeat after 40ms +#define RCCAR_ADDRESS_OFFSET 0 // skip 0 bits +#define RCCAR_ADDRESS_LEN 0 // read 0 address bits +#define RCCAR_COMMAND_OFFSET 0 // skip 0 bits +#define RCCAR_COMMAND_LEN 13 // read 13 bits +#define RCCAR_COMPLETE_DATA_LEN 13 // complete length +#define RCCAR_STOP_BIT 1 // has stop bit +#define RCCAR_LSB 1 // LSB...MSB +#define RCCAR_FLAGS 0 // flags + +#define JVC_START_BIT_PULSE_TIME 9000.0e-6 // 9000 usec pulse +#define JVC_START_BIT_PAUSE_TIME 4500.0e-6 // 4500 usec pause +#define JVC_PULSE_TIME 560.0e-6 // 560 usec pulse +#define JVC_1_PAUSE_TIME 1690.0e-6 // 1690 usec pause +#define JVC_0_PAUSE_TIME 560.0e-6 // 560 usec pause +#define JVC_FRAME_REPEAT_PAUSE_TIME 22.0e-3 // frame repeat after 22ms +#define JVC_ADDRESS_OFFSET 0 // skip 0 bits +#define JVC_ADDRESS_LEN 4 // read 4 address bits +#define JVC_COMMAND_OFFSET 4 // skip 4 bits +#define JVC_COMMAND_LEN 12 // read 12 bits +#define JVC_COMPLETE_DATA_LEN 16 // complete length +#define JVC_STOP_BIT 1 // has stop bit +#define JVC_LSB 1 // LSB...MSB +#define JVC_FLAGS 0 // flags + +#define NIKON_START_BIT_PULSE_TIME 2200.0e-6 // 2200 usec pulse +#define NIKON_START_BIT_PAUSE_TIME 27100.0e-6 // 27100 usec pause +#define NIKON_PULSE_TIME 500.0e-6 // 500 usec pulse +#define NIKON_1_PAUSE_TIME 3500.0e-6 // 3500 usec pause +#define NIKON_0_PAUSE_TIME 1500.0e-6 // 1500 usec pause +#define NIKON_FRAME_REPEAT_PAUSE_TIME 60.0e-3 // frame repeat after 60ms +#define NIKON_ADDRESS_OFFSET 0 // skip 0 bits +#define NIKON_ADDRESS_LEN 0 // read 0 address bits +#define NIKON_COMMAND_OFFSET 0 // skip 0 bits +#define NIKON_COMMAND_LEN 2 // read 2 bits +#define NIKON_COMPLETE_DATA_LEN 2 // complete length +#define NIKON_STOP_BIT 1 // has stop bit +#define NIKON_LSB 0 // LSB...MSB +#define NIKON_FLAGS 0 // flags + +#define KATHREIN_START_BIT_PULSE_TIME 210.0e-6 // 1340 usec pulse +#define KATHREIN_START_BIT_PAUSE_TIME 6218.0e-6 // 340 usec pause +#define KATHREIN_1_PULSE_TIME 210.0e-6 // 1340 usec pulse +#define KATHREIN_1_PAUSE_TIME 3000.0e-6 // 340 usec pause +#define KATHREIN_0_PULSE_TIME 210.0e-6 // 500 usec pulse +#define KATHREIN_0_PAUSE_TIME 1400.0e-6 // 1300 usec pause +#define KATHREIN_SYNC_BIT_PAUSE_LEN_TIME 4600.0e-6 // 4600 usec sync (on 6th and/or 8th bit) +#define KATHREIN_FRAMES 1 // Kathrein sends 1 frame +#define KATHREIN_AUTO_REPETITION_PAUSE_TIME 35.0e-3 // auto repetition after 35ms +#define KATHREIN_FRAME_REPEAT_PAUSE_TIME 35.0e-3 // frame repeat after 35ms +#define KATHREIN_ADDRESS_OFFSET 1 // skip 1 bits +#define KATHREIN_ADDRESS_LEN 4 // read 4 address bits +#define KATHREIN_COMMAND_OFFSET 5 // skip 5 bits +#define KATHREIN_COMMAND_LEN 7 // read 7 bits +#define KATHREIN_COMPLETE_DATA_LEN 13 // complete length +#define KATHREIN_STOP_BIT 1 // has stop bit +#define KATHREIN_LSB 0 // MSB +#define KATHREIN_FLAGS 0 // flags + +#define NETBOX_START_BIT_PULSE_TIME 2400.0e-6 // 2400 usec pulse +#define NETBOX_START_BIT_PAUSE_TIME 800.0e-6 // 800 usec pause +#define NETBOX_PULSE_TIME 800.0e-6 // 800 usec pulse +#define NETBOX_PAUSE_TIME 800.0e-6 // 800 usec pause +#define NETBOX_FRAMES 1 // Netbox sends 1 frame +#define NETBOX_AUTO_REPETITION_PAUSE_TIME 35.0e-3 // auto repetition after 35ms +#define NETBOX_FRAME_REPEAT_PAUSE_TIME 35.0e-3 // frame repeat after 35ms +#define NETBOX_ADDRESS_OFFSET 0 // skip 0 bits +#define NETBOX_ADDRESS_LEN 3 // read 3 address bits +#define NETBOX_COMMAND_OFFSET 3 // skip 3 bits +#define NETBOX_COMMAND_LEN 13 // read 13 bits +#define NETBOX_COMPLETE_DATA_LEN 16 // complete length +#define NETBOX_STOP_BIT 0 // has no stop bit +#define NETBOX_LSB 1 // LSB +#define NETBOX_FLAGS IRMP_PARAM_FLAG_IS_SERIAL // flags + +#define LEGO_START_BIT_PULSE_TIME 158.0e-6 // 158 usec pulse ( 6 x 1/38kHz) +#define LEGO_START_BIT_PAUSE_TIME 1026.0e-6 // 1026 usec pause (39 x 1/38kHz) +#define LEGO_PULSE_TIME 158.0e-6 // 158 usec pulse ( 6 x 1/38kHz) +#define LEGO_1_PAUSE_TIME 553.0e-6 // 553 usec pause (21 x 1/38kHz) +#define LEGO_0_PAUSE_TIME 263.0e-6 // 263 usec pause (10 x 1/38kHz) +#define LEGO_FRAME_REPEAT_PAUSE_TIME 40.0e-3 // frame repeat after 40ms +#define LEGO_ADDRESS_OFFSET 0 // skip 0 bits +#define LEGO_ADDRESS_LEN 0 // read 0 address bits +#define LEGO_COMMAND_OFFSET 0 // skip 0 bits +#define LEGO_COMMAND_LEN 16 // read 16 bits (12 command + 4 CRC) +#define LEGO_COMPLETE_DATA_LEN 16 // complete length +#define LEGO_STOP_BIT 1 // has stop bit +#define LEGO_LSB 0 // MSB...LSB +#define LEGO_FLAGS 0 // flags + +#define THOMSON_PULSE_TIME 550.0e-6 // 550 usec pulse +#define THOMSON_1_PAUSE_TIME 4500.0e-6 // 4500 usec pause +#define THOMSON_0_PAUSE_TIME 2000.0e-6 // 2000 usec pause +#define THOMSON_FRAMES 1 // THOMSON sends 1 frame +#define THOMSON_AUTO_REPETITION_PAUSE_TIME 65.0e-3 // repetition after 65ms +#define THOMSON_FRAME_REPEAT_PAUSE_TIME 65.0e-3 // frame repeat after 65ms +#define THOMSON_ADDRESS_OFFSET 0 // skip 0 bits +#define THOMSON_ADDRESS_LEN 4 // read 4 address bits +#define THOMSON_COMMAND_OFFSET 5 // skip 4 address bits + 1 toggle bit +#define THOMSON_COMMAND_LEN 7 // read 7 command bits +#define THOMSON_COMPLETE_DATA_LEN 12 // complete length +#define THOMSON_STOP_BIT 1 // has stop bit +#define THOMSON_LSB 0 // MSB...LSB +#define THOMSON_FLAGS 0 // flags + +#define AUTO_FRAME_REPETITION_TIME 80.0e-3 // SIRCS/SAMSUNG32/NUBERT: automatic repetition after 25-50ms + +#endif // _IRMP_PROTOCOLS_H_ diff --git a/irmpsystem.h b/irmpsystem.h new file mode 100644 index 0000000..395772b --- /dev/null +++ b/irmpsystem.h @@ -0,0 +1,102 @@ +/*--------------------------------------------------------------------------------------------------------------------------------------------------- + * irmpsystem.h - system specific includes and defines + * + * Copyright (c) 2009-2012 Frank Meyer - frank(at)fli4l.de + * + * $Id: irmpsystem.h,v 1.5 2012/05/23 12:26:26 fm Exp $ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + *--------------------------------------------------------------------------------------------------------------------------------------------------- + */ + +#ifndef _IRMPSYSTEM_H_ +#define _IRMPSYSTEM_H_ + +#if !defined(_IRMP_H_) && !defined(_IRSND_H_) +# error please include only irmp.h or irsnd.h, not irmpsystem.h +#endif + +#if defined(__18CXX) // Microchip PIC C18 compiler +# define PIC_C18 +#elif defined(__PCM__) || defined(__PCB__) || defined(__PCH__) // CCS PIC compiler +# define PIC_CCS +#elif defined(STM32L1XX_MD) || defined(STM32L1XX_MDP) || defined(STM32L1XX_HD) // ARM STM32 +# include +# define ARM_STM32 +# define ARM_STM32L1XX +#elif defined(STM32F10X_LD) || defined(STM32F10X_LD_VL) \ + || defined(STM32F10X_MD) || defined(STM32F10X_MD_VL) \ + || defined(STM32F10X_HD) || defined(STM32F10X_HD_VL) \ + || defined(STM32F10X_XL) || defined(STM32F10X_CL) // ARM STM32 +# include +# define ARM_STM32 +# define ARM_STM32F10X +#elif defined(STM32F4XX) // ARM STM32 +# include +# define ARM_STM32 +# define ARM_STM32F4XX +#elif defined(unix) || defined(WIN32) // Unix/Linux or Windows +# define UNIX_OR_WINDOWS +#else +# define ATMEL_AVR // ATMEL AVR +#endif + +#include + +#ifdef UNIX_OR_WINDOWS // Analyze on Unix/Linux or Windows +# include +# include +# include +# define F_CPU 8000000L +# define ANALYZE +# define DEBUG +#endif + +#if defined(ATMEL_AVR) +# include +# include +# include +# include +# include +# include +# define IRSND_OC2 0 // OC2 +# define IRSND_OC2A 1 // OC2A +# define IRSND_OC2B 2 // OC2B +# define IRSND_OC0 3 // OC0 +# define IRSND_OC0A 4 // OC0A +# define IRSND_OC0B 5 // OC0B +#else +# define PROGMEM +# define memcpy_P memcpy +#endif + +#if defined(PIC_CCS) || defined(PIC_C18) || defined(ARM_STM32) +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +#endif + +#if defined (PIC_C18) +# include // main PIC18 h file +# include // timer lib +# include // pwm lib +# define IRSND_PIC_CCP1 1 // PIC C18 RC2 = PWM1 module +# define IRSND_PIC_CCP2 2 // PIC C18 RC1 = PWM2 module +#endif + +#ifndef TRUE +# define TRUE 1 +# define FALSE 0 +#endif + +typedef struct +{ + uint8_t protocol; // protocol, i.e. NEC_PROTOCOL + uint16_t address; // address + uint16_t command; // command + uint8_t flags; // flags, e.g. repetition +} IRMP_DATA; + +#endif // _IRMPSYSTEM_H_ diff --git a/irsnd.aps b/irsnd.aps index 6b9e031..08da7f8 100644 --- a/irsnd.aps +++ b/irsnd.aps @@ -1 +1 @@ -irsnd07-Jan-2010 20:23:4909-Oct-2011 12:13:26241007-Jan-2010 20:23:4944, 18, 0, 670AVR GCCdefault\irsnd.elfC:\avr\irmp\AVR SimulatorATmega88.xmlfalseR00R01R02R03R04R05R06R07R08R09R10R11R12R13R14R15R16R17R18R19R20R21R22R23R24R25R26R27R28R29R30R31Auto000irsndmain.cirsnd.cirmp.hirsnd.hirsndconfig.hdefault\irsnd.lssdefault\irsnd.mapdefaultNOatmega1284p111irsnd.elfdefault\0-Wall -gdwarf-2 -std=gnu99 -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enumsdefault1C:\Program Files\WinAVR-20100110\bin\avr-gcc.exeC:\Program Files\WinAVR-20100110\utils\bin\make.exe00000irsndmain.c100001irmp.h100002irsnd.c100003irsnd.h100004irsndconfig.h1 +irsnd07-Jan-2010 20:23:4922-May-2012 17:10:20241007-Jan-2010 20:23:4944, 18, 0, 670AVR GCCdefault\irsnd.elfC:\avr\irmp\AVR SimulatorATmega88.xmlfalseR00R01R02R03R04R05R06R07R08R09R10R11R12R13R14R15R16R17R18R19R20R21R22R23R24R25R26R27R28R29R30R31Auto000irsndmain.cirsnd.cirsnd.hirsndconfig.hirmpprotocols.hirmpsystem.hdefault\irsnd.lssdefault\irsnd.mapdefaultNOatmega88111irsnd.elfdefault\1-Wall -gdwarf-2 -std=gnu99 -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enumsdefault1C:\Program Files\WinAVR-20100110\bin\avr-gcc.exeC:\Program Files\WinAVR-20100110\utils\bin\make.exeC:\avr\irmp\irsnd.hC:\avr\irmp\irsndconfig.hC:\avr\irmp\irmpprotocols.hC:\avr\irmp\irmpsystem.hC:\avr\irmp\irsndmain.cC:\avr\irmp\irsnd.c00000irsndmain.c100001irsnd.c100002irsnd.h100003irsndconfig.h100004irmpprotocols.h100005irmpsystem.h1 diff --git a/irsnd.c b/irsnd.c index 17e78f5..ee184e4 100644 --- a/irsnd.c +++ b/irsnd.c @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------------------------------------------------------------- * @file irsnd.c * - * Copyright (c) 2010-2011 Frank Meyer - frank(at)fli4l.de + * Copyright (c) 2010-2012 Frank Meyer - frank(at)fli4l.de * * Supported mikrocontrollers: * @@ -12,7 +12,7 @@ * ATmega164, ATmega324, ATmega644, ATmega644P, ATmega1284 * ATmega88, ATmega88P, ATmega168, ATmega168P, ATmega328P * - * $Id: irsnd.c,v 1.48 2012/02/24 14:24:28 fm Exp $ + * $Id: irsnd.c,v 1.54 2012/05/23 12:26:26 fm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,55 +21,6 @@ *--------------------------------------------------------------------------------------------------------------------------------------------------- */ -#if defined(__18CXX) -#define PIC_C18 // Microchip C18 -#include // basic P18 lib -#include "timers.h" // timer lib -#include "pwm.h" // pwm lib -#endif - -#ifdef unix // test/debug on linux/unix -#include -#include -#include -#include -#include - -#define DEBUG -#define F_CPU 8000000L - -#else // not unix: - -#ifdef WIN32 // test/debug on windows -#include -#include -#include - -#define F_CPU 8000000L -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -#define DEBUG - -#else - -#ifdef CODEVISION -#define COM2A0 6 -#define WGM21 1 -#define CS20 0 -#elif defined(PIC_C18) - //nothing to do here -#else -#include -#include -#include -#include -#endif // CODEVISION - -#endif // WIN32 -#endif // unix - -#include "irmp.h" -#include "irsndconfig.h" #include "irsnd.h" /*--------------------------------------------------------------------------------------------------------------------------------------------------- @@ -77,140 +28,132 @@ typedef unsigned short uint16_t; * ATmega pin definition of OC2 / OC2A / OC2B / OC0 / OC0A / OC0B *--------------------------------------------------------------------------------------------------------------------------------------------------- */ -#if defined (__AVR_ATtiny84__) // ATtiny84 uses OC0A = PB2 or OC0B = PA7 -#if IRSND_OCx == IRSND_OC0A // OC0A -#define IRSND_PORT PORTB // port B -#define IRSND_DDR DDRB // ddr B -#define IRSND_BIT 2 // OC0A -#elif IRSND_OCx == IRSND_OC0B // OC0B -#define IRSND_PORT PORTA // port A -#define IRSND_DDR DDRA // ddr A -#define IRSND_BIT 7 // OC0B -#else -#error Wrong value for IRSND_OCx, choose IRSND_OC0A or IRSND_OC0B in irsndconfig.h -#endif // IRSND_OCx - -#elif defined (__AVR_ATtiny45__) || defined (__AVR_ATtiny85__) // ATtiny45/85 uses OC0A = PB0 or OC0B = PB1 -#if IRSND_OCx == IRSND_OC0A // OC0A -#define IRSND_PORT PORTB // port B -#define IRSND_DDR DDRB // ddr B -#define IRSND_BIT 0 // OC0A -#elif IRSND_OCx == IRSND_OC0B // OC0B -#define IRSND_PORT PORTB // port B -#define IRSND_DDR DDRB // ddr B -#define IRSND_BIT 1 // OC0B -#else -#error Wrong value for IRSND_OCx, choose IRSND_OC0A or IRSND_OC0B in irsndconfig.h -#endif // IRSND_OCx - -#elif defined (__AVR_ATmega8__) // ATmega8 uses only OC2 = PB3 -#if IRSND_OCx == IRSND_OC2 // OC0A -#define IRSND_PORT PORTB // port B -#define IRSND_DDR DDRB // ddr B -#define IRSND_BIT 3 // OC0A -#else -#error Wrong value for IRSND_OCx, choose IRSND_OC2 in irsndconfig.h -#endif // IRSND_OCx - - -#elif defined (__AVR_ATmega16__) \ - || defined (__AVR_ATmega32__) // ATmega16|32 uses OC2 = PD7 -#if IRSND_OCx == IRSND_OC2 // OC2 -#define IRSND_PORT PORTD // port D -#define IRSND_DDR DDRD // ddr D -#define IRSND_BIT 7 // OC2 -#else -#error Wrong value for IRSND_OCx, choose IRSND_OC2 in irsndconfig.h -#endif // IRSND_OCx - -#elif defined (__AVR_ATmega162__) // ATmega162 uses OC2 = PB1 or OC0 = PB0 -#if IRSND_OCx == IRSND_OC2 // OC2 -#define IRSND_PORT PORTB // port B -#define IRSND_DDR DDRB // ddr B -#define IRSND_BIT 1 // OC2 - -#elif IRSND_OCx == IRSND_OC0 // OC0 -#define IRSND_PORT PORTB // port B -#define IRSND_DDR DDRB // ddr B -#define IRSND_BIT 0 // OC0 -#else -#error Wrong value for IRSND_OCx, choose IRSND_OC2 or IRSND_OC0 in irsndconfig.h -#endif // IRSND_OCx - +#if defined (__AVR_ATtiny84__) // ATtiny84 uses OC0A = PB2 or OC0B = PA7 +# if IRSND_OCx == IRSND_OC0A // OC0A +# define IRSND_PORT PORTB // port B +# define IRSND_DDR DDRB // ddr B +# define IRSND_BIT 2 // OC0A +# elif IRSND_OCx == IRSND_OC0B // OC0B +# define IRSND_PORT PORTA // port A +# define IRSND_DDR DDRA // ddr A +# define IRSND_BIT 7 // OC0B +# else +# error Wrong value for IRSND_OCx, choose IRSND_OC0A or IRSND_OC0B in irsndconfig.h +# endif // IRSND_OCx +#elif defined (__AVR_ATtiny45__) || defined (__AVR_ATtiny85__) // ATtiny45/85 uses OC0A = PB0 or OC0B = PB1 +# if IRSND_OCx == IRSND_OC0A // OC0A +# define IRSND_PORT PORTB // port B +# define IRSND_DDR DDRB // ddr B +# define IRSND_BIT 0 // OC0A +# elif IRSND_OCx == IRSND_OC0B // OC0B +# define IRSND_PORT PORTB // port B +# define IRSND_DDR DDRB // ddr B +# define IRSND_BIT 1 // OC0B +# else +# error Wrong value for IRSND_OCx, choose IRSND_OC0A or IRSND_OC0B in irsndconfig.h +# endif // IRSND_OCx +#elif defined (__AVR_ATmega8__) // ATmega8 uses only OC2 = PB3 +# if IRSND_OCx == IRSND_OC2 // OC0A +# define IRSND_PORT PORTB // port B +# define IRSND_DDR DDRB // ddr B +# define IRSND_BIT 3 // OC0A +# else +# error Wrong value for IRSND_OCx, choose IRSND_OC2 in irsndconfig.h +# endif // IRSND_OCx +#elif defined (__AVR_ATmega16__) || defined (__AVR_ATmega32__) // ATmega16|32 uses OC2 = PD7 +# if IRSND_OCx == IRSND_OC2 // OC2 +# define IRSND_PORT PORTD // port D +# define IRSND_DDR DDRD // ddr D +# define IRSND_BIT 7 // OC2 +# else +# error Wrong value for IRSND_OCx, choose IRSND_OC2 in irsndconfig.h +# endif // IRSND_OCx +#elif defined (__AVR_ATmega162__) // ATmega162 uses OC2 = PB1 or OC0 = PB0 +# if IRSND_OCx == IRSND_OC2 // OC2 +# define IRSND_PORT PORTB // port B +# define IRSND_DDR DDRB // ddr B +# define IRSND_BIT 1 // OC2 +# elif IRSND_OCx == IRSND_OC0 // OC0 +# define IRSND_PORT PORTB // port B +# define IRSND_DDR DDRB // ddr B +# define IRSND_BIT 0 // OC0 +# else +# error Wrong value for IRSND_OCx, choose IRSND_OC2 or IRSND_OC0 in irsndconfig.h +# endif // IRSND_OCx #elif defined (__AVR_ATmega164__) \ || defined (__AVR_ATmega324__) \ || defined (__AVR_ATmega644__) \ || defined (__AVR_ATmega644P__) \ || defined (__AVR_ATmega1284__) \ - || defined (__AVR_ATmega1284P__) // ATmega164|324|644|644P|1284 uses OC2A = PD7 or OC2B = PD6 or OC0A = PB3 or OC0B = PB4 -#if IRSND_OCx == IRSND_OC2A // OC2A -#define IRSND_PORT PORTD // port D -#define IRSND_DDR DDRD // ddr D -#define IRSND_BIT 7 // OC2A -#elif IRSND_OCx == IRSND_OC2B // OC2B -#define IRSND_PORT PORTD // port D -#define IRSND_DDR DDRD // ddr D -#define IRSND_BIT 6 // OC2B -#elif IRSND_OCx == IRSND_OC0A // OC0A -#define IRSND_PORT PORTB // port B -#define IRSND_DDR DDRB // ddr B -#define IRSND_BIT 3 // OC0A -#elif IRSND_OCx == IRSND_OC0B // OC0B -#define IRSND_PORT PORTB // port B -#define IRSND_DDR DDRB // ddr B -#define IRSND_BIT 4 // OC0B -#else -#error Wrong value for IRSND_OCx, choose IRSND_OC2A, IRSND_OC2B, IRSND_OC0A, or IRSND_OC0B in irsndconfig.h -#endif // IRSND_OCx - + || defined (__AVR_ATmega1284P__) // ATmega164|324|644|644P|1284 uses OC2A = PD7 or OC2B = PD6 or OC0A = PB3 or OC0B = PB4 +# if IRSND_OCx == IRSND_OC2A // OC2A +# define IRSND_PORT PORTD // port D +# define IRSND_DDR DDRD // ddr D +# define IRSND_BIT 7 // OC2A +# elif IRSND_OCx == IRSND_OC2B // OC2B +# define IRSND_PORT PORTD // port D +# define IRSND_DDR DDRD // ddr D +# define IRSND_BIT 6 // OC2B +# elif IRSND_OCx == IRSND_OC0A // OC0A +# define IRSND_PORT PORTB // port B +# define IRSND_DDR DDRB // ddr B +# define IRSND_BIT 3 // OC0A +# elif IRSND_OCx == IRSND_OC0B // OC0B +# define IRSND_PORT PORTB // port B +# define IRSND_DDR DDRB // ddr B +# define IRSND_BIT 4 // OC0B +# else +# error Wrong value for IRSND_OCx, choose IRSND_OC2A, IRSND_OC2B, IRSND_OC0A, or IRSND_OC0B in irsndconfig.h +# endif // IRSND_OCx #elif defined (__AVR_ATmega48__) \ || defined (__AVR_ATmega88__) \ || defined (__AVR_ATmega88P__) \ || defined (__AVR_ATmega168__) \ || defined (__AVR_ATmega168P__) \ - || defined (__AVR_ATmega328P__) // ATmega48|88|168|168|328 uses OC2A = PB3 or OC2B = PD3 or OC0A = PD6 or OC0B = PD5 -#if IRSND_OCx == IRSND_OC2A // OC2A -#define IRSND_PORT PORTB // port B -#define IRSND_DDR DDRB // ddr B -#define IRSND_BIT 3 // OC2A -#elif IRSND_OCx == IRSND_OC2B // OC2B -#define IRSND_PORT PORTD // port D -#define IRSND_DDR DDRD // ddr D -#define IRSND_BIT 3 // OC2B -#elif IRSND_OCx == IRSND_OC0A // OC0A -#define IRSND_PORT PORTB // port B -#define IRSND_DDR DDRB // ddr B -#define IRSND_BIT 6 // OC0A -#elif IRSND_OCx == IRSND_OC0B // OC0B -#define IRSND_PORT PORTD // port D -#define IRSND_DDR DDRD // ddr D -#define IRSND_BIT 5 // OC0B -#else -#error Wrong value for IRSND_OCx, choose IRSND_OC2A, IRSND_OC2B, IRSND_OC0A, or IRSND_OC0B in irsndconfig.h -#endif // IRSND_OCx + || defined (__AVR_ATmega328P__) // ATmega48|88|168|168|328 uses OC2A = PB3 or OC2B = PD3 or OC0A = PD6 or OC0B = PD5 +# if IRSND_OCx == IRSND_OC2A // OC2A +# define IRSND_PORT PORTB // port B +# define IRSND_DDR DDRB // ddr B +# define IRSND_BIT 3 // OC2A +# elif IRSND_OCx == IRSND_OC2B // OC2B +# define IRSND_PORT PORTD // port D +# define IRSND_DDR DDRD // ddr D +# define IRSND_BIT 3 // OC2B +# elif IRSND_OCx == IRSND_OC0A // OC0A +# define IRSND_PORT PORTB // port B +# define IRSND_DDR DDRB // ddr B +# define IRSND_BIT 6 // OC0A +# elif IRSND_OCx == IRSND_OC0B // OC0B +# define IRSND_PORT PORTD // port D +# define IRSND_DDR DDRD // ddr D +# define IRSND_BIT 5 // OC0B +# else +# error Wrong value for IRSND_OCx, choose IRSND_OC2A, IRSND_OC2B, IRSND_OC0A, or IRSND_OC0B in irsndconfig.h +# endif // IRSND_OCx #elif defined (__AVR_ATmega8515__) -#if IRSND_OCx == IRSND_OC0 -#define IRSND_PORT PORTB // port B -#define IRSND_DDR DDRB // ddr B -#define IRSND_BIT 0 // OC0 -#elif IRSND_OCx == IRSND_OC1A -#define IRSND_PORT PORTD // port D -#define IRSND_DDR DDRD // ddr D -#define IRSND_BIT 5 // OC1A -#elif IRSND_OCx == IRSND_OC1B -#define IRSND_PORT PORTE // port E -#define IRSND_DDR DDRE // ddr E -#define IRSND_BIT 2 // OC1E -#error Wrong value for IRSND_OCx, choose IRSND_OC0, IRSND_OC1A, or IRSND_OC1B in irsndconfig.h -#endif // IRSND_OCx - +# if IRSND_OCx == IRSND_OC0 +# define IRSND_PORT PORTB // port B +# define IRSND_DDR DDRB // ddr B +# define IRSND_BIT 0 // OC0 +# elif IRSND_OCx == IRSND_OC1A +# define IRSND_PORT PORTD // port D +# define IRSND_DDR DDRD // ddr D +# define IRSND_BIT 5 // OC1A +# elif IRSND_OCx == IRSND_OC1B +# define IRSND_PORT PORTE // port E +# define IRSND_DDR DDRE // ddr E +# define IRSND_BIT 2 // OC1E +# else +# error Wrong value for IRSND_OCx, choose IRSND_OC0, IRSND_OC1A, or IRSND_OC1B in irsndconfig.h +# endif // IRSND_OCx #elif defined (PIC_C18) //Microchip C18 compiler //Nothing here to do here -> See irsndconfig.h - +#elif defined (ARM_STM32) //STM32 + //Nothing here to do here -> See irsndconfig.h #else -#if !defined (unix) && !defined (WIN32) -#error mikrocontroller not defined, please fill in definitions here. -#endif // unix, WIN32 +# if !defined (unix) && !defined (WIN32) +# error mikrocontroller not defined, please fill in definitions here. +# endif // unix, WIN32 #endif // __AVR... #if IRSND_SUPPORT_NIKON_PROTOCOL == 1 @@ -335,22 +278,33 @@ typedef unsigned short uint16_t; #define SIEMENS_FRAME_REPEAT_PAUSE_LEN (uint16_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_FRAME_REPEAT_PAUSE_TIME + 0.5) // use uint16_t! -#ifdef PIC_C18 -#define IRSND_FREQ_30_KHZ (uint8_t) ((F_CPU / 30000 / 2 / Pre_Scaler / PIC_Scaler) - 1) -#define IRSND_FREQ_32_KHZ (uint8_t) ((F_CPU / 32000 / 2 / Pre_Scaler / PIC_Scaler) - 1) -#define IRSND_FREQ_36_KHZ (uint8_t) ((F_CPU / 36000 / 2 / Pre_Scaler / PIC_Scaler) - 1) -#define IRSND_FREQ_38_KHZ (uint8_t) ((F_CPU / 38000 / 2 / Pre_Scaler / PIC_Scaler) - 1) -#define IRSND_FREQ_40_KHZ (uint8_t) ((F_CPU / 40000 / 2 / Pre_Scaler / PIC_Scaler) - 1) -#define IRSND_FREQ_56_KHZ (uint8_t) ((F_CPU / 56000 / 2 / Pre_Scaler / PIC_Scaler) - 1) -#define IRSND_FREQ_455_KHZ (uint8_t) ((F_CPU / 455000 / 2 / Pre_Scaler / PIC_Scaler) - 1) -#else // AVR -#define IRSND_FREQ_30_KHZ (uint8_t) ((F_CPU / 30000 / 2) - 1) -#define IRSND_FREQ_32_KHZ (uint8_t) ((F_CPU / 32000 / 2) - 1) -#define IRSND_FREQ_36_KHZ (uint8_t) ((F_CPU / 36000 / 2) - 1) -#define IRSND_FREQ_38_KHZ (uint8_t) ((F_CPU / 38000 / 2) - 1) -#define IRSND_FREQ_40_KHZ (uint8_t) ((F_CPU / 40000 / 2) - 1) -#define IRSND_FREQ_56_KHZ (uint8_t) ((F_CPU / 56000 / 2) - 1) -#define IRSND_FREQ_455_KHZ (uint8_t) ((F_CPU / 455000 / 2) - 1) +#ifdef PIC_C18 // PIC C18 +# define IRSND_FREQ_TYPE uint8_t +# define IRSND_FREQ_30_KHZ (IRSND_FREQ_TYPE) ((F_CPU / 30000 / 2 / Pre_Scaler / PIC_Scaler) - 1) +# define IRSND_FREQ_32_KHZ (IRSND_FREQ_TYPE) ((F_CPU / 32000 / 2 / Pre_Scaler / PIC_Scaler) - 1) +# define IRSND_FREQ_36_KHZ (IRSND_FREQ_TYPE) ((F_CPU / 36000 / 2 / Pre_Scaler / PIC_Scaler) - 1) +# define IRSND_FREQ_38_KHZ (IRSND_FREQ_TYPE) ((F_CPU / 38000 / 2 / Pre_Scaler / PIC_Scaler) - 1) +# define IRSND_FREQ_40_KHZ (IRSND_FREQ_TYPE) ((F_CPU / 40000 / 2 / Pre_Scaler / PIC_Scaler) - 1) +# define IRSND_FREQ_56_KHZ (IRSND_FREQ_TYPE) ((F_CPU / 56000 / 2 / Pre_Scaler / PIC_Scaler) - 1) +# define IRSND_FREQ_455_KHZ (IRSND_FREQ_TYPE) ((F_CPU / 455000 / 2 / Pre_Scaler / PIC_Scaler) - 1) +#elif defined (ARM_STM32) // STM32 +# define IRSND_FREQ_TYPE uint32_t +# define IRSND_FREQ_30_KHZ (IRSND_FREQ_TYPE) (30000) +# define IRSND_FREQ_32_KHZ (IRSND_FREQ_TYPE) (32000) +# define IRSND_FREQ_36_KHZ (IRSND_FREQ_TYPE) (36000) +# define IRSND_FREQ_38_KHZ (IRSND_FREQ_TYPE) (38000) +# define IRSND_FREQ_40_KHZ (IRSND_FREQ_TYPE) (40000) +# define IRSND_FREQ_56_KHZ (IRSND_FREQ_TYPE) (56000) +# define IRSND_FREQ_455_KHZ (IRSND_FREQ_TYPE) (455000) +#else // AVR +# define IRSND_FREQ_TYPE uint8_t +# define IRSND_FREQ_30_KHZ (IRSND_FREQ_TYPE) ((F_CPU / 30000 / 2) - 1) +# define IRSND_FREQ_32_KHZ (IRSND_FREQ_TYPE) ((F_CPU / 32000 / 2) - 1) +# define IRSND_FREQ_36_KHZ (IRSND_FREQ_TYPE) ((F_CPU / 36000 / 2) - 1) +# define IRSND_FREQ_38_KHZ (IRSND_FREQ_TYPE) ((F_CPU / 38000 / 2) - 1) +# define IRSND_FREQ_40_KHZ (IRSND_FREQ_TYPE) ((F_CPU / 40000 / 2) - 1) +# define IRSND_FREQ_56_KHZ (IRSND_FREQ_TYPE) ((F_CPU / 56000 / 2) - 1) +# define IRSND_FREQ_455_KHZ (IRSND_FREQ_TYPE) ((F_CPU / 455000 / 2) - 1) #endif #define FDC_START_BIT_PULSE_LEN (uint8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME + 0.5) @@ -412,28 +366,27 @@ irsnd_on (void) if (! irsnd_is_on) { #ifndef DEBUG - -#if defined(PIC_C18) +# if defined(PIC_C18) // PIC C18 IRSND_PIN = 0; // output mode -> enable PWM outout pin (0=PWM on, 1=PWM off) -#else - -#if IRSND_OCx == IRSND_OC2 // use OC2 +# elif defined (ARM_STM32) // STM32 + TIM_Cmd(IRSND_TIMER, ENABLE); // TIMx enable counter +# else // AVR +# if IRSND_OCx == IRSND_OC2 // use OC2 TCCR2 |= (1< disbale PWM output pin (0=PWM on, 1=PWM off) -#else //AVR +# elif defined (ARM_STM32) // STM32 + TIM_Cmd(IRSND_TIMER, DISABLE); // TIMx enable counter +# else //AVR -#if IRSND_OCx == IRSND_OC2 // use OC2 +# if IRSND_OCx == IRSND_OC2 // use OC2 TCCR2 &= ~(1<= 2) && (IRSND_TIMER_NUMBER <= 5)) || ((IRSND_TIMER_NUMBER >= 12) && (IRSND_TIMER_NUMBER <= 14)) + TimeBaseFreq = RCC_ClocksStructure.PCLK1_Frequency; +# else + TimeBaseFreq = RCC_ClocksStructure.PCLK2_Frequency; +# endif + } + + freq = TimeBaseFreq/freq; + + /* Time base configuration */ + TIM_TimeBaseStructure.TIM_Period = freq; + TIM_TimeBaseStructure.TIM_Prescaler = 0; + TIM_TimeBaseStructure.TIM_ClockDivision = 0; + TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; + TIM_TimeBaseInit(IRSND_TIMER, &TIM_TimeBaseStructure); + + /* PWM1 Mode configuration: Channel1 */ + TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1; + TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable; + TIM_OCInitStructure.TIM_Pulse = (freq + 1) / 2; + TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High; + TIM_OC1Init(IRSND_TIMER, &TIM_OCInitStructure); + +# else // AVR + +# if IRSND_OCx == IRSND_OC2 + OCR2 = freq; // use register OCR2 for OC2 +# elif IRSND_OCx == IRSND_OC2A // use OC2A + OCR2A = freq; // use register OCR2A for OC2A and OC2B! +# elif IRSND_OCx == IRSND_OC2B // use OC2B + OCR2A = freq; // use register OCR2A for OC2A and OC2B! +# elif IRSND_OCx == IRSND_OC0 // use OC0 + OCR0 = freq; // use register OCR2 for OC2 +# elif IRSND_OCx == IRSND_OC0A // use OC0A + OCR0A = freq; // use register OCR0A for OC0A and OC0B! +# elif IRSND_OCx == IRSND_OC0B // use OC0B + OCR0A = freq; // use register OCR0A for OC0A and OC0B! +# else +# error wrong value of IRSND_OCx +# endif +# endif //PIC_C18 #endif // DEBUG } @@ -536,31 +523,71 @@ void irsnd_init (void) { #ifndef DEBUG -#if defined(PIC_C18) - OpenTimer; - irsnd_set_freq (IRSND_FREQ_36_KHZ); //default frequency - IRSND_PIN = 1; //default PWM output pin off (0=PWM on, 1=PWM off) -#else - IRSND_PORT &= ~(1<= 2) && (IRSND_TIMER_NUMBER <= 5)) || ((IRSND_TIMER_NUMBER >= 12) && (IRSND_TIMER_NUMBER <= 14)) + RCC_APB1PeriphClockCmd(IRSND_TIMER_RCC, ENABLE); +# else + RCC_APB2PeriphClockCmd(IRSND_TIMER_RCC, ENABLE); +# endif + irsnd_set_freq (IRSND_FREQ_36_KHZ); // default frequency + + /* TIMx Configuration */ + TIM_OC1PreloadConfig(IRSND_TIMER, TIM_OCPreload_Enable); + TIM_ARRPreloadConfig(IRSND_TIMER, ENABLE); + TIM_Cmd(IRSND_TIMER, ENABLE); +# else // AVR + IRSND_PORT &= ~(1<address & 0xFF00) >> 8; // additional bitlen if (sircs_additional_bitlen > 15 - SIRCS_MINIMUM_DATA_LEN) { - sircs_additional_command_len = 15 - SIRCS_MINIMUM_DATA_LEN; + // sircs_additional_command_len = 15 - SIRCS_MINIMUM_DATA_LEN; sircs_additional_address_len = sircs_additional_bitlen - (15 - SIRCS_MINIMUM_DATA_LEN); } else { - sircs_additional_command_len = sircs_additional_bitlen; + // sircs_additional_command_len = sircs_additional_bitlen; sircs_additional_address_len = 0; } @@ -864,8 +891,8 @@ irsnd_send_data (IRMP_DATA * irmp_data_p, uint8_t do_wait) { irsnd_buffer[0] = ((irmp_data_p->address & 0x1F) << 3) | ((irmp_data_p->command & 0x0380) >> 7); // AAAAACCC (1st frame) irsnd_buffer[1] = (irmp_data_p->command & 0x7F) << 1; // CCCCCCC - irsnd_buffer[2] = ((irmp_data_p->address & 0x1F) << 3) | (((~irmp_data_p->command) & 0x0380) >> 7); // AAAAACCC (2nd frame) - irsnd_buffer[3] = (~(irmp_data_p->command) & 0x7F) << 1; // CCCCCCC + irsnd_buffer[2] = ((irmp_data_p->address & 0x1F) << 3) | (((~irmp_data_p->command) & 0x0380) >> 7); // AAAAAccc (2nd frame) + irsnd_buffer[3] = (~(irmp_data_p->command) & 0x7F) << 1; // ccccccc irsnd_busy = TRUE; break; } @@ -918,8 +945,13 @@ irsnd_send_data (IRMP_DATA * irmp_data_p, uint8_t do_wait) case IRMP_IR60_PROTOCOL: { command = (bitsrevervse (0x7d, IR60_COMMAND_LEN) << 7) | bitsrevervse (irmp_data_p->command, IR60_COMMAND_LEN); +#if 0 irsnd_buffer[0] = command >> 6 | 0x01; // 1011111S (start instruction frame) irsnd_buffer[1] = (command & 0x7F) << 1; // CCCCCCC_ (2nd frame) +#else + irsnd_buffer[0] = ((command & 0x7F) << 1) | 0x01; // CCCCCCCS (1st frame) + irsnd_buffer[1] = command >> 6; // 1011111_ (start instruction frame) +#endif irsnd_busy = TRUE; break; @@ -1063,7 +1095,7 @@ irsnd_ISR (void) static uint8_t last_bit_value; #endif static uint8_t pulse_len = 0xFF; - static IRSND_PAUSE_LEN pause_len = 0xFF; + static IRSND_PAUSE_LEN pause_len = 0xFF; if (irsnd_busy) { @@ -1073,26 +1105,43 @@ irsnd_ISR (void) { auto_repetition_pause_counter++; +#if IRSND_SUPPORT_DENON_PROTOCOL == 1 + if (repeat_frame_pause_len > 0) // frame repeat distance counts from beginning of 1st frame! + { + repeat_frame_pause_len--; + } +#endif + if (auto_repetition_pause_counter >= auto_repetition_pause_len) { auto_repetition_pause_counter = 0; +#if IRSND_SUPPORT_DENON_PROTOCOL == 1 if (irsnd_protocol == IRMP_DENON_PROTOCOL) // n'th denon frame { current_bit = 16; complete_data_len = 2 * DENON_COMPLETE_DATA_LEN + 1; } - else if (irsnd_protocol == IRMP_GRUNDIG_PROTOCOL) // n'th grundig frame + else +#endif +#if IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1 + if (irsnd_protocol == IRMP_GRUNDIG_PROTOCOL) // n'th grundig frame { current_bit = 15; complete_data_len = 16 + GRUNDIG_COMPLETE_DATA_LEN; } - else if (irsnd_protocol == IRMP_IR60_PROTOCOL) // n'th IR60 frame + else +#endif +#if IRSND_SUPPORT_IR60_PROTOCOL == 1 + if (irsnd_protocol == IRMP_IR60_PROTOCOL) // n'th IR60 frame { current_bit = 7; complete_data_len = 2 * IR60_COMPLETE_DATA_LEN + 1; } - else if (irsnd_protocol == IRMP_NOKIA_PROTOCOL) // n'th nokia frame + else +#endif +#if IRSND_SUPPORT_NOKIA_PROTOCOL == 1 + if (irsnd_protocol == IRMP_NOKIA_PROTOCOL) // n'th nokia frame { if (auto_repetition_counter + 1 < n_auto_repetitions) { @@ -1105,6 +1154,11 @@ irsnd_ISR (void) complete_data_len = NOKIA_COMPLETE_DATA_LEN; } } + else +#endif + { + ; + } } else { @@ -1143,7 +1197,6 @@ irsnd_ISR (void) } else { - if (send_trailer) { irsnd_busy = FALSE; @@ -1515,9 +1568,9 @@ irsnd_ISR (void) pause_len = GRUNDIG_NOKIA_IR60_BIT_LEN; has_stop_bit = GRUNDIG_NOKIA_IR60_STOP_BIT; complete_data_len = NOKIA_COMPLETE_DATA_LEN; - n_auto_repetitions = NOKIA_FRAMES; // 2 frames - auto_repetition_pause_len = NOKIA_AUTO_REPETITION_PAUSE_LEN; // 20 msec pause - repeat_frame_pause_len = GRUNDIG_NOKIA_IR60_FRAME_REPEAT_PAUSE_LEN; // 117 msec pause + n_auto_repetitions = NOKIA_FRAMES; // 2 frames + auto_repetition_pause_len = NOKIA_AUTO_REPETITION_PAUSE_LEN; // 20 msec pause + repeat_frame_pause_len = GRUNDIG_NOKIA_IR60_FRAME_REPEAT_PAUSE_LEN; // 117 msec pause irsnd_set_freq (IRSND_FREQ_38_KHZ); break; } @@ -1711,6 +1764,21 @@ irsnd_ISR (void) IRSND_SUPPORT_NUBERT_PROTOCOL == 1 || IRSND_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1 || IRSND_SUPPORT_FDC_PROTOCOL == 1 || IRSND_SUPPORT_RCCAR_PROTOCOL == 1 || \ IRSND_SUPPORT_JVC_PROTOCOL == 1 || IRSND_SUPPORT_NIKON_PROTOCOL == 1 || IRSND_SUPPORT_LEGO_PROTOCOL == 1 || IRSND_SUPPORT_THOMSON_PROTOCOL == 1 { +#if IRSND_SUPPORT_DENON_PROTOCOL == 1 + if (irsnd_protocol == IRMP_DENON_PROTOCOL) + { + if (auto_repetition_pause_len > 0) // 2nd frame distance counts from beginning of 1st frame! + { + auto_repetition_pause_len--; + } + + if (repeat_frame_pause_len > 0) // frame repeat distance counts from beginning of 1st frame! + { + repeat_frame_pause_len--; + } + } +#endif + if (pulse_counter == 0) { if (current_bit == 0xFF) // send start bit diff --git a/irsnd.h b/irsnd.h index eb50d27..88f6d31 100644 --- a/irsnd.h +++ b/irsnd.h @@ -1,9 +1,9 @@ /*--------------------------------------------------------------------------------------------------------------------------------------------------- * irsnd.h * - * Copyright (c) 2010-2011 Frank Meyer - frank(at)fli4l.de + * Copyright (c) 2010-2012 Frank Meyer - frank(at)fli4l.de * - * $Id: irsnd.h,v 1.7 2012/02/16 12:39:36 fm Exp $ + * $Id: irsnd.h,v 1.12 2012/05/23 12:26:26 fm Exp $ * * ATMEGA88 @ 8 MHz * @@ -14,54 +14,106 @@ *--------------------------------------------------------------------------------------------------------------------------------------------------- */ -#ifndef _WC_IRSND_H_ -#define _WC_IRSND_H_ +#ifndef _IRSND_H_ +#define _IRSND_H_ -#if defined(__18CXX) // Microchip C18 declaration of missing typedef -typedef unsigned char uint8_t; -typedef unsigned int uint16_t; -#endif +#include "irmpsystem.h" +#ifndef IRSND_USE_AS_LIB +# include "irsndconfig.h" +#endif -#define IRSND_NO_REPETITIONS 0 // no repetitions -#define IRSND_MAX_REPETITIONS 14 // max # of repetitions -#define IRSND_ENDLESS_REPETITION 15 // endless repetions -#define IRSND_REPETITION_MASK 0x0F // lower nibble of flags +#if defined (ARM_STM32) // STM32 +# define _CONCAT(a,b) a##b +# define CONCAT(a,b) _CONCAT(a,b) +# define IRSND_PORT CONCAT(GPIO, IRSND_PORT_LETTER) +# if defined (ARM_STM32L1XX) +# define IRSND_PORT_RCC CONCAT(RCC_AHBPeriph_GPIO, IRSND_PORT_LETTER) +# define IRSND_GPIO_AF CONCAT(GPIO_AF_TIM, IRSND_TIMER_NUMBER) +# elif defined (ARM_STM32F10X) +# define IRSND_PORT_RCC CONCAT(RCC_APB2Periph_GPIO, IRSND_PORT_LETTER) +# elif defined (ARM_STM32F4XX) +# define IRSND_PORT_RCC CONCAT(RCC_AHB1Periph_GPIO, IRSND_PORT_LETTER) +# define IRSND_GPIO_AF CONCAT(GPIO_AF_TIM, IRSND_TIMER_NUMBER) +# endif +# define IRSND_BIT CONCAT(GPIO_Pin_, IRSND_BIT_NUMBER) +# define IRSND_TIMER CONCAT(TIM, IRSND_TIMER_NUMBER) +# if ((IRSND_TIMER_NUMBER >= 2) && (IRSND_TIMER_NUMBER <= 5)) || ((IRSND_TIMER_NUMBER >= 12) && (IRSND_TIMER_NUMBER <= 14)) +# define IRSND_TIMER_RCC CONCAT(RCC_APB1Periph_TIM, IRSND_TIMER_NUMBER) +# elif (IRSND_TIMER_NUMBER == 1) || ((IRSND_TIMER_NUMBER >= 8) && (IRSND_TIMER_NUMBER <= 11)) +# define IRSND_TIMER_RCC CONCAT(RCC_APB2Periph_TIM, IRSND_TIMER_NUMBER) +# else +# error IRSND_TIMER_NUMBER not valid. +# endif +# ifndef USE_STDPERIPH_DRIVER +# warning The STM32 port of IRSND uses the ST standard peripheral drivers which are not enabled in your build configuration. +# endif -/** - * Initialize ISND encoder - * @details Configures ISDN output pin - */ -extern void irsnd_init (void); +#elif defined(PIC_C18) +// Do not change lines below until you have a different HW. Example is for 18F2550/18F4550 +// setup macro for PWM used PWM module +# if IRSND_OCx == IRSND_PIC_CCP2 +# define IRSND_PIN TRISCbits.TRISC1 // RC1 = PWM2 +# define SetDCPWM(x) SetDCPWM2(x) +# define ClosePWM ClosePWM2 +# define OpenPWM(x) OpenPWM2(x) +# endif +# if IRSND_OCx == IRSND_PIC_CCP1 +# define IRSND_PIN TRISCbits.TRISC2 // RC2 = PWM1 +# define SetDCPWM(x) SetDCPWM1(x) +# define ClosePWM ClosePWM1 +# define OpenPWM(x) OpenPWM1(x) +# endif +//Setup macro for OpenTimer with defined Pre_Scaler +# if Pre_Scaler == 1 +# define OpenTimer OpenTimer2(TIMER_INT_OFF & T2_PS_1_1); +# elif Pre_Scaler == 4 +# define OpenTimer OpenTimer2(TIMER_INT_OFF & T2_PS_1_4); +# elif Pre_Scaler == 16 +# define OpenTimer OpenTimer2(TIMER_INT_OFF & T2_PS_1_16); +# else +# error Incorrect value for Pre_Scaler +# endif +#endif // ARM_STM32 -/** - * Check if sender is busy - * @details checks if sender is busy - * @return TRUE: sender is busy, FALSE: sender is not busy - */ -extern uint8_t irsnd_is_busy (void); +#if IRSND_SUPPORT_SIEMENS_PROTOCOL == 1 && F_INTERRUPTS < 15000 +# warning F_INTERRUPTS too low, SIEMENS protocol disabled (should be at least 15000) +# undef IRSND_SUPPORT_SIEMENS_PROTOCOL +# define IRSND_SUPPORT_SIEMENS_PROTOCOL 0 +#endif -/** - * Send IRMP data - * @details sends IRMP data - * @param pointer to IRMP data structure - * @return TRUE: successful, FALSE: failed - */ -extern uint8_t irsnd_send_data (IRMP_DATA *, uint8_t); +#if IRSND_SUPPORT_RECS80_PROTOCOL == 1 && F_INTERRUPTS < 20000 +# warning F_INTERRUPTS too low, RECS80 protocol disabled (should be at least 20000) +# undef IRSND_SUPPORT_RECS80_PROTOCOL +# define IRSND_SUPPORT_RECS80_PROTOCOL 0 +#endif -/** - * Stop sending IRMP data - * @details stops sending IRMP data - */ -extern void irsnd_stop (void); +#if IRSND_SUPPORT_RECS80EXT_PROTOCOL == 1 && F_INTERRUPTS < 20000 +# warning F_INTERRUPTS too low, RECS80EXT protocol disabled (should be at least 20000) +# undef IRSND_SUPPORT_RECS80EXT_PROTOCOL +# define IRSND_SUPPORT_RECS80EXT_PROTOCOL 0 +#endif -/** - * ISR routine - * @details ISR routine, called 10000 times per second - */ -extern uint8_t irsnd_ISR (void); +#if IRSND_SUPPORT_LEGO_PROTOCOL == 1 && F_INTERRUPTS < 20000 +# warning F_INTERRUPTS too low, LEGO protocol disabled (should be at least 20000) +# undef IRSND_SUPPORT_LEGO_PROTOCOL +# define IRSND_SUPPORT_LEGO_PROTOCOL 0 +#endif + +#include "irmpprotocols.h" + +#define IRSND_NO_REPETITIONS 0 // no repetitions +#define IRSND_MAX_REPETITIONS 14 // max # of repetitions +#define IRSND_ENDLESS_REPETITION 15 // endless repetions +#define IRSND_REPETITION_MASK 0x0F // lower nibble of flags + +extern void irsnd_init (void); +extern uint8_t irsnd_is_busy (void); +extern uint8_t irsnd_send_data (IRMP_DATA *, uint8_t); +extern void irsnd_stop (void); +extern uint8_t irsnd_ISR (void); #if IRSND_USE_CALLBACK == 1 -extern void irsnd_set_callback_ptr (void (*cb)(uint8_t)); +extern void irsnd_set_callback_ptr (void (*cb)(uint8_t)); #endif // IRSND_USE_CALLBACK == 1 -#endif /* _WC_IRSND_H_ */ +#endif /* _IRSND_H_ */ diff --git a/irsndconfig.h b/irsndconfig.h index 7af7e8e..388820b 100644 --- a/irsndconfig.h +++ b/irsndconfig.h @@ -1,9 +1,11 @@ /*--------------------------------------------------------------------------------------------------------------------------------------------------- * irsndconfig.h * + * DO NOT INCLUDE THIS FILE, WILL BE INCLUDED BY IRSND.H! + * * Copyright (c) 2010-2011 Frank Meyer - frank(at)fli4l.de * - * $Id: irsndconfig.h,v 1.31 2012/02/24 15:00:18 fm Exp $ + * $Id: irsndconfig.h,v 1.36 2012/05/23 12:26:26 fm Exp $ * * ATMEGA88 @ 8 MHz * @@ -14,12 +16,19 @@ *--------------------------------------------------------------------------------------------------------------------------------------------------- */ +#ifndef _IRSNDCONFIG_H_ +#define _IRSNDCONFIG_H_ + +#if !defined(_IRSND_H_) +# error please include only irsnd.h, not irsndconfig.h +#endif + /*--------------------------------------------------------------------------------------------------------------------------------------------------- * F_INTERRUPTS: number of interrupts per second, should be in the range from 10000 to 20000, typically 15000 *--------------------------------------------------------------------------------------------------------------------------------------------------- */ #ifndef F_INTERRUPTS -#define F_INTERRUPTS 15000 // interrupts per second +# define F_INTERRUPTS 15000 // interrupts per second #endif /*--------------------------------------------------------------------------------------------------------------------------------------------------- @@ -31,11 +40,11 @@ */ // typical protocols, disable here! Enable Remarks F_INTERRUPTS Program Space -#define IRSND_SUPPORT_SIRCS_PROTOCOL 1 // Sony SIRCS >= 10000 ~150 bytes +#define IRSND_SUPPORT_SIRCS_PROTOCOL 1 // Sony SIRCS >= 10000 ~200 bytes #define IRSND_SUPPORT_NEC_PROTOCOL 1 // NEC + APPLE >= 10000 ~100 bytes #define IRSND_SUPPORT_SAMSUNG_PROTOCOL 1 // Samsung + Samsung32 >= 10000 ~300 bytes #define IRSND_SUPPORT_MATSUSHITA_PROTOCOL 1 // Matsushita >= 10000 ~200 bytes -#define IRSND_SUPPORT_KASEIKYO_PROTOCOL 1 // Kaseikyo >= 10000 ~150 bytes +#define IRSND_SUPPORT_KASEIKYO_PROTOCOL 1 // Kaseikyo >= 10000 ~300 bytes #define IRSND_SUPPORT_DENON_PROTOCOL 1 // DENON, Sharp >= 10000 ~200 bytes // more protocols, enable here! Enable Remarks F_INTERRUPTS Program Space @@ -45,8 +54,8 @@ #define IRSND_SUPPORT_JVC_PROTOCOL 0 // JVC >= 10000 ~150 bytes #define IRSND_SUPPORT_NEC16_PROTOCOL 0 // NEC16 >= 10000 ~150 bytes #define IRSND_SUPPORT_NEC42_PROTOCOL 0 // NEC42 >= 10000 ~150 bytes -#define IRSND_SUPPORT_IR60_PROTOCOL 1 // IR60 (SDA2008) >= 10000 ~250 bytes -#define IRSND_SUPPORT_GRUNDIG_PROTOCOL 1 // Grundig >= 10000 ~300 bytes +#define IRSND_SUPPORT_IR60_PROTOCOL 0 // IR60 (SDA2008) >= 10000 ~250 bytes +#define IRSND_SUPPORT_GRUNDIG_PROTOCOL 0 // Grundig >= 10000 ~300 bytes #define IRSND_SUPPORT_SIEMENS_PROTOCOL 0 // Siemens, Gigaset >= 15000 ~150 bytes #define IRSND_SUPPORT_NOKIA_PROTOCOL 0 // Nokia >= 10000 ~400 bytes @@ -64,26 +73,8 @@ #define IRSND_SUPPORT_RUWIDO_PROTOCOL 0 // RUWIDO, T-Home >= 15000 DON'T CHANGE, NOT SUPPORTED YET! #define IRSND_SUPPORT_LEGO_PROTOCOL 0 // LEGO Power RC >= 20000 ~150 bytes - -/*--------------------------------------------------------------------------------------------------------------------------------------------------- - * DO NOT CHANGE: - *--------------------------------------------------------------------------------------------------------------------------------------------------- - */ -#define IRSND_OC2 0 // OC2 -#define IRSND_OC2A 1 // OC2A -#define IRSND_OC2B 2 // OC2B -#define IRSND_OC0 3 // OC0 -#define IRSND_OC0A 4 // OC0A -#define IRSND_OC0B 5 // OC0B - -//PIC Microchip C18 -#define IRSND_PIC_CCP1 1 // PIC C18 RC2 = PWM1 module -#define IRSND_PIC_CCP2 2 // PIC C18 RC1 = PWM2 module - -#ifndef PIC_C18 // AVR part - /*--------------------------------------------------------------------------------------------------------------------------------------------------- - * AVR + * AVR section: * * Change hardware pin here: IRSND_OC2 = OC2 on ATmegas supporting OC2, e.g. ATmega8 * IRSND_OC2A = OC2A on ATmegas supporting OC2A, e.g. ATmega88 @@ -91,96 +82,49 @@ * IRSND_OC0 = OC0 on ATmegas supporting OC0, e.g. ATmega162 * IRSND_OC0A = OC0A on ATmegas/ATtinys supporting OC0A, e.g. ATtiny84, ATtiny85 * IRSND_OC0B = OC0B on ATmegas/ATtinys supporting OC0B, e.g. ATtiny84, ATtiny85 - * IRSND_PIC_CCP1 = RC2 on PIC 18F2550/18F4550, ... - * IRSND_PIC_CCP2 = RC1 on PIC 18F2550/18F4550, ... *--------------------------------------------------------------------------------------------------------------------------------------------------- */ - -#define IRSND_OCx IRSND_OC2B // use OC2B +#if defined(ATMEL_AVR) +# define IRSND_OCx IRSND_OC2B // use OC2B /*--------------------------------------------------------------------------------------------------------------------------------------------------- - * PIC C18 + * PIC C18 section: * * Change hardware pin here: IRSND_PIC_CCP1 = RC2 on PIC 18F2550/18F4550, ... - * IRSND_PIC_CCP2 = RC1 on PIC 18F2550/18F4550, ... + * IRSND_PIC_CCP2 = RC1 on PIC 18F2550/18F4550, ... *--------------------------------------------------------------------------------------------------------------------------------------------------- */ - -#else -#define IRSND_OCx IRSND_PIC_CCP2 // Use PWMx for PIC +#elif defined(PIC_C18) +# define IRSND_OCx IRSND_PIC_CCP2 // Use PWMx for PIC + // change other PIC C18 specific settings: +# define F_CPU 48000000UL // PIC frequency: set your freq here +# define Pre_Scaler 4 // define prescaler for timer2 e.g. 1,4,16 +# define PIC_Scaler 2 // PIC needs /2 extra in IRSND_FREQ_32_KHZ calculation for right value +# warning Timer2 used for IRSND (PWM out) ! Do not use/setup Timer 2 yourself ! /*--------------------------------------------------------------------------------------------------------------------------------------------------- - * PIC C18 - change other PIC specific settings - ignore it when using AVR + * ARM STM32 section: *--------------------------------------------------------------------------------------------------------------------------------------------------- */ - -#define F_CPU 48000000UL // PIC freq.; Set you Freq here -#define Pre_Scaler 4 // define prescaler for Timer2 e.g. 1,4,16 !!! -#define PIC_Scaler 2 // PIC needs /2 extra in IRSND_FREQ_32_KHZ calculation for right value -#warning Timer2 used for IRSND (PWM out) ! Do not use/setup Timer 2 yourself ! - -//Do not change lines below until you have a diffrent HW !! Example for 18F2550/18F4550 -//Setup macro for PWM used PWM module - -#if IRSND_OCx == IRSND_PIC_CCP2 -#define IRSND_PIN TRISCbits.TRISC1 // RC1 = PWM2 - -#define SetDCPWM(x) SetDCPWM2(x) -#define ClosePWM ClosePWM2 -#define OpenPWM(x) OpenPWM2(x) -#endif - -#if IRSND_OCx == IRSND_PIC_CCP1 -#define IRSND_PIN TRISCbits.TRISC2 // RC2 = PWM1 - -#define SetDCPWM(x) SetDCPWM1(x) -#define ClosePWM ClosePWM1 -#define OpenPWM(x) OpenPWM1(x) -#endif - -//Setup macro for OpenTimer with defined Pre_Scaler -#if Pre_Scaler == 1 -#define OpenTimer OpenTimer2(TIMER_INT_OFF & T2_PS_1_1); -#elif Pre_Scaler == 4 -#define OpenTimer OpenTimer2(TIMER_INT_OFF & T2_PS_1_4); -#elif Pre_Scaler == 16 -#define OpenTimer OpenTimer2(TIMER_INT_OFF & T2_PS_1_16); -#else -#error Incorrect value for Pre_Scaler -#endif - -#endif //PIC_C18 +#elif defined (ARM_STM32) // use C13 as IR input on STM32 +# define IRSND_PORT_LETTER A +# define IRSND_BIT_NUMBER 6 +# define IRSND_TIMER_NUMBER 10 /*--------------------------------------------------------------------------------------------------------------------------------------------------- - * Use Callbacks to indicate output signal or something else + * Other target system *--------------------------------------------------------------------------------------------------------------------------------------------------- */ -#define IRSND_USE_CALLBACK 0 // flag: 0 = don't use callbacks, 1 = use callbacks, default is 0 +#elif !defined (UNIX_OR_WINDOWS) +# error target system not defined. +#endif /*--------------------------------------------------------------------------------------------------------------------------------------------------- - * D O N O T C H A N G E T H E F O L L O W I N G L I N E S ! + * Use Callbacks to indicate output signal or something else *--------------------------------------------------------------------------------------------------------------------------------------------------- */ -#if IRSND_SUPPORT_SIEMENS_PROTOCOL == 1 && F_INTERRUPTS < 15000 -#warning F_INTERRUPTS too low, SIEMENS protocol disabled (should be at least 15000) -#undef IRSND_SUPPORT_SIEMENS_PROTOCOL -#define IRSND_SUPPORT_SIEMENS_PROTOCOL 0 // DO NOT CHANGE! F_INTERRUPTS too low! -#endif - -#if IRSND_SUPPORT_RECS80_PROTOCOL == 1 && F_INTERRUPTS < 20000 -#warning F_INTERRUPTS too low, RECS80 protocol disabled (should be at least 20000) -#undef IRSND_SUPPORT_RECS80_PROTOCOL -#define IRSND_SUPPORT_RECS80_PROTOCOL 0 // DO NOT CHANGE! F_INTERRUPTS too low! -#endif - -#if IRSND_SUPPORT_RECS80EXT_PROTOCOL == 1 && F_INTERRUPTS < 20000 -#warning F_INTERRUPTS too low, RECS80EXT protocol disabled (should be at least 20000) -#undef IRSND_SUPPORT_RECS80EXT_PROTOCOL -#define IRSND_SUPPORT_RECS80EXT_PROTOCOL 0 // DO NOT CHANGE! F_INTERRUPTS too low! +#ifndef IRSND_USE_CALLBACK +# define IRSND_USE_CALLBACK 0 // flag: 0 = don't use callbacks, 1 = use callbacks, default is 0 #endif -#if IRSND_SUPPORT_LEGO_PROTOCOL == 1 && F_INTERRUPTS < 20000 -#warning F_INTERRUPTS too low, LEGO protocol disabled (should be at least 20000) -#undef IRSND_SUPPORT_LEGO_PROTOCOL -#define IRSND_SUPPORT_LEGO_PROTOCOL 0 // DO NOT CHANGE! F_INTERRUPTS too low! -#endif +#endif // _IRSNDCONFIG_H_ diff --git a/irsndmain.c b/irsndmain.c index 3aab539..13f6659 100644 --- a/irsndmain.c +++ b/irsndmain.c @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------------------------------------------------------------- - * irsndmain.c - demo main module to test irmp decoder + * irsndmain.c - demo main module to test irsnd encoder * - * Copyright (c) 2010-2011 Frank Meyer - frank(at)fli4l.de + * Copyright (c) 2010-2012 Frank Meyer - frank(at)fli4l.de * * ATMEGA88 @ 8 MHz * @@ -13,18 +13,10 @@ * (at your option) any later version. *--------------------------------------------------------------------------------------------------------------------------------------------------- */ - -#include -#include -#include -#include -#include -#include "irmp.h" -#include "irsndconfig.h" #include "irsnd.h" #ifndef F_CPU -#error F_CPU unkown +# error F_CPU unkown #endif void diff --git a/main.c b/main.c index 4e666da..dbcd57f 100644 --- a/main.c +++ b/main.c @@ -1,9 +1,9 @@ /*--------------------------------------------------------------------------------------------------------------------------------------------------- * main.c - demo main module to test irmp decoder * - * Copyright (c) 2009-2011 Frank Meyer - frank(at)fli4l.de + * Copyright (c) 2009-2012 Frank Meyer - frank(at)fli4l.de * - * $Id: main.c,v 1.12 2012/02/13 10:59:07 fm Exp $ + * $Id: main.c,v 1.14 2012/05/15 10:25:21 fm Exp $ * * ATMEGA88 @ 8 MHz * @@ -16,13 +16,6 @@ *--------------------------------------------------------------------------------------------------------------------------------------------------- */ -#include -#include -#include -#include -#include - -#include "irmpconfig.h" #include "irmp.h" #ifndef F_CPU diff --git a/makefile.lnx b/makefile.lnx index 79a3a0d..cbc3148 100644 --- a/makefile.lnx +++ b/makefile.lnx @@ -11,22 +11,22 @@ #---------------------------------------------------------------------------- all: irmp irmp-15kHz irmp-20kHz irsnd irsnd-15kHz irsnd-20kHz -irmp: irmp.c irmp.h irmpconfig.h +irmp: irmp.c irmp.h irmpconfig.h irmpsystem.h irmpprotocols.h cc -Wall -DF_INTERRUPTS=10000 irmp.c -o irmp -irmp-15kHz: irmp.c irmp.h irmpconfig.h +irmp-15kHz: irmp.c irmp.h irmpconfig.h irmpsystem.h irmpprotocols.h cc -Wall -DF_INTERRUPTS=15000 irmp.c -o irmp-15kHz -irmp-20kHz: irmp.c irmp.h irmpconfig.h +irmp-20kHz: irmp.c irmp.h irmpconfig.h irmpsystem.h irmpprotocols.h cc -Wall -DF_INTERRUPTS=20000 irmp.c -o irmp-20kHz -irsnd: irsnd.c irsnd.h irmp.h irsndconfig.h +irsnd: irsnd.c irsnd.h irmp.h irsndconfig.h irmpsystem.h irmpprotocols.h cc -Wall -DF_INTERRUPTS=10000 irsnd.c -o irsnd -irsnd-15kHz: irsnd.c irsnd.h irmp.h irsndconfig.h +irsnd-15kHz: irsnd.c irsnd.h irmp.h irsndconfig.h irmpsystem.h irmpprotocols.h cc -Wall -DF_INTERRUPTS=15000 irsnd.c -o irsnd-15kHz -irsnd-20kHz: irsnd.c irsnd.h irmp.h irsndconfig.h +irsnd-20kHz: irsnd.c irsnd.h irmp.h irsndconfig.h irmpsystem.h irmpprotocols.h cc -Wall -DF_INTERRUPTS=20000 irsnd.c -o irsnd-20kHz test: all -- 2.39.2