## firewireDCAM.db
## Template database file to control the features of a firewire camera.
## See the detailled description for information about macros and how features 
## can be controlled and read out: 
##

## Video Format
record(mbbo, "$(P)$(R)FORMAT") {
  field(SCAN, "Passive")
  field(PINI, "NO")
  field(DTYP, "asynInt32")
  field(OUT,  "@asyn($(PORT) 0)FDC_FORMAT")
  field(ZRST, "VGA")
  field(ONST, "Super VGA 1")
  field(TWST, "Super VGA 2")
  field(THST, "Still image")
  field(FRST, "User-defined")
  field(ZRVL, "0x0")
  field(ONVL, "0x1")
  field(TWVL, "0x2")
  field(THVL, "0x6")
  field(FRVL, "0x7")
}

## Read back the framerate setting when not in ROI/format7 mode.
record(mbbi, "$(P)$(R)FORMAT_RBV") {
  field(SCAN, "I/O Intr")
  field(DTYP, "asynInt32")
  field(INP,  "@asyn($(PORT) 0)FDC_FORMAT")
  field(ZRST, "VGA")
  field(ONST, "Super VGA 1")
  field(TWST, "Super VGA 2")
  field(THST, "Still image")
  field(FRST, "User-defined")
  field(ZRVL, "0x0")
  field(ONVL, "0x1")
  field(TWVL, "0x2")
  field(THVL, "0x6")
  field(FRVL, "0x7")
}

## VideoMode
record(mbbo, "$(P)$(R)MODE") {
  field(SCAN, "Passive")
  field(PINI, "NO")
  field(DTYP, "asynInt32")
  field(OUT,  "@asyn($(PORT) 0)FDC_MODE")
  field(ZRST, "0")
  field(ONST, "1")
  field(TWST, "2")
  field(THST, "3")
  field(FRST, "4")
  field(FVST, "5")
  field(SXST, "6")
  field(SVST, "7")
  field(ZRVL, "0x0")
  field(ONVL, "0x1")
  field(TWVL, "0x2")
  field(THVL, "0x3")
  field(FRVL, "0x4")
  field(FVVL, "0x5")
  field(SXVL, "0x6")
  field(SVVL, "0x7")
}

## Read back the framerate setting when not in ROI/format7 mode.
record(mbbi, "$(P)$(R)MODE_RBV") {
  field(SCAN, "I/O Intr")
  field(DTYP, "asynInt32")
  field(INP,  "@asyn($(PORT) 0)FDC_MODE")
  field(ZRST, "0")
  field(ONST, "1")
  field(TWST, "2")
  field(THST, "3")
  field(FRST, "4")
  field(FVST, "5")
  field(SXST, "6")
  field(SVST, "7")
  field(ZRVL, "0x0")
  field(ONVL, "0x1")
  field(TWVL, "0x2")
  field(THVL, "0x3")
  field(FRVL, "0x4")
  field(FVVL, "0x5")
  field(SXVL, "0x6")
  field(SVVL, "0x7")
}

## Change the framerate when the camera is not in the ROI/format7 mode
record(mbbo, "$(P)$(R)FR") {
  field(SCAN, "Passive")
  field(PINI, "NO")
  field(DTYP, "asynInt32")
  field(OUT,  "@asyn($(PORT) 0)FDC_FRAMERATE")
  field(ZRST, "1.875")
  field(ONST, "3.75")
  field(TWST, "7.5")
  field(THST, "15")
  field(FRST, "30")
  field(FVST, "60")
  field(SXST, "120")
  field(SVST, "240")
  field(ZRVL, "0x0")
  field(ONVL, "0x1")
  field(TWVL, "0x2")
  field(THVL, "0x3")
  field(FRVL, "0x4")
  field(FVVL, "0x5")
  field(SXVL, "0x6")
  field(SVVL, "0x7")
}

## Read back the framerate setting when not in ROI/format7 mode.
record(mbbi, "$(P)$(R)FR_RBV") {
  field(SCAN, "I/O Intr")
  field(DTYP, "asynInt32")
  field(INP,  "@asyn($(PORT) 0)FDC_FRAMERATE")
  field(ZRST, "1.875")
  field(ONST, "3.75")
  field(TWST, "7.5")
  field(THST, "15")
  field(FRST, "30")
  field(FVST, "60")
  field(SXST, "120")
  field(SVST, "240")
  field(ZRVL, "0x0")
  field(ONVL, "0x1")
  field(TWVL, "0x2")
  field(THVL, "0x3")
  field(FRVL, "0x4")
  field(FVVL, "0x5")
  field(SXVL, "0x6")
  field(SVVL, "0x7")
}

## Format 7 color code
record(mbbo, "$(P)$(R)COLORCODE") {
  field(SCAN, "Passive")
  field(PINI, "NO")
  field(DTYP, "asynInt32")
  field(OUT,  "@asyn($(PORT) 0)FDC_COLORCODE")
  field(ZRST, "0")
  field(ONST, "1")
  field(TWST, "2")
  field(THST, "3")
  field(FRST, "4")
  field(FVST, "5")
  field(SXST, "6")
  field(SVST, "7")
  field(EIST, "8")
  field(NIST, "9")
  field(TEST, "10")
  field(ZRVL, "0x0")
  field(ONVL, "0x1")
  field(TWVL, "0x2")
  field(THVL, "0x3")
  field(FRVL, "0x4")
  field(FVVL, "0x5")
  field(SXVL, "0x6")
  field(SVVL, "0x7")
  field(EIVL, "0x8")
  field(NIVL, "0x9")
  field(TEVL, "0xA")
}

## Read back the framerate setting when not in ROI/format7 mode.
record(mbbi, "$(P)$(R)COLORCODE_RBV") {
  field(SCAN, "I/O Intr")
  field(DTYP, "asynInt32")
  field(INP,  "@asyn($(PORT) 0)FDC_COLORCODE")
  field(ZRST, "0")
  field(ONST, "1")
  field(TWST, "2")
  field(THST, "3")
  field(FRST, "4")
  field(FVST, "5")
  field(SXST, "6")
  field(SVST, "7")
  field(EIST, "8")
  field(NIST, "9")
  field(TEST, "10")
  field(ZRVL, "0x0")
  field(ONVL, "0x1")
  field(TWVL, "0x2")
  field(THVL, "0x3")
  field(FRVL, "0x4")
  field(FVVL, "0x5")
  field(SXVL, "0x6")
  field(SVVL, "0x7")
  field(EIVL, "0x8")
  field(NIVL, "0x9")
  field(TEVL, "0xA")
}


# Current format string
record(stringin, "$(P)$(R)CURRENT_FORMAT") {
  field(DTYP, "asynOctetRead")
  field(INP,  "@asyn($(PORT) 0)FDC_CURRENT_FORMAT")
  field(SCAN, "I/O Intr")
}

# Current mode string
record(stringin, "$(P)$(R)CURRENT_MODE") {
  field(DTYP, "asynOctetRead")
  field(INP,  "@asyn($(PORT) 0)FDC_CURRENT_MODE")
  field(SCAN, "I/O Intr")
}

# Current frame rate string
record(stringin, "$(P)$(R)CURRENT_RATE") {
  field(DTYP, "asynOctetRead")
  field(INP,  "@asyn($(PORT) 0)FDC_CURRENT_FRAMERATE")
  field(SCAN, "I/O Intr")
}

# Current color mode string
record(stringin, "$(P)$(R)CURRENT_COLORCODE") {
  field(DTYP, "asynOctetRead")
  field(INP,  "@asyn($(PORT) 0)FDC_CURRENT_COLORCODE")
  field(SCAN, "I/O Intr")
}

# Dropped frames
record(longout, "$(P)$(R)DROPPED_FRAMES") {
  field(PINI, "YES")
  field(DTYP, "asynInt32")
  field(OUT,  "@asyn($(PORT) 0)FDC_DROPPED_FRAMES")
}

# Dropped frames
record(longin, "$(P)$(R)DROPPED_FRAMES_RBV") {
  field(DTYP, "asynInt32")
  field(INP,  "@asyn($(PORT) 0)FDC_DROPPED_FRAMES")
  field(SCAN, "I/O Intr")
}
