CCDs are analog devices that collect photons and convert them into charge. The collected charge is then shifted to the output, where an ADC digitizes it.
The TCD1304 datasheet provides this figure.
In brief; the output signal is the reverse of the intensity of the light hitting the pixels. The two key values to know is the voltage of an unexposed pixel (OS), and the voltage of a fully saturated pixel (Vsat).
The raw output from a TCD1304 on an oscilloscope looks like this:
The picture changes slightly when the TCD1304 is placed in the drive circuit described in the datasheet:
The noise seen in both figures stem in part from the oscilloscope. When the capture is done with the ADC in the STM32F401RE it’s cleaner:
And if you want it really neat, you can average several exposures:
You may argue that it would be nicer to have a signal that is proportional to the intensity of the light striking the sensor. This is not impossible and Dave Allmon’s CCD Transmission Spectrograph has an example of such conditioning of the TCD1304’s output to the ADC he uses, and I took the liberty of copying his idea. Read more about that here.
However, as long as the output from the CCD is in the ADC’s range¹ you can also do that in software, though it will be at the expense of the resolution if the ADC’s range is underfilled.
¹ The range of the STM32F401RE’s ADC is 0-3.3V. The ADC has 12-bit resolution, so an input of 3.3V corresponds to a value of 2¹² = 4096, and 0V corresponds to a value of 0. There’s a linear correlation between input voltage an the converted value: