API of wbioslibmanu(asm)



bi_getbtn [O]   ... Gets a button input. 

    ***** Note *****
        Usually, use the Keyin(), EventCall() and EventExec() functions in the rupsys Library.

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=23
                D0(b8-b15): Function number=1h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

        Output: D1: Button code
                The bit corresponding to the input button goes ON.
                Multiple bits may go ON simultaneously.
                
             f e d c b a 9 8 7 6 5 4 3 2 1 0
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            | | | | | | | | | | | | | | | | |
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
             | | | | | | | | | | | | | | | | 
             | | | | | | | | | | | | | | | +-- K0 FILER/TIME button
             | | | | | | | | | | | | | | +---- K1 MENU button
             | | | | | | | | | | | | | +------ K2 EL button
             | | | | | | | | | | | | +-------- K3 ENTER button
             | | | | | | | | | | | +---------- K4 cursor pointer (Left key)
             | | | | | | | | | | +----------- K5 cursor pointer (Up key)
             | | | | | | | | | +-------------- K6 cursor pointer (Right key)
             | | | | | | | | +---------------- K7 cursor pointer (Down key)
             | | | | | | | |
             | | | | | | | +--- /TEST   Key input for inspection at shipment from factory
             | | | | | | +----- CHGSNS  Cell dismounted: 1 Cell mounted: 0
             | | | | | +------- RXD     RS-232C connected but idle: 1 Others: 0
             | | | | +--------- RXDL    RS-232C connected: 1 RS-232C not connected: 0
             | | | +----------- HCLK        CPU clock 3.6MHz: 1 CPU clock 1.8MH: 0
             | | +-------------         Always 0.
             | +---------------         Always 0.
             +----------------- EVENT   Event coded set at the event register 0xf080: 1
            (At event occurrence, an event number from 1 to 255 is set in b0-b7.)

    ***** Function ***** 
        Gets a code for the input button from the button data buffer.




Lib-Index   API-Index

bi_sensbtn [O]  ... Senses the button data buffer. 

    ***** Format *****
        Input:  D0(b-b7): Interrupt number=23
                D0(b8-b15): Function number=2h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

        Output: D1: Button code (Same as above)
                D2: 1:Button input 0:No button input

    ***** Function ***** 
        Returns the code of the first button in the button data buffer.
        No button data buffer changes.




Lib-Index   API-Index

bi_clrbtn [O]   ... Clears the button data buffer. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=23
                D0(b8-b15): Function number=3h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

        Output: None

    ***** Function ***** 
        Clears the button data buffer.




Lib-Index   API-Index

bi_chatpsbtn [O]    ... FILER/TIME, MENU, EL and ENTER buttons 

                               The clock is set to prevent input chattering.
    ***** Format *****
        Input:  D0(b0-b7): Interrupt number==23
                D0(b8-b15): Function number=4h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

                D1: Clock frequency to prevent chattering
                        0: 16Hz
                        1: 32Hz
                        2: 64Hz
                        3: 128Hz
                        4: 256Hz
                        5: 512Hz
                        6: 1024Hz
                        7: 2048Hz

        Output: None

    ***** Function ***** 
        Sets the clock frequency to prevent push button input chattering.




Lib-Index   API-Index

bi_chatjkbtn [O]    ... Sets the clock to prevent cursor pointer input chattering. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=23
                D0(b8-b15): Function number=5h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

                D1: Clock frequency to prevent chattering
                        0: 16Hz
                        1: 32Hz
                        2: 64Hz
                        3: 128Hz
                        4: 256Hz
                        5: 512Hz
                        6: 1024Hz
                        7: 2048Hz
        
        Output: None

    ***** Function *****
        Sets the clock frequency to prevent cursor pointer input chattering.




2. Disk Control
    The details (DI contents) of errors in the disk BIOS are as follows:
        0x0000      Normal termination
        0x0001      ROM disk address designation error (Parameter error)
        0x0003      Writing to the ROM disk
        0x0004      ROM disk area overflow (Parameter error)
        0x0010      Invalid drive designation
        0x0020      Invalid memory ID
        0x0030      Not formatted yet
        0x0040      No alternate block
        0x0050      I/O error
        0x0060      Parameter error (Target function number not found)
        0xFFFE      Voltage drop (This error occurred in writing to flash memory.  Writing itself completed.)
                    The error code 0xFFFE for voltage drop returns the value of normal termination.




Lib-Index   API-Index

bi_secread      ... Reads a sector. 

    ***** Note *****
        Usually, use the bi_vsecread() function in the rupsys Library.

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=24
                D0(b8-b15): Function number=1h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

                D1(b0-b7): Drive number=1h(Flash memory)
                D1(b8-b15): Head number=0-  )

                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  |  Head number     |  Drive number    |
                +------------------+------------------+------------------+

                D2(b0-b7): Cylinder number=0-  )
                D2(b8-b15):Sector number=1-  )
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  |  Sector number   | Cylinder number  |
                +------------------+------------------+------------------+

                A1: Number of sectors to be read
                A2: Read buffer address

        Output:
                D1: Error status(0 for normal output)
                D2: Number of read sectors

    ***** Function ***** 
        Reads the contents of the designated sector into the buffer.




Lib-Index   API-Index

bi_secwrite     ... Writes to a sector. 

    ***** Note *****
        Usually, use the bi_vsecwrite() function in the rupsys Library.

    ***** Format *****  int     bi_secread(secno, wbuf, errcode);
        Input:  D0(b0-b7): Interrupt number=24
                D0(b8-b15): Function number=2h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

                D1(b0-b7): Drive number=1h(Flash memory)
                D1(b8-b15): Head number=(0-  )

                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  |  Head number     |  Drive number    |
                +------------------+------------------+------------------+

                D2(b0-b7): Cylinder number=(0-  )
                D2(b8-b15): Sector number=(1-  )
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  |  Sector number   | Cylinder number  |
                +------------------+------------------+------------------+

                A1: Number of sectors to which data is written
                A2: Write buffer address

        Output:
                D1: Error status (0 for normal output)
                D2: Number of sectors to which data has been written

    ***** Function ***** 
        Writes the contents of the buffer to the designated sector.




Lib-Index   API-Index

bi_format   ... Formats the drive.                          ** Don't use this function usually ** 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=24
                D0(b8-b15): Function number=3h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

                D1: Drive number=1(Flash memory)
                D2: Format level
                        1: "Level 1" -   Only deletion 
                        2: "Level 2" -  a) 0 is written to all blocks, then read out for error check.
                                        b) Deletion
                        3: "Level 3" -  a) 0 is written to all blocks, then read out for error check.
                                        b) Deletion
                                        c) All blocks are checked to confirm that 0xff has been written after deletion.

        Output:
                D1: Error status (0 for normal output)

    ***** Function ***** 
        Formats the entire drive physically according to the defined format information.  
        Error check is made at each level.




Lib-Index   API-Index

bi_getdrform    ... Gets format information. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=24
                D0(b8-b15): Function number=4h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+
                D1: Drive number=1(Flash memory)

        Output:
                D1: Error status (0 for normal output)
                D2(b0-b7): Maximum head number=(number of heads - 1)
                D2(b8-b15): Maximum cylinder number =(number of cylinders - 1)
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  |  Cylinder number |  Head number     |
                +------------------+------------------+------------------+

                D3(b0-b7): Maximum sector number
                D3(b8-b15): Sector size=(0:128B  1:256B  2:512B)
                 23                 15                 7                   0
                +------------------+------------------+---------------------+
                |                  |   Sector size    |Maximum sector number|
                +------------------+------------------+---------------------+

    ***** Function ***** 
        Gets various format information about the drive.




Lib-Index   API-Index

bi_setdrform    ... Sets format information.            ** Don't use this function usually ** 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=24
                D0(b8-b15): Function number=5h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

                D1: Drive number=1(Flash memory)
                D2(b0-b7): Maximum head number=(number of heads - 1)
                D2(b8-b15): Maximum cylinder number=(number of cylinders - 1)

                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  |  Cylinder number |  Head number     |
                +------------------+------------------+------------------+

                D3(b0-b7): Maximum sector number
                D3(b8-b15): Sector size= (0:128B  1:256B  2:512B)
                 23                 15                 7                0
                +------------------+------------------+---------------------+
                |                  |  Sector size     |Maximum sector number|
                +------------------+------------------+---------------------+

        Output:
                D1: Error status (0 for normal output)

    ***** Function ***** 
        Sets format information for the drive.




Lib-Index   API-Index

bi_wrflush  ... Writes to the block cache buffer. 

    ***** Note *****
        Usually, use the bi_vwrflush() function in the rupsys Library.

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=24
                D0(b8-b15): Function number=0bh
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

                D1: Drive number=1(Flash memory)

        Output:
                D1: Error status (0 for normal output)

    ***** Function ***** 
        Holds flash memory block data.
        Writes the contents of the write cache buffer into the flash memory.




3. RS-232C, Ir
    Because the XMODEM protocol is used, the following settings must be made for communication.

    - Data length=8 bits
    - Stop bit=1 bit
    - Parity=None
    - Character flow control=None

    (The ASK system uses the odd parity.)
    When the Ir port is used, communication takes place in half duplex mode.




Lib-Index   API-Index

bi_cominit  ... Initializes the communication port. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=25
                D0(b8-b15): Function number=1h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+
                    
                D1: Communication system
                        0: None
                        1: SIR (Only the physical layer conforms to IrDA1.0.)
                        2: RS232C
                        3: ASK
                        4: Remote control (receiving filter not provided)
                        5: SIR adapter
                        7: Remote control 2 (receiving filter provided)
                        
                D2: Baud rate
                        1: 115200 bps
                        2:  57600 bps
                        3:  38400 bps
                        4:  19200 bps
                        5:   9600 bps
                        6:   4800 bps
                        7:   2400 bps
                        8:   1200 bps
                        9:    600 bps
                        10:   300 bps

                A1: Pulse width (effective only when SIR is selected for communication)
                        1: Sets a pulse width of 1.6usec.
                        2: Sets a pulse width of 3/16 bit.

                A2: Time-out value
                        0: Immediate return
                        0xffff: Timer not monitored
                        Others:Time-out value given in seconds

        Output:
                D1: Error status (0 for normal output)

    ***** Function ***** 
        Initializes the designated communication channel, and sets the baud rate, pulse width and time-out value.




Lib-Index   API-Index

bi_comopen      ... Opens the communication port. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=25
                D0(b8-b15): Function number=7h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

        Output:
                D1: 0: Normal termination   0xffff: Abnormal termination

    ***** Function ***** 
        Opens the communication port.
        This function is provided to save the cell capacitance.  When the communication port is used actually, this function is called before transmission or reception.  After this function has been used, the next bi_comclose function must be called.




Lib-Index   API-Index

bi_comclose     ... Closes the communication port. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=25
                D0(b8-b15): Function number=8h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

        Output:
                D1: 0: Normal termination   0xffff: Abnormal termination

    ***** Function ***** 
        Closes the communication port.




Lib-Index   API-Index

bi_comwrite     ... Transmits one character. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=25
                D0(b8-b15): Function number=2h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+
                D1: Transmission data

        Output:
                D1: 0           Normal termination
                     0xfffe     Voltage drop
                     0xffff     Abnormal termination

                D2: Status
                        b0: Overrun error           (0: None, 1: Found)
                        b1: Parity error            (0: None, 1: Found)
                        b2: Framing error           (0: None, 1: Found)
                        b3: Receive buffer overflow (0: None, 1: Found)
                        b4: Time-out                (0: None, 1: Found)
                        b5: Not open                (0: None, 1: Found)
                        b7: Received data           (0: None, 1: Found)

    ***** Function ***** 
        Writes one character to a selected communication device.




Lib-Index   API-Index

bi_comread      ... Receives one character. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=25
                D0(b8-b15): Function number=3h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

        Output:
                D1: 0: Normal termination   0xffff: Abnormal termination
                D2: Received data
                D3: Status
                        b0: Overrun error           (0: None, 1: Found)
                        b1: Parity error            (0: None, 1: Found)
                        b2: Framing error           (0: None, 1: Found)
                        b3: Receive buffer overflow (0: None, 1: Found)
                        b4: Time-out                (0: None, 1: Found)
                        b5: Not open                (0: None, 1: Found)
                        b7: Received data           (0: None, 1: Found)

    ***** Function ***** 
        Reads one character from a selected communication device.




Lib-Index   API-Index

bi_complread        ... Receives multiple characters. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=25
                D0(b8-b15): Function number=4h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

                D1: Number of characters    
                A1: Receive buffer address
        Output:
                D1: 0: Normal termination   0xffff: Abnormal termination
                D2: Number of actually received characters
                D3: Status
                        b0: Overrun error           (0: None, 1: Found)
                        b1: Parity error            (0: None, 1: Found)
                        b2: Framing error           (0: None, 1: Found)
                        b3: Receive buffer overflow (0: None, 1: Found)
                        b4: Time-out                (0: None, 1: Found)
                        b5: Not open                (0: None, 1: Found)
                        b7: Received data           (0: None, 1: Found)

    ***** Function ***** 
        Reads a specified number of characters from a selected communication device.




Lib-Index   API-Index

bi_comclr[O]    ... Initializes the receive buffer. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=25
                D0(b8-b15): Function number=5h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

        Output:
                D1: 0: Normal termination   0xffff: Abnormal termination

    ***** Function ***** 
        Initializes the receive buffer.




Lib-Index   API-Index

bi_comrnum [O]  ... Gets the number of received characters. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=25
                D0(b8-b15): Function number=6h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

        Output:
                D1: 0: Normal termination   0xffff: Abnormal termination
                D2: Number of received characters

    ***** Function ***** 
        Gets the number of characters remaining in the receive buffer.




Lib-Index   API-Index

bi_complwrite       ... Transmits multiple characters. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=25
                D0(b8-b15): Function number=9h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

                D1: Number of characters
                A1: Transmit buffer address
        Output:
                D1: 0: Normal termination   0xffff: Abnormal termination
                D2: Number of remaining characters (number of characters that could not be transmitted)
                D3:  Status
                        b0: Overrun error           (0: None, 1: Found)
                        b1: Parity error            (0: None, 1: Found)
                        b2: Framing error           (0: None, 1: Found)
                        b3: Receive buffer overflow (0: None, 1: Found)
                        b4: Time-out                (0: None, 1: Found)
                        b5: Not open                (0: None, 1: Found
                        b7: Received data           (0: None, 1: Found)

    ***** Function ***** 
        Writes a specified number of characters to a selected communication device.




4. RTC
Lib-Index   API-Index

bi_tmread   ... Reads the time. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=26
                D0(b8-b15): Function number=1h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

        Output:
                D1: 0:Normal termination    0xffff: Abnormal termination
                D2: Hour (BCD)
                D3: Minute (BCD)
                A1: Second (BCD)

    ***** Function ***** 
        Reads the current time (hour, minute and second).




Lib-Index   API-Index

bi_tmwrite  ... Writes the time. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=26
                D0(b8-b15): Function number=2h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

                D1: Hour (BCD)
                D2: Minute (BCD)
                D3: Second (BCD)

        Output:
                D1: 0: Normal termination   0xffff: Abnormal termination

    ***** Function ***** 
        Sets the current time (hour, minute and second).




Lib-Index   API-Index

bi_dtread   ... Reads the date. 

    ***** Format *****
        Input]: D0(b0-b7): Interrupt number=26
                D0(b8-b15): Function number=3h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

        Output:
                D1: 0: Normal termination   0xffff: Abnormal termination
                D2: Year (BCD)
                D3: Month (BCD)
                A1: Day (BCD)

    ***** Function ***** 
        Reads the current date (year, month and day).




Lib-Index   API-Index

bi_dtwrite  ... Writes the date. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=26
                D0(b8-b15): Function number=4h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

                D1: Year (BCD)
                D2: Month (BCD)
                D3: Day (BCD)

        Output:
                D1: 0: Normal termination   0xffff: Abnormal termination

    ***** Function ***** 
        Sets the current date (year, month and day).




5. Timer

Lib-Index   API-Index

bi_tmset ... Sets the timer. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=28
                D0(b8-b15): Function number=1h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+
                D1(b0-b7): Type of timer
                            0: 1Hz timer
                            1: 4Hz timer
                            2: 64Hz timer
                D1(b8-b15): Priority
                            0: Highest (255: Searches for the top of free timers.)
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  |  Priority        | Type of timer    |
                +------------------+------------------+------------------+

                D2: Timer count
                A1: Timer routine address
        Output:
                D1: 0: Normal termination, 1: No free timer (Priority=255)
                A0: Timer control table address

    ***** Function ***** 
        Calls he func function when the time specified in cnt has elapsed.
        Because the timer routine is called as a 1Hz, 64Hz or 4Hz interrupt handler subroutine, it asynchronously operates in parallel with the normal program.
        For this reason, system calls from the timer routine and some of the BIOS calls (without the mark [O]) cannot be issued.
        When there is already the same priority, it is overwritten.




Lib-Index   API-Index

bi_tmdel [O]  ... Sets the timer. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=28
                D0(b8-b15): Function number=2h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+
                A0: Timer control table address

        Output:
                D1: 0: Normal termination, Others: Abnormal termination
                (Always terminates normally.)




6. Others
Lib-Index   API-Index

bi_reboot [O]   ... Reboot 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=29
                D0(b8-b15): Function number=1h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

        Output:
                None

    ***** Function ***** 
        Reboots the system.  This function does not return control to the calling program.




Lib-Index   API-Index

bi_buzzinit ... Initializes the buzzer. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=29
                D0(b8-b15): Function number=Bh
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

                D1: Volume
                        2(small)- 9(large)
                D2: Tempo

        Output:
                None

    ***** Function ***** 
        Designates the tempo and volume of the bi_buzzer and bi_melody functions to be called later.




Lib-Index   API-Index

bi_buzzer   ... Beeps the buzzer once. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=29
                D0(b8-b15): Function number=2h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

                D1: Musical note
                        0(A1#)-86(C9)
                D2: Musical note length
                        b3-b0   Musical note length (0=16, 1=1, 2=2 ,...., 15=15)
                        b7-b4   Envelope  0000  Pause
                                          0011  3/4 note (without envelope)
                                          0100  4/4 note (without envelope)
										  else  with envelope

        Output:
                D1: 0: Normal termination   0xfffe: Voltage drop

    ***** Function ***** 
        Sets the frequency (scale number) and beeps the buzzer with the volume specified in bi_buzzinit in the following duration (time).

                Time = tempo * length / 64 (second)

        Where tempo is the value specified in bi_buzzinit.
        Control does not return to the calling program unless the buzzer terminates beeping.




Lib-Index   API-Index

bi_melody   ... Plays the melody. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=29
                D0(b8-b15): Function number=eh
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+
                A0: Melody table address
                    Melody addresses placed in bytes (b15-b8: musical note length, b7-b0: musical note word data) according to the scale number (0-86) and musical note length (musical note length + envelope).
                    0xffff must be placed at the end.
                    Refer to bi_buzzer for the musical note and musical note length.

        Output:
                None

    ***** Function ***** 
        Plays multiple musical notes continuously as a melody.
        This function returns control to the calling program immediately.  To synchronize with the calling program, this function increments a one-word area at the address 0xf27c each time it plays one musical note, and sets this area to 0cffff after playing all musical notes.  In addition, when detecting a voltage drop during a play, this function sets 0xfffe and stops the play immediately.  The melody table must be held by the calling program until processing terminates.



Lib-Index   API-Index

bi_canmelody    ... Forcibly terminates the melody play. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=29
                D0(b8-b15): Function number=fh
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

        Output:
                None

    ***** Function ***** 
        Forcibly stops the current melody play.  Even after control returns to the calling program, melody play may continue.  To synchronize with actual stop, the contents at the address 0xf27c must be used for confirmation.  In this case, 0xffe (voltage drop) is always set in the address 0xf27c.




Lib-Index   API-Index

bi_cpususp  ... Stops the CPU. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=29
                D0(b8-b15): Function number=3h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

        Output:
                None

    ***** Function ***** 
        Stops or halts the CPU.




Lib-Index   API-Index

bi_powerread [O]    ... Reads a supply voltage. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=29
                D0(b8-b15): Function number=5h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

        Output:
                D1: 0-255  Value obtained from the A/D converter (256 or more: error)

    ***** Function ***** 
        Reads a supply voltage.
        When this function has already been called by the other program, a value of 255 is returned forcibly.

    ***** Tips ***** 
        Relation between the A/D values and supply voltage (ambient temperature)
            Supply voltage [V]: 7.0  6.5  6.0  5.5  5.0  4.5  4.0
            A/D value         : 169  151  135  118  102   85   70

            Supply voltage [V]: 3.8  3.6  3.5  3.4  3.3  3.2  3.1  3.0 
            A/D value         :  63   60   57   55   53   51   50   48 




Lib-Index   API-Index

bi_powerread2 [O]   ... Reads a supply voltage with a heavy load. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=29
                D0(b8-b15): Function number=10h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

        Output:
                D1: 0-255   Value obtained from the A/D converter (266 or more: error)

    ***** Function ***** 
        Sets a dummy heavy load and reads a supply voltage.
        When this function has already been called by the other program, a value of 255 is returned forcibly.
    ***** Tips ***** 
        Relation between the A/D values and supply voltages (ambient temperature)
            Supply voltage [V]: 7.0  6.5  6.0  5.5  5.0  4.5  4.0
            A/D value         : 169  151  135  118  102   85   70

            Supply voltage [V]: 3.8  3.6  3.5  3.4  3.3  3.2  3.1  3.0 
            A/D value         :  63   60   57   55   53   51   50   48 




Lib-Index   API-Index

bi_current  ... Reads the charging/discharging current.                     ** Don't use this function usually ** 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=29
                D0(b8-b15): Function number=ch
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

        Output:
                D1: 0-255  Value obtained form the A/D converter (266 or more: error)

    ***** Function ***** 
        Reads the charging/discharging current.




Lib-Index   API-Index

bi_getpower     ... Gets the charging/discharging count value. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=29
                D0(b8-b15): Function number=8h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

        Output:
                D1: Charging/discharging count value (lower 16 bits)
                D2: Charging/discharging count value (upper 16 bits)

    ***** Function ***** 
        Subtrats the consumption current for various loads from the value counted during charging to obtain the remaining cell capacitance, then returns the value indicating the current it as the current cell capacitance.




Lib-Index   API-Index

bi_setpower ... Sets the charging/discharging count value.              ** Don't use this function usually ** 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=29
                D0(b8-b15): Function number=dh
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+
                D1: Charging/discharging count value (lower 16 bits)
                D2: Charging/discharging count value (upper 16 bits)

        Output:
                None

    ***** Function ***** 
        Sets the charging/discharging count value.




Lib-Index   API-Index

bi_el       ... Lights or lights out the EL. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=29
                D0(b8-b15): Function number=Ah
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+
                D1: Light time (0-20: second)
                    If 0 is specified, the LE is lit out forcibly.

        Output:
                None

    ***** Function ***** 
        Lights the EL in the duration specified in sec.  Control returns to the calling program immediately (regardless of the EL light-out time).




Lib-Index   API-Index

bi_27Verror ... Checks a cell voltage. 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=29
                D0(b8-b15): Function number=11h
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

        Output:
                D1:  1: Low voltage detected    0: Low voltage not detected

    ***** Function ***** 
        Checks a low voltage where a heavy load is inhibited.  This voltage (3.9V) is usually managed by BIOS.




Lib-Index   API-Index

bi_intvect [O]  ... Sets or gets an interrupt vector. 

    ***** Format *****
        Input:  D0(b0-b7):  Interrupt number=21
                D0(b8-b14): Number of interrupt vector to be set or got
                D0(b15):   0=Read  1=Set
                A0: Handling routine address (for setting the interrupt vector)

        Output:
                A0: Handling routine address (for reading the interrupt vector)

    ***** Function ***** 
        Sets the interrupt vector.




Lib-Index   API-Index

bi_sysread      ... Reads the system area.          ** Don't use this function usually ** 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=24
                D0(b8-b15): Function number=dh
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

                D1: Drive number=1 (Flash memory)
                A2: Read buffer address

        Output:
                D1: Error status (0 for normal output)

    ***** Function ***** 
        Reads the contents (512 bytes fixed) of the system area into the buffer.




Lib-Index   API-Index

bi_syswrite     ... Writes to the system area.          ** Don't use this function usually ** 

    ***** Format *****
        Input:  D0(b0-b7): Interrupt number=24
                D0(b8-b15): Function number=eh
                 23                 15                 7                0
                +------------------+------------------+------------------+
                |                  | Function number  | Interrupt number |
                +------------------+------------------+------------------+

                D1: Drive number=1 (Flash memory)
                A2: Write buffer address

        Output:
                D1: Error status (0 for normal output)

    ***** Function ***** 
        Writes the contents (512 bytes fixed) of the buffer into the system area of the flash memory, and also updates the contents of SRAM for three kinds of data: low voltage inhibiting a heavy load, accounting and scale.

===============================================================================
 Copyright (c) 1998-1999.  Seiko Instruments Inc.  All rights reserved. 
===============================================================================
Lib-Index   API-Index