Fix PCM1862 input selection.

This commit is contained in:
marqs committed 2017-06-12 01:00:34 +03:00
1 parent a8887ce47d
commit 2cd36cdd37
7 files changed
+963 -949

No files matched your search

+1 -1
View File
@@ -134,7 +134,7 @@
<PreBuild/>
<PostBuild/>
<CustomBuild Enabled="yes">
<Target Name="diy-audio-debug">make APP_CFLAGS_DEFINED_SYMBOLS="-DDEBUG -DDIY_AUDIO"</Target>
<Target Name="diy-audio-debug">make APP_CFLAGS_DEFINED_SYMBOLS="-DDEBUG -DENABLE_AUDIO"</Target>
<RebuildCommand/>
<CleanCommand>make clean</CleanCommand>
<BuildCommand>make APP_CFLAGS_DEFINED_SYMBOLS="-DDEBUG"</BuildCommand>
File diff suppressed because it is too large. Load diff
+11 -3
View File
@@ -76,9 +76,7 @@ char row1[LCD_ROW_LEN+1], row2[LCD_ROW_LEN+1], menu_row1[LCD_ROW_LEN+1], menu_ro
extern alt_u8 menu_active;
avinput_t target_mode;
#ifdef ENABLE_AUDIO
alt_u8 pcm1862_active;
#endif
inline void lcd_write_menu()
@@ -734,6 +732,7 @@ int main()
{
tvp_input_t target_input = 0;
ths_input_t target_ths = 0;
pcm_input_t target_pcm = 0;
video_format target_format = 0;
alt_u8 av_init = 0;
@@ -790,54 +789,63 @@ int main()
target_format = FORMAT_RGBS;
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
target_ths = THS_INPUT_B;
target_pcm = PCM_INPUT4;
break;
case AV1_RGsB:
target_input = TVP_INPUT1;
target_format = FORMAT_RGsB;
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
target_ths = THS_INPUT_B;
target_pcm = PCM_INPUT4;
break;
case AV1_YPBPR:
target_input = TVP_INPUT1;
target_format = FORMAT_YPbPr;
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
target_ths = THS_INPUT_B;
target_pcm = PCM_INPUT4;
break;
case AV2_YPBPR:
target_input = TVP_INPUT1;
target_format = FORMAT_YPbPr;
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
target_ths = THS_INPUT_A;
target_pcm = PCM_INPUT3;
break;
case AV2_RGsB:
target_input = TVP_INPUT1;
target_format = FORMAT_RGsB;
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
target_ths = THS_INPUT_A;
target_pcm = PCM_INPUT3;
break;
case AV3_RGBHV:
target_input = TVP_INPUT3;
target_format = FORMAT_RGBHV;
target_typemask = VIDEO_PC;
target_ths = THS_STANDBY;
target_pcm = PCM_INPUT2;
break;
case AV3_RGBs:
target_input = TVP_INPUT3;
target_format = FORMAT_RGBS;
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
target_ths = THS_STANDBY;
target_pcm = PCM_INPUT2;
break;
case AV3_RGsB:
target_input = TVP_INPUT3;
target_format = FORMAT_RGsB;
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
target_ths = THS_STANDBY;
target_pcm = PCM_INPUT2;
break;
case AV3_YPBPR:
target_input = TVP_INPUT3;
target_format = FORMAT_YPbPr;
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
target_ths = THS_STANDBY;
target_pcm = PCM_INPUT2;
break;
default:
break;
@@ -852,7 +860,7 @@ int main()
#ifdef ENABLE_AUDIO
DisableAudioOutput();
if (pcm1862_active)
pcm_source_sel(target_input);
pcm_source_sel(target_pcm);
#endif
tvp_source_sel(target_input, target_format);
cm.clkcnt = 0; //TODO: proper invalidate
+2 -2
View File
@@ -41,8 +41,8 @@ inline void pcm1862_writereg(alt_u8 regaddr, alt_u8 data)
I2C_write(I2CA_BASE, data, 1);
}
void pcm_source_sel(tvp_input_t input) {
alt_u8 adc_ch = 1<<(3-input);
void pcm_source_sel(pcm_input_t input) {
alt_u8 adc_ch = 1<<input;
pcm1862_writereg(PCM1862_ADC1L, adc_ch);
pcm1862_writereg(PCM1862_ADC1R, adc_ch);
+8 -2
View File
@@ -22,9 +22,15 @@
#include "pcm1862_regs.h"
#include "sysconfig.h"
#include "tvp7002.h"
void pcm_source_sel(tvp_input_t input) ;
typedef enum {
PCM_INPUT1 = 0,
PCM_INPUT2 = 1,
PCM_INPUT3 = 2,
PCM_INPUT4 = 3
} pcm_input_t;
void pcm_source_sel(pcm_input_t input) ;
int pcm1862_init();
+3 -3
View File
@@ -2,9 +2,9 @@
<sch:Settings xmlns:sch="http://www.altera.com/embeddedsw/bsp/schema">
<BspType>hal</BspType>
<BspVersion>default</BspVersion>
<BspGeneratedTimeStamp>May 30, 2017 7:39:09 PM</BspGeneratedTimeStamp>
<BspGeneratedUnixTimeStamp>1496162349817</BspGeneratedUnixTimeStamp>
<BspGeneratedLocation>./</BspGeneratedLocation>
<BspGeneratedTimeStamp>Jun 11, 2017 10:07:19 PM</BspGeneratedTimeStamp>
<BspGeneratedUnixTimeStamp>1497208039536</BspGeneratedUnixTimeStamp>
<BspGeneratedLocation>/home/markus/Code/ossc/software/sys_controller_bsp</BspGeneratedLocation>
<BspSettingsFile>settings.bsp</BspSettingsFile>
<SopcDesignFile>../../sys.sopcinfo</SopcDesignFile>
<JdiFile>default</JdiFile>