SD SPI implementation finished

This commit is contained in:
marqs committed 2016-10-21 01:19:53 +03:00
1 parent 71d60144e8
commit f55e9a877e
46 files changed
+2349 -3392

No files matched your search

+6 -3
View File
@@ -38,6 +38,9 @@ const ypbpr_to_rgb_csc_t csc_coeffs[] = {
{ "Rec. 709", 0x2000, 0x0000, 0x323E, 0x2000, 0xFA04, 0xF113, 0x2000, 0x3B61, 0x0000 }, // eq. 105
};
static const alt_u8 Kvco[] = {75, 85, 150, 200};
static const char *Kvco_str[] = { "Ultra low", "Low", "Medium", "High" };
extern mode_data_t video_modes[];
static void tvp_set_clamp(video_format fmt)
@@ -95,11 +98,11 @@ inline void tvp_writereg(alt_u32 regaddr, alt_u8 data)
inline void tvp_reset()
{
usleep(10000);
/*usleep(10000);
IOWR_ALTERA_AVALON_PIO_DATA(PIO_0_BASE, 0x00);
usleep(10000);
IOWR_ALTERA_AVALON_PIO_DATA(PIO_0_BASE, 0x01);
usleep(10000);
usleep(10000);*/
}
inline void tvp_disable_output()
@@ -241,7 +244,7 @@ void tvp_setup_hpll(alt_u16 h_samplerate, alt_u16 v_lines, alt_u8 hz, alt_u8 pll
tvp_writereg(TVP_HPLLCTRL, ((vco_range << 6) | (cp_current << 3)));
}
void tvp_sel_clk(alt_u8 refclk)
void tvp_sel_clk(tvp_refclk_t refclk)
{
alt_u8 status = tvp_readreg(TVP_INPMUX2) & 0xFA;
+4 -9
View File
@@ -24,21 +24,18 @@
#include "video_modes.h"
#include "sysconfig.h"
//#define I2C_DEBUG
#define I2CA_BASE I2C_OPENCORES_0_BASE
#define DEFAULT_VSYNC_THOLD 0x44
#define DEFAULT_LINELEN_TOL 0x06
#define TVP_INTCLK_HZ 6500000UL
#define TVP_EXTCLK_HZ 27000000UL
typedef enum {
TVP_INPUT1 = 0,
TVP_INPUT2 = 1,
TVP_INPUT3 = 2
} tvp_input_t;
static const alt_u8 Kvco[] = {75, 85, 150, 200};
static const char *Kvco_str[] = { "Ultra low", "Low", "Medium", "High" };
typedef enum {
REFCLK_EXT27 = 0,
REFCLK_INTCLK = 1
@@ -66,8 +63,6 @@ typedef struct {
alt_u8 b_f_gain;
} __attribute__((packed)) color_setup_t;
static const alt_u32 clkrate[] = {27000000, 6500000}; //in MHz
inline alt_u32 tvp_readreg(alt_u32 regaddr);
@@ -91,7 +86,7 @@ void tvp_set_fine_gain_offset(color_setup_t *col);
void tvp_setup_hpll(alt_u16 h_samplerate, alt_u16 v_lines, alt_u8 hz, alt_u8 plldivby2);
void tvp_sel_clk(alt_u8 refclk);
void tvp_sel_clk(tvp_refclk_t refclk);
void tvp_sel_csc(const ypbpr_to_rgb_csc_t *csc);