22 #include "ReadWriteBits.h"
40 if (BitIsClear(BiColorLed_ddr, status_led))
43 return BitIsClear(BiColorLed_port, status_led)
66 uint8_t led_num = 0xFF;
97 uint8_t led_num = 0xFF;
104 uint8_t led_setting = 0xFF;
146 uint8_t
const cmd = 3;
152 uint8_t led_num = 0xFF;
172 UsbWriteByte(status);
173 UsbWriteByte(led_setting);
197 uint8_t
const cmd = 4;
203 uint8_t led_num = 0xFF;
210 uint8_t led_setting = 0xFF;
227 UsbWriteByte(status);
261 uint8_t
const cmd = 7;
302 UsbWriteByte(status);
303 UsbWriteByte(binning);
305 UsbWriteByte(row_bitmap);
365 uint8_t
const cmd = 8;
371 uint8_t binning = 0xFF;
385 uint8_t row_bitmap = 0xFF;
418 UsbWriteByte(status);
438 uint8_t
const cmd = 9;
462 UsbWriteByte(status);
463 UsbWriteByte(exposure_msb);
464 UsbWriteByte(exposure_lsb);
482 uint8_t
const cmd = 10;
488 uint8_t exposure_MSB = 0xFF;
495 uint8_t exposure_LSB = 0xFF;
512 UsbWriteByte(status);
534 uint8_t
const cmd = 11;
558 UsbWriteByte(status);
559 UsbWriteByte(num_pixels_MSB);
560 UsbWriteByte(num_pixels_LSB);
568 uint16_t num_pixels = (num_pixels_MSB << 8) | num_pixels_LSB;
569 uint16_t nbytes = 2*num_pixels;
570 uint16_t nbytes_read = 0;
571 while(nbytes_read++ < nbytes)
581 inline void AutoExposure(
void)
583 uint8_t
const cmd = 12;
610 UsbWriteByte(status);
611 UsbWriteByte(success);
612 UsbWriteByte(iterations);
617 inline void GetAutoExposeConfig(
void)
619 uint8_t
const cmd = 13;
688 UsbWriteByte(status);
692 UsbWriteByte(start_pixel_msb);
693 UsbWriteByte(start_pixel_lsb);
695 UsbWriteByte(stop_pixel_msb);
696 UsbWriteByte(stop_pixel_lsb);
698 UsbWriteByte(target_msb);
699 UsbWriteByte(target_lsb);
701 UsbWriteByte(target_tolerance_msb);
702 UsbWriteByte(target_tolerance_lsb);
704 UsbWriteByte(max_exposure_msb);
705 UsbWriteByte(max_exposure_lsb);
707 inline void SetAutoExposeConfig(
void)
712 uint8_t
const cmd = 14;
723 uint8_t start_pixel_msb = 0xFF;
729 uint8_t start_pixel_lsb = 0xFF;
735 uint8_t stop_pixel_msb = 0xFF;
741 uint8_t stop_pixel_lsb = 0xFF;
747 uint8_t target_msb = 0xFF;
753 uint8_t target_lsb = 0xFF;
759 uint8_t target_tolerance_msb = 0xFF;
765 uint8_t target_tolerance_lsb = 0xFF;
771 uint8_t max_exposure_msb = 0xFF;
777 uint8_t max_exposure_lsb = 0xFF;
803 UsbWriteByte(status);
810 inline void GetSensorHash(
void)
812 uint8_t
const cmd = 15;
850 UsbWriteByte(status);
851 UsbWriteByte(first_byte);
852 UsbWriteByte(second_byte);
853 UsbWriteByte(third_byte);
uint8_t max_tries
maximum number of tries before AutoExpose() gives up
void BiColorLedOff(bicolorled_num led)
void BiColorLedGreen(bicolorled_num led)
void BiColorLedRed(bicolorled_num led)
void BiColorLedOn(bicolorled_num led)
uint8_t SpiMasterXfrByte(uint8_t byte)
spi_reg Spi_PortInput
Atmel PIN.
See cfg/microspec.json in the Python API repository.
bool led_setting_is_valid(led_state setting)
uint8_t PADDING
When status_code is ERROR, pad responses to send expected number of bytes.
void GetSensorConfig(void)
uint8_t ReadLedState(void)
void SetSensorConfig(void)
usb-bridge communicates over USB via FTDI USB Bridge IC FT221X
bool UsbRxbufferIsEmpty(void)
uint8_t UsbReadByte(uint8_t *pbyte)