Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //**************************************
- // AD変換用ビット操作ヘッダファイル1
- // ad.h
- // Ver.2.00
- // 2014/10/17
- //**************************************
- #include <sys/io.h>
- #define ADR_AD 0xec00 // デバイスの先頭アドレス
- int ad(int ch)
- {
- unsigned int al,ah,addat;
- outb(ch, ADR_AD + 0x00); // Channel切替
- while((inb(ADR_AD + 0x01)&0x80) == 0);
- al = inb(ADR_AD + 0x00); // 課題1
- ah = inb(ADR_AD + 0x01); // 課題1
- addat = ( ( ( ah & 0x0f )<<8 ) | al); // 課題1
- return(addat); // 0~4095を出力
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement