|
GadgetSeed
0.9.6
|
デバイスドライバAPI [詳解]
#include "task/mutex.h"
データ構造 | |
| struct | st_device |
| デバイスドライバ構造体 [詳解] | |
マクロ定義 | |
| #define | DEF_DEV_NAME_INPUT "input" |
| #define | DEF_DEV_NAME_LED "led" |
| #define | DEF_DEV_NAME_EEPRMOM "eeprom" |
| #define | MAX_DEVNAMELRN 10 |
| #define | SEEK_SET 0 |
| 設定 | |
| #define | SEEK_CUR 1 |
| 現在値に加算 | |
| #define | SEEK_END 2 |
| ファイルサイズに加算 | |
関数 | |
| void | init_device_list (void) |
| デバイスドライバリストを初期化する | |
| int | device_num (void) |
| 登録されているデバイス数を取得する [詳解] | |
| const char * | device_name (int num) |
| デバイス名を取得する [詳解] | |
| const char * | device_explan (int num) |
| デバイス説明を取得する [詳解] | |
| int | register_device (const struct st_device *dev, char *param) |
| int | unregister_device (const struct st_device *dev) |
| デバイスを削除する [詳解] | |
| int | lock_device (struct st_device *dev, unsigned int timeout) |
| デバイスをロックする [詳解] | |
| int | unlock_device (struct st_device *dev) |
| デバイスをアンロックする [詳解] | |
| struct st_device * | open_device (char *name) |
| デバイスをオープンする [詳解] | |
| int | close_device (struct st_device *dev) |
| デバイスをクローズする [詳解] | |
| int | read_device (struct st_device *dev, void *buf, unsigned int count) |
| デバイスよりデータを読み出す [詳解] | |
| int | getc_device (struct st_device *dev, unsigned char *data) |
| デバイスよりデータを1バイト読み出す [詳解] | |
| int | write_device (struct st_device *dev, const void *buf, unsigned int count) |
| デバイスにデータを書き込む [詳解] | |
| int | putc_device (struct st_device *dev, unsigned char data) |
| デバイスにデータを1バイト書き込む [詳解] | |
| int | ioctl_device (struct st_device *dev, unsigned int com, unsigned int arg, void *param) |
| デバイスを制御する [詳解] | |
| int | seek_device (struct st_device *dev, int offset, int whence) |
| デバイスのアクセスポイントを設定する [詳解] | |
| int | block_read_device (struct st_device *dev, void *buf, unsigned int sector, unsigned int blkcount) |
| デバイスよりブロックデータを読み出す [詳解] | |
| int | block_write_device (struct st_device *dev, const void *buf, unsigned int sector, unsigned int blkcount) |
| デバイスにブロックデータを書き込む [詳解] | |
| int | sync_device (struct st_device *dev) |
| デバイスの書き込みデータの同期をとる [詳解] | |
| int | select_device (struct st_device *dev, unsigned int timeout) |
| デバイスのアクセス準備完了を待つ [詳解] | |
| int | suspend_device (struct st_device *dev) |
| デバイスを休止状態にする [詳解] | |
| int | resume_device (struct st_device *dev) |
| デバイスを活性化する [詳解] | |
| int | suspend (void) |
| 全デバイスを休止状態にする [詳解] | |
| int | resume (void) |
| 全デバイスを活性化する [詳解] | |
| int block_read_device | ( | struct st_device * | dev, |
| void * | buf, | ||
| unsigned int | sector, | ||
| unsigned int | blkcount | ||
| ) |
| int block_write_device | ( | struct st_device * | dev, |
| const void * | buf, | ||
| unsigned int | sector, | ||
| unsigned int | blkcount | ||
| ) |
| int close_device | ( | struct st_device * | dev | ) |
| const char* device_explan | ( | int | num | ) |
デバイス説明を取得する
| [in] | num | デバイス番号 |
参照先 st_device::explan, flg_init_task_run, GSC_KERNEL_MAX_DEVICE_NUM.
| const char* device_name | ( | int | num | ) |
デバイス名を取得する
| [in] | num | デバイス名 |
| int device_num | ( | void | ) |
| int getc_device | ( | struct st_device * | dev, |
| unsigned char * | data | ||
| ) |
| int ioctl_device | ( | struct st_device * | dev, |
| unsigned int | com, | ||
| unsigned int | arg, | ||
| void * | param | ||
| ) |
デバイスを制御する
| [in] | dev | デバイスドライバ |
| [in] | com | コマンド |
| [in] | arg | コマンド引数 |
参照元 clear_screen(), draw_fill_ellipse(), get_display_frame(), get_draw_frame(), get_kernel_time(), get_system_utime(), set_display_frame(), set_draw_frame(), start_timer(), stop_timer().

| int lock_device | ( | struct st_device * | dev, |
| unsigned int | timeout | ||
| ) |
| struct st_device* open_device | ( | char * | name | ) |
デバイスをオープンする
| [in] | name | デバイス名 |
参照先 GSC_KERNEL_MAX_DEVICE_NUM, strcomp().
参照元 init_graphics().


| int putc_device | ( | struct st_device * | dev, |
| unsigned char | data | ||
| ) |
| int read_device | ( | struct st_device * | dev, |
| void * | buf, | ||
| unsigned int | count | ||
| ) |
| int resume | ( | void | ) |
| int resume_device | ( | struct st_device * | dev | ) |
| int seek_device | ( | struct st_device * | dev, |
| int | offset, | ||
| int | whence | ||
| ) |
| int select_device | ( | struct st_device * | dev, |
| unsigned int | timeout | ||
| ) |
| int suspend | ( | void | ) |
| int suspend_device | ( | struct st_device * | dev | ) |
| int sync_device | ( | struct st_device * | dev | ) |
| int unlock_device | ( | struct st_device * | dev | ) |
| int unregister_device | ( | const struct st_device * | dev | ) |
デバイスを削除する
| [in] | dev | デバイスドライバ |
参照先 flg_init_task_run, GSC_KERNEL_MAX_DEVICE_NUM, st_device::mutex, mutex_unregister(), mutex_unregister_ISR().
