327
327
* @param[in,out] ctx - pcilib context
328
328
* @param[in] bar - the BAR to read, use PCILIB_BAR_DETECT to detect bar by the specified physical address
329
329
* @param[in] addr - absolute physical address to read or the offset in the specified bar
330
* @param[in] size - number of bytes to read
330
* @param[in] access - word size (access width in bytes)
331
* @param[in] n - number of words to read
331
332
* @param[out] buf - the read data will be placed in this buffer
332
333
* @return - error code or 0 on success
334
int pcilib_read(pcilib_t *ctx, pcilib_bar_t bar, uintptr_t addr, size_t size, void *buf);
335
int pcilib_read(pcilib_t *ctx, pcilib_bar_t bar, uintptr_t addr, uint8_t access, size_t n, void *buf);
337
338
* Performs PIO write to the PCI BAR. The BAR will be automatically mapped and unmapped if necessary.
338
339
* @param[in,out] ctx - pcilib context
339
340
* @param[in] bar - the BAR to write, use PCILIB_BAR_DETECT to detect bar by the specified physical address
340
341
* @param[in] addr - absolute physical address to write or the offset in the specified bar
341
* @param[in] size - number of bytes to write
342
* @param[in] access - word size (access width in bytes)
343
* @param[in] n - number of words to write
342
344
* @param[out] buf - the pointer to the data to be written
343
345
* @return - error code or 0 on success
345
int pcilib_write(pcilib_t *ctx, pcilib_bar_t bar, uintptr_t addr, size_t size, void *buf);
347
int pcilib_write(pcilib_t *ctx, pcilib_bar_t bar, uintptr_t addr, uint8_t access, size_t n, void *buf);
348
350
* Performs PIO read from the PCI BAR. The specified address is treated as FIFO and will be read