1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-07-17 00:47:52 +03:00
ben-wpan/tools/lib/driver.h
Werner Almesberger e2b2df2e31 Made the libatspi API driver-agnostic.
- tools/include/atspi.h: API is now driver-independent
- tools/lib/driver.h: API between driver and frontend
- tools/lib/atspi.c: renamed to atusb.c and updated for driver API
- tools/lib/atspi.c: frontend functions for the driver API
- tools/lib/Makefile: added atusb.o
2010-09-05 19:06:48 -03:00

33 lines
821 B
C

/*
* lib/driver.h - ATSPI driver API
*
* Written 2010 by Werner Almesberger
* Copyright 2010 Werner Almesberger
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef DRIVER_H
#define DRIVER_H
#include <stdint.h>
struct atspi_driver {
const char *name;
void *(*open)(void);
void (*close)(void *dsc);
void (*reset)(void *dsc);
void (*reset_rf)(void *dsc);
void (*reg_write)(void *dsc, uint8_t reg, uint8_t value);
uint8_t (*reg_read)(void *dsc, uint8_t reg);
void (*buf_write)(void *dsc, const void *buf, int size);
int (*buf_read)(void *dsc, void *buf, int size);
};
#endif /* !DRIVER_H */