14 #define DEF_DEV_NAME_INPUT "input" // キーボード、ボタン等入力デバイス 15 #define DEF_DEV_NAME_LED "led" // LED等 16 #define DEF_DEV_NAME_EEPRMOM "eeprom" // EEPROM 18 #define MAX_DEVNAMELRN 10 31 int (* register_dev)(
struct st_device *dev,
char *param);
32 int (* unregister_dev)(
struct st_device *dev);
33 int (* lock)(
struct st_device *dev,
unsigned int timeout);
37 int (* read)(
struct st_device *dev,
void *buf,
unsigned int count);
38 int (* getc)(
struct st_device *dev,
unsigned char *buf);
39 int (* write)(
struct st_device *dev,
const void *buf,
unsigned int count);
40 int (* putc)(
struct st_device *dev,
unsigned char data);
41 int (* ioctl)(
struct st_device *dev,
unsigned int com,
unsigned int arg,
void *param);
42 int (* seek)(
struct st_device *dev,
int offset,
int whence);
43 int (* block_read)(
struct st_device *dev,
void *buf,
unsigned int sector,
unsigned int blkcount);
44 int (* block_write)(
struct st_device *dev,
const void *buf,
unsigned int sector,
unsigned int blkcount);
46 int (* select)(
struct st_device *dev,
unsigned int timeout);
55 extern int register_device(
const struct st_device *dev,
char *param);
74 extern int suspend(
void);
75 extern int resume(
void);
struct st_mutex * mutex
デバイス排他アクセス用MUTEX
int block_write_device(struct st_device *dev, const void *buf, unsigned int sector, unsigned int blkcount)
デバイスにブロックデータを書き込む
void init_device_list(void)
デバイスドライバリストを初期化する
struct st_device * open_device(char *name)
デバイスをオープンする
void * private_data
ドライバ固有データポインタ
int write_device(struct st_device *dev, const void *buf, unsigned int count)
デバイスにデータを書き込む
int read_device(struct st_device *dev, void *buf, unsigned int count)
デバイスよりデータを読み出す
const char * device_name(int num)
デバイス名を取得する
int seek_device(struct st_device *dev, int offset, int whence)
デバイスのアクセスポイントを設定する
int unregister_device(const struct st_device *dev)
デバイスを削除する
int resume_device(struct st_device *dev)
デバイスを活性化する
int sync_device(struct st_device *dev)
デバイスの書き込みデータの同期をとる
const char * device_explan(int num)
デバイス説明を取得する
int unlock_device(struct st_device *dev)
デバイスをアンロックする
int getc_device(struct st_device *dev, unsigned char *data)
デバイスよりデータを1バイト読み出す
int putc_device(struct st_device *dev, unsigned char data)
デバイスにデータを1バイト書き込む
int suspend_device(struct st_device *dev)
デバイスを休止状態にする
int device_num(void)
登録されているデバイス数を取得する
int select_device(struct st_device *dev, unsigned int timeout)
デバイスのアクセス準備完了を待つ
int close_device(struct st_device *dev)
デバイスをクローズする
int ioctl_device(struct st_device *dev, unsigned int com, unsigned int arg, void *param)
デバイスを制御する
char name[MAX_DEVNAMELRN]
デバイス名文字列
int block_read_device(struct st_device *dev, void *buf, unsigned int sector, unsigned int blkcount)
デバイスよりブロックデータを読み出す
int lock_device(struct st_device *dev, unsigned int timeout)
デバイスをロックする