1
0
mirror of https://github.com/marqs85/ossc.git synced 2024-06-16 08:29:33 +00:00

Fix PCM1862 input selection.

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

View File

@ -134,7 +134,7 @@
<PreBuild/> <PreBuild/>
<PostBuild/> <PostBuild/>
<CustomBuild Enabled="yes"> <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/> <RebuildCommand/>
<CleanCommand>make clean</CleanCommand> <CleanCommand>make clean</CleanCommand>
<BuildCommand>make APP_CFLAGS_DEFINED_SYMBOLS="-DDEBUG"</BuildCommand> <BuildCommand>make APP_CFLAGS_DEFINED_SYMBOLS="-DDEBUG"</BuildCommand>

File diff suppressed because it is too large Load Diff

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; extern alt_u8 menu_active;
avinput_t target_mode; avinput_t target_mode;
#ifdef ENABLE_AUDIO
alt_u8 pcm1862_active; alt_u8 pcm1862_active;
#endif
inline void lcd_write_menu() inline void lcd_write_menu()
@ -734,6 +732,7 @@ int main()
{ {
tvp_input_t target_input = 0; tvp_input_t target_input = 0;
ths_input_t target_ths = 0; ths_input_t target_ths = 0;
pcm_input_t target_pcm = 0;
video_format target_format = 0; video_format target_format = 0;
alt_u8 av_init = 0; alt_u8 av_init = 0;
@ -790,54 +789,63 @@ int main()
target_format = FORMAT_RGBS; target_format = FORMAT_RGBS;
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV; target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
target_ths = THS_INPUT_B; target_ths = THS_INPUT_B;
target_pcm = PCM_INPUT4;
break; break;
case AV1_RGsB: case AV1_RGsB:
target_input = TVP_INPUT1; target_input = TVP_INPUT1;
target_format = FORMAT_RGsB; target_format = FORMAT_RGsB;
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV; target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
target_ths = THS_INPUT_B; target_ths = THS_INPUT_B;
target_pcm = PCM_INPUT4;
break; break;
case AV1_YPBPR: case AV1_YPBPR:
target_input = TVP_INPUT1; target_input = TVP_INPUT1;
target_format = FORMAT_YPbPr; target_format = FORMAT_YPbPr;
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV; target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
target_ths = THS_INPUT_B; target_ths = THS_INPUT_B;
target_pcm = PCM_INPUT4;
break; break;
case AV2_YPBPR: case AV2_YPBPR:
target_input = TVP_INPUT1; target_input = TVP_INPUT1;
target_format = FORMAT_YPbPr; target_format = FORMAT_YPbPr;
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV; target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
target_ths = THS_INPUT_A; target_ths = THS_INPUT_A;
target_pcm = PCM_INPUT3;
break; break;
case AV2_RGsB: case AV2_RGsB:
target_input = TVP_INPUT1; target_input = TVP_INPUT1;
target_format = FORMAT_RGsB; target_format = FORMAT_RGsB;
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV; target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
target_ths = THS_INPUT_A; target_ths = THS_INPUT_A;
target_pcm = PCM_INPUT3;
break; break;
case AV3_RGBHV: case AV3_RGBHV:
target_input = TVP_INPUT3; target_input = TVP_INPUT3;
target_format = FORMAT_RGBHV; target_format = FORMAT_RGBHV;
target_typemask = VIDEO_PC; target_typemask = VIDEO_PC;
target_ths = THS_STANDBY; target_ths = THS_STANDBY;
target_pcm = PCM_INPUT2;
break; break;
case AV3_RGBs: case AV3_RGBs:
target_input = TVP_INPUT3; target_input = TVP_INPUT3;
target_format = FORMAT_RGBS; target_format = FORMAT_RGBS;
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV; target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
target_ths = THS_STANDBY; target_ths = THS_STANDBY;
target_pcm = PCM_INPUT2;
break; break;
case AV3_RGsB: case AV3_RGsB:
target_input = TVP_INPUT3; target_input = TVP_INPUT3;
target_format = FORMAT_RGsB; target_format = FORMAT_RGsB;
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV; target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
target_ths = THS_STANDBY; target_ths = THS_STANDBY;
target_pcm = PCM_INPUT2;
break; break;
case AV3_YPBPR: case AV3_YPBPR:
target_input = TVP_INPUT3; target_input = TVP_INPUT3;
target_format = FORMAT_YPbPr; target_format = FORMAT_YPbPr;
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV; target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
target_ths = THS_STANDBY; target_ths = THS_STANDBY;
target_pcm = PCM_INPUT2;
break; break;
default: default:
break; break;
@ -852,7 +860,7 @@ int main()
#ifdef ENABLE_AUDIO #ifdef ENABLE_AUDIO
DisableAudioOutput(); DisableAudioOutput();
if (pcm1862_active) if (pcm1862_active)
pcm_source_sel(target_input); pcm_source_sel(target_pcm);
#endif #endif
tvp_source_sel(target_input, target_format); tvp_source_sel(target_input, target_format);
cm.clkcnt = 0; //TODO: proper invalidate cm.clkcnt = 0; //TODO: proper invalidate

View File

@ -41,8 +41,8 @@ inline void pcm1862_writereg(alt_u8 regaddr, alt_u8 data)
I2C_write(I2CA_BASE, data, 1); I2C_write(I2CA_BASE, data, 1);
} }
void pcm_source_sel(tvp_input_t input) { void pcm_source_sel(pcm_input_t input) {
alt_u8 adc_ch = 1<<(3-input); alt_u8 adc_ch = 1<<input;
pcm1862_writereg(PCM1862_ADC1L, adc_ch); pcm1862_writereg(PCM1862_ADC1L, adc_ch);
pcm1862_writereg(PCM1862_ADC1R, adc_ch); pcm1862_writereg(PCM1862_ADC1R, adc_ch);

View File

@ -22,9 +22,15 @@
#include "pcm1862_regs.h" #include "pcm1862_regs.h"
#include "sysconfig.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(); int pcm1862_init();

View File

@ -2,9 +2,9 @@
<sch:Settings xmlns:sch="http://www.altera.com/embeddedsw/bsp/schema"> <sch:Settings xmlns:sch="http://www.altera.com/embeddedsw/bsp/schema">
<BspType>hal</BspType> <BspType>hal</BspType>
<BspVersion>default</BspVersion> <BspVersion>default</BspVersion>
<BspGeneratedTimeStamp>May 30, 2017 7:39:09 PM</BspGeneratedTimeStamp> <BspGeneratedTimeStamp>Jun 11, 2017 10:07:19 PM</BspGeneratedTimeStamp>
<BspGeneratedUnixTimeStamp>1496162349817</BspGeneratedUnixTimeStamp> <BspGeneratedUnixTimeStamp>1497208039536</BspGeneratedUnixTimeStamp>
<BspGeneratedLocation>./</BspGeneratedLocation> <BspGeneratedLocation>/home/markus/Code/ossc/software/sys_controller_bsp</BspGeneratedLocation>
<BspSettingsFile>settings.bsp</BspSettingsFile> <BspSettingsFile>settings.bsp</BspSettingsFile>
<SopcDesignFile>../../sys.sopcinfo</SopcDesignFile> <SopcDesignFile>../../sys.sopcinfo</SopcDesignFile>
<JdiFile>default</JdiFile> <JdiFile>default</JdiFile>

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<EnsembleReport name="sys" kind="sys" version="1.0" fabric="QSYS"> <EnsembleReport name="sys" kind="sys" version="1.0" fabric="QSYS">
<!-- Format version 17.0 595 (Future versions may contain additional information.) --> <!-- Format version 17.0 595 (Future versions may contain additional information.) -->
<!-- 2017.06.04.17:48:20 --> <!-- 2017.06.11.21:19:10 -->
<!-- A collection of modules and connections --> <!-- A collection of modules and connections -->
<parameter name="AUTO_GENERATION_ID"> <parameter name="AUTO_GENERATION_ID">
<type>java.lang.Integer</type> <type>java.lang.Integer</type>
<value>1496587699</value> <value>1497205150</value>
<derived>false</derived> <derived>false</derived>
<enabled>true</enabled> <enabled>true</enabled>
<visible>false</visible> <visible>false</visible>