MLECO-2919: Restructuring to standardise HAL APIs

* LCD module component created (removed from individual
  platform packs).

* retarget.c moved out into its own component that wraps
  the uart module. It also have the native stub for
  GetLine => paved the way for removing data_acq module
  from profiles.

* shortened names for components' dir for npu and ta

* remove peripheral_memmap and peripheral_irqs headers
  from platform_drivers.h. There should be no need for
  these to be included in the top level now. These should
  be private headers.

* cmsis_device moved in as a component.

* Pyenv created by set_up_default_resource.py will also
  install packages that CMake's source generator needs.

TODO's:

* Remove timer from profiles (MLECO-3096)

Change-Id: I9d6ea2f4f291788f40a16ed507019563c8d7f205
diff --git a/scripts/cmake/source_gen_utils.cmake b/scripts/cmake/source_gen_utils.cmake
index ccce7e7..cd2698c 100644
--- a/scripts/cmake/source_gen_utils.cmake
+++ b/scripts/cmake/source_gen_utils.cmake
@@ -258,13 +258,23 @@
 # outlined above.
 ##############################################################################
 function(setup_source_generator)
+
+    # If a virtual env has been created in the resources_downloaded directory,
+    # use it for source generator. Else, fall back to creating a virtual env
+    # in the current build directory.
+    if (EXISTS ${RESOURCES_DIR}/env)
+        set(DEFAULT_VENV_DIR ${RESOURCES_DIR}/env)
+    else()
+        set(DEFAULT_VENV_DIR ${CMAKE_BINARY_DIR}/venv)
+    endif()
+
     if (${CMAKE_HOST_WIN32})
-#        windows python3 has python.exe
+        # Windows Python3 is python.exe
         set(PY_EXEC python)
-        set(PYTHON ${CMAKE_BINARY_DIR}/pyenv/Scripts/${PY_EXEC})
+        set(PYTHON ${DEFAULT_VENV_DIR}/Scripts/${PY_EXEC})
     else()
         set(PY_EXEC python3)
-        set(PYTHON ${CMAKE_BINARY_DIR}/pyenv/bin/${PY_EXEC})
+        set(PYTHON ${DEFAULT_VENV_DIR}/bin/${PY_EXEC})
     endif()
     set(PYTHON ${PYTHON} PARENT_SCOPE)
 
@@ -276,7 +286,7 @@
     message(STATUS "Configuring python environment at ${PYTHON}")
 
     execute_process(
-        COMMAND ${PY_EXEC} -m venv ${CMAKE_BINARY_DIR}/pyenv
+        COMMAND ${PY_EXEC} -m venv ${DEFAULT_VENV_DIR}
         RESULT_VARIABLE return_code
     )
     if (NOT return_code STREQUAL "0")