From 894649cdfaed746af57d57d64513511c0fbd2728 Mon Sep 17 00:00:00 2001 From: Mats van Reenen Date: Tue, 13 Oct 2020 15:54:38 +0200 Subject: [PATCH] make file structure --- .gitignore | 10 +++ README.md | 46 +----------- common.syscfg | 197 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/gsensor.c | 0 src/header.h | 4 + src/main.c | 36 +++++++++ src/mqtt.c | 0 src/socket.c | 0 8 files changed, 249 insertions(+), 44 deletions(-) create mode 100644 common.syscfg create mode 100644 src/gsensor.c create mode 100644 src/header.h create mode 100644 src/main.c create mode 100644 src/mqtt.c create mode 100644 src/socket.c diff --git a/.gitignore b/.gitignore index b24d71e..9eb654d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,16 @@ # Learn more about .gitignore: # https://www.atlassian.com/git/tutorials/saving-changes/gitignore +# ccs artifact files +/.settings +/targetConfigs +/.ccs* +/.cproject +/.project +*.cmd +/*.c +/*.h + # Node artifact files node_modules/ dist/ diff --git a/README.md b/README.md index 16eff96..18049dc 100644 --- a/README.md +++ b/README.md @@ -1,45 +1,3 @@ -**Edit a file, create a new file, and clone from Bitbucket in under 2 minutes** +# Eindopdracht EMS20 - Groep 5 -When you're done, you can delete the content in this README and update the file with details for others getting started with your repository. - -*We recommend that you open this README in another tab as you perform the tasks below. You can [watch our video](https://youtu.be/0ocf7u76WSo) for a full demo of all the steps in this tutorial. Open the video in a new tab to avoid leaving Bitbucket.* - ---- - -## Edit a file - -You’ll start by editing this README file to learn how to edit a file in Bitbucket. - -1. Click **Source** on the left side. -2. Click the README.md link from the list of files. -3. Click the **Edit** button. -4. Delete the following text: *Delete this line to make a change to the README from Bitbucket.* -5. After making your change, click **Commit** and then **Commit** again in the dialog. The commit page will open and you’ll see the change you just made. -6. Go back to the **Source** page. - ---- - -## Create a file - -Next, you’ll add a new file to this repository. - -1. Click the **New file** button at the top of the **Source** page. -2. Give the file a filename of **contributors.txt**. -3. Enter your name in the empty file space. -4. Click **Commit** and then **Commit** again in the dialog. -5. Go back to the **Source** page. - -Before you move on, go ahead and explore the repository. You've already seen the **Source** page, but check out the **Commits**, **Branches**, and **Settings** pages. - ---- - -## Clone a repository - -Use these steps to clone from SourceTree, our client for using the repository command-line free. Cloning allows you to work on your files locally. If you don't yet have SourceTree, [download and install first](https://www.sourcetreeapp.com/). If you prefer to clone from the command line, see [Clone a repository](https://confluence.atlassian.com/x/4whODQ). - -1. You’ll see the clone button under the **Source** heading. Click that button. -2. Now click **Check out in SourceTree**. You may need to create a SourceTree account or log in. -3. When you see the **Clone New** dialog in SourceTree, update the destination path and name if you’d like to and then click **Clone**. -4. Open the directory you just created to see your repository’s files. - -Now that you're more familiar with your Bitbucket repository, go ahead and add a new file locally. You can [push your change back to Bitbucket with SourceTree](https://confluence.atlassian.com/x/iqyBMg), or you can [add, commit,](https://confluence.atlassian.com/x/8QhODQ) and [push from the command line](https://confluence.atlassian.com/x/NQ0zDQ). \ No newline at end of file +Dit is een project opgegeven door Hoogeschool Rotterdam voor de opleiding elektrotechniek en gemaakt door Bram Bleij en Mats van Reenen. diff --git a/common.syscfg b/common.syscfg new file mode 100644 index 0000000..50cf38b --- /dev/null +++ b/common.syscfg @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2018-2019, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +// @cliArgs --board /ti/boards/CC3220S_LAUNCHXL + +/* + * common.syscfg + */ + +var SimpleLinkWifi = scripting.addModule("/ti/drivers/net/wifi/SimpleLinkWifi"); +var Crypto = scripting.addModule("/ti/drivers/Crypto"); +var Crypto1 = Crypto.addInstance(); +var Power = scripting.addModule("/ti/drivers/Power"); +var Board = scripting.addModule("/ti/drivers/Board"); +var DriverLib = scripting.addModule("/ti/devices/DriverLib"); +var Display = scripting.addModule("/ti/display/Display"); +var Display1 = Display.addInstance(); +var DMA = scripting.addModule("/ti/drivers/DMA"); +var GPIO = scripting.addModule("/ti/drivers/GPIO"); +var GPIO1 = GPIO.addInstance(); +var GPIO2 = GPIO.addInstance(); +var GPIO3 = GPIO.addInstance(); +var GPIO4 = GPIO.addInstance(); +var GPIO5 = GPIO.addInstance(); +var GPIO6 = GPIO.addInstance(); +var GPIO7 = GPIO.addInstance(); +var GPIO8 = GPIO.addInstance(); +var SPI = scripting.addModule("/ti/drivers/SPI"); +var SPI1 = SPI.addInstance(); +var Timer = scripting.addModule("/ti/drivers/Timer"); +var Timer1 = Timer.addInstance(); +var Timer2 = Timer.addInstance(); +var Timer3 = Timer.addInstance(); +var Watchdog = scripting.addModule("/ti/drivers/Watchdog"); +var Watchdog1 = Watchdog.addInstance(); +var SlNet = scripting.addModule("/ti/net/SlNet"); +var SlNet1 = SlNet.addInstance(); +// Name - The C/C++ identifier used in applications as the index parameter passed to Crypto runtime APIs +Crypto1.$name = "CONFIG_Crypto_0"; +// IO Retention Shutdown - IO groups to be retained during Shutdown +Power.ioRetentionShutdown = ["GRP_1"]; +// Name +Power.parkPins.$name = "ti_drivers_power_PowerCC32XXPins0"; +// Name - The C/C++ identifier used in applications as the index parameter passed to Display runtime APIs +Display1.$name = "CONFIG_Display_0"; +// Use Hardware - Select the hardware to use, or 'None' to use available header pins +Display1.$hardware = system.deviceData.board.components.XDS110UART; +// Name - The C/C++ identifier used in applications as the index parameter passed to UART runtime APIs +Display1.uart.$name = "CONFIG_UART_0"; +// Use DMA +Display1.uart.useDMA = true; +// Name +Display1.uart.uart.$name = "MyUART1"; +// Use Peripheral +Display1.uart.uart.$assign = "UART0"; +// Assign pin +Display1.uart.uart.txPin.$assign = "GP01"; // pin number - 55 +// Assign pin +Display1.uart.uart.rxPin.$assign = "GP02"; // pin number - 57 +// Assign pin +Display1.uart.uart.txDmaChannel.$assign = "UDMA_CH9"; +// Assign pin +Display1.uart.uart.rxDmaChannel.$assign = "UDMA_CH8"; +// Use Hardware - Select the hardware to use, or 'None' to use available header pins +GPIO1.$hardware = system.deviceData.board.components.SW2; +// Name - The C/C++ identifier used in applications as the index parameter passed to GPIO runtime APIs +GPIO1.$name = "CONFIG_GPIO_BUTTON_0"; +// Assign pin +GPIO1.gpioPin.$assign = "boosterpack.3"; // P04 +// Use Hardware - Select the hardware to use, or 'None' to use available header pins +GPIO2.$hardware = system.deviceData.board.components.SW3; +// Name - The C/C++ identifier used in applications as the index parameter passed to GPIO runtime APIs +GPIO2.$name = "CONFIG_GPIO_BUTTON_1"; +// Assign pin +GPIO2.gpioPin.$assign = "boosterpack.11"; // P15 +// Use Hardware - Select the hardware to use, or 'None' to use available header pins +GPIO3.$hardware = system.deviceData.board.components.LED0; +// Output Strength - Specifies the output strength +GPIO3.outputStrength = "High"; +// Name - The C/C++ identifier used in applications as the index parameter passed to GPIO runtime APIs +GPIO3.$name = "CONFIG_GPIO_LED_0"; +// Use Hardware - Select the hardware to use, or 'None' to use available header pins +GPIO4.$hardware = system.deviceData.board.components.LED2; +// Output Strength - Specifies the output strength +GPIO4.outputStrength = "High"; +// Name - The C/C++ identifier used in applications as the index parameter passed to GPIO runtime APIs +GPIO4.$name = "CONFIG_GPIO_LED_1"; +// Use Hardware - Select the hardware to use, or 'None' to use available header pins +GPIO5.$hardware = system.deviceData.board.components.LED1; +// Output Strength - Specifies the output strength +GPIO5.outputStrength = "High"; +// Name - The C/C++ identifier used in applications as the index parameter passed to GPIO runtime APIs +GPIO5.$name = "CONFIG_GPIO_LED_2"; +// Name - The C/C++ identifier used in applications as the index parameter passed to GPIO runtime APIs +GPIO6.$name = "CONFIG_GPIO_0"; +// Mode - Select the GPIO mode +GPIO6.mode = "Dynamic"; +// Assign pin +GPIO6.gpioPin.$assign = "boosterpack.19"; // P18 +// Name - The C/C++ identifier used in applications as the index parameter passed to GPIO runtime APIs +GPIO7.$name = "CONFIG_GPIO_1"; +// Mode - Select the GPIO mode +GPIO7.mode = "Dynamic"; +// Assign pin +GPIO7.gpioPin.$assign = "boosterpack.2"; // P58* +// Name - The C/C++ identifier used in applications as the index parameter passed to GPIO runtime APIs +GPIO8.$name = "CONFIG_GPIO_2"; +// Mode - Select the GPIO mode +GPIO8.mode = "Dynamic"; +// Assign pin +GPIO8.gpioPin.$assign = "boosterpack.4"; // P03 +// Name - The C/C++ identifier used in applications as the index parameter passed to SPI runtime APIs +SPI1.$name = "CONFIG_SPI_0"; +// Mode - In three pin mode the SS signal is not used. +SPI1.mode = "Four Pin SS Active Low"; +// Default TX Buffer Value - Specifies the default transmit buffer value. +SPI1.defaultTxBufferValue = "0"; +// Name +SPI1.spi.$name = "MySPI1"; +// Use Peripheral +SPI1.spi.$assign = "SPI0"; +// Assign pin +SPI1.spi.sclkPin.$assign = "boosterpack.7"; // P05 +// Assign pin +SPI1.spi.misoPin.$assign = "boosterpack.14"; // P06 +// Assign pin +SPI1.spi.mosiPin.$assign = "boosterpack.15"; // P07 +// Assign pin +SPI1.spi.ssPin.$assign = "boosterpack.18"; // P08 +// Assign pin +SPI1.spi.dmaRxChannel.$assign = "UDMA_CH6"; +// Assign pin +SPI1.spi.dmaTxChannel.$assign = "UDMA_CH7"; +// Name - The C/C++ identifier used in applications as the index parameter passed to Timer runtime APIs +Timer1.$name = "CONFIG_TIMER_0"; +// Timer Type +Timer1.timerType = "32 Bits"; +// Name +Timer1.timer.$name = "MyTimer1"; +// Use Peripheral +Timer1.timer.$assign = "Timer0"; +// Name - The C/C++ identifier used in applications as the index parameter passed to Timer runtime APIs +Timer2.$name = "CONFIG_TIMER_1"; +// Name +Timer2.timer.$name = "MyTimer1"; +// Use Peripheral +Timer2.timer.$assign = "Timer1"; +// Name - The C/C++ identifier used in applications as the index parameter passed to Timer runtime APIs +Timer3.$name = "CONFIG_TIMER_2"; +// Name +Timer3.timer.$name = "MyTimer1"; +// Use Peripheral +Timer3.timer.$assign = "Timer1"; +// Name - The C/C++ identifier used in applications as the index parameter passed to Watchdog runtime APIs +Watchdog1.$name = "CONFIG_WATCHDOG_0"; +// Name +Watchdog1.watchdog.$name = "MyWATCHDOG1"; +// Use Peripheral +Watchdog1.watchdog.$assign = "WATCHDOG0"; +// Name +SlNet1.$name = "CONFIG_SLNET"; +// Interface Name - Specifies the name for this interface" +SlNet1.ifName = "CC32xx"; +// Suggest solution +GPIO3.gpioPin.$suggestSolution = "64"; +// Suggest solution +GPIO4.gpioPin.$suggestSolution = "1"; +// Suggest solution +GPIO5.gpioPin.$suggestSolution = "2"; diff --git a/src/gsensor.c b/src/gsensor.c new file mode 100644 index 0000000..e69de29 diff --git a/src/header.h b/src/header.h new file mode 100644 index 0000000..d73ea59 --- /dev/null +++ b/src/header.h @@ -0,0 +1,4 @@ + +void * GSensorTask(void *args); +void * MQTTTask(void *args); +void * SocketTask(void *args); diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..3798000 --- /dev/null +++ b/src/main.c @@ -0,0 +1,36 @@ +#include +#include +#include +#include +#include "ti_drivers_config.h" + +#include "./header.h" + +void Hardware_init(){ + Board_init(); + GPIO_init(); +} + +int main(void){ + Hardware_init() // initilize hardware + + // ============================================== + // === tread for G sensor ======================= + // ============================================== + + + + + BIOS_start(); + + return (0); +} + +/* + * ======== dummyOutput ======== + * Dummy SysMin output function needed for benchmarks and size comparison + * of FreeRTOS and TI-RTOS solutions. + */ +void dummyOutput(void) +{ +} diff --git a/src/mqtt.c b/src/mqtt.c new file mode 100644 index 0000000..e69de29 diff --git a/src/socket.c b/src/socket.c new file mode 100644 index 0000000..e69de29