Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/esp8266 example #21

Merged
merged 3 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
77 changes: 77 additions & 0 deletions examples/ESP8266_NONOS_SDK/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
stages:
- build
- deploy

.install_compiler: &install_compiler
- wget https://dl.espressif.com/dl/xtensa-lx106-elf-linux64-1.22.0-100-ge567ec7-5.2.0.tar.gz
- tar -zxvf xtensa-lx106-elf-linux64-1.22.0-100-ge567ec7-5.2.0.tar.gz
- export PATH=./xtensa-lx106-elf/bin/:$PATH
- xtensa-lx106-elf-gcc -v

.build_template: &build_template
stage: build
image: $CI_DOCKER_REGISTRY/esp8266-ci-env
tags:
- build

variables:
GIT_STRATEGY: clone
SSC_DEFAULT_BRANCH: release/esp8266_nonos_sdk

before_script:
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo -n $GITLAB_KEY >> ~/.ssh/id_rsa_base64
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- *install_compiler

build_ssc:
<<: *build_template
artifacts:
paths:
- ./SSC/ssc_bin
expire_in: 6 mos
script:
- git clone $GITLAB_SSH_SERVER/yinling/SSC.git
- cd SSC
# ssc master branch does not support nonos any more, now checkout to the reserved branch
- git checkout ${SSC_DEFAULT_BRANCH}
- chmod +x gen_misc_non_os.sh
- ./gen_misc_non_os.sh

build_at:
<<: *build_template
artifacts:
paths:
- ./bin/upgrade
- ./bin/*.bin
expire_in: 6 mos
script:
- cp -rf examples/at at
- cd at
- make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5

push_master_to_github:
stage: deploy
only:
- master
- /^release\/v.*$/
tags:
- deploy
when: on_success
image: $CI_DOCKER_REGISTRY/esp8266-ci-env
variables:
GIT_STRATEGY: clone
GITHUB_PUSH_REFS: refs/remotes/origin/release refs/remotes/origin/master
script:
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo -n $GH_PUSH_KEY > ~/.ssh/id_rsa_base64
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- git remote add github [email protected]:espressif/ESP8266_NONOS_SDK.git
# - git push --follow-tags github HEAD:master
- eval $(git for-each-ref --shell bash --format 'if [ $CI_COMMIT_SHA == %(objectname) ]; then git checkout -B %(refname:strip=3); git push --follow-tags github %(refname:strip=3); fi;' $GITHUB_PUSH_REFS)
121 changes: 121 additions & 0 deletions examples/ESP8266_NONOS_SDK/LCD_HD44780_TEST/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
#############################################################
# Required variables for each makefile
# Discard this section from all parent makefiles
# Expected variables (with automatic defaults):
# CSRCS (all "C" files in the dir)
# SUBDIRS (all subdirs with a Makefile)
# GEN_LIBS - list of libs to be generated ()
# GEN_IMAGES - list of object file images to be generated ()
# GEN_BINS - list of binaries to be generated ()
# COMPONENTS_xxx - a list of libs/objs in the form
# subdir/lib to be extracted and rolled up into
# a generated lib/image xxx.a ()
#
TARGET = eagle
#FLAVOR = release
FLAVOR = debug

#EXTRA_CCFLAGS += -u

ifndef PDIR # {
GEN_IMAGES= eagle.app.v6.out
GEN_BINS= eagle.app.v6.bin
SPECIAL_MKTARGETS=$(APP_MKTARGETS)
SUBDIRS= \
user

endif # } PDIR

APPDIR = .
LDDIR = ../ld

CCFLAGS += -Os

TARGET_LDFLAGS = \
-nostdlib \
-Wl,-EL \
--longcalls \
--text-section-literals

ifeq ($(FLAVOR),debug)
TARGET_LDFLAGS += -g -O2
endif

ifeq ($(FLAVOR),release)
TARGET_LDFLAGS += -g -O0
endif

COMPONENTS_eagle.app.v6 = \
user/libuser.a

LINKFLAGS_eagle.app.v6 = \
-L../lib \
-nostdlib \
-T$(LD_FILE) \
-Wl,--no-check-sections \
-Wl,--gc-sections \
-u call_user_start \
-Wl,-static \
-Wl,--start-group \
-lc \
-lgcc \
-lhal \
-lphy \
-lpp \
-lnet80211 \
-llwip \
-lwpa \
-lcrypto \
-lmain \
-ldriver \
$(DEP_LIBS_eagle.app.v6) \
-Wl,--end-group

DEPENDS_eagle.app.v6 = \
$(LD_FILE) \
$(LDDIR)/eagle.rom.addr.v6.ld

#############################################################
# Configuration i.e. compile options etc.
# Target specific stuff (defines etc.) goes in here!
# Generally values applying to a tree are captured in the
# makefile at its root level - these are then overridden
# for a subtree within the makefile rooted therein
#

#UNIVERSAL_TARGET_DEFINES = \

# Other potential configuration flags include:
# -DTXRX_TXBUF_DEBUG
# -DTXRX_RXBUF_DEBUG
# -DWLAN_CONFIG_CCX
CONFIGURATION_DEFINES = -DICACHE_FLASH

DEFINES += \
$(UNIVERSAL_TARGET_DEFINES) \
$(CONFIGURATION_DEFINES)

DDEFINES += \
$(UNIVERSAL_TARGET_DEFINES) \
$(CONFIGURATION_DEFINES)


#############################################################
# Recursion Magic - Don't touch this!!
#
# Each subtree potentially has an include directory
# corresponding to the common APIs applicable to modules
# rooted at that subtree. Accordingly, the INCLUDE PATH
# of a module can only contain the include directories up
# its parent path, and not its siblings
#
# Required for each makefile to inherit from the parent
#

INCLUDES := $(INCLUDES) -I $(PDIR)include
PDIR := ../$(PDIR)
sinclude $(PDIR)Makefile

.PHONY: FORCE
FORCE:

31 changes: 31 additions & 0 deletions examples/ESP8266_NONOS_SDK/LCD_HD44780_TEST/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@


@echo off
set PATH=C:/msys32/xtensa-lx106-elf/bin;C:/msys32/usr/bin;C:/msys32/mingw32/bin
echo =======================================================================
echo UPDATING LIBRARY FILES
echo =======================================================================
if not exist user (
call mkdir user
) else (
echo folder "user" exist
)
copy "..\..\..\src\lcd_hd44780.c" "user\"

if not exist include (
call mkdir include
echo folder "include" created
) else (
echo folder "include" exist
)

echo Copy files to include\lcd_hd44780\
copy "..\..\..\src\lcd_hd44780.h" "include\"
copy "..\..\..\src\lcd_hd44780_interface.h" "include\"
copy "..\..\..\src\lcd_hd44780_def_char.h" "include\"
copy "..\..\..\src\lcd_hd44780_config.h" "include\"
echo =======================================================================
echo CLEAN AND BUILD PROJECT
echo =======================================================================

call make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=DIO SPI_SIZE_MAP=6 all
7 changes: 7 additions & 0 deletions examples/ESP8266_NONOS_SDK/LCD_HD44780_TEST/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash -x
echo "make_lib.sh version 20160307"

# $env:PATH = "C:/msys32/xtensa-lx106-elf/bin;C:/msys32/usr/bin;C:/msys32/mingw32/bin";
export PATH="C:/msys32/xtensa-lx106-elf/bin;C:/msys32/usr/bin;C:/msys32/mingw32/bin"
make clean
make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=DIO SPI_SIZE_MAP=6 all
8 changes: 8 additions & 0 deletions examples/ESP8266_NONOS_SDK/LCD_HD44780_TEST/clean.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@


@echo off
set PATH=C:/msys32/xtensa-lx106-elf/bin;C:/msys32/usr/bin;C:/msys32/mingw32/bin
echo =======================================================================
echo CLEAN PROJECT
echo =======================================================================
call make clean
62 changes: 62 additions & 0 deletions examples/ESP8266_NONOS_SDK/LCD_HD44780_TEST/include/lcd_hd44780.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* @Author: lukasz.niewelt
* @Date: 2023-12-06 21:40:29
* @Last Modified by: lukasz.niewelt
* @Last Modified time: 2024-01-10 14:00:22
*/

#ifndef _LCD_HD_44780_H_
#define _LCD_HD_44780_H_

#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
#include <stdbool.h>
#include "lcd_hd44780_config.h"
#include "lcd_hd44780_interface.h"
#include "lcd_hd44780_def_char.h"

enum alignment
{
left,
right
};

extern bool LCD_UPDATE_EVENT;

void lcd_init(void);
void lcd_enable_backlight(void);
void lcd_disable_backlight(void);
void lcd_cls(void);

void lcd_def_char(const uint8_t CGRAM_bank_x_char_adr, const uint8_t *def_char);
void lcd_load_char_bank(const struct char_bank_struct *char_bank);

void lcd_char(const char C);
void lcd_str(const char *str);
void lcd_int(int val, uint8_t width, enum alignment alignment);
void lcd_hex(int val, uint8_t width, enum alignment alignment);
void lcd_bin(int val, uint8_t width);

void lcd_locate(enum LCD_LINES y, enum LCD_COLUMNS x);

void lcd_home(void);
void lcd_cursor_on(void);
void lcd_cursor_off(void);
void lcd_blinking_cursor_on(void);

void lcd_buf_cls(void);
void lcd_buf_char(const char c);
void lcd_buf_locate(enum LCD_LINES y, enum LCD_COLUMNS x);
void lcd_buf_str(const char *str);
void lcd_update(void);

void lcd_buf_int(int val, uint8_t width, enum alignment alignment);
void lcd_buf_hex(int val, uint8_t width, enum alignment alignment);
void lcd_buf_bin(int val, uint8_t width);

#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _LCD_HD_44780_H_ */
Loading
Loading