1

Тема: PT2348 4.1-Channel Audio Processor with Subwoofer

Данный контент доступен только зарегистрированным пользователям.


The PT2348 is a 4.1CH audio processor designed for
Car Audio purpose. Using I2
C interface controls all of
the functions. Like most of audio processor, it
equipped up to 4 stereo sources input with adjustable
gain, master volume with adaptive loudness, treble
and bass tone control.
In a car entertainment system needs front and rear
seat individual control, the PT2348 provides separate
input source selection and output volume adjust ; a
special design mixing amp is very easy combine the
navigation system or cellular phone’s voice into the car
audio system.

FEATURES
• Controlled by I²C Interface
• 4 Stereo Inputs (including 1 quasi-differential input)
with selectable input gain
• 2 Channels Electronic Volume: +15 to -79dB with
1dB/step
• 1 Subwoofer Output: +15 to -79dB with 1dB/step
• Adjustable crossover frequency for Subwoofer
• Tone Control (Bass and Treble): -15 to +15dB,
1dB/step
• Input Gain Control: 0 to +15dB, 1dB/step
• Loudness: 0 to -15dB, 1dB/step
• 4 independent speaker outputs: +15 to -79dB with
1dB/step & independent programmable mix
input with 50% mixing ratio for front speakers
• Low Distortion and Low Noise
• 36-pin SSOP package

PT2348.ino

#include <Wire.h> 
#include <PT2348.h>
PT2348 pt; 

void setup(){
   Wire.begin();
   audio();
}

void loop(){}

void audio(){
   pt.setMain_in(1, 0); 
                 /* Input Selector - in_sel
                    int 0 === QD/SE : QD
                    int 1 === SE IN1
                    int 2 === SE IN2
                    int 3 === SE IN3
                    int 4 === QD/SE : SE IN4
                    int 5 === Mute  
                    Input Gain - in_gain
                    int 0...15 === 0...+15 dB */
   pt.setLoun_sub(0, 0, 0);
                 /* Loudness - loun, loun_off
                    int 0...15 === 0...-15 dB
                    int 0...1 === on...off
                    Subwoofer Cut-off Frequency - sub_f
                    int 0...2 === 80 120 160 Hz */
   pt.setVol(0); // Volume int +15...-80 === +15...-80 dB
   pt.setBass_mix(0, 1, 1, 1);
                 /* BASS - bass
                    int -15...15 === -15...+15 dB
                    MIXING 
                    mixing enable int 0...1 === on...off
                    mixing to LF  int 0...1 === on...off
                    mixing to RF  int 0...1 === on...off */
   pt.setTreble(0);// TREBLE int -15...+15 === -15...+15 dB
   pt.setAtt_mix(0);//MIXING LEVEL int -15...+15 === -15...+15 dB
   pt.setAtt_LF(0);// SPEAKER ATTENUATOR LEFT FRONT int -15...+15 === -15...+15 dB
   pt.setAtt_RF(0);// SPEAKER ATTENUATOR RIGHT FRONT int -15...+15 === -15...+15 dB
   pt.setAtt_LR(0);// SPEAKER ATTENUATOR LEFT REAR  int -15...+15 === -15...+15 dB
   pt.setAtt_RR(0);// SPEAKER ATTENUATOR RIGHT REAR  int -15...+15 === -15...+15 dB
   pt.setAtt_SUB(0);// SPEAKER ATTENUATOR SUBWOOFER  int -15...+15 === -15...+15 dB
   pt.setSecond_in(5, 0, 0);
                /* Second Input Selector 
                    int 0 === QD/SE : QD
                    int 1 === SE IN1
                    int 2 === SE IN2
                    int 3 === SE IN3
                    int 4 === QD/SE : SE IN4
                    int 5 === Mute  
                    Input Gain - in_gain
                    int 0...15 === 0...+15 dB 
                    Rear Speaker Source 
                    int 0...1 === main source...second source */
  }

PT2348.h

/* Alexander Liman
   liman324@yandex.ru
   rcl-radio.ru */

#ifndef PT2348_H
#define PT2348_H

#define PT2348_address 0x44

#define MAIN_IN        0x00
#define LOUN_SUB       0x01
#define VOLUME         0x02
#define BASS_MIX       0x03
#define TREBLE         0x04
#define MIX_LEVEL      0x05
#define ATT_LF         0x06
#define ATT_RF         0x07
#define ATT_LR         0x08
#define ATT_RR         0x09
#define ATT_SUB        0x0A
#define SECOND_IN      0x0B

#include <Arduino.h>
class PT2348
{
  public:
    PT2348();
   void setMain_in(int in_sel, int in_gain); 
                 /* Input Selector - in_sel
                    int 0 === QD/SE : QD
                    int 1 === SE IN1
                    int 2 === SE IN2
                    int 3 === SE IN3
                    int 4 === QD/SE : SE IN4
                    int 5 === Mute  
                    Input Gain - in_gain
                    int 0...15 === 0...+15 dB */
   void setLoun_sub(int loud, int loun_off, int sub_f);
                 /* Loudness - loun, loun_off
                    int 0...15 === 0...-15 dB
                    int 0...1 === on...off
                    Subwoofer Cut-off Frequency - sub_f
                    int 0...2 === 80 120 160 Hz */
   void setVol(int vol); // Volume int +15...-80 === +15...-80 dB
   void setBass_mix(int bass, int mix_off, int mix_LF, int mix_RF);
                 /* BASS - bass
                    int -15...15 === -15...+15 dB
                    MIXING 
                    mixing enable int 0...1 === on...off
                    mixing to LF  int 0...1 === on...off
                    mixing to RF  int 0...1 === on...off */
   void setTreble(int treb);// TREBLE int -15...+15 === -15...+15 dB
   void setAtt_mix(int att_mix);//MIXING LEVEL int -15...+15 === -15...+15 dB
   void setAtt_LF(int att_LF);// SPEAKER ATTENUATOR LEFT FRONT int -15...+15 === -15...+15 dB
   void setAtt_RF(int att_RF);// SPEAKER ATTENUATOR RIGHT FRONT int -15...+15 === -15...+15 dB
   void setAtt_LR(int att_LR);// SPEAKER ATTENUATOR LEFT REAR  int -15...+15 === -15...+15 dB
   void setAtt_RR(int att_RR);// SPEAKER ATTENUATOR RIGHT REAR  int -15...+15 === -15...+15 dB
   void setAtt_SUB(int att_SUB);// SPEAKER ATTENUATOR SUBWOOFER  int -15...+15 === -15...+15 dB
   void setSecond_in(int in_sec_sel, int in_sec_gain, int main_second);
                /* Second Input Selector 
                    int 0 === QD/SE : QD
                    int 1 === SE IN1
                    int 2 === SE IN2
                    int 3 === SE IN3
                    int 4 === QD/SE : SE IN4
                    int 5 === Mute  
                    Input Gain - in_gain
                    int 0...15 === 0...+15 dB 
                    Rear Speaker Source 
                    int 0...1 === main source...second source */

  private:
    void writeWire(char a, char b);
};
    
#endif //PT2348_H

PT2348.cpp

#include <Arduino.h>
#include <Wire.h>
#include "PT2348.h"

PT2348::PT2348(){
    Wire.begin();
}

void PT2348::setMain_in(int in_sel, int in_gain){
           switch(in_sel){
               case 0: in_sel = 0b00000000;break;
               case 1: in_sel = 0b00000001;break;
               case 2: in_sel = 0b00000010;break;
               case 3: in_sel = 0b00000011;break;
               case 4: in_sel = 0b00000100;break;
               case 5: in_sel = 0b00000101;break;
   }
           switch(in_gain){
               case 0: in_gain =  0b00000000;break;
               case 1: in_gain =  0b00001000;break;
               case 2: in_gain =  0b00010000;break;
               case 3: in_gain =  0b00011000;break;
               case 4: in_gain =  0b00100000;break;
               case 5: in_gain =  0b00101000;break;
               case 6: in_gain =  0b00110000;break;
               case 7: in_gain =  0b00111000;break;
               case 8: in_gain =  0b01000000;break;
               case 9: in_gain =  0b01001000;break;
               case 10: in_gain = 0b01010000;break;
               case 11: in_gain = 0b01011000;break;
               case 12: in_gain = 0b01100000;break;
               case 13: in_gain = 0b01101000;break;
               case 14: in_gain = 0b01110000;break;
               case 15: in_gain = 0b01111000;break;
   }
        
           writeWire(MAIN_IN, in_sel+in_gain); 
   }

void PT2348::setLoun_sub(int loud, int loun_off, int sub_f){
           switch(loud){
               case 0: loud =  0b00000000;break;
               case 1: loud =  0b00000001;break;
               case 2: loud =  0b00000010;break;
               case 3: loud =  0b00000011;break;
               case 4: loud =  0b00000100;break;
               case 5: loud =  0b00000101;break;
               case 6: loud =  0b00000110;break;
               case 7: loud =  0b00000111;break;
               case 8: loud =  0b00001000;break;
               case 9: loud =  0b00001001;break;
               case 10: loud = 0b00001010;break;
               case 11: loud = 0b00001011;break;
               case 12: loud = 0b00001100;break;
               case 13: loud = 0b00001101;break;
               case 14: loud = 0b00001110;break;
               case 15: loud = 0b00001111;break;
   }
            switch(loun_off){
               case 0: loun_off = 0b00000000;break;
               case 1: loun_off = 0b00010000;break;
   } 
            switch(sub_f){
               case 0: sub_f = 0b00100000;break;
               case 1: sub_f = 0b01000000;break;
               case 2: sub_f = 0b01100000;break;
   } 
           writeWire(LOUN_SUB, loud+loun_off+sub_f); 
   }

void PT2348::setVol(int vol){
             switch(vol){
               case 0: vol =  0b00000000;break;
               case 1: vol =  0b00000001;break;
               case 2: vol =  0b00000010;break;
               case 3: vol =  0b00000011;break;
               case 4: vol =  0b00000100;break;
               case 5: vol =  0b00000101;break;
               case 6: vol =  0b00000110;break;
               case 7: vol =  0b00000111;break;
               case 8: vol =  0b00001000;break;
               case 9: vol =  0b00001001;break;
               case 10: vol = 0b00001010;break;
               case 11: vol = 0b00001011;break;
               case 12: vol = 0b00001100;break;
               case 13: vol = 0b00001101;break;
               case 14: vol = 0b00001110;break;
               case 15: vol = 0b00001111;break;

               case -1: vol =  0b00010001;break;
               case -2: vol =  0b00010010;break;
               case -3: vol =  0b00010011;break;
               case -4: vol =  0b00010100;break;
               case -5: vol =  0b00010101;break;
               case -6: vol =  0b00010110;break;
               case -7: vol =  0b00010111;break;
               case -8: vol =  0b00100000;break;
               case -9: vol =  0b00100001;break;
               case -10: vol = 0b00100010;break;
               case -11: vol = 0b00100011;break;
               case -12: vol = 0b00100100;break;
               case -13: vol = 0b00100101;break;
               case -14: vol = 0b00100110;break;
               case -15: vol = 0b00100111;break;

               case -16: vol =  0b00110000;break;
               case -17: vol =  0b00110001;break;
               case -18: vol =  0b00110010;break;
               case -19: vol =  0b00110011;break;
               case -20: vol =  0b00110100;break;
               case -21: vol =  0b00110101;break;
               case -22: vol =  0b00110110;break;
               case -23: vol =  0b00110111;break;
               case -24: vol =  0b01000000;break;
               case -25: vol =  0b01000001;break;
               case -26: vol =  0b01000010;break;
               case -27: vol =  0b01000011;break;
               case -28: vol =  0b01000100;break;
               case -29: vol =  0b01000101;break;
               case -30: vol =  0b01000110;break;
               case -31: vol =  0b01000111;break;

               case -32: vol =  0b01010000;break;
               case -33: vol =  0b01010001;break;
               case -34: vol =  0b01010010;break;
               case -35: vol =  0b01010011;break;
               case -36: vol =  0b01010100;break;
               case -37: vol =  0b01010101;break;
               case -38: vol =  0b01010110;break;
               case -39: vol =  0b01010111;break;
               case -40: vol =  0b01100000;break;
               case -41: vol =  0b01100001;break;
               case -42: vol =  0b01100010;break;
               case -43: vol =  0b01100011;break;
               case -44: vol =  0b01100100;break;
               case -45: vol =  0b01100101;break;
               case -46: vol =  0b01100110;break;
               case -47: vol =  0b01100111;break;

               case -48: vol =  0b01110000;break;
               case -49: vol =  0b01110001;break;
               case -50: vol =  0b01110010;break;
               case -51: vol =  0b01110011;break;
               case -52: vol =  0b01110100;break;
               case -53: vol =  0b01110101;break;
               case -54: vol =  0b01110110;break;
               case -55: vol =  0b01110111;break;
               case -56: vol =  0b10000000;break;
               case -57: vol =  0b10000001;break;
               case -58: vol =  0b10000010;break;
               case -59: vol =  0b10000011;break;
               case -60: vol =  0b10000100;break;
               case -61: vol =  0b10000101;break;
               case -62: vol =  0b10000110;break;
               case -63: vol =  0b10000111;break;

               case -64: vol =  0b10010000;break;
               case -65: vol =  0b10010001;break;
               case -66: vol =  0b10010010;break;
               case -67: vol =  0b10010011;break;
               case -68: vol =  0b10010100;break;
               case -69: vol =  0b10010101;break;
               case -70: vol =  0b10010110;break;
               case -71: vol =  0b10010111;break;
               case -72: vol =  0b10100000;break;
               case -73: vol =  0b10100001;break;
               case -74: vol =  0b10100010;break;
               case -75: vol =  0b10100011;break;
               case -76: vol =  0b10100100;break;
               case -77: vol =  0b10100101;break;
               case -78: vol =  0b10100110;break;
               case -79: vol =  0b10100111;break;
  } 
              if(vol<=-80){vol = 0b11110000;}
           writeWire(VOLUME, vol); 
  }


void PT2348::setBass_mix(int bass, int mix_off, int mix_LF, int mix_RF){
             switch(bass){
               case -1: bass =  0b00000001;break;
               case -2: bass =  0b00000010;break;
               case -3: bass =  0b00000011;break;
               case -4: bass =  0b00000100;break;
               case -5: bass =  0b00000101;break;
               case -6: bass =  0b00000110;break;
               case -7: bass =  0b00000111;break;
               case -8: bass =  0b00001000;break;
               case -9: bass =  0b00001001;break;
               case -10: bass = 0b00001010;break;
               case -11: bass = 0b00001011;break;
               case -12: bass = 0b00001100;break;
               case -13: bass = 0b00001101;break;
               case -14: bass = 0b00001110;break;
               case -15: bass = 0b00001111;break;

               case 0: bass =  0b00010000;break;
               case 1: bass =  0b00010001;break;
               case 2: bass =  0b00010010;break;
               case 3: bass =  0b00010011;break;
               case 4: bass =  0b00010100;break;
               case 5: bass =  0b00010101;break;
               case 6: bass =  0b00010110;break;
               case 7: bass =  0b00010111;break;
               case 8: bass =  0b00011000;break;
               case 9: bass =  0b00011001;break;
               case 10: bass = 0b00011010;break;
               case 11: bass = 0b00011011;break;
               case 12: bass = 0b00011100;break;
               case 13: bass = 0b00011101;break;
               case 14: bass = 0b00011110;break;
               case 15: bass = 0b00011111;break;
  }
            switch(mix_off){
               case 0: mix_off = 0b00000000;break;
               case 1: mix_off = 0b00100000;break;
  } 
            switch(mix_LF){
               case 0: mix_LF = 0b00000000;break;
               case 1: mix_LF = 0b01000000;break;
  } 
            switch(mix_RF){
               case 0: mix_RF = 0b00000000;break;
               case 1: mix_RF = 0b10000000;break;
  } 
           writeWire(BASS_MIX, bass+mix_off+mix_LF+mix_RF); 
  }

void PT2348::setTreble(int treb){
             switch(treb){
               case -1: treb =  0b00000001;break;
               case -2: treb =  0b00000010;break;
               case -3: treb =  0b00000011;break;
               case -4: treb =  0b00000100;break;
               case -5: treb =  0b00000101;break;
               case -6: treb =  0b00000110;break;
               case -7: treb =  0b00000111;break;
               case -8: treb =  0b00001000;break;
               case -9: treb =  0b00001001;break;
               case -10: treb = 0b00001010;break;
               case -11: treb = 0b00001011;break;
               case -12: treb = 0b00001100;break;
               case -13: treb = 0b00001101;break;
               case -14: treb = 0b00001110;break;
               case -15: treb = 0b00001111;break;

               case 0: treb =  0b00010000;break;
               case 1: treb =  0b00010001;break;
               case 2: treb =  0b00010010;break;
               case 3: treb =  0b00010011;break;
               case 4: treb =  0b00010100;break;
               case 5: treb =  0b00010101;break;
               case 6: treb =  0b00010110;break;
               case 7: treb =  0b00010111;break;
               case 8: treb =  0b00011000;break;
               case 9: treb =  0b00011001;break;
               case 10: treb = 0b00011010;break;
               case 11: treb = 0b00011011;break;
               case 12: treb = 0b00011100;break;
               case 13: treb = 0b00011101;break;
               case 14: treb = 0b00011110;break;
               case 15: treb = 0b00011111;break;
  }    
           writeWire(TREBLE, treb);    
  }

void PT2348::setAtt_mix(int att_mix){
             switch(att_mix){
               case 0: att_mix =  0b00000000;break;
               case 1: att_mix =  0b00000001;break;
               case 2: att_mix =  0b00000010;break;
               case 3: att_mix =  0b00000011;break;
               case 4: att_mix =  0b00000100;break;
               case 5: att_mix =  0b00000101;break;
               case 6: att_mix =  0b00000110;break;
               case 7: att_mix =  0b00000111;break;
               case 8: att_mix =  0b00001000;break;
               case 9: att_mix =  0b00001001;break;
               case 10: att_mix = 0b00001010;break;
               case 11: att_mix = 0b00001011;break;
               case 12: att_mix = 0b00001100;break;
               case 13: att_mix = 0b00001101;break;
               case 14: att_mix = 0b00001110;break;
               case 15: att_mix = 0b00001111;break;

               case -1: att_mix =  0b00010001;break;
               case -2: att_mix =  0b00010010;break;
               case -3: att_mix =  0b00010011;break;
               case -4: att_mix =  0b00010100;break;
               case -5: att_mix =  0b00010101;break;
               case -6: att_mix =  0b00010110;break;
               case -7: att_mix =  0b00010111;break;
               case -8: att_mix =  0b00100000;break;
               case -9: att_mix =  0b00100001;break;
               case -10: att_mix = 0b00100010;break;
               case -11: att_mix = 0b00100011;break;
               case -12: att_mix = 0b00100100;break;
               case -13: att_mix = 0b00100101;break;
               case -14: att_mix = 0b00100110;break;
               case -15: att_mix = 0b00100111;break;
  }    
           writeWire(MIX_LEVEL, att_mix);    
  }

void PT2348::setAtt_LF(int att_LF){
             switch(att_LF){
               case 0: att_LF =  0b00000000;break;
               case 1: att_LF =  0b00000001;break;
               case 2: att_LF =  0b00000010;break;
               case 3: att_LF =  0b00000011;break;
               case 4: att_LF =  0b00000100;break;
               case 5: att_LF =  0b00000101;break;
               case 6: att_LF =  0b00000110;break;
               case 7: att_LF =  0b00000111;break;
               case 8: att_LF =  0b00001000;break;
               case 9: att_LF =  0b00001001;break;
               case 10: att_LF = 0b00001010;break;
               case 11: att_LF = 0b00001011;break;
               case 12: att_LF = 0b00001100;break;
               case 13: att_LF = 0b00001101;break;
               case 14: att_LF = 0b00001110;break;
               case 15: att_LF = 0b00001111;break;

               case -1: att_LF =  0b00010001;break;
               case -2: att_LF =  0b00010010;break;
               case -3: att_LF =  0b00010011;break;
               case -4: att_LF =  0b00010100;break;
               case -5: att_LF =  0b00010101;break;
               case -6: att_LF =  0b00010110;break;
               case -7: att_LF =  0b00010111;break;
               case -8: att_LF =  0b00100000;break;
               case -9: att_LF =  0b00100001;break;
               case -10: att_LF = 0b00100010;break;
               case -11: att_LF = 0b00100011;break;
               case -12: att_LF = 0b00100100;break;
               case -13: att_LF = 0b00100101;break;
               case -14: att_LF = 0b00100110;break;
               case -15: att_LF = 0b00100111;break;
  }    
           writeWire(ATT_LF, att_LF);    
  }

void PT2348::setAtt_RF(int att_RF){
             switch(att_RF){
               case 0: att_RF =  0b00000000;break;
               case 1: att_RF =  0b00000001;break;
               case 2: att_RF =  0b00000010;break;
               case 3: att_RF =  0b00000011;break;
               case 4: att_RF =  0b00000100;break;
               case 5: att_RF =  0b00000101;break;
               case 6: att_RF =  0b00000110;break;
               case 7: att_RF =  0b00000111;break;
               case 8: att_RF =  0b00001000;break;
               case 9: att_RF =  0b00001001;break;
               case 10: att_RF = 0b00001010;break;
               case 11: att_RF = 0b00001011;break;
               case 12: att_RF = 0b00001100;break;
               case 13: att_RF = 0b00001101;break;
               case 14: att_RF = 0b00001110;break;
               case 15: att_RF = 0b00001111;break;

               case -1: att_RF =  0b00010001;break;
               case -2: att_RF =  0b00010010;break;
               case -3: att_RF =  0b00010011;break;
               case -4: att_RF =  0b00010100;break;
               case -5: att_RF =  0b00010101;break;
               case -6: att_RF =  0b00010110;break;
               case -7: att_RF =  0b00010111;break;
               case -8: att_RF =  0b00100000;break;
               case -9: att_RF =  0b00100001;break;
               case -10: att_RF = 0b00100010;break;
               case -11: att_RF = 0b00100011;break;
               case -12: att_RF = 0b00100100;break;
               case -13: att_RF = 0b00100101;break;
               case -14: att_RF = 0b00100110;break;
               case -15: att_RF = 0b00100111;break;
  }    
           writeWire(ATT_RF, att_RF);    
  }

void PT2348::setAtt_LR(int att_LR){
             switch(att_LR){
               case 0: att_LR =  0b00000000;break;
               case 1: att_LR =  0b00000001;break;
               case 2: att_LR =  0b00000010;break;
               case 3: att_LR =  0b00000011;break;
               case 4: att_LR =  0b00000100;break;
               case 5: att_LR =  0b00000101;break;
               case 6: att_LR =  0b00000110;break;
               case 7: att_LR =  0b00000111;break;
               case 8: att_LR =  0b00001000;break;
               case 9: att_LR =  0b00001001;break;
               case 10: att_LR = 0b00001010;break;
               case 11: att_LR = 0b00001011;break;
               case 12: att_LR = 0b00001100;break;
               case 13: att_LR = 0b00001101;break;
               case 14: att_LR = 0b00001110;break;
               case 15: att_LR = 0b00001111;break;

               case -1: att_LR =  0b00010001;break;
               case -2: att_LR =  0b00010010;break;
               case -3: att_LR =  0b00010011;break;
               case -4: att_LR =  0b00010100;break;
               case -5: att_LR =  0b00010101;break;
               case -6: att_LR =  0b00010110;break;
               case -7: att_LR =  0b00010111;break;
               case -8: att_LR =  0b00100000;break;
               case -9: att_LR =  0b00100001;break;
               case -10: att_LR = 0b00100010;break;
               case -11: att_LR = 0b00100011;break;
               case -12: att_LR = 0b00100100;break;
               case -13: att_LR = 0b00100101;break;
               case -14: att_LR = 0b00100110;break;
               case -15: att_LR = 0b00100111;break;
  }    
           writeWire(ATT_LR, att_LR);    
  }

void PT2348::setAtt_RR(int att_RR){
             switch(att_RR){
               case 0: att_RR =  0b00000000;break;
               case 1: att_RR =  0b00000001;break;
               case 2: att_RR =  0b00000010;break;
               case 3: att_RR =  0b00000011;break;
               case 4: att_RR =  0b00000100;break;
               case 5: att_RR =  0b00000101;break;
               case 6: att_RR =  0b00000110;break;
               case 7: att_RR =  0b00000111;break;
               case 8: att_RR =  0b00001000;break;
               case 9: att_RR =  0b00001001;break;
               case 10: att_RR = 0b00001010;break;
               case 11: att_RR = 0b00001011;break;
               case 12: att_RR = 0b00001100;break;
               case 13: att_RR = 0b00001101;break;
               case 14: att_RR = 0b00001110;break;
               case 15: att_RR = 0b00001111;break;

               case -1: att_RR =  0b00010001;break;
               case -2: att_RR =  0b00010010;break;
               case -3: att_RR =  0b00010011;break;
               case -4: att_RR =  0b00010100;break;
               case -5: att_RR =  0b00010101;break;
               case -6: att_RR =  0b00010110;break;
               case -7: att_RR =  0b00010111;break;
               case -8: att_RR =  0b00100000;break;
               case -9: att_RR =  0b00100001;break;
               case -10: att_RR = 0b00100010;break;
               case -11: att_RR = 0b00100011;break;
               case -12: att_RR = 0b00100100;break;
               case -13: att_RR = 0b00100101;break;
               case -14: att_RR = 0b00100110;break;
               case -15: att_RR = 0b00100111;break;
  }    
           writeWire(ATT_RR, att_RR);    
  }

void PT2348::setAtt_SUB(int att_SUB){
             switch(att_SUB){
               case 0: att_SUB =  0b00000000;break;
               case 1: att_SUB =  0b00000001;break;
               case 2: att_SUB =  0b00000010;break;
               case 3: att_SUB =  0b00000011;break;
               case 4: att_SUB =  0b00000100;break;
               case 5: att_SUB =  0b00000101;break;
               case 6: att_SUB =  0b00000110;break;
               case 7: att_SUB =  0b00000111;break;
               case 8: att_SUB =  0b00001000;break;
               case 9: att_SUB =  0b00001001;break;
               case 10: att_SUB = 0b00001010;break;
               case 11: att_SUB = 0b00001011;break;
               case 12: att_SUB = 0b00001100;break;
               case 13: att_SUB = 0b00001101;break;
               case 14: att_SUB = 0b00001110;break;
               case 15: att_SUB = 0b00001111;break;

               case -1: att_SUB =  0b00010001;break;
               case -2: att_SUB =  0b00010010;break;
               case -3: att_SUB =  0b00010011;break;
               case -4: att_SUB =  0b00010100;break;
               case -5: att_SUB =  0b00010101;break;
               case -6: att_SUB =  0b00010110;break;
               case -7: att_SUB =  0b00010111;break;
               case -8: att_SUB =  0b00100000;break;
               case -9: att_SUB =  0b00100001;break;
               case -10: att_SUB = 0b00100010;break;
               case -11: att_SUB = 0b00100011;break;
               case -12: att_SUB = 0b00100100;break;
               case -13: att_SUB = 0b00100101;break;
               case -14: att_SUB = 0b00100110;break;
               case -15: att_SUB = 0b00100111;break;
  }    
           writeWire(ATT_SUB, att_SUB);    
  }

void PT2348::setSecond_in(int in_sec_sel, int in_sec_gain, int main_second){
           switch(in_sec_sel){
               case 0: in_sec_sel = 0b00000000;break;
               case 1: in_sec_sel = 0b00000001;break;
               case 2: in_sec_sel = 0b00000010;break;
               case 3: in_sec_sel = 0b00000011;break;
               case 4: in_sec_sel = 0b00000100;break;
               case 5: in_sec_sel = 0b00000101;break;
   }
           switch(in_sec_gain){
               case 0: in_sec_gain =  0b00000000;break;
               case 1: in_sec_gain =  0b00001000;break;
               case 2: in_sec_gain =  0b00010000;break;
               case 3: in_sec_gain =  0b00011000;break;
               case 4: in_sec_gain =  0b00100000;break;
               case 5: in_sec_gain =  0b00101000;break;
               case 6: in_sec_gain =  0b00110000;break;
               case 7: in_sec_gain =  0b00111000;break;
               case 8: in_sec_gain =  0b01000000;break;
               case 9: in_sec_gain =  0b01001000;break;
               case 10: in_sec_gain = 0b01010000;break;
               case 11: in_sec_gain = 0b01011000;break;
               case 12: in_sec_gain = 0b01100000;break;
               case 13: in_sec_gain = 0b01101000;break;
               case 14: in_sec_gain = 0b01110000;break;
               case 15: in_sec_gain = 0b01111000;break;
   }
           switch(main_second){
               case 0: main_second = 0b00000000;break;
               case 1: main_second = 0b10000000;break;
   }
        
           writeWire(SECOND_IN, in_sec_sel+in_sec_gain+main_second); 
   }

void PT2348::writeWire(char a, char b){
  Wire.beginTransmission(PT2348_address);
  Wire.write (a);
  Wire.write (b);
  Wire.endTransmission();
}

2

Re: PT2348 4.1-Channel Audio Processor with Subwoofer

Протестировано!!!

3

Re: PT2348 4.1-Channel Audio Processor with Subwoofer

Пример использования PT2348

В примере используется LCD1602 (I2C), энкодер и две кнопки управления

Дополнительные библиотеки:
http://rcl-radio.ru/wp-content/uploads/ … ncoder.zip
http://rcl-radio.ru/wp-content/uploads/ … Timer2.zip
http://rcl-radio.ru/wp-content/uploads/ … remote.zip
http://forum.rcl-radio.ru/misc.php?acti … download=1

#define IR_1 0x2FDD02F // Кнопка вверх
#define IR_2 0x2FD32CD // Кнопка вниз
#define IR_3 0x2FD906F // Кнопка >
#define IR_4 0x2FDF20D // Кнопка <
#define IR_5 0x2FD708F // Кнопка IN

#include <Wire.h> 
#include <PT2348.h>
#include <LiquidCrystal_I2C.h>
#include <Encoder.h>
#include <EEPROM.h>
#include <MsTimer2.h>
#include <boarddefs.h>
#include <IRremote.h>
  PT2348 pt; 
  LiquidCrystal_I2C lcd(0x27,16,2);  // Устанавливаем дисплей
  IRrecv irrecv(12); // указываем вывод модуля IR приемника
  Encoder myEnc(9, 8);// DT, CLK
  decode_results ir; 
   byte a1[8] = {0b00000,0b10101,0b10101,0b10101,0b10101,0b10101,0b10101,0b00000};
   byte a2[8] = {0b00000,0b10100,0b10100,0b10100,0b10100,0b10100,0b10100,0b00000};
   byte a3[8] = {0b00000,0b10000,0b10000,0b10000,0b10000,0b10000,0b10000,0b00000};  
   unsigned long time,oldPosition  = -999,newPosition; 
   int vol,vol_d,z,z0,z1,w,w2,menu,bass,bass_d,treb,treb_d,in,www,menu2;
   int gain0,gain1,gain2,gain3,gain_d,lon,lon_d;
   int rf,lf,rt,lt,sab,vol_out,out,sab_f;
   byte gr1,gr2;

void setup(){
   Wire.begin();irrecv.enableIRIn();lcd.init();lcd.backlight();
  lcd.setCursor(0,0);lcd.print("     PT2348     ");delay(2000);
  Serial.begin(9600); lcd.createChar(0,a1);lcd.createChar(1,a2);lcd.createChar(2,a3);
   pinMode(10,INPUT);  // МЕНЮ КНОПКА SW энкодера
   pinMode(2,INPUT);   // ВЫБОР ВХОДА КНОПКА IN
   pinMode(3,INPUT);   // КНОПКА MENU_2
   MsTimer2::set(3, to_Timer);MsTimer2::start();
  if(EEPROM.read(100)!=0){for(int i=0;i<101;i++){EEPROM.update(i,0);}}// очистка памяти при первом включении 
   vol = EEPROM.read(0)-79;bass = EEPROM.read(1)-15;treb = EEPROM.read(2)-15;in = EEPROM.read(3);
   gain1 = EEPROM.read(5);gain2 = EEPROM.read(6);gain3 = EEPROM.read(7);lon = EEPROM.read(8);
   rf = EEPROM.read(10)-15;lf = EEPROM.read(11)-15;rt = EEPROM.read(12)-15;lt = EEPROM.read(13)-15;sab = EEPROM.read(14)-15;
   sab_f = EEPROM.read(18);
   cl();audio();
}

void loop(){
  if(digitalRead(10)==LOW&&menu2==0){menu++;cl();time=millis();w=1;w2=1;if(menu>2){menu=0;}}// меню
  if(digitalRead(2)==HIGH&&menu2!=3){in++;cl();time=millis();w=1;w2=1;www=1;if(in>3){in=1;};lcd.setCursor(0,0);lcd.print("    INPUT ");lcd.print(in);audio();delay(2000);}// КНОПКА ВЫБОРА ВХОДА IN
  
  if(digitalRead(3)==HIGH){menu2++;menu=100;cl();time=millis();w=1;w2=1;lcd.setCursor(0,0);lcd.print("     MENU 2   ");delay(2000);}
  if(digitalRead(10)==LOW&&menu2>0){menu2++;cl();time=millis();w=1;w2=1;if(menu2>4){menu2=0;menu=0;}}// меню

    ////////////////////// IR /////////////////////////////////////////////////
  if ( irrecv.decode( &ir )) {Serial.print("0x");Serial.println( ir.value,HEX);irrecv.resume();time=millis();w=1;}// IR приемник - чтение, в мониторе порта отображаются коды кнопок
  if(ir.value==0){gr1=0;gr2=0;}// запрет нажатий не активных кнопок пульта

  if(ir.value==IR_1&&menu2==0){menu++;gr1=0;gr2=0;cl();time=millis();w=1;w2=1;if(menu>2){menu=0;}}// меню кнопка вверх 
  if(ir.value==IR_2&&menu2==0){menu--;gr1=0;gr2=0;cl();time=millis();w=1;w2=1;if(menu<0){menu=2;}}// меню кнопка вниз
  if(ir.value==IR_5&&menu2!=3){in++;gr1=0;gr2=0;cl();time=millis();w=1;w2=1;www=1;if(in>3){in=1;};lcd.setCursor(0,0);lcd.print("    INPUT ");lcd.print(in);audio();delay(2000);}// КНОПКА ВЫБОРА ВХОДА IN
  
   /////////////////////////////// VOLUME -79 ... +15 дБ ////////////////////////////////////////////////
 if(menu==0){
     if(ir.value==IR_3){vol++;gr1=1;gr2=0;cl1();w2=1;vol_func();audio();}// кнопка > 
     if(ir.value==0xFFFFFFFF and gr1==1){vol++;gr2=0;cl1();w2=1;vol_func();audio();}// кнопка >>>>>>
     if(ir.value==IR_4){vol--;gr1=0;gr2=1;cl1();w2=1;vol_func();audio();}// кнопка <
     if(ir.value==0xFFFFFFFF and gr2==1){vol--;gr1=0;cl1();w2=1;vol_func();audio();}// кнопка <<<<<<
   
   if (newPosition != oldPosition){oldPosition = newPosition;
     vol=vol+newPosition;myEnc.write(0);newPosition=0;time=millis();w=1;w2=1;vol_func();audio();} 
     lcd.setCursor(0,0);lcd.print("VOLUME  ");
     lcd.print(" ");lcd.print(vol);lcd.print(" ");lcd.setCursor(13,0);lcd.print("dB");vol_d=vol/2+40;
   if(w2==1){
   for(z=0,z0=0,z1=0;z<=vol_d;z++,z1++){if(z1>2){z1=0;z0++;}
   if(z1==1){lcd.setCursor(z0,1);lcd.write((uint8_t)0);lcd.setCursor(z0+1,1);lcd.print("   ");}}
   if(z1==3){lcd.setCursor(z0,1);lcd.write((uint8_t)1);}
   if(z1==2){lcd.setCursor(z0,1);lcd.write((uint8_t)2);}w2=0;}}

   /////////////////////// BASS +/-20 dB ///////////////////////////////////////////////////////////
   if(menu==1){
     if(ir.value==IR_3){bass++;gr1=1;gr2=0;cl1();w2=1;bass_func();audio();}// кнопка > 
     if(ir.value==0xFFFFFFFF and gr1==1){bass++;gr2=0;cl1();w2=1;bass_func();audio();}// кнопка >>>>>>
     if(ir.value==IR_4){bass--;gr1=0;gr2=1;cl1();w2=1;bass_func();audio();}// кнопка < 
     if(ir.value==0xFFFFFFFF and gr2==1){bass--;gr1=0;cl1();w2=1;bass_func();audio();}// кнопка <<<<<<  
    
    if (newPosition != oldPosition) {
    oldPosition = newPosition;
    bass=bass+newPosition;myEnc.write(0);newPosition=0;time=millis();w=1;w2=1;bass_func();audio();} 
   lcd.setCursor(0,0);lcd.print("BASS    ");
   lcd.print(" ");lcd.print(bass);lcd.print(" ");lcd.setCursor(13,0);lcd.print("dB");bass_d=bass+15;
   if(w2==1){
   for(z=0,z0=0,z1=0;z<=bass_d;z++,z1++){if(z1>2){z1=0;z0++;}
   if(z1==1){lcd.setCursor(z0+3,1);lcd.write((uint8_t)0);lcd.setCursor(z0+1+3,1);lcd.print("   ");}}
   if(z1==3){lcd.setCursor(z0+3,1);lcd.write((uint8_t)1);}
   if(z1==2){lcd.setCursor(z0+3,1);lcd.write((uint8_t)2);}w2=0;}}

   ///////////////////////// TREBLE +/-20 dB /////////////////////////////////////////////////////////
   if(menu==2){
     if(ir.value==IR_3){treb++;gr1=1;gr2=0;cl1();w2=1;treb_func();audio();}// кнопка > 
     if(ir.value==0xFFFFFFFF and gr1==1){treb++;gr2=0;cl1();w2=1;treb_func();audio();}// кнопка >>>>>>
     if(ir.value==IR_4){treb--;gr1=0;gr2=1;cl1();w2=1;treb_func();audio();}// кнопка < 
     if(ir.value==0xFFFFFFFF and gr2==1){treb--;gr1=0;cl1();w2=1;treb_func();audio();}// кнопка <<<<<<
    
     if (newPosition != oldPosition) {
    oldPosition = newPosition;
    treb=treb+newPosition;myEnc.write(0);newPosition=0;time=millis();w=1;w2=1;treb_func();audio();} 
   lcd.setCursor(0,0);lcd.print("TREBLE  ");
   lcd.print(" ");lcd.print(treb);lcd.print(" ");lcd.setCursor(13,0);lcd.print("dB");treb_d=treb+15;
   if(w2==1){
   for(z=0,z0=0,z1=0;z<=treb_d;z++,z1++){if(z1>2){z1=0;z0++;}
   if(z1==1){lcd.setCursor(z0+3,1);lcd.write((uint8_t)0);lcd.setCursor(z0+1+3,1);lcd.print("   ");}}
   if(z1==3){lcd.setCursor(z0+3,1);lcd.write((uint8_t)1);}
   if(z1==2){lcd.setCursor(z0+3,1);lcd.write((uint8_t)2);}w2=0;}}

  //////////////////////////  MENU 2 //////////////////////////////////////////////////////////////////////

//////////////// IN + GAIN /////////////////////////////////////////////////////////////
   if(menu2==1){ 
       switch(in){
     case 1: gain0 = gain1;break;
     case 2: gain0 = gain2;break;
     case 3: gain0 = gain3;break;}

    if (newPosition != oldPosition) {
    oldPosition = newPosition;
    gain0=gain0+newPosition;myEnc.write(0);newPosition=0;time=millis();w=1;w2=1;gain_func();audio();} 
   switch(in){
     case 1: gain1 = gain0;break;
     case 2: gain2 = gain0;break;
     case 3: gain3 = gain0;break;
     } 
    if(www==1){audio();www=0;}
  lcd.setCursor(0,0);lcd.print("Gain IN ");lcd.print(in);
      lcd.setCursor(10,0);lcd.print(" ");lcd.print(gain0);lcd.print(" ");lcd.setCursor(14,0);lcd.print("dB");gain_d=gain0*2;
   if(w2==1){
   for(z=0,z0=0,z1=0;z<=gain_d;z++,z1++){if(z1>2){z1=0;z0++;}
   if(z1==1){lcd.setCursor(z0+3,1);lcd.write((uint8_t)0);lcd.setCursor(z0+1+3,1);lcd.print("   ");}}
   if(z1==3){lcd.setCursor(z0+3,1);lcd.write((uint8_t)1);}
   if(z1==2){lcd.setCursor(z0+3,1);lcd.write((uint8_t)2);}}w2=0;} 

/////////////////////// loudness ///////////////////////////////////////////
    if(menu2==2){
  
      if (newPosition != oldPosition) {
      oldPosition = newPosition;
      lon=lon+newPosition;myEnc.write(0);newPosition=0;time=millis();w=1;w2=1;lon_func();audio();} 

   lcd.setCursor(0,0);lcd.print("Loud gain");
   lcd.print(" ");lcd.print(lon);lcd.print(" ");lcd.setCursor(13,0);lcd.print("dB");lon_d=lon*2;
   if(w2==1){
   for(z=0,z0=0,z1=0;z<=lon_d;z++,z1++){if(z1>2){z1=0;z0++;}
   if(z1==1){lcd.setCursor(z0+3,1);lcd.write((uint8_t)0);lcd.setCursor(z0+1+3,1);lcd.print("   ");}}
   if(z1==3){lcd.setCursor(z0+3,1);lcd.write((uint8_t)1);}
   if(z1==2){lcd.setCursor(z0+3,1);lcd.write((uint8_t)2);}w2=0;}}

  ////////////////////////////////////////// out /////////////////////////////////////////////////
 if(menu2==3){  
   if(digitalRead(2)==HIGH){out++;cl();time=millis();www=1;w=1;if(out>4){out=0;}audio();} // перебор выходов кнопкой IN
   if(ir.value==IR_5){out++;cl();time=millis();www=1;w=1;if(out>4){out=0;}audio();} // перебор выходов кнопкой IN
       switch(out){
          case 0:vol_out=rf;break;
          case 1:vol_out=lf;break;
          case 2:vol_out=rt;break;
          case 3:vol_out=lt;break;
          case 4:vol_out=sab;break;}
          
      if (newPosition != oldPosition) {
      oldPosition = newPosition;
      vol_out=vol_out+newPosition;myEnc.write(0);newPosition=0;time=millis();www=1;w=1;w2=1;vol_out_func();audio();} 
      
   lcd.setCursor(0,0);lcd.print("Volume OUT");lcd.setCursor(0,1);
      switch(out){
   case 0:rf=vol_out;lcd.print("RF:  ");lcd.print(rf);break;
   case 1:lf=vol_out;lcd.print("LF:  ");lcd.print(lf);break;
   case 2:rt=vol_out;lcd.print("RT:  ");lcd.print(rt);break;
   case 3:lt=vol_out;lcd.print("LT:  ");lcd.print(lt);break;
   case 4:sab=vol_out;lcd.print("SUB:  ");lcd.print(sab);break;
   }
    if(www==1){audio();www=0;}
  lcd.print(" dB      ");} 

  //////////////////////////////////////subw//////////////////////////////////////////////// 
 if(menu2==4){ 
     if(ir.value==IR_3){sab_f++;gr1=1;gr2=0;cl1();w2=1;sab_f_func();audio();}// кнопка > 
     if(ir.value==0xFFFFFFFF and gr1==1){sab_f++;gr2=0;cl1();w2=1;sab_f_func();audio();}// кнопка >>>>>>
     if(ir.value==IR_4){sab_f--;gr1=0;gr2=1;cl1();w2=1;sab_f_func();audio();}// кнопка < 
     if(ir.value==0xFFFFFFFF and gr2==1){sab_f--;gr1=0;cl1();w2=1;sab_f_func();audio();}// кнопка <<<<<<  
     
      if (newPosition != oldPosition) {
      oldPosition = newPosition;
      sab_f=sab_f+newPosition;myEnc.write(0);newPosition=0;time=millis();w=1;w2=1;sab_f_func();audio();}   
    lcd.setCursor(0,0);lcd.print("Subwoofer Freq.");
    lcd.setCursor(1,6);
      switch(sab_f){
         case 0: lcd.print("80  Hz ");break;
         case 1: lcd.print("120 Hz ");break;
         case 2: lcd.print("160 Hz ");break;}} 


   ///////////////////// EEPROM ///////////////////////////////////////////////////////////////         
  if(millis()-time>10000 && w==1){
     EEPROM.update(0,vol+79);EEPROM.update(1,bass+15);EEPROM.update(2,treb+15);EEPROM.update(3,in);
     EEPROM.update(5,gain1);EEPROM.update(6,gain2);EEPROM.update(7,gain3);EEPROM.update(8,lon);
     EEPROM.update(10,rf+15);EEPROM.update(11,lf+15);EEPROM.update(12,rt+15);EEPROM.update(13,lt+15);EEPROM.update(14,sab+15);
     EEPROM.update(18,sab_f);
     menu=0;menu2=0;w=0;w2=1;cl();}
  
  }// LOOP

void sab_f_func(){if(sab_f>2){sab_f=0;}if(sab_f<0){sab_f=2;}}
void vol_out_func(){if(vol_out>15){vol_out=15;}if(vol_out<-15){vol_out=-15;}}
void lon_func(){if(lon>15){lon=15;}if(lon<0){lon=0;}}
void gain_func(){if(gain0<0){gain0=0;}if(gain0>15){gain0=15;}}
void treb_func(){if(treb>15){treb=15;}if(treb<-15){treb=-15;}}
void bass_func(){if(bass>15){bass=15;}if(bass<-15){bass=-15;}}
void vol_func(){if(vol<-79){vol=-79;}if(vol>15){vol=15;}}
void cl(){ir.value=0;delay(300);lcd.clear();}
void cl1(){ir.value=0;delay(100);}
void to_Timer(){newPosition = myEnc.read()/4;}


void audio(){
   pt.setMain_in(in, gain0); 
                 /* Input Selector - in_sel
                    int 0 === QD/SE : QD
                    int 1 === SE IN1
                    int 2 === SE IN2
                    int 3 === SE IN3
                    int 4 === QD/SE : SE IN4
                    int 5 === Mute  
                    Input Gain - in_gain
                    int 0...15 === 0...+15 dB */
   pt.setLoun_sub(lon, 1, sab_f);
                 /* Loudness - loun, loun_off
                    int 0...15 === 0...-15 dB
                    int 0...1 === on...off
                    Subwoofer Cut-off Frequency - sub_f
                    int 0...2 === 80 120 160 Hz */
   pt.setVol(vol); // Volume int +15...-80 === +15...-80 dB
   pt.setBass_mix(bass, 1, 1, 1);
                 /* BASS - bass
                    int -15...15 === -15...+15 dB
                    MIXING 
                    mixing enable int 0...1 === on...off
                    mixing to LF  int 0...1 === on...off
                    mixing to RF  int 0...1 === on...off */
   pt.setTreble(treb);// TREBLE int -15...+15 === -15...+15 dB
   pt.setAtt_mix(0);//MIXING LEVEL int -15...+15 === -15...+15 dB
   pt.setAtt_LF(lf);// SPEAKER ATTENUATOR LEFT FRONT int -15...+15 === -15...+15 dB
   pt.setAtt_RF(rf);// SPEAKER ATTENUATOR RIGHT FRONT int -15...+15 === -15...+15 dB
   pt.setAtt_LR(lt);// SPEAKER ATTENUATOR LEFT REAR  int -15...+15 === -15...+15 dB
   pt.setAtt_RR(rt);// SPEAKER ATTENUATOR RIGHT REAR  int -15...+15 === -15...+15 dB
   pt.setAtt_SUB(sab);// SPEAKER ATTENUATOR SUBWOOFER  int -15...+15 === -15...+15 dB
   pt.setSecond_in(5, 0, 0);
                /* Second Input Selector 
                    int 0 === QD/SE : QD
                    int 1 === SE IN1
                    int 2 === SE IN2
                    int 3 === SE IN3
                    int 4 === QD/SE : SE IN4
                    int 5 === Mute  
                    Input Gain - in_gain
                    int 0...15 === 0...+15 dB 
                    Rear Speaker Source 
                    int 0...1 === main source...second source */
  }

4

Re: PT2348 4.1-Channel Audio Processor with Subwoofer

Собрал схему, почему то у меня сам переключает бесконечно по кругу bass treble volume? даже при отключенных энкодере и pt2348.
Подскажите в чем проблема.

5

Re: PT2348 4.1-Channel Audio Processor with Subwoofer

Проверьте энкодер, на плате энкодера должны стоять 3 подтягивающих резистора по 10 К на +Uпитания. Кнопка энкодера инверсная, нажатие = GND

6 (2021-02-05 08:36:12 отредактировано fcustoms)

Re: PT2348 4.1-Channel Audio Processor with Subwoofer

Всё отключено, подключён только дисплей. Пробовал на nano и mega. Везде одинаково.

7

Re: PT2348 4.1-Channel Audio Processor with Subwoofer

Без энкодера работать не будет

8

Re: PT2348 4.1-Channel Audio Processor with Subwoofer

SW энкодера нужно поддягивать на 10к к земле? Разобрался у меня на плате нет его, стоят только 2.

9

Re: PT2348 4.1-Channel Audio Processor with Subwoofer

К +5 В

10

Re: PT2348 4.1-Channel Audio Processor with Subwoofer

Переписываю код под OLED i2C 1306 экраны, для проекта. Выложу здесь наработки.