All Downloads are FREE. Search and download functionalities are using the official Maven repository.

spinal.lib.graphic.Rgb.scala Maven / Gradle / Ivy

There is a newer version: 1.10.2a
Show newest version
package spinal.lib.graphic

import spinal.core._

case class RgbConfig(rWidth : Int,gWidth : Int,bWidth : Int){
  def getWidth = rWidth + gWidth + bWidth
}

object Rgb{
  def apply(rWidth : Int,gWidth : Int,bWidth : Int) : Rgb = Rgb(RgbConfig(rWidth,gWidth,bWidth))
}
case class Rgb(c: RgbConfig) extends Bundle{
  val r = UInt(c.rWidth bits)
  val g = UInt(c.gWidth bits)
  val b = UInt(c.bWidth bits)

  def clear(): Unit ={
    r := 0
    g := 0
    b := 0
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy