fix doc format

This commit is contained in:
matthias@quintern.xyz 2024-08-08 20:39:25 +02:00
parent 7fce58e481
commit bf6a5efd7e
22 changed files with 98 additions and 85 deletions

View File

@ -294,7 +294,7 @@ ALIASES = "modifies=\par Modifies Registers^^" \
"macro=\qualifier macro \brief" \
"function=\qualifier subroutine \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
# only. Doxygen will then generate output that is more tailored for C. For

View File

@ -65,3 +65,8 @@
;;
;;********************************************************************************
;;********************************************************************************
;; @defgroup system
;; @brief Core code
;;
;;********************************************************************************

View File

@ -11,7 +11,7 @@ INCLUDE_MEMCOPY = 1
;; @param ARG0-1: Source address
;; @param ARG2-3: Target address
;; @param Y: Number of bytes to copy
;; @modifies: A,Y
;; @modifies A,Y
;;********************************************************************************
.proc memcopy
cpy #0
@ -31,7 +31,7 @@ INCLUDE_MEMCOPY = 1
;; @param ARG0-1: Source address
;; @param ARG2-3: Target address
;; @param ARG5-6: Number of bytes to copy (LE)
;; @modifies: A,Y
;; @modifies A,Y
;;********************************************************************************
.proc memcopy16
lda ARG6

View File

@ -10,7 +10,7 @@
;; @param ARG0-1: Address of the string to print
;; @param x: time to sleep in centiseconds
;; @ingroup applications
;; @clock_dependant
;; @clock_dependent
;;********************************************************************************
.proc print_slow
ldy #$00

View File

@ -9,7 +9,7 @@ scancode: .res 1
;;********************************************************************************
;; @function Initialize the keyboard handler
;; @returns Z: Z = 1 => success, Z = 0 => failure
;; @details:
;; @details
;; 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`
;; After init, the keyboard will be able to send scancodes.

View File

@ -19,7 +19,7 @@ keycode: .res 1
;;********************************************************************************
;; @function Initialize the keyboard handler
;; @returns Z: Z = 1 => success, Z = 0 => failure
;; @details:
;; @details
;; 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`
;; After init, the keyboard will be able to send scancodes.
@ -232,7 +232,7 @@ update_leds:
;; @details
;; Unset modifier bits if a mod key is released.
;; @param X: The scancode
;; @modifies:
;; @modifies
;;********************************************************************************
.proc break_key
; rmb kb::PREVIOUS::BREAK, kb::previous_scancode

View File

@ -9,9 +9,9 @@
;; @details
;; Interrupts might change the actual time to finish
;; To be exact, time_cs is in units of 0.010244s
;; @modifies: ARG15
;; @modifies ARG15
;; @ingroup applications
;; @clock_dependant
;; @clock_dependent
;;********************************************************************************
.proc sleep
_VAR_1 = ARG15

View File

@ -1,6 +1,6 @@
;;********************************************************************************
;; @file
;; @details:
;; @details
;; This code is loaded to the computer via a SPI interface
;; Currently, it must be loaded to $5000, where the main loop will begin
;;********************************************************************************

View File

@ -1,16 +1,20 @@
;********************************************************************************
; @module ringbuffer
; @type utility
; @details
; Size of the ringbuffer is RBUF_MEM_END - RBUF_MEM_START - 2, since two bytes
; are used by the read and write pointer
; The RBUF_NAME variable must be defined, the functions will then be exported
; as rb_<RBUF_NAME>_<function> where <function> = init, read or write
; @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
;********************************************************************************
;;********************************************************************************
;; @module ringbuffer
;; @details
;; Size of the ringbuffer is RBUF_MEM_END - RBUF_MEM_START - 2, since two bytes
;; are used by the read and write pointer
;; The `RBUF_NAME` variable must be defined, the functions will then be exported
;; as `rb_<RBUF_NAME>_<function>` where `<function>` = `init`, `read` or `write`
;;
;; @note
;; Doxygen can not generate proper documentation for this module, because
;; all names are defined using macros
;; @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
.ifndef RBUF_MEM_START
@ -36,9 +40,9 @@ RB_LENGTH = RBUF_MEM_END - RBUF_MEM_START - 2
.endif
;********************************************************************************
; @function Initialize the buffer
;********************************************************************************
;;********************************************************************************
;; @function Initialize the buffer
;;********************************************************************************
.ident(.concat(_RBUF_NAME, "_init")):
.scope
stz RB_WRITE
@ -46,13 +50,13 @@ RB_LENGTH = RBUF_MEM_END - RBUF_MEM_START - 2
rts
.endscope
;********************************************************************************
; @function Read a value from the buffer
; @details
; If there is no value to be read, the Pz will be set
; @returns A: value
; @modifies: A, X
;********************************************************************************
;;********************************************************************************
;; @function Read a value from the buffer
;; @details
;; If there is no value to be read, the Pz will be set
;; @returns A: value
;; @modifies A, X
;;********************************************************************************
.ident(.concat(_RBUF_NAME, "_read")):
.scope
ldx RB_READ
@ -72,11 +76,11 @@ RB_LENGTH = RBUF_MEM_END - RBUF_MEM_START - 2
rts
.endscope
;********************************************************************************
; @function Write a value to the buffer
; @param A: value to store
; @modifies: X
;********************************************************************************
;;********************************************************************************
;; @function Write a value to the buffer
;; @param A: value to store
;; @modifies X
;;********************************************************************************
.ident(.concat(_RBUF_NAME, "_write")):
.scope
; lda kp_VALUES, x ; load the char in a

View File

@ -1,6 +1,6 @@
;;********************************************************************************
;; @module IO-W65C22
;; @type utility
;; @ingroup system
;; @device Western Design - W65C22N Versatile Interface Adapter
;; @details
;;********************************************************************************
@ -139,7 +139,7 @@ INCLUDE_IOW65C22 = 1
;;********************************************************************************
;; @macro Enable an interrupt source
;; @modifies: A
;; @modifies A
;; @param flag: A flag of the interrupt flag register (IO::IRQ)
;;********************************************************************************
.macro IO_EnableIRQ ioaddr, flag
@ -148,7 +148,7 @@ INCLUDE_IOW65C22 = 1
.endmacro
;;********************************************************************************
;; @macro Disable an interrupt source
;; @modifies: A
;; @modifies A
;; @param flag: A flag of the interrupt flag register (IO::IRQ)
;;********************************************************************************
.macro IO_DisableIRQ ioaddr, flag

View File

@ -1,6 +1,6 @@
;;********************************************************************************
;; @module irq_handler
;; @type system
;; @module WIP irq handler with jump tables and stuff
;; @ingroup system
;;********************************************************************************
.ifndef INCLUDE_IRQ_HANDLER
INCLUDE_IRQ_HANDLER = 1

View File

@ -1,12 +1,12 @@
;;********************************************************************************
;; @module keypad4x4
;; @type driver
;; @device 4x4 Matrix Keypad
;; @details
;; The LCD must be connected to a W65C22N Interface Chip:
;; - IO.RA0-7 ->
;; @requires KP_IO: Base Address of IO Chip
;; @depends IO-W65C22N
;; @ingroup drivers
;;********************************************************************************
.ifndef INCLUDE_KEYPAD
INCLUDE_KEYPAD = 1

View File

@ -1,6 +1,6 @@
;;********************************************************************************
;; @module LCD-W164B
;; @ingroup driver
;; @ingroup drivers
;; @device ELECTRONIC ASSEMBLY - W164B-NLW
;; @details
;; The LCD must be connected to a W65C22N Interface Chip:
@ -18,7 +18,7 @@ INCLUDE_LCD = 1
;;********************************************************************************
;; @brief LCD character display
;; @ingroup driver
;; @ingroup drivers
;;********************************************************************************
.scope lcd
LCD_IO = IO1

View File

@ -45,7 +45,7 @@ _charcount: .res 1
;;********************************************************************************
;; @function Set the cursor to a position
;; @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
;; @returns A: the cursor position
;;********************************************************************************
@ -109,7 +109,7 @@ _charcount: .res 1
;;********************************************************************************
;; @function Print a null-terminated string
;; @param ARG0-1 Address of the string to print
;; @modifies: A,Y
;; @modifies A,Y
;; @returns Y: Length of the string
;;********************************************************************************
.proc print
@ -143,7 +143,7 @@ _charcount: .res 1
;; @param A: The ASCII code: 0-7
;; @param ARG0-1: Start address of the 8 bytes describing the character
;; @returns: C: 0 => success, 1 => invalid argument
;; @modifies: A,Y
;; @modifies A,Y
;;********************************************************************************
.proc set_custom_char
cmp #8

View File

@ -1,7 +1,7 @@
;;********************************************************************************
;; @module ps2_keyboard
;; @ingroup drivers
;; @details:
;; @details
;; Support for a PS2 Keyboard using the shift register of a 6522 VIA
;; @section reading Reading a scancode/command answer
;; 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$
;; - 230 \@ 1MHz
;; - 400 \@ 1.84 MHz
;; @clock_dependant
;; @clock_dependent
TIMER_RECV = 400
;; @brief #clock cycles to wait after loading the SR a second time while sending a command to the keyboard
;; @details
@ -61,7 +61,7 @@ TIMER_RECV = 400
;; Values that seem to work:
;; - 230 \@ 1MHz
;; - 400 \@ 1.84 MHz
;; @clock_dependant
;; @clock_dependent
TIMER_SEND = 400
PULL_REG = IO::RANH

View File

@ -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)
;;********************************************************************************
;; @macro Enable the clock signal from the keyboard
;; @modifies: A
;; @modifies A
;; @details
;; 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
;; @modifies: A
;; @modifies A
;; @details
;; 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
;; @modifies: A
;; @modifies A
;;********************************************************************************
.macro _StopPullDataLow
; 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
;; @modifies: A
;; @modifies A
;;********************************************************************************
.macro _PullDataLow
; set pin to output
@ -88,7 +88,7 @@ scancode_handler: .res 2 ;; pointer to a function that handles new scanco
;; - Initialize variables to 0
;; - Clear the VIAs shift register and set T2 to oneshote mode
;; - Set scancode_handler to immediately return (dont handle scancodes)
;; @modifies: A
;; @modifies A
;;********************************************************************************
.proc init
_DisableClock
@ -113,7 +113,7 @@ scancode_handler: .res 2 ;; pointer to a function that handles new scanco
;; @details
;; - use the shift register interrupts to read the first 8 bits
;; - configure timer for timing the read of the last 3 bits
;; @modifies: A
;; @modifies A
;;********************************************************************************
.proc begin_receive
; 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
;; @modifies: A
;; @modifies A
;; @details
;; - read shift register
;; - 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
;; @modifies: A
;; @modifies A
;; @details
;; - read shift register
;; - 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.
;;
;; @modifies: A,X,Y
;; @modifies A,X,Y
;; @param A: The command byte
;; @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}
@ -284,7 +284,7 @@ scancode_handler: .res 2 ;; pointer to a function that handles new scanco
;;********************************************************************************
;; @function Send a byte to the keyboard
;; @modifies: A,X,Y
;; @modifies A,X,Y
;; @param A: The byte to send
;; @details
;; - 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
;; @modifies: A
;; @modifies A
;; @details
;; - load the remaining 3 bits of the transmission into the shift register
;; - 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
;; @modifies: A
;; @modifies A
;; @details
;; - disable timer 2 interrupts
;; - 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.
;;
;; @modifies: A,X,Y
;; @modifies A,X,Y
;; @param A: The command byte
;; @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}

View File

@ -14,7 +14,7 @@ INCLUDE_SPI = 1
;; @details
;; 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.
;; @ingroup driver
;; @ingroup drivers
;; @see via_hardware_bug "VIA external clock bug"
;;********************************************************************************
.scope spi_p

View File

@ -1,21 +1,25 @@
;********************************************************************************
; @module system
; @type header
; @details
; Variable definitions for the current hardware setup
;********************************************************************************
;;********************************************************************************
;; @module system
;; @ingroup system
;; @details
;; Variable definitions for the current hardware setup
;;********************************************************************************
.ifndef INCLUDE_SYSTEM
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 "utility.h65"

View File

@ -5,7 +5,7 @@ INCLUDE_PARITY = 1
;;********************************************************************************
;; @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 Y: The number of set bits in the byte
;;********************************************************************************
@ -21,7 +21,7 @@ INCLUDE_PARITY = 1
;; @details
;; 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 Y: The number of set bits in the byte
;;********************************************************************************

View File

@ -4,7 +4,7 @@
;; @details
;; 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
;;********************************************************************************
.proc count_set_bits

View File

@ -46,7 +46,7 @@ Import str, uint8_to_hex_str, uint_to_hex_str
;; @param out: Output string address
;; @param x0-x9: Additional parameters
;; @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
;;********************************************************************************
.macro Strf fmt,out,x0,x1,x2,x3,x4,x5,x6,x7,x8,x9

View File

@ -31,7 +31,7 @@ digits: .res 1
;; @param ARG2-3: Output string address
;; @param ARG4+: Additional parameters
;; @returns
;; @modifies: A, X, Y, ARG4, ARG5
;; @modifies A, X, Y, ARG4, ARG5
;;********************************************************************************
.proc strf
stz out_idx