diff --git a/.github/workflows/WS.yaml b/.github/workflows/WS.yaml new file mode 100644 index 00000000..03711ac7 --- /dev/null +++ b/.github/workflows/WS.yaml @@ -0,0 +1,50 @@ +name: GVSoC CI +on: [push,pull_request] +jobs: + Regression-Tests: + name: Regression Tests + runs-on: self-hosted + timeout-minutes: 5000 + steps: + - name: Check out repository code + uses: actions/checkout@v2 + - name: Download PULP Toolchain + run: | + cd ${{ github.workspace }} + cd .. + rm -rf v1.0.16-pulp-riscv-gcc-ubuntu-16/ v1.0.16-pulp-riscv-gcc-ubuntu-16.tar.bz2 pulp-sdk/ + wget https://github.com/pulp-platform/pulp-riscv-gnu-toolchain/releases/download/v1.0.16/v1.0.16-pulp-riscv-gcc-ubuntu-16.tar.bz2 + tar -xf v1.0.16-pulp-riscv-gcc-ubuntu-16.tar.bz2 + git clone git@github.com:pulp-platform/pulp-sdk.git + cd ${{ github.workspace }} + export -p > temp_env + - name: Install PULP-SDK Dependancies + run: | + cd ${{ github.workspace }} + source temp_env + pip install --user argcomplete pyelftools + cd ${{ github.workspace }} + export -p > temp_env + - name: Build PULP-SDK + run: | + cd ${{ github.workspace }} + source temp_env + cd ../pulp-sdk + export PULP_RISCV_GCC_TOOLCHAIN=$(pwd)/../v1.0.16-pulp-riscv-gcc-ubuntu-16/ + source configs/pulp-open.sh + make build + cd ${{ github.workspace }} + export -p > temp_env + - name: Launch regression tests + run: | + cd ${{ github.workspace }} + source temp_env + cd ../pulp_sdk/tests/hello/ + make clean all run + cd ${{ github.workspace }} + export -p > temp_env + - name: List files in the repository + run: | + ls ${{ github.workspace }} + cd .. + - run: echo "This job's status is ${{ job.status }}." diff --git a/.github/workflows/regression-tests.yml b/.github/workflows/regression-tests.yml new file mode 100644 index 00000000..4bc2e6ff --- /dev/null +++ b/.github/workflows/regression-tests.yml @@ -0,0 +1,63 @@ +name: GVSoC CI +on: [push,pull_request] +jobs: + Regression-Tests: + name: Regression Tests + runs-on: ubuntu-latest + timeout-minutes: 5000 + steps: + - name: Check out repository code + uses: actions/checkout@v2 + - name: Build COREV Toolchain + run: | + cd ${{ github.workspace }} + cd .. + rm -rf corev-gcc/ corev-binutils-gdb/ riscv-dejagnu/ riscv-newlib/ + git clone https://github.com/EEESlab/corev-gcc.git + git clone https://github.com/EEESlab/corev-binutils-gdb.git + git clone https://github.com/riscv/riscv-newlib.git + git clone https://github.com/EEESlab/riscv-dejagnu.git + sudo apt-get update -y + sudo apt-get install -y expect + cd riscv-dejagnu + ./configure + aclocal + automake + sudo make all install + cd ../corev-gcc + source build-corev-toolchain.sh --all + cd ${{ github.workspace }} + export -p > temp_env + - name: Install PULP-SDK Dependancies + run: | + cd ${{ github.workspace }} + source temp_env + sudo apt update + sudo apt-get install -y build-essential git libftdi-dev libftdi1 doxygen python3-pip libsdl2-dev curl cmake libusb-1.0-0-dev scons gtkwave libsndfile1-dev rsync autoconf automake texinfo libtool pkg-config libsdl2-ttf-dev + pip install --user argcomplete pyelftools + cd ${{ github.workspace }} + export -p > temp_env + - name: Build PULP-SDK + run: | + cd ${{ github.workspace }} + source temp_env + export PULP_RISCV_GCC_TOOLCHAIN=${INSTALL_PREFIX} + source sourceme.sh + make build + cd ${{ github.workspace }} + export -p > temp_env + - name: Launch regression tests + run: | + cd ${{ github.workspace }} + source temp_env + cd tests/hello/ + make clean all run + cd ../perf/vecmul/ + make clean all run + cd ${{ github.workspace }} + export -p > temp_env + - name: List files in the repository + run: | + ls ${{ github.workspace }} + cd .. + - run: echo "This job's status is ${{ job.status }}." diff --git a/.gitignore b/.gitignore index 11348367..c572b247 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,5 @@ __pycache__ build/ install/ -log_build.txt -tools/gap-configs/.sconsign.dblite +.sconsign.dblite +BUILD/ diff --git a/Makefile b/Makefile index b14c1a7e..a9f114d8 100644 --- a/Makefile +++ b/Makefile @@ -5,10 +5,8 @@ ifndef PULP_SDK_HOME endif BUILD_DIR ?= $(CURDIR)/build -ARTIFACT_PATH ?= $(CURDIR)/artifact export BUILD_DIR -export ARTIFACT_PATH include rules/json-tools.mk include rules/gap-configs.mk @@ -17,19 +15,6 @@ include rules/dpi-models.mk include rules/gvsoc.mk include rules/pulpos.mk -checkout: gvsoc.checkout.all - git submodule update --init rtos/pulpos/pulp_hal rtos/pulpos/pulp_archi tests/pmsis_tests rtos/pulpos/pulp rtos/pmsis/pmsis_api tools/gapy - build: gvsoc.build.all clean: gvsoc.clean - -all: checkout build - -artifact: gvsoc.artifact pulpos.artifact - rsync -avR --exclude=".git*" Makefile rules configs tools/rules README.md LICENSE $(ARTIFACT_PATH) - - mkdir -p $(ARTIFACT_PATH)/tools/jenkins - git rev-parse HEAD &> $(ARTIFACT_PATH)/tools/jenkins/sdk_version.txt - -.PHONY: artifact diff --git a/configs/pulp-open-rnnext.sh b/configs/pulp-open-rnnext.sh deleted file mode 100644 index cb296032..00000000 --- a/configs/pulp-open-rnnext.sh +++ /dev/null @@ -1,27 +0,0 @@ -#! /bin/bash - - -if [ -n "${ZSH_VERSION:-}" ]; then - DIR="$(readlink -f -- "${(%):-%x}")" - DIRNAME="$(dirname $DIR)" - PULP_SDK_HOME=$(dirname $DIRNAME) - export PULP_SDK_HOME - #echo $(dirname "$(readlink -f ${(%):-%N})") -else - export PULP_SDK_HOME="$(dirname $(dirname "$(readlink -f "${BASH_SOURCE[0]}")"))" -fi - -export TARGET_CHIP_FAMILY="PULP" -export TARGET_CHIP="PULP" -export TARGET_NAME="pulp" -export BOARD_NAME=pulp -export PULP_CURRENT_CONFIG=$BOARD_NAME@config_file=config/pulp_rnnext.json - -export PULPOS_BOARD=pulp -export PULPOS_BOARD_VERSION=pulp -export PULPOS_BOARD_PROFILE=pulp -export PULPOS_TARGET=pulp -export PULPOS_SYSTEM=pulp -export GAPY_TARGET=pulp_rnnext - -source $PULP_SDK_HOME/configs/common.sh diff --git a/configs/pulp-open.sh b/configs/pulp-open.sh deleted file mode 100644 index 23a25aba..00000000 --- a/configs/pulp-open.sh +++ /dev/null @@ -1,31 +0,0 @@ -#! /bin/bash - - -if [ -n "${ZSH_VERSION:-}" ]; then - DIR="$(readlink -f -- "${(%):-%x}")" - DIRNAME="$(dirname $DIR)" - PULP_SDK_HOME=$(dirname $DIRNAME) - export PULP_SDK_HOME - #echo $(dirname "$(readlink -f ${(%):-%N})") -else - export PULP_SDK_HOME="$(dirname $(dirname "$(readlink -f "${BASH_SOURCE[0]}")"))" -fi - -export TARGET_CHIP_FAMILY="PULP" -export TARGET_CHIP="PULP" -export TARGET_NAME="pulp" -export BOARD_NAME=pulp -export PULP_CURRENT_CONFIG=$BOARD_NAME@config_file=config/$BOARD_NAME.json - -export PULPOS_BOARD=pulp -export PULPOS_BOARD_VERSION=pulp -export PULPOS_BOARD_PROFILE=pulp -export PULPOS_TARGET=pulp -export PULPOS_SYSTEM=pulp -export GAPY_TARGET=pulp - -export PULPOS_MODULES="$PULP_SDK_HOME/rtos/pulpos/pulp $PULP_SDK_HOME/rtos/pmsis/pmsis_bsp" - -export GVSOC_MODULES="$PULP_SDK_HOME/tools/gvsoc/common $PULP_SDK_HOME/tools/gvsoc/pulp/models" - -source $PULP_SDK_HOME/configs/common.sh diff --git a/libs/libbasic-runtime.a b/libs/libbasic-runtime.a new file mode 100644 index 00000000..62b93786 Binary files /dev/null and b/libs/libbasic-runtime.a differ diff --git a/rtos/pmsis/pmsis_api/jenkins/sdk.mk b/rtos/pmsis/pmsis_api/jenkins/sdk.mk deleted file mode 100644 index da5f6248..00000000 --- a/rtos/pmsis/pmsis_api/jenkins/sdk.mk +++ /dev/null @@ -1,34 +0,0 @@ -SHELL=/bin/bash - -ifndef GAP_RISCV_GCC_TOOLCHAIN -export GAP_RISCV_GCC_TOOLCHAIN=$(GAP_RISCV_GCC_TOOLCHAIN_BASE)/1.0.13 -endif - -PLPTEST_PLATFORM ?= gvsoc -PMSIS_OS ?= pulpos -JENKINS_CONFIG ?= gap8 -PLPTEST_OPT ?= --max-timeout=60 - -export PMSIS_OS -export PLPTEST_PLATFORM - -TESTSET ?= --testset=testset.cfg - -gap_sdk_checkout: - if [ ! -e gap_sdk ]; then git clone git@gitlab.greenwaves-tech.com:gwt_sdk_developer/gap_sdk.git; fi - cd gap_sdk && git submodule update --init --recursive - -gap_sdk_build: - cd gap_sdk && . configs/$(JENKINS_CONFIG).sh && make sdk - -bridge: - if [ ! -e pulp-debug-bridge ]; then git clone git@github.com:pulp-platform/pulp-debug-bridge.git; fi - . gap_sdk/configs/$(JENKINS_CONFIG).sh && cd pulp-debug-bridge && make INSTALL_DIR=$$GAP_SDK_HOME/install/workstation TARGET_INSTALL_DIR=$$GAP_SDK_HOME/install BUILD_DIR=$$GAP_SDK_HOME/build/bridge build install - -module: - cd gap_sdk && make -f jenkins.mk patch.pmsis_api - -sdk: gap_sdk_checkout module gap_sdk_build bridge - -test: - cd gap_sdk && . configs/$(JENKINS_CONFIG).sh && plptest $(TESTSET) $(PLPTEST_OPT) diff --git a/rtos/pmsis/pmsis_bsp/LICENSE b/rtos/pmsis/pmsis_bsp/LICENSE deleted file mode 100644 index f433b1a5..00000000 --- a/rtos/pmsis/pmsis_bsp/LICENSE +++ /dev/null @@ -1,177 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS diff --git a/rtos/pmsis/pmsis_bsp/Makefile b/rtos/pmsis/pmsis_bsp/Makefile deleted file mode 100644 index e4ef9f9b..00000000 --- a/rtos/pmsis/pmsis_bsp/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -include src.mk - -ifdef GAP_SDK_HOME -include $(CURDIR)/rules/gap_sdk.mk -else -include $(CURDIR)/rules/pulp_sdk.mk -endif # GAP_SDK_HOME diff --git a/rtos/pmsis/pmsis_bsp/ble/ble.c b/rtos/pmsis/pmsis_bsp/ble/ble.c deleted file mode 100644 index 2417ab09..00000000 --- a/rtos/pmsis/pmsis_bsp/ble/ble.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "pmsis.h" -#include "bsp/ble.h" - -int32_t pi_ble_open(struct pi_device *device) -{ - return device->api->open(device); -} - -void pi_ble_close(struct pi_device *device) -{ - device->api->close(device); -} - -int32_t pi_ble_ioctl(struct pi_device *device, uint32_t cmd, void *arg) -{ - return device->api->ioctl(device, (uint32_t) cmd, arg); -} - -int32_t pi_ble_at_cmd(struct pi_device *device, const char *cmd, char *resp, uint32_t size) -{ - pi_ble_api_t *ble_api = (pi_ble_api_t *) device->api->specific_api; - return ble_api->at_cmd(device, cmd, resp, size); -} - -int32_t pi_ble_peer_connect(struct pi_device *device, const char *addr) -{ - pi_ble_api_t *ble_api = (pi_ble_api_t *) device->api->specific_api; - return ble_api->peer_connect(device, addr); -} - -int32_t pi_ble_peer_disconnect(struct pi_device *device, const char *addr) -{ - pi_ble_api_t *ble_api = (pi_ble_api_t *) device->api->specific_api; - return ble_api->peer_disconnect(device, addr); -} - -void pi_ble_data_send(struct pi_device *device, uint8_t *buffer, uint32_t size) -{ - pi_task_t task_block = {0}; - pi_task_block(&task_block); - pi_ble_data_send_async(device, buffer, size, &task_block); - pi_task_wait_on(&task_block); - pi_task_destroy(&task_block); -} - -void pi_ble_data_send_async(struct pi_device *device, uint8_t *buffer, - uint32_t size, pi_task_t *task) -{ - device->api->write(device, 0, (const void *) buffer, size, task); -} - -void pi_ble_data_get(struct pi_device *device, uint8_t *buffer, uint32_t size) -{ - pi_task_t task_block = {0}; - pi_task_block(&task_block); - pi_ble_data_get_async(device, buffer, size, &task_block); - pi_task_wait_on(&task_block); - pi_task_destroy(&task_block); -} - -void pi_ble_data_get_async(struct pi_device *device, uint8_t *buffer, - uint32_t size, pi_task_t *task) -{ - device->api->read(device, 0, (void *) buffer, size, task); -} diff --git a/rtos/pmsis/pmsis_bsp/ble/nina_b112/nina_b112.c b/rtos/pmsis/pmsis_bsp/ble/nina_b112/nina_b112.c deleted file mode 100644 index 606f3202..00000000 --- a/rtos/pmsis/pmsis_bsp/ble/nina_b112/nina_b112.c +++ /dev/null @@ -1,555 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "bsp/bsp.h" -#include "bsp/ble/nina_b112.h" -#include "nina_b112_defines.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -#ifdef DEBUG -#define DEBUG_PRINTF printf -#else -#define DEBUG_PRINTF(...) ((void) 0) -#endif /* DEBUG */ - -/* Factory default S3(CR) & S4(LF) response format character. */ -#define S3char '\r' /*!< CR char, ASCII 0x0D. */ -#define S4char '\n' /*!< LF char, ASCII 0x0A. */ -/* Same, but to use in string functions (strcat, strcmp, etc...). */ -#define S3str "\r" /*!< CR string. */ -#define S4str "\n" /*!< LF string. */ - -//#define PI_AT_RESP_ARRAY_LENGTH ( 64 ) /*!< RESP array length. */ - -#define PI_NINA_B112_UART_BAUDRATE ( 115200 ) /*!< Baudrate used by NINA_B112 module(default value). */ -#define PI_NINA_B112_DATA_BITS ( 8 ) /*!< Data bits used by NINA_B112 module(default value). */ - -typedef struct -{ - struct pi_device uart_device; /*!< UART interface used to communicate with BLE module. */ - char *byte; /*!< Byte used to receive response. */ - char *buffer; /*!< Buffer used to receive response. */ -} nina_b112_t; - -typedef enum -{ - PI_AT_RESP_NOT_STARTED, /*!< Response not received yet from BLE module. */ - PI_AT_RESP_IN_PROGRESS, /*!< Response transmission has started. */ - PI_AT_RESP_DONE /*!< Response transmission received, with end of resp. */ -} at_resp_state_e; - -typedef enum -{ - CMD_RES_OK = 0, /*!< OK reponse. */ - CMD_RES_ERR = -1, /*!< ERROR response. */ - CMD_RES_UNSOL = -2, /*!< UNSOLICITED_RESPONSE response. */ - CMD_RES_NA = -3 /*!< Non authorized response. */ -} cmd_res_e; - -/** - * \struct cb_args - */ -typedef struct -{ - nina_b112_t *nina; - struct pi_task *task; -} cb_args_t; - - -/******************************************************************************* - * Driver data - ******************************************************************************/ - -static cb_args_t g_param = {0}; - -static volatile at_resp_state_e g_at_resp_state; - -static pi_device_api_t g_nina_b112_api = {0}; -static pi_ble_api_t g_nina_b112_ble_api = {0}; - - -/******************************************************************************* - * Function declaration - ******************************************************************************/ - -static int __pi_nina_b112_open(struct pi_device *device); - -static int __pi_nina_b112_close(struct pi_device *device); - -static ssize_t __pi_nina_b112_data_get(struct pi_device *device, uint32_t ext_addr, - void *buffer, uint32_t size, pi_task_t *task); - -static ssize_t __pi_nina_b112_data_send(struct pi_device *device, uint32_t ext_addr, - const void *buffer, uint32_t size, pi_task_t *task); - -static int __pi_nina_b112_ioctl(struct pi_device *device, uint32_t cmd, void *arg); - -static int32_t __pi_nina_b112_at_cmd(struct pi_device *device, const char *cmd, - char *resp, uint32_t size); - -static int32_t __pi_nina_b112_peer_connect(struct pi_device *device, const char *addr); - -static int32_t __pi_nina_b112_peer_disconnect(struct pi_device *device, const char *addr); - -/******************************************************************************* - * Internal functions - ******************************************************************************/ - -static void __pi_nina_b112_at_cmd_send(nina_b112_t *nina, const char *cmd) -{ - uint32_t cmd_length = strlen(cmd); - uint32_t length = cmd_length + 2 + 1; /* cmd length + "AT" + '\r'. */ - char *cmd_string = (char *) pi_l2_malloc(sizeof(char) * length); - if (cmd_string == NULL) - { - return; - } - strcpy((char*) cmd_string, (char*) "AT"); - if (cmd_length != 0) - { - strcat((char*) cmd_string, (char*) cmd); - } - strcat((char*) cmd_string, (char*) S3str); - DEBUG_PRINTF("Sending: %s\n", cmd_string); - pi_uart_write(&(nina->uart_device), cmd_string, strlen(cmd_string)); - pi_l2_free(cmd_string, sizeof(char) * length); -} - -static void __pi_nina_b112_data_received(void *arg) -{ - cb_args_t *param = (cb_args_t *) arg; - static uint32_t index = 0; - static unsigned char prev_byte = 0; - if ((g_at_resp_state == PI_AT_RESP_IN_PROGRESS) && - (prev_byte == S3char) && (*(g_param.nina->byte) == S4char)) - { - g_param.nina->buffer[--index] = '\0'; - g_at_resp_state = PI_AT_RESP_DONE; - } - else - { - pi_task_callback(g_param.task, __pi_nina_b112_data_received, &g_param); - pi_uart_read_async(&(g_param.nina->uart_device), - (void *) g_param.nina->byte, - sizeof(uint8_t), - g_param.task); - if ((g_at_resp_state == PI_AT_RESP_NOT_STARTED) && - (prev_byte == S3char) && (*(g_param.nina->byte) == S4char)) - { - index = 0; - g_at_resp_state = PI_AT_RESP_IN_PROGRESS; - } - else if (g_at_resp_state == PI_AT_RESP_IN_PROGRESS) - { - g_param.nina->buffer[index++] = *(g_param.nina->byte); - } - } - prev_byte = *(g_param.nina->byte); -} - -static int32_t __pi_nina_b112_wait_for_event(nina_b112_t *nina, char *resp) -{ - g_at_resp_state = PI_AT_RESP_NOT_STARTED; - pi_task_t rx_cb = {0}; - g_param.nina = nina; - g_param.task = &rx_cb; - pi_task_callback(&rx_cb, __pi_nina_b112_data_received, &g_param); - pi_uart_read_async(&(nina->uart_device), (void *) nina->byte, sizeof(uint8_t), &rx_cb); - - while (g_at_resp_state != PI_AT_RESP_DONE) - { - pi_yield(); - } - DEBUG_PRINTF("Got unsolicited response: %s\n", nina->buffer); - uint32_t resp_len = strlen((const char *) nina->buffer); - strcpy((void *) resp, (void *) nina->buffer); - return resp_len; -} - -static int32_t __pi_nina_b112_data_mode_exit(nina_b112_t *nina) -{ - pi_time_wait_us(1000 * 1000); - pi_uart_write(&(nina->uart_device), (void *) '+', 1); - pi_uart_write(&(nina->uart_device), (void *) '+', 1); - pi_uart_write(&(nina->uart_device), (void *) '+', 1); - pi_time_wait_us(1000 * 1000); - return 0; -} - -static int32_t __pi_nina_b112_data_mode_enter(struct pi_device *device) -{ - char str[20]; - strcpy(str, __XSTRING(PI_AT_NINA_B112_O_DATA_MODE)); - return __pi_nina_b112_at_cmd(device, str, NULL, 0); -} - -static int32_t __pi_nina_b112_device_unbond(struct pi_device *device, const char *addr) -{ - char str[60]; - strcpy(str, __XSTRING(PI_AT_NINA_B112_DEVICE_UNBOND_SET)); - strcat(str, addr); - return __pi_nina_b112_at_cmd(device, str, NULL, 0); -} - -static int32_t __pi_nina_b112_device_role(struct pi_device *device, const char *role) -{ - char str[20]; - strcpy(str, __XSTRING(PI_AT_NINA_B112_DEVICE_ROLE_SET)); - strcat(str, role); - return __pi_nina_b112_at_cmd(device, str, NULL, 0); -} - -static int32_t __pi_nina_b112_device_name(struct pi_device *device, const char *name) -{ - char str[128]; - strcpy(str, __XSTRING(PI_AT_NINA_B112_DEVICE_NAME_SET)); - strcat(str, name); - return __pi_nina_b112_at_cmd(device, str, NULL, 0); -} - -static int32_t __pi_nina_b112_configuration_save(struct pi_device *device) -{ - char str[10]; - strcpy(str, __XSTRING(PI_AT_NINA_B112_CFG_SAVE)); - return __pi_nina_b112_at_cmd(device, str, NULL, 0); -} - -static int32_t __pi_nina_b112_device_reboot(struct pi_device *device) -{ - char str[10]; - strcpy(str, __XSTRING(PI_AT_NINA_B112_DEVICE_REBOOT)); - return __pi_nina_b112_at_cmd(device, str, NULL, 0); -} - -static int32_t __pi_nina_b112_uart_settings_set(struct pi_device *device, - struct pi_nina_b112_conf *conf) -{ - char num[30], str[40]; - sprintf(num, "%ld,%d,%d,%d,%d,%d", - conf->baudrate, /* Default baudrate is 115200. */ - 2, /* No CTS/RTS */ - (uint8_t) PI_NINA_B112_DATA_BITS, /* Programmed to 8 data bits. */ - conf->stop_bits, /* Stop bits. */ - conf->parity_bits, /* Parity bits: 1=no parity, 2=Odd, 3=Even. */ - 1 /* 0=Change after reboot, - 1=Immediate change(after OK, wait 40 ms). */ - ); - strcpy(str, __XSTRING(PI_AT_NINA_B112_UART_SETTINGS_SET)); - strcat(str, num); - return __pi_nina_b112_at_cmd(device, str, NULL, 0); -} - -static void __pi_nina_b112_server_configure(struct pi_device *device) -{ - struct pi_nina_b112_conf *conf = (struct pi_nina_b112_conf *) device->config; - nina_b112_t *nina = (nina_b112_t *) device->data; - char str[10]; - - /* Turn off echo. */ - strcpy(str, __XSTRING(PI_AT_NINA_B112_ECHO_OFF)); - __pi_nina_b112_at_cmd(device, str, NULL, 0); - /* Factory reset. */ - strcpy(str, __XSTRING(PI_AT_NINA_B112_FACTORY_RESET)); - __pi_nina_b112_at_cmd(device, str, NULL, 0); - /* Unbound devices. */ - __pi_nina_b112_device_unbond(device, "FFFFFFFFFFFF"); - /* Config device role. */ - __pi_nina_b112_device_role(device, __XSTRING(PI_AT_NINA_B112_SERVER_ROLE)); - /* Config device name. */ - __pi_nina_b112_device_name(device, conf->local_name); - /* UART settings. */ - __pi_nina_b112_uart_settings_set(device, conf); -} - -static void __pi_nina_b112_client_configure(struct pi_device *device) -{ - struct pi_nina_b112_conf *conf = (struct pi_nina_b112_conf *) device->config; - nina_b112_t *nina = (nina_b112_t *) device->data; - char str[10]; - - /* Turn off echo. */ - strcpy(str, __XSTRING(PI_AT_NINA_B112_ECHO_OFF)); - __pi_nina_b112_at_cmd(device, str, NULL, 0); - /* Factory reset. */ - strcpy(str, __XSTRING(PI_AT_NINA_B112_FACTORY_RESET)); - __pi_nina_b112_at_cmd(device, str, NULL, 0); - /* Unbound devices. */ - __pi_nina_b112_device_unbond(device, "FFFFFFFFFFFF"); - /* Config device role. */ - __pi_nina_b112_device_role(device, __XSTRING(PI_AT_NINA_B112_CLIENT_ROLE)); - /* Config device name. */ - __pi_nina_b112_device_name(device, conf->local_name); - /* UART settings. */ - __pi_nina_b112_uart_settings_set(device, conf); -} - -static void __pi_nina_b112_device_id_get(struct pi_device *device, struct pi_nina_b112_id *info) -{ - struct pi_nina_b112_conf *conf = (struct pi_nina_b112_conf *) device->config; - nina_b112_t *nina = (nina_b112_t *) device->data; - char str[10]; - - /* Manufacturer ID. */ - strcpy(str, __XSTRING(PI_AT_NINA_B112_MANUFACTURER_ID)); - __pi_nina_b112_at_cmd(device, str, info->manufacturer_id, sizeof(info->manufacturer_id)); - /* Model ID. */ - strcpy(str, __XSTRING(PI_AT_NINA_B112_MODEL_ID)); - __pi_nina_b112_at_cmd(device, str, info->model_id, sizeof(info->model_id)); - /* Software version ID. */ - strcpy(str, __XSTRING(PI_AT_NINA_B112_SW_VERSION_ID)); - __pi_nina_b112_at_cmd(device, str, info->sw_ver_id, sizeof(info->sw_ver_id)); - /* Serial number ID. */ - strcpy(str, __XSTRING(PI_AT_NINA_B112_SERIAL_NUMBER)); - __pi_nina_b112_at_cmd(device, str, info->serial_num, sizeof(info->serial_num)); -} - -/******************************************************************************* - * API implementation - ******************************************************************************/ - -static int __pi_nina_b112_open(struct pi_device *device) -{ - /* Config device GPIO & pads. */ - pi_gpio_pin_configure(NULL, GPIO_NINA_PWRON, PI_GPIO_OUTPUT); - pi_gpio_pin_configure(NULL, GPIO_NINA17_DSR, PI_GPIO_OUTPUT); - pi_gpio_pin_write(NULL, GPIO_NINA_PWRON, 0); - pi_gpio_pin_write(NULL, GPIO_NINA17_DSR, 1); - - struct pi_nina_b112_conf *conf = (struct pi_nina_b112_conf *) device->config; - /* Nina_b112 device. */ - nina_b112_t *nina = (nina_b112_t *) pi_l2_malloc(sizeof(nina_b112_t)); - if (nina == NULL) - { - return -1; - } - nina->byte = (char *) pi_l2_malloc(sizeof(char) * 1); - if (nina->byte == NULL) - { - pi_l2_free(nina, sizeof(nina_b112_t)); - return -2; - } - nina->buffer = (char *) pi_l2_malloc(sizeof(char) * (uint32_t) PI_AT_RESP_ARRAY_LENGTH); - if (nina->byte == NULL) - { - pi_l2_free(nina->byte, sizeof(sizeof(char) * 1)); - pi_l2_free(nina, sizeof(nina_b112_t)); - return -3; - } - device->data = (void *) nina; - bsp_nina_b112_open_old(); - /* Init and open UART device. */ - struct pi_uart_conf uart_conf = {0}; - pi_uart_conf_init(&uart_conf); - uart_conf.uart_id = conf->uart_itf; - uart_conf.baudrate_bps = PI_NINA_B112_UART_BAUDRATE; - uart_conf.enable_rx = 1; - uart_conf.enable_tx = 1; - pi_open_from_conf(&(nina->uart_device), &uart_conf); - if (pi_uart_open(&(nina->uart_device))) - { - pi_l2_free(nina->buffer, sizeof(sizeof(char) * (uint32_t) PI_AT_RESP_ARRAY_LENGTH)); - pi_l2_free(nina->byte, sizeof(sizeof(char) * 1)); - pi_l2_free(nina, sizeof(nina_b112_t)); - return -4; - } - /* Enable Nina_B112. */ - pi_gpio_pin_write(NULL, GPIO_NINA17_DSR, 0); - pi_gpio_pin_write(NULL, GPIO_NINA_PWRON, 1); - /* Wait some time for stability. */ - pi_time_wait_us(1 * 1000 * 1000); - - /* Test if NINA_B112 is active. */ - cmd_res_e nina_active = __pi_nina_b112_at_cmd(device, "", NULL, 0); - if (nina_active == CMD_RES_ERR) - { - return -5; - } - return 0; -} - -static int __pi_nina_b112_close(struct pi_device *device) -{ - nina_b112_t *nina = (nina_b112_t *) device->data; - pi_uart_close(&(nina->uart_device)); - pi_l2_free(nina->buffer, sizeof(sizeof(char) * (uint32_t) PI_AT_RESP_ARRAY_LENGTH)); - pi_l2_free(nina->byte, sizeof(sizeof(char) * 1)); - pi_l2_free(nina, sizeof(nina_b112_t)); - return 0; -} - -static ssize_t __pi_nina_b112_data_get(struct pi_device *device, uint32_t ext_addr, - void *buffer, uint32_t size, pi_task_t *task) -{ - nina_b112_t *nina = (nina_b112_t *) device->data; - pi_uart_read_async(&(nina->uart_device), buffer, size, task); - return 0; -} - -static ssize_t __pi_nina_b112_data_send(struct pi_device *device, uint32_t ext_addr, - const void *buffer, uint32_t size, pi_task_t *task) -{ - nina_b112_t *nina = (nina_b112_t *) device->data; - pi_uart_write_async(&(nina->uart_device), (void *) buffer, size, task); - return 0; -} - -static int __pi_nina_b112_ioctl(struct pi_device *device, uint32_t cmd, void *arg) -{ - nina_b112_t *nina = (nina_b112_t *) device->data; - pi_ble_ioctl_cmd_e func_id = (pi_ble_ioctl_cmd_e) cmd; - switch (func_id) - { - case PI_NINA_B112_MODEL_INFO : - { - struct pi_nina_b112_id *info = (struct pi_nina_b112_id *) arg; - __pi_nina_b112_device_id_get(device, info); - } - break; - - case PI_NINA_B112_SERVER_CONFIGURE : - { - __pi_nina_b112_server_configure(device); - } - break; - - case PI_NINA_B112_CLIENT_CONFIGURE : - { - __pi_nina_b112_client_configure(device); - } - break; - - case PI_NINA_B112_UART_CONFIGURE : - { - struct pi_nina_b112_conf *conf = (struct pi_nina_b112_conf *) arg; - __pi_nina_b112_uart_settings_set(device, conf); - } - break; - - case PI_NINA_B112_DATA_MODE_ENTER : - { - return __pi_nina_b112_data_mode_enter(device); - } - break; - - case PI_NINA_B112_DATA_MODE_EXIT : - { - __pi_nina_b112_data_mode_exit(nina); - } - break; - - case PI_NINA_B112_WAIT_FOR_EVENT : - { - char *buffer = (char *) arg; - return __pi_nina_b112_wait_for_event(nina, buffer); - } - break; - - default : - printf("Error: unknown ioctl command !\n"); - return -1; - } - return 0; -} - -static int32_t __pi_nina_b112_at_cmd(struct pi_device *device, const char *cmd, - char *resp, uint32_t size) -{ - nina_b112_t *nina = (nina_b112_t *) device->data; - g_at_resp_state = PI_AT_RESP_NOT_STARTED; - pi_task_t rx_cb = {0}; - g_param.nina = nina; - g_param.task = &rx_cb; - pi_task_callback(&rx_cb, __pi_nina_b112_data_received, &g_param); - pi_uart_read_async(&(nina->uart_device), (void *) nina->byte, sizeof(uint8_t), &rx_cb); - __pi_nina_b112_at_cmd_send(nina, cmd); - - while (g_at_resp_state != PI_AT_RESP_DONE) - { - pi_yield(); - } - DEBUG_PRINTF("Got response: %s\n", nina->buffer); - - cmd_res_e cmd_res = CMD_RES_NA; - uint32_t last_char_pos = strlen((const char *) nina->buffer); - if ((nina->buffer[last_char_pos - 1] == 'O') && - (nina->buffer[last_char_pos - 0] == 'K')) - { - DEBUG_PRINTF("OK response received !\n"); - cmd_res = CMD_RES_OK; - } - else if((nina->buffer[last_char_pos - 4] == 'E') && - (nina->buffer[last_char_pos - 3] == 'R') && - (nina->buffer[last_char_pos - 2] == 'R') && - (nina->buffer[last_char_pos - 1] == 'O') && - (nina->buffer[last_char_pos - 0] == 'R')) - { - DEBUG_PRINTF("ERROR response received !\n"); - cmd_res = CMD_RES_ERR; - } - else - { - DEBUG_PRINTF("Unsolicited/unrecognised response received: %s !\n", nina->buffer); - cmd_res = CMD_RES_UNSOL; - } - if (size) - { - strcpy((void *) resp, (void *) nina->buffer); - } - return cmd_res; -} - -static int32_t __pi_nina_b112_peer_connect(struct pi_device *device, const char *addr) -{ - nina_b112_t *nina = (nina_b112_t *) device->data; - char str[60]; - strcpy(str, __XSTRING(PI_AT_NINA_B112_PEER_CONNECT)); - strcat(str, addr); - return __pi_nina_b112_at_cmd(device, str, NULL, 0); -} - -static int32_t __pi_nina_b112_peer_disconnect(struct pi_device *device, const char *addr) -{ - nina_b112_t *nina = (nina_b112_t *) device->data; - char str[60]; - strcpy(str, __XSTRING(PI_AT_NINA_B112_PEER_DISCONNECT)); - strcat(str, addr); - return __pi_nina_b112_at_cmd(device, str, NULL, 0); -} - -void pi_ble_nina_b112_conf_init(struct pi_device *device, struct pi_nina_b112_conf *conf) -{ - bsp_nina_b112_conf_init(conf); - /* Bind NINA_B112 API to BLE API. */ - g_nina_b112_api.open = &__pi_nina_b112_open; - g_nina_b112_api.close = &__pi_nina_b112_close; - g_nina_b112_api.read = &__pi_nina_b112_data_get; - g_nina_b112_api.write = &__pi_nina_b112_data_send; - g_nina_b112_api.ioctl = &__pi_nina_b112_ioctl; - /* BLE specific API. */ - g_nina_b112_ble_api.at_cmd = &__pi_nina_b112_at_cmd; - g_nina_b112_ble_api.peer_connect = &__pi_nina_b112_peer_connect; - g_nina_b112_ble_api.peer_disconnect = &__pi_nina_b112_peer_disconnect; - g_nina_b112_api.specific_api = (void *) &g_nina_b112_ble_api; - char *str = "GreenWaves-GAPOC"; - strcpy(conf->local_name, str); - conf->baudrate = (uint32_t) PI_NINA_B112_UART_BAUDRATE; /* Default baudrate. */ - conf->parity_bits = 1; /* No parity. */ - conf->stop_bits = 1; /* 1 stop bit. */ - device->api = &g_nina_b112_api; -} diff --git a/rtos/pmsis/pmsis_bsp/ble/nina_b112/nina_b112_defines.h b/rtos/pmsis/pmsis_bsp/ble/nina_b112/nina_b112_defines.h deleted file mode 100644 index 271e0daf..00000000 --- a/rtos/pmsis/pmsis_bsp/ble/nina_b112/nina_b112_defines.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __PI_BSP_NINA_B112_DEFINES_H__ -#define __PI_BSP_NINA_B112_DEFINES_H__ - -/*!< Store current configuration. */ -#define PI_AT_NINA_B112_CFG_SAVE &W - -/*!< Reboot chip. */ -#define PI_AT_NINA_B112_DEVICE_REBOOT +CPWROFF - -/*!< Manufacturer ID. */ -#define PI_AT_NINA_B112_MANUFACTURER_ID +CGMI - -/*baudrate_bps = PI_NINA_UART_AT_BAUDRATE_bps; - /* Format 8N-0-1. */ - //uart_conf->bit_length = UART_8_BITS; - //uart_conf->parity_mode = UART_PARITY_DISABLED; - //uart_conf->stop_bit_count = UART_ONE_STOP_BIT; - uart_conf->enable_rx = 1; - uart_conf->enable_tx = 1; - - /* struct pi_nina_b112_conf *_conf = pmsis_l2_malloc(sizeof(struct pi_nina_b112_conf)); */ - /* _conf->skip_pads_config = 0; */ - /* bsp_nina_b112_open(_conf); */ - bsp_nina_b112_open_old(); - - ble->rx_char = (uint8_t *) pmsis_l2_malloc(sizeof(uint8_t)); - if (ble->rx_char == NULL) - { - printf("Char alloc failed\n"); - return -2; - } - ble->rx_buffer = (uint8_t *) pmsis_l2_malloc(sizeof(uint8_t) * (uint32_t) PI_AT_RESP_ARRAY_LENGTH); - if (ble->rx_buffer == NULL) - { - printf("Buffer alloc failed\n"); - return -3; - } - else - { - for (uint32_t i=0; i<(uint32_t) PI_AT_RESP_ARRAY_LENGTH; i++) - { - ble->rx_buffer[i] = 0x0; - } - } - ble->uart_device.config = (void *) uart_conf; - if (pi_uart_open(&(ble->uart_device))) - { - return -4; - } - pi_gpio_pin_write(NULL, GPIO_NINA17_DSR, 0); - pi_gpio_pin_write(NULL, GPIO_NINA_PWRON, 1); - - pi_time_wait_us(1*1000*1000); // some waiting needed after BLE reset... - - return 0; -} - -void pi_nina_b112_close(pi_nina_ble_t *ble) -{ - pi_uart_close(&(ble->uart_device)); - pmsis_l2_malloc_free(ble->rx_char, sizeof(uint8_t)); - pmsis_l2_malloc_free(ble->rx_buffer, sizeof(uint8_t) * (uint32_t) PI_AT_RESP_ARRAY_LENGTH); - pmsis_l2_malloc_free(ble->uart_device.config, sizeof(struct pi_uart_conf)); -} - -void pi_nina_b112_AT_cmd_send(pi_nina_ble_t *ble, const char* cmd) -{ - uint32_t cmd_length = strlen(cmd); - uint32_t length = cmd_length + 2 + 1; /* cmd length + "AT" + '\r'. */ - char *cmd_string = (char *) pmsis_l2_malloc(sizeof(char) * length); - if (cmd_string == NULL) - { - return; - } - strcpy((char*) cmd_string, (char*) "AT"); - strcat((char*) cmd_string, (char*) cmd); - strcat((char*) cmd_string, (char*) S3str); - pi_uart_write(&(ble->uart_device), cmd_string, strlen(cmd_string)); - pmsis_l2_malloc_free(cmd_string, sizeof(char) * length); -} - -/* Uart rx callback. */ -static void __pi_nina_b112_data_received(void *arg) -{ - cb_args *param = (cb_args *) arg; - static uint32_t index = 0; - static unsigned char prev_byte = 0; - if ((at_resp_state == PI_AT_RESP_IN_PROGRESS) && - (prev_byte == S3char) && (*(param->ble->rx_char) == S4char)) - { - param->ble->rx_buffer[--index] = '\0'; - at_resp_state = PI_AT_RESP_DONE; - } - else - { - pi_task_callback(param->task, __pi_nina_b112_data_received, param); - pi_uart_read_async(&(param->ble->uart_device), (void *) param->ble->rx_char, sizeof(uint8_t), param->task); - if ((at_resp_state == PI_AT_RESP_NOT_STARTED) && - (prev_byte == S3char) && (*(param->ble->rx_char) == S4char)) - { - index = 0; - at_resp_state = PI_AT_RESP_IN_PROGRESS; - } - else if (at_resp_state == PI_AT_RESP_IN_PROGRESS) - { - param->ble->rx_buffer[index++] = *(param->ble->rx_char); - } - } - prev_byte = *(param->ble->rx_char); -} - -uint32_t pi_nina_b112_AT_send(pi_nina_ble_t *ble, const char* cmd) -{ - at_resp_state = PI_AT_RESP_NOT_STARTED; - pi_task_t rx_cb = {0}; - param.ble = ble; - param.task = &rx_cb; - pi_task_callback(&rx_cb, __pi_nina_b112_data_received, ¶m); - pi_uart_read_async(&(ble->uart_device), (void *) ble->rx_char, sizeof(uint8_t), &rx_cb); - pi_nina_b112_AT_cmd_send(ble, cmd); - - write_res_t write_result = WR_RES_NA; - while (at_resp_state != PI_AT_RESP_DONE) - { - pi_yield(); - } - DEBUG_PRINTF("Got write resp : %s\n", ble->rx_buffer); - - uint32_t last_char_pos = strlen((const char *) ble->rx_buffer) - 1; - if ((ble->rx_buffer[last_char_pos - 1] == 'O') && - (ble->rx_buffer[last_char_pos - 0] == 'K')) - { - DEBUG_PRINTF("OK response received !\n"); - write_result = WR_RES_OK; - } - else if ((ble->rx_buffer[last_char_pos - 4] == 'E') && - (ble->rx_buffer[last_char_pos - 3] == 'R') && - (ble->rx_buffer[last_char_pos - 2] == 'R') && - (ble->rx_buffer[last_char_pos - 1] == 'O') && - (ble->rx_buffer[last_char_pos - 0] == 'R')) - { - DEBUG_PRINTF("Error response received !\n"); - write_result = WR_RES_ERR; - } - else - { - DEBUG_PRINTF("Unsolicited/unrecognised response received : %s !\n", - ble->rx_buffer); - write_result = WR_RES_UNSOL; - } - return write_result; -} - -void pi_nina_b112_AT_query(pi_nina_ble_t *ble, const char* cmd, char* resp) -{ - at_resp_state = PI_AT_RESP_NOT_STARTED; - pi_task_t rx_cb = {0}; - param.ble = ble; - param.task = &rx_cb; - pi_task_callback(&rx_cb, __pi_nina_b112_data_received, ¶m); - pi_uart_read_async(&(ble->uart_device), (void *) ble->rx_char, sizeof(uint8_t), &rx_cb); - pi_nina_b112_AT_cmd_send(ble, cmd); - - while(at_resp_state != PI_AT_RESP_DONE) - { - pi_yield(); - } - strcpy((char *) resp, (char *) ble->rx_buffer); - DEBUG_PRINTF("Got query resp : %s\n", resp); -} - -void pi_nina_b112_wait_for_event(pi_nina_ble_t *ble, char* resp) -{ - at_resp_state = PI_AT_RESP_NOT_STARTED; - pi_task_t rx_cb = {0}; - param.ble = ble; - param.task = &rx_cb; - pi_task_callback(&rx_cb, __pi_nina_b112_data_received, ¶m); - pi_uart_read_async(&(ble->uart_device), (void *) ble->rx_char, sizeof(uint8_t), &rx_cb); - - while (at_resp_state != PI_AT_RESP_DONE) - { - pi_yield(); - } - strcpy((char *) resp, (char *) ble->rx_buffer); - DEBUG_PRINTF("Got unsolicited resp : %s\n", resp); -} - -void pi_nina_b112_get_data_blocking(pi_nina_ble_t *ble, uint8_t* buffer, uint32_t size) -{ - pi_uart_read(&(ble->uart_device), buffer, size); -} - -void pi_nina_b112_get_data(pi_nina_ble_t *ble, uint8_t* buffer, uint32_t size, struct pi_task *task) -{ - pi_uart_read_async(&(ble->uart_device), buffer, size, task); -} - -void pi_nina_b112_send_data_blocking(pi_nina_ble_t *ble, const uint8_t* buffer, uint32_t size) -{ - pi_uart_write(&(ble->uart_device), (void *) buffer, size); -} - -void pi_nina_b112_send_data(pi_nina_ble_t *ble, const uint8_t* buffer, uint32_t size, struct pi_task *task) -{ - pi_uart_write_async(&(ble->uart_device), (void *) buffer, size, task); -} - -void pi_nina_b112_exit_data_mode(pi_nina_ble_t *ble) -{ - pi_uart_write(&(ble->uart_device), (void *) '+', 1); - pi_uart_write(&(ble->uart_device), (void *) '+', 1); - pi_uart_write(&(ble->uart_device), (void *) '+', 1); -} - diff --git a/rtos/pmsis/pmsis_bsp/bootloader/bootloader_utility.c b/rtos/pmsis/pmsis_bsp/bootloader/bootloader_utility.c deleted file mode 100644 index f89b3e1f..00000000 --- a/rtos/pmsis/pmsis_bsp/bootloader/bootloader_utility.c +++ /dev/null @@ -1,373 +0,0 @@ -/* - * Copyright (C) 2020 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Created by Mathieu Barbe . - * on 1/6/2020. - */ - -#include "string.h" -#include "stdbool.h" - -#include "bsp/bootloader_utility.h" -#include "bsp/ota_utility.h" -#include "bsp/crc/md5.h" - -pi_err_t bootloader_utility_fill_state(const flash_partition_table_t *table, bootloader_state_t *bs) -{ - pi_err_t rc; -#if PI_LOG_LOCAL_LEVEL >= PI_LOG_TRACE - const char *partition_usage; -#endif - - SSBL_TRC("Partition Table:"); - SSBL_TRC("## Label SSBL usage Type ST Offset Length\n"); - - memset(bs, 0, sizeof(*bs)); - - for (uint8_t i = 0; i < table->header.nbr_of_entries; i++) - { - const flash_partition_info_t *partition = table->partitions + i; -#if PI_LOG_LOCAL_LEVEL >= PI_LOG_TRACE - partition_usage = "unknown"; -#endif - - /* valid partition table */ - switch (partition->type) - { - case PI_PARTITION_TYPE_APP: - switch (partition->subtype) - { - case PI_PARTITION_SUBTYPE_APP_FACTORY: - bs->factory = partition->pos; -#if PI_LOG_LOCAL_LEVEL >= PI_LOG_TRACE - partition_usage = "factory app"; -#endif - break; - case PI_PARTITION_SUBTYPE_APP_TEST: - bs->test = partition->pos; -#if PI_LOG_LOCAL_LEVEL >= PI_LOG_TRACE - partition_usage = "test app"; -#endif - break; - default: - /* OTA binary */ - if((partition->subtype & ~PART_SUBTYPE_OTA_MASK) == PART_SUBTYPE_OTA_FLAG) - { - bs->ota[partition->subtype & PART_SUBTYPE_OTA_MASK] = partition->pos; - bs->app_count++; -#if PI_LOG_LOCAL_LEVEL >= PI_LOG_TRACE - partition_usage = "OTA app"; -#endif - } else - { -#if PI_LOG_LOCAL_LEVEL >= PI_LOG_TRACE - partition_usage = "Unknown app"; -#endif - } - break; - } - break; /* PART_TYPE_APP */ - case PI_PARTITION_TYPE_DATA: - switch (partition->subtype) - { - case PI_PARTITION_SUBTYPE_DATA_OTA: /* ota data */ - bs->ota_info = partition->pos; -#if PI_LOG_LOCAL_LEVEL >= PI_LOG_TRACE - partition_usage = "OTA data"; -#endif - break; - default: -#if PI_LOG_LOCAL_LEVEL >= PI_LOG_TRACE - partition_usage = "Unknown data"; -#endif - break; - } - break; /* PARTITION_USAGE_DATA */ - default: /* other partition type */ - break; - } - - SSBL_TRC("%2d %-16s %-16s %02x %02x %08lx %08lx", - i, partition->label, partition_usage, - partition->type, partition->subtype, - partition->pos.offset, partition->pos.size); - } - - - SSBL_TRC("End of partition table\n"); - return PI_OK; -} - -static bool bootloader_utility_binary_header_is_valid(const bin_desc_t *bin_desc) -{ - MD5_CTX context; - size_t cmp; - uint8_t res[16]; - - SSBL_TRC("Binary header: magic code: %.4s, nbr of segments: %u, entry point: 0x%x", - bin_desc->magic_code, bin_desc->header.nb_segments, bin_desc->header.entry); - - // Check magic code - cmp = memcmp(&bin_desc->magic_code, APP_BIN_MAGIC_CODE, 4); - if(cmp) - { - SSBL_ERR("App binary check failed: magic code does not match %.4s != %.4s", APP_BIN_MAGIC_CODE, bin_desc->magic_code); - return false; - } - - if(bin_desc->header.nb_segments > MAX_NB_SEGMENT) - { - SSBL_ERR("overflow of the number of segments allowed. Max %u, used %u", MAX_NB_SEGMENT, bin_desc->header.nb_segments); - return false; - } - - // Check CRC - MD5_Init(&context); - MD5_Update(&context, &bin_desc->header, sizeof(bin_header_t)); - for (uint8_t i = 0; i < bin_desc->header.nb_segments; i++) - { - MD5_Update(&context, bin_desc->segments + i, sizeof(bin_segment_t)); - } - MD5_Final(res, &context); - - cmp = memcmp(res, bin_desc->md5, 16); - if(cmp) - { - SSBL_ERR("App binary MD5 check failed"); - return false; - } - - return true; -} - -bool bootloader_utility_binary_is_valid(pi_device_t *flash, uint32_t flash_offset) -{ - bool is_valid; - bin_desc_t *bin_desc; - - bin_desc = pi_l2_malloc(sizeof(bin_desc_t)); - if(bin_desc == NULL) - { - return false; - } - - pi_flash_read(flash, flash_offset, bin_desc, sizeof(bin_desc_t)); - - is_valid = bootloader_utility_binary_header_is_valid(bin_desc); - - pi_l2_free(bin_desc, sizeof(bin_desc_t)); - - return is_valid; -} - -static void load_segment(pi_device_t *flash, const uint32_t partition_offset, const bin_segment_t *segment) -{ - static PI_L2 uint8_t - l2_buffer[L2_BUFFER_SIZE]; - -// int encrypted = conf.info.encrypted; - - bool isL2Section = segment->ptr >= 0x1C000000 && segment->ptr < 0x1D000000; - - if(isL2Section) - { - SSBL_TRC("Load segment to L2 memory at 0x%lX", segment->ptr); - pi_flash_read(flash, partition_offset + segment->start, (void *) segment->ptr, segment->size); - } else - { - - SSBL_TRC("Load segment to FC TCDM memory at 0xlX (using a L2 buffer).", segment->ptr); - size_t remaining_size = segment->size; - while (remaining_size > 0) - { - size_t iter_size = (remaining_size > L2_BUFFER_SIZE) ? L2_BUFFER_SIZE : remaining_size; - SSBL_TRC("Remaining size 0x%lX, it size %lu", remaining_size, iter_size); - pi_flash_read(flash, partition_offset + segment->start, l2_buffer, iter_size); - memcpy((void *) segment->ptr, (void *) l2_buffer, iter_size); - remaining_size -= iter_size; - } - } - -// aes_unencrypt(area->ptr, area->size); -} - -pi_err_t bootloader_utility_boot_from_partition(pi_device_t *flash, const uint32_t partition_offset) -{ - static PI_L2 - bin_desc_t bin_desc; - static PI_L2 uint8_t - buff[0x94]; - bool differ_copy_of_irq_table = false; - - // Load binary header - pi_flash_read(flash, partition_offset, &bin_desc, sizeof(bin_desc_t)); - -// aes_init = 1; -// aes_unencrypt((unsigned int)&flash_desc, sizeof(flash_desc_t)); - - if(!bootloader_utility_binary_header_is_valid(&bin_desc)) - { - SSBL_ERR("Binary is invalid, unable to boot to this app."); - return PI_ERR_INVALID_APP; - } - - for (uint8_t i = 0; i < bin_desc.header.nb_segments; i++) - { - bin_segment_t *seg = bin_desc.segments + i; - SSBL_TRC("Load segment %u: flash offset 0x%lX - size 0x%lX", - i, seg->start, seg->size); - - // Skip interrupt table entries - if(seg->ptr == 0x1C000000) - { - differ_copy_of_irq_table = true; - SSBL_TRC("Differ the copy of irq table"); - pi_flash_read(flash, partition_offset + seg->start, (void *) buff, 0x94); - seg->ptr += 0x94; - seg->start += 0x94; - seg->size -= 0x94; - } - - load_segment(flash, partition_offset, seg); - } - - - SSBL_TRC("Close flash"); - pi_flash_close(flash); - - SSBL_TRC("Disable global IRQ and timer interrupt"); - disable_irq(); -#ifdef __FREERTOS__ - NVIC_DisableIRQ(SYSTICK_IRQN); -#endif - - if(differ_copy_of_irq_table) - { - SSBL_TRC("Copy IRQ table whithout uDMA."); - uint8_t *ptr = (uint8_t * ) - 0x1C000000; - for (size_t i = 0; i < 0x94; i++) - { - ptr[i] = buff[i]; - } - } - - // Flush instruction cache -#ifdef __FREERTOS__ - SSBL_TRC("Flush icache"); - SCBC_Type *icache = SCBC; - icache->ICACHE_FLUSH = 1; -#endif - - SSBL_INF("Jump to app entry point at 0x%lX", bin_desc.header.entry); - jump_to_address(bin_desc.header.entry); -} - -pi_partition_subtype_t bootloader_utility_get_boot_partition_without_ota_data(const bootloader_state_t *bs) -{ - if(bs->factory.offset) - { - SSBL_INF("Factory partition has been found."); - return PI_PARTITION_SUBTYPE_APP_FACTORY; - } - - if(bs->ota[0].offset) - { - SSBL_INF("Factory partition is not present, try to boot to OTA1 partition."); - return PI_PARTITION_SUBTYPE_APP_OTA_0; - } - - SSBL_ERR("Factory or OTA0 partition not found. Unable to find bootable partition."); - return PI_PARTITION_SUBTYPE_UNKNOWN; -} - -pi_partition_subtype_t bootloader_utility_get_boot_stable_partition(const bootloader_state_t *bs, const ota_state_t *ota_state) -{ - SSBL_TRC("Search stable partition"); - if(ota_state->stable != PI_PARTITION_SUBTYPE_UNKNOWN) - { - SSBL_TRC("OTA data stable partition found: %u", ota_state->stable); - return ota_state->stable; - } - - SSBL_TRC("Stable app not found into OTA data informations. Try to found bootable partition."); - return bootloader_utility_get_boot_partition_without_ota_data(bs); -} - -pi_partition_subtype_t bootloader_utility_get_boot_partition(const flash_partition_table_t *table, const bootloader_state_t *bs) -{ - pi_err_t rc; - ota_state_t *ota_state = NULL; - pi_partition_subtype_t subtype; - - SSBL_INF("Try to read OTA data from flash."); - - if(bs->ota_info.offset == 0) - { - SSBL_WNG("OTA info partition not found, try to find bootable partition."); - return bootloader_utility_get_boot_partition_without_ota_data(bs); - } - - rc = ota_utility_get_ota_state(table->flash, bs->ota_info.offset, ota_state); - if(rc != PI_OK) - { - SSBL_WNG("Unable to read OTA data. Try to boot to factory or ota0 partition."); - return bootloader_utility_get_boot_partition_without_ota_data(bs); - } - - switch (ota_state->state) - { - case PI_OTA_IMG_VALID: - SSBL_INF("Select stable partition type."); - return ota_state->stable; - - case PI_OTA_IMG_NEW: - SSBL_INF("An update is available, try to upgrade app."); - ota_state->state = PI_OTA_IMG_PENDING_VERIFY; - ota_utility_write_ota_data(table, ota_state); - return ota_state->once; - - case PI_OTA_IMG_PENDING_VERIFY: - SSBL_ERR("Last upgrade fail! App could not confirm the workable or non-workable. Invalidate the partition and boot to the stable app."); - ota_state->state = PI_OTA_IMG_ABORTED; - ota_utility_write_ota_data(table, ota_state); - return bootloader_utility_get_boot_stable_partition(bs, ota_state); - - case PI_OTA_IMG_INVALID: - SSBL_INF("Last upgrade has been marked invalid. Boot to the stable app."); - return bootloader_utility_get_boot_stable_partition(bs, ota_state); - - case PI_OTA_IMG_ABORTED: - SSBL_INF("Last upgrade was aborted by the bootloader. Try boot to the stable app."); - return bootloader_utility_get_boot_stable_partition(bs, ota_state); - - case PI_OTA_IMG_BOOT_ONCE: - SSBL_INF("Boot just once to a specific app."); - ota_state->state = PI_OTA_IMG_VALID; - subtype = ota_state->once; - ota_state->once = PI_PARTITION_SUBTYPE_UNKNOWN; - ota_utility_write_ota_data(table, ota_state); - return subtype; - - case PI_OTA_IMG_UNDEFINED: - SSBL_INF("OTA state is not set. Try to boot to the stable app."); - return bootloader_utility_get_boot_stable_partition(bs, ota_state); - } - - SSBL_ERR("Internal error into %s, try to find bootable app."); - return bootloader_utility_get_boot_partition_without_ota_data(bs); -} diff --git a/rtos/pmsis/pmsis_bsp/bsp/ai_deck.c b/rtos/pmsis/pmsis_bsp/bsp/ai_deck.c deleted file mode 100644 index 0c55bfbf..00000000 --- a/rtos/pmsis/pmsis_bsp/bsp/ai_deck.c +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "pmsis.h" - -#include "bsp/bsp.h" -#include "bsp/ai_deck.h" -#include "bsp/camera/himax.h" -#include "bsp/flash/hyperflash.h" -#include "bsp/transport/nina_w10.h" -#include "bsp/ram/hyperram.h" -#include "bsp/ram/spiram.h" - - -static int __bsp_init_pads_done = 0; - -static void __bsp_init_pads() -{ - if (!__bsp_init_pads_done) - { - __bsp_init_pads_done = 1; - uint32_t pads_value[] = {0x00055500, 0x0f000000, 0x003fffff, 0x00000000}; - pi_pad_init(pads_value); - } -} - -void bsp_hyperram_conf_init(struct pi_hyperram_conf *conf) -{ - conf->ram_start = CONFIG_HYPERRAM_START; - conf->ram_size = CONFIG_HYPERRAM_SIZE; - conf->skip_pads_config = 0; - conf->hyper_itf = CONFIG_HYPERRAM_HYPER_ITF; - conf->hyper_cs = CONFIG_HYPERRAM_HYPER_CS; -} - -int bsp_hyperram_open(struct pi_hyperram_conf *conf) -{ - __bsp_init_pads(); - return 0; -} - - - - -void bsp_hyperflash_conf_init(struct pi_hyperflash_conf *conf) -{ - conf->hyper_itf = CONFIG_HYPERFLASH_HYPER_ITF; - conf->hyper_cs = CONFIG_HYPERFLASH_HYPER_CS; -} - -int bsp_hyperflash_open(struct pi_hyperflash_conf *conf) -{ - __bsp_init_pads(); - return 0; -} - - -void bsp_spiflash_conf_init(struct pi_spiflash_conf *conf) -{ - conf->size = CONFIG_SPIFLASH_SIZE; - // sector size is in number of KB - conf->sector_size = CONFIG_SPIFLASH_SECTOR_SIZE; - conf->spi_itf = CONFIG_SPIFLASH_SPI_ITF; - conf->spi_cs = CONFIG_SPIFLASH_SPI_CS; - // try to reach max freq on gapoc_a - conf->baudrate = 50*1000000; -} - -int bsp_spiflash_open(struct pi_spiflash_conf *conf) -{ - return 0; -} - - - -void bsp_spiram_conf_init(struct pi_spiram_conf *conf) -{ - conf->ram_start = CONFIG_SPIRAM_START; - conf->ram_size = CONFIG_SPIRAM_SIZE; - conf->skip_pads_config = 0; - conf->spi_itf = CONFIG_SPIRAM_SPI_ITF; - conf->spi_cs = CONFIG_SPIRAM_SPI_CS; -} - -int bsp_spiram_open(struct pi_spiram_conf *conf) -{ - __bsp_init_pads(); - return 0; -} - - -void bsp_himax_conf_init(struct pi_himax_conf *conf) -{ - __bsp_init_pads(); - conf->i2c_itf = CONFIG_HIMAX_I2C_ITF; - conf->cpi_itf = CONFIG_HIMAX_CPI_ITF; -} - -int bsp_himax_open(struct pi_himax_conf *conf) -{ - __bsp_init_pads(); - return 0; -} - - - -void bsp_nina_w10_conf_init(struct pi_nina_w10_conf *conf) -{ - conf->spi_itf = CONFIG_NINA_W10_SPI_ITF; - conf->spi_cs = CONFIG_NINA_W10_SPI_CS; -} - -int bsp_nina_w10_open(struct pi_nina_w10_conf *conf) -{ - __bsp_init_pads(); - return 0; -} - - -void bsp_init() -{ - __bsp_init_pads(); -} - - -void pi_bsp_init_profile(int profile) -{ - __bsp_init_pads(); -} - - - -void pi_bsp_init() -{ - pi_bsp_init_profile(PI_BSP_PROFILE_DEFAULT); -} \ No newline at end of file diff --git a/rtos/pmsis/pmsis_bsp/bsp/gapoc_a.c b/rtos/pmsis/pmsis_bsp/bsp/gapoc_a.c deleted file mode 100644 index 7b484013..00000000 --- a/rtos/pmsis/pmsis_bsp/bsp/gapoc_a.c +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "pmsis.h" - -#include "bsp/bsp.h" -#include "pmsis/drivers/gpio.h" -#include "pmsis/drivers/pad.h" -#include "bsp/gapoc_a.h" -#include "bsp/camera/mt9v034.h" -#include "bsp/flash/hyperflash.h" -#include "bsp/flash/spiflash.h" -#include "bsp/transport/nina_w10.h" -#include "bsp/display/ili9341.h" -#include "bsp/ram/hyperram.h" -#include "bsp/ram/spiram.h" -#include "bsp/ble/nina_b112.h" -#include "bsp/ble/nina_b112/nina_b112_old.h" - - -static int __bsp_init_pads_done = 0; - - -static void __gpio_init() -{ - pi_gpio_pin_configure(0, GPIOA0_LED , PI_GPIO_OUTPUT); - pi_gpio_pin_configure(0, GPIOA1 , PI_GPIO_INPUT); - pi_gpio_pin_configure(0, GPIOA4_1V8_EN , PI_GPIO_OUTPUT); - pi_gpio_pin_configure(0, GPIOA18 , PI_GPIO_INPUT); - pi_gpio_pin_configure(0, GPIOA19 , PI_GPIO_INPUT); - /* pi_gpio_pin_configure(0, GPIOA2_NINA_RST , PI_GPIO_OUTPUT); */ - /* pi_gpio_pin_configure(0, GPIOA21_NINA17 , PI_GPIO_OUTPUT); */ - - pi_gpio_pin_write(0, GPIOA0_LED, 0); - pi_gpio_pin_write(0, GPIOA4_1V8_EN, 1); - /* pi_gpio_pin_write(0, GPIOA2_NINA_RST, 0); */ - /* pi_gpio_pin_write(0, GPIOA21_NINA17, 1); */ -} - -static void __bsp_init_pads() -{ - if (!__bsp_init_pads_done) - { - __bsp_init_pads_done = 1; - uint32_t pads_value[] = {0x00055500, 0x0f450000, 0x003fffff, 0x00000000}; - pi_pad_init(pads_value); - __gpio_init(); - } -} - -void bsp_hyperram_conf_init(struct pi_hyperram_conf *conf) -{ - conf->ram_start = CONFIG_HYPERRAM_START; - conf->ram_size = CONFIG_HYPERRAM_SIZE; - conf->skip_pads_config = 0; - conf->hyper_itf = CONFIG_HYPERRAM_HYPER_ITF; - conf->hyper_cs = CONFIG_HYPERRAM_HYPER_CS; -} - -int bsp_hyperram_open(struct pi_hyperram_conf *conf) -{ - pi_pad_set_function(CONFIG_HYPERBUS_DATA6_PAD, CONFIG_HYPERRAM_DATA6_PAD_FUNC); - return 0; -} - -void bsp_hyperflash_conf_init(struct pi_hyperflash_conf *conf) -{ - conf->hyper_itf = CONFIG_HYPERFLASH_HYPER_ITF; - conf->hyper_cs = CONFIG_HYPERFLASH_HYPER_CS; -} - -int bsp_hyperflash_open(struct pi_hyperflash_conf *conf) -{ - pi_pad_set_function(CONFIG_HYPERBUS_DATA6_PAD, CONFIG_HYPERRAM_DATA6_PAD_FUNC); - return 0; -} - - -static void __bsp_init_spi_pads() -{ - pi_pad_set_function(PI_PAD_40_D2_SPIM0_SDIO0 , PI_PAD_40_D2_SPIM0_SDIO0_FUNC0 ); - pi_pad_set_function(PI_PAD_41_A11_SPIM0_SDIO1, PI_PAD_41_A11_SPIM0_SDIO1_FUNC0); - pi_pad_set_function(PI_PAD_42_B10_SPIM0_SDIO2, PI_PAD_42_B10_SPIM0_SDIO2_FUNC0); - pi_pad_set_function(PI_PAD_43_A10_SPIM0_SDIO3, PI_PAD_43_A10_SPIM0_SDIO3_FUNC0); - pi_pad_set_function(PI_PAD_44_B8_SPIM0_CSN0 , PI_PAD_44_B8_SPIM0_CSN0_FUNC0 ); - pi_pad_set_function(PI_PAD_45_A8_SPIM0_CSN1 , PI_PAD_45_A8_SPIM0_CSN1_FUNC0 ); - pi_pad_set_function(PI_PAD_46_B7_SPIM0_SCK , PI_PAD_46_B7_SPIM0_SCK_FUNC0 ); -} - -void bsp_spiram_conf_init(struct pi_spiram_conf *conf) -{ - conf->ram_start = CONFIG_SPIRAM_START; - conf->ram_size = CONFIG_SPIRAM_SIZE; - conf->skip_pads_config = 0; - conf->spi_itf = CONFIG_SPIRAM_SPI_ITF; - conf->spi_cs = CONFIG_SPIRAM_SPI_CS; -} - -int bsp_spiram_open(struct pi_spiram_conf *conf) -{ - __bsp_init_pads(); - __bsp_init_spi_pads(); - return 0; -} - -void bsp_spiflash_conf_init(struct pi_spiflash_conf *conf) -{ - conf->size = CONFIG_SPIFLASH_SIZE; - // sector size is in number of KB - conf->sector_size = CONFIG_SPIFLASH_SECTOR_SIZE; - conf->spi_itf = CONFIG_SPIFLASH_SPI_ITF; - conf->spi_cs = CONFIG_SPIFLASH_SPI_CS; -} - -int bsp_spiflash_open(struct pi_spiflash_conf *conf) -{ - __bsp_init_pads(); - __bsp_init_spi_pads(); - return 0; -} - - - - -void bsp_mt9v034_conf_init(struct pi_mt9v034_conf *conf) -{ - __bsp_init_pads(); - conf->i2c_itf = CONFIG_MT9V034_I2C_ITF; - conf->cpi_itf = CONFIG_MT9V034_CPI_ITF; - conf->power_gpio = CONFIG_MT9V034_POWER_GPIO; - conf->trigger_gpio = CONFIG_MT9V034_TRIGGER_GPIO; -} - -int bsp_mt9v034_open(struct pi_mt9v034_conf *conf) -{ - __bsp_init_pads(); - - if (!conf->skip_pads_config) - { - pi_pad_set_function(CONFIG_MT9V034_TRIGGER_GPIO_PAD, CONFIG_MT9V034_TRIGGER_GPIO_PAD_FUNC); - - pi_pad_set_function(CONFIG_MT9V034_POWER_GPIO_PAD, CONFIG_MT9V034_POWER_GPIO_PAD_FUNC); - } - - return 0; -} - - - -void bsp_nina_w10_conf_init(struct pi_nina_w10_conf *conf) -{ - conf->spi_itf = CONFIG_NINA_W10_SPI_ITF; - conf->spi_cs = CONFIG_NINA_W10_SPI_CS; -} - -int bsp_nina_w10_open(struct pi_nina_w10_conf *conf) -{ - __bsp_init_pads(); - return 0; -} - - -void bsp_ili9341_conf_init(struct pi_ili9341_conf *conf) -{ - conf->gpio = CONFIG_ILI9341_GPIO; - conf->spi_itf = CONFIG_ILI9341_SPI_ITF; - conf->spi_cs = CONFIG_ILI9341_SPI_CS; - -} - -int bsp_ili9341_open(struct pi_ili9341_conf *conf) -{ - __bsp_init_pads(); - - if (!conf->skip_pads_config) - { - pi_pad_set_function(CONFIG_ILI9341_GPIO_PAD, CONFIG_ILI9341_GPIO_PAD_FUNC); - } - - return 0; -} - -void bsp_nina_b112_conf_init(struct pi_nina_b112_conf *conf) -{ - conf->uart_itf = (uint8_t) CONFIG_NINA_B112_UART_ID; -} - -int bsp_nina_b112_open(struct pi_nina_b112_conf *conf) -{ - return 0; -} - -int bsp_nina_b112_open_old() -{ - __bsp_init_pads(); - - pi_pad_set_function(CONFIG_HYPERBUS_DATA6_PAD, CONFIG_UART_RX_PAD_FUNC); - return 0; -} - - -void bsp_init() -{ - __bsp_init_pads(); -} - - -void pi_bsp_init_profile(int profile) -{ -} - - - -void pi_bsp_init() -{ - pi_bsp_init_profile(PI_BSP_PROFILE_DEFAULT); -} diff --git a/rtos/pmsis/pmsis_bsp/bsp/gapoc_b.c b/rtos/pmsis/pmsis_bsp/bsp/gapoc_b.c deleted file mode 100644 index 334d5a2b..00000000 --- a/rtos/pmsis/pmsis_bsp/bsp/gapoc_b.c +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "pmsis.h" - -#include "bsp/bsp.h" -#include "pmsis/drivers/gpio.h" -#include "pmsis/drivers/pad.h" -#include "bsp/gapoc_b.h" -#include "bsp/flash/hyperflash.h" -#include "bsp/display/ili9341.h" -#include "bsp/ram/hyperram.h" -#include "bsp/ram/spiram.h" -#include "bsp/ble/nina_b112.h" -#include "bsp/ble/nina_b112/nina_b112_old.h" -#include "bsp/camera/pixart.h" - -static int __bsp_init_pads_done = 0; - - -static void __gpio_init() -{ - pi_gpio_pin_configure(0, GPIO_USER_LED, PI_GPIO_OUTPUT); - pi_gpio_pin_configure(0, GPIO_1V8_EN , PI_GPIO_OUTPUT | PI_GPIO_PULL_DISABLE); - - pi_gpio_pin_write(0, GPIO_USER_LED, 0); - pi_gpio_pin_write(0, GPIO_1V8_EN, 1); -} - -static void __bsp_init_pads() -{ - if (!__bsp_init_pads_done) - { - __bsp_init_pads_done = 1; - uint32_t pads_value[] = {0x00055500, 0x0f450000, 0x003fffff, 0x00000000}; - pi_pad_init(pads_value); - __gpio_init(); - } -} - -void bsp_hyperram_conf_init(struct pi_hyperram_conf *conf) -{ - conf->ram_start = CONFIG_HYPERRAM_START; - conf->ram_size = CONFIG_HYPERRAM_SIZE; - conf->skip_pads_config = 0; - conf->hyper_itf = CONFIG_HYPERRAM_HYPER_ITF; - conf->hyper_cs = CONFIG_HYPERRAM_HYPER_CS; -} - -int bsp_hyperram_open(struct pi_hyperram_conf *conf) -{ - pi_pad_set_function(CONFIG_HYPERBUS_DATA6_PAD, CONFIG_HYPERRAM_DATA6_PAD_FUNC); - return 0; -} - -void bsp_hyperflash_conf_init(struct pi_hyperflash_conf *conf) -{ - conf->hyper_itf = CONFIG_HYPERFLASH_HYPER_ITF; - conf->hyper_cs = CONFIG_HYPERFLASH_HYPER_CS; -} - -int bsp_hyperflash_open(struct pi_hyperflash_conf *conf) -{ - pi_pad_set_function(CONFIG_HYPERBUS_DATA6_PAD, CONFIG_HYPERRAM_DATA6_PAD_FUNC); - return 0; -} - - -void bsp_spiflash_conf_init(struct pi_spiflash_conf *conf) -{ - conf->size = CONFIG_SPIFLASH_SIZE; - // sector size is in number of KB - conf->sector_size = CONFIG_SPIFLASH_SECTOR_SIZE; - conf->spi_itf = CONFIG_SPIFLASH_SPI_ITF; - conf->spi_cs = CONFIG_SPIFLASH_SPI_CS; -} - -int bsp_spiflash_open(struct pi_spiflash_conf *conf) -{ - return 0; -} - -void bsp_spiram_conf_init(struct pi_spiram_conf *conf) -{ - conf->ram_start = CONFIG_SPIRAM_START; - conf->ram_size = CONFIG_SPIRAM_SIZE; - conf->skip_pads_config = 0; - conf->spi_itf = CONFIG_SPIRAM_SPI_ITF; - conf->spi_cs = CONFIG_SPIRAM_SPI_CS; -} - -int bsp_spiram_open(struct pi_spiram_conf *conf) -{ - __bsp_init_pads(); - return 0; -} - -void bsp_ili9341_conf_init(struct pi_ili9341_conf *conf) -{ - conf->gpio = CONFIG_ILI9341_GPIO; - conf->spi_itf = CONFIG_ILI9341_SPI_ITF; - conf->spi_cs = CONFIG_ILI9341_SPI_CS; - -} - -int bsp_ili9341_open(struct pi_ili9341_conf *conf) -{ - __bsp_init_pads(); - - if (!conf->skip_pads_config) - { - pi_pad_set_function(CONFIG_ILI9341_GPIO_PAD, CONFIG_ILI9341_GPIO_PAD_FUNC); - } - - return 0; -} - -void bsp_nina_b112_conf_init(struct pi_nina_b112_conf *conf) -{ - conf->uart_itf = (uint8_t) CONFIG_NINA_B112_UART_ID; -} - -int bsp_nina_b112_open(struct pi_nina_b112_conf *conf) -{ - //__gpio_init(); - return 0; -} - -int bsp_nina_b112_open_old() -{ - __bsp_init_pads(); - - pi_pad_set_function(CONFIG_HYPERBUS_DATA6_PAD, CONFIG_UART_RX_PAD_FUNC); - return 0; -} - -void bsp_pixart_conf_init(struct pi_pixart_conf *conf) -{ - conf->cpi_itf = CONFIG_PIXART_CPI_ITF; - conf->spi_itf = CONFIG_PIXART_SPI_ITF; - conf->spi_cs = CONFIG_PIXART_SPI_CS; - conf->pwm_id = CONFIG_PIXART_PWM_ID; - conf->pwm_channel = CONFIG_PIXART_PWM_CH; - conf->gpio_ctl.gpio_power_4V = CONFIG_PIXART_GPIO_PWR_4V; - conf->gpio_ctl.gpio_power_2V5 = CONFIG_PIXART_GPIO_PWR_2V5; - conf->gpio_ctl.gpio_reset = CONFIG_PIXART_GPIO_RESET; -} - -int bsp_pixart_open(struct pi_pixart_conf *conf) -{ - __bsp_init_pads(); - return 0; -} - -void bsp_init() -{ - __bsp_init_pads(); -} - - -void pi_bsp_init_profile(int profile) -{ -} - - - -void pi_bsp_init() -{ - pi_bsp_init_profile(PI_BSP_PROFILE_DEFAULT); -} diff --git a/rtos/pmsis/pmsis_bsp/bsp/gapoc_b_v2.c b/rtos/pmsis/pmsis_bsp/bsp/gapoc_b_v2.c deleted file mode 100644 index a19131d5..00000000 --- a/rtos/pmsis/pmsis_bsp/bsp/gapoc_b_v2.c +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "pmsis.h" - -#include "bsp/bsp.h" -#include "pmsis/drivers/gpio.h" -#include "pmsis/drivers/pad.h" -#include "bsp/gapoc_b_v2.h" -#include "bsp/flash/hyperflash.h" -#include "bsp/display/ili9341.h" -#include "bsp/ram/hyperram.h" -#include "bsp/ram/spiram.h" -#include "bsp/ble/nina_b112.h" -#include "bsp/ble/nina_b112/nina_b112_old.h" -#include "bsp/camera/thermeye.h" -#include "bsp/camera/ov5640.h" - - -static int __bsp_init_pads_done = 0; - - -static void __gpio_init() -{ - pi_gpio_pin_configure(0, GPIO_USER_LED, PI_GPIO_OUTPUT); - pi_gpio_pin_configure(0, GPIO_1V8_EN , PI_GPIO_OUTPUT | PI_GPIO_PULL_DISABLE); - - pi_gpio_pin_write(0, GPIO_USER_LED, 0); - pi_gpio_pin_write(0, GPIO_1V8_EN, 1); -} - -static void __bsp_init_pads() -{ - if (!__bsp_init_pads_done) - { - __bsp_init_pads_done = 1; - - // This has been removed because it is messing-up pad configs done by user - // The pads should now be configured by the drivers themselves - //uint32_t pads_value[] = {0x00055500, 0x0f450000, 0x003fffff, 0x00000000}; - //pi_pad_init(pads_value); - __gpio_init(); - } -} - -void bsp_hyperram_conf_init(struct pi_hyperram_conf *conf) -{ - conf->ram_start = CONFIG_HYPERRAM_START; - conf->ram_size = CONFIG_HYPERRAM_SIZE; - conf->skip_pads_config = 0; - conf->hyper_itf = CONFIG_HYPERRAM_HYPER_ITF; - conf->hyper_cs = CONFIG_HYPERRAM_HYPER_CS; -} - -int bsp_hyperram_open(struct pi_hyperram_conf *conf) -{ - pi_pad_set_function(CONFIG_HYPERBUS_DATA6_PAD, CONFIG_HYPERRAM_DATA6_PAD_FUNC); - return 0; -} - -void bsp_hyperflash_conf_init(struct pi_hyperflash_conf *conf) -{ - conf->hyper_itf = CONFIG_HYPERFLASH_HYPER_ITF; - conf->hyper_cs = CONFIG_HYPERFLASH_HYPER_CS; -} - -int bsp_hyperflash_open(struct pi_hyperflash_conf *conf) -{ - pi_pad_set_function(CONFIG_HYPERBUS_DATA6_PAD, CONFIG_HYPERRAM_DATA6_PAD_FUNC); - return 0; -} - - -void bsp_spiflash_conf_init(struct pi_spiflash_conf *conf) -{ - conf->size = CONFIG_SPIFLASH_SIZE; - // sector size is in number of KB - conf->sector_size = CONFIG_SPIFLASH_SECTOR_SIZE; - conf->spi_itf = CONFIG_SPIFLASH_SPI_ITF; - conf->spi_cs = CONFIG_SPIFLASH_SPI_CS; -} - -int bsp_spiflash_open(struct pi_spiflash_conf *conf) -{ - return 0; -} - -void bsp_spiram_conf_init(struct pi_spiram_conf *conf) -{ - conf->ram_start = CONFIG_SPIRAM_START; - conf->ram_size = CONFIG_SPIRAM_SIZE; - conf->skip_pads_config = 0; - conf->spi_itf = CONFIG_SPIRAM_SPI_ITF; - conf->spi_cs = CONFIG_SPIRAM_SPI_CS; -} - -int bsp_spiram_open(struct pi_spiram_conf *conf) -{ - return 0; -} - -void bsp_ili9341_conf_init(struct pi_ili9341_conf *conf) -{ - conf->gpio = CONFIG_ILI9341_GPIO; - conf->spi_itf = CONFIG_ILI9341_SPI_ITF; - conf->spi_cs = CONFIG_ILI9341_SPI_CS; - -} - -int bsp_ili9341_open(struct pi_ili9341_conf *conf) -{ - if (!conf->skip_pads_config) - { - pi_pad_set_function(CONFIG_ILI9341_GPIO_PAD, CONFIG_ILI9341_GPIO_PAD_FUNC); - } - - return 0; -} - -void bsp_nina_b112_conf_init(struct pi_nina_b112_conf *conf) -{ - conf->uart_itf = (uint8_t) CONFIG_NINA_B112_UART_ID; -} - -int bsp_nina_b112_open(struct pi_nina_b112_conf *conf) -{ - //__gpio_init(); - return 0; -} - -int bsp_nina_b112_open_old() -{ - pi_pad_set_function(CONFIG_HYPERBUS_DATA6_PAD, CONFIG_UART_RX_PAD_FUNC); - return 0; -} - -void bsp_thermeye_conf_init(struct pi_thermeye_conf *conf) -{ - conf->cpi_id = (uint8_t) CONFIG_THERMEYE_CPI_ID; - conf->i2c_id = (uint8_t) CONFIG_THERMEYE_I2C_ID; - conf->pwm_id = (uint8_t) CONFIG_THERMEYE_PWM_ID; - conf->pwm_channel = (uint8_t) CONFIG_THERMEYE_PWM_CH; - conf->gpio_power = (pi_gpio_e) CONFIG_THERMEYE_GPIO_POWER; - conf->gpio_reset = (pi_gpio_e) CONFIG_THERMEYE_GPIO_RESET; - conf->cpi_format = (pi_cpi_format_e) PI_CPI_FORMAT_BYPASS_LITEND; -} - -int bsp_thermeye_open(struct pi_thermeye_conf *conf) -{ - - //Set Pad to control GPIO - //IR Trig - pi_pad_set_function(PI_PAD_15_B1_RF_PACTRL3, PI_PAD_FUNC1); - pi_gpio_pin_configure(0,GPIO_IR_TRIG,PI_GPIO_OUTPUT); - pi_gpio_pin_write(0,GPIO_1V8_EN,1); - //IR Power ON - pi_pad_set_function(PI_PAD_17_B40_RF_PACTRL5, PI_PAD_FUNC1); - pi_gpio_pin_configure(0,GPIO_IR_PWRON, PI_GPIO_OUTPUT); - pi_gpio_pin_write(0,GPIO_IR_PWRON,1); - //1V8 enable - pi_pad_set_function(PI_PAD_16_A44_RF_PACTRL4, PI_PAD_FUNC1); - pi_gpio_pin_configure(0, GPIO_1V8_EN , PI_GPIO_OUTPUT | PI_GPIO_PULL_DISABLE); - pi_gpio_pin_write(0,GPIO_1V8_EN,1); - //PWM IR Clock - pi_pad_set_function(PI_PAD_33_B12_TIMER0_CH2, PI_PAD_FUNC0); - - //Set camera PAD CPI + I2C - pi_pad_set_function(PI_PAD_18_A43_CAM_PCLK ,PI_PAD_FUNC0); - pi_pad_set_function(PI_PAD_19_A37_CAM_HSYNC,PI_PAD_FUNC0); - pi_pad_set_function(PI_PAD_20_B39_CAM_DATA0,PI_PAD_FUNC0); - pi_pad_set_function(PI_PAD_21_A42_CAM_DATA1,PI_PAD_FUNC0); - pi_pad_set_function(PI_PAD_22_B38_CAM_DATA2,PI_PAD_FUNC0); - pi_pad_set_function(PI_PAD_23_A41_CAM_DATA3,PI_PAD_FUNC0); - pi_pad_set_function(PI_PAD_24_B37_CAM_DATA4,PI_PAD_FUNC0); - pi_pad_set_function(PI_PAD_25_A40_CAM_DATA5,PI_PAD_FUNC0); - pi_pad_set_function(PI_PAD_26_B36_CAM_DATA6,PI_PAD_FUNC0); - pi_pad_set_function(PI_PAD_27_A38_CAM_DATA7,PI_PAD_FUNC0); - pi_pad_set_function(PI_PAD_28_A36_CAM_VSYNC,PI_PAD_FUNC0); - pi_pad_set_function(PI_PAD_29_B34_CAM_SDA ,PI_PAD_FUNC0); - pi_pad_set_function(PI_PAD_30_D1_CAM_SCL ,PI_PAD_FUNC0); - - return 0; -} - -void bsp_ov5640_conf_init(struct pi_ov5640_conf *conf) -{ - conf->i2c_itf = CONFIG_OV5640_I2C_ID; - conf->cpi_itf = CONFIG_OV5640_CPI_ID; -} - -int bsp_ov5640_open(struct pi_ov5640_conf *conf) -{ - return 0; -} - - -void bsp_init() -{ - __bsp_init_pads(); -} - - -void pi_bsp_init_profile(int profile) -{ -} - - - -void pi_bsp_init() -{ - pi_bsp_init_profile(PI_BSP_PROFILE_DEFAULT); -} diff --git a/rtos/pmsis/pmsis_bsp/bsp/gapuino.c b/rtos/pmsis/pmsis_bsp/bsp/gapuino.c deleted file mode 100644 index fda97d81..00000000 --- a/rtos/pmsis/pmsis_bsp/bsp/gapuino.c +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "pmsis.h" - -#include "bsp/bsp.h" -#include "pmsis/drivers/gpio.h" -#include "pmsis/drivers/pad.h" -#include "bsp/gapuino.h" -#include "bsp/display/ili9341.h" -#include "bsp/flash/hyperflash.h" -#include "bsp/ram/hyperram.h" -#include "bsp/ram/spiram.h" -#include "bsp/transport/nina_w10.h" - -#include "bsp/camera/himax.h" -#include "bsp/camera/ov7670.h" -#include "bsp/camera/gc0308.h" -#include "bsp/camera/ov5640.h" -#include "bsp/camera/pixart.h" - - -static int __bsp_init_pads_done = 0; - -static void __bsp_init_pads() -{ - if (!__bsp_init_pads_done) - { - __bsp_init_pads_done = 1; - uint32_t pads_value[] = {0x00055500, 0x0f000000, 0x003fffff, 0x00000000}; - pi_pad_init(pads_value); - } -} - - - -void bsp_hyperram_conf_init(struct pi_hyperram_conf *conf) -{ - conf->ram_start = CONFIG_HYPERRAM_START; - conf->ram_size = CONFIG_HYPERRAM_SIZE; - conf->skip_pads_config = 0; - conf->hyper_itf = CONFIG_HYPERRAM_HYPER_ITF; - conf->hyper_cs = CONFIG_HYPERRAM_HYPER_CS; -} - -int bsp_hyperram_open(struct pi_hyperram_conf *conf) -{ - //__bsp_init_pads(); - return 0; -} - -void bsp_hyperflash_conf_init(struct pi_hyperflash_conf *conf) -{ - conf->hyper_itf = CONFIG_HYPERFLASH_HYPER_ITF; - conf->hyper_cs = CONFIG_HYPERFLASH_HYPER_CS; -} - -int bsp_hyperflash_open(struct pi_hyperflash_conf *conf) -{ - //__bsp_init_pads(); - return 0; -} - - -void bsp_spiflash_conf_init(struct pi_spiflash_conf *conf) -{ - conf->size = CONFIG_SPIFLASH_SIZE; - // sector size is in number of KB - conf->sector_size = CONFIG_SPIFLASH_SECTOR_SIZE; - conf->spi_itf = CONFIG_SPIFLASH_SPI_ITF; - conf->spi_cs = CONFIG_SPIFLASH_SPI_CS; -} - -int bsp_spiflash_open(struct pi_spiflash_conf *conf) -{ - return 0; -} - -void bsp_spiram_conf_init(struct pi_spiram_conf *conf) -{ - conf->ram_start = CONFIG_SPIRAM_START; - conf->ram_size = CONFIG_SPIRAM_SIZE; - conf->skip_pads_config = 0; - conf->spi_itf = CONFIG_SPIRAM_SPI_ITF; - conf->spi_cs = CONFIG_SPIRAM_SPI_CS; -} - -int bsp_spiram_open(struct pi_spiram_conf *conf) -{ - __bsp_init_pads(); - return 0; -} - - -void bsp_himax_conf_init(struct pi_himax_conf *conf) -{ - __bsp_init_pads(); - conf->i2c_itf = CONFIG_HIMAX_I2C_ITF; - conf->cpi_itf = CONFIG_HIMAX_CPI_ITF; -} - -int bsp_himax_open(struct pi_himax_conf *conf) -{ - __bsp_init_pads(); - return 0; -} - - -void bsp_ov7670_conf_init(struct pi_ov7670_conf *conf) -{ - __bsp_init_pads(); - conf->i2c_itf = CONFIG_OV7670_I2C_ITF; - conf->cpi_itf = CONFIG_OV7670_CPI_ITF; -} - -int bsp_ov7670_open(struct pi_ov7670_conf *conf) -{ - __bsp_init_pads(); - return 0; -} - -void bsp_gc0308_conf_init(struct pi_gc0308_conf *conf) -{ - //__bsp_init_pads(); - conf->i2c_itf = CONFIG_GC0308_I2C_ITF; - conf->cpi_itf = CONFIG_GC0308_CPI_ITF; - conf->reset_gpio = PI_GPIO_A18_PAD_32_A13; //This is not reset but power-down -} - -int bsp_gc0308_open(struct pi_gc0308_conf *conf) -{ - //__bsp_init_pads(); - if (!conf->skip_pads_config) - { - pi_pad_set_function(PI_PAD_32_A13_TIMER0_CH1, PI_PAD_32_A13_GPIO_A18_FUNC1); - } - return 0; -} - -void bsp_ov5640_conf_init(struct pi_ov5640_conf *conf) -{ - __bsp_init_pads(); - conf->i2c_itf = CONFIG_OV5640_I2C_ID; - conf->cpi_itf = CONFIG_OV5640_CPI_ID; -} - -int bsp_ov5640_open(struct pi_ov5640_conf *conf) -{ - __bsp_init_pads(); - return 0; -} - -void bsp_ili9341_conf_init(struct pi_ili9341_conf *conf) -{ - conf->gpio = CONFIG_ILI9341_GPIO; - conf->spi_itf = CONFIG_ILI9341_SPI_ITF; - conf->spi_cs = CONFIG_ILI9341_SPI_CS; - -} - -void bsp_pixart_conf_init(struct pi_pixart_conf *conf) -{ - conf->cpi_itf = CONFIG_PIXART_CPI_ITF; - conf->spi_itf = CONFIG_PIXART_SPI_ITF; - conf->spi_cs = CONFIG_PIXART_SPI_CS; - conf->pwm_id = CONFIG_PIXART_PWM_ID; - conf->pwm_channel = CONFIG_PIXART_PWM_CH; - conf->gpio_ctl.gpio_power_4V = CONFIG_PIXART_GPIO_PWR_4V; - conf->gpio_ctl.gpio_power_2V5 = CONFIG_PIXART_GPIO_PWR_2V5; - conf->gpio_ctl.gpio_reset = CONFIG_PIXART_GPIO_RESET; -} - -int bsp_pixart_open(struct pi_pixart_conf *conf) -{ - __bsp_init_pads(); - return 0; -} - -int bsp_ili9341_open(struct pi_ili9341_conf *conf) -{ - __bsp_init_pads(); - - if (!conf->skip_pads_config) - { - pi_pad_set_function(CONFIG_ILI9341_GPIO_PAD, CONFIG_ILI9341_GPIO_PAD_FUNC); - } - - return 0; -} - - -void pi_bsp_init_profile(int profile) -{ - __bsp_init_pads(); - - if (profile == PI_BSP_PROFILE_DEFAULT) - { - /* Special for I2S1, use alternative pad for SDI signal. */ - pi_pad_set_function(PI_PAD_35_B13_I2S1_SCK, PI_PAD_35_B13_I2S1_SDI_FUNC3); - pi_pad_set_function(PI_PAD_37_B14_I2S1_SDI, PI_PAD_37_B14_HYPER_CK_FUNC3); - -#ifndef __ZEPHYR__ - pi_i2s_setup(PI_I2S_SETUP_SINGLE_CLOCK); -#endif - } -} - - - -void bsp_nina_w10_conf_init(struct pi_nina_w10_conf *conf) -{ - conf->spi_itf = CONFIG_NINA_W10_SPI_ITF; - conf->spi_cs = CONFIG_NINA_W10_SPI_CS; -} - -int bsp_nina_w10_open(struct pi_nina_w10_conf *conf) -{ - __bsp_init_pads(); - return 0; -} - - - -void pi_bsp_init() -{ - pi_bsp_init_profile(PI_BSP_PROFILE_DEFAULT); -} diff --git a/rtos/pmsis/pmsis_bsp/bsp/pulp.c b/rtos/pmsis/pmsis_bsp/bsp/pulp.c deleted file mode 100644 index 9d4c500a..00000000 --- a/rtos/pmsis/pmsis_bsp/bsp/pulp.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "pmsis.h" - -#include "bsp/bsp.h" -#include "bsp/pulp.h" -#include "bsp/camera/himax.h" -#include "bsp/flash/hyperflash.h" -#include "bsp/ram/hyperram.h" -#include "bsp/ram/spiram.h" -#include "bsp/eeprom/24xx1025.h" -#include "bsp/eeprom/virtual_eeprom.h" - -static int __bsp_init_pads_done = 0; - -static void __bsp_init_pads() -{ - if (!__bsp_init_pads_done) - { - __bsp_init_pads_done = 1; - } -} - - -void bsp_hyperram_conf_init(struct pi_hyperram_conf *conf) -{ - conf->ram_start = CONFIG_HYPERRAM_START; - conf->ram_size = CONFIG_HYPERRAM_SIZE; - conf->skip_pads_config = 0; - conf->hyper_itf = CONFIG_HYPERRAM_HYPER_ITF; - conf->hyper_cs = CONFIG_HYPERRAM_HYPER_CS; -} - - -int bsp_hyperram_open(struct pi_hyperram_conf *conf) -{ - __bsp_init_pads(); - return 0; -} - - - -void bsp_hyperflash_conf_init(struct pi_hyperflash_conf *conf) -{ - conf->hyper_itf = CONFIG_HYPERFLASH_HYPER_ITF; - conf->hyper_cs = CONFIG_HYPERFLASH_HYPER_CS; -} - -int bsp_hyperflash_open(struct pi_hyperflash_conf *conf) -{ - __bsp_init_pads(); - return 0; -} - - - -void bsp_init() -{ -} - - -void pi_bsp_init_profile(int profile) -{ -} - - - -void pi_bsp_init() -{ - pi_bsp_init_profile(PI_BSP_PROFILE_DEFAULT); -} diff --git a/rtos/pmsis/pmsis_bsp/bsp/vega.c b/rtos/pmsis/pmsis_bsp/bsp/vega.c deleted file mode 100644 index 8051fb07..00000000 --- a/rtos/pmsis/pmsis_bsp/bsp/vega.c +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "pmsis.h" - -#include "bsp/bsp.h" -#include "bsp/vega.h" -#include "bsp/camera/himax.h" -#include "bsp/flash/hyperflash.h" -#include "bsp/ram/hyperram.h" -#include "bsp/ram/spiram.h" - - - - -static int __bsp_init_pads_done = 0; - -static void __bsp_init_pads() -{ - if (!__bsp_init_pads_done) - { - __bsp_init_pads_done = 1; - } -} - - -void bsp_hyperram_conf_init(struct pi_hyperram_conf *conf) -{ - conf->ram_start = CONFIG_HYPERRAM_START; - conf->ram_size = CONFIG_HYPERRAM_SIZE; - conf->skip_pads_config = 0; - conf->hyper_itf = CONFIG_HYPERRAM_HYPER_ITF; - conf->hyper_cs = CONFIG_HYPERRAM_HYPER_CS; -} - -int bsp_hyperram_open(struct pi_hyperram_conf *conf) -{ - __bsp_init_pads(); - return 0; -} - - - -void bsp_hyperflash_conf_init(struct pi_hyperflash_conf *conf) -{ - conf->hyper_itf = CONFIG_HYPERFLASH_HYPER_ITF; - conf->hyper_cs = CONFIG_HYPERFLASH_HYPER_CS; -} - -int bsp_hyperflash_open(struct pi_hyperflash_conf *conf) -{ - __bsp_init_pads(); - return 0; -} - - - -void bsp_spiflash_conf_init(struct pi_spiflash_conf *conf) -{ - conf->size = CONFIG_SPIFLASH_SIZE; - // sector size is in number of KB - conf->sector_size = CONFIG_SPIFLASH_SECTOR_SIZE; - conf->spi_itf = CONFIG_SPIFLASH_SPI_ITF; - conf->spi_cs = CONFIG_SPIFLASH_SPI_CS; -} - -int bsp_spiflash_open(struct pi_spiflash_conf *conf) -{ - return 0; -} - - -void bsp_spiram_conf_init(struct pi_spiram_conf *conf) -{ - conf->ram_start = CONFIG_SPIRAM_START; - conf->ram_size = CONFIG_SPIRAM_SIZE; - conf->skip_pads_config = 0; - conf->spi_itf = CONFIG_SPIRAM_SPI_ITF; - conf->spi_cs = CONFIG_SPIRAM_SPI_CS; -} - -int bsp_spiram_open(struct pi_spiram_conf *conf) -{ - __bsp_init_pads(); - return 0; -} - - -void bsp_himax_conf_init(struct pi_himax_conf *conf) -{ - conf->i2c_itf = CONFIG_HIMAX_I2C_ITF; - conf->cpi_itf = CONFIG_HIMAX_CPI_ITF; -} - -int bsp_himax_open(struct pi_himax_conf *conf) -{ - __bsp_init_pads(); - return 0; -} - - - -void bsp_init() -{ -} - - -void pi_bsp_init_profile(int profile) -{ -} - - - -void pi_bsp_init() -{ - pi_bsp_init_profile(PI_BSP_PROFILE_DEFAULT); -} \ No newline at end of file diff --git a/rtos/pmsis/pmsis_bsp/bsp/wolfe.c b/rtos/pmsis/pmsis_bsp/bsp/wolfe.c deleted file mode 100644 index 49e581d1..00000000 --- a/rtos/pmsis/pmsis_bsp/bsp/wolfe.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "pmsis.h" - -#include "bsp/bsp.h" -#include "bsp/wolfe.h" -#include "bsp/camera/himax.h" -#include "bsp/flash/hyperflash.h" -#include "bsp/ram/hyperram.h" -#include "bsp/ram/spiram.h" - - -static int __bsp_init_pads_done = 0; - -static void __bsp_init_pads() -{ - if (!__bsp_init_pads_done) - { - __bsp_init_pads_done = 1; - } -} - - -void bsp_hyperram_conf_init(struct pi_hyperram_conf *conf) -{ - conf->ram_start = CONFIG_HYPERRAM_START; - conf->ram_size = CONFIG_HYPERRAM_SIZE; - conf->skip_pads_config = 0; - conf->hyper_itf = CONFIG_HYPERRAM_HYPER_ITF; - conf->hyper_cs = CONFIG_HYPERRAM_HYPER_CS; -} - -int bsp_hyperram_open(struct pi_hyperram_conf *conf) -{ - __bsp_init_pads(); - return 0; -} - - - -void bsp_hyperflash_conf_init(struct pi_hyperflash_conf *conf) -{ - conf->hyper_itf = CONFIG_HYPERFLASH_HYPER_ITF; - conf->hyper_cs = CONFIG_HYPERFLASH_HYPER_CS; -} - -int bsp_hyperflash_open(struct pi_hyperflash_conf *conf) -{ - __bsp_init_pads(); - return 0; -} - - -void bsp_spiflash_conf_init(struct pi_spiflash_conf *conf) -{ - conf->size = CONFIG_SPIFLASH_SIZE; - // sector size is in number of KB - conf->sector_size = CONFIG_SPIFLASH_SECTOR_SIZE; - conf->spi_itf = CONFIG_SPIFLASH_SPI_ITF; - conf->spi_cs = CONFIG_SPIFLASH_SPI_CS; -} - -int bsp_spiflash_open(struct pi_spiflash_conf *conf) -{ - return 0; -} - - - -void bsp_spiram_conf_init(struct pi_spiram_conf *conf) -{ - conf->ram_start = CONFIG_SPIRAM_START; - conf->ram_size = CONFIG_SPIRAM_SIZE; - conf->skip_pads_config = 0; - conf->spi_itf = CONFIG_SPIRAM_SPI_ITF; - conf->spi_cs = CONFIG_SPIRAM_SPI_CS; -} - -int bsp_spiram_open(struct pi_spiram_conf *conf) -{ - __bsp_init_pads(); - return 0; -} - - -void bsp_himax_conf_init(struct pi_himax_conf *conf) -{ - conf->i2c_itf = CONFIG_HIMAX_I2C_ITF; - conf->cpi_itf = CONFIG_HIMAX_CPI_ITF; -} - -int bsp_himax_open(struct pi_himax_conf *conf) -{ - __bsp_init_pads(); - return 0; -} - - - -void bsp_init() -{ -} - - - -void pi_bsp_init_profile(int profile) -{ -} - - - -void pi_bsp_init() -{ - pi_bsp_init_profile(PI_BSP_PROFILE_DEFAULT); -} \ No newline at end of file diff --git a/rtos/pmsis/pmsis_bsp/camera/gc0308/gc0308.c b/rtos/pmsis/pmsis_bsp/camera/gc0308/gc0308.c deleted file mode 100755 index e81cf4d5..00000000 --- a/rtos/pmsis/pmsis_bsp/camera/gc0308/gc0308.c +++ /dev/null @@ -1,611 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Authors: Yao ZHANG, GreenWaves Technologies (yao.zhang@greenwaves-technologies.com) - * Francesco PACI, GreenWaves Technologies (francesco.paci@greenwaves-technologies.com) - Germain Haugou, GreenWaves Technologies (germain.haugou@greenwaves-technologies.com) - */ - -#include "pmsis.h" -#include "bsp/bsp.h" -#include "bsp/camera/gc0308.h" -#include "gc0308.h" - -typedef struct { - uint8_t addr; - uint8_t value; -} i2c_req_t; - - -typedef struct { - struct pi_gc0308_conf conf; - struct pi_device cpi_device; - struct pi_device i2c_device; - - struct pi_device gpio_port; - - i2c_req_t i2c_req; - uint32_t i2c_read_value; - - int is_awake; -} gc0308_t; - - -typedef i2c_req_t gc0308_reg_init_t; - -static gc0308_reg_init_t __gc0308_reg_init[] = -{ - {0xfe,0x00}, - {0x01,0xcb}, //0x28 - {0x02,0x60}, //0x00 - {0x0f,0x18}, //0x21 - {0xe2,0x00}, - {0xe3,0xFA}, - {0xe4,0x03}, - {0xe5,0xE8}, - {0xe6,0x03}, - {0xe7,0xE8}, - {0xe8,0x03}, - {0xe9,0xE8}, - {0xea,0x09}, - {0xeb,0xC4}, - {0xec,0x20}, - {0x05,0x00}, - {0x06,0x00}, - {0x07,0x00}, - {0x08,0x00}, - - //{0x09,0x00}, - //{0x0a,0xF8}, - // - //{0x0b,0x01}, - //{0x0c,0x48}, - - {0x0d,0x02}, - {0x0e,0x02}, - {0x10,0x26}, - {0x11,0x0d}, - {0x12,0x2a}, - {0x13,0x00}, - {0x14,0x11}, - - //{0x15,0x4a}, - - {0x16,0x05}, - {0x17,0x01}, - {0x18,0x44}, - {0x19,0x44}, - {0x1a,0x2a}, - {0x1b,0x00}, - {0x1c,0x49}, - {0x1d,0x9a}, - {0x1e,0x61}, - {0x1f,0x16}, - {0x20,0x7f}, - {0x21,0xfa}, - {0x22,0x57}, - {0x24,0xa6}, //Only Y, can be changed to RGB or YUV - {0x25,0x0f}, - {0x26,0x02}, // Vsync Low active, Hsync High active - {0x28,0x00}, - {0x2d,0x0a}, - {0x2f,0x01}, - {0x30,0xf7}, - {0x31,0x50}, - {0x32,0x00}, - {0x33,0x28}, - {0x34,0x2a}, - {0x35,0x28}, - {0x39,0x04}, - {0x3a,0x20}, - {0x3b,0x20}, - {0x3c,0x00}, - {0x3d,0x00}, - {0x3e,0x00}, - {0x3f,0x00}, - - - {0x50,0x14}, // 0x14 - {0x52,0x41}, - {0x53,0x80}, - {0x55,0x80}, - {0x56,0x80}, - {0x8b,0x20}, - {0x8c,0x20}, - {0x8d,0x20}, - {0x8e,0x14}, - {0x8f,0x10}, - {0x90,0x14}, - {0x91,0x3c}, - {0x92,0x50}, - {0x5d,0x12}, - {0x5e,0x1a}, - {0x5f,0x24}, - {0x60,0x07}, - {0x61,0x15}, - {0x62,0x08}, // 0x08 - {0x64,0x03}, // 0x03 - {0x66,0xe8}, - {0x67,0x86}, - {0x68,0x82}, - {0x69,0x18}, - {0x6a,0x0f}, - {0x6b,0x00}, - {0x6c,0x5f}, - {0x6d,0x8f}, - {0x6e,0x55}, - {0x6f,0x38}, - {0x70,0x15}, - {0x71,0x33}, - {0x72,0xdc}, - {0x73,0x00}, - {0x74,0x02}, - {0x75,0x3f}, - {0x76,0x02}, - {0x77,0x38}, // 0x47 - {0x78,0x88}, - {0x79,0x81}, - {0x7a,0x81}, - {0x7b,0x22}, - {0x7c,0xff}, - {0x93,0x48}, //color matrix default - {0x94,0x02}, - {0x95,0x07}, - {0x96,0xe0}, - {0x97,0x40}, - {0x98,0xf0}, - {0xb1,0x40}, - {0xb2,0x40}, - {0xb3,0x40}, //0x40 - {0xb6,0xe0}, - {0xbd,0x38}, - {0xbe,0x36}, - {0xd0,0xCB}, - {0xd1,0x10}, - {0xd2,0x90}, - {0xd3,0x48}, - {0xd5,0xF2}, - {0xd6,0x16}, - {0xdb,0x92}, - {0xdc,0xA5}, - {0xdf,0x23}, - {0xd9,0x00}, - {0xda,0x00}, - {0xe0,0x09}, - {0xed,0x04}, - {0xee,0xa0}, - {0xef,0x40}, - {0x80,0x03}, - - {0x9F,0x10}, - {0xA0,0x20}, - {0xA1,0x38}, - {0xA2,0x4e}, - {0xA3,0x63}, - {0xA4,0x76}, - {0xA5,0x87}, - {0xA6,0xa2}, - {0xA7,0xb8}, - {0xA8,0xca}, - {0xA9,0xd8}, - {0xAA,0xe3}, - {0xAB,0xeb}, - {0xAC,0xf0}, - {0xAD,0xF8}, - {0xAE,0xFd}, - {0xAF,0xFF}, - - {0xc0,0x00}, - {0xc1,0x10}, - {0xc2,0x1c}, - {0xc3,0x30}, - {0xc4,0x43}, - {0xc5,0x54}, - {0xc6,0x65}, - {0xc7,0x75}, - {0xc8,0x93}, - {0xc9,0xB0}, - {0xca,0xCB}, - {0xcb,0xE6}, - {0xcc,0xFF}, - {0xf0,0x02}, - {0xf1,0x01}, - {0xf2,0x02}, - {0xf3,0x30}, - {0xf7,0x12}, - {0xf8,0x0a}, - {0xf9,0x9f}, - {0xfa,0x78}, - {0xfe,0x01}, - {0x00,0xf5}, - {0x02,0x20}, - {0x04,0x10}, - {0x05,0x08}, - {0x06,0x20}, - {0x08,0x0a}, - {0x0a,0xa0}, - {0x0b,0x60}, - {0x0c,0x08}, - {0x0e,0x44}, - {0x0f,0x32}, - {0x10,0x41}, - {0x11,0x37}, - {0x12,0x22}, - {0x13,0x19}, - {0x14,0x44}, - {0x15,0x44}, - {0x16,0xc2}, - {0x17,0xA8}, - {0x18,0x18}, - {0x19,0x50}, - {0x1a,0xd8}, - {0x1b,0xf5}, - {0x70,0x40}, - {0x71,0x58}, - {0x72,0x30}, - {0x73,0x48}, - {0x74,0x20}, - {0x75,0x60}, - {0x77,0x20}, - {0x78,0x32}, - {0x30,0x03}, - {0x31,0x40}, - {0x32,0x10}, - {0x33,0xe0}, - {0x34,0xe0}, - {0x35,0x00}, - {0x36,0x80}, - {0x37,0x00}, - {0x38,0x04}, - {0x39,0x09}, - {0x3a,0x12}, - {0x3b,0x1C}, - {0x3c,0x28}, - {0x3d,0x31}, - {0x3e,0x44}, - {0x3f,0x57}, - {0x40,0x6C}, - {0x41,0x81}, - {0x42,0x94}, - {0x43,0xA7}, - {0x44,0xB8}, - {0x45,0xD6}, - // {0x46,0xEE}, -// {0x47,0x0d}, - {0x62,0xf7}, - {0x63,0x68}, - {0x64,0xd3}, - {0x65,0xd3}, - {0x66,0x60}, - {0xfe,0x00}, - -}; - -static inline int is_i2c_active() -{ -#if defined(ARCHI_PLATFORM_RTL) - - // I2C driver is not yet working on some chips, at least this works on gvsoc. - // Also there is noI2C connection to camera model on RTL -#if PULP_CHIP == CHIP_GAP9 || PULP_CHIP == CHIP_VEGA || PULP_CHIP == CHIP_ARNOLD || PULP_CHIP == CHIP_PULPISSIMO || PULP_CHIP == CHIP_PULPISSIMO_V1 - return 0; -#else - return rt_platform() != ARCHI_PLATFORM_RTL; -#endif - -#else - - return 1; - -#endif -} - - - -static void __gc0308_reg_write(gc0308_t *gc0308, uint8_t addr, uint8_t value) -{ - if (is_i2c_active()) - { - gc0308->i2c_req.value = value; - gc0308->i2c_req.addr = (uint8_t)addr; - pi_i2c_write(&gc0308->i2c_device, (uint8_t *)&gc0308->i2c_req, 2, PI_I2C_XFER_STOP); - } -} - - - -static uint8_t __gc0308_reg_read(gc0308_t *gc0308, uint8_t addr) -{ - - if (is_i2c_active()) - { - gc0308->i2c_req.addr = (addr & 0xFF); - pi_i2c_write(&gc0308->i2c_device, (uint8_t *)&gc0308->i2c_req.addr, 1, PI_I2C_XFER_NO_STOP); - pi_i2c_read(&gc0308->i2c_device, (uint8_t *)&gc0308->i2c_read_value, 1, PI_I2C_XFER_STOP); - return *(volatile uint8_t *)&gc0308->i2c_read_value; - } - return 0; -} - -static void __gc0308_init_regs(gc0308_t *gc0308) -{ - int32_t i; - for(i=0; i<(int32_t)(sizeof(__gc0308_reg_init)/sizeof(gc0308_reg_init_t)); i++) - { - __gc0308_reg_write(gc0308, __gc0308_reg_init[i].addr, __gc0308_reg_init[i].value); - } - -#ifdef DEBUG - uint8_t reg_value = 0; - for(i=0; i<(sizeof(__gc0308_reg_init)/sizeof(gc0308_reg_init_t)); i++) - { - reg_value = __gc0308_reg_read(gc0308, __gc0308_reg_init[i].addr); - if (reg_value != __gc0308_reg_init[i].value) - printf("error reg: @%X = %X (expected: %X)\n", __gc0308_reg_init[i].addr, reg_value, __gc0308_reg_init[i].value); - } -#endif - -} - - - -static void __gc0308_reset(gc0308_t *gc0308) -{ - //set to 0 power down pin - pi_gpio_pin_write(&gc0308->gpio_port, gc0308->conf.reset_gpio, 0); -} - - -static void __gc0308_mode(gc0308_t *gc0308, uint8_t mode) -{ - // The camera standby mode is controlled by PWDN pin, which is not connected on GAPuino board. - // Do nothing here -} - - - -static void __gc0308_wakeup(gc0308_t *gc0308) -{ - if (!gc0308->is_awake) - { - // The camera standby mode is controlled by PWDN pin, which is not connected on GAPuino board. - // Do nothing here - gc0308->is_awake = 1; - } -} - - - -static void __gc0308_standby(gc0308_t *gc0308) -{ - if (gc0308->is_awake) - { - // The camera standby mode is controlled by PWDN pin, which is not connected on GAPuino board. - // Do nothing here - gc0308->is_awake = 0; - } -} - -static void __gc0308_set_qvga(gc0308_t *gc0308) -{ - - // gc0308_t *gc0308 = (gc0308_t *)device->data; - - __gc0308_reg_write(gc0308,0xfe,0x01); - __gc0308_reg_write(gc0308,0x54,0x22); //1/2 subsample - __gc0308_reg_write(gc0308,0x55,0x03); - __gc0308_reg_write(gc0308,0x56,0x00); - __gc0308_reg_write(gc0308,0x57,0x00); - __gc0308_reg_write(gc0308,0x58,0x00); - __gc0308_reg_write(gc0308,0x59,0x00); - __gc0308_reg_write(gc0308,0xfe,0x00); - __gc0308_reg_write(gc0308,0x46,0x80);//enable crop window mode - __gc0308_reg_write(gc0308,0x47,0x00); - __gc0308_reg_write(gc0308,0x48,0x00); - __gc0308_reg_write(gc0308,0x49,0x00); - __gc0308_reg_write(gc0308,0x4a,0xf0);//240 - __gc0308_reg_write(gc0308,0x4b,0x01); - __gc0308_reg_write(gc0308,0x4c,0x40); //320 - - return; -} - -void __gc0308_set_crop(struct pi_device *device, uint8_t offset_x, uint8_t offset_y,uint16_t width,uint16_t height) -{ - uint8_t reg8; - gc0308_t *gc0308 = (gc0308_t *)device->data; - - __gc0308_reg_write(gc0308,0xfe,0x00); - //Enable Crop - __gc0308_reg_write(gc0308, 0x46, 0x80); - //set x offset - __gc0308_reg_write(gc0308, 0x48, offset_x); - //set y offset - __gc0308_reg_write(gc0308, 0x47, offset_y); - //set width - reg8 = ( width & 0x00ff); - __gc0308_reg_write(gc0308, 0x4C, reg8); - reg8 = ( width & 0x0300) >> 8; - __gc0308_reg_write(gc0308, 0x4B, reg8); - //set height - reg8 = ( height & 0x00ff); - __gc0308_reg_write(gc0308, 0x4A, reg8); - reg8 = ( height & 0x0100) >> 8; - __gc0308_reg_write(gc0308, 0x49, reg8); - - return; -} - - - - -int32_t __gc0308_open(struct pi_device *device) -{ - struct pi_gc0308_conf *conf = (struct pi_gc0308_conf *)device->config; - - gc0308_t *gc0308 = (gc0308_t *)pmsis_l2_malloc(sizeof(gc0308_t)); - if (gc0308 == NULL) return -1; - - memcpy(&gc0308->conf, conf, sizeof(*conf)); - device->data = (void *)gc0308; - - if (bsp_gc0308_open(conf)) - goto error; - - struct pi_gpio_conf gpio_reset_conf; - pi_gpio_conf_init(&gpio_reset_conf); - pi_open_from_conf(&gc0308->gpio_port, &gpio_reset_conf); - if (pi_gpio_open(&gc0308->gpio_port)) - goto error; - - pi_gpio_pin_configure(&gc0308->gpio_port, conf->reset_gpio, PI_GPIO_OUTPUT); - - struct pi_cpi_conf cpi_conf; - pi_cpi_conf_init(&cpi_conf); - cpi_conf.itf = conf->cpi_itf; - pi_open_from_conf(&gc0308->cpi_device, &cpi_conf); - - if (pi_cpi_open(&gc0308->cpi_device)) - goto error; - - struct pi_i2c_conf i2c_conf; - pi_i2c_conf_init(&i2c_conf); - i2c_conf.cs = 0x42; - i2c_conf.itf = conf->i2c_itf; - i2c_conf.max_baudrate = 200000; - pi_open_from_conf(&gc0308->i2c_device, &i2c_conf); - - if (pi_i2c_open(&gc0308->i2c_device)) - goto error2; - - __gc0308_reset(gc0308); - - uint8_t cam_id = __gc0308_reg_read(gc0308, 0x00); - if (cam_id != 0x9b) goto error2; - - __gc0308_init_regs(gc0308); - - if(gc0308->conf.format==PI_CAMERA_QVGA){ - __gc0308_set_qvga(gc0308); - } - - if(gc0308->conf.color_mode==PI_CAMERA_GRAY8){ - pi_cpi_set_format(&gc0308->cpi_device, PI_CPI_FORMAT_BYPASS_BIGEND); - __gc0308_reg_write(gc0308,0x24,0xb1); //set to YUV and get only Y - }else{ - pi_cpi_set_format(&gc0308->cpi_device, PI_CPI_FORMAT_BYPASS_LITEND); - //registers in this case are left by default to RGB565 - } - - - return 0; - -error2: - pi_cpi_close(&gc0308->cpi_device); -error: - pmsis_l2_malloc_free(gc0308, sizeof(gc0308_t)); - return -1; -} - - - -static void __gc0308_close(struct pi_device *device) -{ - gc0308_t *gc0308 = (gc0308_t *)device->data; - __gc0308_standby(gc0308); - pi_cpi_close(&gc0308->cpi_device); - pmsis_l2_malloc_free(gc0308, sizeof(gc0308_t)); -} - - - -static int32_t __gc0308_control(struct pi_device *device, pi_camera_cmd_e cmd, void *arg) -{ - int irq = disable_irq(); - - gc0308_t *gc0308 = (gc0308_t *)device->data; - - switch (cmd) - { - case PI_CAMERA_CMD_ON: - __gc0308_wakeup(gc0308); - break; - - case PI_CAMERA_CMD_OFF: - __gc0308_standby(gc0308); - break; - - case PI_CAMERA_CMD_START: - pi_cpi_control_start(&gc0308->cpi_device); - break; - - case PI_CAMERA_CMD_STOP: - pi_cpi_control_stop(&gc0308->cpi_device); - break; - - default: - break; - } - - restore_irq(irq); - - return 0; -} - -void __gc0308_capture_async(struct pi_device *device, void *buffer, uint32_t bufferlen, pi_task_t *task) -{ - gc0308_t *gc0308 = (gc0308_t *)device->data; - - pi_cpi_capture_async(&gc0308->cpi_device, buffer, bufferlen, task); -} - -int32_t __gc0308_reg_set(struct pi_device *device, uint32_t addr, uint8_t *value) -{ - gc0308_t *gc0308 = (gc0308_t *)device->data; - __gc0308_reg_write(gc0308, addr, *value); - return 0; -} - -int32_t __gc0308_reg_get(struct pi_device *device, uint32_t addr, uint8_t *value) -{ - gc0308_t *gc0308 = (gc0308_t *)device->data; - *value = __gc0308_reg_read(gc0308, addr); - return 0; -} - - -static pi_camera_api_t gc0308_api = -{ - .open = &__gc0308_open, - .close = &__gc0308_close, - .control = &__gc0308_control, - .capture_async = &__gc0308_capture_async, - .reg_set = &__gc0308_reg_set, - .reg_get = &__gc0308_reg_get, - .set_crop = &__gc0308_set_crop, -}; - - -void pi_gc0308_conf_init(struct pi_gc0308_conf *conf) -{ - conf->camera.api = &gc0308_api; - conf->skip_pads_config = 0; - bsp_gc0308_conf_init(conf); - __camera_conf_init(&conf->camera); - conf->format = PI_CAMERA_QVGA; - conf->color_mode = PI_CAMERA_RGB565; -} diff --git a/rtos/pmsis/pmsis_bsp/camera/gc0308/gc0308.h b/rtos/pmsis/pmsis_bsp/camera/gc0308/gc0308.h deleted file mode 100755 index f807c706..00000000 --- a/rtos/pmsis/pmsis_bsp/camera/gc0308/gc0308.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __CAM_GC0308_H__ -#define __CAM_GC0308_H__ - - -enum { - GC0308_STANDBY = 0x0, - GC0308_STREAMING = 0x1, // I2C triggered streaming enable -}; - - -#endif diff --git a/rtos/pmsis/pmsis_bsp/camera/himax/himax.c b/rtos/pmsis/pmsis_bsp/camera/himax/himax.c deleted file mode 100644 index 09e0b0ab..00000000 --- a/rtos/pmsis/pmsis_bsp/camera/himax/himax.c +++ /dev/null @@ -1,367 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Authors: Yao ZHANG, GreenWaves Technologies (yao.zhang@greenwaves-technologies.com) - * Francesco PACI, GreenWaves Technologies (francesco.paci@greenwaves-technologies.com) - Germain Haugou, GreenWaves Technologies (germain.haugou@greenwaves-technologies.com) - */ - -#include "pmsis.h" -#include "pmsis/rtos/os_frontend_api/pmsis_time.h" -#include "bsp/bsp.h" -#include "bsp/camera/himax.h" -#include "himax.h" - - -typedef struct { - uint16_t addr; - uint8_t value; -} i2c_req_t; - - -typedef struct { - struct pi_device cpi_device; - struct pi_device i2c_device; - i2c_req_t i2c_req; - uint32_t i2c_read_value; - int is_awake; -} himax_t; - - - -typedef struct { - uint16_t addr; - uint8_t data; -} himax_reg_init_t; - - - -static himax_reg_init_t __himax_reg_init[] = -{ - {HIMAX_BLC_TGT, 0x08}, // BLC target :8 at 8 bit mode - {HIMAX_BLC2_TGT, 0x08}, // BLI target :8 at 8 bit mode - {HIMAX_BIT_CONTROL, 0x1E}, - {HIMAX_ANA_Register_14, 0x00}, - {HIMAX_OUTPUT_PIN_STATUS_CONTROL, 0x04}, // pad pull 0 - - {HIMAX_BLC_CFG, 0x43}, // BLC_on, IIR - - {HIMAX_BLI_EN, 0x01}, // BLI enable - {HIMAX_BLC_TGT, 0x00}, // BLI Target [Def: 0x20] - - {HIMAX_DPC_CTRL, 0x01}, // DPC option 0: DPC off 1 : mono 3 : bayer1 5 : bayer2 - {HIMAX_SINGLE_THR_HOT, 0x90}, // single hot pixel th - {HIMAX_SINGLE_THR_COLD, 0x40}, // single cold pixel th - - {HIMAX_STATISTIC_CTRL, 0x07}, - {HIMAX_MD_LROI_Y_START_H, 0x00}, - {HIMAX_MD_LROI_Y_START_L, 0x58}, - {HIMAX_MD_LROI_Y_END_H, 0x00}, - {HIMAX_MD_LROI_Y_END_L, 0x9B}, - - {HIMAX_AE_CTRL, 0x01}, //Automatic Exposure Gain Control - {HIMAX_AE_TARGET_MEAN, 0x3C}, //AE target mean [Def: 0x3C] - {HIMAX_AE_MIN_MEAN, 0x0A}, //AE min target mean [Def: 0x0A] - - {HIMAX_INTEGRATION_H, 0x00}, //Integration H [Def: 0x01] - {HIMAX_INTEGRATION_L, 0x60}, //Integration L [Def: 0x08] - {HIMAX_ANALOG_GAIN, 0x00}, //Analog Global Gain - {HIMAX_DAMPING_FACTOR, 0x20}, //Damping Factor [Def: 0x20] - {HIMAX_DIGITAL_GAIN_H, 0x01}, //Digital Gain High [Def: 0x01] - {HIMAX_DIGITAL_GAIN_L, 0x00}, //Digital Gain Low [Def: 0x00] - - {HIMAX_CONVERGE_IN_TH, 0x03}, - {HIMAX_CONVERGE_OUT_TH, 0x05}, - - {HIMAX_MAX_INTG_H, 0x01}, - {HIMAX_MAX_INTG_L, 0x54}, - - {HIMAX_MAX_AGAIN_FULL, 0x03}, - {HIMAX_MAX_AGAIN_BIN2, 0x04}, - - {HIMAX_MAX_DGAIN, 0xC0}, - {HIMAX_FS_CTRL, 0x00}, //Flicker Control - {HIMAX_FS_60HZ_H, 0x00}, - {HIMAX_FS_60HZ_L, 0x3C}, - {HIMAX_FS_50HZ_H, 0x00}, - {HIMAX_FS_50HZ_L, 0x32}, - - {HIMAX_MD_CTRL, 0x30}, - {HIMAX_FRAME_LEN_LINES_H, 0x02}, - {HIMAX_FRAME_LEN_LINES_L, 0x16}, - {HIMAX_LINE_LEN_PCK_H, 0x01}, - {HIMAX_LINE_LEN_PCK_L, 0x78}, - {HIMAX_QVGA_WIN_EN, 0x00}, - {HIMAX_READOUT_X, 0x01}, - {HIMAX_READOUT_Y, 0x01}, - {HIMAX_BINNING_MODE, 0x00}, - {HIMAX_SIX_BIT_MODE_EN, 0x70}, - {HIMAX_BIT_CONTROL, 0x02}, - {HIMAX_OSC_CLK_DIV, 0x0B}, -// {HIMAX_OSC_CLK_DIV, 0x25}, //Clock gating and clock divisors - {HIMAX_PCLK_POLARITY, 0x20}, //PCLK0 polarity - {HIMAX_IMG_ORIENTATION, 0x00}, // change the orientation - {HIMAX_GRP_PARAM_HOLD, 0x01}, // hold - {HIMAX_VSYNC_HSYNC_PIXEL_SHIFT_EN, 0x01}, // avoid 2 invalid pixel columns -}; - - - -static inline int is_i2c_active() -{ -#if defined(ARCHI_PLATFORM_RTL) - - // I2C driver is not yet working on some chips, at least this works on gvsoc. - // Also there is noI2C connection to camera model on RTL -#if PULP_CHIP == CHIP_GAP9 || PULP_CHIP == CHIP_VEGA || PULP_CHIP == CHIP_ARNOLD || PULP_CHIP == CHIP_PULPISSIMO || PULP_CHIP == CHIP_PULPISSIMO_V1 - return 0; -#else - return rt_platform() != ARCHI_PLATFORM_RTL; -#endif - -#else - - return 1; - -#endif -} - - - -static void __himax_reg_write(himax_t *himax, uint16_t addr, uint8_t value) -{ - if (is_i2c_active()) - { - himax->i2c_req.value = value; - himax->i2c_req.addr = ((addr >> 8) & 0xff) | ((addr & 0xff) << 8); - pi_i2c_write(&himax->i2c_device, (uint8_t *)&himax->i2c_req, 3, PI_I2C_XFER_STOP); - } -} - - - -static uint8_t __himax_reg_read(himax_t *himax, uint16_t addr) -{ - if (is_i2c_active()) - { - himax->i2c_req.addr = ((addr >> 8) & 0xff) | ((addr & 0xff) << 8); - pi_i2c_write(&himax->i2c_device, (uint8_t *)&himax->i2c_req, 2, PI_I2C_XFER_NO_STOP); - pi_i2c_read(&himax->i2c_device, (uint8_t *)&himax->i2c_read_value, 1, PI_I2C_XFER_STOP); - return *(volatile uint8_t *)&himax->i2c_read_value; - } - else - { - return 0; - } -} - - - -static void __himax_init_regs(himax_t *himax) -{ - int32_t i; - for(i=0; i<(int32_t)(sizeof(__himax_reg_init)/sizeof(himax_reg_init_t)); i++) - { - __himax_reg_write(himax, __himax_reg_init[i].addr, __himax_reg_init[i].data); - } -} - - - -static void __himax_reset(himax_t *himax) -{ - __himax_reg_write(himax, HIMAX_SW_RESET, HIMAX_RESET); - - while (__himax_reg_read(himax, HIMAX_MODE_SELECT) != HIMAX_STANDBY) - { - __himax_reg_write(himax, HIMAX_SW_RESET, HIMAX_RESET); - pi_time_wait_us(50); - } -} - - - -static void __himax_mode(himax_t *himax, uint8_t mode) -{ - __himax_reg_write(himax, HIMAX_MODE_SELECT, mode); -} - - - -static void __himax_wakeup(himax_t *himax) -{ - if (!himax->is_awake) - { - __himax_mode(himax, HIMAX_STREAMING); - himax->is_awake = 1; - } -} - - - -static void __himax_standby(himax_t *himax) -{ - if (himax->is_awake) - { - __himax_mode(himax, HIMAX_STANDBY); - himax->is_awake = 0; - } -} - - - -int32_t __himax_open(struct pi_device *device) -{ - struct pi_himax_conf *conf = (struct pi_himax_conf *)device->config; - - himax_t *himax = (himax_t *)pmsis_l2_malloc(sizeof(himax_t)); - if (himax == NULL) return -1; - - device->data = (void *)himax; - - if (bsp_himax_open(conf)) - goto error; - - struct pi_cpi_conf cpi_conf; - pi_cpi_conf_init(&cpi_conf); - cpi_conf.itf = conf->cpi_itf; - pi_open_from_conf(&himax->cpi_device, &cpi_conf); - - if (pi_cpi_open(&himax->cpi_device)) - goto error; - - struct pi_i2c_conf i2c_conf; - pi_i2c_conf_init(&i2c_conf); - i2c_conf.cs = 0x48; - i2c_conf.itf = conf->i2c_itf; - pi_open_from_conf(&himax->i2c_device, &i2c_conf); - - if (pi_i2c_open(&himax->i2c_device)) - goto error2; - - pi_cpi_set_format(&himax->cpi_device, PI_CPI_FORMAT_BYPASS_BIGEND); - - himax->is_awake = 0; - - __himax_reset(himax); - - __himax_init_regs(himax); - - __himax_wakeup(himax); - - return 0; - -error2: - pi_cpi_close(&himax->cpi_device); -error: - pmsis_l2_malloc_free(himax, sizeof(himax_t)); - return -1; -} - - - -static void __himax_close(struct pi_device *device) -{ - himax_t *himax = (himax_t *)device->data; - __himax_standby(himax); - pi_cpi_close(&himax->cpi_device); - pmsis_l2_malloc_free(himax, sizeof(himax_t)); -} - - - -static int32_t __himax_control(struct pi_device *device, pi_camera_cmd_e cmd, void *arg) -{ - int irq = disable_irq(); - - himax_t *himax = (himax_t *)device->data; - - switch (cmd) - { - case PI_CAMERA_CMD_ON: - __himax_wakeup(himax); - break; - - case PI_CAMERA_CMD_OFF: - __himax_standby(himax); - break; - - case PI_CAMERA_CMD_START: - pi_cpi_control_start(&himax->cpi_device); - break; - - case PI_CAMERA_CMD_STOP: - pi_cpi_control_stop(&himax->cpi_device); - break; - - default: - break; - } - - restore_irq(irq); - - return 0; -} - - - -void __himax_capture_async(struct pi_device *device, void *buffer, uint32_t bufferlen, pi_task_t *task) -{ - himax_t *himax = (himax_t *)device->data; - - pi_cpi_capture_async(&himax->cpi_device, buffer, bufferlen, task); -} - - - -int32_t __himax_reg_set(struct pi_device *device, uint32_t addr, uint8_t *value) -{ - himax_t *himax = (himax_t *)device->data; - __himax_reg_write(himax, addr, *value); - return 0; -} - - - -int32_t __himax_reg_get(struct pi_device *device, uint32_t addr, uint8_t *value) -{ - himax_t *himax = (himax_t *)device->data; - *value = __himax_reg_read(himax, addr); - return 0; -} - - - -static pi_camera_api_t himax_api = -{ - .open = &__himax_open, - .close = &__himax_close, - .control = &__himax_control, - .capture_async = &__himax_capture_async, - .reg_set = &__himax_reg_set, - .reg_get = &__himax_reg_get -}; - - - -void pi_himax_conf_init(struct pi_himax_conf *conf) -{ - conf->camera.api = &himax_api; - conf->skip_pads_config = 0; - bsp_himax_conf_init(conf); - __camera_conf_init(&conf->camera); -} diff --git a/rtos/pmsis/pmsis_bsp/camera/himax/himax.h b/rtos/pmsis/pmsis_bsp/camera/himax/himax.h deleted file mode 100644 index f5f72fea..00000000 --- a/rtos/pmsis/pmsis_bsp/camera/himax/himax.h +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __BSP_CAMERA_HIMAX_HIMAX_H__ -#define __BSP_CAMERA_HIMAX_HIMAX_H__ - -/* - * HIMAX camera macros - */ -// Register address -// Read only registers -#define HIMAX_MODEL_ID_H 0x0000 -#define HIMAX_MODEL_ID_L 0x0001 -#define HIMAX_FRAME_COUNT 0x0005 -#define HIMAX_PIXEL_ORDER 0x0006 -// R&W registers -// Sensor mode control -#define HIMAX_MODE_SELECT 0x0100 -#define HIMAX_IMG_ORIENTATION 0x0101 -#define HIMAX_SW_RESET 0x0103 -#define HIMAX_GRP_PARAM_HOLD 0x0104 -// Sensor exposure gain control -#define HIMAX_INTEGRATION_H 0x0202 -#define HIMAX_INTEGRATION_L 0x0203 -#define HIMAX_ANALOG_GAIN 0x0205 -#define HIMAX_DIGITAL_GAIN_H 0x020E -#define HIMAX_DIGITAL_GAIN_L 0x020F -// Frame timing control -#define HIMAX_FRAME_LEN_LINES_H 0x0340 -#define HIMAX_FRAME_LEN_LINES_L 0x0341 -#define HIMAX_LINE_LEN_PCK_H 0x0342 -#define HIMAX_LINE_LEN_PCK_L 0x0343 -// Binning mode control -#define HIMAX_READOUT_X 0x0383 -#define HIMAX_READOUT_Y 0x0387 -#define HIMAX_BINNING_MODE 0x0390 -// Test pattern control -#define HIMAX_TEST_PATTERN_MODE 0x0601 -// Black level control -#define HIMAX_BLC_CFG 0x1000 -#define HIMAX_BLC_TGT 0x1003 -#define HIMAX_BLI_EN 0x1006 -#define HIMAX_BLC2_TGT 0x1007 -// Sensor reserved -#define HIMAX_DPC_CTRL 0x1008 -#define HIMAX_SINGLE_THR_HOT 0x100B -#define HIMAX_SINGLE_THR_COLD 0x100C -// VSYNC,HSYNC and pixel shift register -#define HIMAX_VSYNC_HSYNC_PIXEL_SHIFT_EN 0x1012 -// Statistic control and read only -#define HIMAX_STATISTIC_CTRL 0x2000 -#define HIMAX_MD_LROI_X_START_H 0x2011 -#define HIMAX_MD_LROI_X_START_L 0x2012 -#define HIMAX_MD_LROI_Y_START_H 0x2013 -#define HIMAX_MD_LROI_Y_START_L 0x2014 -#define HIMAX_MD_LROI_X_END_H 0x2015 -#define HIMAX_MD_LROI_X_END_L 0x2016 -#define HIMAX_MD_LROI_Y_END_H 0x2017 -#define HIMAX_MD_LROI_Y_END_L 0x2018 -// Automatic exposure gain control -#define HIMAX_AE_CTRL 0x2100 -#define HIMAX_AE_TARGET_MEAN 0x2101 -#define HIMAX_AE_MIN_MEAN 0x2102 -#define HIMAX_CONVERGE_IN_TH 0x2103 -#define HIMAX_CONVERGE_OUT_TH 0x2104 -#define HIMAX_MAX_INTG_H 0x2105 -#define HIMAX_MAX_INTG_L 0x2106 -#define HIMAX_MIN_INTG 0x2107 -#define HIMAX_MAX_AGAIN_FULL 0x2108 -#define HIMAX_MAX_AGAIN_BIN2 0x2109 -#define HIMAX_MIN_AGAIN 0x210A -#define HIMAX_MAX_DGAIN 0x210B -#define HIMAX_MIN_DGAIN 0x210C -#define HIMAX_DAMPING_FACTOR 0x210D -#define HIMAX_FS_CTRL 0x210E -#define HIMAX_FS_60HZ_H 0x210F -#define HIMAX_FS_60HZ_L 0x2110 -#define HIMAX_FS_50HZ_H 0x2111 -#define HIMAX_FS_50HZ_L 0x2112 -#define HIMAX_FS_HYST_TH 0x2113 -// Motion detection control -#define HIMAX_MD_CTRL 0x2150 -#define HIMAX_I2C_CLEAR 0x2153 -#define HIMAX_WMEAN_DIFF_TH_H 0x2155 -#define HIMAX_WMEAN_DIFF_TH_M 0x2156 -#define HIMAX_WMEAN_DIFF_TH_L 0x2157 -#define HIMAX_MD_THH 0x2158 -#define HIMAX_MD_THM1 0x2159 -#define HIMAX_MD_THM2 0x215A -#define HIMAX_MD_THL 0x215B -// Sensor timing control -#define HIMAX_QVGA_WIN_EN 0x3010 -#define HIMAX_SIX_BIT_MODE_EN 0x3011 -#define HIMAX_PMU_AUTOSLEEP_FRAMECNT 0x3020 -#define HIMAX_ADVANCE_VSYNC 0x3022 -#define HIMAX_ADVANCE_HSYNC 0x3023 -#define HIMAX_EARLY_GAIN 0x3035 -// IO and clock control -#define HIMAX_BIT_CONTROL 0x3059 -#define HIMAX_OSC_CLK_DIV 0x3060 -#define HIMAX_ANA_Register_11 0x3061 -#define HIMAX_IO_DRIVE_STR 0x3062 -#define HIMAX_IO_DRIVE_STR2 0x3063 -#define HIMAX_ANA_Register_14 0x3064 -#define HIMAX_OUTPUT_PIN_STATUS_CONTROL 0x3065 -#define HIMAX_ANA_Register_17 0x3067 -#define HIMAX_PCLK_POLARITY 0x3068 - -/* - * Useful value of Himax registers - */ -#define HIMAX_RESET 0x01 -#define HIMAX_Pclk_rising_edge 0x00 -#define HIMAX_Pclk_falling_edge 0x01 - - -enum { - HIMAX_STANDBY = 0x0, - HIMAX_STREAMING = 0x1, // I2C triggered streaming enable - HIMAX_STREAMING2 = 0x3, // Output N frames - HIMAX_STREAMING3 = 0x5 // Hardware Trigger -}; - - -#endif diff --git a/rtos/pmsis/pmsis_bsp/camera/mt9v034/mt9v034.c b/rtos/pmsis/pmsis_bsp/camera/mt9v034/mt9v034.c deleted file mode 100644 index 9eb0f823..00000000 --- a/rtos/pmsis/pmsis_bsp/camera/mt9v034/mt9v034.c +++ /dev/null @@ -1,372 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "pmsis.h" -#include "bsp/bsp.h" -#include "bsp/camera/mt9v034.h" -#include "mt9v034.h" - - - -typedef struct { - uint8_t addr; - uint16_t value; -} __attribute__((packed)) i2c_req_t; - - - -typedef struct { - struct pi_mt9v034_conf conf; - struct pi_device cpi_device; - struct pi_device i2c_device; - struct pi_device gpio_port; - i2c_req_t i2c_req; -} mt9v034_t; - - - -static inline int is_i2c_active() -{ -#if defined(ARCHI_PLATFORM_RTL) - - // I2C driver is not yet working on some chips, at least this works on gvsoc. - // Also there is noI2C connection to camera model on RTL -#if PULP_CHIP == CHIP_GAP9 || PULP_CHIP == CHIP_VEGA || PULP_CHIP == CHIP_ARNOLD || PULP_CHIP == CHIP_PULPISSIMO || PULP_CHIP == CHIP_PULPISSIMO_V1 - return 0; -#else - return rt_platform() != ARCHI_PLATFORM_RTL; -#endif - -#else - - return 1; - -#endif -} - - - -static void __mt9v034_reg_write(mt9v034_t *mt9v034, uint8_t addr, uint16_t value) -{ - if (is_i2c_active()) - { - mt9v034->i2c_req.value = ((value >> 8) & 0xff) | ((value & 0xff) << 8); - mt9v034->i2c_req.addr = addr; - pi_i2c_write(&mt9v034->i2c_device, (uint8_t *)&mt9v034->i2c_req, 3, PI_I2C_XFER_STOP); - } -} - - -static uint16_t __mt9v034_reg_read(mt9v034_t *mt9v034, uint8_t addr) -{ - if (is_i2c_active()) - { - mt9v034->i2c_req.addr = addr; - pi_i2c_write(&mt9v034->i2c_device, (uint8_t *)&mt9v034->i2c_req, 1, PI_I2C_XFER_NO_STOP); - pi_i2c_read(&mt9v034->i2c_device, (uint8_t *)&mt9v034->i2c_req.value, 2, PI_I2C_XFER_STOP); - uint16_t value = mt9v034->i2c_req.value; - return ((value >> 8) & 0xff) | ((value & 0xff) << 8); - } - return 0; -} - - - -static int __mt9v034_start(mt9v034_t *mt9v034) -{ - // GPIO_CIS_EXP // Make sure trigger input is low -- normally redundant - pi_gpio_pin_write(&mt9v034->gpio_port, mt9v034->conf.trigger_gpio, 0); - - // Enable 3V3A/3V3D - pi_gpio_pin_write(&mt9v034->gpio_port, mt9v034->conf.power_gpio, 1); // GPIO_CIS_PWRON - - // Wait for chip ready - { - uint16_t id; - do - { - id = __mt9v034_reg_read(mt9v034, MT9V034_CHIP_ID_REG); - } while (id == 0xFFFF); // Getting 0xFFFF when I2C not yet ready - - if (id != MT9V034_CHIP_ID) - { - printf("Error - Unexpected I2C device address from CIS, id got: %x\n", id); - return -1; - } - } - - // Make sure camera won't start outputting valid pixels yet: go to snapshot mode (trigger input asssumed low) - __mt9v034_reg_write(mt9v034, MT9V034_CHIP_CONTROL, MT9V034_CHIP_CONTROL_SNAPSHOT_MODE | MT9V034_CHIP_CONTROL_DVP_OFF| MT9V034_CHIP_CONTROL_SIMULTANEOUS); - - // Reset chip (except I2C config) to abort any capture started in default master mode before config change (helps save power) - __mt9v034_reg_write(mt9v034, MT9V034_RESET, MT9V034_SOFT_RESET); - - // Replace default values of some reserved registers as per recommendations ginven in datasheet Rev.D, Table 8 p14 - // Need different settings in case of binning ? - if( (__mt9v034_reg_read(mt9v034, MT9V034_COARSE_SHUTTER_WIDTH_A)==0) && (__mt9v034_reg_read(mt9v034, MT9V034_FINE_SHUTTER_WIDTH_A)<456) ) - { - __mt9v034_reg_write(mt9v034, MT9V034_RESERVED_REG20, 0x01c7); // exception to below general case - } - else - { - __mt9v034_reg_write(mt9v034, MT9V034_RESERVED_REG20, 0x03C7); // rather than default = 0x01C1 - __mt9v034_reg_write(mt9v034, MT9V034_RESERVED_REG13, 0x2D2E); // rather than default = 0x01C1 - } - - __mt9v034_reg_write(mt9v034, MT9V034_RESERVED_REG24, 0x001b); // rather than default = 0x0010 - __mt9v034_reg_write(mt9v034, MT9V034_RESERVED_REG2B, 0x0003); // rather than default = 0x0004 - __mt9v034_reg_write(mt9v034, MT9V034_RESERVED_REG2F, 0x0003); // rather than default = 0x0004 - - int binning = 0; - int width = 640; - - if (mt9v034->conf.format == PI_CAMERA_QVGA) - { - binning = 1; - width = 320; - } - if (mt9v034->conf.format == PI_CAMERA_QQVGA) - { - binning = 2; - width = 160; - } - - __mt9v034_reg_write(mt9v034, MT9V034_READ_MODE_A, - (binning << MT9V034_READ_MODE_ROW_BIN_SHIFT) | - (binning << MT9V034_READ_MODE_COLUMN_BIN_SHIFT) | - (mt9v034->conf.column_flip << MT9V034_READ_MODE_COLUMN_FLIP_SHIFT) | - (mt9v034->conf.row_flip << MT9V034_READ_MODE_ROW_FLIP_SHIFT) - ); - - if (binning) - { - // !!! In binning mode, mt9v034 appears to provide pixels with difft timing -- requiring clock inversion !! - __mt9v034_reg_write(mt9v034, MT9V034_PIXEL_CLOCK, MT9V034_PIXEL_CLOCK_INV_PXL_CLK); - - // Correct Pixel Count in Histogram - __mt9v034_reg_write(mt9v034, MT9V034_HISTOGRAM_PIXCOUNT, MT9V034_HISTOGRAM_PIXCOUNT_DEF/((1+binning)*(1+binning))); - } - - __mt9v034_reg_write(mt9v034, MT9V034_COLUMN_START_A, 56+1); // first column index is 1 - __mt9v034_reg_write(mt9v034, MT9V034_WINDOW_WIDTH_A, 640); - __mt9v034_reg_write(mt9v034, MT9V034_ROW_START_A, 4); // CAUTION: First 4 rows are dark rows, not to be read out // !!! A VOIR //// - __mt9v034_reg_write(mt9v034, MT9V034_WINDOW_HEIGHT_A, 480); - - - // Adjust target brightness - // TODO -- This could be offered as user-definable setting - #define BRIGHTNESS_1_64 MT9V034_AEC_AGC_DESIRED_BIN_DEF // keep at MT9V034_AEC_AGC_DESIRED_BIN_DEF=58 for default brightness (Min=1, Max=64) - __mt9v034_reg_write(mt9v034, MT9V034_AEC_AGC_DESIRED_BIN, BRIGHTNESS_1_64 ); - - //Enable High Dynamic Range, this is very good for image flow - __mt9v034_reg_write(mt9v034, MT9V034_HDR, MT9V034_HDR_ON ); - - //Set Black level control to auto - __mt9v034_reg_write(mt9v034, MT9V034_BLACK_LEVEL_CTRL, MT9V034_BLACK_LEVEL_AUTO ); - - - - // Program Horizontal and Vertical Blanking accordingly: - // Keep Frame Start Blanking and Frame End Blanking to their default values - // Short row timing is not possible (see Table 5 Note 1 of DS rev D), - // minimum total row time is 704pclk (hal width +blanking) - // --> Decide to always keep total row time = 752+94 (max line width + default HBI) = 846pclk @26.66MHz -- keep same for 27MHz - #define TOTAL_ROW_TIME 704 // was 846 // = max line width + default HBI - __mt9v034_reg_write(mt9v034, MT9V034_HORIZONTAL_BLANKING_A, TOTAL_ROW_TIME - width); - //__mt9v034_reg_write(mt9v034, MT9V034_VERTICAL_BLANKING_A, 1000); - - // -- Switch camera to suitable mode (GPIO_CIS_EXP assumed low, normally already done!] - __mt9v034_reg_write(mt9v034, MT9V034_CHIP_CONTROL, MT9V034_CHIP_CONTROL_SNAPSHOT_MODE | MT9V034_CHIP_CONTROL_DVP_ON | MT9V034_CHIP_CONTROL_SIMULTANEOUS); - - - return 0; -} - - -static void __mt9v034_on(mt9v034_t *mt9v034) -{ - // Enable 3V3A/3V3D - pi_gpio_pin_write(&mt9v034->gpio_port, mt9v034->conf.power_gpio, 1); -} - - - -static void __mt9v034_off(mt9v034_t *mt9v034) -{ - // Stop 3V3A/3V3D - pi_gpio_pin_write(0, mt9v034->conf.power_gpio, 0); -} - - - -static void __mt9v034_trigger_snapshot(mt9v034_t *mt9v034) -{ - // -- GPIO_CIS_EXP snapshot trigger signal - pi_gpio_pin_write(&mt9v034->gpio_port, mt9v034->conf.trigger_gpio, 1); // generate rising edge to trigger snapshot - pi_gpio_pin_write(&mt9v034->gpio_port, mt9v034->conf.trigger_gpio, 0); // generate rising edge to trigger snapshot -} - - - -static int32_t __mt9v034_open(struct pi_device *device) -{ - struct pi_mt9v034_conf *conf = (struct pi_mt9v034_conf *)device->config; - - mt9v034_t *mt9v034 = (mt9v034_t *)pmsis_l2_malloc(sizeof(mt9v034_t)); - if (mt9v034 == NULL) return -1; - - memcpy(&mt9v034->conf, conf, sizeof(*conf)); - device->data = (void *)mt9v034; - - struct pi_cpi_conf cpi_conf; - pi_cpi_conf_init(&cpi_conf); - cpi_conf.itf = conf->cpi_itf; - pi_open_from_conf(&mt9v034->cpi_device, &cpi_conf); - - if (pi_cpi_open(&mt9v034->cpi_device)) - goto error; - - struct pi_i2c_conf i2c_conf; - pi_i2c_conf_init(&i2c_conf); - i2c_conf.cs = 0x90; - i2c_conf.itf = 1; - pi_open_from_conf(&mt9v034->i2c_device, &i2c_conf); - - if (pi_i2c_open(&mt9v034->i2c_device)) - goto error2; - - struct pi_gpio_conf gpio_conf; - pi_gpio_conf_init(&gpio_conf); - - pi_open_from_conf(&mt9v034->gpio_port, &gpio_conf); - - if (pi_gpio_open(&mt9v034->gpio_port)) - goto error3; - - pi_gpio_pin_configure(&mt9v034->gpio_port, conf->trigger_gpio, PI_GPIO_OUTPUT); - - pi_gpio_pin_configure(&mt9v034->gpio_port, conf->power_gpio, PI_GPIO_OUTPUT); - - if (__mt9v034_start(mt9v034) != 0) - goto error4; - - if (bsp_mt9v034_open(conf)) - goto error4; - - pi_cpi_set_format(&mt9v034->cpi_device, PI_CPI_FORMAT_BYPASS_BIGEND); - - return 0; - -error4: - // TODO does not exist yet - //pi_gpio_close(&mt9v034->gpio_port); -error3: - pi_i2c_close(&mt9v034->i2c_device); -error2: - pi_cpi_close(&mt9v034->cpi_device); -error: - pmsis_l2_malloc_free(mt9v034, sizeof(mt9v034_t)); - return -1; -} - - - -static void __mt9v034_close(struct pi_device *device) -{ - mt9v034_t *mt9v034 = (mt9v034_t *)device->data; - pi_cpi_close(&mt9v034->cpi_device); - pmsis_l2_malloc_free(mt9v034, sizeof(mt9v034_t)); -} - - - -static int32_t __mt9v034_control(struct pi_device *device, pi_camera_cmd_e cmd, void *arg) -{ - mt9v034_t *mt9v034 = (mt9v034_t *)device->data; - - switch (cmd) - { - case PI_CAMERA_CMD_ON: - __mt9v034_on(mt9v034); - break; - - case PI_CAMERA_CMD_OFF: - __mt9v034_off(mt9v034); - break; - - case PI_CAMERA_CMD_START: - pi_cpi_control_start(&mt9v034->cpi_device); - __mt9v034_trigger_snapshot(mt9v034); - break; - - case PI_CAMERA_CMD_STOP: - pi_cpi_control_stop(&mt9v034->cpi_device); - break; - - default: - break; - } - - return 0; -} - - - -static void __mt9v034_capture_async(struct pi_device *device, void *buffer, uint32_t bufferlen, pi_task_t *task) -{ - mt9v034_t *mt9v034 = (mt9v034_t *)device->data; - - pi_cpi_capture_async(&mt9v034->cpi_device, buffer, bufferlen, task); -} - -static int32_t __mt9v034_reg_set(struct pi_device *device, uint32_t addr, uint8_t *value) -{ - mt9v034_t *mt9v034 = (mt9v034_t *)device->data; - __mt9v034_reg_write(mt9v034, addr, *(uint16_t *)value); - return 0; -} - - - -static int32_t __mt9v034_reg_get(struct pi_device *device, uint32_t addr, uint8_t *value) -{ - mt9v034_t *mt9v034 = (mt9v034_t *)device->data; - *(uint16_t *)value = __mt9v034_reg_read(mt9v034, addr); - return 0; -} - -static pi_camera_api_t MT9V034_api = -{ - .open = &__mt9v034_open, - .close = &__mt9v034_close, - .control = &__mt9v034_control, - .capture_async = &__mt9v034_capture_async, - .reg_set = &__mt9v034_reg_set, - .reg_get = &__mt9v034_reg_get -}; - - - -void pi_mt9v034_conf_init(struct pi_mt9v034_conf *conf) -{ - conf->camera.api = &MT9V034_api; - bsp_mt9v034_conf_init(conf); - conf->format = PI_CAMERA_QVGA; - conf->column_flip = 1; - conf->row_flip = 0; - conf->skip_pads_config = 0; - __camera_conf_init(&conf->camera); -} diff --git a/rtos/pmsis/pmsis_bsp/camera/mt9v034/mt9v034.h b/rtos/pmsis/pmsis_bsp/camera/mt9v034/mt9v034.h deleted file mode 100644 index d495e76c..00000000 --- a/rtos/pmsis/pmsis_bsp/camera/mt9v034/mt9v034.h +++ /dev/null @@ -1,274 +0,0 @@ -/* -* Copyright (C) 2019 GreenWaves Technologies -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* -* Authors: Germain Haugou, GreenWaves Technologies (germain.haugou@greenwaves-technologies.com) -*/ - -// File CIS_MT9V034.h - -#ifndef __CIS_MT9V034_H -#define __CIS_MT9V034_H // avoid recursive inclusions - -#define MT9V034_DEV_ADDR_WR 0x90 // 8-bit device address for WRITE (0xB8 7-bit I2C device address) -#define MT9V034_DEV_ADDR_RD 0x91 // 8-bit device address for READ - - -// **** REGISTER DEFINITION : *************************************************** - -/* The first four rows are black rows. The active area spans 753x481 pixels. */ -#define MT9V034_PIXEL_ARRAY_HEIGHT 485 -#define MT9V034_PIXEL_ARRAY_WIDTH 753 - -#define MT9V034_SYSCLK_FREQ_DEF 26600000 - -#define MT9V034_CHIP_ID_REG 0x00 -#define MT9V034_CHIP_ID 0x1324 - -#define MT9V034_COLUMN_START_A 0x01 // _A for Context A -#define MT9V034_COLUMN_START_MIN 1 -#define MT9V034_COLUMN_START_DEF 1 -#define MT9V034_COLUMN_START_MAX 752 - -#define MT9V034_ROW_START_A 0x02 -#define MT9V034_ROW_START_MIN 4 -#define MT9V034_ROW_START_DEF 4 // was 5? -#define MT9V034_ROW_START_MAX 482 - -#define MT9V034_WINDOW_HEIGHT_A 0x03 -#define MT9V034_WINDOW_HEIGHT_MIN 1 -#define MT9V034_WINDOW_HEIGHT_DEF 480 -#define MT9V034_WINDOW_HEIGHT_MAX 480 - -#define MT9V034_WINDOW_WIDTH_A 0x04 -#define MT9V034_WINDOW_WIDTH_MIN 1 -#define MT9V034_WINDOW_WIDTH_DEF 752 -#define MT9V034_WINDOW_WIDTH_MAX 752 - -#define MT9V034_HORIZONTAL_BLANKING_A 0x05 - -#define MT9V034_HORIZONTAL_BLANKING_MIN 61 -#define MT9V034_HORIZONTAL_BLANKING_DEF 94 -#define MT9V034_HORIZONTAL_BLANKING_MAX 1023 - -#define MT9V034_VERTICAL_BLANKING_A 0x06 -#define MT9V034_VERTICAL_BLANKING_MIN 2 // was 4? -#define MT9V034_VERTICAL_BLANKING_DEF 45 -#define MT9V034_VERTICAL_BLANKING_MAX 32288 - - -#define MT9V034_CHIP_CONTROL 0x07 -#define MT9V034_CHIP_CONTROL_MASTER_MODE (1 << 3) -#define MT9V034_CHIP_CONTROL_SNAPSHOT_MODE (3 << 3) -#define MT9V034_CHIP_CONTROL_DVP_ON (1 << 7) -#define MT9V034_CHIP_CONTROL_DVP_OFF (0 << 7) -#define MT9V034_CHIP_CONTROL_SIMULTANEOUS (1 << 8) -#define MT9V034_CHIP_CONTROL_SEQUENTIAL (0 << 8) -// Some fields missing here incl. bit[15] = Context A/B switch -// !! CAUTION -- spec says bit [9] is reserved and =0 means normal (recommended) operation ...but says default value is 1 ("reserved, do not use"?!? -// --> Rev.D says its Defective Pixel Correction Enable - -#define MT9V034_SHUTTER_WIDTH1_A 0x08 - -#define MT9V034_SHUTTER_WIDTH2_A 0x09 - -#define MT9V034_SHUTTER_WIDTH_CONTROL_A 0x0a -#define SHUTTER_WIDTH_T2_RATIO_MASK (0xF << 0) // 4 bits -#define SHUTTER_WIDTH_T2_RATIO_SHIFT 0 -#define SHUTTER_WIDTH_T3_RATIO_MASK (0xF << 4) // 4 bits -#define SHUTTER_WIDTH_T3_RATIO_SHIFT 4 -#define SHUTTER_WIDTH_HDR_AUTO_ADJUST_MASK (1 << 8) -#define SHUTTER_WIDTH_HDR_AUTO_ADJUST_SHIFT 8 -#define SHUTTER_WIDTH_SINGLE_KNEE_MASK (1 << 9) -#define SHUTTER_WIDTH_SINGLE_KNEE_SHIFT 9 - - - - -#define MT9V034_COARSE_SHUTTER_WIDTH_A 0x0b -#define MT9V034_COARSE_SHUTTER_WIDTH_MIN 0 -#define MT9V034_COARSE_SHUTTER_WIDTH_DEF 480 -#define MT9V034_COARSE_SHUTTER_WIDTH_MAX 32765 - -#define MT9V034_RESET 0x0c -#define MT9V034_SOFT_RESET 0x01 -#define MT9V034_GAIN_EXP_RESET 0x02 - -#define MT9V034_READ_MODE_A 0x0d -#define MT9V034_READ_MODE_ROW_BIN_MASK (3 << 0) -#define MT9V034_READ_MODE_ROW_BIN_SHIFT 0 -#define MT9V034_READ_MODE_COLUMN_BIN_MASK (3 << 2) -#define MT9V034_READ_MODE_COLUMN_BIN_SHIFT 2 -#define MT9V034_READ_MODE_ROW_FLIP_MASK (1 << 4) -#define MT9V034_READ_MODE_ROW_FLIP_SHIFT 4 -#define MT9V034_READ_MODE_COLUMN_FLIP_MASK (1 << 5) -#define MT9V034_READ_MODE_COLUMN_FLIP_SHIFT 5 -#define MT9V034_READ_MODE_DARK_ROWS_MASK (1 << 6) -#define MT9V034_READ_MODE_DARK_ROWS_SHIFT 6 //was at posn 7? -#define MT9V034_READ_MODE_DARK_COLUMNS_MASK (1 << 7) -#define MT9V034_READ_MODE_DARK_COLUMNS_SHIFT 7 // was at posn 6? -#define MT9V034_READ_MODE_RESERVED 0x300 - -// Register @0x0E = Read Mode Context B... - -#define MT9V034_PIXEL_OPERATION_MODE 0x0f -#define MT9V034_PIXEL_OPERATION_MODE_HDR_A (1 << 0) // context A -#define MT9V034_PIXEL_OPERATION_MODE_COLOR (1 << 1) -#define MT9V034_PIXEL_OPERATION_MODE_HDR_B (1 << 8) // Context B // was (1 << 6) ?? - -// added XC: -#define MT9V034_LED_OUT_CTRL 0x1B -#define MT9V034_LED_OUT_CTRL_DISABLE (1 << 0) -#define MT9V034_LED_OUT_CTRL_INVERT (1 << 1) - -#define MT9V034_ADC_COMPANDING 0x1C -#define MT9V034_LINEAR_AB (2 << 0) | (2<<8) -#define MT9V034_12TO10_COMPANDING_AB (3 << 0) | (3<<8) - - -// Missing misc. ADC controls @0x2C, 0x31, 0x32, 0x33, 0x34 - -#define MT9V034_RESERVED_REG13 0x13 -#define MT9V034_RESERVED_REG20 0x20 -#define MT9V034_RESERVED_REG24 0x24 -#define MT9V034_RESERVED_REG2B 0x2B -#define MT9V034_RESERVED_REG2F 0x2F - -#define MT9V034_VREF_ADC 0x2C -#define MT9V034_VREF_1V0 0 // for ADC input range = 0.71V -#define MT9V034_VREF_1V1 1 // for ADC input range = 0.79V -#define MT9V034_VREF_1V2 2 // for ADC input range = 0.86V -#define MT9V034_VREF_1V3 3 // for ADC input range = 0.93V -#define MT9V034_VREF_1V4 4 // for ADC input range = 1.0V (default) -#define MT9V034_VREF_1V5 5 // for ADC input range = 1.07V -#define MT9V034_VREF_1V6 6 // for ADC input range = 1.14V -#define MT9V034_VREF_2V1 7 // for ADC input range = 1.5V - -#define MT9V034_ANALOG_GAIN_A 0x35 -#define MT9V034_ANALOG_GAIN_MIN 16 -#define MT9V034_ANALOG_GAIN_DEF 16 -#define MT9V034_ANALOG_GAIN_MAX 64 -#define MT9V034_ANALOG_GAIN_GLOBAL (1<<15) - -// @0x36 was MT9V034_MAX_ANALOG_GAIN ? -#define MT9V034_ANALOG_GAIN_B 0x36 - -// @0x39, 0x3A, 0x3B, 0x3C : misc. voltage controls for Context B - -#define MT9V034_FRAME_DARK_AVERAGE 0x42 - -#define MT9V034_DARK_AVG_THRESH 0x46 -#define MT9V034_DARK_AVG_LOW_THRESH_MASK (255 << 0) -#define MT9V034_DARK_AVG_LOW_THRESH_SHIFT 0 -#define MT9V034_DARK_AVG_HIGH_THRESH_MASK (255 << 8) -#define MT9V034_DARK_AVG_HIGH_THRESH_SHIFT 8 - -#define MT9V034_BLACK_LEVEL_CTRL 0x47 -#define MT9V034_BLACK_LEVEL_OVERRIDE (1 << 0) -#define MT9V034_BLACK_LEVEL_AUTO (0 << 0) -#define MT9V034_BLACK_LEVEL_AVG_FRAMES_MASK (7 << 5) -#define MT9V034_BLACK_LEVEL_AVG_FRAMES_SHIFT 5 - -#define MT9V034_BLACK_LEVEL_VALUE_A 0x48 - -#define MT9V034_ROW_NOISE_CORR_CONTROL 0x70 -#define MT9V034_ROW_NOISE_CORR_ENABLE_A (1 << 0) -#define MT9V034_ROW_NOISE_CORR_USE_BLK_AVG_A (1 << 1) -#define MT9V034_ROW_NOISE_CORR_ENABLE_B (1 << 8) // was 5 -#define MT9V034_ROW_NOISE_CORR_USE_BLK_AVG_B (1 << 9) // was 7 - -// @0x71: Row noise constant - -#define MT9V034_PIXEL_CLOCK 0x72 -#define MT9V034_PIXEL_CLOCK_INV_LINE (1 << 0) -#define MT9V034_PIXEL_CLOCK_INV_FRAME (1 << 1) -#define MT9V034_PIXEL_CLOCK_XOR_LINE (1 << 2) -#define MT9V034_PIXEL_CLOCK_CONT_LINE (1 << 3) -#define MT9V034_PIXEL_CLOCK_INV_PXL_CLK (1 << 4) - -#define MT9V034_HDR 0x0F -#define MT9V034_HDR_OFF (0x00) -#define MT9V034_HDR_ON (0x01) - -#define MT9V034_TEST_PATTERN 0x7f -#define MT9V034_TEST_PATTERN_DATA_MASK (1023 << 0) -#define MT9V034_TEST_PATTERN_DATA_SHIFT 0 -#define MT9V034_TEST_PATTERN_USE_DATA (1 << 10) -#define MT9V034_TEST_PATTERN_GREY_MASK (3 << 11) -#define MT9V034_TEST_PATTERN_GREY_NONE (0 << 11) -#define MT9V034_TEST_PATTERN_GREY_VERTICAL (1 << 11) -#define MT9V034_TEST_PATTERN_GREY_HORIZONTAL (2 << 11) -#define MT9V034_TEST_PATTERN_GREY_DIAGONAL (3 << 11) -#define MT9V034_TEST_PATTERN_ENABLE (1 << 13) -#define MT9V034_TEST_PATTERN_FLIP (1 << 14) - -// @0x80-0x98 -- Tiled digital gains -// 0x99-0xA4 - digtial tiles coordinates - -#define MT9V034_AEC_AGC_DESIRED_BIN 0xa5 -#define MT9V034_AEC_AGC_DESIRED_BIN_DEF 45 - -#define MT9V034_AEC_UPDATE_FREQUENCY 0xa6 - -#define MT9V034_AEC_LPF 0xa8 - -#define MT9V034_AGC_UPDATE_FREQUENCY 0xa9 - -#define MT9V034_AGC_LPF 0xaa - -// missing @0xAB, 0xAC, 0xAE -- analog gain and coarse shutter widths settings -#define MT9V034_AEC_MAX_SHUTTER_WIDTH 0xad - -#define MT9V034_AEC_AGC_ENABLE 0xaf -#define MT9V034_AEC_ENABLE_A (1 << 0) -#define MT9V034_AGC_ENABLE_A (1 << 1) -#define MT9V034_AEC_ENABLE_B (1 << 8) -#define MT9V034_AGC_ENABLE_B (1 << 9) - -// Missing @0xB0 (AGC/AEC pixel count), -// Missing 0xB1-0xB9 (LVDS & stereoscopy settings) -// Missing 0xBA, 0xBB, 0xBC -- AEC/AGC status info - -// #define MT9V034_AEC_MAX_SHUTTER_WIDTH 0xbd // does not exist ?! -// #define MT9V034_THERMAL_INFO 0xc1 // does not exist ?! - -// Missing regsiters @0x!BF, 0xC0-D9, 0xF0, 0xFE -#define MT9V034_HISTOGRAM_PIXCOUNT 0xB0 -#define MT9V034_HISTOGRAM_PIXCOUNT_DEF 44000 - - -#define MT9V034_AGC_OUTPUT 0xBA - -#define MT9V034_AEC_OUTPUT 0xBB - -#define MT9V034_AGC_AEC_CURRENT_BIN 0xBC - -#define MT9V034_MONITOR_NUM_FRAMES 0xC0 -#define MT9V034_MONITOR_DEFAULT_NUM 10 // default number of frames in register - -#define MT9V034_FINE_SHUTTER_WIDTH_A 0xd5 -#define MT9V034_FINE_SHUTTER_WIDTH_MIN 0 -#define MT9V034_FINE_SHUTTER_WIDTH_DEF 0 -#define MT9V034_FINE_SHUTTER_WIDTH_MAX 1774 - -#define MT9V034_MONITOR_MODE 0xd8 -#define MT9V034_MONITOR_EN (1<<0) -#define MT9V034_MONITOR_DIS (0<<0) - - -#endif // ndef __CIS_MT9V034_H - - diff --git a/rtos/pmsis/pmsis_bsp/camera/ov5640/ov5640.c b/rtos/pmsis/pmsis_bsp/camera/ov5640/ov5640.c deleted file mode 100755 index 22fdfe97..00000000 --- a/rtos/pmsis/pmsis_bsp/camera/ov5640/ov5640.c +++ /dev/null @@ -1,599 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Authors: Yao ZHANG, GreenWaves Technologies (yao.zhang@greenwaves-technologies.com) - */ - -#include "pmsis.h" -#include "pmsis/rtos/os_frontend_api/pmsis_time.h" -#include "bsp/bsp.h" -#include "bsp/camera/ov5640.h" -#include "ov5640.h" - -typedef struct { - uint16_t addr; - uint8_t value; -} i2c_req_t; - - -typedef struct { - struct pi_ov5640_conf conf; - struct pi_device cpi_device; - struct pi_device i2c_device; - - struct pi_device gpio_port; - - i2c_req_t i2c_req; - uint32_t i2c_read_value; - - int is_awake; -} ov5640_t; - - -typedef i2c_req_t ov5640_reg_init_t; - - -static ov5640_reg_init_t __ov5640_reg_init[] = -{ - {0x3008, 0x42}, // software power down, bit[6] - {0x3103, 0x03}, // system clock from PLL, bit[1] - {0x3017, 0xff}, // FREX, Vsync, HREF, PCLK, D[9:6] output enable - {0x3018, 0xff}, // D[5:0], GPIO[1:0] output enable - {0x3034, 0x18}, // MIPI 10-bit - {0x3035, 0x41}, //0x41, // PLL - {0x3036, 0x90}, // PLL - {0x3037, 0x03}, //0x13, // PLL root divider, bit[4], PLL pre-divider, bit[3:0] - {0x3108, 0x01}, // PCLK root divider, bit[5:4], SCLK2x root divider, bit[3:2], SCLK root divider, bit[1:0] - {0x3630, 0x36}, - {0x3631, 0x0e}, - {0x3632, 0xe2}, - {0x3633, 0x12}, - {0x3621, 0xe0}, - {0x3704, 0xa0}, - {0x3703, 0x5a}, - {0x3715, 0x78}, - {0x3717, 0x01}, - {0x370b, 0x60}, - {0x3705, 0x1a}, - {0x3905, 0x02}, - {0x3906, 0x10}, - {0x3901, 0x0a}, - {0x3731, 0x12}, - {0x3600, 0x08}, // VCM control - {0x3601, 0x33}, // VCM control - {0x302d, 0x60}, // system control - {0x3620, 0x52}, - {0x371b, 0x20}, - {0x471c, 0x50}, - {0x3a13, 0x43}, // pre-gain = 1.047x - {0x3a18, 0x00}, // gain ceiling - {0x3a19, 0xf8}, // gain ceiling = 15.5x - {0x3635, 0x13}, - {0x3636, 0x03}, - {0x3634, 0x40}, - {0x3622, 0x01}, - {0x3c01, 0x34}, // Band auto, bit[7] - {0x3c04, 0x28}, // threshold low sum - {0x3c05, 0x98}, // threshold high sum - {0x3c06, 0x00}, // light meter 1 threshold[15:8] - {0x3c07, 0x07}, // light meter 1 threshold[7:0] - {0x3c08, 0x00}, // light meter 2 threshold[15:8] - {0x3c09, 0x1c}, // light meter 2 threshold[7:0] - {0x3c0a, 0x9c}, // sample number[15:8] - {0x3c0b, 0x40}, // sample number[7:0] - {0x3810, 0x00}, // Timing Hoffset[11:8] - {0x3811, 0x10}, // Timing Hoffset[7:0] - {0x3812, 0x00}, // Timing Voffset[10:8] - {0x3708, 0x64}, - {0x4001, 0x02}, // BLC start from line 2 - {0x4005, 0x1a}, // BLC always update - {0x3000, 0x00}, // enable blocks - {0x3004, 0xff}, // enable clocks - {0x300e, 0x58}, // MIPI power down, DVP enable - {0x302e, 0x00}, - //{0x4300, 0x23}, // rgb888 - {0x4300, 0x61}, // rgb565 - {0x501F, 0x01}, - {0x3820, 0x40}, // flip - {0x3821, 0x01}, // mirror - {0x3814, 0x71}, // timing X inc - {0x3815, 0x35}, // timing Y inc - {0x3800, 0x00}, // HS - {0x3801, 0x00}, // HS - {0x3802, 0x00}, // VS - {0x3803, 0x00}, // VS - {0x3804, 0x0a}, // HW (HE) - {0x3805, 0x3f}, // HW (HE) - {0x3806, 0x07}, // VH (VE) - {0x3807, 0x9f}, // VH (VE) - {0x3808, (320 >> 8)}, // DVPHO - {0x3809, (320 & 0xff)}, // DVPHO - {0x380a, (260 >> 8)}, // DVPVO - {0x380b, (260 & 0xff)}, // DVPVO - {0x380c, 0x07}, // HTS - {0x380d, 0x58}, // HTS - {0x380e, 0x01}, // VTS - {0x380f, 0xf0}, // VTS - {0x3810, 0x00}, // HTS - {0x3811, 0x08}, // HTS - {0x3812, 0x00}, // VTS - {0x3813, 0x02}, // VTS - {0x3618, 0x00}, - {0x3612, 0x29}, - {0x3709, 0x52}, - {0x370c, 0x03}, - {0x3a02, 0x02}, // 60Hz max exposure - {0x3a03, 0xe0}, // 60Hz max exposure - {0x3a14, 0x02}, // 50Hz max exposure - {0x3a15, 0xe0}, // 50Hz max exposure - {0x4004, 0x02}, // BLC line number - {0x3002, 0x1c}, // reset JFIFO, SFIFO, JPG - {0x3006, 0xc3}, // disable clock of JPEG2x, JPEG - {0x4713, 0x03}, // JPEG mode 3 - {0x4407, 0x04}, // Quantization scale - {0x460b, 0x37}, - {0x460c, 0x20}, - {0x4837, 0x16}, // MIPI global timing - {0x3824, 0x04}, // PCLK manual divider - {0x5001, 0xA3}, // SDE on, scale on, UV average off, color matrix on, AWB on - {0x3503, 0x00}, // AEC/AGC on - {0x440e, 0x00}, - {0x5000, 0xa7}, // Lenc on, raw gamma on, BPC on, WPC on, CIP on - {0x3a0f, 0x30}, // stable range in high - {0x3a10, 0x28}, // stable range in low - {0x3a1b, 0x30}, // stable range out high - {0x3a1e, 0x26}, // stable range out low - {0x3a11, 0x60}, // fast zone high - {0x3a1f, 0x14}, // fast zone low - {0x5800, 0x23}, - {0x5801, 0x14}, - {0x5802, 0x0f}, - {0x5803, 0x0f}, - {0x5804, 0x12}, - {0x5805, 0x26}, - {0x5806, 0x0c}, - {0x5807, 0x08}, - {0x5808, 0x05}, - {0x5809, 0x05}, - {0x580a, 0x08}, - {0x580b, 0x0d}, - {0x580c, 0x08}, - {0x580d, 0x03}, - {0x580e, 0x00}, - {0x580f, 0x00}, - {0x5810, 0x03}, - {0x5811, 0x09}, - {0x5812, 0x07}, - {0x5813, 0x03}, - {0x5814, 0x00}, - {0x5815, 0x01}, - {0x5816, 0x03}, - {0x5817, 0x08}, - {0x5818, 0x0d}, - {0x5819, 0x08}, - {0x581a, 0x05}, - {0x581b, 0x06}, - {0x581c, 0x08}, - {0x581d, 0x0e}, - {0x581e, 0x29}, - {0x581f, 0x17}, - {0x5820, 0x11}, - {0x5821, 0x11}, - {0x5822, 0x15}, - {0x5823, 0x28}, - {0x5824, 0x46}, - {0x5825, 0x26}, - {0x5826, 0x08}, - {0x5827, 0x26}, - {0x5828, 0x64}, - {0x5829, 0x26}, - {0x582a, 0x24}, - {0x582b, 0x22}, - {0x582c, 0x24}, - {0x582d, 0x24}, - {0x582e, 0x06}, - {0x582f, 0x22}, - {0x5830, 0x40}, - {0x5831, 0x42}, - {0x5832, 0x24}, - {0x5833, 0x26}, - {0x5834, 0x24}, - {0x5835, 0x22}, - {0x5836, 0x22}, - {0x5837, 0x26}, - {0x5838, 0x44}, - {0x5839, 0x24}, - {0x583a, 0x26}, - {0x583b, 0x28}, - {0x583c, 0x42}, - {0x583d, 0xce}, // lenc BR offset - {0x5180, 0xff}, // AWB B block - {0x5181, 0xf2}, // AWB control - {0x5182, 0x00}, // [7:4] max local counter, [3:0] max fast counter - {0x5183, 0x14}, // AWB advanced - {0x5184, 0x25}, - {0x5185, 0x24}, - {0x5186, 0x09}, - {0x5187, 0x09}, - {0x5188, 0x09}, - {0x5189, 0x75}, - {0x518a, 0x54}, - {0x518b, 0xe0}, - {0x518c, 0xb2}, - {0x518d, 0x42}, - {0x518e, 0x3d}, - {0x518f, 0x56}, - {0x5190, 0x46}, - {0x5191, 0xf8}, // AWB top limit - {0x5192, 0x04}, // AWB bottom limit - {0x5193, 0x70}, // red limit - {0x5194, 0xf0}, // green limit - {0x5195, 0xf0}, // blue limit - {0x5196, 0x03}, // AWB control - {0x5197, 0x01}, // local limit - {0x5198, 0x04}, - {0x5199, 0x12}, - {0x519a, 0x04}, - {0x519b, 0x00}, - {0x519c, 0x06}, - {0x519d, 0x82}, - {0x519e, 0x38}, // AWB control - {0x5480, 0x01}, // Gamma bias plus on, bit[0] - {0x5481, 0x08}, - {0x5482, 0x14}, - {0x5483, 0x28}, - {0x5484, 0x51}, - {0x5485, 0x65}, - {0x5486, 0x71}, - {0x5487, 0x7d}, - {0x5488, 0x87}, - {0x5489, 0x91}, - {0x548a, 0x9a}, - {0x548b, 0xaa}, - {0x548c, 0xb8}, - {0x548d, 0xcd}, - {0x548e, 0xdd}, - {0x548f, 0xea}, - {0x5490, 0x1d}, - {0x5381, 0x1e}, // CMX1 for Y - {0x5382, 0x5b}, // CMX2 for Y - {0x5383, 0x08}, // CMX3 for Y - {0x5384, 0x0a}, // CMX4 for U - {0x5385, 0x7e}, // CMX5 for U - {0x5386, 0x88}, // CMX6 for U - {0x5387, 0x7c}, // CMX7 for V - {0x5388, 0x6c}, // CMX8 for V - {0x5389, 0x10}, // CMX9 for V - {0x538a, 0x01}, // sign[9] - {0x538b, 0x98}, // sign[8:1] - {0x5580, 0x06}, // saturation on, bit[1] - {0x5583, 0x40}, - {0x5584, 0x10}, - {0x5589, 0x10}, - {0x558a, 0x00}, - {0x558b, 0xf8}, - {0x501d, 0x40}, // enable manual offset of contrast - {0x5300, 0x08}, // CIP sharpen MT threshold 1 - {0x5301, 0x30}, // CIP sharpen MT threshold 2 - {0x5302, 0x10}, // CIP sharpen MT offset 1 - {0x5303, 0x00}, // CIP sharpen MT offset 2 - {0x5304, 0x08}, // CIP DNS threshold 1 - {0x5305, 0x30}, // CIP DNS threshold 2 - {0x5306, 0x08}, // CIP DNS offset 1 - {0x5307, 0x16}, // CIP DNS offset 2 - {0x5309, 0x08}, // CIP sharpen TH threshold 1 - {0x530a, 0x30}, // CIP sharpen TH threshold 2 - {0x530b, 0x04}, // CIP sharpen TH offset 1 - {0x530c, 0x06}, // CIP sharpen TH offset 2 - {0x5025, 0x00}, - {0x3008, 0x02}, // wake up from standby, bit[6] - {0x4740, 0x21}, //VSYNC active HIGH - -}; - -static inline int is_i2c_active() -{ -#if defined(ARCHI_PLATFORM_RTL) - - // I2C driver is not yet working on some chips, at least this works on gvsoc. - // Also there is noI2C connection to camera model on RTL -#if PULP_CHIP == CHIP_GAP9 || PULP_CHIP == CHIP_VEGA || PULP_CHIP == CHIP_ARNOLD || PULP_CHIP == CHIP_PULPISSIMO || PULP_CHIP == CHIP_PULPISSIMO_V1 - return 0; -#else - return rt_platform() != ARCHI_PLATFORM_RTL; -#endif - -#else - - return 1; - -#endif -} - - - -static void __ov5640_reg_write(ov5640_t *ov5640, uint16_t addr, uint8_t value) -{ - if (is_i2c_active()) - { - ov5640->i2c_req.value = value; - ov5640->i2c_req.addr = ((addr >> 8) & 0xff) | ((addr & 0xff) << 8); - pi_i2c_write(&ov5640->i2c_device, (uint8_t *)&ov5640->i2c_req, 3, PI_I2C_XFER_STOP); - } -} - - - -static uint8_t __ov5640_reg_read(ov5640_t *ov5640, uint16_t addr) -{ - if (is_i2c_active()) - { - ov5640->i2c_req.addr = ((addr >> 8) & 0xff) | ((addr & 0xff) << 8); - pi_i2c_write(&ov5640->i2c_device, (uint8_t *)&ov5640->i2c_req.addr, 2, PI_I2C_XFER_STOP); - pi_i2c_read(&ov5640->i2c_device, (uint8_t *)&ov5640->i2c_read_value, 1, PI_I2C_XFER_STOP); - return *(volatile uint8_t *)&ov5640->i2c_read_value; - } - else - { - return 0; - } -} - - -static void __ov5640_init_regs(ov5640_t *ov5640) -{ - int32_t i; - for(i=0; i<(int32_t)(sizeof(__ov5640_reg_init)/sizeof(ov5640_reg_init_t)); i++) - { - __ov5640_reg_write(ov5640, __ov5640_reg_init[i].addr, __ov5640_reg_init[i].value); - } -#ifdef DEBUG - uint8_t reg_value = 0; - for(i=0; i<(sizeof(__ov5640_reg_init)/sizeof(ov5640_reg_init_t)); i++) - { - reg_value = __ov5640_reg_read(ov5640, __ov5640_reg_init[i].addr); - if (reg_value != __ov5640_reg_init[i].value) - printf("error reg: @%X = %X (expected: %X)\n", __ov5640_reg_init[i].addr, reg_value, __ov5640_reg_init[i].value); - } -#endif -} - - - -static void __ov5640_reset(ov5640_t *ov5640) -{ - __ov5640_reg_write(ov5640, 0x3103, 0x11); - //HW reset: pull the RESETB pin to 0 - // SW reset - __ov5640_reg_write(ov5640, 0x3008, 0x82); - // Datasheet: Wait 1ms after reset - pi_time_wait_us(10000); -#ifdef CUSTOM_BSP - pi_gpio_pin_write(&ov5640->gpio_port, ov5640->conf.reset_gpio, 1); -#endif -} - - -static void __ov5640_mode(ov5640_t *ov5640, uint8_t mode) -{ - uint8_t value=0; - value = __ov5640_reg_read(ov5640, 0x3008); - if (mode == OV5640_STREAMING) - value = 0x02; - else if (mode == OV5640_STANDBY) - value |= 0x42; // SW PWDN - - __ov5640_reg_write(ov5640, 0x3008, value); -} - - - -static void __ov5640_wakeup(ov5640_t *ov5640) -{ - if (!ov5640->is_awake) - { -#ifdef CUSTOM_BSP - pi_gpio_pin_write(&ov5640->gpio_port, ov5640->conf.pwdn_gpio, 0); - pi_time_wait_us(10000); - pi_gpio_pin_write(&ov5640->gpio_port, ov5640->conf.reset_gpio, 1); - pi_time_wait_us(10000); -#endif - - __ov5640_mode(ov5640, OV5640_STREAMING); - ov5640->is_awake = 1; - } -} - - - -static void __ov5640_standby(ov5640_t *ov5640) -{ - if (ov5640->is_awake) - { - __ov5640_mode(ov5640, OV5640_STANDBY); - -#ifdef CUSTOM_BSP - pi_gpio_pin_write(&ov5640->gpio_port, ov5640->conf.pwdn_gpio, 1); -#endif - - ov5640->is_awake = 0; - } -} - - - -int32_t __ov5640_open(struct pi_device *device) -{ - struct pi_ov5640_conf *conf = (struct pi_ov5640_conf *)device->config; - - ov5640_t *ov5640 = (ov5640_t *)pmsis_l2_malloc(sizeof(ov5640_t)); - if (ov5640 == NULL) return -1; - - device->data = (void *)ov5640; - - if (bsp_ov5640_open(conf)) - goto error; - -#ifdef CUSTOM_BSP - struct pi_gpio_conf gpio_conf; - pi_gpio_conf_init(&gpio_conf); - pi_open_from_conf(&ov5640->gpio_port, &gpio_conf); - if (pi_gpio_open(&ov5640->gpio_port)) - goto error; - - pi_gpio_pin_configure(&ov5640->gpio_port, conf->reset_gpio, PI_GPIO_OUTPUT); - pi_gpio_pin_configure(&ov5640->gpio_port, conf->pwdn_gpio, PI_GPIO_OUTPUT); - - pi_gpio_pin_write(&ov5640->gpio_port, conf->pwdn_gpio, 0); - pi_time_wait_us(1000); - pi_gpio_pin_write(&ov5640->gpio_port, ov5640->conf.reset_gpio, 0); - pi_time_wait_us(20000); -#endif - - struct pi_cpi_conf cpi_conf; - pi_cpi_conf_init(&cpi_conf); - cpi_conf.itf = conf->cpi_itf; - pi_open_from_conf(&ov5640->cpi_device, &cpi_conf); - - if (pi_cpi_open(&ov5640->cpi_device)) - goto error; - - struct pi_i2c_conf i2c_conf; - pi_i2c_conf_init(&i2c_conf); - i2c_conf.cs = 0x78; - i2c_conf.itf = conf->i2c_itf; - i2c_conf.max_baudrate = 400000; - pi_open_from_conf(&ov5640->i2c_device, &i2c_conf); - - if (pi_i2c_open(&ov5640->i2c_device)) - goto error2; - - pi_cpi_set_format(&ov5640->cpi_device, PI_CPI_FORMAT_BYPASS_LITEND); - - uint8_t cam_id[2]; - cam_id[0] = __ov5640_reg_read(ov5640, 0x300A); - cam_id[1] = __ov5640_reg_read(ov5640, 0x300B); - - if(cam_id[0] != 0x56 || cam_id[1] != 0x40) - { - printf("camera open failed: cam_id 0x%X%X is wrong\n", cam_id[1], cam_id[0] ); - goto error2; - } - - __ov5640_reset(ov5640); - __ov5640_init_regs(ov5640); - - return 0; - -error2: - pi_cpi_close(&ov5640->cpi_device); -error: - pmsis_l2_malloc_free(ov5640, sizeof(ov5640_t)); - return -1; -} - - - -static void __ov5640_close(struct pi_device *device) -{ - ov5640_t *ov5640 = (ov5640_t *)device->data; - __ov5640_standby(ov5640); - pi_cpi_close(&ov5640->cpi_device); - pmsis_l2_malloc_free(ov5640, sizeof(ov5640_t)); -} - - - -static int32_t __ov5640_control(struct pi_device *device, pi_camera_cmd_e cmd, void *arg) -{ - int irq = disable_irq(); - - ov5640_t *ov5640 = (ov5640_t *)device->data; - - switch (cmd) - { - case PI_CAMERA_CMD_ON: - __ov5640_wakeup(ov5640); - break; - - case PI_CAMERA_CMD_OFF: - __ov5640_standby(ov5640); - break; - - case PI_CAMERA_CMD_START: - pi_cpi_control_start(&ov5640->cpi_device); - break; - - case PI_CAMERA_CMD_STOP: - pi_cpi_control_stop(&ov5640->cpi_device); - break; - - default: - break; - } - - restore_irq(irq); - - return 0; -} - -void __ov5640_capture_async(struct pi_device *device, void *buffer, uint32_t bufferlen, pi_task_t *task) -{ - ov5640_t *ov5640 = (ov5640_t *)device->data; - - pi_cpi_capture_async(&ov5640->cpi_device, buffer, bufferlen, task); -} - - - -int32_t __ov5640_reg_set(struct pi_device *device, uint32_t addr, uint8_t *value) -{ - ov5640_t *ov5640 = (ov5640_t *)device->data; - __ov5640_reg_write(ov5640, addr, *value); - return 0; -} - - - -int32_t __ov5640_reg_get(struct pi_device *device, uint32_t addr, uint8_t *value) -{ - ov5640_t *ov5640 = (ov5640_t *)device->data; - *value = __ov5640_reg_read(ov5640, addr); - return 0; -} - - - -static pi_camera_api_t ov5640_api = -{ - .open = &__ov5640_open, - .close = &__ov5640_close, - .control = &__ov5640_control, - .capture_async = &__ov5640_capture_async, - .reg_set = &__ov5640_reg_set, - .reg_get = &__ov5640_reg_get -}; - - - -void pi_ov5640_conf_init(struct pi_ov5640_conf *conf) -{ - conf->camera.api = &ov5640_api; - conf->skip_pads_config = 0; - bsp_ov5640_conf_init(conf); - __camera_conf_init(&conf->camera); -} diff --git a/rtos/pmsis/pmsis_bsp/camera/ov5640/ov5640.h b/rtos/pmsis/pmsis_bsp/camera/ov5640/ov5640.h deleted file mode 100755 index d1fd052d..00000000 --- a/rtos/pmsis/pmsis_bsp/camera/ov5640/ov5640.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __CAM_OV5640_H__ -#define __CAM_OV5640_H__ - - -/* - * Address of Camera Registers - */ - -enum { - OV5640_STANDBY = 0x0, - OV5640_STREAMING = 0x1, // I2C triggered streaming enable -}; - - -#endif diff --git a/rtos/pmsis/pmsis_bsp/camera/ov7670/ov7670.c b/rtos/pmsis/pmsis_bsp/camera/ov7670/ov7670.c deleted file mode 100755 index 0f05e813..00000000 --- a/rtos/pmsis/pmsis_bsp/camera/ov7670/ov7670.c +++ /dev/null @@ -1,415 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Authors: Yao ZHANG, GreenWaves Technologies (yao.zhang@greenwaves-technologies.com) - * Francesco PACI, GreenWaves Technologies (francesco.paci@greenwaves-technologies.com) - Germain Haugou, GreenWaves Technologies (germain.haugou@greenwaves-technologies.com) - */ - -#include "pmsis.h" -#include "pmsis/rtos/os_frontend_api/pmsis_time.h" -#include "bsp/bsp.h" -#include "bsp/camera/ov7670.h" -#include "ov7670.h" - -typedef struct { - uint8_t addr; - uint8_t value; -} i2c_req_t; - - -typedef struct { - struct pi_device cpi_device; - struct pi_device i2c_device; - - struct pi_device ov7670_reset; - struct pi_device ov7670_pwdn; - - i2c_req_t i2c_req; - uint32_t i2c_read_value; - - int is_awake; -} ov7670_t; - - -typedef i2c_req_t ov7670_reg_init_t; - -typedef struct { - ov7670_t *ov7670; - pi_task_t *task; - void *buffer; - uint32_t bufferlen; -} ov7670_callbak; - - - - - - -static ov7670_reg_init_t __ov7670_reg_init[] = -{ - { REG_COM7, COM7_RESET }, -/* - * Clock scale: 3 = 15fps - * 2 = 20fps - * 1 = 30fps - */ - { REG_CLKRC, 0x1 }, /* OV: clock scale (30 fps) */ - { REG_TSLB, 0x04 }, /* OV */ - { REG_COM7, 0 }, /* VGA */ - /* - * Set the hardware window. These values from OV don't entirely - * make sense - hstop is less than hstart. But they work... - */ - { REG_HSTART, 0x13 }, { REG_HSTOP, 0x01 }, - { REG_HREF, 0xb6 }, { REG_VSTART, 0x02 }, - { REG_VSTOP, 0x7a }, { REG_VREF, 0x0a }, - { REG_COM3, 0 }, { REG_COM14, 0 }, - /* Mystery scaling numbers */ - { 0x70, 0x3a }, { 0x71, 0x35 }, - { 0x72, 0x11 }, { 0x73, 0xf0 }, - { 0xa2, 0x02 }, { REG_COM10, 0x0 }, - /* Gamma curve values */ - { 0x7a, 0x20 }, { 0x7b, 0x10 }, - { 0x7c, 0x1e }, { 0x7d, 0x35 }, - { 0x7e, 0x5a }, { 0x7f, 0x69 }, - { 0x80, 0x76 }, { 0x81, 0x80 }, - { 0x82, 0x88 }, { 0x83, 0x8f }, - { 0x84, 0x96 }, { 0x85, 0xa3 }, - { 0x86, 0xaf }, { 0x87, 0xc4 }, - { 0x88, 0xd7 }, { 0x89, 0xe8 }, - /* AGC and AEC parameters. Note we start by disabling those features, - then turn them only after tweaking the values. */ - { REG_COM8, COM8_FASTAEC | COM8_AECSTEP | COM8_BFILT }, - { REG_GAIN, 0 }, { REG_AECH, 0 }, - { REG_COM4, 0x40 }, /* magic reserved bit */ - { REG_COM9, 0x18 }, /* 4x gain + magic rsvd bit */ - { REG_BD50MAX, 0x05 }, { REG_BD60MAX, 0x07 }, - { REG_AEW, 0x95 }, { REG_AEB, 0x33 }, - { REG_VPT, 0xe3 }, { REG_HAECC1, 0x78 }, - { REG_HAECC2, 0x68 }, { 0xa1, 0x03 }, /* magic */ - { REG_HAECC3, 0xd8 }, { REG_HAECC4, 0xd8 }, - { REG_HAECC5, 0xf0 }, { REG_HAECC6, 0x90 }, - { REG_HAECC7, 0x94 }, - { REG_COM8, COM8_FASTAEC|COM8_AECSTEP|COM8_BFILT|COM8_AGC|COM8_AEC }, - /* Almost all of these are magic "reserved" values. */ - { REG_COM5, 0x61 }, { REG_COM6, 0x4b }, - { 0x16, 0x02 }, { REG_MVFP, 0x07 }, - { 0x21, 0x02 }, { 0x22, 0x91 }, - { 0x29, 0x07 }, { 0x33, 0x0b }, - { 0x35, 0x0b }, { 0x37, 0x1d }, - { 0x38, 0x71 }, { 0x39, 0x2a }, - { REG_COM12, 0x78 }, { 0x4d, 0x40 }, - { 0x4e, 0x20 }, { REG_GFIX, 0 }, - { 0x6b, 0x4a }, { 0x74, 0x10 }, - { 0x8d, 0x4f }, { 0x8e, 0 }, - { 0x8f, 0 }, { 0x90, 0 }, - { 0x91, 0 }, { 0x96, 0 }, - { 0x9a, 0 }, { 0xb0, 0x84 }, - { 0xb1, 0x0c }, { 0xb2, 0x0e }, - { 0xb3, 0x82 }, { 0xb8, 0x0a }, - /* More reserved magic, some of which tweaks white balance */ - { 0x43, 0x0a }, { 0x44, 0xf0 }, - { 0x45, 0x34 }, { 0x46, 0x58 }, - { 0x47, 0x28 }, { 0x48, 0x3a }, - { 0x59, 0x88 }, { 0x5a, 0x88 }, - { 0x5b, 0x44 }, { 0x5c, 0x67 }, - { 0x5d, 0x49 }, { 0x5e, 0x0e }, - { 0x6c, 0x0a }, { 0x6d, 0x55 }, - { 0x6e, 0x11 }, { 0x6f, 0x9f }, /* "9e for advance AWB" */ - { 0x6a, 0x40 }, { REG_BLUE, 0x40 }, - { REG_RED, 0x60 }, - { REG_COM8, COM8_FASTAEC|COM8_AECSTEP|COM8_BFILT|COM8_AGC|COM8_AEC|COM8_AWB }, - /* Matrix coefficients */ - { 0x4f, 0x80 }, { 0x50, 0x80 }, - { 0x51, 0 }, { 0x52, 0x22 }, - { 0x53, 0x5e }, { 0x54, 0x80 }, - { 0x58, 0x9e }, - { REG_COM16, COM16_AWBGAIN }, { REG_EDGE, 0 }, - { 0x75, 0x05 }, { 0x76, 0xe1 }, - { 0x4c, 0 }, { 0x77, 0x01 }, - { REG_COM13, 0xc3 }, { 0x4b, 0x09 }, - { 0xc9, 0x60 }, { REG_COM16, 0x38 }, - { 0x56, 0x40 }, - { 0x34, 0x11 }, { REG_COM11, COM11_EXP|COM11_HZAUTO }, - { 0xa4, 0x88 }, { 0x96, 0 }, - { 0x97, 0x30 }, { 0x98, 0x20 }, - { 0x99, 0x30 }, { 0x9a, 0x84 }, - { 0x9b, 0x29 }, { 0x9c, 0x03 }, - { 0x9d, 0x4c }, { 0x9e, 0x3f }, - { 0x78, 0x04 }, - /* Extra-weird stuff. Some sort of multiplexor register */ - { 0x79, 0x01 }, { 0xc8, 0xf0 }, - { 0x79, 0x0f }, { 0xc8, 0x00 }, - { 0x79, 0x10 }, { 0xc8, 0x7e }, - { 0x79, 0x0a }, { 0xc8, 0x80 }, - { 0x79, 0x0b }, { 0xc8, 0x01 }, - { 0x79, 0x0c }, { 0xc8, 0x0f }, - { 0x79, 0x0d }, { 0xc8, 0x20 }, - { 0x79, 0x09 }, { 0xc8, 0x80 }, - { 0x79, 0x02 }, { 0xc8, 0xc0 }, - { 0x79, 0x03 }, { 0xc8, 0x40 }, - { 0x79, 0x05 }, { 0xc8, 0x30 }, - { 0x79, 0x26 }, - { 0xff, 0xff }, /* END MARKER */ -}; - -static inline int is_i2c_active() -{ -#if defined(ARCHI_PLATFORM_RTL) - - // I2C driver is not yet working on some chips, at least this works on gvsoc. - // Also there is noI2C connection to camera model on RTL -#if PULP_CHIP == CHIP_GAP9 || PULP_CHIP == CHIP_VEGA || PULP_CHIP == CHIP_ARNOLD || PULP_CHIP == CHIP_PULPISSIMO || PULP_CHIP == CHIP_PULPISSIMO_V1 - return 0; -#else - return rt_platform() != ARCHI_PLATFORM_RTL; -#endif - -#else - - return 1; - -#endif -} - - - -static void __ov7670_reg_write(ov7670_t *ov7670, uint8_t addr, uint8_t value) -{ - if (is_i2c_active()) - { - ov7670->i2c_req.value = value; - ov7670->i2c_req.addr = (uint8_t)addr; - pi_i2c_write(&ov7670->i2c_device, (uint8_t *)&ov7670->i2c_req, 2, PI_I2C_XFER_STOP); - } -} - - - -static uint8_t __ov7670_reg_read(ov7670_t *ov7670, uint8_t addr) -{ - if (is_i2c_active()) - { - ov7670->i2c_req.addr = (addr & 0xFF); - pi_i2c_write(&ov7670->i2c_device, (uint8_t *)&ov7670->i2c_req, 1, PI_I2C_XFER_STOP); - pi_i2c_read(&ov7670->i2c_device, (uint8_t *)&ov7670->i2c_read_value, 1, PI_I2C_XFER_STOP); - return *(volatile uint8_t *)&ov7670->i2c_read_value; - } - else - { - return 0; - } -} - - - -static void __ov7670_init_regs(ov7670_t *ov7670) -{ - int32_t i; - for(i=0; i<(int32_t)(sizeof(__ov7670_reg_init)/sizeof(ov7670_reg_init_t)); i++) - { - __ov7670_reg_write(ov7670, __ov7670_reg_init[i].addr, __ov7670_reg_init[i].value); - } -} - - - -static void __ov7670_reset(ov7670_t *ov7670) -{ - __ov7670_reg_write(ov7670, REG_COM7, COM7_RESET); - pi_time_wait_us(1000); -} - - -static void __ov7670_mode(ov7670_t *ov7670, uint8_t mode) -{ - uint8_t value=0; - value = __ov7670_reg_read(ov7670, REG_COM2); - if (mode == OV7670_STREAMING) - value &= (~COM2_SSLEEP&0xFF); - else if (mode == OV7670_STANDBY) - value |= (COM2_SSLEEP&0xFF); - - __ov7670_reg_write(ov7670, REG_COM2, value); -} - - - -static void __ov7670_wakeup(ov7670_t *ov7670) -{ - if (!ov7670->is_awake) - { - __ov7670_mode(ov7670, OV7670_STREAMING); - ov7670->is_awake = 1; - } -} - - - -static void __ov7670_standby(ov7670_t *ov7670) -{ - if (ov7670->is_awake) - { - __ov7670_mode(ov7670, OV7670_STANDBY); - ov7670->is_awake = 0; - } -} - - - -int32_t __ov7670_open(struct pi_device *device) -{ - struct pi_ov7670_conf *conf = (struct pi_ov7670_conf *)device->config; - - ov7670_t *ov7670 = (ov7670_t *)pmsis_l2_malloc(sizeof(ov7670_t)); - if (ov7670 == NULL) return -1; - - device->data = (void *)ov7670; - - if (bsp_ov7670_open(conf)) - goto error; - - struct pi_cpi_conf cpi_conf; - pi_cpi_conf_init(&cpi_conf); - cpi_conf.itf = conf->cpi_itf; - pi_open_from_conf(&ov7670->cpi_device, &cpi_conf); - - if (pi_cpi_open(&ov7670->cpi_device)) - goto error; - - struct pi_i2c_conf i2c_conf; - pi_i2c_conf_init(&i2c_conf); - i2c_conf.cs = 0x42; - i2c_conf.itf = conf->i2c_itf; - i2c_conf.max_baudrate = 200000; - pi_open_from_conf(&ov7670->i2c_device, &i2c_conf); - - if (pi_i2c_open(&ov7670->i2c_device)) - goto error2; - - - // Workaround for FreeRTOS, TODO to be fixed -#if defined(__FREERTOS__) - pi_cpi_set_format(&ov7670->cpi_device, PI_CPI_FORMAT_BYPASS_LITEND); -#else - pi_cpi_set_format(&ov7670->cpi_device, PI_CPI_FORMAT_BYPASS_BIGEND); -#endif - - __ov7670_reset(ov7670); - __ov7670_init_regs(ov7670); - - return 0; - -error2: - pi_cpi_close(&ov7670->cpi_device); -error: - pmsis_l2_malloc_free(ov7670, sizeof(ov7670_t)); - return -1; -} - - - -static void __ov7670_close(struct pi_device *device) -{ - ov7670_t *ov7670 = (ov7670_t *)device->data; - __ov7670_standby(ov7670); - pi_cpi_close(&ov7670->cpi_device); - pmsis_l2_malloc_free(ov7670, sizeof(ov7670_t)); -} - - - -static int32_t __ov7670_control(struct pi_device *device, pi_camera_cmd_e cmd, void *arg) -{ - int irq = disable_irq(); - - ov7670_t *ov7670 = (ov7670_t *)device->data; - - switch (cmd) - { - case PI_CAMERA_CMD_ON: - __ov7670_wakeup(ov7670); - break; - - case PI_CAMERA_CMD_OFF: - __ov7670_standby(ov7670); - break; - - case PI_CAMERA_CMD_START: - pi_cpi_control_start(&ov7670->cpi_device); - break; - - case PI_CAMERA_CMD_STOP: - pi_cpi_control_stop(&ov7670->cpi_device); - break; - - default: - break; - } - - restore_irq(irq); - - return 0; -} - -void __ov7670_capture_async(struct pi_device *device, void *buffer, uint32_t bufferlen, pi_task_t *task) -{ - ov7670_t *ov7670 = (ov7670_t *)device->data; - - pi_cpi_capture_async(&ov7670->cpi_device, buffer, bufferlen, task); -} - - - -int32_t __ov7670_reg_set(struct pi_device *device, uint32_t addr, uint8_t *value) -{ - ov7670_t *ov7670 = (ov7670_t *)device->data; - __ov7670_reg_write(ov7670, addr, *value); - return 0; -} - - - -int32_t __ov7670_reg_get(struct pi_device *device, uint32_t addr, uint8_t *value) -{ - ov7670_t *ov7670 = (ov7670_t *)device->data; - *value = __ov7670_reg_read(ov7670, addr); - return 0; -} - - - -static pi_camera_api_t ov7670_api = -{ - .open = &__ov7670_open, - .close = &__ov7670_close, - .control = &__ov7670_control, - .capture_async = &__ov7670_capture_async, - .reg_set = &__ov7670_reg_set, - .reg_get = &__ov7670_reg_get -}; - - - -void pi_ov7670_conf_init(struct pi_ov7670_conf *conf) -{ - conf->camera.api = &ov7670_api; - conf->skip_pads_config = 0; - bsp_ov7670_conf_init(conf); - __camera_conf_init(&conf->camera); -} diff --git a/rtos/pmsis/pmsis_bsp/camera/ov7670/ov7670.h b/rtos/pmsis/pmsis_bsp/camera/ov7670/ov7670.h deleted file mode 100755 index 363bf341..00000000 --- a/rtos/pmsis/pmsis_bsp/camera/ov7670/ov7670.h +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __CAM_OV7670_H__ -#define __CAM_OV7670_H__ - - -/* - * Address of Camera Registers - */ -// Registers for changing the FPS -// as default: fps = 30 fps: F(internal clock) = 24MHz/(0+1) -#define CAM_REG_CLKRC 0x11 // default: 0x80 -#define CAM_REG_DBLV 0x6B // default: 0x3A - -// Registers for configuring the format (Resolution, Image): -// as default: resolution = VGA -// Image_format = YUV -#define CAM_REG_COM3 0x0C // default: 0x00 -#define CAM_REG_COM7 0x12 // default: 0x00 -#define CAM_REG_COM14 0x3E // default: 0x0E -#define CAM_REG_COM15 0x40 // default: 0xC0 - -/* - * Options of Camera - */ -#define CAM_RESET 0x80 //COM7[7]: Resets all registers to default values, when 1. - -// Options for changing the FPS by modifing the PCLK -#define Prescaler_Enable 0x00 //CLKRC[6]: apply prescaler on input clock. If this bit = 1: Use external clock directly (no clock pre-scale available) -#define Clock_Prescaler_MAX 0x1F //CLKRC[5:0]: Internal clock prescalar: F(internal clock) = F(input clock)/(Bit[5:0]+1). Enabling prescaler by 32. -#define Clock_Prescaler_MIN 0x01 //Enabling prescaler by 2 -#define Bypass_PLL 0x30 //DBLV[7:6]: PLL control -#define PLL_x4 0x70 -#define PLL_x6 0xB0 -#define PLL_x8 0xF0 - -#define Scaling_Enable 0x08 //COM3[3] -#define Manual_scaling 0x04 //COM14[3]: For Enabling the manual scaling, this bit should be setted as 1 (Manual scaling enable) - -#define VGA_Format 0x00 //Mode default: the following formats are the predefined resolutions -#define CIF_Format 0x20 //COM7[5] -#define QVGA_Format 0x10 //COM7[4] -#define QCIF_Format 0x08 //COM7[3] -#define YUV_Image_Format 0x00 //COM7[2]|COM7[0]: the COM7[1] is a bit for enabling(1)/disabling(0) the color bar -#define RGB_Image_Format 0x04 //COM7[2]|COM7[0] - -// Attention, the RGB format can be setted only when COM7[2] = 1 AND COM7[0] = 0; -#define RGB_Normal 0x00 //COM15[5:4] -#define RGB_565 0x10 //COM15[5:4] -#define RGB_555 0x30 //COM15[5:4] - -/* - * OV7670 REG ADDR - */ -#define REG_GAIN 0x00 /* Gain lower 8 bits (rest in vref) */ -#define REG_BLUE 0x01 /* blue gain */ -#define REG_RED 0x02 /* red gain */ -#define REG_VREF 0x03 /* Pieces of GAIN, VSTART, VSTOP */ -#define REG_COM1 0x04 /* Control 1 */ -#define COM1_CCIR656 0x40 /* CCIR656 enable */ -#define REG_BAVE 0x05 /* U/B Average level */ -#define REG_GbAVE 0x06 /* Y/Gb Average level */ -#define REG_AECHH 0x07 /* AEC MS 5 bits */ -#define REG_RAVE 0x08 /* V/R Average level */ -#define REG_COM2 0x09 /* Control 2 */ -#define COM2_SSLEEP 0x10 /* Soft sleep mode */ -#define REG_PID 0x0a /* Product ID MSB */ -#define REG_VER 0x0b /* Product ID LSB */ -#define REG_COM3 0x0c /* Control 3 */ -#define COM3_SWAP 0x40 /* Byte swap */ -#define COM3_SCALEEN 0x08 /* Enable scaling */ -#define COM3_DCWEN 0x04 /* Enable downsamp/crop/window */ -#define REG_COM4 0x0d /* Control 4 */ -#define REG_COM5 0x0e /* All "reserved" */ -#define REG_COM6 0x0f /* Control 6 */ -#define REG_AECH 0x10 /* More bits of AEC value */ -#define REG_CLKRC 0x11 /* Clock control */ -#define CLK_EXT 0x40 /* Use external clock directly */ -#define CLK_SCALE 0x3f /* Mask for internal clock scale */ -#define REG_COM7 0x12 /* Control 7 */ -#define COM7_RESET 0x80 /* Register reset */ -#define COM7_FMT_MASK 0x38 -#define COM7_FMT_VGA 0x00 -#define COM7_FMT_CIF 0x20 /* CIF format */ -#define COM7_FMT_QVGA 0x10 /* QVGA format */ -#define COM7_FMT_QCIF 0x08 /* QCIF format */ -#define COM7_RGB 0x04 /* bits 0 and 2 - RGB format */ -#define COM7_YUV 0x00 /* YUV */ -#define COM7_BAYER 0x01 /* Bayer format */ -#define COM7_PBAYER 0x05 /* "Processed bayer" */ -#define REG_COM8 0x13 /* Control 8 */ -#define COM8_FASTAEC 0x80 /* Enable fast AGC/AEC */ -#define COM8_AECSTEP 0x40 /* Unlimited AEC step size */ -#define COM8_BFILT 0x20 /* Band filter enable */ -#define COM8_AGC 0x04 /* Auto gain enable */ -#define COM8_AWB 0x02 /* White balance enable */ -#define COM8_AEC 0x01 /* Auto exposure enable */ -#define REG_COM9 0x14 /* Control 9- gain ceiling */ -#define REG_COM10 0x15 /* Control 10 */ -#define COM10_HSYNC 0x40 /* HSYNC instead of HREF */ -#define COM10_PCLK_HB 0x20 /* Suppress PCLK on horiz blank */ -#define COM10_HREF_REV 0x08 /* Reverse HREF */ -#define COM10_VS_LEAD 0x04 /* VSYNC on clock leading edge */ -#define COM10_VS_NEG 0x02 /* VSYNC negative */ -#define COM10_HS_NEG 0x01 /* HSYNC negative */ -#define REG_HSTART 0x17 /* Horiz start high bits */ -#define REG_HSTOP 0x18 /* Horiz stop high bits */ -#define REG_VSTART 0x19 /* Vert start high bits */ -#define REG_VSTOP 0x1a /* Vert stop high bits */ -#define REG_PSHFT 0x1b /* Pixel delay after HREF */ -#define REG_MIDH 0x1c /* Manuf. ID high */ -#define REG_MIDL 0x1d /* Manuf. ID low */ -#define REG_MVFP 0x1e /* Mirror / vflip */ -#define MVFP_MIRROR 0x20 /* Mirror image */ -#define MVFP_FLIP 0x10 /* Vertical flip */ - -#define REG_AEW 0x24 /* AGC upper limit */ -#define REG_AEB 0x25 /* AGC lower limit */ -#define REG_VPT 0x26 /* AGC/AEC fast mode op region */ -#define REG_HSYST 0x30 /* HSYNC rising edge delay */ -#define REG_HSYEN 0x31 /* HSYNC falling edge delay */ -#define REG_HREF 0x32 /* HREF pieces */ -#define REG_TSLB 0x3a /* lots of stuff */ -#define TSLB_YLAST 0x04 /* UYVY or VYUY - see com13 */ -#define REG_COM11 0x3b /* Control 11 */ -#define COM11_NIGHT 0x80 /* NIght mode enable */ -#define COM11_NMFR 0x60 /* Two bit NM frame rate */ -#define COM11_HZAUTO 0x10 /* Auto detect 50/60 Hz */ -#define COM11_50HZ 0x08 /* Manual 50Hz select */ -#define COM11_EXP 0x02 -#define REG_COM12 0x3c /* Control 12 */ -#define COM12_HREF 0x80 /* HREF always */ -#define REG_COM13 0x3d /* Control 13 */ -#define COM13_GAMMA 0x80 /* Gamma enable */ -#define COM13_UVSAT 0x40 /* UV saturation auto adjustment */ -#define COM13_UVSWAP 0x01 /* V before U - w/TSLB */ -#define REG_COM14 0x3e /* Control 14 */ -#define COM14_DCWEN 0x10 /* DCW/PCLK-scale enable */ -#define REG_EDGE 0x3f /* Edge enhancement factor */ -#define REG_COM15 0x40 /* Control 15 */ -#define COM15_R10F0 0x00 /* Data range 10 to F0 */ -#define COM15_R01FE 0x80 /* 01 to FE */ -#define COM15_R00FF 0xc0 /* 00 to FF */ -#define COM15_RGB565 0x10 /* RGB565 output */ -#define COM15_RGB555 0x30 /* RGB555 output */ -#define REG_COM16 0x41 /* Control 16 */ -#define COM16_AWBGAIN 0x08 /* AWB gain enable */ -#define REG_COM17 0x42 /* Control 17 */ -#define COM17_AECWIN 0xc0 /* AEC window - must match COM4 */ -#define COM17_CBAR 0x08 /* DSP Color bar */ -/* - * This matrix defines how the colors are generated, must be - * tweaked to adjust hue and saturation. - * - * Order: v-red, v-green, v-blue, u-red, u-green, u-blue - * They are nine-bit signed quantities, with the sign bit - * stored in0x58.Sign for v-red is bit 0, and up from there. - */ -#define REG_CMATRIX_BASE 0x4f -#define CMATRIX_LEN 6 -#define REG_CMATRIX_SIGN 0x58 -#define REG_BRIGHT 0x55 /* Brightness */ -#define REG_CONTRAS 0x56 /* Contrast control */ -#define REG_GFIX 0x69 /* Fix gain control */ -#define REG_REG76 0x76 /* OV's name */ -#define R76_BLKPCOR 0x80 /* Black pixel correction enable */ -#define R76_WHTPCOR 0x40 /* White pixel correction enable */ -#define REG_RGB444 0x8c /* RGB 444 control */ -#define R444_ENABLE 0x02 /* Turn on RGB444, overrides 5x5 */ -#define R444_RGBX 0x01 /* Empty nibble at end */ -#define REG_HAECC1 0x9f /* Hist AEC/AGC control 1 */ -#define REG_HAECC2 0xa0 /* Hist AEC/AGC control 2 */ -#define REG_BD50MAX 0xa5 /* 50hz banding step limit */ -#define REG_HAECC3 0xa6 /* Hist AEC/AGC control 3 */ -#define REG_HAECC4 0xa7 /* Hist AEC/AGC control 4 */ -#define REG_HAECC5 0xa8 /* Hist AEC/AGC control 5 */ -#define REG_HAECC6 0xa9 /* Hist AEC/AGC control 6 */ -#define REG_HAECC7 0xaa /* Hist AEC/AGC control 7 */ -#define REG_BD60MAX 0xab /* 60hz banding step limit */ -#define COM7_FMT_CIF 0x20 /* CIF format */ -#define COM7_RGB 0x04 /* bits 0 and 2 - RGB format */ -#define COM7_YUV 0x00 /* YUV */ -#define COM7_BAYER 0x01 /* Bayer format */ -#define COM7_PBAYER 0x05 /* "Processed bayer" */ -#define COM10_VS_LEAD 0x04 /* VSYNC on clock leading edge */ -#define COM11_50HZ 0x08 /* Manual 50Hz select */ -#define COM13_UVSAT 0x40 /* UV saturation auto adjustment */ -#define COM15_R01FE 0x80 /* 01 to FE */ -#define MTX1 0x4f /* Matrix Coefficient 1 */ -#define MTX2 0x50 /* Matrix Coefficient 2 */ -#define MTX3 0x51 /* Matrix Coefficient 3 */ -#define MTX4 0x52 /* Matrix Coefficient 4 */ -#define MTX5 0x53 /* Matrix Coefficient 5 */ -#define MTX6 0x54 /* Matrix Coefficient 6 */ -#define MTXS 0x58 /* Matrix Coefficient Sign */ -#define AWBC7 0x59 /* AWB Control 7 */ -#define AWBC8 0x5a /* AWB Control 8 */ -#define AWBC9 0x5b /* AWB Control 9 */ -#define AWBC10 0x5c /* AWB Control 10 */ -#define AWBC11 0x5d /* AWB Control 11 */ -#define AWBC12 0x5e /* AWB Control 12 */ -#define REG_GFI 0x69 /* Fix gain control */ -#define GGAIN 0x6a /* G Channel AWB Gain */ -#define DBLV 0x6b -#define AWBCTR3 0x6c /* AWB Control 3 */ -#define AWBCTR2 0x6d /* AWB Control 2 */ -#define AWBCTR1 0x6e /* AWB Control 1 */ -#define AWBCTR0 0x6f /* AWB Control 0 */ - - -enum { - OV7670_STANDBY = 0x0, - OV7670_STREAMING = 0x1, // I2C triggered streaming enable -}; - - -#endif diff --git a/rtos/pmsis/pmsis_bsp/camera/pixart/pixart.c b/rtos/pmsis/pmsis_bsp/camera/pixart/pixart.c deleted file mode 100644 index a7f01c4c..00000000 --- a/rtos/pmsis/pmsis_bsp/camera/pixart/pixart.c +++ /dev/null @@ -1,408 +0,0 @@ -/* - * Copyright (C) 2020 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "pmsis.h" -#include "bsp/bsp.h" -#include "bsp/camera/pixart.h" -#include "pixart.h" - - -typedef struct { - uint32_t addr; - uint32_t value; -} spi_req_t; - -typedef struct { - struct pi_pixart_conf conf; - struct pi_device cpi_device; - struct pi_device spi_device; - struct pi_device pwm_device; - struct pi_device gpio_port; - spi_req_t spi_req; -} pixart_t; - -typedef struct { - uint8_t addr; - uint8_t data; -} pixart_reg_init_t; - -static pixart_reg_init_t __pixart_reg_init[] = -{ - {0x7F, 0x00}, // bank select 0 - {0x0C, 0x1D}, // soft reset - {0x7F, 0x00}, // bank select 0 - //{0x07, 0x00}, // Hsynclnv/Vsynclnv/PxClklnv/AAvg_V/AAvg_H/VFlip/HFlip - {0x07, 0x80}, // Hsynclnv/Vsynclnv/PxClklnv/AAvg_V/AAvg_H/VFlip/HFlip - {0x08, 0x03}, // Askip_V/Askip_H - {0x0B, 0x0E}, - {0x0D, 0xC5}, // BLC/R_ABC_startline/R_ABC_En - {0x0F, 0x32}, // BINV_UB - //{0x11, 0x41}, // R_fgh - {0x11, 0x61}, // R_fgh - {0x12, 0xBD}, // R_ggh - {0x13, 0xD2}, - {0x14, 0xFE}, - {0x15, 0x00}, - {0x17, 0x02}, - {0x1A, 0x07}, - {0x1B, 0x08}, - {0x20, 0x00}, - {0x25, 0x78}, - {0x29, 0x28}, - {0x2B, 0x06}, - {0x2F, 0x0E}, - {0x30, 0x0E}, - {0x34, 0x0F}, - {0x35, 0x0F}, - {0x3A, 0x28}, - {0x45, 0x17}, - {0x46, 0x17}, - //{0x48, 0x10}, // Expo[7:0] - //{0x49, 0x27}, // Expo[15:8] - //{0x4A, 0x00}, // Expo[23:16] - {0x48, 0x10}, // Expo[7:0] - {0x49, 0x51}, // Expo[15:8] - {0x4A, 0x00}, // Expo[23:16] - {0x4D, 0x0D}, - {0x4E, 0x20}, - {0x62, 0x12}, - {0x64, 0x02}, - {0x67, 0x0A}, - {0x69, 0x0A}, - {0x6C, 0x0B}, - {0x6E, 0x0B}, - {0x71, 0x0A}, - {0x73, 0x1D}, - {0x75, 0x1E}, - {0x77, 0x0B}, - {0x7F, 0x01}, // Bank select 1 - {0x01, 0x14}, - {0x02, 0x02}, - {0x04, 0x96}, - {0x05, 0x03}, - {0x06, 0x46}, - {0x0D, 0x9F}, // BLACINV Control 1/T_BLACINV_EnH/ - {0x0E, 0x11}, // BLACINV Control 2/T_SIG_REF - {0x0F, 0x48}, - {0x10, 0x10}, - {0x11, 0x00}, - {0x12, 0x05}, // T_GPIO_OPDRV/T_HSYNC_OPDRV/T_VSYNC_OPDRV/T_PXD_OPDRV - {0x15, 0x00}, - {0x16, 0x01}, - {0x17, 0x67}, - {0x18, 0xD0}, - {0x21, 0x14}, - {0x22, 0x80}, - {0x23, 0x80}, // Mode select trigger/exit low power mode - {0x2F, 0x30}, - {0x35, 0x64}, - {0x39, 0x03}, - {0x3A, 0x03}, - //{0x45, 0x02}, - {0x46, 0x06}, // BLC Function 2/R_ABC_SampleSize - //{0x4A, 0x01}, // Vsync_front_delay[7:0] - //{0x4B, 0x10}, // Vsync_rear_delay[7:0] - {0x4A, 0xFF}, // Vsync_front_delay[7:0] - {0x4B, 0x00}, // Vsync_rear_delay[7:0] - {0x00, 0x01}, // Update -}; - - -static inline int is_spi_active(void) -{ -#if defined(ARCHI_PLATFORM_RTL) - - // SPI driver is not yet working on some chips, at least this works on gvsoc. - // Also there is noSPI connection to camera model on RTL -#if PULP_CHIP == CHIP_GAP9 || PULP_CHIP == CHIP_VEGA || PULP_CHIP == CHIP_ARNOLD || PULP_CHIP == CHIP_PULPISSIMO || PULP_CHIP == CHIP_PULPISSIMO_V1 - return 0; -#else - return rt_platform() != ARCHI_PLATFORM_RTL; -#endif - -#else - - return 1; - -#endif -} - -static void __pixart_reg_write(pixart_t *pixart, uint8_t addr, uint8_t value) -{ - if (is_spi_active()) - { - /* wtrite command must keep MSB 0. */ - pixart->spi_req.addr = (addr & 0x7F); - pixart->spi_req.value = value; - pi_spi_send(&pixart->spi_device, (uint8_t *)&pixart->spi_req.addr, 8, PI_SPI_CS_KEEP); - pi_spi_send(&pixart->spi_device, (uint8_t *)&pixart->spi_req.value, 8, PI_SPI_CS_AUTO); - } -} - -static uint8_t __pixart_reg_read(pixart_t *pixart, uint8_t addr) -{ - if (is_spi_active()) - { - /* read command must keep MSB 1. */ - pixart->spi_req.addr = (addr | 0x80); - pi_spi_send(&pixart->spi_device, (uint8_t *)&pixart->spi_req.addr, 8, PI_SPI_CS_KEEP); - pi_spi_receive(&pixart->spi_device, (uint8_t *)&pixart->spi_req.value, 8, PI_SPI_CS_AUTO); - return pixart->spi_req.value; - } - - return 0; -} - -static void __pixart_regs_init(pixart_t *pixart) -{ - for (uint8_t i = 0; i < (sizeof(__pixart_reg_init) / sizeof(pixart_reg_init_t)); i++) - { - __pixart_reg_write(pixart, __pixart_reg_init[i].addr, __pixart_reg_init[i].data); - } - - /* wait for time to ensure init success. */ - pi_time_wait_us(1000); -} - -static void __pixart_on(pixart_t *pixart) -{ - /* enable 4V/2V5 to power on camera. */ - pi_gpio_pin_write(&pixart->gpio_port, pixart->conf.gpio_ctl.gpio_power_4V, 1); - pi_gpio_pin_write(&pixart->gpio_port, pixart->conf.gpio_ctl.gpio_power_2V5, 1); -} - -static void __pixart_off(pixart_t *pixart) -{ - /* close 4V/2V5 to power off camera. */ - pi_gpio_pin_write(&pixart->gpio_port, pixart->conf.gpio_ctl.gpio_power_4V, 0); - pi_gpio_pin_write(&pixart->gpio_port, pixart->conf.gpio_ctl.gpio_power_2V5, 0); -} - -static void __pixart_mode(pixart_t *pixart, uint8_t mode) -{ - __pixart_reg_write(pixart, PIXART_BANK_SELECT_REG, 0x01); - __pixart_reg_write(pixart, PIXART_SWITCH_MODE_CTL1_REG, (mode != PIXART_TRIGGER_MODE) ? 0x00 : 0x80); - __pixart_reg_write(pixart, PIXART_UPDATE_REG, 0x01); -} - -static int __pixart_start(pixart_t *pixart) -{ - /* poweron camera. */ - __pixart_on(pixart); - - /* wait time > 500us to complete poweron process. */ - pi_time_wait_us(1000); - - /* reset camera from pad. */ - //pi_gpio_pin_write(&pixart->gpio_port, pixart->conf.gpio_ctl.gpio_reset, 1); - - /* wait time > 500us to complete reset process. */ - //pi_time_wait_us(1000); - - uint16_t id; - do - { - /* soft reset pixart. */ - __pixart_reg_write(pixart, PIXART_GLOBAL_RESET_REG, PIXART_SOFT_RESET); - - pi_time_wait_us(100); - - id = ((__pixart_reg_read(pixart, PIXART_CHIP_ID_REG_H) << 8) | __pixart_reg_read(pixart, PIXART_CHIP_ID_REG_L)); - - } while (id == 0xFFFF); //while (id != PIXART_CHIP_ID); - - /* init register for pixart and then pixart is ready. */ - __pixart_regs_init(pixart); - - return 0; -} - -static void __pixart_trigger_snapshot(pixart_t *pixart) -{ - /* in trigger mode to start run. */ - __pixart_reg_write(pixart, PIXART_SWITCH_MODE_CTL2_REG, 0x8C); - __pixart_reg_write(pixart, PIXART_SWITCH_MODE_CTL2_REG, 0x0C); -} - -static int32_t __pixart_open(struct pi_device *device) -{ - struct pi_pixart_conf *conf = (struct pi_pixart_conf *)device->config; - - /* init bsp gpio. */ - bsp_pixart_open(conf); - - pixart_t *pixart = (pixart_t *)pmsis_l2_malloc(sizeof(pixart_t)); - if (pixart == NULL) - return -1; - - memcpy(&pixart->conf, conf, sizeof(*conf)); - device->data = (void *)pixart; - - /* configure cpi interface. */ - struct pi_cpi_conf cpi_conf; - pi_cpi_conf_init(&cpi_conf); - cpi_conf.itf = conf->cpi_itf; - pi_open_from_conf(&pixart->cpi_device, &cpi_conf); - if (pi_cpi_open(&pixart->cpi_device)) - goto error; - - pi_cpi_set_format(&pixart->cpi_device, PI_CPI_FORMAT_BYPASS_BIGEND); - - /* configure spi interface to use for command. */ - struct pi_spi_conf spi_conf; - pi_spi_conf_init(&spi_conf); - spi_conf.itf = conf->spi_itf; - spi_conf.cs = conf->spi_cs; - spi_conf.wordsize = PI_SPI_WORDSIZE_8; - spi_conf.big_endian = 1; - spi_conf.max_baudrate = PIXART_SPI_BAUDRATE; - spi_conf.polarity = 0; - spi_conf.phase = 0; - pi_open_from_conf(&pixart->spi_device, &spi_conf); - if (pi_spi_open(&pixart->spi_device)) - goto error2; - - /* configure pwm to support clk to camera. */ - struct pi_pwm_conf pwm_conf; - pi_pwm_conf_init(&pwm_conf); - pwm_conf.pwm_id = conf->pwm_id; - pwm_conf.ch_id = conf->pwm_channel; - pwm_conf.timer_conf &= ~PI_PWM_CLKSEL_REFCLK_32K; - pwm_conf.timer_conf |= PI_PWM_CLKSEL_FLL; - pi_open_from_conf(&pixart->pwm_device, &pwm_conf); - if (pi_pwm_open(&pixart->pwm_device)) - goto error3; - - pi_pwm_duty_cycle_set(&pixart->pwm_device, PIXART_MCLK_FREQ, 50); - pi_pwm_timer_start(&pixart->pwm_device); - - /* configure gpio to control power and reset functions. */ - struct pi_gpio_conf gpio_conf; - pi_gpio_conf_init(&gpio_conf); - pi_open_from_conf(&pixart->gpio_port, &gpio_conf); - if (pi_gpio_open(&pixart->gpio_port)) - goto error4; - - pi_gpio_pin_configure(&pixart->gpio_port, conf->gpio_ctl.gpio_power_4V, PI_GPIO_OUTPUT | PI_GPIO_PULL_DISABLE); - pi_gpio_pin_configure(&pixart->gpio_port, conf->gpio_ctl.gpio_power_2V5, PI_GPIO_OUTPUT | PI_GPIO_PULL_DISABLE); - //pi_gpio_pin_configure(&pixart->gpio_port, conf->gpio_ctl.gpio_reset, PI_GPIO_OUTPUT | PI_GPIO_PULL_DISABLE); - __pixart_off(pixart); - //pi_gpio_pin_write(&pixart->gpio_port, pixart->conf.gpio_ctl.gpio_reset, 0); - - /* init camera. */ - if (__pixart_start(pixart) != 0) - goto error5; - - return 0; - -error5: - // TODO does not exist yet - //pi_gpio_close(&pixart->gpio_port); -error4: - pi_pwm_close(&pixart->pwm_device); -error3: - pi_spi_close(&pixart->spi_device); -error2: - pi_cpi_close(&pixart->cpi_device); -error: - pmsis_l2_malloc_free(pixart, sizeof(pixart_t)); - - return -1; -} - -static void __pixart_close(struct pi_device *device) -{ - /* close periph and free memery. */ - pixart_t *pixart = (pixart_t *)device->data; - pi_pwm_close(&pixart->pwm_device); - pi_spi_close(&pixart->spi_device); - pi_cpi_close(&pixart->cpi_device); - pmsis_l2_malloc_free(pixart, sizeof(pixart_t)); -} - -static int32_t __pixart_control(struct pi_device *device, pi_camera_cmd_e cmd, void *arg) -{ - pixart_t *pixart = (pixart_t *)device->data; - - switch (cmd) - { - case PI_CAMERA_CMD_ON: - __pixart_on(pixart); - break; - - case PI_CAMERA_CMD_OFF: - __pixart_off(pixart); - break; - - case PI_CAMERA_CMD_START: - pi_cpi_control_start(&pixart->cpi_device); - break; - - case PI_CAMERA_CMD_STOP: - /* switch from contiune mode to trigger mode(or stop output datastream). */ - __pixart_mode(pixart, PIXART_TRIGGER_MODE); - pi_cpi_control_stop(&pixart->cpi_device); - break; - - default: - break; - } - - return 0; -} - -static void __pixart_capture_async(struct pi_device *device, void *buffer, uint32_t bufferlen, pi_task_t *task) -{ - pixart_t *pixart = (pixart_t *)device->data; - - pi_cpi_capture_async(&pixart->cpi_device, buffer, bufferlen, task); - - /* switch to continue mode and start output datastream. */ - __pixart_mode(pixart, PIXART_CONTINUE_MODE); -} - -static int32_t __pixart_reg_set(struct pi_device *device, uint32_t addr, uint8_t *value) -{ - pixart_t *pixart = (pixart_t *)device->data; - __pixart_reg_write(pixart, addr, *(uint16_t *)value); - return 0; -} - -static int32_t __pixart_reg_get(struct pi_device *device, uint32_t addr, uint8_t *value) -{ - pixart_t *pixart = (pixart_t *)device->data; - *(uint16_t *)value = __pixart_reg_read(pixart, addr); - return 0; -} - -static pi_camera_api_t pixart_api = -{ - .open = &__pixart_open, - .close = &__pixart_close, - .control = &__pixart_control, - .capture_async = &__pixart_capture_async, - .reg_set = &__pixart_reg_set, - .reg_get = &__pixart_reg_get -}; - -void pi_pixart_conf_init(struct pi_pixart_conf *conf) -{ - conf->camera.api = &pixart_api; - bsp_pixart_conf_init(conf); - conf->format = PI_CAMERA_QVGA; - conf->skip_pads_config = 0; - __camera_conf_init(&conf->camera); -} diff --git a/rtos/pmsis/pmsis_bsp/camera/pixart/pixart.h b/rtos/pmsis/pmsis_bsp/camera/pixart/pixart.h deleted file mode 100644 index 31e2027b..00000000 --- a/rtos/pmsis/pmsis_bsp/camera/pixart/pixart.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -* Copyright (C) 2019 GreenWaves Technologies -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* -* Authors: Germain Haugou, GreenWaves Technologies (germain.haugou@greenwaves-technologies.com) -*/ - -// File CIS_PIXART.h - -#ifndef __CIS_PIXART_H -#define __CIS_PIXART_H // avoid recursive inclusions - -#define PIXART_MCLK_FREQ 6000000 -#define PIXART_SPI_BAUDRATE 10000000 - -#define PIXART_TRIGGER_MODE 0 -#define PIXART_CONTINUE_MODE 1 - -#define PIXART_CHIP_ID_REG_L 0x00 -#define PIXART_CHIP_ID_REG_H 0x01 -#define PIXART_CHIP_ID 0x6100 - -#define PIXART_UPDATE_REG 0x00 - -#define PIXART_GLOBAL_RESET_REG 0x0C -#define PIXART_SOFT_RESET 0x1D - -#define PIXART_SWITCH_MODE_CTL1_REG 0x23 -#define PIXART_SWITCH_MODE_CTL2_REG 0x24 -#define PIXART_BANK_SELECT_REG 0x7F - -#endif // ndef __CIS_PIXART_H - - diff --git a/rtos/pmsis/pmsis_bsp/camera/thermeye/thermeye.c b/rtos/pmsis/pmsis_bsp/camera/thermeye/thermeye.c deleted file mode 100644 index b771bdbb..00000000 --- a/rtos/pmsis/pmsis_bsp/camera/thermeye/thermeye.c +++ /dev/null @@ -1,350 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "pmsis.h" -#include "bsp/bsp.h" -#include "bsp/camera/thermeye.h" -#include "thermeye_defines.h" - -typedef struct -{ - uint16_t addr; - uint8_t value; -} __attribute__((packed)) i2c_req_t; - -typedef struct -{ - struct pi_thermeye_conf conf; - struct pi_device cpi_device; - struct pi_device i2c_device; - struct pi_device pwm_device; - struct pi_device gpio_device; - i2c_req_t i2c_req; -} thermeye_t; - - -static uint8_t __pi_thermeye_reg_read(thermeye_t *thermeye, uint16_t addr) -{ - /* - * addr = 0x_X1_X2_X3_X4. - * 16 bits address : MSB(8) | LSB(8). - * => req.addr = X3_X4_X1_X2 - */ - thermeye->i2c_req.addr = ((addr << 8) | (addr >> 8)); - pi_i2c_write(&(thermeye->i2c_device), (uint8_t *) &(thermeye->i2c_req.addr), 2, PI_I2C_XFER_NO_STOP); - pi_i2c_read(&(thermeye->i2c_device), (uint8_t *) &(thermeye->i2c_req.value), 1, PI_I2C_XFER_STOP); - return thermeye->i2c_req.value; -} - -static void __pi_thermeye_reg_write(thermeye_t *thermeye, uint16_t addr, uint8_t value) -{ - thermeye->i2c_req.addr = ((addr << 8) | (addr >> 8)); - thermeye->i2c_req.value = value; - pi_i2c_write(&(thermeye->i2c_device), (uint8_t *) &(thermeye->i2c_req), 3, PI_I2C_XFER_STOP); -} - -static void __pi_thermeye_start(thermeye_t *thermeye) -{ - //printf("Sensor On\n"); - /* Start Master Clock. Need GPIO, pin E12 on sensor. */ - /* MC frequency 14 * I2C SCL frequency. Set when opened. */ - { - /* Set NRST. GPIO_IR_NRST, pin M5 on sensor. */ - pi_gpio_pin_write(&(thermeye->gpio_device), thermeye->conf.gpio_reset, 0); - - /* Enable power to sensor. */ - pi_gpio_pin_write(&(thermeye->gpio_device), thermeye->conf.gpio_power, 1); - pi_time_wait_us(1500); - - /* Start sensor MC -> PWM. */ - /* No need to start again and again. */ - //pi_pwm_timer_start(&(thermeye->pwm_device)); - - /* Release NRST. */ - pi_gpio_pin_write(&(thermeye->gpio_device), thermeye->conf.gpio_reset, 1); - - /* Wait some time to stabilise power on. */ - pi_time_wait_us(1500); - hal_compiler_barrier(); - } - - /* Read read-only register using I2C. */ - { - uint8_t value[3] = {0}; - do - { - value[0] = __pi_thermeye_reg_read(thermeye, (uint16_t) READ_ONLY_A); - value[1] = __pi_thermeye_reg_read(thermeye, (uint16_t) READ_ONLY_B); - value[2] = __pi_thermeye_reg_read(thermeye, (uint16_t) READ_ONLY_C); - } while ((value[0] != 0x55) || (value[1] != 0xC6) || (value[2] != 0xC5)); - //printf("Read_only access : %x %x %x\n", value[0], value[1], value[2]); - } - - /* Set sensor in digital mode. */ - hal_compiler_barrier(); - __pi_thermeye_reg_write(thermeye, (uint16_t) INT_CAPA_LD, 0x01); - __pi_thermeye_reg_write(thermeye, (uint16_t) EXT_CAPA_LD, 0x02); - __pi_thermeye_reg_write(thermeye, (uint16_t) ADC_BIAS, 0x00); - __pi_thermeye_reg_write(thermeye, (uint16_t) EXT_POLAR, 0x08); - __pi_thermeye_reg_write(thermeye, (uint16_t) DACGFID, 0xBD); - __pi_thermeye_reg_write(thermeye, (uint16_t) DACGSK_A, 0x01); - __pi_thermeye_reg_write(thermeye, (uint16_t) DACGSK_B, 0x30); - __pi_thermeye_reg_write(thermeye, (uint16_t) VTEMP_ADC, 0x60); - __pi_thermeye_reg_write(thermeye, (uint16_t) DACVBUS, 0x00); - __pi_thermeye_reg_write(thermeye, (uint16_t) INTEGRATION, 0x25); - __pi_thermeye_reg_write(thermeye, (uint16_t) GAIN_IMAGE, 0x53); - /* Set Configs. */ - __pi_thermeye_reg_write(thermeye, (uint16_t) CONFIG, 0x01); - __pi_thermeye_reg_write(thermeye, (uint16_t) CONFIG, 0x41); - __pi_thermeye_reg_write(thermeye, (uint16_t) 0x005D, ((1 << 2) | (1 << 0))); - //__pi_thermeye_reg_write(thermeye, (uint16_t) CONFIG, 0x01); - - hal_compiler_barrier(); - /* Wait capa preload. Here 19ms. */ - pi_time_wait_us(19000); - - /* Disable external capa preload. */ - __pi_thermeye_reg_write(thermeye, (uint16_t) EXT_CAPA_LD, 0x00); -} - -static uint32_t __pi_thermeye_trigger_snapshot(thermeye_t *thermeye) -{ - uint32_t feedback = 0; - /* Switch on led during image capture. */ - //pi_gpio_pin_write(NULL, GPIO_USER_LED, 1); - - __pi_thermeye_reg_write(thermeye, (uint16_t) CONFIG, 0x45); - //feedback = __pi_thermeye_reg_read(thermeye, (uint16_t) CONFIG); - return feedback; -} - -static void __pi_thermeye_stop(thermeye_t *thermeye) -{ - /* Switch off led. */ - //pi_gpio_pin_write(NULL, GPIO_USER_LED, 0); - - /* Reset NRST. GPIO_IR_NRST, pin M5 on sensor. */ - pi_gpio_pin_write(&(thermeye->gpio_device), thermeye->conf.gpio_reset, 0); - pi_time_wait_us(2); - - /* Disable power to sensor. */ - pi_gpio_pin_write(&(thermeye->gpio_device), thermeye->conf.gpio_power, 0); - //printf("Sensor Off\n"); -} - -static void __pi_thermeye_on(thermeye_t *thermeye) -{ - /* Enable power to sensor. */ - pi_gpio_pin_write(&(thermeye->gpio_device), thermeye->conf.gpio_power, 1); - pi_time_wait_us(100); -} - -static void __pi_thermeye_off(thermeye_t *thermeye) -{ - /* Disable power to sensor. */ - pi_gpio_pin_write(&(thermeye->gpio_device), thermeye->conf.gpio_power, 0); - pi_time_wait_us(100); -} - -static int32_t __pi_thermeye_open(struct pi_device *device) -{ - struct pi_thermeye_conf *conf = (struct pi_thermeye_conf *) device->config; - - /* Setup board. Init default padframes. */ - bsp_thermeye_open(conf); - - /* Switch on user led while config. */ - //pi_gpio_pin_write(NULL, GPIO_USER_LED, 1); - - thermeye_t *thermeye = (thermeye_t *) pi_l2_malloc(sizeof(thermeye_t)); - if (thermeye == NULL) - { - return -1; - } - - memcpy(&(thermeye->conf), conf, sizeof(struct pi_thermeye_conf)); - device->data = (void *) thermeye; - - //printf("ThermEye: opening CPI(%d), I2C(%d), PWM(%d, %d), GPIO_Power %x, GPIO_Reset %x\n", - // conf->cpi_id, conf->i2c_id, conf->pwm_id, conf->pwm_channel, - // conf->gpio_power, conf->gpio_reset); - - /* PWM open. */ - #define PWM_FQCY_KHz (700) - struct pi_pwm_conf pwm_conf; - pi_pwm_conf_init(&pwm_conf); - pwm_conf.pwm_id = conf->pwm_id; - pwm_conf.ch_id = conf->pwm_channel; - pwm_conf.timer_conf &= ~PI_PWM_CLKSEL_REFCLK_32K; - pwm_conf.timer_conf |= PI_PWM_CLKSEL_FLL; - pi_open_from_conf(&(thermeye->pwm_device), &pwm_conf); - if (pi_pwm_open(&(thermeye->pwm_device))) - { - printf("PWM open failed !\n"); - pi_l2_free(thermeye, sizeof(struct pi_thermeye_conf)); - return -2; - } - pi_pwm_duty_cycle_set(&(thermeye->pwm_device), PWM_FQCY_KHz * 1000, 50); - - pi_pwm_timer_start(&(thermeye->pwm_device)); - - /* I2C open. */ - /* F_pwm = 14 * F_i2c, at least. */ - #define I2C0_FQCY_KHZ (PWM_FQCY_KHz / 16) - struct pi_i2c_conf i2c_conf; - pi_i2c_conf_init(&i2c_conf); - i2c_conf.cs = ((uint8_t) I2CAD) << 1; - i2c_conf.itf = conf->i2c_id; - i2c_conf.max_baudrate = I2C0_FQCY_KHZ * 1000; - pi_open_from_conf(&(thermeye->i2c_device), &i2c_conf); - if (pi_i2c_open(&(thermeye->i2c_device))) - { - printf("I2C open failed !\n"); - pi_pwm_close(&(thermeye->i2c_device)); - pi_l2_free(thermeye, sizeof(struct pi_thermeye_conf)); - return -3; - } - - //printf("PWM: %d kHz I2C: %d kHz\n", PWM_FQCY_KHz, I2C0_FQCY_KHZ); - - /* CPI open. */ - struct pi_cpi_conf cpi_conf = {0}; - pi_cpi_conf_init(&cpi_conf); - cpi_conf.itf = conf->cpi_id; - pi_open_from_conf(&(thermeye->cpi_device), &cpi_conf); - if (pi_cpi_open(&(thermeye->cpi_device))) - { - printf("CPI_open failed !\n"); - pi_pwm_close(&(thermeye->pwm_device)); - pi_i2c_close(&(thermeye->i2c_device)); - pi_l2_free(thermeye, sizeof(struct pi_thermeye_conf)); - return -4; - } - pi_cpi_set_format(&(thermeye->cpi_device), conf->cpi_format); - - /* GPIO open. */ - struct pi_gpio_conf gpio_conf; - pi_gpio_conf_init(&gpio_conf); - pi_open_from_conf(&(thermeye->gpio_device), &gpio_conf); - if (pi_gpio_open(&(thermeye->gpio_device))) - { - printf("GPIO_open failed !\n"); - pi_pwm_close(&(thermeye->pwm_device)); - pi_i2c_close(&(thermeye->i2c_device)); - pi_cpi_close(&(thermeye->cpi_device)); - pi_l2_free(thermeye, sizeof(struct pi_thermeye_conf)); - return -5; - } - - /* GPIO_IR_NRST, pin M5 on sensor. */ - pi_gpio_pin_configure(&(thermeye->gpio_device), conf->gpio_reset, PI_GPIO_OUTPUT | PI_GPIO_PULL_DISABLE); - - /* Power to sensor. */ - pi_gpio_pin_configure(&(thermeye->gpio_device), conf->gpio_power, PI_GPIO_OUTPUT | PI_GPIO_PULL_DISABLE); - - /* Init done, switch off led. */ - //pi_gpio_pin_write(NULL, GPIO_USER_LED, 0); - return 0; -} - -static void __pi_thermeye_close(struct pi_device *device) -{ - thermeye_t *thermeye = (thermeye_t *) device->data; - - /* Close PWM. */ - pi_pwm_close(&(thermeye->pwm_device)); - - /* Close I2C. */ - pi_i2c_close(&(thermeye->i2c_device)); - - /* Close CPI. */ - pi_cpi_close(&(thermeye->cpi_device)); - - /* Free thermeye_t struct. */ - pi_l2_free(thermeye, sizeof(thermeye_t)); -} - -static int32_t __pi_thermeye_control(struct pi_device *device, pi_camera_cmd_e cmd, - void *arg) -{ - thermeye_t *thermeye = (thermeye_t *) device->data; - switch (cmd) - { - case PI_CAMERA_CMD_ON: - __pi_thermeye_on(thermeye); - break; - - case PI_CAMERA_CMD_OFF: - __pi_thermeye_off(thermeye); - break; - - case PI_CAMERA_CMD_START: - pi_cpi_control_start(&(thermeye->cpi_device)); - __pi_thermeye_start(thermeye); - __pi_thermeye_trigger_snapshot(thermeye); - break; - - case PI_CAMERA_CMD_STOP: - pi_cpi_control_stop(&(thermeye->cpi_device)); - __pi_thermeye_stop(thermeye); - break; - - default: - break; - } - return 0; -} - -static void __pi_thermeye_capture_async(struct pi_device *device, void *buffer, - uint32_t bufferlen, pi_task_t *task) -{ - thermeye_t *thermeye = (thermeye_t *) device->data; - pi_cpi_capture_async(&(thermeye->cpi_device), buffer, bufferlen, task); - //__pi_thermeye_trigger_snapshot(thermeye); -} - -static int32_t __pi_thermeye_reg_get(struct pi_device *device, uint32_t addr, uint8_t *value) -{ - thermeye_t *thermeye = (thermeye_t *) device->data; - *value = __pi_thermeye_reg_read(thermeye, (uint16_t) addr); - return 0; -} - -static int32_t __pi_thermeye_reg_set(struct pi_device *device, uint32_t addr, uint8_t *value) -{ - thermeye_t *thermeye = (thermeye_t *) device->data; - __pi_thermeye_reg_write(thermeye, (uint16_t) addr, *value); - return 0; -} - - -static pi_camera_api_t thermeye_api = -{ - .open = &__pi_thermeye_open, - .close = &__pi_thermeye_close, - .control = &__pi_thermeye_control, - .capture_async = &__pi_thermeye_capture_async, - .reg_get = &__pi_thermeye_reg_get, - .reg_set = &__pi_thermeye_reg_set -}; - - -void pi_thermeye_conf_init(struct pi_thermeye_conf *conf) -{ - conf->camera.api = &thermeye_api; - bsp_thermeye_conf_init(conf); - conf->skip_pads_config = 0; -} diff --git a/rtos/pmsis/pmsis_bsp/camera/thermeye/thermeye_defines.h b/rtos/pmsis/pmsis_bsp/camera/thermeye/thermeye_defines.h deleted file mode 100644 index e7283f56..00000000 --- a/rtos/pmsis/pmsis_bsp/camera/thermeye/thermeye_defines.h +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __BSP_THERMEYE_DEFINES_H__ -#define __BSP_THERMEYE_DEFINES_H__ - -/* I2C chip select address. */ -#define I2CAD ( 0x12 ) - -/* Registers address, to be addressed using I2C. */ - -/* Serial number of the sensor is written in those registers. */ -#define SERIAL_NB_A ( 0x0000 ) -#define SERIAL_NB_B ( 0x0001 ) -#define SERIAL_NB_C ( 0x0002 ) -#define SERIAL_NB_D ( 0x0003 ) - -/* - * Gain values - * - * Gain | CINT | Reg_val - * 0.75 | 8pF | 0x7X - * 0.86 | 7pF | 0x6X - * 1.00 | 6pF | 0x5X <--- Default config. - * 1.20 | 5pF | 0x4X - * 1.50 | 4pF | 0x3X - * 2.00 | 3pF | 0x2X - * 3.00 | 2pF | 0x1X - * 6.00 | 1pF | 0x0X - * - * Image flip - * - * Use GAIN_IMAGE's bit 0 & 1(UPROW & UPCOL) to flip image. - * SCANNING DIRECTION | UPROW UPCOL - * left → right / down → up (default configuration) | 1 1 - * left → right / up → down | 0 1 - * right → left / down → up | 1 0 - * right → left / up → down | 0 0 - * - * Default value : 0x53. - */ -#define GAIN_IMAGE ( 0x0040 ) - -/* - * VTEMP_ADC = VTEMP_SEL|MUX_ADC_2x8|ADC_ENABLE|X|SEQ_TRIGGER|X|X|X| - * - * ADC Operating mode | MUX-ADC 2x8 | ADC_Enable - * 0 | 1 | 0 - * 1 | 0 | 1 - * 1 | 1 | 1 - * - * VTEMP_SEL = 0 -> -4.8 mv/C. -> FPA temp = -0.0305 * VTEMP + 413 *C. - * VTEMP_SEL = 1 -> +14.8 mv/C. -> FPA temp = 33*C, VTEMP = 1.85V. - * Default value : 0x40 - */ -#define VTEMP_ADC ( 0x0041 ) - -#define YMIN ( 0x0044 ) -#define YMAX_B ( 0x0046 ) -#define XMIN_B ( 0x0048 ) -#define XMAX_B ( 0x004A ) - -/* - * GFID internal = 0.0102V DACGFID value + 0.7775V - * GFID min = 0V, GFID max = 2.86V - */ -#define DACGFID ( 0x004B ) - -/* - * GSK Internal (V) = 0.0026 DACGSK value + 0.9697 V - * GSK min = 1.65 V and GSK max = 3.6 V - */ -#define DACGSK_A ( 0x004C ) -#define DACGSK_B ( 0x004D ) -/* Generated internally, default value is 0x0. VBUS = 2.3V. */ -#define DACVBUS ( 0x004E ) - -/* - * TINT = val(INTEGRATION) * PSYNC. - * Max TINT = 300us. - * if ( TINT > (nb_col - 13) ) - * Additional interline = ( TINT - (nb_col - 13) * PSYNC ) - * Additional interframwe = ( TINT - (nb_col - 13) * PSYNC ) - */ -#define INTEGRATION ( 0x0050 ) /* Default value : 0x50. */ -#define ADC_BIAS ( 0x005A ) - -/* - * EXT_POLAR = X|X|X|X|GOC_EXT|VBUS_EXT|GFID_EXT|GSK_EXT - * - * Default value : 0x0B. - * GOC_EXT = 1 - * VBUS_EXT = 0 (must be internal) - * GFID_EXT = 1 - * GSK_EXT = 1 - */ -#define EXT_POLAR ( 0x005B ) - -/* - * CONFIG = X|X|X|X|X|START_SEQ|WINDOW|I2CDIFF. - */ -#define CONFIG ( 0x005C ) - -/* - * Value of inter-line duration while HSYNC = 0. - * Preset factory value : 17. - * Min val = 17, Max val = 17 + 255. - */ -#define INTERLINE ( 0x0062 ) - -/* - * Check window resizing errors. - * FEEDBACK[7] = BAD_XY_PROG : 0 OK, 1 KO Fault : incorrect minimum & maximum values. - * FEEDBACK[6] = STOP_SEQ : 0 Sequencer running, 1 Sequencer stopped. - * FEEDBACK[4] = AD_SIZE_PROG : 0 OK, 1 KO Fault : unauthorized format. - * FEEDBACK[3] = CL_INT_DONE : 0 Sequencer not ready, 1 Sequencer ready. - */ -#define FEEDBACK ( 0x0063 ) - -#define EXT_CAPA_LD ( 0x0082 ) -#define INT_CAPA_LD ( 0x008A ) - -/* - * Value of inter-frame duration while VSYNC = 0. - * INTERFRAME_A/B = 0 -> Interframe_real = 16 * PSYNC. - * INTERFRAME_A/B != 0 -> Interframe_real = (nb_col * INTERFRAME_A/B + 18 + INTERFRAME_A/B) * PSYNC. - */ -#define INTERFRAME_A ( 0x008E ) -#define INTERFRAME_B ( 0x008F ) - -#define READ_ONLY_A ( 0x00F7 ) /* Read-only, factory value = 0x55. */ -#define READ_ONLY_B ( 0x00F8 ) /* Read-only, factory value = 0xC6. */ -#define READ_ONLY_C ( 0x00F9 ) /* Read-only, factory value = 0xC5. */ - -#endif /* __BSP_THERMEYE_DEFINES_H__ */ - -/* - * Nominal config: - * Master clock = 780kHz, framerate = 50Hz. - * SCL = 52kHz. - * ADC & DAC on. - * ADC & DAC voltage : internal. - * GFID internally generated, default value of DACGFID. - * GSK internally generated, default value of DACGSK. - * VBUS internally generated. - * CINT = 6pF. - * TINT = 29 period of PSYNC -> Tint = 75us. - * INTERLINE = 0. - * INTERFRAME = 0. - */ -/* - * Starting config given(from User Guide) : - * - */ diff --git a/rtos/pmsis/pmsis_bsp/crc/md5.c b/rtos/pmsis/pmsis_bsp/crc/md5.c deleted file mode 100644 index 900c03c7..00000000 --- a/rtos/pmsis/pmsis_bsp/crc/md5.c +++ /dev/null @@ -1,291 +0,0 @@ -/* - * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc. - * MD5 Message-Digest Algorithm (RFC 1321). - * - * Homepage: - * http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5 - * - * Author: - * Alexander Peslyak, better known as Solar Designer - * - * This software was written by Alexander Peslyak in 2001. No copyright is - * claimed, and the software is hereby placed in the public domain. - * In case this attempt to disclaim copyright and place the software in the - * public domain is deemed null and void, then the software is - * Copyright (c) 2001 Alexander Peslyak and it is hereby released to the - * general public under the following terms: - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted. - * - * There's ABSOLUTELY NO WARRANTY, express or implied. - * - * (This is a heavily cut-down "BSD license".) - * - * This differs from Colin Plumb's older public domain implementation in that - * no exactly 32-bit integer data type is required (any 32-bit or wider - * unsigned integer data type will do), there's no compile-time endianness - * configuration, and the function prototypes match OpenSSL's. No code from - * Colin Plumb's implementation has been reused; this comment merely compares - * the properties of the two independent implementations. - * - * The primary goals of this implementation are portability and ease of use. - * It is meant to be fast, but not as fast as possible. Some known - * optimizations are not included to reduce source code size and avoid - * compile-time configuration. - */ - -#ifndef HAVE_OPENSSL - -#include - -#include "bsp/crc/md5.h" - -/* - * The basic MD5 functions. - * - * F and G are optimized compared to their RFC 1321 definitions for - * architectures that lack an AND-NOT instruction, just like in Colin Plumb's - * implementation. - */ -#define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) -#define G(x, y, z) ((y) ^ ((z) & ((x) ^ (y)))) -#define H(x, y, z) (((x) ^ (y)) ^ (z)) -#define H2(x, y, z) ((x) ^ ((y) ^ (z))) -#define I(x, y, z) ((y) ^ ((x) | ~(z))) - -/* - * The MD5 transformation for all four rounds. - */ -#define STEP(f, a, b, c, d, x, t, s) \ - (a) += f((b), (c), (d)) + (x) + (t); \ - (a) = (((a) << (s)) | (((a) & 0xffffffff) >> (32 - (s)))); \ - (a) += (b); - -/* - * SET reads 4 input bytes in little-endian byte order and stores them in a - * properly aligned word in host byte order. - * - * The check for little-endian architectures that tolerate unaligned memory - * accesses is just an optimization. Nothing will break if it fails to detect - * a suitable architecture. - * - * Unfortunately, this optimization may be a C strict aliasing rules violation - * if the caller's data buffer has effective type that cannot be aliased by - * MD5_u32plus. In practice, this problem may occur if these MD5 routines are - * inlined into a calling function, or with future and dangerously advanced - * link-time optimizations. For the time being, keeping these MD5 routines in - * their own translation unit avoids the problem. - */ -#if defined(__i386__) || defined(__x86_64__) || defined(__vax__) -#define SET(n) \ - (*(MD5_u32plus *)&ptr[(n) * 4]) -#define GET(n) \ - SET(n) -#else -#define SET(n) \ - (ctx->block[(n)] = \ - (MD5_u32plus)ptr[(n) * 4] | \ - ((MD5_u32plus)ptr[(n) * 4 + 1] << 8) | \ - ((MD5_u32plus)ptr[(n) * 4 + 2] << 16) | \ - ((MD5_u32plus)ptr[(n) * 4 + 3] << 24)) -#define GET(n) \ - (ctx->block[(n)]) -#endif - -/* - * This processes one or more 64-byte data blocks, but does NOT update the bit - * counters. There are no alignment requirements. - */ -static const void *body(MD5_CTX *ctx, const void *data, unsigned long size) -{ - const unsigned char *ptr; - MD5_u32plus a, b, c, d; - MD5_u32plus saved_a, saved_b, saved_c, saved_d; - - ptr = (const unsigned char *)data; - - a = ctx->a; - b = ctx->b; - c = ctx->c; - d = ctx->d; - - do { - saved_a = a; - saved_b = b; - saved_c = c; - saved_d = d; - -/* Round 1 */ - STEP(F, a, b, c, d, SET(0), 0xd76aa478, 7) - STEP(F, d, a, b, c, SET(1), 0xe8c7b756, 12) - STEP(F, c, d, a, b, SET(2), 0x242070db, 17) - STEP(F, b, c, d, a, SET(3), 0xc1bdceee, 22) - STEP(F, a, b, c, d, SET(4), 0xf57c0faf, 7) - STEP(F, d, a, b, c, SET(5), 0x4787c62a, 12) - STEP(F, c, d, a, b, SET(6), 0xa8304613, 17) - STEP(F, b, c, d, a, SET(7), 0xfd469501, 22) - STEP(F, a, b, c, d, SET(8), 0x698098d8, 7) - STEP(F, d, a, b, c, SET(9), 0x8b44f7af, 12) - STEP(F, c, d, a, b, SET(10), 0xffff5bb1, 17) - STEP(F, b, c, d, a, SET(11), 0x895cd7be, 22) - STEP(F, a, b, c, d, SET(12), 0x6b901122, 7) - STEP(F, d, a, b, c, SET(13), 0xfd987193, 12) - STEP(F, c, d, a, b, SET(14), 0xa679438e, 17) - STEP(F, b, c, d, a, SET(15), 0x49b40821, 22) - -/* Round 2 */ - STEP(G, a, b, c, d, GET(1), 0xf61e2562, 5) - STEP(G, d, a, b, c, GET(6), 0xc040b340, 9) - STEP(G, c, d, a, b, GET(11), 0x265e5a51, 14) - STEP(G, b, c, d, a, GET(0), 0xe9b6c7aa, 20) - STEP(G, a, b, c, d, GET(5), 0xd62f105d, 5) - STEP(G, d, a, b, c, GET(10), 0x02441453, 9) - STEP(G, c, d, a, b, GET(15), 0xd8a1e681, 14) - STEP(G, b, c, d, a, GET(4), 0xe7d3fbc8, 20) - STEP(G, a, b, c, d, GET(9), 0x21e1cde6, 5) - STEP(G, d, a, b, c, GET(14), 0xc33707d6, 9) - STEP(G, c, d, a, b, GET(3), 0xf4d50d87, 14) - STEP(G, b, c, d, a, GET(8), 0x455a14ed, 20) - STEP(G, a, b, c, d, GET(13), 0xa9e3e905, 5) - STEP(G, d, a, b, c, GET(2), 0xfcefa3f8, 9) - STEP(G, c, d, a, b, GET(7), 0x676f02d9, 14) - STEP(G, b, c, d, a, GET(12), 0x8d2a4c8a, 20) - -/* Round 3 */ - STEP(H, a, b, c, d, GET(5), 0xfffa3942, 4) - STEP(H2, d, a, b, c, GET(8), 0x8771f681, 11) - STEP(H, c, d, a, b, GET(11), 0x6d9d6122, 16) - STEP(H2, b, c, d, a, GET(14), 0xfde5380c, 23) - STEP(H, a, b, c, d, GET(1), 0xa4beea44, 4) - STEP(H2, d, a, b, c, GET(4), 0x4bdecfa9, 11) - STEP(H, c, d, a, b, GET(7), 0xf6bb4b60, 16) - STEP(H2, b, c, d, a, GET(10), 0xbebfbc70, 23) - STEP(H, a, b, c, d, GET(13), 0x289b7ec6, 4) - STEP(H2, d, a, b, c, GET(0), 0xeaa127fa, 11) - STEP(H, c, d, a, b, GET(3), 0xd4ef3085, 16) - STEP(H2, b, c, d, a, GET(6), 0x04881d05, 23) - STEP(H, a, b, c, d, GET(9), 0xd9d4d039, 4) - STEP(H2, d, a, b, c, GET(12), 0xe6db99e5, 11) - STEP(H, c, d, a, b, GET(15), 0x1fa27cf8, 16) - STEP(H2, b, c, d, a, GET(2), 0xc4ac5665, 23) - -/* Round 4 */ - STEP(I, a, b, c, d, GET(0), 0xf4292244, 6) - STEP(I, d, a, b, c, GET(7), 0x432aff97, 10) - STEP(I, c, d, a, b, GET(14), 0xab9423a7, 15) - STEP(I, b, c, d, a, GET(5), 0xfc93a039, 21) - STEP(I, a, b, c, d, GET(12), 0x655b59c3, 6) - STEP(I, d, a, b, c, GET(3), 0x8f0ccc92, 10) - STEP(I, c, d, a, b, GET(10), 0xffeff47d, 15) - STEP(I, b, c, d, a, GET(1), 0x85845dd1, 21) - STEP(I, a, b, c, d, GET(8), 0x6fa87e4f, 6) - STEP(I, d, a, b, c, GET(15), 0xfe2ce6e0, 10) - STEP(I, c, d, a, b, GET(6), 0xa3014314, 15) - STEP(I, b, c, d, a, GET(13), 0x4e0811a1, 21) - STEP(I, a, b, c, d, GET(4), 0xf7537e82, 6) - STEP(I, d, a, b, c, GET(11), 0xbd3af235, 10) - STEP(I, c, d, a, b, GET(2), 0x2ad7d2bb, 15) - STEP(I, b, c, d, a, GET(9), 0xeb86d391, 21) - - a += saved_a; - b += saved_b; - c += saved_c; - d += saved_d; - - ptr += 64; - } while (size -= 64); - - ctx->a = a; - ctx->b = b; - ctx->c = c; - ctx->d = d; - - return ptr; -} - -void MD5_Init(MD5_CTX *ctx) -{ - ctx->a = 0x67452301; - ctx->b = 0xefcdab89; - ctx->c = 0x98badcfe; - ctx->d = 0x10325476; - - ctx->lo = 0; - ctx->hi = 0; -} - -void MD5_Update(MD5_CTX *ctx, const void *data, unsigned long size) -{ - MD5_u32plus saved_lo; - unsigned long used, available; - - saved_lo = ctx->lo; - if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo) - ctx->hi++; - ctx->hi += size >> 29; - - used = saved_lo & 0x3f; - - if (used) { - available = 64 - used; - - if (size < available) { - memcpy(&ctx->buffer[used], data, size); - return; - } - - memcpy(&ctx->buffer[used], data, available); - data = (const unsigned char *)data + available; - size -= available; - body(ctx, ctx->buffer, 64); - } - - if (size >= 64) { - data = body(ctx, data, size & ~(unsigned long)0x3f); - size &= 0x3f; - } - - memcpy(ctx->buffer, data, size); -} - -#define OUT(dst, src) \ - (dst)[0] = (unsigned char)(src); \ - (dst)[1] = (unsigned char)((src) >> 8); \ - (dst)[2] = (unsigned char)((src) >> 16); \ - (dst)[3] = (unsigned char)((src) >> 24); - -void MD5_Final(unsigned char *result, MD5_CTX *ctx) -{ - unsigned long used, available; - - used = ctx->lo & 0x3f; - - ctx->buffer[used++] = 0x80; - - available = 64 - used; - - if (available < 8) { - memset(&ctx->buffer[used], 0, available); - body(ctx, ctx->buffer, 64); - used = 0; - available = 64; - } - - memset(&ctx->buffer[used], 0, available - 8); - - ctx->lo <<= 3; - OUT(&ctx->buffer[56], ctx->lo) - OUT(&ctx->buffer[60], ctx->hi) - - body(ctx, ctx->buffer, 64); - - OUT(&result[0], ctx->a) - OUT(&result[4], ctx->b) - OUT(&result[8], ctx->c) - OUT(&result[12], ctx->d) - - memset(ctx, 0, sizeof(*ctx)); -} - -#endif diff --git a/rtos/pmsis/pmsis_bsp/display/display.c b/rtos/pmsis/pmsis_bsp/display/display.c deleted file mode 100644 index 60d90b22..00000000 --- a/rtos/pmsis/pmsis_bsp/display/display.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Authors: Germain Haugou, GreenWaves Technologies (germain.haugou@greenwaves-technologies.com) - */ -#include "pmsis.h" -#include "bsp/display.h" - - -int pi_display_open(struct pi_device *device) -{ - struct pi_display_conf *conf = (struct pi_display_conf *)device->config; - pi_display_api_t *api = (pi_display_api_t *)conf->api; - device->api = (struct pi_device_api *)api; - return api->open(device); -} - - - -void pi_display_write(struct pi_device *device, pi_buffer_t *buffer, uint16_t x, uint16_t y, uint16_t w, uint16_t h) -{ - pi_task_t task; - pi_task_block(&task); - pi_display_write_async(device, buffer, x, y, w, h, &task); - pi_task_wait_on(&task); - pi_task_destroy(&task); -} - - - -void __display_conf_init(struct pi_display_conf *conf) -{ -} diff --git a/rtos/pmsis/pmsis_bsp/display/ili9341/ili9341.c b/rtos/pmsis/pmsis_bsp/display/ili9341/ili9341.c deleted file mode 100644 index 3ae4837a..00000000 --- a/rtos/pmsis/pmsis_bsp/display/ili9341/ili9341.c +++ /dev/null @@ -1,577 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Authors: Francesco Paci, GreenWaves Technologies (francesco.paci@greenwaves-technologies.com) - * Germain Haugou, GreenWaves Technologies (germain.haugou@greenwaves-technologies.com) - */ - - -#include "pmsis.h" -#include "pmsis/drivers/spi.h" -#include "pmsis/drivers/hyperbus.h" -#include "pmsis/drivers/gpio.h" -#include "bsp/display/ili9341.h" -#include "bsp/bsp.h" -#include "ili9341.h" - -#define TEMP_BUFFER_SIZE (256) - -typedef struct -{ - struct pi_device spim; - struct pi_device gpio_port; - int width; - uint32_t current_data; - uint32_t current_size; - uint32_t current_line_len; - pi_buffer_t *buffer; - uint8_t temp_buffer[TEMP_BUFFER_SIZE*2]; - pi_task_t temp_copy_task; - pi_task_t *current_task; - int gpio; - - unsigned int _width; - unsigned int _height; - int16_t cursor_x; - int16_t cursor_y; - int16_t wrap; - uint8_t textsize; - uint16_t textcolor; - uint16_t textbgcolor; -} ili_t; - -#if 1 - -static void __ili_init(ili_t *ili); -static void __ili_set_rotation(ili_t *ili,uint8_t m); -static void __ili_set_addr_window(ili_t *ili,uint16_t x, uint16_t y, uint16_t w, uint16_t h) ; -static void __ili_write_8(ili_t *ili, uint8_t d); -static void __ili_write_command(ili_t *ili,uint8_t cmd); -static void __ili_gray8_to_rgb565(uint8_t *input,uint16_t *output,int width, int height); -static void __ili_rgb565_to_rgb565(uint16_t *input,uint16_t *output,int width, int height); - -static void __ili9341_write_buffer_iter(void *arg) -{ - ili_t *ili = (ili_t *)arg; - uint32_t size = TEMP_BUFFER_SIZE; - - if (ili->buffer->stride != 0) - { - if (size > ili->current_line_len) - size = ili->current_line_len; - } - else - { - if (size > ili->current_size) - size = ili->current_size; - } - - pi_task_t *task = &ili->temp_copy_task; - pi_spi_flags_e flags = PI_SPI_CS_KEEP; - - ili->current_size -= size; - if (ili->current_size == 0) - { - task = ili->current_task; - flags = PI_SPI_CS_AUTO; - } - if(ili->buffer->format==PI_BUFFER_FORMAT_RGB565){ - __ili_rgb565_to_rgb565((uint16_t *)ili->current_data, (uint16_t *)ili->temp_buffer, size, 1); - ili->current_data += size*2; - } - else{ - __ili_gray8_to_rgb565((uint8_t *)ili->current_data, (uint16_t *)ili->temp_buffer, size, 1); - ili->current_data += size; - } - - - if (ili->buffer->stride != 0) - { - ili->current_line_len -= size; - if (ili->current_line_len == 0) - { - ili->current_line_len = ili->width; - ili->current_data += ili->buffer->stride; - } - } - pi_spi_send_async(&ili->spim, ili->temp_buffer, size*2*8, flags, task); -} - - - -static void __ili_write_async(struct pi_device *device, pi_buffer_t *buffer, uint16_t x, uint16_t y,uint16_t w, uint16_t h, pi_task_t *task) -{ - ili_t *ili = (ili_t *)device->data; - - __ili_set_addr_window(ili, x, y, w, h); // Clipped area - - pi_task_callback(&ili->temp_copy_task, __ili9341_write_buffer_iter, (void *)ili); - - ili->buffer = buffer; - ili->width = w; - ili->current_task = task; - ili->current_data = (uint32_t)buffer->data; - ili->current_size = w*h; - ili->current_line_len = w; - - __ili9341_write_buffer_iter(ili); -} - - - -static int __ili_open(struct pi_device *device) -{ - struct pi_ili9341_conf *conf = (struct pi_ili9341_conf *)device->config; - - ili_t *ili = (ili_t *)pmsis_l2_malloc(sizeof(ili_t)); - if (ili == NULL) return -1; - - if (bsp_ili9341_open(conf)) - goto error; - - struct pi_gpio_conf gpio_conf; - pi_gpio_conf_init(&gpio_conf); - - pi_open_from_conf(&ili->gpio_port, &gpio_conf); - - if (pi_gpio_open(&ili->gpio_port)) - goto error; - - device->data = (void *)ili; - - ili->gpio = conf->gpio; - - struct pi_spi_conf spi_conf; - pi_spi_conf_init(&spi_conf); - spi_conf.itf = conf->spi_itf; - spi_conf.cs = conf->spi_cs; - - spi_conf.wordsize = PI_SPI_WORDSIZE_8; - spi_conf.big_endian = 1; - spi_conf.max_baudrate = 50000000; - spi_conf.polarity = 0; - spi_conf.phase = 0; - - pi_open_from_conf(&ili->spim, &spi_conf); - - if (pi_spi_open(&ili->spim)) - goto error; - - __ili_init(ili); - ili->_width = ILI9341_TFTWIDTH; - ili->_height = ILI9341_TFTHEIGHT; - __ili_set_rotation(ili,0); - - ili->cursor_x = 0; - ili->cursor_y = 0; - ili->wrap = 0; - ili->textsize = 1; - ili->textcolor = ILI9341_GREEN; - ili->textbgcolor = ILI9341_WHITE; - - return 0; - -error: - pmsis_l2_malloc_free(ili, sizeof(ili_t)); - return -1; -} - - - -static int32_t __ili_ioctl(struct pi_device *device, uint32_t cmd, void *arg) -{ - ili_t *ili = (ili_t *)device->data; - - switch (cmd) - { - case PI_ILI_IOCTL_ORIENTATION: - __ili_set_rotation(ili, (uint8_t)(long)arg); - return 0; - } - return -1; -} - - - -static pi_display_api_t ili_api = -{ - .open = &__ili_open, - .write_async = &__ili_write_async, - .ioctl = &__ili_ioctl -}; - - - -void pi_ili9341_conf_init(struct pi_ili9341_conf *conf) -{ - conf->display.api = &ili_api; - conf->spi_itf = 0; - conf->skip_pads_config = 0; - __display_conf_init(&conf->display); - bsp_ili9341_conf_init(conf); -} - - - -static void __ili_write_8(ili_t *ili, uint8_t value) -{ - ili->temp_buffer[0] = value; - pi_spi_send(&ili->spim, ili->temp_buffer, 8, PI_SPI_CS_AUTO); -} - - - -static void __ili_write_16(ili_t *ili, uint16_t value) -{ - __ili_write_8(ili, value >> 8); - __ili_write_8(ili, value); -} - - - -static void __ili_write_32(ili_t *ili, uint32_t value) -{ - __ili_write_16(ili, value >> 16); - __ili_write_16(ili, value); -} - - - -static void __ili_write_command(ili_t *ili, uint8_t cmd) -{ - pi_gpio_pin_write(&ili->gpio_port, ili->gpio, 0); - __ili_write_8(ili,cmd); - pi_gpio_pin_write(&ili->gpio_port, ili->gpio, 1); -} - - - -static void __ili_init(ili_t *ili) -{ - pi_gpio_pin_configure(&ili->gpio_port, ili->gpio, PI_GPIO_OUTPUT); - pi_gpio_pin_write(&ili->gpio_port, ili->gpio, 0); - - __ili_write_command(ili,0xEF); - __ili_write_8(ili,0x03); - __ili_write_8(ili,0x80); - __ili_write_8(ili,0x02); - - __ili_write_command(ili,0xCF); - __ili_write_8(ili,0x00); - __ili_write_8(ili,0XC1); - __ili_write_8(ili,0X30); - - __ili_write_command(ili,0xED); - __ili_write_8(ili,0x64); - __ili_write_8(ili,0x03); - __ili_write_8(ili,0X12); - __ili_write_8(ili,0X81); - - __ili_write_command(ili, 0xE8); - __ili_write_8(ili,0x85); - __ili_write_8(ili,0x00); - __ili_write_8(ili,0x78); - - __ili_write_command(ili,0xCB); - __ili_write_8(ili,0x39); - __ili_write_8(ili,0x2C); - __ili_write_8(ili,0x00); - __ili_write_8(ili,0x34); - __ili_write_8(ili,0x02); - - __ili_write_command(ili,0xF7); - __ili_write_8(ili,0x20); - - __ili_write_command(ili,0xEA); - __ili_write_8(ili,0x00); - __ili_write_8(ili,0x00); - - __ili_write_command(ili,ILI9341_PWCTR1); //Power control - __ili_write_8(ili,0x23); //VRH[5:0] - - __ili_write_command(ili,ILI9341_PWCTR2); //Power control - __ili_write_8(ili,0x10); //SAP[2:0];BT[3:0] - - __ili_write_command(ili,ILI9341_VMCTR1); //VCM control - __ili_write_8(ili,0x3e); - __ili_write_8(ili,0x28); - - __ili_write_command(ili,ILI9341_VMCTR2); //VCM control2 - __ili_write_8(ili,0x86); //-- - - __ili_write_command(ili,ILI9341_MADCTL); // Memory Access Control - __ili_write_8(ili,0x48); - - __ili_write_command(ili,ILI9341_VSCRSADD); // Vertical scroll - __ili_write_16(ili,0); // Zero - - __ili_write_command(ili,ILI9341_PIXFMT); - __ili_write_8(ili,0x55); - - __ili_write_command(ili,ILI9341_FRMCTR1); - __ili_write_8(ili,0x00); - __ili_write_8(ili,0x18); - - __ili_write_command(ili,ILI9341_DFUNCTR); // Display Function Control - __ili_write_8(ili,0x08); - __ili_write_8(ili,0x82); - __ili_write_8(ili,0x27); - - __ili_write_command(ili,0xF2); // 3Gamma Function Disable - __ili_write_8(ili,0x00); - - __ili_write_command(ili,ILI9341_GAMMASET); //Gamma curve selected - __ili_write_8(ili,0x01); - - __ili_write_command(ili,ILI9341_GMCTRP1); //Set Gamma - __ili_write_8(ili,0x0F); - __ili_write_8(ili,0x31); - __ili_write_8(ili,0x2B); - __ili_write_8(ili,0x0C); - __ili_write_8(ili,0x0E); - __ili_write_8(ili,0x08); - __ili_write_8(ili,0x4E); - __ili_write_8(ili,0xF1); - __ili_write_8(ili,0x37); - __ili_write_8(ili,0x07); - __ili_write_8(ili,0x10); - __ili_write_8(ili,0x03); - __ili_write_8(ili,0x0E); - __ili_write_8(ili,0x09); - __ili_write_8(ili,0x00); - - __ili_write_command(ili,ILI9341_GMCTRN1); //Set Gamma - __ili_write_8(ili,0x00); - __ili_write_8(ili,0x0E); - __ili_write_8(ili,0x14); - __ili_write_8(ili,0x03); - __ili_write_8(ili,0x11); - __ili_write_8(ili,0x07); - __ili_write_8(ili,0x31); - __ili_write_8(ili,0xC1); - __ili_write_8(ili,0x48); - __ili_write_8(ili,0x08); - __ili_write_8(ili,0x0F); - __ili_write_8(ili,0x0C); - __ili_write_8(ili,0x31); - __ili_write_8(ili,0x36); - __ili_write_8(ili,0x0F); - - __ili_write_command(ili,ILI9341_SLPOUT); //Exit Sleep - pi_time_wait_us(120000); - __ili_write_command(ili,ILI9341_DISPON); //Display on - pi_time_wait_us(120000); - -} - - - -static void __ili_set_rotation(ili_t *ili, uint8_t m) -{ - int rotation = m % 4; // can't be higher than 3 - switch (rotation) - { - case 0: - m = (MADCTL_MX | MADCTL_BGR); - ili->_width = ILI9341_TFTWIDTH; - ili->_height = ILI9341_TFTHEIGHT; - break; - - case 1: - m = (MADCTL_MV | MADCTL_BGR); - ili->_width = ILI9341_TFTHEIGHT; - ili->_height = ILI9341_TFTWIDTH; - break; - - case 2: - m = (MADCTL_MY | MADCTL_BGR); - ili->_width = ILI9341_TFTWIDTH; - ili->_height = ILI9341_TFTHEIGHT; - break; - - case 3: - m = (MADCTL_MX | MADCTL_MY | MADCTL_MV | MADCTL_BGR); - ili->_width = ILI9341_TFTHEIGHT; - ili->_height = ILI9341_TFTWIDTH; - break; - } - - __ili_write_command(ili, ILI9341_MADCTL); - __ili_write_8(ili, m); -} - - - -static void __ili_gray8_to_rgb565(uint8_t *input,uint16_t *output,int width, int height) -{ - for(int i=0;i> 3 ) << 3) | ((input[i] >> 5) ) | (((input[i] >> 2 ) << 13) )| ((input[i] >> 3) <<8); - } -} - -static void __ili_rgb565_to_rgb565(uint16_t *input,uint16_t *output,int width, int height) -{ - for(int i=0;i> 8) | ((input[i] & 0x00FF) << 8); - } -} - - - -static void __ili_set_addr_window(ili_t *ili,uint16_t x, uint16_t y, uint16_t w, uint16_t h) -{ - uint32_t xa = ((uint32_t)x << 16) | (x+w-1); - uint32_t ya = ((uint32_t)y << 16) | (y+h-1); - __ili_write_command(ili,ILI9341_CASET); // Column addr set - __ili_write_32(ili,xa); - __ili_write_command(ili,ILI9341_PASET); // Row addr set - __ili_write_32(ili,ya); - __ili_write_command(ili,ILI9341_RAMWR); // write to RAM -} - - - -void writeColor(struct pi_device *device, uint16_t color, unsigned int len) -{ - ili_t *ili = (ili_t *)device->data; - for (uint32_t t=0; tdata; - - if((x >= ili->_width) || (y >= ili->_height)) return; - unsigned short x2 = x + w - 1, y2 = y + h - 1; - - // Clip right/bottom - if(x2 >= ili->_width) w = ili->_width - x; - if(y2 >= ili->_height) h = ili->_height - y; - unsigned int len = (int32_t)w * h; - - //setAddrWindow(spim,x, y, w, h); - __ili_set_addr_window(ili, x, y, w, h); // Clipped area - - writeColor(device, color, len); -} - - -void setTextWrap(struct pi_device *device,signed short w) -{ - ili_t *ili = (ili_t *)device->data; - ili->wrap = w; -} - -void setCursor(struct pi_device *device,signed short x, signed short y) -{ - ili_t *ili = (ili_t *)device->data; - ili->cursor_x = x; - ili->cursor_y = y; -} - -void setTextColor(struct pi_device *device,uint16_t c) -{ - ili_t *ili = (ili_t *)device->data; - // For 'transparent' background, we'll set the bg - // to the same as fg instead of using a flag - ili->textcolor = c; -} - -static void __ili_writePixelAtPos(struct pi_device *device,int16_t x, int16_t y, uint16_t color) -{ - ili_t *ili = (ili_t *)device->data; - - if((x < 0) ||(x >= (int)ili->_width) || (y < 0) || (y >= (int)ili->_height)) return; - - __ili_set_addr_window(ili, x, y, 1, 1); // Clipped area - __ili_write_16(ili,color); -} - -static void drawChar(struct pi_device *device,int16_t x, int16_t y, unsigned char c, - uint16_t color, uint16_t bg, uint8_t size) -{ - ili_t *ili = (ili_t *)device->data; - - if((x >= (int)ili->_width) || // Clip right - (y >= (int)ili->_height) || // Clip bottom - ((x + 6 * size - 1) < 0) || // Clip left - ((y + 8 * size - 1) < 0)) // Clip top - return; - - //if(!_cp437 && (c >= 176)) c++; // Handle 'classic' charset behavior - - for(int8_t i=0; i<5; i++ ) - { // Char bitmap = 5 columns - uint8_t line = font[c * 5 + i]; - for(int8_t j=0; j<8; j++, line >>= 1) - { - if(line & 1) - { - if(size == 1) - __ili_writePixelAtPos(device,x+i, y+j, color); - else - writeFillRect(device,x+i*size, y+j*size, size, size, color); - } - else if(bg != color) - { - if(size == 1) - __ili_writePixelAtPos(device,x+i, y+j, bg); - else - writeFillRect(device,x+i*size, y+j*size, size, size, bg); - } - } - } -} - - -static void writeChar(struct pi_device *device,uint8_t c) -{ - ili_t *ili = (ili_t *)device->data; - - if(c == '\n') - { // Newline? - ili->cursor_x = 0; // Reset x to zero, - ili->cursor_y += ili->textsize * 8; // advance y one line - } - else if (c != '\r') - { // Ignore carriage returns - if (ili->wrap && ((ili->cursor_x + ili->textsize * 6) > (int)ili->_width)) - { // Off right? - ili->cursor_x = 0; // Reset x to zero, - ili->cursor_y += ili->textsize * 8; // advance y one line - } - drawChar(device, ili->cursor_x, ili->cursor_y, c, ili->textcolor, ili->textbgcolor, ili->textsize); - ili->cursor_x += ili->textsize * 6; // Advance x one char - } -} - -void writeText(struct pi_device *device,char* str,int fontsize) -{ - ili_t *ili = (ili_t *)device->data; - ili->textsize = fontsize; - int i=0; - while(str[i] != '\0') - writeChar(device,str[i++]); -} -#endif diff --git a/rtos/pmsis/pmsis_bsp/display/ili9341/ili9341.h b/rtos/pmsis/pmsis_bsp/display/ili9341/ili9341.h deleted file mode 100644 index f6a9ccc5..00000000 --- a/rtos/pmsis/pmsis_bsp/display/ili9341/ili9341.h +++ /dev/null @@ -1,373 +0,0 @@ -/* - * Copyright (C) 2019 GreenWaves Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "pmsis.h" - -#ifndef __ILI9341_H__ -#define __ILI9341_H__ - -#define ILI9341_TFTWIDTH 240 // ILI9341 max TFT width -#define ILI9341_TFTHEIGHT 320 // ILI9341 max TFT height - -#define ILI9341_NOP 0x00 // No-op register -#define ILI9341_SWRESET 0x01 // Software reset register -#define ILI9341_RDDID 0x04 // Read display identification information -#define ILI9341_RDDST 0x09 // Read Display Status - -#define ILI9341_SLPIN 0x10 // Enter Sleep Mode -#define ILI9341_SLPOUT 0x11 // Sleep Out -#define ILI9341_PTLON 0x12 // Partial Mode ON -#define ILI9341_NORON 0x13 // Normal Display Mode ON - -#define ILI9341_RDMODE 0x0A // Read Display Power Mode -#define ILI9341_RDMADCTL 0x0B // Read Display MADCTL -#define ILI9341_RDPIXFMT 0x0C // Read Display Pixel Format -#define ILI9341_RDIMGFMT 0x0D // Read Display Image Format -#define ILI9341_RDSELFDIAG 0x0F // Read Display Self-Diagnostic Result - -#define ILI9341_INVOFF 0x20 // Display Inversion OFF -#define ILI9341_INVON 0x21 // Display Inversion ON -#define ILI9341_GAMMASET 0x26 // Gamma Set -#define ILI9341_DISPOFF 0x28 // Display OFF -#define ILI9341_DISPON 0x29 // Display ON - -#define ILI9341_CASET 0x2A // Column Address Set -#define ILI9341_PASET 0x2B // Page Address Set -#define ILI9341_RAMWR 0x2C // Memory Write -#define ILI9341_RAMRD 0x2E // Memory Read - -#define ILI9341_PTLAR 0x30 // Partial Area -#define ILI9341_MADCTL 0x36 // Memory Access Control -#define ILI9341_VSCRSADD 0x37 // Vertical Scrolling Start Address -#define ILI9341_PIXFMT 0x3A // COLMOD: Pixel Format Set - -#define ILI9341_FRMCTR1 0xB1 // Frame Rate Control (In Normal Mode/Full Colors) -#define ILI9341_FRMCTR2 0xB2 // Frame Rate Control (In Idle Mode/8 colors) -#define ILI9341_FRMCTR3 0xB3 // Frame Rate control (In Partial Mode/Full Colors) -#define ILI9341_INVCTR 0xB4 // Display Inversion Control -#define ILI9341_DFUNCTR 0xB6 // Display Function Control - -#define ILI9341_PWCTR1 0xC0 // Power Control 1 -#define ILI9341_PWCTR2 0xC1 // Power Control 2 -#define ILI9341_PWCTR3 0xC2 // Power Control 3 -#define ILI9341_PWCTR4 0xC3 // Power Control 4 -#define ILI9341_PWCTR5 0xC4 // Power Control 5 -#define ILI9341_VMCTR1 0xC5 // VCOM Control 1 -#define ILI9341_VMCTR2 0xC7 // VCOM Control 2 - -#define ILI9341_RDID1 0xDA // Read ID 1 -#define ILI9341_RDID2 0xDB // Read ID 2 -#define ILI9341_RDID3 0xDC // Read ID 3 -#define ILI9341_RDID4 0xDD // Read ID 4 - -#define ILI9341_GMCTRP1 0xE0 // Positive Gamma Correction -#define ILI9341_GMCTRN1 0xE1 // Negative Gamma Correction -//#define ILI9341_PWCTR6 0xFC - - - -#define MADCTL_MY 0x80 // Bottom to top -#define MADCTL_MX 0x40 // Right to left -#define MADCTL_MV 0x20 // Reverse Mode -#define MADCTL_ML 0x10 // LCD refresh Bottom to top -#define MADCTL_RGB 0x00 // Red-Green-Blue pixel order -#define MADCTL_BGR 0x08 // Blue-Green-Red pixel order -#define MADCTL_MH 0x04 // LCD refresh right to left - - - -// Color definitions -#define ILI9341_BLACK 0x0000 ///< 0, 0, 0 -#define ILI9341_NAVY 0x000F ///< 0, 0, 128 -#define ILI9341_DARKGREEN 0x03E0 ///< 0, 128, 0 -#define ILI9341_DARKCYAN 0x03EF ///< 0, 128, 128 -#define ILI9341_MAROON 0x7800 ///< 128, 0, 0 -#define ILI9341_PURPLE 0x780F ///< 128, 0, 128 -#define ILI9341_OLIVE 0x7BE0 ///< 128, 128, 0 -#define ILI9341_LIGHTGREY 0xC618 ///< 192, 192, 192 -#define ILI9341_DARKGREY 0x7BEF ///< 128, 128, 128 -#define ILI9341_BLUE 0x001F ///< 0, 0, 255 -#define ILI9341_GREEN 0x07E0 ///< 0, 255, 0 -#define ILI9341_CYAN 0x07FF ///< 0, 255, 255 -#define ILI9341_RED 0xF800 ///< 255, 0, 0 -#define ILI9341_MAGENTA 0xF81F ///< 255, 0, 255 -#define ILI9341_YELLOW 0xFFE0 ///< 255, 255, 0 -#define ILI9341_WHITE 0xFFFF ///< 255, 255, 255 -#define ILI9341_ORANGE 0xFD20 ///< 255, 165, 0 -#define ILI9341_GREENYELLOW 0xAFE5 ///< 173, 255, 47 -#define ILI9341_PINK 0xFC18 ///< 255, 128, 192 - -static const unsigned char font[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, - 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, - 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, - 0x18, 0x3C, 0x7E, 0x3C, 0x18, - 0x1C, 0x57, 0x7D, 0x57, 0x1C, - 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, - 0x00, 0x18, 0x3C, 0x18, 0x00, - 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, - 0x00, 0x18, 0x24, 0x18, 0x00, - 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, - 0x30, 0x48, 0x3A, 0x06, 0x0E, - 0x26, 0x29, 0x79, 0x29, 0x26, - 0x40, 0x7F, 0x05, 0x05, 0x07, - 0x40, 0x7F, 0x05, 0x25, 0x3F, - 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, - 0x7F, 0x3E, 0x1C, 0x1C, 0x08, - 0x08, 0x1C, 0x1C, 0x3E, 0x7F, - 0x14, 0x22, 0x7F, 0x22, 0x14, - 0x5F, 0x5F, 0x00, 0x5F, 0x5F, - 0x06, 0x09, 0x7F, 0x01, 0x7F, - 0x00, 0x66, 0x89, 0x95, 0x6A, - 0x60, 0x60, 0x60, 0x60, 0x60, - 0x94, 0xA2, 0xFF, 0xA2, 0x94, - 0x08, 0x04, 0x7E, 0x04, 0x08, - 0x10, 0x20, 0x7E, 0x20, 0x10, - 0x08, 0x08, 0x2A, 0x1C, 0x08, - 0x08, 0x1C, 0x2A, 0x08, 0x08, - 0x1E, 0x10, 0x10, 0x10, 0x10, - 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, - 0x30, 0x38, 0x3E, 0x38, 0x30, - 0x06, 0x0E, 0x3E, 0x0E, 0x06, - 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x5F, 0x00, 0x00, - 0x00, 0x07, 0x00, 0x07, 0x00, - 0x14, 0x7F, 0x14, 0x7F, 0x14, - 0x24, 0x2A, 0x7F, 0x2A, 0x12, - 0x23, 0x13, 0x08, 0x64, 0x62, - 0x36, 0x49, 0x56, 0x20, 0x50, - 0x00, 0x08, 0x07, 0x03, 0x00, - 0x00, 0x1C, 0x22, 0x41, 0x00, - 0x00, 0x41, 0x22, 0x1C, 0x00, - 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, - 0x08, 0x08, 0x3E, 0x08, 0x08, - 0x00, 0x80, 0x70, 0x30, 0x00, - 0x08, 0x08, 0x08, 0x08, 0x08, - 0x00, 0x00, 0x60, 0x60, 0x00, - 0x20, 0x10, 0x08, 0x04, 0x02, - 0x3E, 0x51, 0x49, 0x45, 0x3E, - 0x00, 0x42, 0x7F, 0x40, 0x00, - 0x72, 0x49, 0x49, 0x49, 0x46, - 0x21, 0x41, 0x49, 0x4D, 0x33, - 0x18, 0x14, 0x12, 0x7F, 0x10, - 0x27, 0x45, 0x45, 0x45, 0x39, - 0x3C, 0x4A, 0x49, 0x49, 0x31, - 0x41, 0x21, 0x11, 0x09, 0x07, - 0x36, 0x49, 0x49, 0x49, 0x36, - 0x46, 0x49, 0x49, 0x29, 0x1E, - 0x00, 0x00, 0x14, 0x00, 0x00, - 0x00, 0x40, 0x34, 0x00, 0x00, - 0x00, 0x08, 0x14, 0x22, 0x41, - 0x14, 0x14, 0x14, 0x14, 0x14, - 0x00, 0x41, 0x22, 0x14, 0x08, - 0x02, 0x01, 0x59, 0x09, 0x06, - 0x3E, 0x41, 0x5D, 0x59, 0x4E, - 0x7C, 0x12, 0x11, 0x12, 0x7C, - 0x7F, 0x49, 0x49, 0x49, 0x36, - 0x3E, 0x41, 0x41, 0x41, 0x22, - 0x7F, 0x41, 0x41, 0x41, 0x3E, - 0x7F, 0x49, 0x49, 0x49, 0x41, - 0x7F, 0x09, 0x09, 0x09, 0x01, - 0x3E, 0x41, 0x41, 0x51, 0x73, - 0x7F, 0x08, 0x08, 0x08, 0x7F, - 0x00, 0x41, 0x7F, 0x41, 0x00, - 0x20, 0x40, 0x41, 0x3F, 0x01, - 0x7F, 0x08, 0x14, 0x22, 0x41, - 0x7F, 0x40, 0x40, 0x40, 0x40, - 0x7F, 0x02, 0x1C, 0x02, 0x7F, - 0x7F, 0x04, 0x08, 0x10, 0x7F, - 0x3E, 0x41, 0x41, 0x41, 0x3E, - 0x7F, 0x09, 0x09, 0x09, 0x06, - 0x3E, 0x41, 0x51, 0x21, 0x5E, - 0x7F, 0x09, 0x19, 0x29, 0x46, - 0x26, 0x49, 0x49, 0x49, 0x32, - 0x03, 0x01, 0x7F, 0x01, 0x03, - 0x3F, 0x40, 0x40, 0x40, 0x3F, - 0x1F, 0x20, 0x40, 0x20, 0x1F, - 0x3F, 0x40, 0x38, 0x40, 0x3F, - 0x63, 0x14, 0x08, 0x14, 0x63, - 0x03, 0x04, 0x78, 0x04, 0x03, - 0x61, 0x59, 0x49, 0x4D, 0x43, - 0x00, 0x7F, 0x41, 0x41, 0x41, - 0x02, 0x04, 0x08, 0x10, 0x20, - 0x00, 0x41, 0x41, 0x41, 0x7F, - 0x04, 0x02, 0x01, 0x02, 0x04, - 0x40, 0x40, 0x40, 0x40, 0x40, - 0x00, 0x03, 0x07, 0x08, 0x00, - 0x20, 0x54, 0x54, 0x78, 0x40, - 0x7F, 0x28, 0x44, 0x44, 0x38, - 0x38, 0x44, 0x44, 0x44, 0x28, - 0x38, 0x44, 0x44, 0x28, 0x7F, - 0x38, 0x54, 0x54, 0x54, 0x18, - 0x00, 0x08, 0x7E, 0x09, 0x02, - 0x18, 0xA4, 0xA4, 0x9C, 0x78, - 0x7F, 0x08, 0x04, 0x04, 0x78, - 0x00, 0x44, 0x7D, 0x40, 0x00, - 0x20, 0x40, 0x40, 0x3D, 0x00, - 0x7F, 0x10, 0x28, 0x44, 0x00, - 0x00, 0x41, 0x7F, 0x40, 0x00, - 0x7C, 0x04, 0x78, 0x04, 0x78, - 0x7C, 0x08, 0x04, 0x04, 0x78, - 0x38, 0x44, 0x44, 0x44, 0x38, - 0xFC, 0x18, 0x24, 0x24, 0x18, - 0x18, 0x24, 0x24, 0x18, 0xFC, - 0x7C, 0x08, 0x04, 0x04, 0x08, - 0x48, 0x54, 0x54, 0x54, 0x24, - 0x04, 0x04, 0x3F, 0x44, 0x24, - 0x3C, 0x40, 0x40, 0x20, 0x7C, - 0x1C, 0x20, 0x40, 0x20, 0x1C, - 0x3C, 0x40, 0x30, 0x40, 0x3C, - 0x44, 0x28, 0x10, 0x28, 0x44, - 0x4C, 0x90, 0x90, 0x90, 0x7C, - 0x44, 0x64, 0x54, 0x4C, 0x44, - 0x00, 0x08, 0x36, 0x41, 0x00, - 0x00, 0x00, 0x77, 0x00, 0x00, - 0x00, 0x41, 0x36, 0x08, 0x00, - 0x02, 0x01, 0x02, 0x04, 0x02, - 0x3C, 0x26, 0x23, 0x26, 0x3C, - 0x1E, 0xA1, 0xA1, 0x61, 0x12, - 0x3A, 0x40, 0x40, 0x20, 0x7A, - 0x38, 0x54, 0x54, 0x55, 0x59, - 0x21, 0x55, 0x55, 0x79, 0x41, - 0x22, 0x54, 0x54, 0x78, 0x42, // a-umlaut - 0x21, 0x55, 0x54, 0x78, 0x40, - 0x20, 0x54, 0x55, 0x79, 0x40, - 0x0C, 0x1E, 0x52, 0x72, 0x12, - 0x39, 0x55, 0x55, 0x55, 0x59, - 0x39, 0x54, 0x54, 0x54, 0x59, - 0x39, 0x55, 0x54, 0x54, 0x58, - 0x00, 0x00, 0x45, 0x7C, 0x41, - 0x00, 0x02, 0x45, 0x7D, 0x42, - 0x00, 0x01, 0x45, 0x7C, 0x40, - 0x7D, 0x12, 0x11, 0x12, 0x7D, // A-umlaut - 0xF0, 0x28, 0x25, 0x28, 0xF0, - 0x7C, 0x54, 0x55, 0x45, 0x00, - 0x20, 0x54, 0x54, 0x7C, 0x54, - 0x7C, 0x0A, 0x09, 0x7F, 0x49, - 0x32, 0x49, 0x49, 0x49, 0x32, - 0x3A, 0x44, 0x44, 0x44, 0x3A, // o-umlaut - 0x32, 0x4A, 0x48, 0x48, 0x30, - 0x3A, 0x41, 0x41, 0x21, 0x7A, - 0x3A, 0x42, 0x40, 0x20, 0x78, - 0x00, 0x9D, 0xA0, 0xA0, 0x7D, - 0x3D, 0x42, 0x42, 0x42, 0x3D, // O-umlaut - 0x3D, 0x40, 0x40, 0x40, 0x3D, - 0x3C, 0x24, 0xFF, 0x24, 0x24, - 0x48, 0x7E, 0x49, 0x43, 0x66, - 0x2B, 0x2F, 0xFC, 0x2F, 0x2B, - 0xFF, 0x09, 0x29, 0xF6, 0x20, - 0xC0, 0x88, 0x7E, 0x09, 0x03, - 0x20, 0x54, 0x54, 0x79, 0x41, - 0x00, 0x00, 0x44, 0x7D, 0x41, - 0x30, 0x48, 0x48, 0x4A, 0x32, - 0x38, 0x40, 0x40, 0x22, 0x7A, - 0x00, 0x7A, 0x0A, 0x0A, 0x72, - 0x7D, 0x0D, 0x19, 0x31, 0x7D, - 0x26, 0x29, 0x29, 0x2F, 0x28, - 0x26, 0x29, 0x29, 0x29, 0x26, - 0x30, 0x48, 0x4D, 0x40, 0x20, - 0x38, 0x08, 0x08, 0x08, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x38, - 0x2F, 0x10, 0xC8, 0xAC, 0xBA, - 0x2F, 0x10, 0x28, 0x34, 0xFA, - 0x00, 0x00, 0x7B, 0x00, 0x00, - 0x08, 0x14, 0x2A, 0x14, 0x22, - 0x22, 0x14, 0x2A, 0x14, 0x08, - 0x55, 0x00, 0x55, 0x00, 0x55, // #176 (25% block) missing in old code - 0xAA, 0x55, 0xAA, 0x55, 0xAA, // 50% block - 0xFF, 0x55, 0xFF, 0x55, 0xFF, // 75% block - 0x00, 0x00, 0x00, 0xFF, 0x00, - 0x10, 0x10, 0x10, 0xFF, 0x00, - 0x14, 0x14, 0x14, 0xFF, 0x00, - 0x10, 0x10, 0xFF, 0x00, 0xFF, - 0x10, 0x10, 0xF0, 0x10, 0xF0, - 0x14, 0x14, 0x14, 0xFC, 0x00, - 0x14, 0x14, 0xF7, 0x00, 0xFF, - 0x00, 0x00, 0xFF, 0x00, 0xFF, - 0x14, 0x14, 0xF4, 0x04, 0xFC, - 0x14, 0x14, 0x17, 0x10, 0x1F, - 0x10, 0x10, 0x1F, 0x10, 0x1F, - 0x14, 0x14, 0x14, 0x1F, 0x00, - 0x10, 0x10, 0x10, 0xF0, 0x00, - 0x00, 0x00, 0x00, 0x1F, 0x10, - 0x10, 0x10, 0x10, 0x1F, 0x10, - 0x10, 0x10, 0x10, 0xF0, 0x10, - 0x00, 0x00, 0x00, 0xFF, 0x10, - 0x10, 0x10, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0xFF, 0x10, - 0x00, 0x00, 0x00, 0xFF, 0x14, - 0x00, 0x00, 0xFF, 0x00, 0xFF, - 0x00, 0x00, 0x1F, 0x10, 0x17, - 0x00, 0x00, 0xFC, 0x04, 0xF4, - 0x14, 0x14, 0x17, 0x10, 0x17, - 0x14, 0x14, 0xF4, 0x04, 0xF4, - 0x00, 0x00, 0xFF, 0x00, 0xF7, - 0x14, 0x14, 0x14, 0x14, 0x14, - 0x14, 0x14, 0xF7, 0x00, 0xF7, - 0x14, 0x14, 0x14, 0x17, 0x14, - 0x10, 0x10, 0x1F, 0x10, 0x1F, - 0x14, 0x14, 0x14, 0xF4, 0x14, - 0x10, 0x10, 0xF0, 0x10, 0xF0, - 0x00, 0x00, 0x1F, 0x10, 0x1F, - 0x00, 0x00, 0x00, 0x1F, 0x14, - 0x00, 0x00, 0x00, 0xFC, 0x14, - 0x00, 0x00, 0xF0, 0x10, 0xF0, - 0x10, 0x10, 0xFF, 0x10, 0xFF, - 0x14, 0x14, 0x14, 0xFF, 0x14, - 0x10, 0x10, 0x10, 0x1F, 0x00, - 0x00, 0x00, 0x00, 0xF0, 0x10, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, - 0xFF, 0xFF, 0xFF, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xFF, 0xFF, - 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, - 0x38, 0x44, 0x44, 0x38, 0x44, - 0xFC, 0x4A, 0x4A, 0x4A, 0x34, // sharp-s or beta - 0x7E, 0x02, 0x02, 0x06, 0x06, - 0x02, 0x7E, 0x02, 0x7E, 0x02, - 0x63, 0x55, 0x49, 0x41, 0x63, - 0x38, 0x44, 0x44, 0x3C, 0x04, - 0x40, 0x7E, 0x20, 0x1E, 0x20, - 0x06, 0x02, 0x7E, 0x02, 0x02, - 0x99, 0xA5, 0xE7, 0xA5, 0x99, - 0x1C, 0x2A, 0x49, 0x2A, 0x1C, - 0x4C, 0x72, 0x01, 0x72, 0x4C, - 0x30, 0x4A, 0x4D, 0x4D, 0x30, - 0x30, 0x48, 0x78, 0x48, 0x30, - 0xBC, 0x62, 0x5A, 0x46, 0x3D, - 0x3E, 0x49, 0x49, 0x49, 0x00, - 0x7E, 0x01, 0x01, 0x01, 0x7E, - 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, - 0x44, 0x44, 0x5F, 0x44, 0x44, - 0x40, 0x51, 0x4A, 0x44, 0x40, - 0x40, 0x44, 0x4A, 0x51, 0x40, - 0x00, 0x00, 0xFF, 0x01, 0x03, - 0xE0, 0x80, 0xFF, 0x00, 0x00, - 0x08, 0x08, 0x6B, 0x6B, 0x08, - 0x36, 0x12, 0x36, 0x24, 0x36, - 0x06, 0x0F, 0x09, 0x0F, 0x06, - 0x00, 0x00, 0x18, 0x18, 0x00, - 0x00, 0x00, 0x10, 0x10, 0x00, - 0x30, 0x40, 0xFF, 0x01, 0x01, - 0x00, 0x1F, 0x01, 0x01, 0x1E, - 0x00, 0x19, 0x1D, 0x17, 0x12, - 0x00, 0x3C, 0x3C, 0x3C, 0x3C, - 0x00, 0x00, 0x00, 0x00, 0x00 // #255 NBSP -}; - - -#endif \ No newline at end of file diff --git a/rtos/pmsis/pmsis_bsp/docs/Makefile b/rtos/pmsis/pmsis_bsp/docs/Makefile deleted file mode 100644 index d4bb2cbb..00000000 --- a/rtos/pmsis/pmsis_bsp/docs/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build -SOURCEDIR = . -BUILDDIR = _build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/rtos/pmsis/pmsis_bsp/docs/ble.rst b/rtos/pmsis/pmsis_bsp/docs/ble.rst deleted file mode 100644 index 583b64c1..00000000 --- a/rtos/pmsis/pmsis_bsp/docs/ble.rst +++ /dev/null @@ -1,10 +0,0 @@ -BLE ---- - -BLE -... - -.. doxygengroup:: BLE - :members: - :private-members: - :protected-members: diff --git a/rtos/pmsis/pmsis_bsp/docs/camera.rst b/rtos/pmsis/pmsis_bsp/docs/camera.rst deleted file mode 100644 index 2646280d..00000000 --- a/rtos/pmsis/pmsis_bsp/docs/camera.rst +++ /dev/null @@ -1,26 +0,0 @@ -Camera ------- - -Common API -.......... - -.. doxygengroup:: Camera - :members: - :private-members: - :protected-members: - -Himax -..... - -.. doxygengroup:: Himax - :members: - :private-members: - :protected-members: - -Mt9v034 -....... - -.. doxygengroup:: Mt9v - :members: - :private-members: - :protected-members: diff --git a/rtos/pmsis/pmsis_bsp/docs/conf.py b/rtos/pmsis/pmsis_bsp/docs/conf.py deleted file mode 100644 index 488573e1..00000000 --- a/rtos/pmsis/pmsis_bsp/docs/conf.py +++ /dev/null @@ -1,62 +0,0 @@ -# Configuration file for the Sphinx documentation builder. -# -# This file only contains a selection of the most common options. For a full -# list see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# -- Path setup -------------------------------------------------------------- - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# -# import os -# import sys -# sys.path.insert(0, os.path.abspath('.')) - -import subprocess, os - -subprocess.call('make -f dox.mk clean all', shell=True) - -# -- Project information ----------------------------------------------------- - -project = 'PMSIS BSP' -copyright = '2019, GreenWaves Technologies' -author = 'GreenWaves Technologies' - - -# -- General configuration --------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - 'breathe', - 'recommonmark' -] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] - - -# -- Options for HTML output ------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -html_theme = 'sphinx_rtd_theme' - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - -breathe_projects = { "pmsis_bsp": "doc/xml" } - -breathe_default_project = "pmsis_bsp" - diff --git a/rtos/pmsis/pmsis_bsp/docs/display.rst b/rtos/pmsis/pmsis_bsp/docs/display.rst deleted file mode 100644 index 8bee5982..00000000 --- a/rtos/pmsis/pmsis_bsp/docs/display.rst +++ /dev/null @@ -1,10 +0,0 @@ -Display -------- - -Display -....... - -.. doxygengroup:: Display - :members: - :private-members: - :protected-members: diff --git a/rtos/pmsis/pmsis_bsp/docs/dox.mk b/rtos/pmsis/pmsis_bsp/docs/dox.mk deleted file mode 100644 index 986ab88f..00000000 --- a/rtos/pmsis/pmsis_bsp/docs/dox.mk +++ /dev/null @@ -1,10 +0,0 @@ -CHIP ?= gap8 - -clean: - rm -rf ./doc - rm -rf pmsis.html - -all: - cat pmsis.dxy.in | sed s/@CHIP_CONFIG@/$(CHIP)/ > pmsis.dxy - doxygen pmsis.dxy - ln -s ${CURDIR}/doc/html/index.html pmsis.html diff --git a/rtos/pmsis/pmsis_bsp/docs/flash.rst b/rtos/pmsis/pmsis_bsp/docs/flash.rst deleted file mode 100644 index 59369e88..00000000 --- a/rtos/pmsis/pmsis_bsp/docs/flash.rst +++ /dev/null @@ -1,18 +0,0 @@ -Flash ------ - -Common API -.......... - -.. doxygengroup:: Flash - :members: - :private-members: - :protected-members: - -Hyperflash -.......... - -.. doxygengroup:: Hyperflash - :members: - :private-members: - :protected-members: diff --git a/rtos/pmsis/pmsis_bsp/docs/fs.rst b/rtos/pmsis/pmsis_bsp/docs/fs.rst deleted file mode 100644 index 269dea19..00000000 --- a/rtos/pmsis/pmsis_bsp/docs/fs.rst +++ /dev/null @@ -1,7 +0,0 @@ -FS --- - -.. doxygengroup:: FS - :members: - :private-members: - :protected-members: diff --git a/rtos/pmsis/pmsis_bsp/docs/headers/groups.h b/rtos/pmsis/pmsis_bsp/docs/headers/groups.h deleted file mode 100755 index e69de29b..00000000 diff --git a/rtos/pmsis/pmsis_bsp/docs/index.rst b/rtos/pmsis/pmsis_bsp/docs/index.rst deleted file mode 100644 index e644087e..00000000 --- a/rtos/pmsis/pmsis_bsp/docs/index.rst +++ /dev/null @@ -1,22 +0,0 @@ -PMSIS BSP documentation -======================= - -.. include:: mainpage.md - -.. toctree:: - :maxdepth: 2 - :caption: Drivers: - - ram - flash - camera - fs - ble - display - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/rtos/pmsis/pmsis_bsp/docs/mainpage.md b/rtos/pmsis/pmsis_bsp/docs/mainpage.md deleted file mode 100644 index 564457b5..00000000 --- a/rtos/pmsis/pmsis_bsp/docs/mainpage.md +++ /dev/null @@ -1,21 +0,0 @@ -Introduction -============ - -The PMSIS BSP is a set of high level-drivers written on top of the PMSIS API, which makes them available on any operating system which implements the PMSIS API. - -Conventions -=========== - -All functions prefixed by `pi_` can only be called from fabric-controller side while the ones prefixed by `pi_cl_` can only be called from cluster side. Any exception to these rules is documented where it applies. - -All functions on fabric-controller side are by default synchronous and are blocking the caller until the operation is done. All the functions suffixed by `_async` are asynchronous and are not blocking the caller. The termination of such operations is managed with a `pi_task_t` object, see PMSIS API documentation for more information. - -Functions on cluster-side are by default synchronous but can also be asynchronous if the documentation of the function mentions it. - -Chip-specific information -========================= - -GAP8 ----- - -All functions transferring data between an external device and a chip memory must use the L2 memory for the chip memory. \ No newline at end of file diff --git a/rtos/pmsis/pmsis_bsp/docs/make.bat b/rtos/pmsis/pmsis_bsp/docs/make.bat deleted file mode 100644 index 2119f510..00000000 --- a/rtos/pmsis/pmsis_bsp/docs/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=. -set BUILDDIR=_build - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/rtos/pmsis/pmsis_bsp/docs/pmsis.dxy.in b/rtos/pmsis/pmsis_bsp/docs/pmsis.dxy.in deleted file mode 100755 index 8ad213b0..00000000 --- a/rtos/pmsis/pmsis_bsp/docs/pmsis.dxy.in +++ /dev/null @@ -1,2361 +0,0 @@ -# Doxyfile 1.8.6 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a double hash (##) is considered a comment and is placed in -# front of the TAG it is preceding. -# -# All text after a single hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists, items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (\" \"). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. -# The default value is: UTF-8. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by -# double-quotes, unless you are using Doxywizard) that should identify the -# project for which the documentation is generated. This name is used in the -# title of most generated pages and in a few other places. -# The default value is: My Project. - -PROJECT_NAME = PMSIS BSP - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. This -# could be handy for archiving the generated documentation or if some version -# control system is used. - -PROJECT_NUMBER = "Version 0.1" - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer a -# quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = "PMSIS BSP" - -# With the PROJECT_LOGO tag one can specify an logo or icon that is included in -# the documentation. The maximum height of the logo should not exceed 55 pixels -# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo -# to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path -# into which the generated documentation will be written. If a relative path is -# entered, it will be relative to the location where doxygen was started. If -# left blank the current directory will be used. - -OUTPUT_DIRECTORY = doc - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this -# option can be useful when feeding doxygen a huge amount of source files, where -# putting all generated files in the same directory would otherwise causes -# performance problems for the file system. -# The default value is: NO. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), -# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, -# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, -# Ukrainian and Vietnamese. -# The default value is: English. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member -# descriptions after the members that are listed in the file and class -# documentation (similar to Javadoc). Set to NO to disable this. -# The default value is: YES. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief -# description of a member or function before the detailed description -# -# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. -# The default value is: YES. - -REPEAT_BRIEF = NO - -# This tag implements a quasi-intelligent brief description abbreviator that is -# used to form the text in various listings. Each string in this list, if found -# as the leading text of the brief description, will be stripped from the text -# and the result, after processing the whole list, is used as the annotated -# text. Otherwise, the brief description is used as-is. If left blank, the -# following values are used ($name is automatically replaced with the name of -# the entity):The $name class, The $name widget, The $name file, is, provides, -# specifies, contains, represents, a, an and the. - -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# doxygen will generate a detailed section even if there is only a brief -# description. -# The default value is: NO. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. -# The default value is: NO. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path -# before files name in the file list and in the header files. If set to NO the -# shortest path that makes the file name unique will be used -# The default value is: YES. - -FULL_PATH_NAMES = NO - -# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. -# Stripping is only done if one of the specified strings matches the left-hand -# part of the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the path to -# strip. -# -# Note that you can specify absolute paths here, but also relative paths, which -# will be relative from the directory where doxygen is started. -# This tag requires that the tag FULL_PATH_NAMES is set to YES. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the -# path mentioned in the documentation of a class, which tells the reader which -# header file to include in order to use a class. If left blank only the name of -# the header file containing the class definition is used. Otherwise one should -# specify the list of include paths that are normally passed to the compiler -# using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but -# less readable) file names. This can be useful is your file systems doesn't -# support long names like on DOS, Mac, or CD-ROM. -# The default value is: NO. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the -# first line (until the first dot) of a Javadoc-style comment as the brief -# description. If set to NO, the Javadoc-style will behave just like regular Qt- -# style comments (thus requiring an explicit @brief command for a brief -# description.) -# The default value is: NO. - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first -# line (until the first dot) of a Qt-style comment as the brief description. If -# set to NO, the Qt-style will behave just like regular Qt-style comments (thus -# requiring an explicit \brief command for a brief description.) -# The default value is: NO. - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a -# multi-line C++ special comment block (i.e. a block of //! or /// comments) as -# a brief description. This used to be the default behavior. The new default is -# to treat a multi-line C++ comment block as a detailed description. Set this -# tag to YES if you prefer the old behavior instead. -# -# Note that setting this tag to YES also means that rational rose comments are -# not recognized any more. -# The default value is: NO. - -MULTILINE_CPP_IS_BRIEF = YES - -# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the -# documentation from any documented member that it re-implements. -# The default value is: YES. - -INHERIT_DOCS = NO - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a -# new page for each member. If set to NO, the documentation of a member will be -# part of the file/class/namespace that contains it. -# The default value is: NO. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen -# uses this value to replace tabs by spaces in code fragments. -# Minimum value: 1, maximum value: 16, default value: 4. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that act as commands in -# the documentation. An alias has the form: -# name=value -# For example adding -# "sideeffect=@par Side Effects:\n" -# will allow you to put the command \sideeffect (or @sideeffect) in the -# documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. - -ALIASES = - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. For -# instance, some of the names that are used will be different. The list of all -# members will be omitted, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or -# Python sources only. Doxygen will then generate output that is more tailored -# for that language. For instance, namespaces will be presented as packages, -# qualified scopes will look different, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources. Doxygen will then generate output that is tailored for Fortran. -# The default value is: NO. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for VHDL. -# The default value is: NO. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. -# -# Note For files without extension you can use no_extension as a placeholder. -# -# Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments -# according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you can -# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in -# case of backward compatibilities issues. -# The default value is: YES. - -MARKDOWN_SUPPORT = YES - -# When enabled doxygen tries to link words that correspond to documented -# classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by by putting a % sign in front of the word -# or globally by setting AUTOLINK_SUPPORT to NO. -# The default value is: YES. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should set this -# tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); -# versus func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. -# The default value is: NO. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. -# The default value is: NO. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen -# will parse them like normal C++ but will assume all classes use public instead -# of private inheritance when no explicit protection keyword is present. -# The default value is: NO. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate -# getter and setter methods for a property. Setting this option to YES will make -# doxygen to replace the get and set methods by a property in the documentation. -# This will only work if the methods are indeed getting or setting a simple -# type. If this is not the case, or you want to show the methods anyway, you -# should set this option to NO. -# The default value is: YES. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. -# The default value is: NO. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES to allow class member groups of the same type -# (for instance a group of public functions) to be put as a subgroup of that -# type (e.g. under the Public Functions section). Set it to NO to prevent -# subgrouping. Alternatively, this can be done per class using the -# \nosubgrouping command. -# The default value is: YES. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions -# are shown inside the group in which they are included (e.g. using \ingroup) -# instead of on a separate page (for HTML and Man pages) or section (for LaTeX -# and RTF). -# -# Note that this feature does not work in combination with -# SEPARATE_MEMBER_PAGES. -# The default value is: NO. - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions -# with only public data fields or simple typedef fields will be shown inline in -# the documentation of the scope in which they are defined (i.e. file, -# namespace, or group documentation), provided this scope is documented. If set -# to NO, structs, classes, and unions are shown on a separate page (for HTML and -# Man pages) or section (for LaTeX and RTF). -# The default value is: NO. - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or -# enum is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically be -# useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. -# The default value is: NO. - -TYPEDEF_HIDES_STRUCT = YES - -# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This -# cache is used to resolve symbols given their name and scope. Since this can be -# an expensive process and often the same symbol appears multiple times in the -# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small -# doxygen will become slower. If the cache is too large, memory is wasted. The -# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range -# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 -# symbols. At the end of a run doxygen will report the cache usage and suggest -# the optimal cache size from a speed point of view. -# Minimum value: 0, maximum value: 9, default value: 0. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. Private -# class members and static file members will be hidden unless the -# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. -# Note: This will also disable the warnings about undocumented members that are -# normally produced when WARNINGS is set to YES. -# The default value is: NO. - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will -# be included in the documentation. -# The default value is: NO. - -EXTRACT_PRIVATE = YES - -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal -# scope will be included in the documentation. -# The default value is: NO. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file will be -# included in the documentation. -# The default value is: NO. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO -# only classes defined in header files are included. Does not have any effect -# for Java sources. -# The default value is: YES. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local methods, -# which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO only methods in the interface are -# included. -# The default value is: NO. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base name of -# the file that contains the anonymous namespace. By default anonymous namespace -# are hidden. -# The default value is: NO. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all -# undocumented members inside documented classes or files. If set to NO these -# members will be included in the various overviews, but no documentation -# section is generated. This option has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. If set -# to NO these classes will be included in the various overviews. This option has -# no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO these declarations will be -# included in the documentation. -# The default value is: NO. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO these -# blocks will be appended to the function's detailed documentation block. -# The default value is: NO. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation that is typed after a -# \internal command is included. If the tag is set to NO then the documentation -# will be excluded. Set it to YES to include the internal documentation. -# The default value is: NO. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. -# The default value is: system dependent. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES the -# scope will be hidden. -# The default value is: NO. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of -# the files that are included by a file in the documentation of that file. -# The default value is: YES. - -SHOW_INCLUDE_FILES = NO - - -SHOW_GROUPED_MEMB_INC = NO - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include -# files with double quotes in the documentation rather than with sharp brackets. -# The default value is: NO. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the -# documentation for inline members. -# The default value is: YES. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the -# (detailed) documentation of file and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. -# The default value is: YES. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief -# descriptions of file, namespace and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. Note that -# this will also influence the order of the classes in the class list. -# The default value is: NO. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the -# (brief and detailed) documentation of class members so that constructors and -# destructors are listed first. If set to NO the constructors will appear in the -# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. -# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief -# member documentation. -# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting -# detailed member documentation. -# The default value is: NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy -# of group names into alphabetical order. If set to NO the group names will -# appear in their defined order. -# The default value is: NO. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by -# fully-qualified names, including namespaces. If set to NO, the class list will -# be sorted only by class name, not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the alphabetical -# list. -# The default value is: NO. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper -# type resolution of all parameters of a function it will reject a match between -# the prototype and the implementation of a member function even if there is -# only one candidate or it is obvious which candidate to choose by doing a -# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still -# accept a match between prototype and implementation in such cases. -# The default value is: NO. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the -# todo list. This list is created by putting \todo commands in the -# documentation. -# The default value is: YES. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the -# test list. This list is created by putting \test commands in the -# documentation. -# The default value is: YES. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug -# list. This list is created by putting \bug commands in the documentation. -# The default value is: YES. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) -# the deprecated list. This list is created by putting \deprecated commands in -# the documentation. -# The default value is: YES. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional documentation -# sections, marked by \if ... \endif and \cond -# ... \endcond blocks. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the -# initial value of a variable or macro / define can have for it to appear in the -# documentation. If the initializer consists of more lines than specified here -# it will be hidden. Use a value of 0 to hide initializers completely. The -# appearance of the value of individual variables and macros / defines can be -# controlled using \showinitializer or \hideinitializer command in the -# documentation regardless of this setting. -# Minimum value: 0, maximum value: 10000, default value: 30. - -MAX_INITIALIZER_LINES = 0 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES the list -# will mention the files that were used to generate the documentation. -# The default value is: YES. - -SHOW_USED_FILES = NO - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This -# will remove the Files entry from the Quick Index and from the Folder Tree View -# (if specified). -# The default value is: YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces -# page. This will remove the Namespaces entry from the Quick Index and from the -# Folder Tree View (if specified). -# The default value is: YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command command input-file, where command is the value of the -# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided -# by doxygen. Whatever the program writes to standard output is used as the file -# version. For an example see the documentation. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. You can -# optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. -# -# Note that if you run doxygen from a directory containing a file called -# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE -# tag is left empty. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files containing -# the reference definitions. This must be a list of .bib files. The .bib -# extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. -# For LaTeX the style of the bibliography can be controlled using -# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. Do not use file names with spaces, bibtex cannot handle them. See -# also \cite for info how to create references. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# Configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated to -# standard output by doxygen. If QUIET is set to YES this implies that the -# messages are off. -# The default value is: NO. - -QUIET = YES - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES -# this implies that the warnings are on. -# -# Tip: Turn warnings on while writing the documentation. -# The default value is: YES. - -WARNINGS = YES - -# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate -# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag -# will automatically be disabled. -# The default value is: YES. - -WARN_IF_UNDOCUMENTED = YES - -# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some parameters -# in a documented function, or documenting parameters that don't exist or using -# markup commands wrongly. -# The default value is: YES. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that -# are documented, but have no documentation for their parameters or return -# value. If set to NO doxygen will only warn about wrong or incomplete parameter -# documentation, but not about the absence of documentation. -# The default value is: NO. - -WARN_NO_PARAMDOC = YES - -# The WARN_FORMAT tag determines the format of the warning messages that doxygen -# can produce. The string should contain the $file, $line, and $text tags, which -# will be replaced by the file and line number from which the warning originated -# and the warning text. Optionally the format may contain $version, which will -# be replaced by the version of the file (if it could be obtained via -# FILE_VERSION_FILTER) -# The default value is: $file:$line: $text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning and error -# messages should be written. If left blank the output is written to standard -# error (stderr). - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# Configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag is used to specify the files and/or directories that contain -# documented source files. You may enter file names like myfile.cpp or -# directories like /usr/src/myproject. Separate the files or directories with -# spaces. -# Note: If this tag is empty the current directory is searched. - -INPUT = mainpage.md \ - ../include/bsp/fs.h \ - ../include/bsp/camera.h \ - ../include/bsp/camera/himax.h \ - ../include/bsp/camera/mt9v034.h \ - ../include/bsp/ram/hyperram.h \ - ../include/bsp/ram.h \ - ../include/bsp/flash/hyperflash.h \ - ../include/bsp/flash.h \ - ../include/bsp/ble/nina_b112/nina_b112.h \ - ../include/bsp/display.h \ - ../include/bsp/display/ili9341.h \ - ../include/bsp/partition.h \ - headers - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses -# libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of -# possible encodings. -# The default value is: UTF-8. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank the -# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, -# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, -# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, -# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, -# *.qsf, *.as and *.js. - -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.d \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.idl \ - *.odl \ - *.cs \ - *.php \ - *.php3 \ - *.inc \ - *.m \ - *.mm \ - *.dox \ - *.py \ - *.f90 \ - *.f \ - *.for \ - *.vhd \ - *.vhdl \ - *.txt - -# The RECURSIVE tag can be used to specify whether or not subdirectories should -# be searched for input files as well. -# The default value is: NO. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = math_helper.* - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. -# The default value is: NO. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories for example use the pattern */test/* - -EXCLUDE_PATTERNS = */RTE/* - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories use the pattern */test/* - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or directories -# that contain example code fragments that are included (see the \include -# command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank all -# files are included. - -EXAMPLE_PATTERNS = * - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude commands -# irrespective of the value of the RECURSIVE tag. -# The default value is: NO. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or directories -# that contain images that are to be included in the documentation (see the -# \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command: -# -# -# -# where is the value of the INPUT_FILTER tag, and is the -# name of an input file. Doxygen will then use the output that the filter -# program writes to standard output. If FILTER_PATTERNS is specified, this tag -# will be ignored. -# -# Note that the filter must not add or remove lines; it is applied before the -# code is scanned, but not when the output code is generated. If lines are added -# or removed, the anchors will not be placed correctly. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: pattern=filter -# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how -# filters are used. If the FILTER_PATTERNS tag is empty or if none of the -# patterns match the file name, INPUT_FILTER is applied. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER ) will also be used to filter the input files that are used for -# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). -# The default value is: NO. - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and -# it is also possible to disable source filtering for a specific pattern using -# *.ext= (so without naming a filter). -# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. - -FILTER_SOURCE_PATTERNS = - -# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that -# is part of the input, its contents will be placed on the main page -# (index.html). This can be useful if you have a project on for instance GitHub -# and want to reuse the introduction page also for the doxygen output. - -USE_MDFILE_AS_MAINPAGE = mainpage.md - -#--------------------------------------------------------------------------- -# Configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will be -# generated. Documented entities will be cross-referenced with these sources. -# -# Note: To get rid of all source code in the generated output, make sure that -# also VERBATIM_HEADERS is set to NO. -# The default value is: NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body of functions, -# classes and enums directly into the documentation. -# The default value is: NO. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any -# special comment blocks from generated source code fragments. Normal C, C++ and -# Fortran comments will always remain visible. -# The default value is: YES. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. -# The default value is: NO. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES then for each documented function -# all documented entities called/used by that function will be listed. -# The default value is: NO. - -REFERENCES_RELATION = YES - -# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES, then the hyperlinks from functions in REFERENCES_RELATION and -# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will -# link to the documentation. -# The default value is: YES. - -REFERENCES_LINK_SOURCE = NO - -# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the -# source code will show a tooltip with additional information such as prototype, -# brief description and links to the definition and documentation. Since this -# will make the HTML file larger and loading of large files a bit slower, you -# can opt to disable this feature. -# The default value is: YES. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -SOURCE_TOOLTIPS = YES - -# If the USE_HTAGS tag is set to YES then the references to source code will -# point to the HTML generated by the htags(1) tool instead of doxygen built-in -# source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version -# 4.8.6 or higher. -# -# To use it do the following: -# - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file -# - Make sure the INPUT points to the root of the source tree -# - Run doxygen as normal -# -# Doxygen will invoke htags (and that will in turn invoke gtags), so these -# tools must be available from the command line (i.e. in the search path). -# -# The result: instead of the source browser generated by doxygen, the links to -# source code will now point to the output of htags. -# The default value is: NO. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a -# verbatim copy of the header file for each class for which an include is -# specified. Set to NO to disable this. -# See also: Section \class. -# The default value is: YES. - -VERBATIM_HEADERS = NO - -# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the -# clang parser (see: http://clang.llvm.org/) for more acurate parsing at the -# cost of reduced performance. This can be particularly helpful with template -# rich C++ code for which doxygen's built-in parser lacks the necessary type -# information. -# Note: The availability of this option depends on whether or not doxygen was -# compiled with the --with-libclang option. -# The default value is: NO. - -CLANG_ASSISTED_PARSING = NO - -# If clang assisted parsing is enabled you can provide the compiler with command -# line options that you would normally use when invoking the compiler. Note that -# the include paths will already be set by doxygen for the files and directories -# specified with INPUT and INCLUDE_PATH. -# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. - -CLANG_OPTIONS = - -#--------------------------------------------------------------------------- -# Configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all -# compounds will be generated. Enable this if the project contains a lot of -# classes, structs, unions or interfaces. -# The default value is: YES. - -ALPHABETICAL_INDEX = NO - -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all classes will -# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag -# can be used to specify a prefix (or a list of prefixes) that should be ignored -# while generating the index headers. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -IGNORE_PREFIX = ignore_ - -#--------------------------------------------------------------------------- -# Configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output -# The default value is: YES. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each -# generated HTML page (for example: .htm, .php, .asp). -# The default value is: .html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a user-defined HTML header file for -# each generated HTML page. If the tag is left blank doxygen will generate a -# standard header. -# -# To get valid HTML the header file that includes any scripts and style sheets -# that doxygen needs, which is dependent on the configuration options used (e.g. -# the setting GENERATE_TREEVIEW). It is highly recommended to start with a -# default header using -# doxygen -w html new_header.html new_footer.html new_stylesheet.css -# YourConfigFile -# and then modify the file new_header.html. See also section "Doxygen usage" -# for information on how to generate the default header that doxygen normally -# uses. -# Note: The header is subject to change so you typically have to regenerate the -# default header when upgrading to a newer version of doxygen. For a description -# of the possible markers and block names see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each -# generated HTML page. If the tag is left blank doxygen will generate a standard -# footer. See HTML_HEADER for more information on how to generate a default -# footer and what special commands can be used inside the footer. See also -# section "Doxygen usage" for information on how to generate the default footer -# that doxygen normally uses. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style -# sheet that is used by each HTML page. It can be used to fine-tune the look of -# the HTML output. If left blank doxygen will generate a default style sheet. -# See also section "Doxygen usage" for information on how to generate the style -# sheet that doxygen normally uses. -# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as -# it is more robust and this tag (HTML_STYLESHEET) will in the future become -# obsolete. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_STYLESHEET = - -# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- -# defined cascading style sheet that is included after the standard style sheets -# created by doxygen. Using this option one can overrule certain style aspects. -# This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefor more robust against future updates. -# Doxygen will copy the style sheet file to the output directory. For an example -# see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that the -# files will be copied as-is; there are no commands or markers available. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the stylesheet and background images according to -# this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value -# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 -# purple, and 360 is red again. -# Minimum value: 0, maximum value: 359, default value: 220. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use grayscales only. A -# value of 255 will produce the most vivid colors. -# Minimum value: 0, maximum value: 255, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the -# luminance component of the colors in the HTML output. Values below 100 -# gradually make the output lighter, whereas values above 100 make the output -# darker. The value divided by 100 is the actual gamma applied, so 80 represents -# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not -# change the gamma. -# Minimum value: 40, maximum value: 240, default value: 80. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_TIMESTAMP = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries -# shown in the various tree structured indices initially; the user can expand -# and collapse entries dynamically later on. Doxygen will expand the tree to -# such a level that at most the specified number of entries are visible (unless -# a fully collapsed tree already exceeds this amount). So setting the number of -# entries 1 will produce a full collapsed tree by default. 0 is a special value -# representing an infinite number of entries and will result in a full expanded -# tree by default. -# Minimum value: 0, maximum value: 9999, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files will be -# generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_DOCSET = NO - -# This tag determines the name of the docset feed. A documentation feed provides -# an umbrella under which multiple documentation sets from a single provider -# (such as a company or product suite) can be grouped. -# The default value is: Doxygen generated docs. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# This tag specifies a string that should uniquely identify the documentation -# set bundle. This should be a reverse domain-name style string, e.g. -# com.mycompany.MyDocSet. Doxygen will append .docset to the name. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. -# The default value is: org.doxygen.Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. -# The default value is: Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three -# additional HTML index files: index.hhp, index.hhc, and index.hhk. The -# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. -# -# The HTML Help Workshop contains a compiler that can convert all HTML output -# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML -# files are now used as the Windows 98 help format, and will replace the old -# Windows help format (.hlp) on all Windows platforms in the future. Compressed -# HTML files also contain an index, a table of contents, and you can search for -# words in the documentation. The HTML workshop also contains a viewer for -# compressed HTML files. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_HTMLHELP = NO - -# The CHM_FILE tag can be used to specify the file name of the resulting .chm -# file. You can add a path in front of the file if the result should not be -# written to the html output directory. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_FILE = - -# The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler ( hhc.exe). If non-empty -# doxygen will try to run the HTML help compiler on the generated index.hhp. -# The file has to be specified with full path. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -HHC_LOCATION = - -# The GENERATE_CHI flag controls if a separate .chi index file is generated ( -# YES) or that it should be included in the master .chm file ( NO). -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -GENERATE_CHI = NO - -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) -# and project file content. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_INDEX_ENCODING = - -# The BINARY_TOC flag controls whether a binary table of contents is generated ( -# YES) or a normal table of contents ( NO) in the .chm file. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members to -# the table of contents of the HTML help documentation and to the tree view. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that -# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help -# (.qch) of the generated HTML documentation. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify -# the file name of the resulting .qch file. The path specified is relative to -# the HTML output folder. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help -# Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt -# Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- -# folders). -# The default value is: doc. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_VIRTUAL_FOLDER = doc - -# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom -# filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_SECT_FILTER_ATTRS = - -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be -# generated, together with the HTML files, they form an Eclipse help plugin. To -# install this plugin and make it available under the help contents menu in -# Eclipse, the contents of the directory containing the HTML and XML files needs -# to be copied into the plugins directory of eclipse. The name of the directory -# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. -# After copying Eclipse needs to be restarted before the help appears. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the Eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have this -# name. Each documentation set should have its own identifier. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# If you want full control over the layout of the generated HTML pages it might -# be necessary to disable the index and replace it with your own. The -# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top -# of each HTML page. A value of NO enables the index and the value YES disables -# it. Since the tabs in the index contain the same information as the navigation -# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. If the tag -# value is set to YES, a side panel will be generated containing a tree-like -# index structure (just like the one that is generated for HTML Help). For this -# to work a browser that supports JavaScript, DHTML, CSS and frames is required -# (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can -# further fine-tune the look of the index. As an example, the default style -# sheet generated by doxygen has an example that shows how to put an image at -# the root of the tree instead of the PROJECT_NAME. Since the tree basically has -# the same information as the tab index, you could consider setting -# DISABLE_INDEX to YES when enabling this option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_TREEVIEW = YES - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that -# doxygen will group on one line in the generated HTML documentation. -# -# Note that a value of 0 will completely suppress the enum values from appearing -# in the overview section. -# Minimum value: 0, maximum value: 20, default value: 4. -# This tag requires that the tag GENERATE_HTML is set to YES. - -ENUM_VALUES_PER_LINE = 0 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used -# to set the initial width (in pixels) of the frame in which the tree is shown. -# Minimum value: 0, maximum value: 1500, default value: 250. -# This tag requires that the tag GENERATE_HTML is set to YES. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to -# external symbols imported via tag files in a separate window. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of LaTeX formulas included as images in -# the HTML documentation. When you change the font size after a successful -# doxygen run you need to manually remove any form_*.png images from the HTML -# output directory to force them to be regenerated. -# Minimum value: 8, maximum value: 50, default value: 10. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using prerendered bitmaps. Use this if you do not have LaTeX -# installed or if you want to formulas look prettier in the HTML output. When -# enabled you may also need to install MathJax separately and configure the path -# to it using the MATHJAX_RELPATH option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -USE_MATHJAX = NO - -# When MathJax is enabled you can set the default output format to be used for -# the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. -# Possible values are: HTML-CSS (which is slower, but has the best -# compatibility), NativeMML (i.e. MathML) and SVG. -# The default value is: HTML-CSS. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_FORMAT = HTML-CSS - -# When MathJax is enabled you need to specify the location relative to the HTML -# output directory using the MATHJAX_RELPATH option. The destination directory -# should contain the MathJax.js script. For instance, if the mathjax directory -# is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax -# Content Delivery Network so you can quickly see the result without installing -# MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_RELPATH = http://www.mathjax.org/mathjax - -# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax -# extension names that should be enabled during MathJax rendering. For example -# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_EXTENSIONS = - -# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces -# of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an -# example see the documentation. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_CODEFILE = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box for -# the HTML output. The underlying search engine uses javascript and DHTML and -# should work on any modern browser. Note that when using HTML help -# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) -# there is already a search function so this one should typically be disabled. -# For large projects the javascript based search engine can be slow, then -# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to -# search using the keyboard; to jump to the search box use + S -# (what the is depends on the OS and browser, but it is typically -# , /