fix doc format
This commit is contained in:
parent
7fce58e481
commit
bf6a5efd7e
@ -294,7 +294,7 @@ ALIASES = "modifies=\par Modifies Registers^^" \
|
|||||||
"macro=\qualifier macro \brief" \
|
"macro=\qualifier macro \brief" \
|
||||||
"function=\qualifier subroutine \brief" \
|
"function=\qualifier subroutine \brief" \
|
||||||
"module=\file ^^ \brief" \
|
"module=\file ^^ \brief" \
|
||||||
"clock_dependant=\xrefitem clock_dependant \"Clock Speed Dependance\" \"Clock frequency dependant code\""
|
"clock_dependent=\xrefitem clock_dependant \"Clock Speed Dependence\" \"Clock speed dependent code\""
|
||||||
|
|
||||||
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
|
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
|
||||||
# only. Doxygen will then generate output that is more tailored for C. For
|
# only. Doxygen will then generate output that is more tailored for C. For
|
||||||
|
@ -65,3 +65,8 @@
|
|||||||
;;
|
;;
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
|
|
||||||
|
;;********************************************************************************
|
||||||
|
;; @defgroup system
|
||||||
|
;; @brief Core code
|
||||||
|
;;
|
||||||
|
;;********************************************************************************
|
||||||
|
@ -11,7 +11,7 @@ INCLUDE_MEMCOPY = 1
|
|||||||
;; @param ARG0-1: Source address
|
;; @param ARG0-1: Source address
|
||||||
;; @param ARG2-3: Target address
|
;; @param ARG2-3: Target address
|
||||||
;; @param Y: Number of bytes to copy
|
;; @param Y: Number of bytes to copy
|
||||||
;; @modifies: A,Y
|
;; @modifies A,Y
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
.proc memcopy
|
.proc memcopy
|
||||||
cpy #0
|
cpy #0
|
||||||
@ -31,7 +31,7 @@ INCLUDE_MEMCOPY = 1
|
|||||||
;; @param ARG0-1: Source address
|
;; @param ARG0-1: Source address
|
||||||
;; @param ARG2-3: Target address
|
;; @param ARG2-3: Target address
|
||||||
;; @param ARG5-6: Number of bytes to copy (LE)
|
;; @param ARG5-6: Number of bytes to copy (LE)
|
||||||
;; @modifies: A,Y
|
;; @modifies A,Y
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
.proc memcopy16
|
.proc memcopy16
|
||||||
lda ARG6
|
lda ARG6
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
;; @param ARG0-1: Address of the string to print
|
;; @param ARG0-1: Address of the string to print
|
||||||
;; @param x: time to sleep in centiseconds
|
;; @param x: time to sleep in centiseconds
|
||||||
;; @ingroup applications
|
;; @ingroup applications
|
||||||
;; @clock_dependant
|
;; @clock_dependent
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
.proc print_slow
|
.proc print_slow
|
||||||
ldy #$00
|
ldy #$00
|
||||||
|
@ -9,7 +9,7 @@ scancode: .res 1
|
|||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
;; @function Initialize the keyboard handler
|
;; @function Initialize the keyboard handler
|
||||||
;; @returns Z: Z = 1 => success, Z = 0 => failure
|
;; @returns Z: Z = 1 => success, Z = 0 => failure
|
||||||
;; @details:
|
;; @details
|
||||||
;; Initializes the PS/2 keyboard driver and the handler.
|
;; Initializes the PS/2 keyboard driver and the handler.
|
||||||
;; If any PS/2 command fails, init returns with Z = 0. The failed command (and parameter) can be loaded from `ps2kb::send_cmd` and `ps2kb::send_data`
|
;; If any PS/2 command fails, init returns with Z = 0. The failed command (and parameter) can be loaded from `ps2kb::send_cmd` and `ps2kb::send_data`
|
||||||
;; After init, the keyboard will be able to send scancodes.
|
;; After init, the keyboard will be able to send scancodes.
|
||||||
|
@ -19,7 +19,7 @@ keycode: .res 1
|
|||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
;; @function Initialize the keyboard handler
|
;; @function Initialize the keyboard handler
|
||||||
;; @returns Z: Z = 1 => success, Z = 0 => failure
|
;; @returns Z: Z = 1 => success, Z = 0 => failure
|
||||||
;; @details:
|
;; @details
|
||||||
;; Initializes the PS/2 keyboard driver and the handler.
|
;; Initializes the PS/2 keyboard driver and the handler.
|
||||||
;; If any PS/2 command fails, init returns with Z = 0. The failed command (and parameter) can be loaded from `ps2kb::send_cmd` and `ps2kb::send_data`
|
;; If any PS/2 command fails, init returns with Z = 0. The failed command (and parameter) can be loaded from `ps2kb::send_cmd` and `ps2kb::send_data`
|
||||||
;; After init, the keyboard will be able to send scancodes.
|
;; After init, the keyboard will be able to send scancodes.
|
||||||
@ -232,7 +232,7 @@ update_leds:
|
|||||||
;; @details
|
;; @details
|
||||||
;; Unset modifier bits if a mod key is released.
|
;; Unset modifier bits if a mod key is released.
|
||||||
;; @param X: The scancode
|
;; @param X: The scancode
|
||||||
;; @modifies:
|
;; @modifies
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
.proc break_key
|
.proc break_key
|
||||||
; rmb kb::PREVIOUS::BREAK, kb::previous_scancode
|
; rmb kb::PREVIOUS::BREAK, kb::previous_scancode
|
||||||
|
@ -9,9 +9,9 @@
|
|||||||
;; @details
|
;; @details
|
||||||
;; Interrupts might change the actual time to finish
|
;; Interrupts might change the actual time to finish
|
||||||
;; To be exact, time_cs is in units of 0.010244s
|
;; To be exact, time_cs is in units of 0.010244s
|
||||||
;; @modifies: ARG15
|
;; @modifies ARG15
|
||||||
;; @ingroup applications
|
;; @ingroup applications
|
||||||
;; @clock_dependant
|
;; @clock_dependent
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
.proc sleep
|
.proc sleep
|
||||||
_VAR_1 = ARG15
|
_VAR_1 = ARG15
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
;; @file
|
;; @file
|
||||||
;; @details:
|
;; @details
|
||||||
;; This code is loaded to the computer via a SPI interface
|
;; This code is loaded to the computer via a SPI interface
|
||||||
;; Currently, it must be loaded to $5000, where the main loop will begin
|
;; Currently, it must be loaded to $5000, where the main loop will begin
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
|
@ -1,16 +1,20 @@
|
|||||||
;********************************************************************************
|
;;********************************************************************************
|
||||||
; @module ringbuffer
|
;; @module ringbuffer
|
||||||
; @type utility
|
;; @details
|
||||||
; @details
|
;; Size of the ringbuffer is RBUF_MEM_END - RBUF_MEM_START - 2, since two bytes
|
||||||
; Size of the ringbuffer is RBUF_MEM_END - RBUF_MEM_START - 2, since two bytes
|
;; are used by the read and write pointer
|
||||||
; are used by the read and write pointer
|
;; The `RBUF_NAME` variable must be defined, the functions will then be exported
|
||||||
; The RBUF_NAME variable must be defined, the functions will then be exported
|
;; as `rb_<RBUF_NAME>_<function>` where `<function>` = `init`, `read` or `write`
|
||||||
; as rb_<RBUF_NAME>_<function> where <function> = init, read or write
|
;;
|
||||||
; @requires
|
;; @note
|
||||||
; RBUF_MEM_START: First address of ringbuffer memory space
|
;; Doxygen can not generate proper documentation for this module, because
|
||||||
; RBUF_MEM_END: Last address of ringbuffer memory space
|
;; all names are defined using macros
|
||||||
; RBUF_NAME: Name of the ringbuffer
|
;; @requires
|
||||||
;********************************************************************************
|
;; RBUF_MEM_START: First address of ringbuffer memory space
|
||||||
|
;; RBUF_MEM_END: Last address of ringbuffer memory space
|
||||||
|
;; RBUF_NAME: Name of the ringbuffer
|
||||||
|
;; @ingroup utility
|
||||||
|
;;********************************************************************************
|
||||||
.code
|
.code
|
||||||
|
|
||||||
.ifndef RBUF_MEM_START
|
.ifndef RBUF_MEM_START
|
||||||
@ -36,9 +40,9 @@ RB_LENGTH = RBUF_MEM_END - RBUF_MEM_START - 2
|
|||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
|
||||||
;********************************************************************************
|
;;********************************************************************************
|
||||||
; @function Initialize the buffer
|
;; @function Initialize the buffer
|
||||||
;********************************************************************************
|
;;********************************************************************************
|
||||||
.ident(.concat(_RBUF_NAME, "_init")):
|
.ident(.concat(_RBUF_NAME, "_init")):
|
||||||
.scope
|
.scope
|
||||||
stz RB_WRITE
|
stz RB_WRITE
|
||||||
@ -46,13 +50,13 @@ RB_LENGTH = RBUF_MEM_END - RBUF_MEM_START - 2
|
|||||||
rts
|
rts
|
||||||
.endscope
|
.endscope
|
||||||
|
|
||||||
;********************************************************************************
|
;;********************************************************************************
|
||||||
; @function Read a value from the buffer
|
;; @function Read a value from the buffer
|
||||||
; @details
|
;; @details
|
||||||
; If there is no value to be read, the Pz will be set
|
;; If there is no value to be read, the Pz will be set
|
||||||
; @returns A: value
|
;; @returns A: value
|
||||||
; @modifies: A, X
|
;; @modifies A, X
|
||||||
;********************************************************************************
|
;;********************************************************************************
|
||||||
.ident(.concat(_RBUF_NAME, "_read")):
|
.ident(.concat(_RBUF_NAME, "_read")):
|
||||||
.scope
|
.scope
|
||||||
ldx RB_READ
|
ldx RB_READ
|
||||||
@ -72,11 +76,11 @@ RB_LENGTH = RBUF_MEM_END - RBUF_MEM_START - 2
|
|||||||
rts
|
rts
|
||||||
.endscope
|
.endscope
|
||||||
|
|
||||||
;********************************************************************************
|
;;********************************************************************************
|
||||||
; @function Write a value to the buffer
|
;; @function Write a value to the buffer
|
||||||
; @param A: value to store
|
;; @param A: value to store
|
||||||
; @modifies: X
|
;; @modifies X
|
||||||
;********************************************************************************
|
;;********************************************************************************
|
||||||
.ident(.concat(_RBUF_NAME, "_write")):
|
.ident(.concat(_RBUF_NAME, "_write")):
|
||||||
.scope
|
.scope
|
||||||
; lda kp_VALUES, x ; load the char in a
|
; lda kp_VALUES, x ; load the char in a
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
;; @module IO-W65C22
|
;; @module IO-W65C22
|
||||||
;; @type utility
|
;; @ingroup system
|
||||||
;; @device Western Design - W65C22N Versatile Interface Adapter
|
;; @device Western Design - W65C22N Versatile Interface Adapter
|
||||||
;; @details
|
;; @details
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
@ -139,7 +139,7 @@ INCLUDE_IOW65C22 = 1
|
|||||||
|
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
;; @macro Enable an interrupt source
|
;; @macro Enable an interrupt source
|
||||||
;; @modifies: A
|
;; @modifies A
|
||||||
;; @param flag: A flag of the interrupt flag register (IO::IRQ)
|
;; @param flag: A flag of the interrupt flag register (IO::IRQ)
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
.macro IO_EnableIRQ ioaddr, flag
|
.macro IO_EnableIRQ ioaddr, flag
|
||||||
@ -148,7 +148,7 @@ INCLUDE_IOW65C22 = 1
|
|||||||
.endmacro
|
.endmacro
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
;; @macro Disable an interrupt source
|
;; @macro Disable an interrupt source
|
||||||
;; @modifies: A
|
;; @modifies A
|
||||||
;; @param flag: A flag of the interrupt flag register (IO::IRQ)
|
;; @param flag: A flag of the interrupt flag register (IO::IRQ)
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
.macro IO_DisableIRQ ioaddr, flag
|
.macro IO_DisableIRQ ioaddr, flag
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
;; @module irq_handler
|
;; @module WIP irq handler with jump tables and stuff
|
||||||
;; @type system
|
;; @ingroup system
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
.ifndef INCLUDE_IRQ_HANDLER
|
.ifndef INCLUDE_IRQ_HANDLER
|
||||||
INCLUDE_IRQ_HANDLER = 1
|
INCLUDE_IRQ_HANDLER = 1
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
;; @module keypad4x4
|
;; @module keypad4x4
|
||||||
;; @type driver
|
|
||||||
;; @device 4x4 Matrix Keypad
|
;; @device 4x4 Matrix Keypad
|
||||||
;; @details
|
;; @details
|
||||||
;; The LCD must be connected to a W65C22N Interface Chip:
|
;; The LCD must be connected to a W65C22N Interface Chip:
|
||||||
;; - IO.RA0-7 ->
|
;; - IO.RA0-7 ->
|
||||||
;; @requires KP_IO: Base Address of IO Chip
|
;; @requires KP_IO: Base Address of IO Chip
|
||||||
;; @depends IO-W65C22N
|
;; @depends IO-W65C22N
|
||||||
|
;; @ingroup drivers
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
.ifndef INCLUDE_KEYPAD
|
.ifndef INCLUDE_KEYPAD
|
||||||
INCLUDE_KEYPAD = 1
|
INCLUDE_KEYPAD = 1
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
;; @module LCD-W164B
|
;; @module LCD-W164B
|
||||||
;; @ingroup driver
|
;; @ingroup drivers
|
||||||
;; @device ELECTRONIC ASSEMBLY - W164B-NLW
|
;; @device ELECTRONIC ASSEMBLY - W164B-NLW
|
||||||
;; @details
|
;; @details
|
||||||
;; The LCD must be connected to a W65C22N Interface Chip:
|
;; The LCD must be connected to a W65C22N Interface Chip:
|
||||||
@ -18,7 +18,7 @@ INCLUDE_LCD = 1
|
|||||||
|
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
;; @brief LCD character display
|
;; @brief LCD character display
|
||||||
;; @ingroup driver
|
;; @ingroup drivers
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
.scope lcd
|
.scope lcd
|
||||||
LCD_IO = IO1
|
LCD_IO = IO1
|
||||||
|
@ -45,7 +45,7 @@ _charcount: .res 1
|
|||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
;; @function Set the cursor to a position
|
;; @function Set the cursor to a position
|
||||||
;; @param A: cursor position: `(lcd::LINEX + offset)`, where offset € [$0, $f]
|
;; @param A: cursor position: `(lcd::LINEX + offset)`, where offset € [$0, $f]
|
||||||
;; @details:
|
;; @details
|
||||||
;; If the position is too large, it will be set to char 4 in line 2
|
;; If the position is too large, it will be set to char 4 in line 2
|
||||||
;; @returns A: the cursor position
|
;; @returns A: the cursor position
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
@ -109,7 +109,7 @@ _charcount: .res 1
|
|||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
;; @function Print a null-terminated string
|
;; @function Print a null-terminated string
|
||||||
;; @param ARG0-1 Address of the string to print
|
;; @param ARG0-1 Address of the string to print
|
||||||
;; @modifies: A,Y
|
;; @modifies A,Y
|
||||||
;; @returns Y: Length of the string
|
;; @returns Y: Length of the string
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
.proc print
|
.proc print
|
||||||
@ -143,7 +143,7 @@ _charcount: .res 1
|
|||||||
;; @param A: The ASCII code: 0-7
|
;; @param A: The ASCII code: 0-7
|
||||||
;; @param ARG0-1: Start address of the 8 bytes describing the character
|
;; @param ARG0-1: Start address of the 8 bytes describing the character
|
||||||
;; @returns: C: 0 => success, 1 => invalid argument
|
;; @returns: C: 0 => success, 1 => invalid argument
|
||||||
;; @modifies: A,Y
|
;; @modifies A,Y
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
.proc set_custom_char
|
.proc set_custom_char
|
||||||
cmp #8
|
cmp #8
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
;; @module ps2_keyboard
|
;; @module ps2_keyboard
|
||||||
;; @ingroup drivers
|
;; @ingroup drivers
|
||||||
;; @details:
|
;; @details
|
||||||
;; Support for a PS2 Keyboard using the shift register of a 6522 VIA
|
;; Support for a PS2 Keyboard using the shift register of a 6522 VIA
|
||||||
;; @section reading Reading a scancode/command answer
|
;; @section reading Reading a scancode/command answer
|
||||||
;; Pressing a key causes 11 bits to be sent: 1 start - 8 scancode - 1 parity - 1 stop
|
;; Pressing a key causes 11 bits to be sent: 1 start - 8 scancode - 1 parity - 1 stop
|
||||||
@ -49,7 +49,7 @@ VIA = IO1
|
|||||||
;; Calculate the appropriate value using: @f$ N_\text{cycles} = 230 \times f_\text{in MHZ} @f$
|
;; Calculate the appropriate value using: @f$ N_\text{cycles} = 230 \times f_\text{in MHZ} @f$
|
||||||
;; - 230 \@ 1MHz
|
;; - 230 \@ 1MHz
|
||||||
;; - 400 \@ 1.84 MHz
|
;; - 400 \@ 1.84 MHz
|
||||||
;; @clock_dependant
|
;; @clock_dependent
|
||||||
TIMER_RECV = 400
|
TIMER_RECV = 400
|
||||||
;; @brief #clock cycles to wait after loading the SR a second time while sending a command to the keyboard
|
;; @brief #clock cycles to wait after loading the SR a second time while sending a command to the keyboard
|
||||||
;; @details
|
;; @details
|
||||||
@ -61,7 +61,7 @@ TIMER_RECV = 400
|
|||||||
;; Values that seem to work:
|
;; Values that seem to work:
|
||||||
;; - 230 \@ 1MHz
|
;; - 230 \@ 1MHz
|
||||||
;; - 400 \@ 1.84 MHz
|
;; - 400 \@ 1.84 MHz
|
||||||
;; @clock_dependant
|
;; @clock_dependent
|
||||||
TIMER_SEND = 400
|
TIMER_SEND = 400
|
||||||
|
|
||||||
PULL_REG = IO::RANH
|
PULL_REG = IO::RANH
|
||||||
|
@ -25,7 +25,7 @@ scancode_handler: .res 2 ;; pointer to a function that handles new scanco
|
|||||||
; these are macros and not subroutines to save time during the interrupt handler (no jsr, rts)
|
; these are macros and not subroutines to save time during the interrupt handler (no jsr, rts)
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
;; @macro Enable the clock signal from the keyboard
|
;; @macro Enable the clock signal from the keyboard
|
||||||
;; @modifies: A
|
;; @modifies A
|
||||||
;; @details
|
;; @details
|
||||||
;; Stop pulling the keyboards clock low
|
;; Stop pulling the keyboards clock low
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
@ -38,7 +38,7 @@ scancode_handler: .res 2 ;; pointer to a function that handles new scanco
|
|||||||
|
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
;; @macro Disable the clock signal from the keyboard
|
;; @macro Disable the clock signal from the keyboard
|
||||||
;; @modifies: A
|
;; @modifies A
|
||||||
;; @details
|
;; @details
|
||||||
;; Pulls the keyboards clock low
|
;; Pulls the keyboards clock low
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
@ -56,7 +56,7 @@ scancode_handler: .res 2 ;; pointer to a function that handles new scanco
|
|||||||
|
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
;; @macro Stop pulling the keyboard data pin low
|
;; @macro Stop pulling the keyboard data pin low
|
||||||
;; @modifies: A
|
;; @modifies A
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
.macro _StopPullDataLow
|
.macro _StopPullDataLow
|
||||||
; set pin to input
|
; set pin to input
|
||||||
@ -67,7 +67,7 @@ scancode_handler: .res 2 ;; pointer to a function that handles new scanco
|
|||||||
|
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
;; @macro Pull the keyboard data pin low
|
;; @macro Pull the keyboard data pin low
|
||||||
;; @modifies: A
|
;; @modifies A
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
.macro _PullDataLow
|
.macro _PullDataLow
|
||||||
; set pin to output
|
; set pin to output
|
||||||
@ -88,7 +88,7 @@ scancode_handler: .res 2 ;; pointer to a function that handles new scanco
|
|||||||
;; - Initialize variables to 0
|
;; - Initialize variables to 0
|
||||||
;; - Clear the VIAs shift register and set T2 to oneshote mode
|
;; - Clear the VIAs shift register and set T2 to oneshote mode
|
||||||
;; - Set scancode_handler to immediately return (dont handle scancodes)
|
;; - Set scancode_handler to immediately return (dont handle scancodes)
|
||||||
;; @modifies: A
|
;; @modifies A
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
.proc init
|
.proc init
|
||||||
_DisableClock
|
_DisableClock
|
||||||
@ -113,7 +113,7 @@ scancode_handler: .res 2 ;; pointer to a function that handles new scanco
|
|||||||
;; @details
|
;; @details
|
||||||
;; - use the shift register interrupts to read the first 8 bits
|
;; - use the shift register interrupts to read the first 8 bits
|
||||||
;; - configure timer for timing the read of the last 3 bits
|
;; - configure timer for timing the read of the last 3 bits
|
||||||
;; @modifies: A
|
;; @modifies A
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
.proc begin_receive
|
.proc begin_receive
|
||||||
; disable timer interrupts (this might be called while waiting on the last 3 bits)
|
; disable timer interrupts (this might be called while waiting on the last 3 bits)
|
||||||
@ -154,7 +154,7 @@ scancode_handler: .res 2 ;; pointer to a function that handles new scanco
|
|||||||
|
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
;; @function Read the first 8 bits an
|
;; @function Read the first 8 bits an
|
||||||
;; @modifies: A
|
;; @modifies A
|
||||||
;; @details
|
;; @details
|
||||||
;; - read shift register
|
;; - read shift register
|
||||||
;; - disable shift register interrupts
|
;; - disable shift register interrupts
|
||||||
@ -181,7 +181,7 @@ scancode_handler: .res 2 ;; pointer to a function that handles new scanco
|
|||||||
|
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
;; @function Read the last 3 bits after after timer 2 is up
|
;; @function Read the last 3 bits after after timer 2 is up
|
||||||
;; @modifies: A
|
;; @modifies A
|
||||||
;; @details
|
;; @details
|
||||||
;; - read shift register
|
;; - read shift register
|
||||||
;; - disable timer 2 interrupts
|
;; - disable timer 2 interrupts
|
||||||
@ -260,7 +260,7 @@ scancode_handler: .res 2 ;; pointer to a function that handles new scanco
|
|||||||
;;
|
;;
|
||||||
;; If ANY of the bytes in cmd_response is 0xFE, the command failed.
|
;; If ANY of the bytes in cmd_response is 0xFE, the command failed.
|
||||||
;;
|
;;
|
||||||
;; @modifies: A,X,Y
|
;; @modifies A,X,Y
|
||||||
;; @param A: The command byte
|
;; @param A: The command byte
|
||||||
;; @param X: The data byte or NO_DATA if only the command byte should be sent
|
;; @param X: The data byte or NO_DATA if only the command byte should be sent
|
||||||
;; @param Y: The number of data bytes expected to receive. Must be one of {0, 1, 2}
|
;; @param Y: The number of data bytes expected to receive. Must be one of {0, 1, 2}
|
||||||
@ -284,7 +284,7 @@ scancode_handler: .res 2 ;; pointer to a function that handles new scanco
|
|||||||
|
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
;; @function Send a byte to the keyboard
|
;; @function Send a byte to the keyboard
|
||||||
;; @modifies: A,X,Y
|
;; @modifies A,X,Y
|
||||||
;; @param A: The byte to send
|
;; @param A: The byte to send
|
||||||
;; @details
|
;; @details
|
||||||
;; - pull clock low to stop keyboard transmissions
|
;; - pull clock low to stop keyboard transmissions
|
||||||
@ -343,7 +343,7 @@ scancode_handler: .res 2 ;; pointer to a function that handles new scanco
|
|||||||
|
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
;; @function Send the lasts 3 bits
|
;; @function Send the lasts 3 bits
|
||||||
;; @modifies: A
|
;; @modifies A
|
||||||
;; @details
|
;; @details
|
||||||
;; - load the remaining 3 bits of the transmission into the shift register
|
;; - load the remaining 3 bits of the transmission into the shift register
|
||||||
;; - disable shift register interrupts
|
;; - disable shift register interrupts
|
||||||
@ -365,7 +365,7 @@ scancode_handler: .res 2 ;; pointer to a function that handles new scanco
|
|||||||
|
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
;; @function Setup VIA to receive the keyboard's answer
|
;; @function Setup VIA to receive the keyboard's answer
|
||||||
;; @modifies: A
|
;; @modifies A
|
||||||
;; @details
|
;; @details
|
||||||
;; - disable timer 2 interrupts
|
;; - disable timer 2 interrupts
|
||||||
;; - pull clock low
|
;; - pull clock low
|
||||||
@ -416,7 +416,7 @@ scancode_handler: .res 2 ;; pointer to a function that handles new scanco
|
|||||||
;;
|
;;
|
||||||
;; If ANY of the bytes in cmd_response is 0xFE, the command failed.
|
;; If ANY of the bytes in cmd_response is 0xFE, the command failed.
|
||||||
;;
|
;;
|
||||||
;; @modifies: A,X,Y
|
;; @modifies A,X,Y
|
||||||
;; @param A: The command byte
|
;; @param A: The command byte
|
||||||
;; @param X: The data byte or NO_DATA if only the command byte should be sent
|
;; @param X: The data byte or NO_DATA if only the command byte should be sent
|
||||||
;; @param Y: The number of data bytes expected to receive. Must be one of {0, 1, 2}
|
;; @param Y: The number of data bytes expected to receive. Must be one of {0, 1, 2}
|
||||||
|
@ -14,7 +14,7 @@ INCLUDE_SPI = 1
|
|||||||
;; @details
|
;; @details
|
||||||
;; This requires the data line to be hooked up to `CB2` and the clock to `CB1`.
|
;; This requires the data line to be hooked up to `CB2` and the clock to `CB1`.
|
||||||
;; The VIA will be set to shift in the data into the shift register under the external clock.
|
;; The VIA will be set to shift in the data into the shift register under the external clock.
|
||||||
;; @ingroup driver
|
;; @ingroup drivers
|
||||||
;; @see via_hardware_bug "VIA external clock bug"
|
;; @see via_hardware_bug "VIA external clock bug"
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
.scope spi_p
|
.scope spi_p
|
||||||
|
@ -1,21 +1,25 @@
|
|||||||
;********************************************************************************
|
;;********************************************************************************
|
||||||
; @module system
|
;; @module system
|
||||||
; @type header
|
;; @ingroup system
|
||||||
; @details
|
;; @details
|
||||||
; Variable definitions for the current hardware setup
|
;; Variable definitions for the current hardware setup
|
||||||
;********************************************************************************
|
;;********************************************************************************
|
||||||
|
|
||||||
.ifndef INCLUDE_SYSTEM
|
.ifndef INCLUDE_SYSTEM
|
||||||
INCLUDE_SYSTEM = 1
|
INCLUDE_SYSTEM = 1
|
||||||
; reserved RAM addresses
|
|
||||||
; 00-0f - free use (Z0-Z15)
|
|
||||||
; 10-1f - arguments / return values (ARG0-ARG15)
|
|
||||||
; 20-ff - free
|
|
||||||
; 0100 - 01FF Stack
|
|
||||||
; 0200,0201 keybuffer write/read pointer
|
|
||||||
; 0202-02ff keybuffer
|
|
||||||
; 0300 lcd character counter
|
|
||||||
|
|
||||||
|
;;********************************************************************************
|
||||||
|
;; @page system_stuff More System stuff
|
||||||
|
;; @subsubsection ram_reserved Reserved RAM addresses
|
||||||
|
;; - 00-0f - free use (Z0-Z15)
|
||||||
|
;; - 10-1f - arguments / return values (ARG0-ARG15)
|
||||||
|
;; - 20-ff - free
|
||||||
|
;; - 0100 - 01FF Stack
|
||||||
|
;; - 0200,0201 keypad keybuffer write/read pointer
|
||||||
|
;; - 0202-02ff keypad keybuffer
|
||||||
|
;; - 0300 lcd character counter
|
||||||
|
;; @ingroup system
|
||||||
|
;;********************************************************************************
|
||||||
|
|
||||||
.include "io_W65C22.h65"
|
.include "io_W65C22.h65"
|
||||||
.include "utility.h65"
|
.include "utility.h65"
|
||||||
|
@ -5,7 +5,7 @@ INCLUDE_PARITY = 1
|
|||||||
|
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
;; @macro Calculate even parity
|
;; @macro Calculate even parity
|
||||||
;; @modifies: A, X, Y
|
;; @modifies A, X, Y
|
||||||
;; @returns A: 0 - even number of set bits, 1 - uneven number of set bits
|
;; @returns A: 0 - even number of set bits, 1 - uneven number of set bits
|
||||||
;; @returns Y: The number of set bits in the byte
|
;; @returns Y: The number of set bits in the byte
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
@ -21,7 +21,7 @@ INCLUDE_PARITY = 1
|
|||||||
;; @details
|
;; @details
|
||||||
;; Count the number of set bits in Y.
|
;; Count the number of set bits in Y.
|
||||||
;;
|
;;
|
||||||
;; @modifies: A, X, Y
|
;; @modifies A, X, Y
|
||||||
;; @returns A: 1 - even number of set bits, 0 - uneven number of set bits
|
;; @returns A: 1 - even number of set bits, 0 - uneven number of set bits
|
||||||
;; @returns Y: The number of set bits in the byte
|
;; @returns Y: The number of set bits in the byte
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
;; @details
|
;; @details
|
||||||
;; Count the number of set bits in Y.
|
;; Count the number of set bits in Y.
|
||||||
;;
|
;;
|
||||||
;; @modifies: A, X, Y
|
;; @modifies A, X, Y
|
||||||
;; @returns Y: The number of set bits in the byte
|
;; @returns Y: The number of set bits in the byte
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
.proc count_set_bits
|
.proc count_set_bits
|
||||||
|
@ -46,7 +46,7 @@ Import str, uint8_to_hex_str, uint_to_hex_str
|
|||||||
;; @param out: Output string address
|
;; @param out: Output string address
|
||||||
;; @param x0-x9: Additional parameters
|
;; @param x0-x9: Additional parameters
|
||||||
;; @warning Addresses as additional paramters must be passed like this `#<addr,#>addr`
|
;; @warning Addresses as additional paramters must be passed like this `#<addr,#>addr`
|
||||||
;; @modifies: A, X, Y, ARG4, ARG5
|
;; @modifies A, X, Y, ARG4, ARG5
|
||||||
;; @see str::strf
|
;; @see str::strf
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
.macro Strf fmt,out,x0,x1,x2,x3,x4,x5,x6,x7,x8,x9
|
.macro Strf fmt,out,x0,x1,x2,x3,x4,x5,x6,x7,x8,x9
|
||||||
|
@ -31,7 +31,7 @@ digits: .res 1
|
|||||||
;; @param ARG2-3: Output string address
|
;; @param ARG2-3: Output string address
|
||||||
;; @param ARG4+: Additional parameters
|
;; @param ARG4+: Additional parameters
|
||||||
;; @returns
|
;; @returns
|
||||||
;; @modifies: A, X, Y, ARG4, ARG5
|
;; @modifies A, X, Y, ARG4, ARG5
|
||||||
;;********************************************************************************
|
;;********************************************************************************
|
||||||
.proc strf
|
.proc strf
|
||||||
stz out_idx
|
stz out_idx
|
||||||
|
Loading…
Reference in New Issue
Block a user