Alpha spectrometer developed during my internship at the IEAP.
Pu-239 Am-241 Cm-244 spectrum (on bare die BPW34 in vacuum)
|----------|---------
| type | content...
|----------|---------
If the device receives a packet with invalid type, it responds with an ERROR packet with EUNKNOWN error type.
This does not do anything, it is recommended to send a bunch of NOPs on opening the serial port to flush any data which might have been left in the device input buffer.
|----------|
| 0x01 |
|----------|
Used by host to check whether the device is alive. Device should respond with PONG.
|----------|
| 0x02 |
|----------|
Used by host to get basic properties. Device should respond with GETRESP.
|----------|---------|
| 0x03 | propid |
|----------|---------|
Used by host to set basic properties. Propval length depends on the property being set. Note that multi byte values should be sent in little endian.
|----------|---------|----------
| 0x04 | propid | propval...
|----------|---------|----------
Start sampling and sending events.
|----------|
| 0x05 |
|----------|
End sampling and sending events.
|----------|
| 0x06 |
|----------|
The most significant bit of the type field is always set to 1.
Sent as response to host PING.
|----------|
| 0x82 |
|----------|
Send event (little endian).
|----------|----------|----------|
| 0x87 | low | high |
|----------|----------|----------|
|----------|----------|----------
| 0x83 | propid | value...
|----------|----------|----------
The value length depends on the propid and the byte order is little endian.
Sends event waveform. This is currently not yet implemented.
|----------|----------|----------
| 0x88 | length | <length> samples, 2 bytes each, Big endian
|----------|----------|----------
|----------|----------|
| 0xff | errno |
|----------|----------|
Sent on errors. errno: = 1 EUNKNOWN -- Sent on unknown packet type received = 2 EINKEY -- Sent on invalid key in GET/SET packet = 3 EINOP -- Sent on invalid operation on an existing key (unsuported read/write)
length = 2
Firmware version version.
length = 2
Event trigger threshold.
length = 1
Set to 1 if the internal bias generator should be enabled.
length = 1
Set to 1 if the internal x6 amplifier should be enabled.
length = 2
If the value is > 0, the events are further filtered based on whether their falling edge is at least N samples longer than the rising edge.
length = 2
Serial number of the device. Set at compile time using make SERNO=X