Skip to content

Commit

Permalink
Initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
emb4fun committed Aug 26, 2021
1 parent 430f903 commit 0403ffe
Show file tree
Hide file tree
Showing 2,433 changed files with 714,901 additions and 0 deletions.
9 changes: 9 additions & 0 deletions _clean.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@echo off

del *.bak /S
cd source
call _clean.bat
cd ..
cd webpage
call _clean.bat
cd ..
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

TinyELCA ChangeLog

= Version 1.00 / 1.00, 26.08.2021
* First version for GitHub.
13 changes: 13 additions & 0 deletions source/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
# Ignore files by file types
#
**/*.bak

#
# Some more specific rules
#
build/
CodeWright/
lint/
prj/RAM Debug/
prj/RAM Release/
6 changes: 6 additions & 0 deletions source/_clean.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
del *.bak /S
del build\*.* /Q
rmdir "prj\RAM Debug" /S /Q
rmdir "prj\RAM Release" /S /Q
del prj\*.jlink

39 changes: 39 additions & 0 deletions source/_create_fw.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@echo off
cls

::
:: Project name
::
set PRJ_NAME=tinyelca_fw
set ORG_NAME=tiny-elca

:: ------------------------------------

::
:: Delete files which does not needed anymore
::
mkdir build >NUL 2>&1
del build\*.* /Q >NUL 2>&1

::
:: Copy output file and create new image file
::
copy "prj\RAM Release\%ORG_NAME%.bin" .\build >NUL 2>&1
.\common\tools\xbin -i:.\build\%ORG_NAME%.bin -o:.\build\fw.bin -v:.\incprj\project.h

::
:: Rename image files to "project" files
::
copy .\build\fw.bin .\build\fw1.bin >NUL 2>&1
copy .\build\fw.bin .\build\fw2.bin >NUL 2>&1
copy .\build\fw.bin .\build\firmware.bin >NUL 2>&1
move .\build\fw.bin .\build\%PRJ_NAME%.bin >NUL 2>&1

::
:: Add version info to the filenames
::
.\common\tools\xname -o:.\build\%PRJ_NAME%.bin -v:.\incprj\project.h
del .\build\%ORG_NAME%.bin >NUL 2>&1

echo.
rem pause
66 changes: 66 additions & 0 deletions source/common/inc/cert.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/**************************************************************************
* Copyright (c) 2020 by Michael Fischer (www.emb4fun.de).
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. Neither the name of the author 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.
*
***************************************************************************
* History:
*
* 05.03.2020 mifi First Version.
**************************************************************************/
#if !defined(__CERT_H__)
#define __CERT_H__

/**************************************************************************
* Includes
**************************************************************************/
#include <stdint.h>

/**************************************************************************
* Global Definitions
**************************************************************************/

/**************************************************************************
* Macro Definitions
**************************************************************************/

/**************************************************************************
* Functions Definitions
**************************************************************************/

void cert_Init (void);

int cert_Get_DeviceKey(char **buf, size_t *buflen);
int cert_Get_DeviceCert(char **buf, size_t *buflen);
int cert_Get_IntermediateCert(char **buf, size_t *buflen);

#endif /* !__CERT_H__ */

/*** EOF ***/
91 changes: 91 additions & 0 deletions source/common/inc/etc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/**************************************************************************
* Copyright (c) 2019 by Michael Fischer (www.emb4fun.de).
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. Neither the name of the author 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.
*
***************************************************************************
* History:
*
* 31.05.2019 mifi First Version.
**************************************************************************/
#if !defined(__ETC_H__)
#define __ETC_H__

/**************************************************************************
* Includes
**************************************************************************/
#include <stdint.h>

/**************************************************************************
* Global Definitions
**************************************************************************/

typedef enum _etc_ip_addr_
{
ETC_IP_ADDR = 0,
ETC_IP_MASK,
ETC_IP_GW,
ETC_IP_DNS,
ETC_IP_DNS2,
ETC_IP_NTP,
ETC_IP_SYSLOG,

ETC_IP_MAX
} ETC_IP_ADDRESS;

/**************************************************************************
* Macro Definitions
**************************************************************************/

/**************************************************************************
* Functions Definitions
**************************************************************************/

void etc_Init (void);

char *etc_ShortNameGet (void);
char *etc_LongNameGet (void);
char *etc_LocationGet (void);

int etc_IPDhcpIsUsed (void);
int etc_IPTnpIsES (void);
int etc_IPmDNSIsUsed (void);

uint32_t etc_IPAddrGet (ETC_IP_ADDRESS eAddress);

int etc_TimeZoneIDGet (void);
int etc_TimeZoneOffsetGet (void);
int etc_TimeZoneDstGet (void);
uint32_t etc_TimeNTPAddrGet (void);
uint32_t etc_TimeNTPRefresh (void);

#endif /* !__ETC_H__ */

/*** EOF ***/
Loading

0 comments on commit 0403ffe

Please sign in to comment.