viacuda: Getting and setting ADB device mask

This commit is contained in:
dingusdev 2021-03-04 08:01:42 -07:00
parent 2767257f2d
commit 2d08ded9f4
2 changed files with 13 additions and 0 deletions

View File

@ -370,6 +370,16 @@ void ViaCuda::pseudo_command(int cmd, int data_count) {
this->out_buf[3] = this->poll_rate;
this->out_count++;
break;
case CUDA_SET_DEVICE_LIST:
response_header(CUDA_PKT_PSEUDO, 0);
this->device_mask = ((uint16_t)in_buf[2]) >> 8;
this->device_mask += ((uint16_t)in_buf[3]);
break;
case CUDA_GET_DEVICE_LIST:
response_header(CUDA_PKT_PSEUDO, 0);
this->out_buf[2] = (uint8_t)((this->device_mask >> 8) & 0xFF);
this->out_buf[3] = (uint8_t)((this->device_mask) & 0xFF);
break;
case CUDA_READ_WRITE_I2C:
response_header(CUDA_PKT_PSEUDO, 0);
i2c_simple_transaction(this->in_buf[2], &this->in_buf[3], this->in_count - 3);

View File

@ -102,6 +102,8 @@ enum {
CUDA_FILE_SERVER_FLAG = 0x13, /* set file server flag */
CUDA_SET_AUTOPOLL_RATE = 0x14, /* set auto-polling rate */
CUDA_GET_AUTOPOLL_RATE = 0x16, /* get auto-polling rate */
CUDA_SET_DEVICE_LIST = 0x19, /* set device list */
CUDA_GET_DEVICE_LIST = 0x1A, /* get device list */
CUDA_READ_WRITE_I2C = 0x22, /* read/write I2C device */
CUDA_COMB_FMT_I2C = 0x25, /* combined format I2C transaction */
CUDA_OUT_PB0 = 0x26, /* output one bit to Cuda's PB0 line */
@ -144,6 +146,7 @@ private:
int32_t real_time = 0;
bool file_server;
uint16_t m6805_address = 0x1100;
uint16_t device_mask = 0;
bool is_open_ended;
uint8_t curr_i2c_addr;