uint8_t * ptr; typedef struct{ uint8_t x; uint8_t y; }struct_position; //struct to enable memcopy of a block struct_position position; ptr = api_call(); (more code) memcpy(ptr, &position, (sizeof(struct_position))); (more) pUsbApi->hw->WriteEP(hUsb, 0x82, ptr, 8); |
ptr = api_call(); uint8_t val = ptr[3]; |