diff --git a/docs/api/2024.1/assembly/index.html b/docs/api/2024.1/assembly/index.html index 886d41a..7241b3c 100644 --- a/docs/api/2024.1/assembly/index.html +++ b/docs/api/2024.1/assembly/index.html @@ -944,6 +944,13 @@
Description
Checks if ch395 exists
+Example
+ jsr ch395_get_glob_int_status
+ cmp #$AA
+ beq ch395_connected
+ rts
+ch395_connected:
+
Modify
Description
+Get General interrupt Status
Modify
Example
+ jsr ch395_get_glob_int_status
+ ; check accumulator to get interrupts states
+
Description
Get ch395 firmware version
@@ -1020,12 +1033,33 @@Modify
+Description
+Get the length received from socket
+Example
+ lda #$01 ; Socket 1
+ jsr ch395_get_recv_len_sn
+ ; check A and X for length received
+ch395_connected:
+
Modify
Returns
+Accumulator : The length
+X Register : The length
+Modify
Description
Set ip addr
Description
+Set Socket Ip address to connect with
Description
Set ipraw protocol on socket
diff --git a/docs/api/2024.1/c/index.html b/docs/api/2024.1/c/index.html index de5f631..9f79b47 100644 --- a/docs/api/2024.1/c/index.html +++ b/docs/api/2024.1/c/index.html @@ -430,6 +430,13 @@ oid ch395_close_socket_sn(unsigned char ID_SOCKET) + + +Description
Close socket
+Description
+Get General interrupt Status
Description
Get ch395 firmware version
Description
+Get the length received from socket
Description
Set ip addr
-Description
Set ipraw protocol on socket
Description
Checks if ch395 exists
+Example
+ jsr ch395_get_glob_int_status
+ cmp #$AA
+ beq ch395_connected
+ rts
+ch395_connected:
+
Modify
Description
+Get General interrupt Status
Modify
Example
+ jsr ch395_get_glob_int_status
+ ; check accumulator to get interrupts states
+
Description
Get ch395 firmware version
@@ -737,12 +750,33 @@Modify
+Description
+Get the length received from socket
+Example
+ lda #$01 ; Socket 1
+ jsr ch395_get_recv_len_sn
+ ; check A and X for length received
+ch395_connected:
+
Modify
Returns
+Accumulator : The length
+X Register : The length
+Modify
Description
Set ip addr
Description
+Set Socket Ip address to connect with
Description
Set ipraw protocol on socket
diff --git a/docs/api/c/index.html b/docs/api/c/index.html index 28a7750..91b184f 100644 --- a/docs/api/c/index.html +++ b/docs/api/c/index.html @@ -430,6 +430,13 @@ oid ch395_close_socket_sn(unsigned char ID_SOCKET) + + +Description
Close socket
+Description
+Get General interrupt Status
Description
Get ch395 firmware version
Description
+Get the length received from socket
Description
Set ip addr
-Description
Set ipraw protocol on socket
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
Description
Clear receive buffer
Modify
Description
Close socket
Input
Modify
Description
Enable or not dhcp
Input
Modify
Description
Get cmd status
Modify
Modify
Modify
Description
Get ch395 firmware version
Modify
Modify
Modify
Modify
Modify
Description
Returns in A socket status (close/open)
Modify
Modify
Description
Reset ch395
Example
jsr ch395_reset_all\n; Wait a bit\n
"},{"location":"assembly/#ch395_retran_period","title":"ch395_retran_period","text":"Description
Retran period
Example
lda #$FF\nldx #$FF\njsr ch395_retran_period\n
"},{"location":"assembly/#ch395_set_des_port_sn","title":"ch395_set_des_port_sn","text":""},{"location":"assembly/#ch395_set_fun_para","title":"ch395_set_fun_para","text":"Input
Modify
Description
Set ip addr
"},{"location":"assembly/#ch395_set_ip_addr_sn","title":"ch395_set_ip_addr_sn","text":""},{"location":"assembly/#ch395_set_ipraw_pro_sn","title":"ch395_set_ipraw_pro_sn","text":"Description
Set ipraw protocol on socket
"},{"location":"assembly/#ch395_set_mac_adress","title":"ch395_set_mac_adress","text":"Description
Set mac address
"},{"location":"assembly/#ch395_set_proto_type_sn","title":"ch395_set_proto_type_sn","text":""},{"location":"assembly/#ch395_set_retran_count","title":"ch395_set_retran_count","text":""},{"location":"assembly/#ch395_set_sour_port_sn","title":"ch395_set_sour_port_sn","text":""},{"location":"assembly/#ch395_tcp_connect_sn","title":"ch395_tcp_connect_sn","text":""},{"location":"assembly/#ch395_tcp_disconnect_sn","title":"ch395_tcp_disconnect_sn","text":""},{"location":"assembly/#ch395_tcp_listen_sn","title":"ch395_tcp_listen_sn","text":""},{"location":"assembly/#ch395_write_send_buf_sn","title":"ch395_write_send_buf_sn","text":""},{"location":"c/","title":"C","text":""},{"location":"c/#c","title":"C","text":""},{"location":"c/#unsigned-char-ch395_check_exist","title":"unsigned char ch395_check_exist();","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":"c/#void-ch395_open_socket_snunsigned-char-id_socket","title":"void ch395_open_socket_sn(unsigned char ID_SOCKET)","text":""},{"location":"c/#void-ch395_reset_all","title":"void ch395_reset_all()","text":"Description
Reset ch395
"},{"location":"c/#void-ch395_set_fun_paraunsigned-char-flag","title":"void ch395_set_fun_para(unsigned char flag)","text":"Description
Set ip addr
"},{"location":"c/#void-ch395_set_ip_addr_snunsigned-char-ip_addrunsigned-char-id_socket","title":"void ch395_set_ip_addr_sn(unsigned char ip_addr[],unsigned char ID_SOCKET)","text":"Description
Set ipraw protocol on socket
"},{"location":"c/#void-ch395_set_proto_type_snunsigned-char-protounsigned-char-id_socket","title":"void ch395_set_proto_type_sn(unsigned char proto,unsigned char ID_SOCKET)","text":""},{"location":"c/#_1","title":"C","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
Description
Clear receive buffer
Modify
Description
Close socket
Input
Modify
Description
Enable or not dhcp
Input
Modify
Description
Get cmd status
Modify
Modify
Modify
Description
Get ch395 firmware version
Modify
Modify
Modify
Modify
Modify
Description
Returns in A socket status (close/open)
Modify
Modify
Description
Reset ch395
Example
jsr ch395_reset_all\n; Wait a bit\n
"},{"location":"2024.1/assembly/#ch395_retran_period","title":"ch395_retran_period","text":"Description
Retran period
Example
lda #$FF\nldx #$FF\njsr ch395_retran_period\n
"},{"location":"2024.1/assembly/#ch395_set_des_port_sn","title":"ch395_set_des_port_sn","text":""},{"location":"2024.1/assembly/#ch395_set_fun_para","title":"ch395_set_fun_para","text":"Input
Modify
Description
Set ip addr
"},{"location":"2024.1/assembly/#ch395_set_ip_addr_sn","title":"ch395_set_ip_addr_sn","text":""},{"location":"2024.1/assembly/#ch395_set_ipraw_pro_sn","title":"ch395_set_ipraw_pro_sn","text":"Description
Set ipraw protocol on socket
"},{"location":"2024.1/assembly/#ch395_set_mac_adress","title":"ch395_set_mac_adress","text":"Description
Set mac address
"},{"location":"2024.1/assembly/#ch395_set_proto_type_sn","title":"ch395_set_proto_type_sn","text":""},{"location":"2024.1/assembly/#ch395_set_retran_count","title":"ch395_set_retran_count","text":""},{"location":"2024.1/assembly/#ch395_set_sour_port_sn","title":"ch395_set_sour_port_sn","text":""},{"location":"2024.1/assembly/#ch395_tcp_connect_sn","title":"ch395_tcp_connect_sn","text":""},{"location":"2024.1/assembly/#ch395_tcp_disconnect_sn","title":"ch395_tcp_disconnect_sn","text":""},{"location":"2024.1/assembly/#ch395_tcp_listen_sn","title":"ch395_tcp_listen_sn","text":""},{"location":"2024.1/assembly/#ch395_write_send_buf_sn","title":"ch395_write_send_buf_sn","text":""},{"location":"2024.1/c/","title":"C","text":""},{"location":"2024.1/c/#c","title":"C","text":""},{"location":"2024.1/c/#unsigned-char-ch395_check_exist","title":"unsigned char ch395_check_exist();","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":""},{"location":"2024.1/c/#void-ch395_open_socket_snunsigned-char-id_socket","title":"void ch395_open_socket_sn(unsigned char ID_SOCKET)","text":""},{"location":"2024.1/c/#void-ch395_reset_all","title":"void ch395_reset_all()","text":"Description
Reset ch395
"},{"location":"2024.1/c/#void-ch395_set_fun_paraunsigned-char-flag","title":"void ch395_set_fun_para(unsigned char flag)","text":"Description
Set ip addr
"},{"location":"2024.1/c/#void-ch395_set_ip_addr_snunsigned-char-ip_addrunsigned-char-id_socket","title":"void ch395_set_ip_addr_sn(unsigned char ip_addr[],unsigned char ID_SOCKET)","text":"Description
Set ipraw protocol on socket
"},{"location":"2024.1/c/#void-ch395_set_proto_type_snunsigned-char-protounsigned-char-id_socket","title":"void ch395_set_proto_type_sn(unsigned char proto,unsigned char ID_SOCKET)","text":""},{"location":"2024.1/c/#_1","title":"C","text":""}]} \ 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
Example
jsr ch395_get_glob_int_status\ncmp #$AA\nbeq ch395_connected\nrts\nch395_connected:\n
Modify
Returns
Description
Clear receive buffer
Modify
Description
Close socket
Input
Modify
Description
Enable or not dhcp
Input
Modify
Description
Get cmd status
Modify
Modify
Description
Get General interrupt Status
Modify
Example
jsr ch395_get_glob_int_status\n; check accumulator to get interrupts states\n
"},{"location":"assembly/#ch395_get_ic_ver","title":"ch395_get_ic_ver","text":"Description
Get ch395 firmware version
Modify
Modify
Modify
Modify
Description
Get the length received from socket
Example
lda #$01 ; Socket 1\njsr ch395_get_recv_len_sn\n; check A and X for length received\nch395_connected:\n
Modify
Returns
Accumulator : The length
X Register : The length
Modify
Description
Returns in A socket status (close/open)
Modify
Modify
Description
Reset ch395
Example
jsr ch395_reset_all\n; Wait a bit\n
"},{"location":"assembly/#ch395_retran_period","title":"ch395_retran_period","text":"Description
Retran period
Example
lda #$FF\nldx #$FF\njsr ch395_retran_period\n
"},{"location":"assembly/#ch395_set_des_port_sn","title":"ch395_set_des_port_sn","text":""},{"location":"assembly/#ch395_set_fun_para","title":"ch395_set_fun_para","text":"Input
Modify
Description
Set ip addr
"},{"location":"assembly/#ch395_set_ip_addr_sn","title":"ch395_set_ip_addr_sn","text":"Description
Set Socket Ip address to connect with
"},{"location":"assembly/#ch395_set_ipraw_pro_sn","title":"ch395_set_ipraw_pro_sn","text":"Description
Set ipraw protocol on socket
"},{"location":"assembly/#ch395_set_mac_adress","title":"ch395_set_mac_adress","text":"Description
Set mac address
"},{"location":"assembly/#ch395_set_proto_type_sn","title":"ch395_set_proto_type_sn","text":""},{"location":"assembly/#ch395_set_retran_count","title":"ch395_set_retran_count","text":""},{"location":"assembly/#ch395_set_sour_port_sn","title":"ch395_set_sour_port_sn","text":""},{"location":"assembly/#ch395_tcp_connect_sn","title":"ch395_tcp_connect_sn","text":""},{"location":"assembly/#ch395_tcp_disconnect_sn","title":"ch395_tcp_disconnect_sn","text":""},{"location":"assembly/#ch395_tcp_listen_sn","title":"ch395_tcp_listen_sn","text":""},{"location":"assembly/#ch395_write_send_buf_sn","title":"ch395_write_send_buf_sn","text":""},{"location":"c/","title":"C","text":""},{"location":"c/#c","title":"C","text":""},{"location":"c/#unsigned-char-ch395_check_exist","title":"unsigned char ch395_check_exist();","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":"c/#unsigned-int-ch395_get_glob_int_status","title":"unsigned int ch395_get_glob_int_status();","text":"Description
Get General interrupt Status
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":"Description
Get the length received from socket
"},{"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":"c/#void-ch395_open_socket_snunsigned-char-id_socket","title":"void ch395_open_socket_sn(unsigned char ID_SOCKET)","text":""},{"location":"c/#void-ch395_reset_all","title":"void ch395_reset_all()","text":"Description
Reset ch395
"},{"location":"c/#void-ch395_set_fun_paraunsigned-char-flag","title":"void ch395_set_fun_para(unsigned char flag)","text":"Description
Set ip addr
"},{"location":"c/#void-ch395_set_ip_addr_snunsigned-char-ip_addr-unsigned-char-id_socket","title":"void ch395_set_ip_addr_sn(unsigned char ip_addr[], unsigned char ID_SOCKET)","text":"Description
Set ipraw protocol on socket
"},{"location":"c/#void-ch395_set_proto_type_snunsigned-char-protounsigned-char-id_socket","title":"void ch395_set_proto_type_sn(unsigned char proto,unsigned char ID_SOCKET)","text":""},{"location":"c/#_1","title":"C","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
Example
jsr ch395_get_glob_int_status\ncmp #$AA\nbeq ch395_connected\nrts\nch395_connected:\n
Modify
Returns
Description
Clear receive buffer
Modify
Description
Close socket
Input
Modify
Description
Enable or not dhcp
Input
Modify
Description
Get cmd status
Modify
Modify
Description
Get General interrupt Status
Modify
Example
jsr ch395_get_glob_int_status\n; check accumulator to get interrupts states\n
"},{"location":"2024.1/assembly/#ch395_get_ic_ver","title":"ch395_get_ic_ver","text":"Description
Get ch395 firmware version
Modify
Modify
Modify
Modify
Description
Get the length received from socket
Example
lda #$01 ; Socket 1\njsr ch395_get_recv_len_sn\n; check A and X for length received\nch395_connected:\n
Modify
Returns
Accumulator : The length
X Register : The length
Modify
Description
Returns in A socket status (close/open)
Modify
Modify
Description
Reset ch395
Example
jsr ch395_reset_all\n; Wait a bit\n
"},{"location":"2024.1/assembly/#ch395_retran_period","title":"ch395_retran_period","text":"Description
Retran period
Example
lda #$FF\nldx #$FF\njsr ch395_retran_period\n
"},{"location":"2024.1/assembly/#ch395_set_des_port_sn","title":"ch395_set_des_port_sn","text":""},{"location":"2024.1/assembly/#ch395_set_fun_para","title":"ch395_set_fun_para","text":"Input
Modify
Description
Set ip addr
"},{"location":"2024.1/assembly/#ch395_set_ip_addr_sn","title":"ch395_set_ip_addr_sn","text":"Description
Set Socket Ip address to connect with
"},{"location":"2024.1/assembly/#ch395_set_ipraw_pro_sn","title":"ch395_set_ipraw_pro_sn","text":"Description
Set ipraw protocol on socket
"},{"location":"2024.1/assembly/#ch395_set_mac_adress","title":"ch395_set_mac_adress","text":"Description
Set mac address
"},{"location":"2024.1/assembly/#ch395_set_proto_type_sn","title":"ch395_set_proto_type_sn","text":""},{"location":"2024.1/assembly/#ch395_set_retran_count","title":"ch395_set_retran_count","text":""},{"location":"2024.1/assembly/#ch395_set_sour_port_sn","title":"ch395_set_sour_port_sn","text":""},{"location":"2024.1/assembly/#ch395_tcp_connect_sn","title":"ch395_tcp_connect_sn","text":""},{"location":"2024.1/assembly/#ch395_tcp_disconnect_sn","title":"ch395_tcp_disconnect_sn","text":""},{"location":"2024.1/assembly/#ch395_tcp_listen_sn","title":"ch395_tcp_listen_sn","text":""},{"location":"2024.1/assembly/#ch395_write_send_buf_sn","title":"ch395_write_send_buf_sn","text":""},{"location":"2024.1/c/","title":"C","text":""},{"location":"2024.1/c/#c","title":"C","text":""},{"location":"2024.1/c/#unsigned-char-ch395_check_exist","title":"unsigned char ch395_check_exist();","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.1/c/#unsigned-int-ch395_get_glob_int_status","title":"unsigned int ch395_get_glob_int_status();","text":"Description
Get General interrupt Status
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":"Description
Get the length received from socket
"},{"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":""},{"location":"2024.1/c/#void-ch395_open_socket_snunsigned-char-id_socket","title":"void ch395_open_socket_sn(unsigned char ID_SOCKET)","text":""},{"location":"2024.1/c/#void-ch395_reset_all","title":"void ch395_reset_all()","text":"Description
Reset ch395
"},{"location":"2024.1/c/#void-ch395_set_fun_paraunsigned-char-flag","title":"void ch395_set_fun_para(unsigned char flag)","text":"Description
Set ip addr
"},{"location":"2024.1/c/#void-ch395_set_ip_addr_snunsigned-char-ip_addr-unsigned-char-id_socket","title":"void ch395_set_ip_addr_sn(unsigned char ip_addr[], unsigned char ID_SOCKET)","text":"Description
Set ipraw protocol on socket
"},{"location":"2024.1/c/#void-ch395_set_proto_type_snunsigned-char-protounsigned-char-id_socket","title":"void ch395_set_proto_type_sn(unsigned char proto,unsigned char ID_SOCKET)","text":""},{"location":"2024.1/c/#_1","title":"C","text":""}]} \ No newline at end of file diff --git a/docs/api/sitemap.xml.gz b/docs/api/sitemap.xml.gz index e2c8a25..9ef9e03 100644 Binary files a/docs/api/sitemap.xml.gz and b/docs/api/sitemap.xml.gz differ diff --git a/docs/code/2024.1/assembly.md b/docs/code/2024.1/assembly.md index d5f6e01..1d435f2 100644 --- a/docs/code/2024.1/assembly.md +++ b/docs/code/2024.1/assembly.md @@ -7,6 +7,17 @@ Checks if ch395 exists +***Example*** + +```ca65 + jsr ch395_get_glob_int_status + cmp #$AA + beq ch395_connected + rts +ch395_connected: +``` + + ***Modify*** * Accumulator @@ -82,11 +93,23 @@ Get cmd status ## ch395_get_glob_int_status +***Description*** + +Get General interrupt Status + ***Modify*** * Accumulator +***Example*** + +```ca65 + jsr ch395_get_glob_int_status + ; check accumulator to get interrupts states +``` + + ## ch395_get_ic_ver @@ -122,15 +145,40 @@ Get ch395 firmware version ## ch395_get_phy_status +***Modify*** + +* Accumulator + ## ch395_get_recv_len_sn +***Description*** + +Get the length received from socket + + +***Example*** + +```ca65 + lda #$01 ; Socket 1 + jsr ch395_get_recv_len_sn + ; check A and X for length received +ch395_connected: +``` + ***Modify*** * Accumulator * X Register +***Returns*** + +* Accumulator : The length + +* X Register : The length + + ## ch395_get_remot_ipp_sn @@ -234,6 +282,10 @@ Set ip addr ## ch395_set_ip_addr_sn +***Description*** + +Set Socket Ip address to connect with + ## ch395_set_ipraw_pro_sn diff --git a/docs/code/2024.1/c.md b/docs/code/2024.1/c.md index 292a609..26d1b16 100644 --- a/docs/code/2024.1/c.md +++ b/docs/code/2024.1/c.md @@ -26,6 +26,12 @@ Close socket +## unsigned int ch395_get_glob_int_status(); + +***Description*** + +Get General interrupt Status + ***Description*** @@ -46,6 +52,10 @@ Get ch395 firmware version ## void ch395_get_recv_len_sn(unsigned char ID_SOCKET) +***Description*** + +Get the length received from socket + @@ -86,7 +96,7 @@ Set ip addr -## void ch395_set_ip_addr_sn(unsigned char ip_addr[],unsigned char ID_SOCKET) +## void ch395_set_ip_addr_sn(unsigned char ip_addr[], unsigned char ID_SOCKET) diff --git a/docs/code/assembly.md b/docs/code/assembly.md index d5f6e01..1d435f2 100644 --- a/docs/code/assembly.md +++ b/docs/code/assembly.md @@ -7,6 +7,17 @@ Checks if ch395 exists +***Example*** + +```ca65 + jsr ch395_get_glob_int_status + cmp #$AA + beq ch395_connected + rts +ch395_connected: +``` + + ***Modify*** * Accumulator @@ -82,11 +93,23 @@ Get cmd status ## ch395_get_glob_int_status +***Description*** + +Get General interrupt Status + ***Modify*** * Accumulator +***Example*** + +```ca65 + jsr ch395_get_glob_int_status + ; check accumulator to get interrupts states +``` + + ## ch395_get_ic_ver @@ -122,15 +145,40 @@ Get ch395 firmware version ## ch395_get_phy_status +***Modify*** + +* Accumulator + ## ch395_get_recv_len_sn +***Description*** + +Get the length received from socket + + +***Example*** + +```ca65 + lda #$01 ; Socket 1 + jsr ch395_get_recv_len_sn + ; check A and X for length received +ch395_connected: +``` + ***Modify*** * Accumulator * X Register +***Returns*** + +* Accumulator : The length + +* X Register : The length + + ## ch395_get_remot_ipp_sn @@ -234,6 +282,10 @@ Set ip addr ## ch395_set_ip_addr_sn +***Description*** + +Set Socket Ip address to connect with + ## ch395_set_ipraw_pro_sn diff --git a/docs/code/c.md b/docs/code/c.md index 292a609..26d1b16 100644 --- a/docs/code/c.md +++ b/docs/code/c.md @@ -26,6 +26,12 @@ Close socket +## unsigned int ch395_get_glob_int_status(); + +***Description*** + +Get General interrupt Status + ***Description*** @@ -46,6 +52,10 @@ Get ch395 firmware version ## void ch395_get_recv_len_sn(unsigned char ID_SOCKET) +***Description*** + +Get the length received from socket + @@ -86,7 +96,7 @@ Set ip addr -## void ch395_set_ip_addr_sn(unsigned char ip_addr[],unsigned char ID_SOCKET) +## void ch395_set_ip_addr_sn(unsigned char ip_addr[], unsigned char ID_SOCKET) diff --git a/src/6502/_ch395_check_exist.s b/src/6502/_ch395_check_exist.s index ba5ec12..aab3a69 100644 --- a/src/6502/_ch395_check_exist.s +++ b/src/6502/_ch395_check_exist.s @@ -7,10 +7,21 @@ .proc _ch395_check_exist ;;@proto unsigned char ch395_check_exist(); + ;;@```c + ;;@` val = ch395_get_glob_int_status(); + ;;@` if (val == 0xAA) printf("Ch395 is here"); + ;;@``` .endproc .proc ch395_check_exist ;;@brief Checks if ch395 exists + ;;@```ca65 + ;;@` jsr ch395_get_glob_int_status + ;;@` cmp #$AA + ;;@` beq ch395_connected + ;;@` rts + ;;@`ch395_connected: + ;;@``` ;;@modifyA ;;@returnsA Returns #AA if it exists lda #CH395_CHECK_EXIST diff --git a/src/6502/_ch395_get_glob_int_status.s b/src/6502/_ch395_get_glob_int_status.s index 0916118..6c5d792 100644 --- a/src/6502/_ch395_get_glob_int_status.s +++ b/src/6502/_ch395_get_glob_int_status.s @@ -6,10 +6,21 @@ .export ch395_get_glob_int_status .proc _ch395_get_glob_int_status + ;;@proto unsigned int ch395_get_glob_int_status(); + ;;@brief Get General interrupt Status + ;;@```c + ;;@` val = ch395_get_glob_int_status(); + ;;@` // check val to get interrupts states + ;;@``` .endproc .proc ch395_get_glob_int_status + ;;@brief Get General interrupt Status ;;@modifyA + ;;@```ca65 + ;;@` jsr ch395_get_glob_int_status + ;;@` ; check accumulator to get interrupts states + ;;@``` lda #CH395_GET_GLOB_INT_STATUS sta CH395_COMMAND_PORT lda CH395_DATA_PORT diff --git a/src/6502/_ch395_get_phy_status.s b/src/6502/_ch395_get_phy_status.s index f34fac3..112309b 100644 --- a/src/6502/_ch395_get_phy_status.s +++ b/src/6502/_ch395_get_phy_status.s @@ -9,6 +9,7 @@ .endproc .proc ch395_get_phy_status + ;;@modifyA lda #CH395_GET_PHY_STATUS sta CH395_COMMAND_PORT lda CH395_DATA_PORT diff --git a/src/6502/_ch395_get_recv_len_sn.s b/src/6502/_ch395_get_recv_len_sn.s index 3b186ac..39f4b6e 100644 --- a/src/6502/_ch395_get_recv_len_sn.s +++ b/src/6502/_ch395_get_recv_len_sn.s @@ -7,13 +7,25 @@ .proc _ch395_get_recv_len_sn ;;@proto void ch395_get_recv_len_sn(unsigned char ID_SOCKET) + ;;@brief Get the length received from socket + ;;@```c + ;;@` lda #$01 ; Socket 1 + ;;@` length_received = ch395_get_recv_len_sn(); + ;;@``` .endproc .proc ch395_get_recv_len_sn + ;;@brief Get the length received from socket + ;;@```ca65 + ;;@` lda #$01 ; Socket 1 + ;;@` jsr ch395_get_recv_len_sn + ;;@` ; check A and X for length received + ;;@`ch395_connected: + ;;@``` ;;@modifyA ;;@modifyX - ;;@returnsA - ;;@returnsX + ;;@returnsA The length + ;;@returnsX The length ldx #CH395_GET_RECV_LEN_SN stx CH395_COMMAND_PORT sta CH395_DATA_PORT ; send socket diff --git a/src/6502/_ch395_set_ip_addr_sn.s b/src/6502/_ch395_set_ip_addr_sn.s index aa9c46a..eee8371 100644 --- a/src/6502/_ch395_set_ip_addr_sn.s +++ b/src/6502/_ch395_set_ip_addr_sn.s @@ -14,10 +14,12 @@ .export ch395_set_ip_addr_sn .proc _ch395_set_ip_addr_sn - ;;@proto void ch395_set_ip_addr_sn(unsigned char ip_addr[],unsigned char ID_SOCKET) + ;;@proto void ch395_set_ip_addr_sn(unsigned char ip_addr[], unsigned char ID_SOCKET) + .endproc .proc ch395_set_ip_addr_sn + ;;@brief Set Socket Ip address to connect with .ifdef FROM_ASSEMBLY sty ptr1 diff --git a/src/include/ch395.h b/src/include/ch395.h index f6978a6..96b9cf5 100644 --- a/src/include/ch395.h +++ b/src/include/ch395.h @@ -16,26 +16,26 @@ unsigned char ch395_get_dhcp_status(); void ch395_set_ip_addr_sn(unsigned char ip_addr[], unsigned char ID_SOCKET); void ch395_set_proto_type_sn(unsigned char proto,unsigned char ID_SOCKET); -void ch395_set_des_port_sn(unsigned int port,unsigned char ID_SOCKET); -void ch395_set_sour_port_sn(unsigned int port,unsigned char ID_SOCKET); -void ch395_open_socket_sn(unsigned char ID_SOCKET); -void ch395_tcp_connect_sn(unsigned char ID_SOCKET); -void ch395_tcp_listen_sn(unsigned char ID_SOCKET); -unsigned int ch395_get_recv_len_sn(unsigned char ID_SOCKET); +void ch395_set_des_port_sn(unsigned int port,unsigned char ID_SOCKET); +void ch395_set_sour_port_sn(unsigned int port,unsigned char ID_SOCKET); +void ch395_open_socket_sn(unsigned char ID_SOCKET); +void ch395_tcp_connect_sn(unsigned char ID_SOCKET); +void ch395_tcp_listen_sn(unsigned char ID_SOCKET); +unsigned int ch395_get_recv_len_sn(unsigned char ID_SOCKET); -void ch395_write_send_buf_sn(unsigned char *buffer, unsigned int length,unsigned char ID_SOCKET); -void ch395_read_recv_buf_sn(unsigned char *buffer, unsigned int length,unsigned char ID_SOCKET); +void ch395_write_send_buf_sn(unsigned char *buffer, unsigned int length,unsigned char ID_SOCKET); +void ch395_read_recv_buf_sn(unsigned char *buffer, unsigned int length,unsigned char ID_SOCKET); -void ch395_close_socket_sn(unsigned char ID_SOCKET); +void ch395_close_socket_sn(unsigned char ID_SOCKET); unsigned char ch395_get_int_status_sn(unsigned char ID_SOCKET); unsigned char *ch395_get_socket_status_sn(unsigned char ID_SOCKET); // return 2 bytes unsigned char ch395_get_phy_status(); -void ch395_get_remot_ipp_sn(unsigned char *ptr, unsigned char socket); +void ch395_get_remot_ipp_sn(unsigned char *ptr, unsigned char socket); -unsigned int ch395_get_glob_int_status(); -void ch395_clear_recv_buf_sn(unsigned char socket); -void ch395_set_fun_para(unsigned char flag); -void ch395_tcp_disconnect_sn(unsigned char ID_SOCKET); +unsigned char ch395_get_glob_int_status(); +void ch395_clear_recv_buf_sn(unsigned char socket); +void ch395_set_fun_para(unsigned char flag); +void ch395_tcp_disconnect_sn(unsigned char ID_SOCKET); //void ch395_set_gwip_addr(ch395ipaddress gatewayipadress); @@ -63,14 +63,14 @@ void ch395_tcp_disconnect_sn(unsigned char ID_SOCKET); #define CH395_DHCP_STATUS_ENABLED 0x00 #define CH395_DHCP_STATUS_DISABLED 0x01 -#define CH395_SOCKET0 0 -#define CH395_SOCKET1 1 -#define CH395_SOCKET2 2 -#define CH395_SOCKET3 3 -#define CH395_SOCKET4 4 -#define CH395_SOCKET5 5 -#define CH395_SOCKET6 6 -#define CH395_SOCKET7 7 +#define CH395_SOCKET0 0 +#define CH395_SOCKET1 1 +#define CH395_SOCKET2 2 +#define CH395_SOCKET3 3 +#define CH395_SOCKET4 4 +#define CH395_SOCKET5 5 +#define CH395_SOCKET6 6 +#define CH395_SOCKET7 7 #define CH395_PROTO_TYPE_TCP 0x03 #define CH395_PROTO_TYPE_UDP 0x02