






|
 |
Developers
onHand Manual: wbios (C bindings)
Button input (key input)
- int bi_getbtn(void)
Reads a button from the button data buffer encoded in a word
(b7...Down/Right/Up/Left/Enter/El/Menu/Filer...b0; b15: Event)
- int bi_sensbtn(int *code)
If true, returns into code the next word waiting in the button data buffer
- int bi_scanbtn(void)
Read the button I/O ports and return actual status of the buttons encoded as
in bi_getbtn() but b15:Event always 0
- void bi_clrbtn()
Clears the button data buffer, discarding any ramaining keys
- void bi_chatpsbtn(int clk)
Sets the clock to (clk*16)Hz (default: clk=1) to prevent misunderstanding of
Filer/Menu/EL/Enter buttons because of chattering
- void bi_chatjkbtn(int clk)
Sets the clock to (clk*16)Hz (default: clk=1) to prevent misunderstanding of
cursor buttons because of chattering
Disk control
- int bi_secread(int drive,int head,int cyl,int
secno,int snum,void *rbuf)
Reads snum sectors into rbuf, returning the number of sectors actually read
- int bi_secwrite(int drive,int head,int cyl,int
secno,int snum,void *wbuf)
Writes snum sectors from wbuf, returning the number of sectors actually
written
- int bi_format(int drive,int level)
Formats drive (1=Flash) using the specified level (1=deletion only;2=write
check and deletion;3=write check,deletion and read check)
- int bi_getdrform(int drive,int *inf)
Returns drive information into inf (8bytes: maxCyl/maxHead/maxSect/SectorSize,
being sector size 0=128/1=256/2=512bytes)
- int bi_setdrform(int drive,int cyl,int hed,int
secnt,int secsize)
Sets format information of the specified drive, useful only as preamble of
formatting a drive
- int bi_wrflush(int drive)
Flush the write buffer of the specified drive (1=Flash). Must be called
after using dos_write()/dos_fwrite()
RS-232c (full duplex) and IR (half duplex) using XMODEM
protocol
- int bi_cominit(int comdev,int baud,int pulse,int
timeout)
Init the comm port (comdev: 0=none,1=SIR,2=RS-232,3=ASK,4=RC,5=SIRad,7=RC2)
- int bi_comopen(void)
Opens the communication device (powers it up)
- int bi_comclose(void)
Closes the communication device (powers it down)
- int bi_comwrite(char cdat)
Transmits the character in cdat
- int bi_complwrite(char *cdat,int clen,int *num)
Transmits clen characters from cdat; on failure puts into num the number of
characters not transmitted
- int bi_comread(char *cdat)
Receives a character and saves it into cdat. Drawing in the LCD during
reception is discouraged as its stops the receive interrupt
- int bi_complread(char *cdat,int clen)
Receives clen characters from cdat returning the number of characters
received
- int bi_complreadn(char *cdat,int clen,int *num)
Receives clen characters from cdat; on failure puts into num the number of
characters received
- int bi_comclr(void)
Clears the communication receive buffer of 150bytes
- int bi_comrnum(void)
Returns the number of characters waiting in the receive buffer
RTC
Timer
Sound
System control
Name
int bi_getbtn(void)
Synopsis
#include <wbios.h>
int bi_getbtn(void);
Description
Returns the button status and other misc info from the button data buffer
encoded in bits inside a word.
If no button presses or events waits in the button input buffer the function waits
until button input before returning.
The meaning of each bit follows:
- b0: K0 Filer/time button
- b1: K1 Menu button
- b2: K2 EL button
- b3: K3 ENTER button
- b4: K4 Cursor left
- b5: K5 Cursor up
- b6: K6 Cursor right
- b7: K7 Cursor down
- b8: TEST (not used)
- b9: Cell dismounted
- b10: RS-232 connected but idle
- b11: RS-232 connected
- b12: CPU multiplier (1=3.6Mhz, 0=1.8Mhz)
- b13: Reserved (always 0)
- b14: Reserved (always 0)
- b15: Event number at address 0xf080
If it is an event, b0..b7 are used to store the event number (which is in the
range 0-255).
Return values
Returns a word indicating the button status (see description).
Examples
(none)
Written with the information provided in the onHand
manuals. Copyleft by dario@softhome.net
This text is distributed under the GNU FDL. Last updated (dd/mm/yyyy):
21/10/2001
|