Home : I/O Peripherals Library | DSD Peripheral

Description

<TODO>

Naming Conventions

<TODO>

Interface Functions

<TODO>

Example Usage

<TODO>

Configuration

<TODO>

Source Files

xperipherals_dsd.h DSD peripheral interface
xperipherals_dsd_1.xc DSD output peripheral #1 implementation
xperipherals_dsd_2.xc DSD output peripheral #2 implementation

Source Listings

xperipherals_dsd.h

#ifndef XPERIPHERALS_DSD_OUT__INCLUDED
#define XPERIPHERALS_DSD_OUT__INCLUDED

#include "xsystem_types.h"

// These must be defined in "xconfig.h" for each peripheral bus being used
//
// XPERIPHERALS_DSD_TX_n                No value
// XPERIPHERALS_DSD_TX_n__TILE_NUMBER   Integer, XS1 tile number
// XPERIPHERALS_DSD_TX_n__BIT_CLOCK     XS1 clock-block identifier
// XPERIPHERALS_DSD_TX_n__TXD_PORT      XS1 port identifier

#define XPERIPHERALS_DSD_TX__INTERFACE( N ) \
\
void xperipherals_dsd_tx_##N##__initialize ( void ); \
void xperipherals_dsd_tx_##N##__transfer   ( xuint sampleL, xuint sampleR );

XPERIPHERALS_DSD_TX__INTERFACE( 1 )
XPERIPHERALS_DSD_TX__INTERFACE( 2 )

#endif

xperipherals_dsd_1.xc

#include <xs1.h>
#include <platform.h>
#include <xclib.h>
#include <print.h>

#include "xperipherals_dsd.h"

#ifdef XPERIPHERALS_DSD_OUT_1

extern in port master_audio_clock_port;
extern clock   master_audio_clock_block;

clock _xperipherals_dsd_out_1__bit_clock = $resource.data-clock;
out buffered port:32 _xperipherals_dsd_out_1__port_txd = $resource.txd-port;

static xuint _xperipherals_dsd_out_1__first_pass;
static xuint _xperipherals_dsd_out_1__bit_time;
static xuint _xperipherals_dsd_out_1__sample_num;

void xperipherals_dsd_out_1__initialize( void )
{
}

static void _xperipherals_dsd_out_1__synchronize( void )
{
}

static void _xperipherals_dsd_out_1__transmit( xuint tx_sample_new, xuint tx_user_data )
{
}

xsint xperipherals_dsd_out_1__transfer( xuint sampleL, sampleR )
{
}

#endif

xperipherals_dsd_2.xc

#include <xs1.h>
#include <platform.h>
#include <xclib.h>
#include <print.h>

#include "xperipherals_dsd.h"

#ifdef XPERIPHERALS_DSD_OUT_2

extern in port master_audio_clock_port;
extern clock   master_audio_clock_block;

clock _xperipherals_dsd_out_2__bit_clock = $resource.data-clock;
out buffered port:32 _xperipherals_dsd_out_2__port_txd = $resource.txd-port;

static xuint _xperipherals_dsd_out_2__first_pass;
static xuint _xperipherals_dsd_out_2__bit_time;
static xuint _xperipherals_dsd_out_2__sample_num;

void xperipherals_dsd_out_2__initialize( void )
{
}

static void _xperipherals_dsd_out_2__synchronize( void )
{
}

static void _xperipherals_dsd_out_2__transmit( xuint tx_sample_new, xuint tx_user_data )
{
}

xsint xperipherals_dsd_out_2__transfer( xuint sampleL, sampleR )
{
}

#endif