Changeset 1584

Show
Ignore:
Timestamp:
06/22/09 05:31:17 (14 years ago)
Author:
jwoithe
Message:

RME: Fill out TCO definitions. Start work on TCO interface methods.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/rme/fireface_def.h

    r1575 r1584  
    407407// Defines used to configure selected quadlets of the TCO write space.  The 
    408408// byte indices referenced in the define names are 0-based. 
     409 
     410// TCO quadlet 0 
     411#define FF_TCO0_MTC                           0x80000000 
     412 
     413// TCO quadlet 1 
    409414#define FF_TCO1_TCO_lock                      0x00000001 
     415#define FF_TCO1_WORD_CLOCK_INPUT_RATE0        0x00000002 
     416#define FF_TCO1_WORD_CLOCK_INPUT_RATE1        0x00000004 
     417#define FF_TCO1_LTC_INPUT_VALID               0x00000008 
     418#define FF_TCO1_WORD_CLOCK_INPUT_VALID        0x00000010 
     419#define FF_TCO1_VIDEO_INPUT_NTSC              0x00000020 
     420#define FF_TCO1_VIDEO_INPUT_PAL               0x00000040 
     421#define FF_TCO1_SET_TC                        0x00000100 
     422#define FF_TCO1_SET_DROPFRAME                 0x00000200 
     423#define FF_TCO1_LTC_FORMAT0                   0x00000400 
     424#define FF_TCO1_LTC_FORMAT1                   0x00000800 
     425 
     426#define FF_TCO1_WORD_CLOCK_INPUT_1x           0 
     427#define FF_TCO1_WORD_CLOCK_INPUT_2x           FF_TCO1_WORD_CLOCK_INPUT_RATE0 
     428#define FF_TCO1_WORD_CLOCK_INPUT_4x           FF_TCO1_WORD_CLOCK_INPUT_RATE1 
     429#define FF_TC01_LTC_FORMAT_24fps              0 
     430#define FF_TCO1_LTC_FORMAT_25fps              FF_TCO1_LTC_FORMAT0 
     431#define FF_TC01_LTC_FORMAT_29_97fps           FF_TCO1_LTC_FORMAT1 
     432#define FF_TCO1_LTC_FORMAT_29_97dpfs          (FF_TCO1_LTC_FORMAT1|FF_TCO1_SET_DROPFRAME) 
     433#define FF_TCO1_LTC_FORMAT_30fps              (FF_TCO1_LTC_FORMAT0|FF_TCO1_LTC_FORMAT1) 
     434#define FF_TCO1_LTC_FORMAT_30dfps             (FF_TCO1_LTC_FORMAT0|FF_TCO1_LTC_FORMAT1|FF_TCO1_SET_DROPFRAME) 
     435 
     436// TCO quadlet 2 
     437#define FF_TCO2_TC_RUN                        0x00010000 
     438#define FF_TCO2_WORD_CLOCK_CONV0              0x00020000 
     439#define FF_TCO2_WORD_CLOCK_CONV1              0x00040000 
     440#define FF_TCO2_NUM_DROPFRAMES0               0x00080000 // Unused 
     441#define FF_TCO2_NUM_DROPFRAMES1               0x00100000 // Unused 
     442#define FF_TCO2_SET_JAM_SYNC                  0x00200000 
     443#define FF_TCO2_SET_FLYWHEEL                  0x00400000 
     444#define FF_TCO2_SET_01_4                      0x01000000 
     445#define FF_TCO2_SET_PULLDOWN                  0x02000000 
     446#define FF_TCO2_SET_PULLUP                    0x04000000 
     447#define FF_TCO2_SET_FREQ                      0x08000000 
     448#define FF_TCO2_SET_TERMINATION               0x10000000 
     449#define FF_TCO2_SET_INPUT0                    0x20000000 
     450#define FF_TCO2_SET_INPUT1                    0x40000000 
     451#define FF_TCO2_SET_FREQ_FROM_APP             0x80000000 
     452 
     453#define FF_TCO2_WORD_CLOCK_CONV_1_1           0 
     454#define FF_TCO2_WORD_CLOCK_CONV_44_48         FF_TCO2_WORD_CLOCK_CONV0 
     455#define FF_TCO2_WORD_CLOCK_CONV_48_44         FF_TCO2_WORD_CLOCK_CONV1 
     456#define FF_TCO2_PULL_0                        0 
     457#define FF_TCO2_PULL_UP_01                    FF_TCO2_SET_PULLUP 
     458#define FF_TCO2_PULL_DOWN_01                  FF_TCO2_SET_PULLDOWN 
     459#define FF_TCO2_PULL_UP_40                    (FF_TCO2_SET_PULLUP|FF_TCO2_SET_01_4) 
     460#define FF_TCO2_PULL_DOWN_40                  (FF_TCO2_SET_PULLDOWN|FF_TCO2_SET_01_4) 
     461#define FF_TCO2_INPUT_LTC                     FF_TCO2_SET_INPUT1 
     462#define FF_TCO2_INPUT_VIDEO                   FF_TCO2_SET_INPUT0 
     463#define FF_TCO2_INPUT_WORD_CLOCK              0 
    410464 
    411465#endif 
  • trunk/libffado/src/rme/fireface_hw.cpp

    r1574 r1584  
    257257} 
    258258 
    259 
     259signed int Device::write_tco_settings(FF_TCO_settings_t tco_settings) 
     260
     261    // Writes the supplied application-level settings to the device's TCO 
     262    // (Time Code Option).  Don't bother doing anything if the device doesn't 
     263    // have a TCO fitted.  Returns 0 on success, -1 on error. 
     264 
     265    quadlet_t tc[4] = {0, 0, 0, 0}; 
     266 
     267    if (!tco_present) { 
     268        return -1; 
     269    } 
     270 
     271    return 0; 
     272
     273 
     274
  • trunk/libffado/src/rme/rme_avdevice.cpp

    r1575 r1584  
    9797    , m_rme_model( RME_MODEL_NONE ) 
    9898    , m_ddsFreq( -1 ) 
     99    , tco_present( 0 ) 
    99100{ 
    100101    debugOutput( DEBUG_LEVEL_VERBOSE, "Created Rme::Device (NodeID %d)\n", 
     
    170171        debugError("Unsupported model\n"); 
    171172        return false; 
     173    } 
     174 
     175    // If device is FF800, check to see if the TCO is fitted 
     176    if (m_rme_model == RME_MODEL_FIREFACE800) { 
     177        tco_present = (read_tco(NULL, 0) == 0); 
    172178    } 
    173179 
  • trunk/libffado/src/rme/rme_avdevice.h

    r1574 r1584  
    9393    signed int m_ddsFreq; 
    9494 
     95    signed int tco_present; 
    9596    FF_software_settings_t settings; 
    9697 
     
    118119    signed int read_tco(quadlet_t *tco_data, signed int size); 
    119120    signed int write_tco(quadlet_t *tco_data, signed int size); 
     121 
     122    signed int write_tco_settings(FF_TCO_settings_t tco_settings); 
    120123     
    121124};