From 81788d4ac32f5834795056de115096af51fe8188 Mon Sep 17 00:00:00 2001 From: jede Date: Sat, 3 Feb 2024 23:10:42 +0100 Subject: [PATCH] fix --- .gitignore | 1 + docs/api/2024.1/assembly/index.html | 124 ++- docs/api/2024.1/c/index.html | 49 +- docs/api/2024.2/assembly/index.html | 1107 ------------------------ docs/api/2024.2/c/index.html | 775 ----------------- docs/api/2024.2/ch376.inc/index.html | 682 --------------- docs/api/assembly/index.html | 68 +- docs/api/c/index.html | 28 +- docs/api/search/search_index.json | 2 +- docs/api/sitemap.xml.gz | Bin 127 -> 127 bytes docs/code/2024.1/assembly.md | 36 + docs/code/2024.1/c.md | 10 + docs/code/2024.2/assembly.md | 652 -------------- docs/code/2024.2/c.md | 232 ----- docs/code/2024.2/ch376.inc.md | 204 ----- docs/code/assembly.md | 36 + docs/code/c.md | 10 + src/6502/_ch395_check_exist.s | 1 - src/6502/_ch395_get_dhcp_status.s | 8 +- src/6502/_ch395_get_glob_int_status.s | 6 +- src/6502/_ch395_get_ic_ver.s | 2 + src/6502/_ch395_get_int_status_sn.s | 8 +- src/6502/_ch395_get_ip_inf.s | 3 + src/6502/_ch395_get_mac_adress.s | 4 + src/6502/_ch395_get_phy_status.s | 8 +- src/6502/_ch395_get_recv_len_sn.s | 9 +- src/6502/_ch395_get_remot_ipp_sn.s | 5 + src/6502/_ch395_get_socket_status_sn.s | 8 +- 28 files changed, 402 insertions(+), 3676 deletions(-) delete mode 100644 docs/api/2024.2/assembly/index.html delete mode 100644 docs/api/2024.2/c/index.html delete mode 100644 docs/api/2024.2/ch376.inc/index.html delete mode 100644 docs/code/2024.2/assembly.md delete mode 100644 docs/code/2024.2/c.md delete mode 100644 docs/code/2024.2/ch376.inc.md diff --git a/.gitignore b/.gitignore index 1dfcf17..9fef0c1 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ error.txt *.ld65 *.o *.lib +target/ diff --git a/docs/api/2024.1/assembly/index.html b/docs/api/2024.1/assembly/index.html index 79ee38f..48eed4d 100644 --- a/docs/api/2024.1/assembly/index.html +++ b/docs/api/2024.1/assembly/index.html @@ -426,6 +426,20 @@ ch395_get_cmd_status + + +
  • + + ch395_get_dhcp_status + + +
  • + +
  • + + ch395_get_glob_int_status + +
  • @@ -433,6 +447,48 @@ ch395_get_ic_ver +
  • + +
  • + + ch395_get_int_status_sn + + +
  • + +
  • + + ch395_get_mac_adress + + +
  • + +
  • + + ch395_get_phy_status + + +
  • + +
  • + + ch395_get_recv_len_sn + + +
  • + +
  • + + ch395_get_remot_ipp_sn + + +
  • + +
  • + + ch395_get_socket_status_sn + +
  • @@ -538,6 +594,20 @@ ch395_get_cmd_status + + +
  • + + ch395_get_dhcp_status + + +
  • + +
  • + + ch395_get_glob_int_status + +
  • @@ -545,6 +615,48 @@ ch395_get_ic_ver +
  • + +
  • + + ch395_get_int_status_sn + + +
  • + +
  • + + ch395_get_mac_adress + + +
  • + +
  • + + ch395_get_phy_status + + +
  • + +
  • + + ch395_get_recv_len_sn + + +
  • + +
  • + + ch395_get_remot_ipp_sn + + +
  • + +
  • + + ch395_get_socket_status_sn + +
  • @@ -603,7 +715,17 @@

    ch395_dhcp_enable

  • X Register
  • ch395_get_cmd_status

    -

    ch395_get_ic_ver

    +

    ch395_get_dhcp_status

    +

    ch395_get_glob_int_status

    +

    ch395_get_ic_ver

    +

    Description

    +

    Get ch395 firmware version

    +

    ch395_get_int_status_sn

    +

    ch395_get_mac_adress

    +

    ch395_get_phy_status

    +

    ch395_get_recv_len_sn

    +

    ch395_get_remot_ipp_sn

    +

    ch395_get_socket_status_sn


    diff --git a/docs/api/2024.1/c/index.html b/docs/api/2024.1/c/index.html index c72a0fc..8dc1ddf 100644 --- a/docs/api/2024.1/c/index.html +++ b/docs/api/2024.1/c/index.html @@ -430,6 +430,27 @@ oid ch395_close_socket_sn(unsigned char ID_SOCKET) + + +
  • + + unsigned char ch395_get_int_status_sn(unsigned char ID_SOCKET); + + +
  • + +
  • + + void ch395_get_recv_len_sn(unsigned char ID_SOCKET) + + +
  • + +
  • + + unsigned int ch395_get_socket_status_sn(unsigned char ID_SOCKET); + +
  • @@ -501,6 +522,27 @@ oid ch395_close_socket_sn(unsigned char ID_SOCKET) + + +
  • + + unsigned char ch395_get_int_status_sn(unsigned char ID_SOCKET); + + +
  • + +
  • + + void ch395_get_recv_len_sn(unsigned char ID_SOCKET) + + +
  • + +
  • + + unsigned int ch395_get_socket_status_sn(unsigned char ID_SOCKET); + +
  • @@ -525,7 +567,12 @@

    void ch395_clear_re

    Clear receive buffer

    oid ch395_close_socket_sn(unsigned char ID_SOCKET)

    Description

    -

    Close socket

    +

    Close socket

    +

    Description

    +

    Get ch395 firmware version

    +

    unsigned char ch395_get_int_status_sn(unsigned char ID_SOCKET);

    +

    void ch395_get_recv_len_sn(unsigned char ID_SOCKET)

    +

    unsigned int ch395_get_socket_status_sn(unsigned char ID_SOCKET);


    diff --git a/docs/api/2024.2/assembly/index.html b/docs/api/2024.2/assembly/index.html deleted file mode 100644 index 9df27e2..0000000 --- a/docs/api/2024.2/assembly/index.html +++ /dev/null @@ -1,1107 +0,0 @@ - - - - - - - - - - - - - - - - - - - Assembly - CH395 LIB DOCUMENTATION - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - Skip to content - - -
    -
    - -
    - - - - -
    - - -
    - -
    - - - - - - - - - -
    -
    - - - -
    -
    -
    - - - - - - - -
    -
    -
    - - - - - - - -
    -
    - - - - -

    Assembly

    -

    ch376_check_exist

    -

    Description

    -

    If ch376 is present, it will return $AA

    -

    Modify

    -
      -
    • Accumulator
    • -
    -

    Returns

    -
      -
    • Accumulator : $AA if it's OK
    • -
    -

    Example

    -
     jsr ch376_check_exist
    - cmp #$AA
    - beq @exists
    - rts ; Does not exist
    -@exists:
    -...
    -
    -

    ch376_dir_create

    -

    Description

    -

    create a folder

    -

    Modify

    -
      -
    • Accumulator
    • -
    • X Register From ch376_wait_response_call
    • -
    • Y Register From ch376_wait_response_call
    • -
    -

    Returns

    -
      -
    • Accumulator : ch376 status values
    • -
    -

    Example

    -
     jsr ch376_dir_create
    - ; check accumulator here ch376_wait_response had been launched by ch376_dir_create
    -
    -

    ch376_disk_capacity

    -

    Description

    -

    check disk capacity

    -
    -

    Impossible to use

    -
    -

    ch376_disk_mount

    -

    Description

    -

    perform a disk mount

    -

    Modify

    -
      -
    • Accumulator
    • -
    • X Register From ch376_wait_response_call
    • -
    • Y Register From ch376_wait_response_call
    • -
    -

    Returns

    -
      -
    • Accumulator : ch376 status values
    • -
    -

    Example

    -
     jsr ch376_disk_mount
    - ; check accumulator here ch376_wait_response had been launched by ch376_disk_mount
    -
    -

    ch376_disk_query

    -
    -

    Impossible to use

    -
    -

    ch376_file_close

    -

    Description

    -

    Close file

    -

    Modify

    -
      -
    • Accumulator
    • -
    • X Register From ch376_wait_response_call
    • -
    • Y Register From ch376_wait_response_call
    • -
    -

    Returns

    -
      -
    • Accumulator : 'ch376 status' value
    • -
    -

    Example

    -
     jsr ch376_file_close
    - ; check accumulator here ch376_wait_response had been launched by ch376_file_close
    -
    -

    ch376_file_create

    -

    Description

    -

    create file

    -

    Modify

    -
      -
    • Accumulator
    • -
    • X Register From ch376_wait_response_call
    • -
    • Y Register From ch376_wait_response_call
    • -
    -

    Returns

    -
      -
    • Accumulator : ch376 status value
    • -
    -

    Example

    -
     jsr ch376_file_create
    - ; check accumulator here ch376_wait_response had been launched by ch376_file_create
    -
    -

    ch376_file_erase

    -

    Description

    -

    Erase file

    -

    Modify

    -
      -
    • Accumulator
    • -
    • X Register From ch376_wait_response_call
    • -
    • Y Register From ch376_wait_response_call
    • -
    -

    Returns

    -
      -
    • Accumulator : ch376 status value
    • -
    -

    Example

    -
     jsr ch376_file_erase
    - ; Check accumulator here :
    - ; Ch376_wait_response had been launched
    - ; By ch376_file_erase
    -
    -

    ch376_file_open

    -

    Description

    -

    open file

    -

    Modify

    -
      -
    • Accumulator
    • -
    • X Register From ch376_wait_response_call
    • -
    • Y Register From ch376_wait_response_call
    • -
    -

    Returns

    -
      -
    • Accumulator : 'ch376 status' value
    • -
    -

    Example

    -
     jsr ch376_file_erase
    - ; check accumulator here ch376_wait_response had been launched by ch376_file_open
    - rts
    -
    -

    ch376_get_descr

    -

    Description

    -

    Get usb descr device

    -

    Modify

    -
      -
    • X Register
    • -
    • Y Register From ch376_wait_response_call
    • -
    -

    Returns

    -
      -
    • Accumulator : ch376 status values
    • -
    -

    Example

    -
     jsr ch376_get_descr
    - ; check accumulator here ch376_wait_response had been launched by ch376_get_descr
    - rts
    -
    -

    ch376_get_file_size

    -

    Description

    -

    Get file size

    -
    -

    Impossible to use

    -
    -

    ch376_ic_get_ver

    -

    Description

    -

    Get ch376 firmware version

    -

    Modify

    -
      -
    • Accumulator
    • -
    -

    Returns

    -
      -
    • Accumulator : ch376 firmware version
    • -
    -

    Example

    -
     jsr ch376_ic_get_ver
    - ; check accumulator for Version (integer value)
    -
    -

    ch376_issue_token_x

    -

    Description

    -

    Send Token for control transfert

    -

    Input

    -
      -
    • Accumulator : ch376 Token
    • -
    -

    Modify

    -
      -
    • Accumulator
    • -
    • X Register
    • -
    • Y Register From ch376_wait_response
    • -
    -

    Returns

    -
      -
    • Accumulator : ch376 status
    • -
    -

    Example

    -
     lda #$80
    - jsr ch376_issue_token_x
    - ; check accumulator for ch376 status
    -
    -

    ch376_lib_version

    -

    Description

    -

    Get lib version

    -

    Modify

    -
      -
    • Accumulator
    • -
    -

    Returns

    -
      -
    • Accumulator : ch376 lib version
    • -
    -

    Example

    -
     jsr ch376_lib_version
    - cmp #CH376_LIB_VERSION_2024_2
    - beq @right_version
    - ; Wrong version
    -...
    - rts
    -@right_version:
    -...
    - rts
    -
    -

    ch376_reset_all

    -

    Description

    -

    reset CH376

    -

    Modify

    -
      -
    • Accumulator
    • -
    • X Register
    • -
    • Y Register
    • -
    -

    Example

    -
     jsr ch376_reset_all
    - rts
    -
    -

    ch376_seek_file

    -

    Description

    -

    Seek file. Performs a wait_response

    -

    Input

    -
      -
    • Accumulator : First byte
    • -
    • Y Register : second byte
    • -
    • X Register : third byte byte
    • -
    • RES : Fourth byte
    • -
    -

    Modify

    -
      -
    • Accumulator
    • -
    • X Register from ch376_wait_response call
    • -
    • Y Register from ch376_wait_response call
    • -
    -

    Returns

    -
      -
    • Accumulator : ch376 status values
    • -
    -

    Example

    -
     lda #$04
    - sta RES
    - lda #$01
    - ldy #$02
    - ldx #$03
    - jsr ch376_seek_file
    - ; check accumulator here ch376_wait_response had been launched by ch376_seek_file
    -
    -
    -

    Not tested

    -
    -

    ch376_set_address

    -

    Description

    -

    set usb address

    -

    Modify

    -
      -
    • X Register
    • -
    -

    Example

    -
     lda #$02
    - jsr ch376_set_address
    -
    -

    ch376_set_bytes_read

    -

    Description

    -

    Set bytes to read. Manage only 16 bits. Others bytes are set to 0 to provide 32 bits integer to ch376 chip

    -

    Input

    -
      -
    • Accumulator : Low value
    • -
    • Y Register : High value
    • -
    -

    Modify

    -
      -
    • X Register
    • -
    • Accumulator
    • -
    -

    Example

    -
     lda #$02
    - ldy #$10
    - jsr ch376_set_bytes_read
    -
    -

    ch376_set_bytes_write

    -

    Description

    -

    Set bytes to write. Manage only 16 bits. Others bytes are set to 0 to provide 32 bits integer to ch376 chip

    -

    Input

    -
      -
    • Accumulator : Low value
    • -
    • Y Register : High value
    • -
    -

    Modify

    -
      -
    • X Register
    • -
    • Accumulator
    • -
    -

    Example

    -
     lda #$02
    - ldy #$10
    - jsr ch376_set_bytes_write
    -
    -

    ch376_set_config

    -

    Description

    -

    set config for usb device

    -

    Input

    -
      -
    • Accumulator : config value
    • -
    -

    Modify

    -
      -
    • X Register
    • -
    -

    Example

    -
     lda #$02
    - jsr ch376_set_config
    -
    -

    ch376_set_file_name

    -

    Description

    -

    set file_name

    -

    Input

    -
      -
    • Accumulator : Low ptr adress of the string, terminated by 0
    • -
    • Y Register : High ptr adress of the string, terminated by 0
    • -
    -

    Modify

    -

    *RES -* Accumulator -* Y Register

    -

    Example

    -
     lda #<myfile
    - ldy #>myfile
    - jsr ch376_set_file_name
    - rts
    -myfile:
    - .byte "hello.txt"
    -
    -

    ch376_set_usb_addr

    -

    Description

    -

    set usb_address

    -

    Input

    -
      -
    • Accumulator : The address to set
    • -
    -

    Modify

    -
      -
    • X Register
    • -
    -

    Example

    -
    ; Set usb addr
    - lda #$02
    - jsr ch376_set_usb_addr
    - rts
    -
    -

    ch376_set_usb_mode

    -

    Description

    -

    Set usb mode

    -

    Input

    -
      -
    • Accumulator : The usb mode to set
    • -
    -

    Modify

    -
      -
    • X Register
    • -
    -

    Example

    -
     lda #CH376_USB_MODE_HOST_RESET
    - jsr ch376_set_usb_mode
    - rts
    -
    -

    ch376_set_usb_speed

    -

    Description

    -

    Set usb mode

    -

    Input

    -
      -
    • Accumulator : The speed for usb
    • -
    -

    Modify

    -
      -
    • X Register
    • -
    -

    Example

    -
     lda #$02
    - jsr ch376_set_usb_speed
    - rts
    -
    -

    ch376_wait_response

    -

    Description

    -

    Perform wait_response. It's not needed to call because some commands already perform ch376_wait_response

    -

    Modify

    -
      -
    • Accumulator
    • -
    • X Register
    • -
    • Y Register
    • -
    -

    Returns

    -
      -
    • Accumulator : "ch376 status" value (or return 1 if usb controller does not respond)
    • -
    -

    Example

    -
     jsr ch376_wait_response
    - rts
    -
    -

    ch376_wr_usb_data

    -

    Description

    -

    Send data to usb device. First byte must be the the length to send

    -

    Input

    -
      -
    • Accumulator : Low byte of ptr data
    • -
    • X Register : High byte of ptr data
    • -
    -

    Modify

    -
      -
    • Accumulator
    • -
    • Y Register
    • -
    • X Register -*RES
    • -
    -

    Example

    -
     lda #<data
    - ldx #>data
    - jsr ch376_wr_usb_data
    - rts
    -data:
    - ; length, set port feature, set feature, port_power,0, Id port, 0, 0, 0
    - .byte 8,$23,3,8,0,1,0,0
    -
    - -
    -
    - - - Last update: - 2024-02-03 - - -
    - - - - - - -
    -
    - - - - -
    - - - -
    - - - -
    -
    -
    -
    - - - - - - - - - \ No newline at end of file diff --git a/docs/api/2024.2/c/index.html b/docs/api/2024.2/c/index.html deleted file mode 100644 index dba73fc..0000000 --- a/docs/api/2024.2/c/index.html +++ /dev/null @@ -1,775 +0,0 @@ - - - - - - - - - - - - - - - - - - - C - CH395 LIB DOCUMENTATION - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - Skip to content - - -
    -
    - -
    - - - - -
    - - -
    - -
    - - - - - - - - - -
    -
    - - - -
    -
    -
    - - - - - - - -
    -
    -
    - - - - - - - -
    -
    - - - - -

    C

    -

    unsigned char ch376_check_exist(void);

    -

    Description

    -

    If ch376 is present, it will return 0XAA

    -

    Returns

    -

    0XAA if it's OK

    -

    unsigned char ch376_dir_create();

    -

    Description

    -

    create a folder

    -

    ch376_disk_capacity();

    -

    Description

    -

    check disk capacity

    -
    -

    Impossible to use

    -
    -

    unsigned char ch376_disk_mount(void);

    -

    Description

    -

    perform a disk mount

    -

    Returns

    -

    ch376 status values

    -

    void ch376_disk_query(void);

    -
    -

    Impossible to use

    -
    -

    unsigned char ch376_file_close();

    -

    Returns

    -

    ch376 status values

    -

    unsigned char ch376_dir_create();

    -

    Description

    -

    create file

    -

    Returns

    -

    ch376 status values

    -

    unsigned char ch376_file_erase();

    -

    Description

    -

    erase file

    -

    Returns

    -

    ch376 status value

    -

    unsigned char ch376_file_open(void);

    -

    Description

    -

    open file

    -

    Returns

    -

    'ch376 status' value

    -

    unsigned char ch376_get_descr(unsigned char mode);

    -

    Description

    -

    Get usb descr device

    -

    Returns

    -

    ch376 status values

    -

    void ch376_get_file_size(void);

    -
    -

    Impossible to use

    -
    -

    unsigned char ch376_ic_get_version(void);

    -

    Description

    -

    Get ch376 firmware version

    -

    Returns

    -

    ch376 firmware version

    -

    void ch376_issue_token_x(unsigned char token)

    -

    Description

    -

    Send Token for control transfert

    -

    unsigned char ch376_lib_version(void);

    -

    Description

    -

    Get lib version

    -

    Returns

    -

    ch376 lib version

    -

    void ch376_reset_all(void);

    -

    Description

    -

    reset CH376

    -

    unsigned int ch376_seek_file(long position);

    -

    Description

    -

    Seek file

    -

    Returns

    -

    ch376 status values

    -

    void ch376_set_address(unsigned char adress);

    -

    Description

    -

    set usb address

    -

    void ch376_set_bytes_write(unsigned int nb);

    -

    void ch376_set_bytes_read(unsigned int nb);

    -

    void ch376_set_config(unsigned char config);

    -

    Description

    -

    set config for usb device

    -

    void ch376_set_file_name(char *filename);

    -

    Description

    -

    set file_name

    -

    void ch376_set_usb_addr(unsigned char adress);

    -

    Description

    -

    set usb_address

    -

    void ch376_set_usb_mode(unsigned char mode);

    -

    Description

    -

    Set usb mode

    -

    Input

    -

    void ch376_set_usb_speed(unsigned char speed);

    -

    Description

    -

    Set usb mode

    -

    Input

    -

    unsigned char ch376_wait_response(void);

    -

    Description

    -

    Perform wait_response

    -

    Returns

    -

    "ch376 status" values

    -

    void ch376_wr_usb_data(char *data);

    -

    Description

    -

    Send data to usb device. First byte must be the the length to send

    - -
    -
    - - - Last update: - 2024-02-03 - - -
    - - - - - - -
    -
    - - - - -
    - - - -
    - - - -
    -
    -
    -
    - - - - - - - - - \ No newline at end of file diff --git a/docs/api/2024.2/ch376.inc/index.html b/docs/api/2024.2/ch376.inc/index.html deleted file mode 100644 index 7c81110..0000000 --- a/docs/api/2024.2/ch376.inc/index.html +++ /dev/null @@ -1,682 +0,0 @@ - - - - - - - - - - - - - - - - - - - Ch376.inc - CH395 LIB DOCUMENTATION - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    -
    - -
    - - - - -
    - - -
    - -
    - - - - - - - - - -
    -
    - - - -
    -
    -
    - - - - - - - -
    -
    -
    - - - -
    -
    -
    - - - -
    -
    -
    - - - -
    -
    - - - - -

    Ch376.inc

    - -

    CH376_LIB_VERSION_2023_4 = $00 -CH376_LIB_VERSION_2024_1 = $01 -CH376_LIB_VERSION_2024_2 = $02 -* -CH376_DETECTED = $AA -* -CH376_NONE = $00 -CH376_GET_IC_VER = $01 -CH376_SET_BAUDRATE = $02 -CH376_GET_ENTER_SLEEP = $03 -CH276_SET_USB_SPEED = $04 -CH376_RESET_ALL = $05 -CH376_CHECK_EXIST = $06 -CH376_GET_REGISTER = $0A -CH376_GET_DEV_RATE = $0A -CH376_SET_REGISTER = $0B -CH376_SET_SD0 = $0B -CH376_WRITE_VAR8 = $0B -CH376_GET_FILE_SIZE = $0C ; Get the current file length -CH376_READ_VAR32 = $0C -CH376_WRITE_VAR32 = $0D -CH376_DELAY_100US = $0F -CH376_SET_USB_ADDR = $13 -CH376_SET_USB_MODE = $15 -CH376_TEST_CONNECT = $16 -CH376_ABORT_NAK = $17 -CH376_SET_EP0_RX = $18 -CH376_SET_EP0_TX = $19 -CH376_SET_EP1_RX = $1A -CH376_SET_EP1_TX = $1B -CH376_SET_EP2_RX = $1C -CH376_SET_EP2_TX = $1D -CH376_GET_STATUS = $22 -CH376_UNLOCK_USB = $23 ; From CH375 datasheet -CH376_DIRTY_BUFFER = $25 -CH376_RD_USB_DATA0 = $27 -CH376_RD_USB_DATA_UNLOCK = $28 ; From CH375 datasheet -CH376_WR_EP0 = $29 ; DATA3 -CH376_WR_EP1 = $2A ; DATA5 -CH376_WR_EP2 = $2B ; DATA7 -CH376_WR_USB_DATA = $2C -CH376_WR_REQ_DATA = $2D -CH376_OFS_DATA = $2E -CH376_SET_FILE_NAME = $2F -CH376_DISK_CONNECT = $30 ; check the disk connection status -CH376_DISK_MOUNT = $31 -CH376_FILE_OPEN = $32 -CH376_FILE_ENUM_GO = $33 -CH376_CMD_FILE_CREATE = $34 -CH376_FILE_ERASE = $35 -CH376_FILE_CLOSE = $36 -CH376_DIR_INFO_READ = $37 -CH376_DIR_INFO_SAVE = $38 -CH376_BYTE_LOCATE = $39 -CH376_BYTE_READ = $3A -CH376_BYTE_RD_GO = $3B -CH376_BYTE_WRITE = $3C -CH376_BYTE_WR_GO = $3D -CH376_DISK_CAPACITY = $3E -CH376_DISK_QUERY = $3F -CH376_DIR_CREATE = $40 -CH376_CLR_STALL = $41 -CH376_SET_ADRESS = $45 -CH376_CMD_GET_DESCR = $46 -CH376_CMD_SET_CONFIG = $49 ; Set USB configuration -CH376_SEC_READ = $4B -CH376_SEC_WRITE = $4C -CH376_AUTO_SETUP = $4D -CH376_ISSUE_TKN_X = $4E ; Send synchronization token and execute transactions -CH376_DISC_BOC = $50 -CH376_DISK_INIT = $51 ; Init USB memory -CH376_DISK_RESET = $52 -CH376_DISK_SIZE = $53 ; Get The maximum capacity of the USB memory -CH376_DISC_READ = $54 -CH376_DISK_RD_GO = $55 -CH376_DISK_WRITE = $56 -CH376_DISK_WR_GO = $57 -CH376_DISK_INQUIRY = $58 -CH376_DISK_READY = $59 -CH376_DISK_R_SENSE = $5A -CH376_RD_DISK_SEC = $5B -CH376_WR_DISK_SEC = $5C -CH376_DISK_MAX_LUN = $5D -* -; CODE FOR CH376_SET_USB_MODE -* -CH376_USB_MODE_DEVICE_INVALID = $00 -CH376_USB_MODE_DEVICE_OUTER_FW = $01 -CH376_USB_MODE_DEVICE_INNER_FW = $02 -CH376_USB_MODE_CODE_SDCARD = $03 -; The code of 06H means switch to valid USB-HOST, produce SOF package automatically. -CH376_USB_MODE_CODE_USB_HOST_SOF_PACKAGE_AUTOMATICALLY = $06 -CH376_USB_MODE_HOST_RESET = $07 -* -CH376_ERR_OPEN_DIR = $41 -CH376_ERR_MISS_FILE = $42 -CH376_ERR_FOUND_NAME = $43 -CH376_ERR_DISK_DISCON = $82 -CH376_ERR_LARGE_SECTOR = $84 -CH376_ERR_TYPE_ERROR = $92 -CH376_ERR_BPB_ERROR = $A1 -CH376_ERR_DISK_FULL = $B1 -CH376_ERR_FDT_OVER = $B2 -CH376_ERR_FILE_CLOSE = $B4 -* -* -CH376_USB_INT_SUCCESS = $14 -CH376_USB_INT_CONNECT = $15 -CH376_USB_INT_DISCONNECT = $16 -CH376_USB_INT_BUF_OVER = $17 -CH376_USB_INT_USB_READY = $18 -CH376_USB_INT_DISK_READ = $1D -CH376_USB_INT_DISK_WRITE = $1E -CH376_USB_INT_DISK_ERR = $1F -* -CH376_ST_RET_SUCCESS = $51 -CH376_ST_RET_ABORT = $5F -* -* -* -; / * Informations de base du système actuel * / -; / * Le bit 6 est utilisé pour indiquer la sous-classe du périphérique de stockage USB SubClass-Code, le bit 6 est 0 pour indiquer que la sous-classe est 6 et le bit 6 est 1 pour indiquer que la sous-classe est différente de 6 * / -; / * Le bit 5 est utilisé pour indiquer l'état de la configuration USB en mode périphérique USB et l'état de la connexion du périphérique USB en mode hôte USB * / -; / * En mode périphérique USB, si le bit 5 est 1, la configuration USB est terminée et les bits 5 et 0 ne sont pas configurés * / -; / * En mode hôte USB, si le bit 5 est 1, il y a un périphérique USB dans le port USB, et si le bit 5 est 0, il n'y a pas de périphérique USB dans le port USB * / -; / * Le bit 4 est utilisé pour indiquer l'état de verrouillage du tampon en mode périphérique USB. Le bit 4 est 1 signifie que le tampon USB est verrouillé et le bit 6 est 1 signifie qu'il a été libéré * / -; / * Autres bits, réservés, veuillez ne pas modifier * / -VAR_SYS_BASE_INFO = $20 -* -; / * Nombre de tentatives d'opération de transaction USB * / -; / * Si le bit 7 est 0, il ne réessayera pas lorsque NAK est reçu, le bit 7 est 1 et le bit 6 est 0, et réessayera à l'infini lors de la réception de NAK (vous pouvez utiliser la commande CMD_ABORT_NAK pour abandonner la nouvelle tentative), le bit 7 est 1 et 6 est 1 Réessayez au plus 3 secondes lors de la réception de NAK * / -; / * Bit 5 ~ Bit 0 représente le nombre de tentatives après l'expiration du délai * / -VAR_RETRY_TIMES = $25 -* -; / * Indicateur de bit en mode fichier hôte * / -; / * Bit 1 et Bit 0, l'indicateur du système de fichiers FAT du disque logique, 00-FAT12, 01-FAT16, 10-FAT32, 11-illégal * / -; / * Bit 2, indique si les données de la table FAT dans le tampon courant ont été modifiées, 0-non modifié, 1-modifié * / -; / * Bit 3, la longueur du fichier doit être modifiée, le fichier actuel est ajouté avec les données, 0-Aucune modification n'est pas ajoutée, 1-Ajouté et doit être modifié * / -; / * Autres bits, réservés, veuillez ne pas modifier * / -VAR_FILE_BIT_FLAG = $26 -* -; / * État du disque et du fichier en mode fichier hôte * / -; VAR_SD_BIT_FLAG 0x30 / * Indicateur de bit de la carte SD en mode fichier hôte * / -; / * Bit 0, version de la carte SD, 0- prend uniquement en charge la première version SD, 1- prend en charge la deuxième version SD * / -; / * Bit 1, reconnaissance automatique, carte 0-SD, carte 1-MMC * / -; / * Bit 2, identification automatique, carte SD de capacité standard 0, carte SD 1 grande capacité (HC-SD) * / -; / * Bit 4, délai d'expiration de la commande ACMD41 * / -; / * Bit 5, délai d'expiration de la commande CMD1 * / -; / * Bit 6, délai d'expiration de la commande CMD58 * / -; / * Autres bits, réservés, veuillez ne pas modifier * / -VAR_DISK_STATUS = $2B -* -; / * L'indicateur de synchronisation du point de terminaison BULK-IN / BULK-OUT du périphérique de stockage USB * / -; / * Bit 7, indicateur de synchronisation de point de terminaison en bloc * / -; / * Bit 6, indicateur de synchronisation de point de terminaison en bloc * / -; / * Bit 5 ~ Bit 0, doit être 0 * / -VAR_UDISK_TOGGLE = $31 -* -; / * Le numéro d'unité logique du périphérique de stockage USB * / -; / * Bit 7 ~ Bit 4, le numéro d'unité logique actuel du périphérique de stockage USB, après que CH376 initialise le périphérique de stockage USB, la valeur par défaut est d'accéder à 0 # unité logique * / -; / * Bit 3 ~ Bit 0, le numéro d'unité logique maximum du périphérique de stockage USB, plus 1 est égal au nombre d'unités logiques * / -VAR_UDISK_LUN = $34 -* -; / * Le nombre de secteurs par cluster du disque logique * / -VAR_SEC_PER_CLUS = $38 -; / * Le numéro d'index des informations de répertoire de fichiers en cours dans le secteur * / -VAR_FILE_DIR_INDEX = $3B -* -; / * Le décalage de secteur du pointeur de fichier actuel dans le cluster, 0xFF pointe vers la fin du fichier, la fin du cluster * / -VAR_CLUS_SEC_OFS = $3C -* -;/ * Variable 32 bits / 4 octets * / -; / * Pour les disques FAT16, c'est le nombre de secteurs occupés par le répertoire racine, et pour les disques FAT32, c'est le numéro de cluster de départ du répertoire racine (longueur totale 32 bits, octet de poids faible en premier) * / -VAR_DISK_ROOT = $44 -* -; / * Le nombre total de clusters du disque logique (la longueur totale est de 32 bits, octet de poids faible en premier) * / -VAR_DSK_TOTAL_CLUS = $48 -* -; / * Le numéro de secteur absolu de départ du disque logique LBA (longueur totale 32 bits, octet de poids faible en premier) * / -VAR_DSK_START_LBA = $4C -* -; / * LBA de départ de la zone de données du disque logique (la longueur totale est de 32 bits, octet de poids faible en premier) * / -VAR_DSK_DAT_START = $50 -* -; / * LBA correspondant aux données du tampon de données actuel du disque (longueur totale 32 bits, octet de poids faible en premier) * / -VAR_LBA_BUFFER = $54 -* -; / * L'adresse LBA de départ du disque actuellement lu et écrit (la longueur totale est de 32 bits, octet de poids faible en premier) * / -VAR_LBA_CURRENT = $58 -* -; / * L'adresse LBA du secteur où se trouvent les informations du répertoire de fichiers en cours (longueur totale 32 bits, octet de poids faible en premier) * / -VAR_FAT_DIR_LBA = $5C -* -; / * Le numéro de cluster de départ du fichier ou du répertoire (dossier) actuel (longueur totale 32 bits, octet de poids faible en premier) * / -VAR_START_CLUSTER = $60 -* -; / * Le numéro de cluster actuel du fichier actuel (la longueur totale est de 32 bits, octet de poids faible en premier) * / -VAR_CURRENT_CLUST = $64 -* -; / * La longueur du fichier actuel (la longueur totale est de 32 bits, octet de poids faible en premier) * / -VAR_FILE_SIZE = $68 -* -; / * Le pointeur de fichier actuel, le décalage d'octet de la position actuelle de lecture et d'écriture (longueur totale 32 bits, octet de poids faible en premier) * / -*VAR_CURRENT_OFFSET = $6C

    - -
    -
    - - - Last update: - 2024-02-03 - - -
    - - - - - - -
    -
    - - - - -
    - - - -
    - - - -
    -
    -
    -
    - - - - - - - - - \ No newline at end of file diff --git a/docs/api/assembly/index.html b/docs/api/assembly/index.html index 334d808..cf2d42e 100644 --- a/docs/api/assembly/index.html +++ b/docs/api/assembly/index.html @@ -444,6 +444,20 @@ ch395_get_cmd_status + + +
  • + + ch395_get_dhcp_status + + +
  • + +
  • + + ch395_get_glob_int_status + +
  • @@ -451,6 +465,48 @@ ch395_get_ic_ver +
  • + +
  • + + ch395_get_int_status_sn + + +
  • + +
  • + + ch395_get_mac_adress + + +
  • + +
  • + + ch395_get_phy_status + + +
  • + +
  • + + ch395_get_recv_len_sn + + +
  • + +
  • + + ch395_get_remot_ipp_sn + + +
  • + +
  • + + ch395_get_socket_status_sn + +
  • @@ -509,7 +565,17 @@

    ch395_dhcp_enable

  • X Register
  • ch395_get_cmd_status

    -

    ch395_get_ic_ver

    +

    ch395_get_dhcp_status

    +

    ch395_get_glob_int_status

    +

    ch395_get_ic_ver

    +

    Description

    +

    Get ch395 firmware version

    +

    ch395_get_int_status_sn

    +

    ch395_get_mac_adress

    +

    ch395_get_phy_status

    +

    ch395_get_recv_len_sn

    +

    ch395_get_remot_ipp_sn

    +

    ch395_get_socket_status_sn


    diff --git a/docs/api/c/index.html b/docs/api/c/index.html index f8424f4..c0a31ab 100644 --- a/docs/api/c/index.html +++ b/docs/api/c/index.html @@ -430,6 +430,27 @@ oid ch395_close_socket_sn(unsigned char ID_SOCKET) + + +
  • + + unsigned char ch395_get_int_status_sn(unsigned char ID_SOCKET); + + +
  • + +
  • + + void ch395_get_recv_len_sn(unsigned char ID_SOCKET) + + +
  • + +
  • + + unsigned int ch395_get_socket_status_sn(unsigned char ID_SOCKET); + +
  • @@ -454,7 +475,12 @@

    void ch395_clear_re

    Clear receive buffer

    oid ch395_close_socket_sn(unsigned char ID_SOCKET)

    Description

    -

    Close socket

    +

    Close socket

    +

    Description

    +

    Get ch395 firmware version

    +

    unsigned char ch395_get_int_status_sn(unsigned char ID_SOCKET);

    +

    void ch395_get_recv_len_sn(unsigned char ID_SOCKET)

    +

    unsigned int ch395_get_socket_status_sn(unsigned char ID_SOCKET);


    diff --git a/docs/api/search/search_index.json b/docs/api/search/search_index.json index cb6f2fa..85841b0 100644 --- a/docs/api/search/search_index.json +++ b/docs/api/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Introduction","text":"

    This lib is used to manage ch395 chip for 6502 cpu

    "},{"location":"assembly/","title":"Assembly","text":""},{"location":"assembly/#assembly","title":"Assembly","text":""},{"location":"assembly/#ch395_check_exist","title":"ch395_check_exist","text":"

    Description

    Checks if ch395 exists

    Modify

    Returns

    "},{"location":"assembly/#ch395_clear_recv_buf_sn","title":"ch395_clear_recv_buf_sn","text":"

    Description

    Clear receive buffer

    Modify

    "},{"location":"assembly/#ch395_close_socket_sn","title":"ch395_close_socket_sn","text":"

    Description

    Close socket

    Input

    Modify

    "},{"location":"assembly/#ch395_dhcp_enable","title":"ch395_dhcp_enable","text":"

    Input

    Modify

    "},{"location":"assembly/#ch395_get_cmd_status","title":"ch395_get_cmd_status","text":""},{"location":"assembly/#ch395_get_ic_ver","title":"ch395_get_ic_ver","text":""},{"location":"c/","title":"C","text":""},{"location":"c/#c","title":"C","text":""},{"location":"c/#_1","title":"C","text":""},{"location":"c/#void-ch395_clear_recv_buf_snunsigned-char-id_socket","title":"void ch395_clear_recv_buf_sn(unsigned char ID_SOCKET)","text":"

    Description

    Clear receive buffer

    "},{"location":"c/#oid-ch395_close_socket_snunsigned-char-id_socket","title":"oid ch395_close_socket_sn(unsigned char ID_SOCKET)","text":"

    Description

    Close socket

    "},{"location":"2024.1/assembly/","title":"Assembly","text":""},{"location":"2024.1/assembly/#assembly","title":"Assembly","text":""},{"location":"2024.1/assembly/#ch395_check_exist","title":"ch395_check_exist","text":"

    Description

    Checks if ch395 exists

    Modify

    Returns

    "},{"location":"2024.1/assembly/#ch395_clear_recv_buf_sn","title":"ch395_clear_recv_buf_sn","text":"

    Description

    Clear receive buffer

    Modify

    "},{"location":"2024.1/assembly/#ch395_close_socket_sn","title":"ch395_close_socket_sn","text":"

    Description

    Close socket

    Input

    Modify

    "},{"location":"2024.1/assembly/#ch395_dhcp_enable","title":"ch395_dhcp_enable","text":"

    Input

    Modify

    "},{"location":"2024.1/assembly/#ch395_get_cmd_status","title":"ch395_get_cmd_status","text":""},{"location":"2024.1/assembly/#ch395_get_ic_ver","title":"ch395_get_ic_ver","text":""},{"location":"2024.1/c/","title":"C","text":""},{"location":"2024.1/c/#c","title":"C","text":""},{"location":"2024.1/c/#_1","title":"C","text":""},{"location":"2024.1/c/#void-ch395_clear_recv_buf_snunsigned-char-id_socket","title":"void ch395_clear_recv_buf_sn(unsigned char ID_SOCKET)","text":"

    Description

    Clear receive buffer

    "},{"location":"2024.1/c/#oid-ch395_close_socket_snunsigned-char-id_socket","title":"oid ch395_close_socket_sn(unsigned char ID_SOCKET)","text":"

    Description

    Close socket

    "},{"location":"2024.2/assembly/","title":"Assembly","text":""},{"location":"2024.2/assembly/#assembly","title":"Assembly","text":""},{"location":"2024.2/assembly/#ch376_check_exist","title":"ch376_check_exist","text":"

    Description

    If ch376 is present, it will return $AA

    Modify

    Returns

    Example

     jsr ch376_check_exist\ncmp #$AA\nbeq @exists\nrts ; Does not exist\n@exists:\n...\n
    "},{"location":"2024.2/assembly/#ch376_dir_create","title":"ch376_dir_create","text":"

    Description

    create a folder

    Modify

    Returns

    Example

     jsr ch376_dir_create\n; check accumulator here ch376_wait_response had been launched by ch376_dir_create\n
    "},{"location":"2024.2/assembly/#ch376_disk_capacity","title":"ch376_disk_capacity","text":"

    Description

    check disk capacity

    Impossible to use

    "},{"location":"2024.2/assembly/#ch376_disk_mount","title":"ch376_disk_mount","text":"

    Description

    perform a disk mount

    Modify

    Returns

    Example

     jsr ch376_disk_mount\n; check accumulator here ch376_wait_response had been launched by ch376_disk_mount\n
    "},{"location":"2024.2/assembly/#ch376_disk_query","title":"ch376_disk_query","text":"

    Impossible to use

    "},{"location":"2024.2/assembly/#ch376_file_close","title":"ch376_file_close","text":"

    Description

    Close file

    Modify

    Returns

    Example

     jsr ch376_file_close\n; check accumulator here ch376_wait_response had been launched by ch376_file_close\n
    "},{"location":"2024.2/assembly/#ch376_file_create","title":"ch376_file_create","text":"

    Description

    create file

    Modify

    Returns

    Example

     jsr ch376_file_create\n; check accumulator here ch376_wait_response had been launched by ch376_file_create\n
    "},{"location":"2024.2/assembly/#ch376_file_erase","title":"ch376_file_erase","text":"

    Description

    Erase file

    Modify

    Returns

    Example

     jsr ch376_file_erase\n; Check accumulator here :\n; Ch376_wait_response had been launched\n; By ch376_file_erase\n
    "},{"location":"2024.2/assembly/#ch376_file_open","title":"ch376_file_open","text":"

    Description

    open file

    Modify

    Returns

    Example

     jsr ch376_file_erase\n; check accumulator here ch376_wait_response had been launched by ch376_file_open\nrts\n
    "},{"location":"2024.2/assembly/#ch376_get_descr","title":"ch376_get_descr","text":"

    Description

    Get usb descr device

    Modify

    Returns

    Example

     jsr ch376_get_descr\n; check accumulator here ch376_wait_response had been launched by ch376_get_descr\nrts\n
    "},{"location":"2024.2/assembly/#ch376_get_file_size","title":"ch376_get_file_size","text":"

    Description

    Get file size

    Impossible to use

    "},{"location":"2024.2/assembly/#ch376_ic_get_ver","title":"ch376_ic_get_ver","text":"

    Description

    Get ch376 firmware version

    Modify

    Returns

    Example

     jsr ch376_ic_get_ver\n; check accumulator for Version (integer value)\n
    "},{"location":"2024.2/assembly/#ch376_issue_token_x","title":"ch376_issue_token_x","text":"

    Description

    Send Token for control transfert

    Input

    Modify

    Returns

    Example

     lda #$80\njsr ch376_issue_token_x\n; check accumulator for ch376 status\n
    "},{"location":"2024.2/assembly/#ch376_lib_version","title":"ch376_lib_version","text":"

    Description

    Get lib version

    Modify

    Returns

    Example

     jsr ch376_lib_version\ncmp #CH376_LIB_VERSION_2024_2\nbeq @right_version\n; Wrong version\n...\nrts\n@right_version:\n...\nrts\n
    "},{"location":"2024.2/assembly/#ch376_reset_all","title":"ch376_reset_all","text":"

    Description

    reset CH376

    Modify

    Example

     jsr ch376_reset_all\nrts\n
    "},{"location":"2024.2/assembly/#ch376_seek_file","title":"ch376_seek_file","text":"

    Description

    Seek file. Performs a wait_response

    Input

    Modify

    Returns

    Example

     lda #$04\nsta RES\nlda #$01\nldy #$02\nldx #$03\njsr ch376_seek_file\n; check accumulator here ch376_wait_response had been launched by ch376_seek_file\n

    Not tested

    "},{"location":"2024.2/assembly/#ch376_set_address","title":"ch376_set_address","text":"

    Description

    set usb address

    Modify

    Example

     lda #$02\njsr ch376_set_address\n
    "},{"location":"2024.2/assembly/#ch376_set_bytes_read","title":"ch376_set_bytes_read","text":"

    Description

    Set bytes to read. Manage only 16 bits. Others bytes are set to 0 to provide 32 bits integer to ch376 chip

    Input

    Modify

    Example

     lda #$02\nldy #$10\njsr ch376_set_bytes_read\n
    "},{"location":"2024.2/assembly/#ch376_set_bytes_write","title":"ch376_set_bytes_write","text":"

    Description

    Set bytes to write. Manage only 16 bits. Others bytes are set to 0 to provide 32 bits integer to ch376 chip

    Input

    Modify

    Example

     lda #$02\nldy #$10\njsr ch376_set_bytes_write\n
    "},{"location":"2024.2/assembly/#ch376_set_config","title":"ch376_set_config","text":"

    Description

    set config for usb device

    Input

    Modify

    Example

     lda #$02\njsr ch376_set_config\n
    "},{"location":"2024.2/assembly/#ch376_set_file_name","title":"ch376_set_file_name","text":"

    Description

    set file_name

    Input

    Modify

    *RES * Accumulator * Y Register

    Example

     lda #<myfile\nldy #>myfile\njsr ch376_set_file_name\nrts\nmyfile:\n.byte \"hello.txt\"\n
    "},{"location":"2024.2/assembly/#ch376_set_usb_addr","title":"ch376_set_usb_addr","text":"

    Description

    set usb_address

    Input

    Modify

    Example

    ; Set usb addr\nlda #$02\njsr ch376_set_usb_addr\nrts\n
    "},{"location":"2024.2/assembly/#ch376_set_usb_mode","title":"ch376_set_usb_mode","text":"

    Description

    Set usb mode

    Input

    Modify

    Example

     lda #CH376_USB_MODE_HOST_RESET\njsr ch376_set_usb_mode\nrts\n
    "},{"location":"2024.2/assembly/#ch376_set_usb_speed","title":"ch376_set_usb_speed","text":"

    Description

    Set usb mode

    Input

    Modify

    Example

     lda #$02\njsr ch376_set_usb_speed\nrts\n
    "},{"location":"2024.2/assembly/#ch376_wait_response","title":"ch376_wait_response","text":"

    Description

    Perform wait_response. It's not needed to call because some commands already perform ch376_wait_response

    Modify

    Returns

    Example

     jsr ch376_wait_response\nrts\n
    "},{"location":"2024.2/assembly/#ch376_wr_usb_data","title":"ch376_wr_usb_data","text":"

    Description

    Send data to usb device. First byte must be the the length to send

    Input

    Modify

    Example

     lda #<data\nldx #>data\njsr ch376_wr_usb_data\nrts\ndata:\n; length, set port feature, set feature, port_power,0, Id port, 0, 0, 0\n.byte 8,$23,3,8,0,1,0,0\n
    "},{"location":"2024.2/c/","title":"C","text":""},{"location":"2024.2/c/#c","title":"C","text":""},{"location":"2024.2/c/#unsigned-char-ch376_check_existvoid","title":"unsigned char ch376_check_exist(void);","text":"

    Description

    If ch376 is present, it will return 0XAA

    Returns

    0XAA if it's OK

    "},{"location":"2024.2/c/#unsigned-char-ch376_dir_create","title":"unsigned char ch376_dir_create();","text":"

    Description

    create a folder

    "},{"location":"2024.2/c/#ch376_disk_capacity","title":"ch376_disk_capacity();","text":"

    Description

    check disk capacity

    Impossible to use

    "},{"location":"2024.2/c/#unsigned-char-ch376_disk_mountvoid","title":"unsigned char ch376_disk_mount(void);","text":"

    Description

    perform a disk mount

    Returns

    ch376 status values

    "},{"location":"2024.2/c/#void-ch376_disk_queryvoid","title":"void ch376_disk_query(void);","text":"

    Impossible to use

    "},{"location":"2024.2/c/#unsigned-char-ch376_file_close","title":"unsigned char ch376_file_close();","text":"

    Returns

    ch376 status values

    "},{"location":"2024.2/c/#unsigned-char-ch376_dir_create_1","title":"unsigned char ch376_dir_create();","text":"

    Description

    create file

    Returns

    ch376 status values

    "},{"location":"2024.2/c/#unsigned-char-ch376_file_erase","title":"unsigned char ch376_file_erase();","text":"

    Description

    erase file

    Returns

    ch376 status value

    "},{"location":"2024.2/c/#unsigned-char-ch376_file_openvoid","title":"unsigned char ch376_file_open(void);","text":"

    Description

    open file

    Returns

    'ch376 status' value

    "},{"location":"2024.2/c/#unsigned-char-ch376_get_descrunsigned-char-mode","title":"unsigned char ch376_get_descr(unsigned char mode);","text":"

    Description

    Get usb descr device

    Returns

    ch376 status values

    "},{"location":"2024.2/c/#void-ch376_get_file_sizevoid","title":"void ch376_get_file_size(void);","text":"

    Impossible to use

    "},{"location":"2024.2/c/#unsigned-char-ch376_ic_get_versionvoid","title":"unsigned char ch376_ic_get_version(void);","text":"

    Description

    Get ch376 firmware version

    Returns

    ch376 firmware version

    "},{"location":"2024.2/c/#void-ch376_issue_token_xunsigned-char-token","title":"void ch376_issue_token_x(unsigned char token)","text":"

    Description

    Send Token for control transfert

    "},{"location":"2024.2/c/#unsigned-char-ch376_lib_versionvoid","title":"unsigned char ch376_lib_version(void);","text":"

    Description

    Get lib version

    Returns

    ch376 lib version

    "},{"location":"2024.2/c/#void-ch376_reset_allvoid","title":"void ch376_reset_all(void);","text":"

    Description

    reset CH376

    "},{"location":"2024.2/c/#unsigned-int-ch376_seek_filelong-position","title":"unsigned int ch376_seek_file(long position);","text":"

    Description

    Seek file

    Returns

    ch376 status values

    "},{"location":"2024.2/c/#void-ch376_set_addressunsigned-char-adress","title":"void ch376_set_address(unsigned char adress);","text":"

    Description

    set usb address

    "},{"location":"2024.2/c/#void-ch376_set_bytes_writeunsigned-int-nb","title":"void ch376_set_bytes_write(unsigned int nb);","text":""},{"location":"2024.2/c/#void-ch376_set_bytes_readunsigned-int-nb","title":"void ch376_set_bytes_read(unsigned int nb);","text":""},{"location":"2024.2/c/#void-ch376_set_configunsigned-char-config","title":"void ch376_set_config(unsigned char config);","text":"

    Description

    set config for usb device

    "},{"location":"2024.2/c/#void-ch376_set_file_namechar-filename","title":"void ch376_set_file_name(char *filename);","text":"

    Description

    set file_name

    "},{"location":"2024.2/c/#void-ch376_set_usb_addrunsigned-char-adress","title":"void ch376_set_usb_addr(unsigned char adress);","text":"

    Description

    set usb_address

    "},{"location":"2024.2/c/#void-ch376_set_usb_modeunsigned-char-mode","title":"void ch376_set_usb_mode(unsigned char mode);","text":"

    Description

    Set usb mode

    Input

    "},{"location":"2024.2/c/#void-ch376_set_usb_speedunsigned-char-speed","title":"void ch376_set_usb_speed(unsigned char speed);","text":"

    Description

    Set usb mode

    Input

    "},{"location":"2024.2/c/#unsigned-char-ch376_wait_responsevoid","title":"unsigned char ch376_wait_response(void);","text":"

    Description

    Perform wait_response

    Returns

    \"ch376 status\" values

    "},{"location":"2024.2/c/#void-ch376_wr_usb_datachar-data","title":"void ch376_wr_usb_data(char *data);","text":"

    Description

    Send data to usb device. First byte must be the the length to send

    "},{"location":"2024.2/ch376.inc/","title":"Ch376.inc","text":"

    CH376_LIB_VERSION_2023_4 = $00 CH376_LIB_VERSION_2024_1 = $01 CH376_LIB_VERSION_2024_2 = $02 * CH376_DETECTED = $AA * CH376_NONE = $00 CH376_GET_IC_VER = $01 CH376_SET_BAUDRATE = $02 CH376_GET_ENTER_SLEEP = $03 CH276_SET_USB_SPEED = $04 CH376_RESET_ALL = $05 CH376_CHECK_EXIST = $06 CH376_GET_REGISTER = $0A CH376_GET_DEV_RATE = $0A CH376_SET_REGISTER = $0B CH376_SET_SD0 = $0B CH376_WRITE_VAR8 = $0B CH376_GET_FILE_SIZE = $0C ; Get the current file length CH376_READ_VAR32 = $0C CH376_WRITE_VAR32 = $0D CH376_DELAY_100US = $0F CH376_SET_USB_ADDR = $13 CH376_SET_USB_MODE = $15 CH376_TEST_CONNECT = $16 CH376_ABORT_NAK = $17 CH376_SET_EP0_RX = $18 CH376_SET_EP0_TX = $19 CH376_SET_EP1_RX = $1A CH376_SET_EP1_TX = $1B CH376_SET_EP2_RX = $1C CH376_SET_EP2_TX = $1D CH376_GET_STATUS = $22 CH376_UNLOCK_USB = $23 ; From CH375 datasheet CH376_DIRTY_BUFFER = $25 CH376_RD_USB_DATA0 = $27 CH376_RD_USB_DATA_UNLOCK = $28 ; From CH375 datasheet CH376_WR_EP0 = $29 ; DATA3 CH376_WR_EP1 = $2A ; DATA5 CH376_WR_EP2 = $2B ; DATA7 CH376_WR_USB_DATA = $2C CH376_WR_REQ_DATA = $2D CH376_OFS_DATA = $2E CH376_SET_FILE_NAME = $2F CH376_DISK_CONNECT = $30 ; check the disk connection status CH376_DISK_MOUNT = $31 CH376_FILE_OPEN = $32 CH376_FILE_ENUM_GO = $33 CH376_CMD_FILE_CREATE = $34 CH376_FILE_ERASE = $35 CH376_FILE_CLOSE = $36 CH376_DIR_INFO_READ = $37 CH376_DIR_INFO_SAVE = $38 CH376_BYTE_LOCATE = $39 CH376_BYTE_READ = $3A CH376_BYTE_RD_GO = $3B CH376_BYTE_WRITE = $3C CH376_BYTE_WR_GO = $3D CH376_DISK_CAPACITY = $3E CH376_DISK_QUERY = $3F CH376_DIR_CREATE = $40 CH376_CLR_STALL = $41 CH376_SET_ADRESS = $45 CH376_CMD_GET_DESCR = $46 CH376_CMD_SET_CONFIG = $49 ; Set USB configuration CH376_SEC_READ = $4B CH376_SEC_WRITE = $4C CH376_AUTO_SETUP = $4D CH376_ISSUE_TKN_X = $4E ; Send synchronization token and execute transactions CH376_DISC_BOC = $50 CH376_DISK_INIT = $51 ; Init USB memory CH376_DISK_RESET = $52 CH376_DISK_SIZE = $53 ; Get The maximum capacity of the USB memory CH376_DISC_READ = $54 CH376_DISK_RD_GO = $55 CH376_DISK_WRITE = $56 CH376_DISK_WR_GO = $57 CH376_DISK_INQUIRY = $58 CH376_DISK_READY = $59 CH376_DISK_R_SENSE = $5A CH376_RD_DISK_SEC = $5B CH376_WR_DISK_SEC = $5C CH376_DISK_MAX_LUN = $5D * ; CODE FOR CH376_SET_USB_MODE * CH376_USB_MODE_DEVICE_INVALID = $00 CH376_USB_MODE_DEVICE_OUTER_FW = $01 CH376_USB_MODE_DEVICE_INNER_FW = $02 CH376_USB_MODE_CODE_SDCARD = $03 ; The code of 06H means switch to valid USB-HOST, produce SOF package automatically. CH376_USB_MODE_CODE_USB_HOST_SOF_PACKAGE_AUTOMATICALLY = $06 CH376_USB_MODE_HOST_RESET = $07 * CH376_ERR_OPEN_DIR = $41 CH376_ERR_MISS_FILE = $42 CH376_ERR_FOUND_NAME = $43 CH376_ERR_DISK_DISCON = $82 CH376_ERR_LARGE_SECTOR = $84 CH376_ERR_TYPE_ERROR = $92 CH376_ERR_BPB_ERROR = $A1 CH376_ERR_DISK_FULL = $B1 CH376_ERR_FDT_OVER = $B2 CH376_ERR_FILE_CLOSE = $B4 * * CH376_USB_INT_SUCCESS = $14 CH376_USB_INT_CONNECT = $15 CH376_USB_INT_DISCONNECT = $16 CH376_USB_INT_BUF_OVER = $17 CH376_USB_INT_USB_READY = $18 CH376_USB_INT_DISK_READ = $1D CH376_USB_INT_DISK_WRITE = $1E CH376_USB_INT_DISK_ERR = $1F * CH376_ST_RET_SUCCESS = $51 CH376_ST_RET_ABORT = $5F * * * ; / * Informations de base du syst\u00e8me actuel * / ; / * Le bit 6 est utilis\u00e9 pour indiquer la sous-classe du p\u00e9riph\u00e9rique de stockage USB SubClass-Code, le bit 6 est 0 pour indiquer que la sous-classe est 6 et le bit 6 est 1 pour indiquer que la sous-classe est diff\u00e9rente de 6 * / ; / * Le bit 5 est utilis\u00e9 pour indiquer l'\u00e9tat de la configuration USB en mode p\u00e9riph\u00e9rique USB et l'\u00e9tat de la connexion du p\u00e9riph\u00e9rique USB en mode h\u00f4te USB * / ; / * En mode p\u00e9riph\u00e9rique USB, si le bit 5 est 1, la configuration USB est termin\u00e9e et les bits 5 et 0 ne sont pas configur\u00e9s * / ; / * En mode h\u00f4te USB, si le bit 5 est 1, il y a un p\u00e9riph\u00e9rique USB dans le port USB, et si le bit 5 est 0, il n'y a pas de p\u00e9riph\u00e9rique USB dans le port USB * / ; / * Le bit 4 est utilis\u00e9 pour indiquer l'\u00e9tat de verrouillage du tampon en mode p\u00e9riph\u00e9rique USB. Le bit 4 est 1 signifie que le tampon USB est verrouill\u00e9 et le bit 6 est 1 signifie qu'il a \u00e9t\u00e9 lib\u00e9r\u00e9 * / ; / * Autres bits, r\u00e9serv\u00e9s, veuillez ne pas modifier * / VAR_SYS_BASE_INFO = $20 * ; / * Nombre de tentatives d'op\u00e9ration de transaction USB * / ; / * Si le bit 7 est 0, il ne r\u00e9essayera pas lorsque NAK est re\u00e7u, le bit 7 est 1 et le bit 6 est 0, et r\u00e9essayera \u00e0 l'infini lors de la r\u00e9ception de NAK (vous pouvez utiliser la commande CMD_ABORT_NAK pour abandonner la nouvelle tentative), le bit 7 est 1 et 6 est 1 R\u00e9essayez au plus 3 secondes lors de la r\u00e9ception de NAK * / ; / * Bit 5 ~ Bit 0 repr\u00e9sente le nombre de tentatives apr\u00e8s l'expiration du d\u00e9lai * / VAR_RETRY_TIMES = $25 * ; / * Indicateur de bit en mode fichier h\u00f4te * / ; / * Bit 1 et Bit 0, l'indicateur du syst\u00e8me de fichiers FAT du disque logique, 00-FAT12, 01-FAT16, 10-FAT32, 11-ill\u00e9gal * / ; / * Bit 2, indique si les donn\u00e9es de la table FAT dans le tampon courant ont \u00e9t\u00e9 modifi\u00e9es, 0-non modifi\u00e9, 1-modifi\u00e9 * / ; / * Bit 3, la longueur du fichier doit \u00eatre modifi\u00e9e, le fichier actuel est ajout\u00e9 avec les donn\u00e9es, 0-Aucune modification n'est pas ajout\u00e9e, 1-Ajout\u00e9 et doit \u00eatre modifi\u00e9 * / ; / * Autres bits, r\u00e9serv\u00e9s, veuillez ne pas modifier * / VAR_FILE_BIT_FLAG = $26 * ; / * \u00c9tat du disque et du fichier en mode fichier h\u00f4te * / ; VAR_SD_BIT_FLAG 0x30 / * Indicateur de bit de la carte SD en mode fichier h\u00f4te * / ; / * Bit 0, version de la carte SD, 0- prend uniquement en charge la premi\u00e8re version SD, 1- prend en charge la deuxi\u00e8me version SD * / ; / * Bit 1, reconnaissance automatique, carte 0-SD, carte 1-MMC * / ; / * Bit 2, identification automatique, carte SD de capacit\u00e9 standard 0, carte SD 1 grande capacit\u00e9 (HC-SD) * / ; / * Bit 4, d\u00e9lai d'expiration de la commande ACMD41 * / ; / * Bit 5, d\u00e9lai d'expiration de la commande CMD1 * / ; / * Bit 6, d\u00e9lai d'expiration de la commande CMD58 * / ; / * Autres bits, r\u00e9serv\u00e9s, veuillez ne pas modifier * / VAR_DISK_STATUS = $2B * ; / * L'indicateur de synchronisation du point de terminaison BULK-IN / BULK-OUT du p\u00e9riph\u00e9rique de stockage USB * / ; / * Bit 7, indicateur de synchronisation de point de terminaison en bloc * / ; / * Bit 6, indicateur de synchronisation de point de terminaison en bloc * / ; / * Bit 5 ~ Bit 0, doit \u00eatre 0 * / VAR_UDISK_TOGGLE = $31 * ; / * Le num\u00e9ro d'unit\u00e9 logique du p\u00e9riph\u00e9rique de stockage USB * / ; / * Bit 7 ~ Bit 4, le num\u00e9ro d'unit\u00e9 logique actuel du p\u00e9riph\u00e9rique de stockage USB, apr\u00e8s que CH376 initialise le p\u00e9riph\u00e9rique de stockage USB, la valeur par d\u00e9faut est d'acc\u00e9der \u00e0 0 # unit\u00e9 logique * / ; / * Bit 3 ~ Bit 0, le num\u00e9ro d'unit\u00e9 logique maximum du p\u00e9riph\u00e9rique de stockage USB, plus 1 est \u00e9gal au nombre d'unit\u00e9s logiques * / VAR_UDISK_LUN = $34 * ; / * Le nombre de secteurs par cluster du disque logique * / VAR_SEC_PER_CLUS = $38 ; / * Le num\u00e9ro d'index des informations de r\u00e9pertoire de fichiers en cours dans le secteur * / VAR_FILE_DIR_INDEX = $3B * ; / * Le d\u00e9calage de secteur du pointeur de fichier actuel dans le cluster, 0xFF pointe vers la fin du fichier, la fin du cluster * / VAR_CLUS_SEC_OFS = $3C * ;/ * Variable 32 bits / 4 octets * / ; / * Pour les disques FAT16, c'est le nombre de secteurs occup\u00e9s par le r\u00e9pertoire racine, et pour les disques FAT32, c'est le num\u00e9ro de cluster de d\u00e9part du r\u00e9pertoire racine (longueur totale 32 bits, octet de poids faible en premier) * / VAR_DISK_ROOT = $44 * ; / * Le nombre total de clusters du disque logique (la longueur totale est de 32 bits, octet de poids faible en premier) * / VAR_DSK_TOTAL_CLUS = $48 * ; / * Le num\u00e9ro de secteur absolu de d\u00e9part du disque logique LBA (longueur totale 32 bits, octet de poids faible en premier) * / VAR_DSK_START_LBA = $4C * ; / * LBA de d\u00e9part de la zone de donn\u00e9es du disque logique (la longueur totale est de 32 bits, octet de poids faible en premier) * / VAR_DSK_DAT_START = $50 * ; / * LBA correspondant aux donn\u00e9es du tampon de donn\u00e9es actuel du disque (longueur totale 32 bits, octet de poids faible en premier) * / VAR_LBA_BUFFER = $54 * ; / * L'adresse LBA de d\u00e9part du disque actuellement lu et \u00e9crit (la longueur totale est de 32 bits, octet de poids faible en premier) * / VAR_LBA_CURRENT = $58 * ; / * L'adresse LBA du secteur o\u00f9 se trouvent les informations du r\u00e9pertoire de fichiers en cours (longueur totale 32 bits, octet de poids faible en premier) * / VAR_FAT_DIR_LBA = $5C * ; / * Le num\u00e9ro de cluster de d\u00e9part du fichier ou du r\u00e9pertoire (dossier) actuel (longueur totale 32 bits, octet de poids faible en premier) * / VAR_START_CLUSTER = $60 * ; / * Le num\u00e9ro de cluster actuel du fichier actuel (la longueur totale est de 32 bits, octet de poids faible en premier) * / VAR_CURRENT_CLUST = $64 * ; / * La longueur du fichier actuel (la longueur totale est de 32 bits, octet de poids faible en premier) * / VAR_FILE_SIZE = $68 * ; / * Le pointeur de fichier actuel, le d\u00e9calage d'octet de la position actuelle de lecture et d'\u00e9criture (longueur totale 32 bits, octet de poids faible en premier) * / *VAR_CURRENT_OFFSET = $6C

    "}]} \ No newline at end of file +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Introduction","text":"

    This lib is used to manage ch395 chip for 6502 cpu

    "},{"location":"assembly/","title":"Assembly","text":""},{"location":"assembly/#assembly","title":"Assembly","text":""},{"location":"assembly/#ch395_check_exist","title":"ch395_check_exist","text":"

    Description

    Checks if ch395 exists

    Modify

    Returns

    "},{"location":"assembly/#ch395_clear_recv_buf_sn","title":"ch395_clear_recv_buf_sn","text":"

    Description

    Clear receive buffer

    Modify

    "},{"location":"assembly/#ch395_close_socket_sn","title":"ch395_close_socket_sn","text":"

    Description

    Close socket

    Input

    Modify

    "},{"location":"assembly/#ch395_dhcp_enable","title":"ch395_dhcp_enable","text":"

    Input

    Modify

    "},{"location":"assembly/#ch395_get_cmd_status","title":"ch395_get_cmd_status","text":""},{"location":"assembly/#ch395_get_dhcp_status","title":"ch395_get_dhcp_status","text":""},{"location":"assembly/#ch395_get_glob_int_status","title":"ch395_get_glob_int_status","text":""},{"location":"assembly/#ch395_get_ic_ver","title":"ch395_get_ic_ver","text":"

    Description

    Get ch395 firmware version

    "},{"location":"assembly/#ch395_get_int_status_sn","title":"ch395_get_int_status_sn","text":""},{"location":"assembly/#ch395_get_mac_adress","title":"ch395_get_mac_adress","text":""},{"location":"assembly/#ch395_get_phy_status","title":"ch395_get_phy_status","text":""},{"location":"assembly/#ch395_get_recv_len_sn","title":"ch395_get_recv_len_sn","text":""},{"location":"assembly/#ch395_get_remot_ipp_sn","title":"ch395_get_remot_ipp_sn","text":""},{"location":"assembly/#ch395_get_socket_status_sn","title":"ch395_get_socket_status_sn","text":""},{"location":"c/","title":"C","text":""},{"location":"c/#c","title":"C","text":""},{"location":"c/#_1","title":"C","text":""},{"location":"c/#void-ch395_clear_recv_buf_snunsigned-char-id_socket","title":"void ch395_clear_recv_buf_sn(unsigned char ID_SOCKET)","text":"

    Description

    Clear receive buffer

    "},{"location":"c/#oid-ch395_close_socket_snunsigned-char-id_socket","title":"oid ch395_close_socket_sn(unsigned char ID_SOCKET)","text":"

    Description

    Close socket

    Description

    Get ch395 firmware version

    "},{"location":"c/#unsigned-char-ch395_get_int_status_snunsigned-char-id_socket","title":"unsigned char ch395_get_int_status_sn(unsigned char ID_SOCKET);","text":""},{"location":"c/#void-ch395_get_recv_len_snunsigned-char-id_socket","title":"void ch395_get_recv_len_sn(unsigned char ID_SOCKET)","text":""},{"location":"c/#unsigned-int-ch395_get_socket_status_snunsigned-char-id_socket","title":"unsigned int ch395_get_socket_status_sn(unsigned char ID_SOCKET);","text":""},{"location":"2024.1/assembly/","title":"Assembly","text":""},{"location":"2024.1/assembly/#assembly","title":"Assembly","text":""},{"location":"2024.1/assembly/#ch395_check_exist","title":"ch395_check_exist","text":"

    Description

    Checks if ch395 exists

    Modify

    Returns

    "},{"location":"2024.1/assembly/#ch395_clear_recv_buf_sn","title":"ch395_clear_recv_buf_sn","text":"

    Description

    Clear receive buffer

    Modify

    "},{"location":"2024.1/assembly/#ch395_close_socket_sn","title":"ch395_close_socket_sn","text":"

    Description

    Close socket

    Input

    Modify

    "},{"location":"2024.1/assembly/#ch395_dhcp_enable","title":"ch395_dhcp_enable","text":"

    Input

    Modify

    "},{"location":"2024.1/assembly/#ch395_get_cmd_status","title":"ch395_get_cmd_status","text":""},{"location":"2024.1/assembly/#ch395_get_dhcp_status","title":"ch395_get_dhcp_status","text":""},{"location":"2024.1/assembly/#ch395_get_glob_int_status","title":"ch395_get_glob_int_status","text":""},{"location":"2024.1/assembly/#ch395_get_ic_ver","title":"ch395_get_ic_ver","text":"

    Description

    Get ch395 firmware version

    "},{"location":"2024.1/assembly/#ch395_get_int_status_sn","title":"ch395_get_int_status_sn","text":""},{"location":"2024.1/assembly/#ch395_get_mac_adress","title":"ch395_get_mac_adress","text":""},{"location":"2024.1/assembly/#ch395_get_phy_status","title":"ch395_get_phy_status","text":""},{"location":"2024.1/assembly/#ch395_get_recv_len_sn","title":"ch395_get_recv_len_sn","text":""},{"location":"2024.1/assembly/#ch395_get_remot_ipp_sn","title":"ch395_get_remot_ipp_sn","text":""},{"location":"2024.1/assembly/#ch395_get_socket_status_sn","title":"ch395_get_socket_status_sn","text":""},{"location":"2024.1/c/","title":"C","text":""},{"location":"2024.1/c/#c","title":"C","text":""},{"location":"2024.1/c/#_1","title":"C","text":""},{"location":"2024.1/c/#void-ch395_clear_recv_buf_snunsigned-char-id_socket","title":"void ch395_clear_recv_buf_sn(unsigned char ID_SOCKET)","text":"

    Description

    Clear receive buffer

    "},{"location":"2024.1/c/#oid-ch395_close_socket_snunsigned-char-id_socket","title":"oid ch395_close_socket_sn(unsigned char ID_SOCKET)","text":"

    Description

    Close socket

    Description

    Get ch395 firmware version

    "},{"location":"2024.1/c/#unsigned-char-ch395_get_int_status_snunsigned-char-id_socket","title":"unsigned char ch395_get_int_status_sn(unsigned char ID_SOCKET);","text":""},{"location":"2024.1/c/#void-ch395_get_recv_len_snunsigned-char-id_socket","title":"void ch395_get_recv_len_sn(unsigned char ID_SOCKET)","text":""},{"location":"2024.1/c/#unsigned-int-ch395_get_socket_status_snunsigned-char-id_socket","title":"unsigned int ch395_get_socket_status_sn(unsigned char ID_SOCKET);","text":""}]} \ No newline at end of file diff --git a/docs/api/sitemap.xml.gz b/docs/api/sitemap.xml.gz index faf1c03c7c179409a928b20062151dbed73dbc30..0d02f2d1adb7a8b0255e8709fddec0b02023f351 100644 GIT binary patch delta 12 Tcmb=gXOr*d;FxPTk*yK{7nK8@ delta 12 Tcmb=gXOr*d;0V>9$W{pe79|5y diff --git a/docs/code/2024.1/assembly.md b/docs/code/2024.1/assembly.md index 6bdd564..0a08101 100644 --- a/docs/code/2024.1/assembly.md +++ b/docs/code/2024.1/assembly.md @@ -60,7 +60,43 @@ Close socket +## ch395_get_dhcp_status + + + +## ch395_get_glob_int_status + + + ## ch395_get_ic_ver +***Description*** + +Get ch395 firmware version + + + +## ch395_get_int_status_sn + + + +## ch395_get_mac_adress + + + +## ch395_get_phy_status + + + +## ch395_get_recv_len_sn + + + +## ch395_get_remot_ipp_sn + + + +## ch395_get_socket_status_sn + diff --git a/docs/code/2024.1/c.md b/docs/code/2024.1/c.md index f613615..e856629 100644 --- a/docs/code/2024.1/c.md +++ b/docs/code/2024.1/c.md @@ -28,6 +28,14 @@ Close socket +***Description*** + +Get ch395 firmware version + + + +## unsigned char ch395_get_int_status_sn(unsigned char ID_SOCKET); + @@ -36,11 +44,13 @@ Close socket +## void ch395_get_recv_len_sn(unsigned char ID_SOCKET) +## unsigned int ch395_get_socket_status_sn(unsigned char ID_SOCKET); diff --git a/docs/code/2024.2/assembly.md b/docs/code/2024.2/assembly.md deleted file mode 100644 index 09b97f8..0000000 --- a/docs/code/2024.2/assembly.md +++ /dev/null @@ -1,652 +0,0 @@ -# Assembly - -## ch376_check_exist - -***Description*** - -If ch376 is present, it will return $AA - - -***Modify*** - -* Accumulator - -***Returns*** - -* Accumulator : $AA if it's OK - - -***Example*** - -```ca65 - jsr ch376_check_exist - cmp #$AA - beq @exists - rts ; Does not exist -@exists: -... -``` - - - -## ch376_dir_create - -***Description*** - -create a folder - - -***Modify*** - -* Accumulator -* X Register From ch376_wait_response_call -* Y Register From ch376_wait_response_call - -***Returns*** - -* Accumulator : ch376 status values - - -***Example*** - -```ca65 - jsr ch376_dir_create - ; check accumulator here ch376_wait_response had been launched by ch376_dir_create -``` - - - -## ch376_disk_capacity - -***Description*** - -check disk capacity - -!!! bug "Impossible to use" - - -## ch376_disk_mount - -***Description*** - -perform a disk mount - - -***Modify*** - -* Accumulator -* X Register From ch376_wait_response_call -* Y Register From ch376_wait_response_call - -***Returns*** - -* Accumulator : ch376 status values - - -***Example*** - -```ca65 - jsr ch376_disk_mount - ; check accumulator here ch376_wait_response had been launched by ch376_disk_mount -``` - - - -## ch376_disk_query - -!!! bug "Impossible to use" - - -## ch376_file_close - -***Description*** - -Close file - - -***Modify*** - -* Accumulator -* X Register From ch376_wait_response_call -* Y Register From ch376_wait_response_call - -***Returns*** - -* Accumulator : 'ch376 status' value - - -***Example*** - -```ca65 - jsr ch376_file_close - ; check accumulator here ch376_wait_response had been launched by ch376_file_close -``` - - - -## ch376_file_create - -***Description*** - -create file - - -***Modify*** - -* Accumulator -* X Register From ch376_wait_response_call -* Y Register From ch376_wait_response_call - -***Returns*** - -* Accumulator : ch376 status value - - -***Example*** - -```ca65 - jsr ch376_file_create - ; check accumulator here ch376_wait_response had been launched by ch376_file_create -``` - - - -## ch376_file_erase - -***Description*** - -Erase file - - -***Modify*** - -* Accumulator -* X Register From ch376_wait_response_call -* Y Register From ch376_wait_response_call - -***Returns*** - -* Accumulator : ch376 status value - - -***Example*** - -```ca65 - jsr ch376_file_erase - ; Check accumulator here : - ; Ch376_wait_response had been launched - ; By ch376_file_erase -``` - - - -## ch376_file_open - -***Description*** - -open file - - -***Modify*** - -* Accumulator -* X Register From ch376_wait_response_call -* Y Register From ch376_wait_response_call - -***Returns*** - -* Accumulator : 'ch376 status' value - - -***Example*** - -```ca65 - jsr ch376_file_erase - ; check accumulator here ch376_wait_response had been launched by ch376_file_open - rts -``` - - - -## ch376_get_descr - -***Description*** - -Get usb descr device - - -***Modify*** - -* X Register -* Y Register From ch376_wait_response_call - -***Returns*** - -* Accumulator : ch376 status values - - -***Example*** - -```ca65 - jsr ch376_get_descr - ; check accumulator here ch376_wait_response had been launched by ch376_get_descr - rts -``` - - - -## ch376_get_file_size - -***Description*** - -Get file size - -!!! bug "Impossible to use" - - -## ch376_ic_get_ver - -***Description*** - -Get ch376 firmware version - - -***Modify*** - -* Accumulator - -***Returns*** - -* Accumulator : ch376 firmware version - - -***Example*** - -```ca65 - jsr ch376_ic_get_ver - ; check accumulator for Version (integer value) -``` - - - -## ch376_issue_token_x - -***Description*** - -Send Token for control transfert - -***Input*** - -* Accumulator : ch376 Token - -***Modify*** - -* Accumulator -* X Register -* Y Register From ch376_wait_response - -***Returns*** - -* Accumulator : ch376 status - - -***Example*** - -```ca65 - lda #$80 - jsr ch376_issue_token_x - ; check accumulator for ch376 status -``` - - - -## ch376_lib_version - -***Description*** - -Get lib version - - -***Modify*** - -* Accumulator - -***Returns*** - -* Accumulator : ch376 lib version - - -***Example*** - -```ca65 - jsr ch376_lib_version - cmp #CH376_LIB_VERSION_2024_2 - beq @right_version - ; Wrong version -... - rts -@right_version: -... - rts -``` - - - -## ch376_reset_all - -***Description*** - -reset CH376 - - -***Modify*** - -* Accumulator -* X Register -* Y Register - -***Example*** - -```ca65 - jsr ch376_reset_all - rts -``` - - - -## ch376_seek_file - -***Description*** - -Seek file. Performs a wait_response - -***Input*** - -* Accumulator : First byte -* Y Register : second byte -* X Register : third byte byte -* RES : Fourth byte - -***Modify*** - -* Accumulator -* X Register from ch376_wait_response call -* Y Register from ch376_wait_response call - -***Returns*** - -* Accumulator : ch376 status values - - -***Example*** - -```ca65 - lda #$04 - sta RES - lda #$01 - ldy #$02 - ldx #$03 - jsr ch376_seek_file - ; check accumulator here ch376_wait_response had been launched by ch376_seek_file -``` - -!!! note "Not tested" - - -## ch376_set_address - -***Description*** - -set usb address - - -***Modify*** - -* X Register - -***Example*** - -```ca65 - lda #$02 - jsr ch376_set_address -``` - - - -## ch376_set_bytes_read - -***Description*** - -Set bytes to read. Manage only 16 bits. Others bytes are set to 0 to provide 32 bits integer to ch376 chip - -***Input*** - -* Accumulator : Low value -* Y Register : High value - -***Modify*** - -* X Register -* Accumulator - -***Example*** - -```ca65 - lda #$02 - ldy #$10 - jsr ch376_set_bytes_read -``` - - - -## ch376_set_bytes_write - -***Description*** - -Set bytes to write. Manage only 16 bits. Others bytes are set to 0 to provide 32 bits integer to ch376 chip - -***Input*** - -* Accumulator : Low value -* Y Register : High value - -***Modify*** - -* X Register -* Accumulator - -***Example*** - -```ca65 - lda #$02 - ldy #$10 - jsr ch376_set_bytes_write -``` - - - -## ch376_set_config - -***Description*** - -set config for usb device - -***Input*** - -* Accumulator : config value - -***Modify*** - -* X Register - -***Example*** - -```ca65 - lda #$02 - jsr ch376_set_config -``` - - - -## ch376_set_file_name - -***Description*** - -set file_name - -***Input*** - -* Accumulator : Low ptr adress of the string, terminated by 0 -* Y Register : High ptr adress of the string, terminated by 0 - -***Modify*** - -*RES -* Accumulator -* Y Register - -***Example*** - -```ca65 - lda #myfile - jsr ch376_set_file_name - rts -myfile: - .byte "hello.txt" -``` - - - -## ch376_set_usb_addr - -***Description*** - -set usb_address - -***Input*** - -* Accumulator : The address to set - -***Modify*** - -* X Register - -***Example*** - -```ca65 -; Set usb addr - lda #$02 - jsr ch376_set_usb_addr - rts -``` - - - -## ch376_set_usb_mode - -***Description*** - -Set usb mode - -***Input*** - -* Accumulator : The usb mode to set - -***Modify*** - -* X Register - -***Example*** - -```ca65 - lda #CH376_USB_MODE_HOST_RESET - jsr ch376_set_usb_mode - rts -``` - - - -## ch376_set_usb_speed - -***Description*** - -Set usb mode - -***Input*** - -* Accumulator : The speed for usb - -***Modify*** - -* X Register - -***Example*** - -```ca65 - lda #$02 - jsr ch376_set_usb_speed - rts -``` - - - -## ch376_wait_response - -***Description*** - -Perform wait_response. It's not needed to call because some commands already perform ch376_wait_response - - -***Modify*** - -* Accumulator -* X Register -* Y Register - -***Returns*** - -* Accumulator : "ch376 status" value (or return 1 if usb controller does not respond) - - -***Example*** - -```ca65 - jsr ch376_wait_response - rts -``` - - - -## ch376_wr_usb_data - -***Description*** - -Send data to usb device. First byte must be the the length to send - -***Input*** - -* Accumulator : Low byte of ptr data -* X Register : High byte of ptr data - -***Modify*** - -* Accumulator -* Y Register -* X Register -*RES - -***Example*** - -```ca65 - lda #data - jsr ch376_wr_usb_data - rts -data: - ; length, set port feature, set feature, port_power,0, Id port, 0, 0, 0 - .byte 8,$23,3,8,0,1,0,0 -``` - - - diff --git a/docs/code/2024.2/c.md b/docs/code/2024.2/c.md deleted file mode 100644 index 0cbb61f..0000000 --- a/docs/code/2024.2/c.md +++ /dev/null @@ -1,232 +0,0 @@ -# C - -## unsigned char ch376_check_exist(void); - -***Description*** - -If ch376 is present, it will return 0XAA - -***Returns*** - -0XAA if it's OK - - -## unsigned char ch376_dir_create(); - -***Description*** - -create a folder - - - -## ch376_disk_capacity(); - -***Description*** - -check disk capacity - -!!! bug "Impossible to use" - - -## unsigned char ch376_disk_mount(void); - -***Description*** - -perform a disk mount - -***Returns*** - -ch376 status values - - -## void ch376_disk_query(void); - -!!! bug "Impossible to use" - - -## unsigned char ch376_file_close(); - -***Returns*** - -ch376 status values - - -## unsigned char ch376_dir_create(); - -***Description*** - -create file - -***Returns*** - -ch376 status values - - -## unsigned char ch376_file_erase(); - -***Description*** - -erase file - -***Returns*** - -ch376 status value - - -## unsigned char ch376_file_open(void); - -***Description*** - -open file - -***Returns*** - -'ch376 status' value - - -## unsigned char ch376_get_descr(unsigned char mode); - -***Description*** - -Get usb descr device - -***Returns*** - -ch376 status values - - -## void ch376_get_file_size(void); - -!!! bug "Impossible to use" - - -## unsigned char ch376_ic_get_version(void); - -***Description*** - -Get ch376 firmware version - -***Returns*** - -ch376 firmware version - - -## void ch376_issue_token_x(unsigned char token) - -***Description*** - -Send Token for control transfert - - - -## unsigned char ch376_lib_version(void); - -***Description*** - -Get lib version - -***Returns*** - -ch376 lib version - - -## void ch376_reset_all(void); - -***Description*** - -reset CH376 - - - -## unsigned int ch376_seek_file(long position); - -***Description*** - -Seek file - -***Returns*** - -ch376 status values - - -## void ch376_set_address(unsigned char adress); - -***Description*** - -set usb address - - - -## void ch376_set_bytes_write(unsigned int nb); - - - -## void ch376_set_bytes_read(unsigned int nb); - - - -## void ch376_set_config(unsigned char config); - -***Description*** - -set config for usb device - - - -## void ch376_set_file_name(char *filename); - -***Description*** - -set file_name - - - -## void ch376_set_usb_addr(unsigned char adress); - -***Description*** - -set usb_address - - - -## void ch376_set_usb_mode(unsigned char mode); - -***Description*** - -Set usb mode - -***Input*** - - - - -## void ch376_set_usb_speed(unsigned char speed); - -***Description*** - -Set usb mode - -***Input*** - - - - -## unsigned char ch376_wait_response(void); - -***Description*** - -Perform wait_response - -***Returns*** - -"ch376 status" values - - -## void ch376_wr_usb_data(char *data); - -***Description*** - -Send data to usb device. First byte must be the the length to send - - - diff --git a/docs/code/2024.2/ch376.inc.md b/docs/code/2024.2/ch376.inc.md deleted file mode 100644 index cae34d3..0000000 --- a/docs/code/2024.2/ch376.inc.md +++ /dev/null @@ -1,204 +0,0 @@ -*CH376_LIB_VERSION_2023_4 = $00 -*CH376_LIB_VERSION_2024_1 = $01 -*CH376_LIB_VERSION_2024_2 = $02 -* -*CH376_DETECTED = $AA -* -*CH376_NONE = $00 -*CH376_GET_IC_VER = $01 -*CH376_SET_BAUDRATE = $02 -*CH376_GET_ENTER_SLEEP = $03 -*CH276_SET_USB_SPEED = $04 -*CH376_RESET_ALL = $05 -*CH376_CHECK_EXIST = $06 -*CH376_GET_REGISTER = $0A -*CH376_GET_DEV_RATE = $0A -*CH376_SET_REGISTER = $0B -*CH376_SET_SD0 = $0B -*CH376_WRITE_VAR8 = $0B -*CH376_GET_FILE_SIZE = $0C ; Get the current file length -*CH376_READ_VAR32 = $0C -*CH376_WRITE_VAR32 = $0D -*CH376_DELAY_100US = $0F -*CH376_SET_USB_ADDR = $13 -*CH376_SET_USB_MODE = $15 -*CH376_TEST_CONNECT = $16 -*CH376_ABORT_NAK = $17 -*CH376_SET_EP0_RX = $18 -*CH376_SET_EP0_TX = $19 -*CH376_SET_EP1_RX = $1A -*CH376_SET_EP1_TX = $1B -*CH376_SET_EP2_RX = $1C -*CH376_SET_EP2_TX = $1D -*CH376_GET_STATUS = $22 -*CH376_UNLOCK_USB = $23 ; From CH375 datasheet -*CH376_DIRTY_BUFFER = $25 -*CH376_RD_USB_DATA0 = $27 -*CH376_RD_USB_DATA_UNLOCK = $28 ; From CH375 datasheet -*CH376_WR_EP0 = $29 ; DATA3 -*CH376_WR_EP1 = $2A ; DATA5 -*CH376_WR_EP2 = $2B ; DATA7 -*CH376_WR_USB_DATA = $2C -*CH376_WR_REQ_DATA = $2D -*CH376_OFS_DATA = $2E -*CH376_SET_FILE_NAME = $2F -*CH376_DISK_CONNECT = $30 ; check the disk connection status -*CH376_DISK_MOUNT = $31 -*CH376_FILE_OPEN = $32 -*CH376_FILE_ENUM_GO = $33 -*CH376_CMD_FILE_CREATE = $34 -*CH376_FILE_ERASE = $35 -*CH376_FILE_CLOSE = $36 -*CH376_DIR_INFO_READ = $37 -*CH376_DIR_INFO_SAVE = $38 -*CH376_BYTE_LOCATE = $39 -*CH376_BYTE_READ = $3A -*CH376_BYTE_RD_GO = $3B -*CH376_BYTE_WRITE = $3C -*CH376_BYTE_WR_GO = $3D -*CH376_DISK_CAPACITY = $3E -*CH376_DISK_QUERY = $3F -*CH376_DIR_CREATE = $40 -*CH376_CLR_STALL = $41 -*CH376_SET_ADRESS = $45 -*CH376_CMD_GET_DESCR = $46 -*CH376_CMD_SET_CONFIG = $49 ; Set USB configuration -*CH376_SEC_READ = $4B -*CH376_SEC_WRITE = $4C -*CH376_AUTO_SETUP = $4D -*CH376_ISSUE_TKN_X = $4E ; Send synchronization token and execute transactions -*CH376_DISC_BOC = $50 -*CH376_DISK_INIT = $51 ; Init USB memory -*CH376_DISK_RESET = $52 -*CH376_DISK_SIZE = $53 ; Get The maximum capacity of the USB memory -*CH376_DISC_READ = $54 -*CH376_DISK_RD_GO = $55 -*CH376_DISK_WRITE = $56 -*CH376_DISK_WR_GO = $57 -*CH376_DISK_INQUIRY = $58 -*CH376_DISK_READY = $59 -*CH376_DISK_R_SENSE = $5A -*CH376_RD_DISK_SEC = $5B -*CH376_WR_DISK_SEC = $5C -*CH376_DISK_MAX_LUN = $5D -* -*; CODE FOR CH376_SET_USB_MODE -* -*CH376_USB_MODE_DEVICE_INVALID = $00 -*CH376_USB_MODE_DEVICE_OUTER_FW = $01 -*CH376_USB_MODE_DEVICE_INNER_FW = $02 -*CH376_USB_MODE_CODE_SDCARD = $03 -*; The code of 06H means switch to valid USB-HOST, produce SOF package automatically. -*CH376_USB_MODE_CODE_USB_HOST_SOF_PACKAGE_AUTOMATICALLY = $06 -*CH376_USB_MODE_HOST_RESET = $07 -* -*CH376_ERR_OPEN_DIR = $41 -*CH376_ERR_MISS_FILE = $42 -*CH376_ERR_FOUND_NAME = $43 -*CH376_ERR_DISK_DISCON = $82 -*CH376_ERR_LARGE_SECTOR = $84 -*CH376_ERR_TYPE_ERROR = $92 -*CH376_ERR_BPB_ERROR = $A1 -*CH376_ERR_DISK_FULL = $B1 -*CH376_ERR_FDT_OVER = $B2 -*CH376_ERR_FILE_CLOSE = $B4 -* -* -*CH376_USB_INT_SUCCESS = $14 -*CH376_USB_INT_CONNECT = $15 -*CH376_USB_INT_DISCONNECT = $16 -*CH376_USB_INT_BUF_OVER = $17 -*CH376_USB_INT_USB_READY = $18 -*CH376_USB_INT_DISK_READ = $1D -*CH376_USB_INT_DISK_WRITE = $1E -*CH376_USB_INT_DISK_ERR = $1F -* -*CH376_ST_RET_SUCCESS = $51 -*CH376_ST_RET_ABORT = $5F -* -* -* -*; / * Informations de base du système actuel * / -*; / * Le bit 6 est utilisé pour indiquer la sous-classe du périphérique de stockage USB SubClass-Code, le bit 6 est 0 pour indiquer que la sous-classe est 6 et le bit 6 est 1 pour indiquer que la sous-classe est différente de 6 * / -*; / * Le bit 5 est utilisé pour indiquer l'état de la configuration USB en mode périphérique USB et l'état de la connexion du périphérique USB en mode hôte USB * / -*; / * En mode périphérique USB, si le bit 5 est 1, la configuration USB est terminée et les bits 5 et 0 ne sont pas configurés * / -*; / * En mode hôte USB, si le bit 5 est 1, il y a un périphérique USB dans le port USB, et si le bit 5 est 0, il n'y a pas de périphérique USB dans le port USB * / -*; / * Le bit 4 est utilisé pour indiquer l'état de verrouillage du tampon en mode périphérique USB. Le bit 4 est 1 signifie que le tampon USB est verrouillé et le bit 6 est 1 signifie qu'il a été libéré * / -*; / * Autres bits, réservés, veuillez ne pas modifier * / -*VAR_SYS_BASE_INFO = $20 -* -*; / * Nombre de tentatives d'opération de transaction USB * / -*; / * Si le bit 7 est 0, il ne réessayera pas lorsque NAK est reçu, le bit 7 est 1 et le bit 6 est 0, et réessayera à l'infini lors de la réception de NAK (vous pouvez utiliser la commande CMD_ABORT_NAK pour abandonner la nouvelle tentative), le bit 7 est 1 et 6 est 1 Réessayez au plus 3 secondes lors de la réception de NAK * / -*; / * Bit 5 ~ Bit 0 représente le nombre de tentatives après l'expiration du délai * / -*VAR_RETRY_TIMES = $25 -* -*; / * Indicateur de bit en mode fichier hôte * / -*; / * Bit 1 et Bit 0, l'indicateur du système de fichiers FAT du disque logique, 00-FAT12, 01-FAT16, 10-FAT32, 11-illégal * / -*; / * Bit 2, indique si les données de la table FAT dans le tampon courant ont été modifiées, 0-non modifié, 1-modifié * / -*; / * Bit 3, la longueur du fichier doit être modifiée, le fichier actuel est ajouté avec les données, 0-Aucune modification n'est pas ajoutée, 1-Ajouté et doit être modifié * / -*; / * Autres bits, réservés, veuillez ne pas modifier * / -*VAR_FILE_BIT_FLAG = $26 -* -*; / * État du disque et du fichier en mode fichier hôte * / -*; VAR_SD_BIT_FLAG 0x30 / * Indicateur de bit de la carte SD en mode fichier hôte * / -*; / * Bit 0, version de la carte SD, 0- prend uniquement en charge la première version SD, 1- prend en charge la deuxième version SD * / -*; / * Bit 1, reconnaissance automatique, carte 0-SD, carte 1-MMC * / -*; / * Bit 2, identification automatique, carte SD de capacité standard 0, carte SD 1 grande capacité (HC-SD) * / -*; / * Bit 4, délai d'expiration de la commande ACMD41 * / -*; / * Bit 5, délai d'expiration de la commande CMD1 * / -*; / * Bit 6, délai d'expiration de la commande CMD58 * / -*; / * Autres bits, réservés, veuillez ne pas modifier * / -*VAR_DISK_STATUS = $2B -* -*; / * L'indicateur de synchronisation du point de terminaison BULK-IN / BULK-OUT du périphérique de stockage USB * / -*; / * Bit 7, indicateur de synchronisation de point de terminaison en bloc * / -*; / * Bit 6, indicateur de synchronisation de point de terminaison en bloc * / -*; / * Bit 5 ~ Bit 0, doit être 0 * / -*VAR_UDISK_TOGGLE = $31 -* -*; / * Le numéro d'unité logique du périphérique de stockage USB * / -*; / * Bit 7 ~ Bit 4, le numéro d'unité logique actuel du périphérique de stockage USB, après que CH376 initialise le périphérique de stockage USB, la valeur par défaut est d'accéder à 0 # unité logique * / -*; / * Bit 3 ~ Bit 0, le numéro d'unité logique maximum du périphérique de stockage USB, plus 1 est égal au nombre d'unités logiques * / -*VAR_UDISK_LUN = $34 -* -*; / * Le nombre de secteurs par cluster du disque logique * / -*VAR_SEC_PER_CLUS = $38 -*; / * Le numéro d'index des informations de répertoire de fichiers en cours dans le secteur * / -*VAR_FILE_DIR_INDEX = $3B -* -*; / * Le décalage de secteur du pointeur de fichier actuel dans le cluster, 0xFF pointe vers la fin du fichier, la fin du cluster * / -*VAR_CLUS_SEC_OFS = $3C -* -*;/ * Variable 32 bits / 4 octets * / -*; / * Pour les disques FAT16, c'est le nombre de secteurs occupés par le répertoire racine, et pour les disques FAT32, c'est le numéro de cluster de départ du répertoire racine (longueur totale 32 bits, octet de poids faible en premier) * / -*VAR_DISK_ROOT = $44 -* -*; / * Le nombre total de clusters du disque logique (la longueur totale est de 32 bits, octet de poids faible en premier) * / -*VAR_DSK_TOTAL_CLUS = $48 -* -*; / * Le numéro de secteur absolu de départ du disque logique LBA (longueur totale 32 bits, octet de poids faible en premier) * / -*VAR_DSK_START_LBA = $4C -* -*; / * LBA de départ de la zone de données du disque logique (la longueur totale est de 32 bits, octet de poids faible en premier) * / -*VAR_DSK_DAT_START = $50 -* -*; / * LBA correspondant aux données du tampon de données actuel du disque (longueur totale 32 bits, octet de poids faible en premier) * / -*VAR_LBA_BUFFER = $54 -* -*; / * L'adresse LBA de départ du disque actuellement lu et écrit (la longueur totale est de 32 bits, octet de poids faible en premier) * / -*VAR_LBA_CURRENT = $58 -* -*; / * L'adresse LBA du secteur où se trouvent les informations du répertoire de fichiers en cours (longueur totale 32 bits, octet de poids faible en premier) * / -*VAR_FAT_DIR_LBA = $5C -* -*; / * Le numéro de cluster de départ du fichier ou du répertoire (dossier) actuel (longueur totale 32 bits, octet de poids faible en premier) * / -*VAR_START_CLUSTER = $60 -* -*; / * Le numéro de cluster actuel du fichier actuel (la longueur totale est de 32 bits, octet de poids faible en premier) * / -*VAR_CURRENT_CLUST = $64 -* -*; / * La longueur du fichier actuel (la longueur totale est de 32 bits, octet de poids faible en premier) * / -*VAR_FILE_SIZE = $68 -* -*; / * Le pointeur de fichier actuel, le décalage d'octet de la position actuelle de lecture et d'écriture (longueur totale 32 bits, octet de poids faible en premier) * / -*VAR_CURRENT_OFFSET = $6C diff --git a/docs/code/assembly.md b/docs/code/assembly.md index 6bdd564..0a08101 100644 --- a/docs/code/assembly.md +++ b/docs/code/assembly.md @@ -60,7 +60,43 @@ Close socket +## ch395_get_dhcp_status + + + +## ch395_get_glob_int_status + + + ## ch395_get_ic_ver +***Description*** + +Get ch395 firmware version + + + +## ch395_get_int_status_sn + + + +## ch395_get_mac_adress + + + +## ch395_get_phy_status + + + +## ch395_get_recv_len_sn + + + +## ch395_get_remot_ipp_sn + + + +## ch395_get_socket_status_sn + diff --git a/docs/code/c.md b/docs/code/c.md index f613615..e856629 100644 --- a/docs/code/c.md +++ b/docs/code/c.md @@ -28,6 +28,14 @@ Close socket +***Description*** + +Get ch395 firmware version + + + +## unsigned char ch395_get_int_status_sn(unsigned char ID_SOCKET); + @@ -36,11 +44,13 @@ Close socket +## void ch395_get_recv_len_sn(unsigned char ID_SOCKET) +## unsigned int ch395_get_socket_status_sn(unsigned char ID_SOCKET); diff --git a/src/6502/_ch395_check_exist.s b/src/6502/_ch395_check_exist.s index a8d364f..dcfff8b 100644 --- a/src/6502/_ch395_check_exist.s +++ b/src/6502/_ch395_check_exist.s @@ -3,7 +3,6 @@ .endif .export _ch395_check_exist - .export ch395_check_exist .proc _ch395_check_exist diff --git a/src/6502/_ch395_get_dhcp_status.s b/src/6502/_ch395_get_dhcp_status.s index b28e464..d490b22 100644 --- a/src/6502/_ch395_get_dhcp_status.s +++ b/src/6502/_ch395_get_dhcp_status.s @@ -3,13 +3,15 @@ .endif .export _ch395_get_dhcp_status +.export ch395_get_dhcp_status + .proc _ch395_get_dhcp_status +.endproc + +.proc ch395_get_dhcp_status lda #CH395_GET_DHCP_STATUS sta CH395_COMMAND_PORT lda CH395_DATA_PORT - - ldx #$00 - rts .endproc diff --git a/src/6502/_ch395_get_glob_int_status.s b/src/6502/_ch395_get_glob_int_status.s index e34d6f8..f9e0b37 100644 --- a/src/6502/_ch395_get_glob_int_status.s +++ b/src/6502/_ch395_get_glob_int_status.s @@ -3,12 +3,14 @@ .endif .export _ch395_get_glob_int_status +.export ch395_get_glob_int_status .proc _ch395_get_glob_int_status +.endproc + +.proc ch395_get_glob_int_status lda #CH395_GET_GLOB_INT_STATUS sta CH395_COMMAND_PORT - lda CH395_DATA_PORT - ;ldx CH395_DATA_PORT rts .endproc diff --git a/src/6502/_ch395_get_ic_ver.s b/src/6502/_ch395_get_ic_ver.s index 3d07351..2610ad2 100644 --- a/src/6502/_ch395_get_ic_ver.s +++ b/src/6502/_ch395_get_ic_ver.s @@ -7,9 +7,11 @@ .export ch395_get_ic_ver .proc _ch395_get_ic_ver + ;;@brief Get ch395 firmware version .endproc .proc ch395_get_ic_ver + ;;@brief Get ch395 firmware version lda #CH395_GET_IC_VER sta CH395_COMMAND_PORT lda CH395_DATA_PORT diff --git a/src/6502/_ch395_get_int_status_sn.s b/src/6502/_ch395_get_int_status_sn.s index ab24117..08f483b 100644 --- a/src/6502/_ch395_get_int_status_sn.s +++ b/src/6502/_ch395_get_int_status_sn.s @@ -3,13 +3,17 @@ .endif .export _ch395_get_int_status_sn -; unsigned char ch395_get_int_status_sn(unsigned char ID_SOCKET); +.export ch395_get_int_status_sn + .proc _ch395_get_int_status_sn + ;;@proto unsigned char ch395_get_int_status_sn(unsigned char ID_SOCKET); +.endproc + +.proc ch395_get_int_status_sn ldx #CH395_GET_INT_STATUS_SN stx CH395_COMMAND_PORT sta CH395_DATA_PORT lda CH395_DATA_PORT - ldx #$00 rts .endproc diff --git a/src/6502/_ch395_get_ip_inf.s b/src/6502/_ch395_get_ip_inf.s index 648a4f8..65c5ea0 100644 --- a/src/6502/_ch395_get_ip_inf.s +++ b/src/6502/_ch395_get_ip_inf.s @@ -2,6 +2,8 @@ .include "../include/ch395.inc" .endif + .include "telestrat.inc" + .export _ch395_get_ip_inf .ifndef ptr1 @@ -16,6 +18,7 @@ sta CH395_COMMAND_PORT ldy #$00 + @loop: lda CH395_DATA_PORT sta (ptr1),y diff --git a/src/6502/_ch395_get_mac_adress.s b/src/6502/_ch395_get_mac_adress.s index 4453912..9d3f985 100644 --- a/src/6502/_ch395_get_mac_adress.s +++ b/src/6502/_ch395_get_mac_adress.s @@ -7,8 +7,12 @@ .endif .export _ch395_get_mac_adress +.export ch395_get_mac_adress .proc _ch395_get_mac_adress +.endproc + +.proc ch395_get_mac_adress sta ptr1 stx ptr1+1 lda #CH395_GET_MAC_ADDR diff --git a/src/6502/_ch395_get_phy_status.s b/src/6502/_ch395_get_phy_status.s index 6735ed0..f34fac3 100644 --- a/src/6502/_ch395_get_phy_status.s +++ b/src/6502/_ch395_get_phy_status.s @@ -3,14 +3,14 @@ .endif .export _ch395_get_phy_status +.export ch395_get_phy_status .proc _ch395_get_phy_status +.endproc + +.proc ch395_get_phy_status lda #CH395_GET_PHY_STATUS sta CH395_COMMAND_PORT lda CH395_DATA_PORT -.ifdef FROM_ASSEMBLY -.else - ldx #$00 -.endif rts .endproc diff --git a/src/6502/_ch395_get_recv_len_sn.s b/src/6502/_ch395_get_recv_len_sn.s index 53a5999..51df0e3 100644 --- a/src/6502/_ch395_get_recv_len_sn.s +++ b/src/6502/_ch395_get_recv_len_sn.s @@ -1,12 +1,15 @@ .ifndef CH395_COMMAND_PORT .include "ch395.inc" -.endif +.endif .export _ch395_get_recv_len_sn - -; void ch395_get_recv_len_sn(unsigned char ID_SOCKET) +.export ch395_get_recv_len_sn .proc _ch395_get_recv_len_sn + ;;@proto void ch395_get_recv_len_sn(unsigned char ID_SOCKET) +.endproc + +.proc ch395_get_recv_len_sn ldx #CH395_GET_RECV_LEN_SN stx CH395_COMMAND_PORT sta CH395_DATA_PORT ; send socket diff --git a/src/6502/_ch395_get_remot_ipp_sn.s b/src/6502/_ch395_get_remot_ipp_sn.s index 7790754..4f5c68d 100644 --- a/src/6502/_ch395_get_remot_ipp_sn.s +++ b/src/6502/_ch395_get_remot_ipp_sn.s @@ -10,8 +10,13 @@ ; _ch395_get_remot_ipp_sn(unsigned char *ptr, unsigned char socket) .export _ch395_get_remot_ipp_sn +.export ch395_get_remot_ipp_sn .proc _ch395_get_remot_ipp_sn +.endproc + + +.proc ch395_get_remot_ipp_sn .ifdef FROM_ASSEMBLY sty ptr1 diff --git a/src/6502/_ch395_get_socket_status_sn.s b/src/6502/_ch395_get_socket_status_sn.s index e0c0445..a62578a 100644 --- a/src/6502/_ch395_get_socket_status_sn.s +++ b/src/6502/_ch395_get_socket_status_sn.s @@ -6,11 +6,11 @@ .export _ch395_get_socket_status_sn .export ch395_get_socket_status_sn -; unsigned int ch395_get_socket_status_sn(unsigned char ID_SOCKET); - -ch395_get_socket_status_sn = _ch395_get_socket_status_sn - .proc _ch395_get_socket_status_sn + ;;@proto unsigned int ch395_get_socket_status_sn(unsigned char ID_SOCKET); +.endproc + +.proc ch395_get_socket_status_sn ; Returns in A socket status (close/open) ; X : the TCP state ldx #CH395_GET_SOCKET_STATUS_SN