Skip to content

Commit

Permalink
working on the vnc driver
Browse files Browse the repository at this point in the history
  • Loading branch information
kdschlosser committed Oct 29, 2024
1 parent 4b5e280 commit ee2f135
Show file tree
Hide file tree
Showing 7 changed files with 527 additions and 1,171 deletions.
94 changes: 72 additions & 22 deletions ext_mod/lcd_bus/micropython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ if(ESP_PLATFORM)
get_filename_component(BINDING_DIR ${CMAKE_CURRENT_LIST_DIR}/../.. ABSOLUTE)
set(LIBVNC_DIR ${BINDING_DIR}/lib/libvncserver
set(LIBVNCSERVER_DIR ${LIBVNC_DIR}/src/libvncserver)

set(LIBVNCCLIENT_DIR ${LIBVNC_DIR}/src/libvncclient)
set(LIBVNCCOMMON_DIR ${LIBVNC_DIR}/src/common)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${LIBVNC_DIR}/cmake/Modules/")

set(FREERTOS_POSIX_DIR ${BINDING_DIR}/lib/Lab-Project-FreeRTOS-POSIX)
set(LWIP_DIR ${BINDING_DIR}/lib/micropythob/lib/lwip)

include(CheckFunctionExists)
include(CheckSymbolExists)
Expand All @@ -26,10 +30,18 @@ if(ESP_PLATFORM)
set(LCD_INCLUDES
${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_LIST_DIR}/esp32_include
${CMAKE_CURRENT_LIST_DIR}/rfb_bus
${LIBVNC_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}/include
${LIBVNCSERVER_DIR}
${LIBVNCCLIENT_DIR}
${LIBVNCCOMMON_DIR}
${FREERTOS_POSIX_DIR}/include
${FREERTOS_POSIX_DIR}/include/FreeRTOS_POSIX
${FREERTOS_POSIX_DIR}/FreeRTOS-Plus-POSIX/include
${FREERTOS_POSIX_DIR}/FreeRTOS-Plus-POSIX/include/portable/espressif/esp32_devkitc_esp_wrover_kit
${LWIP_DIR}/src/include/lwip
${LWIP_DIR}/src/compat/posix
)

set(LCD_SOURCES
Expand All @@ -39,6 +51,10 @@ if(ESP_PLATFORM)
${CMAKE_CURRENT_LIST_DIR}/esp32_src/spi_bus.c
${CMAKE_CURRENT_LIST_DIR}/esp32_src/i80_bus.c
${CMAKE_CURRENT_LIST_DIR}/esp32_src/rgb_bus.c
#
${CMAKE_CURRENT_LIST_DIR}/rfb_bus/rfb_bus.c
${CMAKE_CURRENT_LIST_DIR}/rfb_bus/rfb_keysym.c
#
${LIBVNCSERVER_DIR}/main.c
${LIBVNCSERVER_DIR}/rfbserver.c
${LIBVNCSERVER_DIR}/rfbregion.c
Expand All @@ -55,33 +71,61 @@ if(ESP_PLATFORM)
${LIBVNCSERVER_DIR}/font.c
${LIBVNCSERVER_DIR}/draw.c
${LIBVNCSERVER_DIR}/selbox.c
${LIBVNCCOMMON_DIR}/vncauth.c
${LIBVNCCOMMON_DIR}/sockets.c
${LIBVNCSERVER_DIR}/cargs.c
${LIBVNCSERVER_DIR}/ultra.c
${LIBVNCSERVER_DIR}/scale.c
#
${LIBVNCCLIENT_DIR}/cursor.c
${LIBVNCCLIENT_DIR}/listen.c
${LIBVNCCLIENT_DIR}/rfbclient.c
${LIBVNCCLIENT_DIR}/sockets.c
${LIBVNCCLIENT_DIR}/vncviewer.c
#
${LIBVNCCOMMON_DIR}/vncauth.c
${LIBVNCCOMMON_DIR}/sockets.c
${LIBVNCCOMMON_DIR}/sockets.c
#
${FREERTOS_POSIX_DIR}/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_clock.c
${FREERTOS_POSIX_DIR}/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_mqueue.c
${FREERTOS_POSIX_DIR}/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_pthread.c
${FREERTOS_POSIX_DIR}/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_pthread_barrier.c
${FREERTOS_POSIX_DIR}/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_pthread_cond.c
${FREERTOS_POSIX_DIR}/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_pthread_mutex.c
${FREERTOS_POSIX_DIR}/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_sched.c
${FREERTOS_POSIX_DIR}/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_semaphore.c
${FREERTOS_POSIX_DIR}/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_timer.c
${FREERTOS_POSIX_DIR}/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_unistd.c
${FREERTOS_POSIX_DIR}/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_utils.c
)

check_include_file("dirent.h" LIBVNCSERVER_HAVE_DIRENT_H)
check_include_file("endian.h" LIBVNCSERVER_HAVE_ENDIAN_H)
check_include_file("fcntl.h" LIBVNCSERVER_HAVE_FCNTL_H)
check_include_file("netinet/in.h" LIBVNCSERVER_HAVE_NETINET_IN_H)
check_include_file("sys/endian.h" LIBVNCSERVER_HAVE_SYS_ENDIAN_H)
check_include_file("sys/socket.h" LIBVNCSERVER_HAVE_SYS_SOCKET_H)
check_include_file("sys/stat.h" LIBVNCSERVER_HAVE_SYS_STAT_H)
check_include_file("sys/time.h" LIBVNCSERVER_HAVE_SYS_TIME_H)
check_include_file("sys/types.h" LIBVNCSERVER_HAVE_SYS_TYPES_H)
check_include_file("sys/wait.h" LIBVNCSERVER_HAVE_SYS_WAIT_H)
check_include_file("unistd.h" LIBVNCSERVER_HAVE_UNISTD_H)
check_include_file("sys/resource.h" LIBVNCSERVER_HAVE_SYS_RESOURCE_H)

check_include_file("dirent.h" LIBVNCSERVER_HAVE_DIRENT_H)
check_include_file("endian.h" LIBVNCSERVER_HAVE_ENDIAN_H)
check_include_file("fcntl.h" LIBVNCSERVER_HAVE_FCNTL_H)
check_include_file("netinet/in.h" LIBVNCSERVER_HAVE_NETINET_IN_H)
check_include_file("sys/endian.h" LIBVNCSERVER_HAVE_SYS_ENDIAN_H)
check_include_file("sys/socket.h" LIBVNCSERVER_HAVE_SYS_SOCKET_H)
check_include_file("sys/stat.h" LIBVNCSERVER_HAVE_SYS_STAT_H)
check_include_file("sys/time.h" LIBVNCSERVER_HAVE_SYS_TIME_H)
check_include_file("sys/types.h" LIBVNCSERVER_HAVE_SYS_TYPES_H)
check_include_file("sys/wait.h" LIBVNCSERVER_HAVE_SYS_WAIT_H)
check_include_file("unistd.h" LIBVNCSERVER_HAVE_UNISTD_H)
check_include_file("sys/resource.h" LIBVNCSERVER_HAVE_SYS_RESOURCE_H)


# headers needed for check_type_size()
check_include_file("vfork.h" LIBVNCSERVER_HAVE_VFORK_H)
check_include_file("ws2tcpip.h" LIBVNCSERVER_HAVE_WS2TCPIP_H)
check_include_file("arpa/inet.h" HAVE_ARPA_INET_H)
check_include_file("stdint.h" HAVE_STDINT_H)
check_include_file("stddef.h" HAVE_STDDEF_H)
check_include_file("sys/types.h" HAVE_SYS_TYPES_H)

# error out if required headers not found
if(NOT HAVE_STDINT_H)
message(FATAL_ERROR "Could NOT find required header stdint.h")
endif()

check_function_exists(gettimeofday LIBVNCSERVER_HAVE_GETTIMEOFDAY)
check_function_exists(vfork LIBVNCSERVER_HAVE_VFORK)
check_function_exists(vprintf LIBVNCSERVER_HAVE_VPRINTF)
Expand All @@ -102,23 +146,29 @@ if(ESP_PLATFORM)
check_function_exists(strerror LIBVNCSERVER_HAVE_STRERROR)
check_function_exists(strstr LIBVNCSERVER_HAVE_STRSTR)

check_type_size(pid_t LIBVNCSERVER_PID_T)
check_type_size(size_t LIBVNCSERVER_SIZE_T)
check_type_size(socklen_t LIBVNCSERVER_SOCKLEN_T)
check_type_size(in_addr_t LIBVNCSERVER_IN_ADDR_T)

check_symbol_exists(htobe64 "endian.h" LIBVNCSERVER_HAVE_HTOBE64)
check_symbol_exists(htobe64 "sys/endian.h" LIBVNCSERVER_HAVE_HTOBE64)
check_symbol_exists(OSSwapHostToBigInt64 "libkern/OSByteOrder.h" LIBVNCSERVER_HAVE_OSSWAPHOSTTOBIGINT64)

if(LIBVNCSERVER_HAVE_SYS_SOCKET_H)
# socklen_t
list(APPEND CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h")
endif(LIBVNCSERVER_HAVE_SYS_SOCKET_H)
if(HAVE_ARPA_INET_H)
# in_addr_t
list(APPEND CMAKE_EXTRA_INCLUDE_FILES "arpa/inet.h")
endif(HAVE_ARPA_INET_H)

set(LIBVNCSERVER_NEED_INADDR_T 1)
check_type_size(pid_t LIBVNCSERVER_PID_T)
check_type_size(size_t LIBVNCSERVER_SIZE_T)
check_type_size(socklen_t LIBVNCSERVER_SOCKLEN_T)
check_type_size(in_addr_t LIBVNCSERVER_IN_ADDR_T)

if(NOT HAVE_LIBVNCSERVER_IN_ADDR_T)
set(LIBVNCSERVER_NEED_INADDR_T 1)
endif(NOT HAVE_LIBVNCSERVER_IN_ADDR_T)

TEST_BIG_ENDIAN(LIBVNCSERVER_WORDS_BIGENDIAN)
TEST_BIG_ENDIAN(LIBVNCSERVER_WORDS_BIGENDIAN)

configure_file(${LIBVNC_DIR}/include/rfb/rfbconfig.h.cmakein ${CMAKE_CURRENT_BINARY_DIR}/include/rfb/rfbconfig.h)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@
* and that license is able to be viewed in the LICENSE file in the root
* of this project.
*/


#include "rfb_bus.h"
#include "rfb_keysym.h"
#include "FreeRTOS_POSIX.h"
#include "rfb/rfb.h"

18 changes: 18 additions & 0 deletions ext_mod/lcd_bus/rfb_bus/rfb_bus.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* Copyright (C) 2024 Kevin G Schlosser
* Code that is written by thE above named is done under the GPL license
* and that license is able to be viewed in the LICENSE file in the root
* of this project.
*/


// https://githuB.Com/FrEERTOS/LAB-ProjECt-FrEERTOS-POSIX
// https://githuB.Com/LiBVNC/liBvnCsErvEr

#ifndef __RFB_BUS_H__
#define __RFB_BUS_H__

#include "rfb_keysym.h"



#endif /* __RFB_BUS_H__ */
Loading

0 comments on commit ee2f135

Please sign in to comment.