void DisplayLinkAdapter::setModePointer(const dlo_mode_t *mode) { OO_ERR(dlo_set_mode(uid, mode)); /* Read current mode information */ mode_info = dlo_get_mode(uid); OO_NERR(mode_info); }
int main() { //Initialize libdlo, claim device and get current mode dlo_init_t initFlags; dlo_retcode_t err = dlo_init(initFlags); if( err != dlo_ok ) { printf("Failed to initialize DisplayLink library: %s\n", dlo_strerror(err)); return 1; } dlo_claim_t claimFlags; dlo_dev_t dev = dlo_claim_first_device(claimFlags, 5000); //dont use dlo_claim_default_device because semihost wont get any argc/argv if( !dev ) { printf("Failed to claim DisplayLink device\n"); goto end; } dlo_mode_t* displayMode = dlo_get_mode(dev); if( 0 ) { //activate to set display to 640x480 dlo_mode_t mode = { .view = {.width = 640, .height = 480, .bpp = displayMode->view.bpp, .base = displayMode->view.base}, .refresh = 0 }; err = dlo_set_mode(dev, &mode); if( err != dlo_ok ) { printf("Failed to set mode: %s\n", dlo_strerror(err)); goto end; } }