Merge remote-tracking branch 'origin/maintenance-8.x.x' into mmosca-dji-no-compat
38
.github/PULL_REQUEST_TEMPLATE/new_target_pull_request.md
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
This pull requests adds support for ``$TARGET_NAME``
|
||||
|
||||
* [ ] Target complies with ``docs/policies/NEW_HARDWARE_POLICY.md``
|
||||
|
||||
The following items have been checked and confirmed working by an INAV developer on actual hardware: (feel free to remove non-relevant items)
|
||||
|
||||
* [ ] Samples received
|
||||
* [ ] Flash firmware
|
||||
* [ ] Calibrate
|
||||
* [ ] Orientation matches
|
||||
* [ ] Gyro working
|
||||
* [ ] Accel working
|
||||
* [ ] Voltage correct
|
||||
* [ ] Current correct
|
||||
* [ ] Baro working
|
||||
* [ ] Mag I2C Bus
|
||||
* [ ] Additional I2C2 Buses (Airspeed/other accessories)
|
||||
* [ ] UART1
|
||||
* [ ] UART2
|
||||
* [ ] UART3
|
||||
* [ ] UART4
|
||||
* [ ] UART5
|
||||
* [ ] UART6
|
||||
* [ ] UART7
|
||||
* [ ] UART8
|
||||
* [ ] Analog Camera working
|
||||
* [ ] Video Out working
|
||||
* [ ] OSD working
|
||||
* [ ] LEDs working
|
||||
* [ ] Buzzer working
|
||||
* [ ] Motor outputs
|
||||
* [ ] DShot support on m1-4
|
||||
* [ ] Servo outputs
|
||||
* [ ] Blackbox
|
||||
* [ ] PINIO1
|
||||
* [ ] PINIO2
|
||||
* [ ] PINIO3
|
||||
* [ ] PINIO4
|
77
.github/workflows/ci.yml
vendored
|
@ -3,6 +3,9 @@ name: Build firmware
|
|||
# are working on the main repo and want to trigger
|
||||
# a CI build submit a draft PR.
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '!maintenance-8.x.x'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'src/**'
|
||||
|
@ -13,12 +16,21 @@ on:
|
|||
- 'CMakeLists.txt'
|
||||
- '*.sh'
|
||||
|
||||
workflow_call:
|
||||
#inputs:
|
||||
# release_build:
|
||||
# description: 'Specifies if it is a build that should include commit hash in hex file names or not'
|
||||
# default: false
|
||||
# required: false
|
||||
# type: boolean
|
||||
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
id: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
|
||||
id: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
@ -37,7 +49,7 @@ jobs:
|
|||
# why we try github.event.pull_request.head.sha first
|
||||
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
|
||||
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
|
||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/^[ \t]+|[ \t\)]+$/, "", $2); print $2 }')
|
||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t)]/, "", $2); print $2 }')
|
||||
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||
echo "NUM_CORES=$(grep processor /proc/cpuinfo | wc -l)" >> $GITHUB_ENV
|
||||
|
@ -72,7 +84,7 @@ jobs:
|
|||
# why we try github.event.pull_request.head.sha first
|
||||
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
|
||||
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
|
||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/^[ \t]+|[ \t\)]+$/, "", $2); print $2 }')
|
||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t)]/, "", $2); print $2 }')
|
||||
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||
echo "NUM_CORES=$(grep processor /proc/cpuinfo | wc -l)" >> $GITHUB_ENV
|
||||
|
@ -96,6 +108,42 @@ jobs:
|
|||
name: targets
|
||||
path: targets.txt
|
||||
|
||||
build-SITL-Linux-arm64:
|
||||
runs-on: ubuntu-22.04-arm
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get update && sudo apt-get -y install ninja-build
|
||||
- name: Setup environment
|
||||
env:
|
||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
||||
run: |
|
||||
# This is the hash of the commit for the PR
|
||||
# when the action is triggered by PR, empty otherwise
|
||||
COMMIT_ID=${{ github.event.pull_request.head.sha }}
|
||||
# This is the hash of the commit when triggered by push
|
||||
# but the hash of refs/pull/<n>/merge, which is different
|
||||
# from the hash of the latest commit in the PR, that's
|
||||
# why we try github.event.pull_request.head.sha first
|
||||
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
|
||||
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
|
||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t)]/, "", $2); print $2 }')
|
||||
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||
echo "NUM_CORES=$(grep processor /proc/cpuinfo | wc -l)" >> $GITHUB_ENV
|
||||
- name: Build SITL
|
||||
run: mkdir -p build_SITL && cd build_SITL && cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -G Ninja .. && ninja -j${{ env.NUM_CORES }}
|
||||
- name: Strip version number
|
||||
run: |
|
||||
for f in build_SITL/*_SITL; do
|
||||
mv $f $(echo $f | sed -e 's/_[0-9]\+\.[0-9]\+\.[0-9]\+//')
|
||||
done
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.BUILD_NAME }}_SITL-Linux-aarch64
|
||||
path: ./build_SITL/*_SITL
|
||||
|
||||
build-SITL-Linux:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
@ -115,12 +163,17 @@ jobs:
|
|||
# why we try github.event.pull_request.head.sha first
|
||||
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
|
||||
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
|
||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/^[ \t]+|[ \t\)]+$/, "", $2); print $2 }')
|
||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t)]/, "", $2); print $2 }')
|
||||
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||
echo "NUM_CORES=$(grep processor /proc/cpuinfo | wc -l)" >> $GITHUB_ENV
|
||||
- name: Build SITL
|
||||
run: mkdir -p build_SITL && cd build_SITL && cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -G Ninja .. && ninja -j${{ env.NUM_CORES }}
|
||||
- name: Strip version number
|
||||
run: |
|
||||
for f in build_SITL/*_SITL; do
|
||||
mv $f $(echo $f | sed -e 's/_[0-9]\+\.[0-9]\+\.[0-9]\+//')
|
||||
done
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
|
@ -148,7 +201,7 @@ jobs:
|
|||
# why we try github.event.pull_request.head.sha first
|
||||
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
|
||||
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
|
||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/^[ \t]+|[ \t\)]+$/, "", $2); print $2 }')
|
||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t)]/, "", $2); print $2 }')
|
||||
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||
echo "NUM_CORES=$(grep processor /proc/cpuinfo | wc -l)" >> $GITHUB_ENV
|
||||
|
@ -157,7 +210,11 @@ jobs:
|
|||
mkdir -p build_SITL && cd build_SITL
|
||||
cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -G Ninja ..
|
||||
ninja -j4
|
||||
|
||||
- name: Strip version number
|
||||
run: |
|
||||
for f in build_SITL/*_SITL; do
|
||||
mv -v $f $(echo $f | sed -Ee 's/_[0-9]+\.[0-9]+\.[0-9]+//')
|
||||
done
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
|
@ -188,19 +245,23 @@ jobs:
|
|||
# why we try github.event.pull_request.head.sha first
|
||||
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
|
||||
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
|
||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/^[ \t]+|[ \t\)]+$/, "", $2); print $2 }')
|
||||
VERSION=$( grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t)]/, "", $2); print $2 }' )
|
||||
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||
|
||||
- name: Build SITL
|
||||
run: mkdir -p build_SITL && cd build_SITL && cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -G Ninja .. && ninja -j4
|
||||
- name: Strip version number
|
||||
run: |
|
||||
for f in ./build_SITL/*_SITL.exe; do
|
||||
mv $f $(echo $f | sed -e 's/_[0-9]\+\.[0-9]\+\.[0-9]\+//')
|
||||
done
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.BUILD_NAME }}_SITL-WIN
|
||||
path: ./build_SITL/*.exe
|
||||
|
||||
|
||||
test:
|
||||
#needs: [build]
|
||||
runs-on: ubuntu-latest
|
||||
|
|
245
.github/workflows/dev-builds.yml
vendored
|
@ -1,245 +0,0 @@
|
|||
name: Build pre-release
|
||||
# Don't enable CI on push, just on PR. If you
|
||||
# are working on the main repo and want to trigger
|
||||
# a CI build submit a draft PR.
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'src/**'
|
||||
- '.github/**'
|
||||
- 'cmake/**'
|
||||
- 'lib/**'
|
||||
- 'docs/Settings.md'
|
||||
- 'CMakeLists.txt'
|
||||
- '*.sh'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
id: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get update && sudo apt-get -y install ninja-build
|
||||
- name: Setup environment
|
||||
env:
|
||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
||||
run: |
|
||||
# This is the hash of the commit for the PR
|
||||
# when the action is triggered by PR, empty otherwise
|
||||
COMMIT_ID=${{ github.event.pull_request.head.sha }}
|
||||
# This is the hash of the commit when triggered by push
|
||||
# but the hash of refs/pull/<n>/merge, which is different
|
||||
# from the hash of the latest commit in the PR, that's
|
||||
# why we try github.event.pull_request.head.sha first
|
||||
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
|
||||
BUILD_SUFFIX=dev-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
|
||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/^[ \t]+|[ \t\)]+$/, "", $2); print $2 }')
|
||||
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||
echo "NUM_CORES=$(grep processor /proc/cpuinfo | wc -l)" >> $GITHUB_ENV
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: downloads
|
||||
key: ${{ runner.os }}-downloads-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('**/cmake/*')}}
|
||||
- name: Build targets (${{ matrix.id }})
|
||||
run: mkdir -p build && cd build && cmake -DWARNINGS_AS_ERRORS=ON -DCI_JOB_INDEX=${{ matrix.id }} -DCI_JOB_COUNT=${{ strategy.job-total }} -DBUILD_SUFFIX=${{ env.BUILD_SUFFIX }} -DVERSION_TYPE=dev -G Ninja .. && ninja -j${{ env.NUM_CORES }} ci
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.BUILD_NAME }}.${{ matrix.id }}
|
||||
path: ./build/*.hex
|
||||
|
||||
build-SITL-Linux:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get update && sudo apt-get -y install ninja-build
|
||||
- name: Setup environment
|
||||
env:
|
||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
||||
run: |
|
||||
# This is the hash of the commit for the PR
|
||||
# when the action is triggered by PR, empty otherwise
|
||||
COMMIT_ID=${{ github.event.pull_request.head.sha }}
|
||||
# This is the hash of the commit when triggered by push
|
||||
# but the hash of refs/pull/<n>/merge, which is different
|
||||
# from the hash of the latest commit in the PR, that's
|
||||
# why we try github.event.pull_request.head.sha first
|
||||
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
|
||||
BUILD_SUFFIX=dev-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
|
||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t\)]+/, "", $2); print $2 }')
|
||||
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||
echo "NUM_CORES=$(grep processor /proc/cpuinfo | wc -l)" >> $GITHUB_ENV
|
||||
- name: Build SITL
|
||||
run: mkdir -p build_SITL && cd build_SITL && cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -G Ninja -DVERSION_TYPE=dev .. && ninja -j${{ env.NUM_CORES }}
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: sitl-${{ env.BUILD_NAME }}-Linux
|
||||
path: ./build_SITL/*_SITL
|
||||
|
||||
build-SITL-Mac:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
brew install cmake ninja ruby
|
||||
|
||||
- name: Setup environment
|
||||
env:
|
||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
||||
run: |
|
||||
# This is the hash of the commit for the PR
|
||||
# when the action is triggered by PR, empty otherwise
|
||||
COMMIT_ID=${{ github.event.pull_request.head.sha }}
|
||||
# This is the hash of the commit when triggered by push
|
||||
# but the hash of refs/pull/<n>/merge, which is different
|
||||
# from the hash of the latest commit in the PR, that's
|
||||
# why we try github.event.pull_request.head.sha first
|
||||
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
|
||||
BUILD_SUFFIX=dev-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
|
||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t\)]+/, "", $2); print $2 }')
|
||||
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||
- name: Build SITL
|
||||
run: |
|
||||
mkdir -p build_SITL && cd build_SITL
|
||||
cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DVERSION_TYPE=dev -G Ninja ..
|
||||
ninja -j4
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: sitl-${{ env.BUILD_NAME }}-MacOS
|
||||
path: ./build_SITL/*_SITL
|
||||
|
||||
build-SITL-Windows:
|
||||
runs-on: windows-latest
|
||||
defaults:
|
||||
run:
|
||||
shell: C:\tools\cygwin\bin\bash.exe -o igncr '{0}'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Cygwin
|
||||
uses: egor-tensin/setup-cygwin@v4
|
||||
with:
|
||||
packages: cmake ruby ninja gcc-g++
|
||||
- name: Setup environment
|
||||
env:
|
||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
||||
run: |
|
||||
# This is the hash of the commit for the PR
|
||||
# when the action is triggered by PR, empty otherwise
|
||||
COMMIT_ID=${{ github.event.pull_request.head.sha }}
|
||||
# This is the hash of the commit when triggered by push
|
||||
# but the hash of refs/pull/<n>/merge, which is different
|
||||
# from the hash of the latest commit in the PR, that's
|
||||
# why we try github.event.pull_request.head.sha first
|
||||
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
|
||||
BUILD_SUFFIX=dev-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
|
||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t\)]+/, "", $2); print $2 }')
|
||||
#echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||
#echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||
#echo "VERSION_TAG=-$(date '+%Y%m%d')" >> $GITHUB_ENV
|
||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||
- name: Build SITL
|
||||
run: mkdir -p build_SITL && cd build_SITL && cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -DVERSION_TYPE=dev -G Ninja .. && ninja -j4
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: sitl-${{ env.BUILD_NAME }}-WIN
|
||||
path: ./build_SITL/*.exe
|
||||
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get update && sudo apt-get -y install ninja-build
|
||||
- name: Run Tests
|
||||
run: mkdir -p build && cd build && cmake -DTOOLCHAIN=none -G Ninja .. && ninja check
|
||||
|
||||
release:
|
||||
needs: [build, build-SITL-Linux, build-SITL-Mac, build-SITL-Windows, test]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Get version
|
||||
id: version
|
||||
run: |
|
||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t\)]+/, "", $2); print $2 }')
|
||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||
- name: Get current date
|
||||
id: date
|
||||
run: echo "today=$(date '+%Y%m%d')" >> $GITHUB_OUTPUT
|
||||
- name: download artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: hexes
|
||||
pattern: inav-*
|
||||
merge-multiple: true
|
||||
- name: download sitl linux
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: resources/sitl/linux
|
||||
pattern: sitl-*-Linux
|
||||
merge-multiple: true
|
||||
- name: download sitl windows
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: resources/sitl/windows
|
||||
pattern: sitl-*-WIN
|
||||
merge-multiple: true
|
||||
- name: download sitl mac
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: resources/sitl/macos
|
||||
pattern: sitl-*-MacOS
|
||||
merge-multiple: true
|
||||
- name: Consolidate sitl files
|
||||
run: |
|
||||
zip -r -9 sitl-resources.zip resources/
|
||||
- name: Upload release artifacts
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
name: inav-${{ steps.version.outputs.version }}-dev-${{ steps.date.outputs.today }}-${{ github.run_number }}-${{ github.sha }}
|
||||
tag_name: v${{ steps.version.outputs.version }}-${{ steps.date.outputs.today }}.${{ github.run_number }}
|
||||
# To create release on a different repo, we need a token setup
|
||||
token: ${{ secrets.NIGHTLY_TOKEN }}
|
||||
repository: iNavFlight/inav-nightly
|
||||
prerelease: true
|
||||
draft: false
|
||||
#generate_release_notes: true
|
||||
make_latest: false
|
||||
files: |
|
||||
hexes/*.hex
|
||||
sitl-resources.zip
|
||||
body: |
|
||||
${{ steps.notes.outputs.notes }}
|
||||
|
||||
### Flashing
|
||||
These are nightly builds and configuration settings can be added and removed often. Flashing with Full chip erase is strongly recommended to avoid issues.
|
||||
Firmware related issues should be opened in the iNavflight/inav repository, not in inav-nightly.
|
||||
|
||||
### Repository:
|
||||
${{ github.repository }} ([link](${{ github.event.repository.html_url }}))
|
||||
|
||||
### Branch:
|
||||
${{ github.ref_name }} ([link](${{ github.event.repository.html_url }}/tree/${{ github.ref_name }}))
|
||||
|
||||
### Latest changeset:
|
||||
${{ github.event.head_commit.id }} ([link](${{ github.event.head_commit.url }}))
|
||||
|
||||
### Changes:
|
||||
${{ github.event.head_commit.message }}
|
||||
|
104
.github/workflows/nightly-build.yml
vendored
Normal file
|
@ -0,0 +1,104 @@
|
|||
name: Build pre-release
|
||||
# Don't enable CI on push, just on PR. If you
|
||||
# are working on the main repo and want to trigger
|
||||
# a CI build submit a draft PR.
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- maintenance-8.x.x
|
||||
paths:
|
||||
- 'src/**'
|
||||
- '.github/**'
|
||||
- 'cmake/**'
|
||||
- 'lib/**'
|
||||
- 'docs/Settings.md'
|
||||
- 'CMakeLists.txt'
|
||||
- '*.sh'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: build
|
||||
uses: ./.github/workflows/ci.yml
|
||||
|
||||
release:
|
||||
name: Release
|
||||
needs: [build]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Get version
|
||||
id: version
|
||||
run: |
|
||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t\)]/, "", $2); print $2 }')
|
||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||
- name: Get current date
|
||||
id: date
|
||||
run: echo "today=$(date '+%Y%m%d')" >> $GITHUB_OUTPUT
|
||||
- name: download artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: hexes
|
||||
pattern: matrix-inav-*
|
||||
merge-multiple: true
|
||||
- name: download sitl linux
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: resources/sitl/linux
|
||||
pattern: inav-*SITL-Linux
|
||||
merge-multiple: true
|
||||
- name: download sitl linux aarch64
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: resources/sitl/linux/arm64
|
||||
pattern: inav-*SITL-Linux-aarch64
|
||||
merge-multiple: true
|
||||
- name: download sitl windows
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: resources/sitl/windows
|
||||
pattern: inav-*SITL-WIN
|
||||
merge-multiple: true
|
||||
- name: download sitl mac
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: resources/sitl/macos
|
||||
pattern: inav-*SITL-MacOS
|
||||
merge-multiple: true
|
||||
- name: Consolidate sitl files
|
||||
run: |
|
||||
zip -r -9 sitl-resources.zip resources/
|
||||
- name: Upload release artifacts
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
name: inav-${{ steps.version.outputs.version }}-dev-${{ steps.date.outputs.today }}-${{ github.run_number }}-${{ github.sha }}
|
||||
tag_name: v${{ steps.version.outputs.version }}-${{ steps.date.outputs.today }}.${{ github.run_number }}
|
||||
# To create release on a different repo, we need a token setup
|
||||
token: ${{ secrets.NIGHTLY_TOKEN }}
|
||||
repository: iNavFlight/inav-nightly
|
||||
prerelease: true
|
||||
draft: false
|
||||
#generate_release_notes: true
|
||||
make_latest: false
|
||||
files: |
|
||||
hexes/*.hex
|
||||
sitl-resources.zip
|
||||
body: |
|
||||
${{ steps.notes.outputs.notes }}
|
||||
|
||||
### Flashing
|
||||
These are nightly builds and configuration settings can be added and removed often. Flashing with Full chip erase is strongly recommended to avoid issues.
|
||||
Firmware related issues should be opened in the iNavflight/inav repository, not in inav-nightly.
|
||||
|
||||
### Repository:
|
||||
${{ github.repository }} ([link](${{ github.event.repository.html_url }}))
|
||||
|
||||
### Branch:
|
||||
${{ github.ref_name }} ([link](${{ github.event.repository.html_url }}/tree/${{ github.ref_name }}))
|
||||
|
||||
### Latest changeset:
|
||||
${{ github.event.head_commit.id }} ([link](${{ github.event.head_commit.url }}))
|
||||
|
||||
### Changes:
|
||||
${{ github.event.head_commit.message }}
|
||||
|
22
.vscode/c_cpp_properties.json
vendored
|
@ -34,11 +34,29 @@
|
|||
"USE_I2C_IO_EXPANDER",
|
||||
"USE_PCF8574",
|
||||
"USE_ESC_SENSOR",
|
||||
"USE_PROGRAMMING_FRAMEWORK",
|
||||
"USE_SERIALRX_GHST",
|
||||
"USE_TELEMETRY_GHST",
|
||||
"USE_CMS",
|
||||
"USE_DJI_HD_OSD",
|
||||
"USE_GYRO_KALMAN",
|
||||
"USE_RANGEFINDER",
|
||||
"USE_RATE_DYNAMICS",
|
||||
"USE_SMITH_PREDICTOR",
|
||||
"USE_ALPHA_BETA_GAMMA_FILTER",
|
||||
"USE_MAG_VCM5883",
|
||||
"USE_TELEMETRY_JETIEXBUS",
|
||||
"USE_NAV",
|
||||
"USE_SDCARD_SDIO",
|
||||
"USE_SDCARD",
|
||||
"USE_Q_TUNE",
|
||||
"USE_GYRO_FFT_FILTER",
|
||||
"USE_BARO_DPS310",
|
||||
"USE_ADAPTIVE_FILTER",
|
||||
"MCU_FLASH_SIZE 1024",
|
||||
"MCU_FLASH_SIZE 1024"
|
||||
],
|
||||
"configurationProvider": "ms-vscode.cmake-tools"
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
}
|
||||
|
|
4
.vscode/settings.json
vendored
|
@ -4,7 +4,7 @@
|
|||
"cmath": "c",
|
||||
"ranges": "c",
|
||||
"navigation.h": "c",
|
||||
"rth_trackback.h": "c"
|
||||
"rth_trackback.h": "c",
|
||||
"platform.h": "c",
|
||||
"timer.h": "c",
|
||||
"bus.h": "c"
|
||||
|
@ -15,4 +15,4 @@
|
|||
"editor.expandTabs": true,
|
||||
"C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: Google, IndentWidth: 4, BreakBeforeBraces: Mozilla }"
|
||||
|
||||
}
|
||||
}
|
|
@ -51,7 +51,7 @@ else()
|
|||
endif()
|
||||
endif()
|
||||
|
||||
project(INAV VERSION 8.0.0)
|
||||
project(INAV VERSION 8.1.0)
|
||||
|
||||
enable_language(ASM)
|
||||
|
||||
|
|
|
@ -3,13 +3,20 @@ if(DEFINED CI_JOB_INDEX AND DEFINED CI_JOB_COUNT)
|
|||
message("-- configuring CI job ${job_name}/${CI_JOB_COUNT}")
|
||||
get_property(targets GLOBAL PROPERTY RELEASE_TARGETS)
|
||||
list(LENGTH targets count)
|
||||
message("-- ${count} total targets")
|
||||
math(EXPR per_job "(${count}+${CI_JOB_COUNT}-1)/${CI_JOB_COUNT}")
|
||||
message("-- ${per_job} targets per job")
|
||||
math(EXPR start "${CI_JOB_INDEX}*${per_job}")
|
||||
list(SUBLIST targets ${start} ${per_job} ci_targets)
|
||||
message("-- will build targets: ${ci_targets}")
|
||||
add_custom_target(ci
|
||||
${CMAKE_COMMAND} -E true
|
||||
DEPENDS ${ci_targets}
|
||||
)
|
||||
message("-- ${per_job} targets per job, starting at ${start}")
|
||||
if(${start} LESS ${count})
|
||||
list(SUBLIST targets ${start} ${per_job} ci_targets)
|
||||
message("-- will build targets: ${ci_targets}")
|
||||
add_custom_target(ci
|
||||
${CMAKE_COMMAND} -E true
|
||||
DEPENDS ${ci_targets}
|
||||
)
|
||||
else()
|
||||
add_custom_target(ci
|
||||
${CMAKE_COMMAND} -E true
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -38,6 +38,8 @@ set(STM32F7_HAL_SRC
|
|||
stm32f7xx_ll_tim.c
|
||||
stm32f7xx_ll_usb.c
|
||||
stm32f7xx_ll_utils.c
|
||||
stm32f7xx_hal_sd.c
|
||||
stm32f7xx_ll_sdmmc.c
|
||||
)
|
||||
list(TRANSFORM STM32F7_HAL_SRC PREPEND "${STM32F7_HAL_DIR}/Src/")
|
||||
|
||||
|
@ -74,7 +76,7 @@ main_sources(STM32F7_SRC
|
|||
drivers/system_stm32f7xx.c
|
||||
drivers/serial_uart_stm32f7xx.c
|
||||
drivers/serial_uart_hal.c
|
||||
drivers/sdcard/sdmmc_sdio_f7xx.c
|
||||
drivers/sdcard/sdmmc_sdio_hal.c
|
||||
)
|
||||
|
||||
main_sources(STM32F7_MSC_SRC
|
||||
|
|
|
@ -161,7 +161,7 @@ main_sources(STM32H7_SRC
|
|||
drivers/serial_uart_stm32h7xx.c
|
||||
drivers/serial_uart_hal.c
|
||||
drivers/sdio.h
|
||||
drivers/sdcard/sdmmc_sdio_h7xx.c
|
||||
drivers/sdcard/sdmmc_sdio_hal.c
|
||||
)
|
||||
|
||||
main_sources(STM32H7_MSC_SRC
|
||||
|
@ -222,3 +222,4 @@ macro(define_target_stm32h7 subfamily size)
|
|||
endmacro()
|
||||
|
||||
define_target_stm32h7(43 i)
|
||||
define_target_stm32h7(A3 i)
|
||||
|
|
|
@ -71,7 +71,7 @@ To find out cruise airspeed, make a test flight. Enable ground speed display on
|
|||
|
||||
Cruise airspeed is specified in cm/s.
|
||||
|
||||
To convert km/h to m/s, multiply by 27.77.
|
||||
To convert km/h to cm/s, multiply by 27.77.
|
||||
|
||||
|
||||
Example: 100 km/h = 100 * 27.77 = 2777 cm/s
|
||||
|
|
135
docs/Geozones.md
Normal file
|
@ -0,0 +1,135 @@
|
|||
# Geozones
|
||||
|
||||
## Introduction
|
||||
The Geozone feature allows pilots to define one or multiple areas on the map in Mission Control, to prevent accidental flying outside of allowed zones (Flight-Zones, FZ) or to avoid certain areas they are not allowed or not willing to fly in (No-Flight-Zone, NFZ).
|
||||
This type of feature might be known to many pilots as a "Geofence" and despite providing the same core functionality, INAV Geozones are significantly more versatile and provide more safety and features.
|
||||
|
||||
Geozones can not only inform the Pilot on the OSD, if the aircraft is approaching a geozone border, it also gives the distance and direction to the closest border and the remaining flight distance to the breach point. Additionally, it provides autonomous avoidance features, if the Aircraft is in any kind of self-leveling flight mode.
|
||||
The most important feature for safety is the automatic path planning for RTH (Start Return To Home), that automatically avoids NFZ areas if possible.
|
||||
|
||||

|
||||
|
||||
|
||||
## Compatibility
|
||||
- [INAV Version: 8.0 or later](https://github.com/iNavFlight/inav/releases)
|
||||
- [INAV Configurator: 8.0 or Later](https://github.com/iNavFlight/inav-configurator/releases)
|
||||
- [MWPTools: Snapshot 2024-11-15 or later](https://github.com/stronnag/mwptools)
|
||||
- Only flight controller with more than 512k of Flash (STM32F405, STM32F765, STM32H743, etc.)
|
||||
- Plane, Multirotor (Rover and Boat are untested at time of writing)
|
||||
|
||||
## Setup Procedure
|
||||
- In the INAV Configurator, switch to the Configuration Panel and enable "Geozone" in the features.
|
||||
- Switch to the Mission Control Panel and you will see a new Icon to call up the Geozone Editor. If Zones are already set up, they will be loaded automatically, as soon as you enter Mission Control.
|
||||

|
||||
- Click on the "+" Symbol to add a new zone and define its parameters to your desire.
|
||||
- The following Options are available:
|
||||
- Shape: Configures a Zone as a Circle or a Polygon
|
||||
- Type: Inclusive (FZ, green) or Exclusive (NFZ, red)
|
||||
- Min. Alt (cm): lower ceiling of the Zone (0 represents the ground relative from the launch location or AMSL. No action will be taken at a minimum altitude of 0, so the aircraft can "dive out" of an Inclusive FZ on a hill. To have a Minimum Altitude action, set a negative altitude of -1 or lower)
|
||||
- Max. Alt (cm): upper ceiling of the Zone (A value if 0 means no upper altitude limit)
|
||||
- Action: Action to execute if an aircraft approaches the border of that Zone
|
||||
- Radius: Circular Zone only, Radius of the Circle
|
||||
- Move the Zone-Markers to the desired locations, to create a bordered area with the shape and size needed (Or change the radius in case of a Circular Zone)
|
||||
- To add additional vertices, click on the borderline of the zone you are editing. This will add a new vertex to that line to move around.
|
||||

|
||||
- Add additional Zones as you like, Zones can be separated but also overlapping (See [Limitations]( ) for details)
|
||||
- After finishing the zone setup, click the "Store in EEPROM" Button to save the zones on the Flight Controller. It is important that the FC reboots after storing, as the Zones can only be used after a fresh boot process.
|
||||

|
||||
|
||||
## Global Settings
|
||||
- In the Advanced Tuning Panel, you will find additional global settings for Geozones
|
||||

|
||||
- Detection Distance `geozone_detection_distance`: Defines at what distance a Geozone will be shown as a System Message if a breach is imminent.
|
||||
- Avoid Altitude Range `geozone_avoid_altitude_range`: When the Aircraft approaches an NFZ that has a upper limit (can be overflown at higher altitude), INAV will climb above the Zone automatically if the altitude difference between Zone ceiling and current Aircraft altitude is less, than this value. For fixed wing, you need to consider how steep the possible climb angle is.
|
||||
- Safe Altitude Distance `geozone_safe_altitude_distance`: Vertical safety margin to avoid a ceiling or floor altitude breach at high vertical speed. If your FZ Ceiling is at 100m and this value set to 10m, the aircraft will not allow you to fly above 90m and descents if the Aircraft overshoots.
|
||||
- Safehome as Inclusive `geozone_safehome_as_inclusive`: Defines every Safehome location as a circular Inclusive zone with the radius of `safehome_max_distance` to allow a FZ at ground altitude (For Landings) if the general FZ around it might have a minimum altitude.
|
||||
- Safehome Zone Action `geozone_safehome_zone_action`: Defines the action on zone breach if Safehome is enabled as inclusive. This is helpful for flying fields with distance or altitude restrictions for LOS Pilots.
|
||||
- Multirotor Stop Distance `geozone_mr_stop_distance:`: Distance from the Border a Multirotor will stop, if the Fence Action is Avoid or Loiter (For fixed wings, this will be calculated from the Loiter-Radius of the Plane).
|
||||
- No Way Home Action `geozone_no_way_home_action`: If RTH cannot find a possible route in FS or RTH modes, the Aircraft will either emergency land or fly straight back home and ignores NFZ.
|
||||
|
||||
## Functions and Behaviors
|
||||
- Zone Type: Inclusive
|
||||
- If craft is armed inside the Inclusive FZ, everything outside that zone is considered an NFZ.
|
||||
- Inclusive FZ can be combined if they overlap and will be handled as one zone.
|
||||
- Overlapping multiple FZ allows different upper and lower altitude limits for each zone, as long as they still overlap in 3D Space (Both overlapping zones have to have a overlapping altitude range as well).
|
||||
- Arming the aircraft outside of an Inclusive Zone is prohibited within a 2km distance to the next vertex (Distance to a border between two vertex is not checked). Arming override can be used. Arming at a distance bigger than 2km is possible.
|
||||
- Arming a craft outside of an Inclusive FZ will disable all Inclusive zones.
|
||||
- Zone Type: Exclusive
|
||||
- Arming inside an Exclusive NFZ is prohibited. Arming override can be used but not recommended. If armed inside an NFZ the Pilot keeps control until the NFZ is left, then any configured Action will be executed on re-enter.
|
||||
- Exclusive Zones can be combined and overlapped as needed.
|
||||
- Exclusive NFZ with an upper or lower limit other than 0 can be overflown and underflown. The Automatic avoidance will only fly above NFZ if possible and never below.
|
||||
- Actions:
|
||||
- Avoid: Also called “Bounce” (only airplanes): The aircraft flies away from the boundary at the same angle it approached it, like a pool ball bouncing off the table border. Multirotor will switch into "Position Hold".
|
||||
- Hold: Position in front of the boundary is held. Airplances will adjust their loiter center according to the loider radius, to stay away from the border while circling.
|
||||
- RTH: Triggers Return To Home. The Failsafe RTH Procedure is executed, so RTH Trackback is also used if enabled for Failsafe situations.
|
||||
- None: No action (only info in OSD).
|
||||
- RTH:
|
||||
- If RTH is enabled by Failsafe, User Command or Zone Action, INAV will calculate a path to the Home Location that automatically avoids NFZ and tries to stay inside the current FZ.
|
||||
- If no Path can be calculated (Not able to climb over a blocking NFZ, No Intersection between FZ, too tight gaps between blocking NFZ) a configurable alternative action will be executed.
|
||||
- Direct RTH: Ignores Flight zones and comes back in a direct path.
|
||||
- Emergency Land: Executes a GPS enabled Emergency Landing (Circle down with horizontal position hold active on Planes).
|
||||
- When direct "Line of sight" with the Home location is reached (No zones blocking path), regular RTH settings are executed.
|
||||
- To abort the Smart-RTH feature and come back on a direct way, disable and Re-Enable RTH within 1 Second. This temporarily ignores all FZ and NFZ borders.
|
||||
- Return to Zone:
|
||||
- If the Aircraft breaches into an NFZ or out of a FZ (by avoiding tight angled Zones or flown in Acro mode and then the mode switches to any Self-Level mode), RTZ is initiated and the aircraft flies back into the last permitted zone on the shortest possible course.
|
||||
|
||||
## OSD Elements
|
||||
- Three dedicated OSD Elements have been added:
|
||||
- Fence-Distance Horizontal shows the distance to the nearest Fence Border and the heading to that border. (ID 145)
|
||||
- Fence-Distance Vertical shows the distance to the nearest ceiling or floor of a zone. (ID 146)
|
||||
- Fence-Direction Vertical is an optional element to show if the nearest vertical border is above or below the aircraft. (ID 144)
|
||||

|
||||
- The Flight-Mode will show AUTO if the Aircraft executes any kind of Fence-Action.
|
||||
- The System-Message shows the distance to a potential fence breach point, based on the current aircraft Attitude and Heading.
|
||||
- Additionally, the System Message shows the current Fence Action that is Executed.
|
||||
|
||||
|
||||
## Limitations
|
||||
- The maximum number of dedicated zones of any type is 63.
|
||||
- The maximum number of vertices of all zones combined is 127. Every circular zone uses 2 vertices while every polygon has to consist of at least 3 vertices.
|
||||
- INAV can only execute one border-breach action at a time. This is especially important to consider for Airplanes that cannot hover.
|
||||
- Complicated Zone setups with overlaps and tight areas can cause a loiter or "bounce" into another NFZ that was not considered before.
|
||||
- This can lead to a "Return to FZ" action that tries to find the shortest path into an allowed area.
|
||||
- All Geozone Actions are disabled when in Waypoint Mode. The Pilot is responsible for planning his mission accordingly, to not create a path that crosses NFZ areas. If a mission leads to such an area and the pilot disables WP mode, a "Return to FZ" action will be executed.
|
||||
- All Geozone Actions are disabled in ACRO and MANUAL Mode. INAV will not take over control in these modes and only OSD Warnings are shown.
|
||||
- Planning the Geozone as a polygon, needs to have the vertex numbering to be counter clockwise in ascending order. One vertex must not be dragged over another border to create crossing borders within one zone. INAV Configurator and MWP will check for that before uploading.
|
||||
- Examples of Zones that are not allowed:
|
||||

|
||||
- To properly combine multiple Inclusion FZ into one area, the Zones need to overlap at 2 borders and the points where the borders touch, must be at least 2.5x Loiter-Radius apart from Airplanes at least 2.5x Multirotor Stop Distance apart for Multirotor.
|
||||
- Example:
|
||||

|
||||
- If multiple zones with different minimum and maximum altitudes are combined, they need to vertically overlap at least 50m.
|
||||
- There is a chance that Smart RTH cannot find a path around NFZ areas, if there are multiple very big zones blocking the path. Due to hardware limitations, the amount of waypoints that Smart RTH can create are limited. Many Zones with very long border lines (>500m) cause additional waypoints.
|
||||
- It is not recommended to edit geozones in CLI by hand as this bypasses a lot of sanity checks. Potential errors in zones will disable them or can lead to unexpected behaviors. Transferring Geozones with a DIFF between aircraft is fine.
|
||||
|
||||
## CLI
|
||||
The Geozone Information are stored in two separate data arrays. The first array holds the main Geozone Information and settings. The second array holds the Geozone vertices.
|
||||
The following commands are available for users:
|
||||
|
||||
- `geozone` without argument lists the current settings
|
||||
- `geozone reset <id>` resets a specific geozone and all related vertices. If no ID proveded, all geozones and vertices will be deleted.
|
||||
- `geozone vertex` - lists all vertices.
|
||||
- `geozone vertex reset` - deletes all vertices.
|
||||
- `geozone vertex reset <zone id>` - Deletes all vertices of the zone.
|
||||
- `geozone vertex reset <zone id> <vertex id>` - Deletes the vertex with the corresponding id from a zone.
|
||||
|
||||
The following information are for app-developers. _DO NOT EDIT GEOZONES MANUALLY CLI_!
|
||||
|
||||
`geozone <id> <shape> <type> <minimum altitude> <maximum altitude> <is_amsl> <fence action> <vertices count>`
|
||||
|
||||
- id: 0 - 63
|
||||
- shape: 0 = Circular, 1 = Polygonal
|
||||
- type: 0 = Exclusive, 1 = Inclusive
|
||||
- minimum altitude: In centimetres, 0 = ground
|
||||
- maximum altitude: In centimetres, 0 = infinity
|
||||
- is_amsl: 0 = relative, 1 = AMSL
|
||||
- fence action: 0 = None, 1 = Avoid, 2 = Position hold, 3 = Return To Home
|
||||
- vertices count: 0-126 - Sanity check if number of vertices matches with configured zones
|
||||
|
||||
`geozone vertex <zone id> <vertex idx> <latitude> <logitude>`
|
||||
|
||||
- zone id: (0-63) The zone id to which this vertex belongs
|
||||
- vertex idx: Index of the vertex (0-126)
|
||||
- latitude/ logitude: Longitude and latitude of the vertex. Values in decimal degrees * 1e7. Example:the value 47.562004o becomes 475620040
|
||||
|
||||
|
|
@ -4,7 +4,7 @@ The On Screen Display, or OSD, is a feature that overlays flight data over the v
|
|||
|
||||
|
||||
General OSD information is in this document. Other documents cover specific OSD-related topics:
|
||||
* [Custom OSD Messages](https://github.com/iNavFlight/inav/wiki/OSD-custom-messages)
|
||||
* [Custom OSD Elements](https://github.com/iNavFlight/inav/wiki/Custom-OSD-Elements)
|
||||
* [OSD Hud and ESP32 radars](https://github.com/iNavFlight/inav/wiki/OSD-Hud-and-ESP32-radars)
|
||||
* [OSD Joystick](https://github.com/iNavFlight/inav/blob/master/docs/OSD%20Joystick.md)
|
||||
* [DJI compatible OSD.md](https://github.com/iNavFlight/inav/blob/master/docs/DJI%20compatible%20OSD.md)
|
||||
|
@ -190,6 +190,13 @@ Here are the OSD Elements provided by INAV.
|
|||
| 156 | OSD_CUSTOM_ELEMENT_6 | 8.0.0 | |
|
||||
| 157 | OSD_CUSTOM_ELEMENT_7 | 8.0.0 | |
|
||||
| 158 | OSD_CUSTOM_ELEMENT_8 | 8.0.0 | |
|
||||
| 159 | OSD_LQ_DOWNLINK | 8.0.0 | |
|
||||
| 160 | OSD_RX_POWER_DOWNLINK | 8.0.0 | |
|
||||
| 161 | OSD_RX_BAND | 8.0.0 | |
|
||||
| 162 | OSD_RX_MODE | 8.0.0 | |
|
||||
| 163 | OSD_COURSE_TO_FENCE | 8.0.0 | |
|
||||
| 164 | OSD_H_DIST_TO_FENCE | 8.0.0 | |
|
||||
| 165 | OSD_V_DIST_TO_FENCE | 8.0.0 | |
|
||||
|
||||
# Pilot Logos
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ IPF can be edited using INAV Configurator user interface, or via CLI. To use COn
|
|||
| 47 | Edge | Momentarily true when triggered by `Operand A`. `Operand A` is the activation operator [`boolean`], `Operand B` _(Optional)_ is the time for the edge to stay active [ms]. After activation, operator will return `true` until the time in Operand B is reached. If a pure momentary edge is wanted. Just leave `Operand B` as the default `Value: 0` setting. |
|
||||
| 48 | Delay | Delays activation after being triggered. This will return `true` when `Operand A` _is_ true, and the delay time in `Operand B` [ms] has been exceeded. |
|
||||
| 49 | Timer | A simple on - off timer. `true` for the duration of `Operand A` [ms]. Then `false` for the duration of `Operand B` [ms]. |
|
||||
| 50 | Delta (|A| >= B) | This returns `true` when the value of `Operand A` has changed by the value of `Operand B` or greater within 100ms. |
|
||||
| 50 | Delta | This returns `true` when the value of `Operand A` has changed by the value of `Operand B` or greater within 100ms. ( \|ΔA\| >= B ) |
|
||||
| 51 | Approx Equals (A ~ B) | `true` if `Operand B` is within 1% of `Operand A`. |
|
||||
| 52 | LED Pin PWM | Value `Operand A` from [`0` : `100`] starts PWM generation on LED Pin. See [LED pin PWM](LED%20pin%20PWM.md). Any other value stops PWM generation (stop to allow ws2812 LEDs updates in shared modes). |
|
||||
| 53 | Disable GPS Sensor Fix | Disables the GNSS sensor fix. For testing GNSS failure. |
|
||||
|
|
|
@ -62,7 +62,7 @@ All other interfaces (I2C, SPI, etc.) are not emulated.
|
|||
## Remote control
|
||||
Multiple methods for connecting RC Controllers are available:
|
||||
- MSP_RX (TCP/IP)
|
||||
- joystick (via simulator)
|
||||
- joystick / radio attached via USB (via simulator)
|
||||
- serial receiver via USB to serial converter
|
||||
- any receiver with proxy flight controller
|
||||
|
||||
|
@ -75,6 +75,7 @@ MSP_RX is the default, 18 channels are supported over TCP/IP connection.
|
|||
Only 8 channels are supported.
|
||||
|
||||
Select "SIM (SITL)" as the receiver and set up a joystick in the simulator.
|
||||
Many RC transmittters (radios) can function as a joystick by plugging them in to the computer via USB, making this the simplest option in many cases.
|
||||
|
||||
*Not available with INAV-X-Plane-HITL plugin.*
|
||||
|
||||
|
|
104
docs/Settings.md
|
@ -674,7 +674,7 @@ Defines debug values exposed in debug variables (developer / debugging setting)
|
|||
|
||||
### disarm_always
|
||||
|
||||
Disarms the motors independently of throttle value. Setting to OFF reverts to the old behaviour of disarming only when the throttle is low.
|
||||
When you switch to Disarm, do so regardless of throttle position. If this Setting is `OFF`. It will only disarm only when the throttle is low. This is similar to the previous `disarm_kill_switch` option. Default setting is the same as the old default behaviour.
|
||||
|
||||
| Default | Min | Max |
|
||||
| --- | --- | --- |
|
||||
|
@ -842,6 +842,16 @@ Q factor for dynamic notches
|
|||
|
||||
---
|
||||
|
||||
### enable_broken_o4_workaround
|
||||
|
||||
DJI O4 release firmware has a broken MSP DisplayPort implementation. This enables a workaround to restore ARM detection.
|
||||
|
||||
| Default | Min | Max |
|
||||
| --- | --- | --- |
|
||||
| OFF | OFF | ON |
|
||||
|
||||
---
|
||||
|
||||
### esc_sensor_listen_only
|
||||
|
||||
Enable when BLHeli32 Auto Telemetry function is used. Disable in every other case
|
||||
|
@ -908,7 +918,7 @@ EzTune filter cutoff frequency
|
|||
|
||||
| Default | Min | Max |
|
||||
| --- | --- | --- |
|
||||
| 110 | 10 | 300 |
|
||||
| 110 | 20 | 300 |
|
||||
|
||||
---
|
||||
|
||||
|
@ -1178,7 +1188,7 @@ The target percentage of maximum mixer output used for determining the rates in
|
|||
|
||||
| Default | Min | Max |
|
||||
| --- | --- | --- |
|
||||
| 80 | 50 | 100 |
|
||||
| 90 | 50 | 100 |
|
||||
|
||||
---
|
||||
|
||||
|
@ -1472,6 +1482,76 @@ Yaw Iterm is frozen when bank angle is above this threshold [degrees]. This solv
|
|||
|
||||
---
|
||||
|
||||
### geozone_avoid_altitude_range
|
||||
|
||||
Altitude range in which an attempt is made to avoid a geozone upwards
|
||||
|
||||
| Default | Min | Max |
|
||||
| --- | --- | --- |
|
||||
| 5000 | 0 | 1000000 |
|
||||
|
||||
---
|
||||
|
||||
### geozone_detection_distance
|
||||
|
||||
Distance from which a geozone is detected
|
||||
|
||||
| Default | Min | Max |
|
||||
| --- | --- | --- |
|
||||
| 50000 | 0 | 1000000 |
|
||||
|
||||
---
|
||||
|
||||
### geozone_mr_stop_distance
|
||||
|
||||
Distance in which multirotors stops before the border
|
||||
|
||||
| Default | Min | Max |
|
||||
| --- | --- | --- |
|
||||
| 15000 | 0 | 100000 |
|
||||
|
||||
---
|
||||
|
||||
### geozone_no_way_home_action
|
||||
|
||||
Action if RTH with active geozones is unable to calculate a course to home
|
||||
|
||||
| Default | Min | Max |
|
||||
| --- | --- | --- |
|
||||
| RTH | | |
|
||||
|
||||
---
|
||||
|
||||
### geozone_safe_altitude_distance
|
||||
|
||||
Vertical distance that must be maintained to the upper and lower limits of the zone.
|
||||
|
||||
| Default | Min | Max |
|
||||
| --- | --- | --- |
|
||||
| 1000 | 0 | 10000 |
|
||||
|
||||
---
|
||||
|
||||
### geozone_safehome_as_inclusive
|
||||
|
||||
Treat nearest safehome as inclusive geozone
|
||||
|
||||
| Default | Min | Max |
|
||||
| --- | --- | --- |
|
||||
| OFF | OFF | ON |
|
||||
|
||||
---
|
||||
|
||||
### geozone_safehome_zone_action
|
||||
|
||||
Fence action for safehome zone
|
||||
|
||||
| Default | Min | Max |
|
||||
| --- | --- | --- |
|
||||
| NONE | | |
|
||||
|
||||
---
|
||||
|
||||
### gimbal_pan_channel
|
||||
|
||||
Gimbal pan rc channel index. 0 is no channel.
|
||||
|
@ -2948,7 +3028,7 @@ If enabled, motor will stop when throttle is low on this mixer_profile
|
|||
|
||||
| Default | Min | Max |
|
||||
| --- | --- | --- |
|
||||
| OFF | OFF | ON |
|
||||
| ON | OFF | ON |
|
||||
|
||||
---
|
||||
|
||||
|
@ -3048,7 +3128,7 @@ Adjusts the deceleration response of fixed wing altitude control as the target a
|
|||
|
||||
| Default | Min | Max |
|
||||
| --- | --- | --- |
|
||||
| 20 | 5 | 100 |
|
||||
| 40 | 5 | 100 |
|
||||
|
||||
---
|
||||
|
||||
|
@ -3354,7 +3434,7 @@ Launch throttle - throttle to be set during launch sequence (pwm units)
|
|||
|
||||
### nav_fw_launch_timeout
|
||||
|
||||
Maximum time for launch sequence to be executed. After this time LAUNCH mode will be turned off and regular flight mode will take over (ms)
|
||||
Maximum time for launch sequence to continue after throwing. After this time LAUNCH mode will end and regular flight mode will take over (ms)
|
||||
|
||||
| Default | Min | Max |
|
||||
| --- | --- | --- |
|
||||
|
@ -3532,6 +3612,16 @@ D gain of altitude PID controller (Fixedwing)
|
|||
|
||||
---
|
||||
|
||||
### nav_fw_pos_z_ff
|
||||
|
||||
FF gain of altitude PID controller (Fixedwing)
|
||||
|
||||
| Default | Min | Max |
|
||||
| --- | --- | --- |
|
||||
| 10 | 0 | 255 |
|
||||
|
||||
---
|
||||
|
||||
### nav_fw_pos_z_i
|
||||
|
||||
I gain of altitude PID controller (Fixedwing)
|
||||
|
@ -3548,7 +3638,7 @@ P gain of altitude PID controller (Fixedwing)
|
|||
|
||||
| Default | Min | Max |
|
||||
| --- | --- | --- |
|
||||
| 40 | 0 | 255 |
|
||||
| 30 | 0 | 255 |
|
||||
|
||||
---
|
||||
|
||||
|
|
63
docs/VTOL.md
|
@ -113,7 +113,7 @@ set mc_iterm_relax = RPY
|
|||
save
|
||||
```
|
||||
|
||||
# STEP1&2: Configuring as a Normal fixed-wing/Multi-Copter in two profiles separately
|
||||
# STEP1: Configuring as a normal fixed-wing in Profile 1
|
||||
|
||||
1. **Select the fisrt Mixer Profile and PID Profile:**
|
||||
- In the CLI, switch to the mixer_profile and pid_profile you wish to set first. You can also switch mixer_profile/pid_profile through gui if with aforementioned presets loaded.
|
||||
|
@ -132,7 +132,10 @@ save
|
|||
|
||||

|
||||
|
||||
3. **Switch to Another Mixer Profile with PID Profile:**
|
||||
|
||||
# STEP2: Configuring as a Multi-Copter in Profile 2
|
||||
|
||||
1. **Switch to Another Mixer Profile with PID Profile:**
|
||||
- In the CLI, switch to another mixer_profile along with the appropriate pid_profile. You can also switch mixer_profile/pid_profile through gui if with aforementioned presets loaded.
|
||||
```
|
||||
mixer_profile 2
|
||||
|
@ -141,7 +144,7 @@ save
|
|||
save
|
||||
```
|
||||
|
||||
4. **Configure the Multi-Copter/fixed-wing:**
|
||||
2. **Configure the Multicopter/tricopter:**
|
||||
- Set up your multi-copter/fixed-wing as usual, this time for mixer_profile 2 and pid_profile 2.
|
||||
- Utilize the 'MAX' input in the servo mixer to tilt the motors without altering the servo midpoint.
|
||||
- At this stage, focus on configuring profile-specific settings. You can streamline this process by copying and pasting the default PID settings.
|
||||
|
@ -174,7 +177,59 @@ save
|
|||
|
||||
Conduct a bench test on the model (without props attached). The model can now switch between fixed-wing and multi-copter modes while armed. Furthermore, it is capable of mid-air switching, resulting in an immediate stall upon entering fixed-wing profile
|
||||
|
||||
# STEP4: Transition Mixing (Multi-Rotor Profile)(Recommended)
|
||||
# STEP4: Tilting Servo Setup (Recommended)
|
||||
### Setting up the tilting servos to operate correclty is crucial for correct yaw control of the craft. Using the default setup works, but will most likely result in your craft crawling forward with evey yaw input.
|
||||
The steps below describe how you can fine-tune the tilting servos such as to obtian the desired result.
|
||||
|
||||
1. **Set the tilt servos at 45 degrees:**
|
||||
- Connect and power the tilting servos with your flight controller.
|
||||
- Enter transition mode (your switch should be in the mid-position).
|
||||
- Check from the Outputs tab output that the tilt servo channels are exactly at 1500μs.
|
||||
- In this mode, your tilt servos should be at the 45-degree position and you can now mount the motor and prop to your tilt servo such that the angle of the motor mounting plate is at 45 degrees upwards.
|
||||
- NOTE1: If you have dedicated tilt servos, you may have engraved indeces on the servos and tilting motor sassembly to help you with this step. If the servos don't end up exactly at 45 degrees due to the teeth on the servo and the control arm/plate, don't worry, this will be automatically adjusted after completing the other steps below.
|
||||
- NOTE2: If you are using control rods to adjust the tilt of the servos, adjust the lenth of your control rod and the position of the control arm position the control arm as close as possible to the mid position. It will depend on the oriatation of the servo, but generally speaking, the control arm of the servo should be pointed perpendicular to the fuselage when the motor mounts are at the 45 degree setting.
|
||||
|
||||
2. **Switch to Multicopter/Tricopter:**
|
||||
- Assuming that you have set up your mixer similar to STEP1 and STEP2, you can now switch to the tricopter/multicopter mode and your servos should be tilting the motors upwards. If this is not the case, reverse the servo(s) in the Outputs tab such that the servo(s) is/are pointed upwards.
|
||||
- It is OK for the servos not to point exactly 90 degrees upwards, but they should be as close as possible to that position.
|
||||
- Also, ensure that your MAX values in the Mixer tab are at 100 and -100, so that your servo will move to the maximum position, as shown in the screenshots in STEP1 and STEP2.
|
||||
|
||||
3. **Adjust the maximum throws for the Multicopter/Tricopter mode:**
|
||||
- While in tricopter mode, go to the Outputs tab and adjust the endpoints MIN and MAX values such that when your motors are pointed slightly backwards.
|
||||
- Rotate the prop such that it is pointed backwards towards the wing/motor mount and ensure that the gap is the same on both sides by adjusting the MIN and MAX values for the tilt servo channels.
|
||||
- NOTE: You can check the distance with calipers or gauge blocks. Alternatively, you can adjust the MIN and MAX for your tilting servos such that the props are just touching the top of the wing or motor mount, and then you can increase/degrease the MIN and MAX values for each channel by the same ammount for both servos. This should ensure that you have the same gap between the tip of the prop and the wing or motor mount for both sides.
|
||||
|
||||
4. **Adjust the minimum position for the Fixed-wing mode:**
|
||||
- Repeat the same step as point 3 with the model in fixed-wing mode, where the servos are tilted forwards.
|
||||
- For this step, you just have to make sure that the motors are pointed exactly forwards.
|
||||
- You can do this by adjusting the respective MIN and MAX values in the Output tab for the tilt servo channels while in fixed-wing mode.
|
||||
- NOTE: Ensuring that your servos are tilted exactly forward is a crucial step as it can cause the plane to roll slightly if that it is not the case. However, ensuring the exact aligment will depend on your specific setup. If you are using dedicated tilting motor servos rather than standard servos with control arms and pushrods, you can make sure that you are exact by measuring the distance between the front edge of the tilting servo and the of the motor mounting plate. If the disances are the uniform across each mount and same on both motors, your servos are pointed forwads correctly.
|
||||
|
||||
5. **Adjsut the vertival position of the tilt servos:**
|
||||
- Switch back to multicopter/tricopter mode and open the Mixer tab.
|
||||
- Start adjusting the `MAX` mixer lines from STEP2 such that the servos are pointed exactly upwards. In other words, start reducing the values of 100 and -100 to something like 80 and -80 until the motors are are pointed exaxctly upwards.
|
||||
- You will have to `Save & reboot` for adjustement for the changes to take effect, so be patient, take your time and don't forget to `Save & reboot`.
|
||||
- Move the YAW stick to either extreme position and ensure that the servos are tilting the motors both forwards and backwards.
|
||||
- NOTE: When yawing fully left, the left motor should tilt backwards and the right motor should tilt forwards.
|
||||
|
||||
6. **Adjsut the throws of the tilt servos:**
|
||||
- The final step is to adjust the throws of the servos such that they are the same in both directions.
|
||||
- To do this, move back to the Mixer tab while in multicopter/tricopter mode and start adjusting the previously set up 50 and -50 values from the Stabilised Yaw lines.
|
||||
- You can try with lower values of about 30 and -30 and then increase the values until you reach the maximum travel point.
|
||||
- NOTE: The maximum is reached when both servos are moving the same ammount in oposite directions and one servo does not continue to move after the other has stopped.
|
||||
|
||||
7. **Check correct operation and direction:**
|
||||
- Cycle back and forth between the plane, transition and tricopter modes to make sure that your servos are maintaining the same setting.
|
||||
- For the fixed wing setting, your tilt servos should point the motors exactly forwards.
|
||||
- For the multicoper/tricopter mode, the tilt servos should point the motors exactly upwards and when moving the yaw stick, both servos should tilt the motors the same ammount in opposite directions.
|
||||
|
||||
Optional Setup Step for Tilt Servos:
|
||||
|
||||
8. **Reversing tilt servos and mixer signs:**
|
||||
If you have set up the mixer as suggested in STEP1 and STEP2, you may have to deal with negative values for the mixer. You may wish to reverese a servo so that you don't have to deal with the negative signs. In that case, you may have to adjust the MIN and MAX values from point 4 again, so that your tilt servos are operating correctly. Check the operation of the servos once again for the YAW control in multicopter/tricipter mode as well as the horixontal position of the tilt servos in fixed-wing mode.
|
||||
|
||||
|
||||
# STEP5: Transition Mixing (Multi-Rotor Profile)(Recommended)
|
||||
### Transition Mixing is typically useful in multi-copter profile to gain airspeed in prior to entering the fixed-wing profile. When the `MIXER TRANSITION` mode is activated, the associated motor or servo will move according to your configured Transition Mixing.
|
||||
|
||||
Please note that transition input is disabled when a navigation mode is activated. The use of Transition Mixing is necessary to enable additional features such as VTOL RTH with out stalling.
|
||||
|
|
|
@ -59,6 +59,12 @@ More target options:
|
|||
* Note that in multirotor configuration, servos are not enabled on S5 and S6
|
||||
* Uses target **OMNIBUSF4V6**
|
||||
|
||||
For the Omnibus V6 and the Fireworks V2 boards, run the following command in the CLI tab to select the correct accelerometer / gyro:
|
||||
|
||||
set gyro_to_use = 1
|
||||
set acc_hardware = auto
|
||||
save
|
||||
|
||||
|
||||
### [Omnibus F4 Pro](https://inavflight.com/shop/p/OMNIBUSF4PRO)
|
||||
|
||||
|
|
3
docs/boards/RADIOLINKF722.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# RADIOLINKF722
|
||||
|
||||
> Notice: DSHOT does not work on M6 output. If using M6, please use a different motor protocol.
|
74
docs/development/Converting Betaflight Targets.md
Normal file
|
@ -0,0 +1,74 @@
|
|||
If your flight controller does not have an official INAV target, it is possible to use src/utils/bf2inav.py script to generate a good starting point for an unofficial INAV target.
|
||||
|
||||
This script can read the config.h from [Betaflight's target configuration repository](https://github.com/betaflight/config) and it currently supports STM32F405, STM32F722, STM32F745, STM32H743 and AT32F435 targets.
|
||||
Locate your Flight Controller target config.h in BetaFlight's repo, eg.: [config.h](https://github.com/betaflight/config/blob/master/configs/BETAFPVF405/config.h), for BETAFPVF435 target.
|
||||
|
||||
It is also advisable to record the output of the timer command from BetaFlight, as it will provide useful information on `timer` usage that can be used to adjust the generated target later.
|
||||
|
||||
```
|
||||
# timer
|
||||
timer B08 AF3
|
||||
# pin B08: TIM10 CH1 (AF3)
|
||||
timer C08 AF3
|
||||
# pin C08: TIM8 CH3 (AF3)
|
||||
timer B00 AF2
|
||||
# pin B00: TIM3 CH3 (AF2)
|
||||
timer B01 AF2
|
||||
# pin B01: TIM3 CH4 (AF2)
|
||||
timer A03 AF1
|
||||
# pin A03: TIM2 CH4 (AF1)
|
||||
timer A02 AF1
|
||||
# pin A02: TIM2 CH3 (AF1)
|
||||
timer B06 AF2
|
||||
# pin B06: TIM4 CH1 (AF2)
|
||||
timer A08 AF1
|
||||
# pin A08: TIM1 CH1 (AF1)
|
||||
timer A09 AF1
|
||||
# pin A09: TIM1 CH2 (AF1)
|
||||
timer A10 AF1
|
||||
# pin A10: TIM1 CH3 (AF1)
|
||||
```
|
||||
In the above example, `pin B08: TIM10 CH1 (AF3)` means that pind to CH1. This information can be used to fix the generated timer assigned to match BetaFlight's allocation by editing the `target.c` file generated by the `bf2inav.py` script.
|
||||
|
||||
|
||||
Using the BETAFPVF405 target mentioned above, to create the target now we need to:
|
||||
|
||||
1. Download INAV source code and be able to build
|
||||
2. Download the config.h from BetaFlight repository
|
||||
3. Create a target folder that will be used as the output folder for the `bf2inav.py` script, eg: `inav/src/main/targets/BETAFPVF405`
|
||||
4. Navigate to the script folder in `inav/src/utils/`
|
||||
5. `python3 ./bf2inav.py -i config.h -o ../main/target/BETAFPVF405/`
|
||||
6. Edit generated `target.c` and chose the correct timer definitions to match Betaflight's timer definitions.
|
||||
```
|
||||
timerHardware_t timerHardware[] = {
|
||||
DEF_TIM(TIM3, CH3, PB0, TIM_USE_OUTPUT_AUTO, 0, 0),
|
||||
//DEF_TIM(TIM8, CH2N, PB0, TIM_USE_OUTPUT_AUTO, 0, 0),
|
||||
//DEF_TIM(TIM1, CH2N, PB0, TIM_USE_OUTPUT_AUTO, 0, 0),
|
||||
|
||||
DEF_TIM(TIM3, CH4, PB1, TIM_USE_OUTPUT_AUTO, 0, 0),
|
||||
//DEF_TIM(TIM8, CH3N, PB1, TIM_USE_OUTPUT_AUTO, 0, 0),
|
||||
//DEF_TIM(TIM1, CH3N, PB1, TIM_USE_OUTPUT_AUTO, 0, 0),
|
||||
|
||||
//DEF_TIM(TIM5, CH4, PA3, TIM_USE_OUTPUT_AUTO, 0, 0),
|
||||
//DEF_TIM(TIM9, CH2, PA3, TIM_USE_OUTPUT_AUTO, 0, 0),
|
||||
DEF_TIM(TIM2, CH4, PA3, TIM_USE_OUTPUT_AUTO, 0, 0),
|
||||
|
||||
//DEF_TIM(TIM5, CH3, PA2, TIM_USE_OUTPUT_AUTO, 0, 0),
|
||||
//DEF_TIM(TIM9, CH1, PA2, TIM_USE_OUTPUT_AUTO, 0, 0),
|
||||
DEF_TIM(TIM2, CH3, PA2, TIM_USE_OUTPUT_AUTO, 0, 0),
|
||||
|
||||
DEF_TIM(TIM8, CH3, PC8, TIM_USE_OUTPUT_AUTO, 0, 0),
|
||||
//DEF_TIM(TIM3, CH3, PC8, TIM_USE_OUTPUT_AUTO, 0, 0),
|
||||
|
||||
DEF_TIM(TIM1, CH1, PA8, TIM_USE_OUTPUT_AUTO, 0, 0),
|
||||
|
||||
//DEF_TIM(TIM3, CH1, PB4, TIM_USE_BEEPER, 0, 0),
|
||||
|
||||
DEF_TIM(TIM4, CH1, PB6, TIM_USE_LED, 0, 0),
|
||||
|
||||
};
|
||||
```
|
||||
In this particular example, PA3, PA2 were changed to match Betaflight's mapping, and the timer PB4 was disabled, due to a timer conflict. Normal channels are prefered over N channels (CH1, over CH1N) or C channels in AT32 architectures.
|
||||
7. Now update yout build scripts by running `cmake` and build the target you just created. The target name can be checked in the generated `CMakeLists.txt`, but should match the Betaflight target name.
|
||||
|
||||
For information on how to build INAV, check the documents in the [docs/development](https://github.com/iNavFlight/inav/tree/master/docs/development) folder.
|
|
@ -0,0 +1,186 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file adafruit_802_conf.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file includes the nucleo configuration and errno files
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef ADAFRUIT_802_CONF_H
|
||||
#define ADAFRUIT_802_CONF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32f4xx_nucleo_conf.h"
|
||||
#include "stm32f4xx_nucleo_errno.h"
|
||||
#include "stm32f4xx_nucleo_bus.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ADAFRUIT_802
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_CONFIG Config
|
||||
* @{
|
||||
*/
|
||||
|
||||
#if !defined (USE_NUCLEO_64) && !defined (USE_NUCLEO_144)
|
||||
#error "Board Pin number not defined"
|
||||
#endif
|
||||
|
||||
/** @defgroup ADAFRUIT_802_CONFIG_Exported_Constants Exported Constants
|
||||
* @{
|
||||
*/
|
||||
#define BUS_SPIx_Init BSP_SPI1_Init
|
||||
#define BUS_SPIx_Recv BSP_SPI1_Recv
|
||||
#define BUS_SPIx_Send BSP_SPI1_Send
|
||||
#define BUS_SPIx_SendRecv BSP_SPI1_SendRecv
|
||||
|
||||
/**
|
||||
* @brief ADC Interface pins
|
||||
* used to detect motion of Joystick available on Adafruit 1.8" TFT shield
|
||||
*/
|
||||
#if defined (USE_NUCLEO_64)
|
||||
#define ADAFRUIT_802_ADCx ADC1
|
||||
#define ADAFRUIT_802_ADCx_CLK_ENABLE() __HAL_RCC_ADC1_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_ADCx_CLK_DISABLE() __HAL_RCC_ADC1_CLK_DISABLE()
|
||||
#define ADAFRUIT_802_ADCx_CHANNEL ADC_CHANNEL_8
|
||||
|
||||
#define ADAFRUIT_802_ADCx_GPIO_PORT GPIOB
|
||||
#define ADAFRUIT_802_ADCx_GPIO_PIN GPIO_PIN_0
|
||||
#define ADAFRUIT_802_ADCx_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_ADCx_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
|
||||
#else /* USE_NUCLEO_144 */
|
||||
#if defined(ADC3)
|
||||
#define ADAFRUIT_802_ADCx ADC3
|
||||
#define ADAFRUIT_802_ADCx_CLK_ENABLE() __HAL_RCC_ADC3_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_ADCx_CLK_DISABLE() __HAL_RCC_ADC3_CLK_DISABLE()
|
||||
#define ADAFRUIT_802_ADCx_CHANNEL ADC_CHANNEL_9
|
||||
|
||||
#define ADAFRUIT_802_ADCx_GPIO_PORT GPIOF
|
||||
#define ADAFRUIT_802_ADCx_GPIO_PIN GPIO_PIN_3
|
||||
#define ADAFRUIT_802_ADCx_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_ADCx_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
|
||||
#else
|
||||
#define ADAFRUIT_802_ADCx ADC1
|
||||
#define ADAFRUIT_802_ADCx_CLK_ENABLE() __HAL_RCC_ADC1_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_ADCx_CLK_DISABLE() __HAL_RCC_ADC1_CLK_DISABLE()
|
||||
#define ADAFRUIT_802_ADCx_CHANNEL ADC_CHANNEL_11
|
||||
|
||||
#define ADAFRUIT_802_ADCx_GPIO_PORT GPIOC
|
||||
#define ADAFRUIT_802_ADCx_GPIO_PIN GPIO_PIN_1
|
||||
#define ADAFRUIT_802_ADCx_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_ADCx_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define ADAFRUIT_802_ADCx_RANK 1U
|
||||
#define ADAFRUIT_802_ADCx_SAMPLETIME ADC_SAMPLETIME_3CYCLES
|
||||
#define ADAFRUIT_802_ADCx_PRESCALER ADC_CLOCKPRESCALER_PCLK_DIV4
|
||||
#define ADAFRUIT_802_ADCx_POLL_TIMEOUT 10U
|
||||
|
||||
#if defined (USE_NUCLEO_64)
|
||||
/**
|
||||
* @brief SD Control Interface pins (shield D4)
|
||||
*/
|
||||
#define ADAFRUIT_802_SD_CS_PIN GPIO_PIN_5
|
||||
#define ADAFRUIT_802_SD_CS_GPIO_PORT GPIOB
|
||||
#define ADAFRUIT_802_SD_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_SD_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
|
||||
|
||||
/**
|
||||
* @brief LCD Control Interface pins (shield D10)
|
||||
*/
|
||||
#define ADAFRUIT_802_LCD_CS_PIN GPIO_PIN_6
|
||||
#define ADAFRUIT_802_LCD_CS_GPIO_PORT GPIOB
|
||||
#define ADAFRUIT_802_LCD_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_LCD_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
|
||||
|
||||
/**
|
||||
* @brief LCD Data/Command Interface pins (shield D8)
|
||||
*/
|
||||
#define ADAFRUIT_802_LCD_DC_PIN GPIO_PIN_9
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_PORT GPIOA
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
|
||||
#else /* USE_NUCLEO_144 */
|
||||
/**
|
||||
* @brief SD Control Interface pins (shield D4)
|
||||
*/
|
||||
#define ADAFRUIT_802_SD_CS_PIN GPIO_PIN_14
|
||||
#define ADAFRUIT_802_SD_CS_GPIO_PORT GPIOF
|
||||
#define ADAFRUIT_802_SD_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_SD_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
|
||||
|
||||
/**
|
||||
* @brief LCD Control Interface pins (shield D10)
|
||||
*/
|
||||
#define ADAFRUIT_802_LCD_CS_PIN GPIO_PIN_14
|
||||
#define ADAFRUIT_802_LCD_CS_GPIO_PORT GPIOD
|
||||
#define ADAFRUIT_802_LCD_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_LCD_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE()
|
||||
|
||||
/**
|
||||
* @brief LCD Data/Command Interface pins (shield D8)
|
||||
*/
|
||||
#define ADAFRUIT_802_LCD_DC_PIN GPIO_PIN_12
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_PORT GPIOF
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief SD Control Lines management
|
||||
*/
|
||||
#define ADAFRUIT_802_SD_CS_LOW() HAL_GPIO_WritePin(ADAFRUIT_802_SD_CS_GPIO_PORT, ADAFRUIT_802_SD_CS_PIN, GPIO_PIN_RESET)
|
||||
#define ADAFRUIT_802_SD_CS_HIGH() HAL_GPIO_WritePin(ADAFRUIT_802_SD_CS_GPIO_PORT, ADAFRUIT_802_SD_CS_PIN, GPIO_PIN_SET)
|
||||
|
||||
/**
|
||||
* @brief LCD Control Lines management
|
||||
*/
|
||||
#define ADAFRUIT_802_LCD_CS_LOW() HAL_GPIO_WritePin(ADAFRUIT_802_LCD_CS_GPIO_PORT, ADAFRUIT_802_LCD_CS_PIN, GPIO_PIN_RESET)
|
||||
#define ADAFRUIT_802_LCD_CS_HIGH() HAL_GPIO_WritePin(ADAFRUIT_802_LCD_CS_GPIO_PORT, ADAFRUIT_802_LCD_CS_PIN, GPIO_PIN_SET)
|
||||
#define ADAFRUIT_802_LCD_DC_LOW() HAL_GPIO_WritePin(ADAFRUIT_802_LCD_DC_GPIO_PORT, ADAFRUIT_802_LCD_DC_PIN, GPIO_PIN_RESET)
|
||||
#define ADAFRUIT_802_LCD_DC_HIGH() HAL_GPIO_WritePin(ADAFRUIT_802_LCD_DC_GPIO_PORT, ADAFRUIT_802_LCD_DC_PIN, GPIO_PIN_SET)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ADAFRUIT_802_CONF_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
@ -0,0 +1,138 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file adafruit_802_conf.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file includes the nucleo configuration and errno files
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef ADAFRUIT_802_CONF_H
|
||||
#define ADAFRUIT_802_CONF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32f7xx_nucleo_conf.h"
|
||||
#include "stm32f7xx_nucleo_errno.h"
|
||||
#include "stm32f7xx_nucleo_bus.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ADAFRUIT_802
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_CONFIG Config
|
||||
* @{
|
||||
*/
|
||||
|
||||
#if !defined (USE_NUCLEO_144)
|
||||
#error "Board Pin number not defined"
|
||||
#endif
|
||||
|
||||
/** @defgroup ADAFRUIT_802_CONFIG_Exported_Constants Exported Constants
|
||||
* @{
|
||||
*/
|
||||
#define BUS_SPIx_Init BSP_SPI1_Init
|
||||
#define BUS_SPIx_Recv BSP_SPI1_Recv
|
||||
#define BUS_SPIx_Send BSP_SPI1_Send
|
||||
#define BUS_SPIx_SendRecv BSP_SPI1_SendRecv
|
||||
|
||||
/**
|
||||
* @brief ADC Interface pins
|
||||
* used to detect motion of Joystick available on Adafruit 1.8" TFT shield
|
||||
*/
|
||||
#if defined (USE_NUCLEO_144)
|
||||
#define NUCLEO_ADCx ADC3
|
||||
#define NUCLEO_ADCx_CLK_ENABLE() __HAL_RCC_ADC3_CLK_ENABLE()
|
||||
#define NUCLEO_ADCx_CLK_DISABLE() __HAL_RCC_ADC3_CLK_DISABLE()
|
||||
#define NUCLEO_ADCx_CHANNEL ADC_CHANNEL_9
|
||||
|
||||
#define NUCLEO_ADCx_GPIO_PORT GPIOF
|
||||
#define NUCLEO_ADCx_GPIO_PIN GPIO_PIN_3
|
||||
#define NUCLEO_ADCx_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
|
||||
#define NUCLEO_ADCx_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
|
||||
|
||||
#define ADAFRUIT_802_ADCx_RANK 1U
|
||||
#define ADAFRUIT_802_ADCx_SAMPLETIME ADC_SAMPLETIME_3CYCLES
|
||||
#define ADAFRUIT_802_ADCx_PRESCALER ADC_CLOCK_SYNC_DIV4
|
||||
#define ADAFRUIT_802_ADCx_POLL_TIMEOUT 10U
|
||||
|
||||
/**
|
||||
* @brief SD Control Interface pins (shield D4)
|
||||
*/
|
||||
#define NUCLEO_SD_CS_PIN GPIO_PIN_14
|
||||
#define NUCLEO_SD_CS_GPIO_PORT GPIOF
|
||||
#define NUCLEO_SD_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
|
||||
#define NUCLEO_SD_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
|
||||
|
||||
/**
|
||||
* @brief LCD Control Interface pins (shield D10)
|
||||
*/
|
||||
#define NUCLEO_LCD_CS_PIN GPIO_PIN_14
|
||||
#define NUCLEO_LCD_CS_GPIO_PORT GPIOD
|
||||
#define NUCLEO_LCD_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
|
||||
#define NUCLEO_LCD_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE()
|
||||
|
||||
/**
|
||||
* @brief LCD Data/Command Interface pins (shield D8)
|
||||
*/
|
||||
#define NUCLEO_LCD_DC_PIN GPIO_PIN_12
|
||||
#define NUCLEO_LCD_DC_GPIO_PORT GPIOF
|
||||
#define NUCLEO_LCD_DC_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
|
||||
#define NUCLEO_LCD_DC_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief SD Control Lines management
|
||||
*/
|
||||
#define SD_CS_LOW() HAL_GPIO_WritePin(NUCLEO_SD_CS_GPIO_PORT, NUCLEO_SD_CS_PIN, GPIO_PIN_RESET)
|
||||
#define SD_CS_HIGH() HAL_GPIO_WritePin(NUCLEO_SD_CS_GPIO_PORT, NUCLEO_SD_CS_PIN, GPIO_PIN_SET)
|
||||
|
||||
/**
|
||||
* @brief LCD Control Lines management
|
||||
*/
|
||||
#define LCD_CS_LOW() HAL_GPIO_WritePin(NUCLEO_LCD_CS_GPIO_PORT, NUCLEO_LCD_CS_PIN, GPIO_PIN_RESET)
|
||||
#define LCD_CS_HIGH() HAL_GPIO_WritePin(NUCLEO_LCD_CS_GPIO_PORT, NUCLEO_LCD_CS_PIN, GPIO_PIN_SET)
|
||||
#define LCD_DC_LOW() HAL_GPIO_WritePin(NUCLEO_LCD_DC_GPIO_PORT, NUCLEO_LCD_DC_PIN, GPIO_PIN_RESET)
|
||||
#define LCD_DC_HIGH() HAL_GPIO_WritePin(NUCLEO_LCD_DC_GPIO_PORT, NUCLEO_LCD_DC_PIN, GPIO_PIN_SET)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ADAFRUIT_802_CONF_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
@ -0,0 +1,136 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file adafruit_802_conf.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file includes the nucleo configuration and errno files
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef ADAFRUIT_802_CONF_H
|
||||
#define ADAFRUIT_802_CONF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32g4xx_nucleo_conf.h"
|
||||
#include "stm32g4xx_nucleo_errno.h"
|
||||
#include "stm32g4xx_nucleo_bus.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ADAFRUIT_802
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_CONFIG Config
|
||||
* @{
|
||||
*/
|
||||
|
||||
#if !defined (USE_NUCLEO_64)
|
||||
#error "Board Pin number not defined"
|
||||
#endif
|
||||
|
||||
/** @defgroup ADAFRUIT_802_CONFIG_Exported_Constants Exported Constants
|
||||
* @{
|
||||
*/
|
||||
#define BUS_SPIx_Init BSP_SPI1_Init
|
||||
#define BUS_SPIx_Recv BSP_SPI1_Recv
|
||||
#define BUS_SPIx_Send BSP_SPI1_Send
|
||||
#define BUS_SPIx_SendRecv BSP_SPI1_SendRecv
|
||||
|
||||
/**
|
||||
* @brief ADC Interface pins
|
||||
* used to detect motion of Joystick available on Adafruit 1.8" TFT shield
|
||||
*/
|
||||
#define ADAFRUIT_802_ADCx ADC1
|
||||
#define ADAFRUIT_802_ADCx_CLK_ENABLE() __HAL_RCC_ADC12_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_ADCx_CLK_DISABLE() __HAL_RCC_ADC12_CLK_DISABLE()
|
||||
#define ADAFRUIT_802_ADCx_CHANNEL ADC_CHANNEL_15
|
||||
|
||||
#define ADAFRUIT_802_ADCx_GPIO_PORT GPIOB
|
||||
#define ADAFRUIT_802_ADCx_GPIO_PIN GPIO_PIN_0
|
||||
#define ADAFRUIT_802_ADCx_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_ADCx_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
|
||||
|
||||
#define ADAFRUIT_802_ADCx_RANK ADC_REGULAR_RANK_1
|
||||
#define ADAFRUIT_802_ADCx_SAMPLETIME ADC_SAMPLETIME_24CYCLES_5
|
||||
#define ADAFRUIT_802_ADCx_PRESCALER ADC_CLOCK_SYNC_PCLK_DIV4
|
||||
#define ADAFRUIT_802_ADCx_POLL_TIMEOUT 10U
|
||||
|
||||
/**
|
||||
* @brief SD Control Interface pins (shield D4)
|
||||
*/
|
||||
#define ADAFRUIT_802_SD_CS_PIN GPIO_PIN_5
|
||||
#define ADAFRUIT_802_SD_CS_GPIO_PORT GPIOB
|
||||
#define ADAFRUIT_802_SD_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_SD_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
|
||||
|
||||
/**
|
||||
* @brief LCD Control Interface pins (shield D10)
|
||||
*/
|
||||
#define ADAFRUIT_802_LCD_CS_PIN GPIO_PIN_6
|
||||
#define ADAFRUIT_802_LCD_CS_GPIO_PORT GPIOB
|
||||
#define ADAFRUIT_802_LCD_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_LCD_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
|
||||
|
||||
/**
|
||||
* @brief LCD Data/Command Interface pins (shield D8)
|
||||
*/
|
||||
#define ADAFRUIT_802_LCD_DC_PIN GPIO_PIN_9
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_PORT GPIOA
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
|
||||
|
||||
/**
|
||||
* @brief SD Control Lines management
|
||||
*/
|
||||
#define ADAFRUIT_802_SD_CS_LOW() HAL_GPIO_WritePin(ADAFRUIT_802_SD_CS_GPIO_PORT, ADAFRUIT_802_SD_CS_PIN, GPIO_PIN_RESET)
|
||||
#define ADAFRUIT_802_SD_CS_HIGH() HAL_GPIO_WritePin(ADAFRUIT_802_SD_CS_GPIO_PORT, ADAFRUIT_802_SD_CS_PIN, GPIO_PIN_SET)
|
||||
|
||||
/**
|
||||
* @brief LCD Control Lines management
|
||||
*/
|
||||
#define ADAFRUIT_802_LCD_CS_LOW() HAL_GPIO_WritePin(ADAFRUIT_802_LCD_CS_GPIO_PORT, ADAFRUIT_802_LCD_CS_PIN, GPIO_PIN_RESET)
|
||||
#define ADAFRUIT_802_LCD_CS_HIGH() HAL_GPIO_WritePin(ADAFRUIT_802_LCD_CS_GPIO_PORT, ADAFRUIT_802_LCD_CS_PIN, GPIO_PIN_SET)
|
||||
#define ADAFRUIT_802_LCD_DC_LOW() HAL_GPIO_WritePin(ADAFRUIT_802_LCD_DC_GPIO_PORT, ADAFRUIT_802_LCD_DC_PIN, GPIO_PIN_RESET)
|
||||
#define ADAFRUIT_802_LCD_DC_HIGH() HAL_GPIO_WritePin(ADAFRUIT_802_LCD_DC_GPIO_PORT, ADAFRUIT_802_LCD_DC_PIN, GPIO_PIN_SET)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ADAFRUIT_802_CONF_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
@ -0,0 +1,161 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file adafruit_802_conf.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file includes the nucleo configuration and errno files
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef ADAFRUIT_802_CONF_H
|
||||
#define ADAFRUIT_802_CONF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32h7xx_nucleo_conf.h"
|
||||
#include "stm32h7xx_nucleo_errno.h"
|
||||
#include "stm32h7xx_nucleo_bus.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ADAFRUIT_802
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_CONFIG Config
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_CONFIG_Exported_Constants Exported Constants
|
||||
* @{
|
||||
*/
|
||||
#define BUS_SPIx_Init BSP_SPI1_Init
|
||||
#define BUS_SPIx_Recv BSP_SPI1_Recv
|
||||
#define BUS_SPIx_Send BSP_SPI1_Send
|
||||
#define BUS_SPIx_SendRecv BSP_SPI1_SendRecv
|
||||
|
||||
/**
|
||||
* @brief ADC Interface pins
|
||||
* used to detect motion of Joystick available on Adafruit 1.8" TFT shield
|
||||
*/
|
||||
#if defined (USE_NUCLEO_H745ZI_Q) || defined (USE_NUCLEO_H743ZI2) || defined (USE_NUCLEO_H7A3ZI_Q)
|
||||
#define ADAFRUIT_802_ADCx ADC1
|
||||
#define ADAFRUIT_802_ADCx_CLK_ENABLE() __HAL_RCC_ADC12_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_ADCx_CLK_DISABLE() __HAL_RCC_ADC12_CLK_DISABLE()
|
||||
#define ADAFRUIT_802_ADCx_CHANNEL ADC_CHANNEL_5
|
||||
|
||||
#define ADAFRUIT_802_ADCx_GPIO_PORT GPIOB
|
||||
#define ADAFRUIT_802_ADCx_GPIO_PIN GPIO_PIN_1
|
||||
#define ADAFRUIT_802_ADCx_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_ADCx_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
|
||||
#else /* USE_NUCLEO_H743ZI */
|
||||
#define ADAFRUIT_802_ADCx ADC3
|
||||
#define ADAFRUIT_802_ADCx_CLK_ENABLE() __HAL_RCC_ADC3_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_ADCx_CLK_DISABLE() __HAL_RCC_ADC3_CLK_DISABLE()
|
||||
#define ADAFRUIT_802_ADCx_CHANNEL ADC_CHANNEL_5
|
||||
|
||||
#define ADAFRUIT_802_ADCx_GPIO_PORT GPIOF
|
||||
#define ADAFRUIT_802_ADCx_GPIO_PIN GPIO_PIN_3
|
||||
#define ADAFRUIT_802_ADCx_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_ADCx_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
|
||||
#endif
|
||||
|
||||
#define ADAFRUIT_802_ADCx_RANK ADC_REGULAR_RANK_1
|
||||
#define ADAFRUIT_802_ADCx_SAMPLETIME ADC_SAMPLETIME_2CYCLES_5
|
||||
#define ADAFRUIT_802_ADCx_PRESCALER ADC_CLOCKPRESCALER_PCLK_DIV4
|
||||
#define ADAFRUIT_802_ADCx_POLL_TIMEOUT 10U
|
||||
|
||||
/**
|
||||
* @brief SD Control Interface pins (shield D4)
|
||||
*/
|
||||
#define ADAFRUIT_802_SD_CS_PIN GPIO_PIN_14
|
||||
#if defined (USE_NUCLEO_H745ZI_Q) || defined (USE_NUCLEO_H743ZI2) || defined (USE_NUCLEO_H7A3ZI_Q)
|
||||
#define ADAFRUIT_802_SD_CS_GPIO_PORT GPIOE
|
||||
#define ADAFRUIT_802_SD_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_SD_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE()
|
||||
#else /* USE_NUCLEO_H743ZI */
|
||||
#define ADAFRUIT_802_SD_CS_GPIO_PORT GPIOF
|
||||
#define ADAFRUIT_802_SD_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_SD_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
|
||||
#endif
|
||||
/**
|
||||
* @brief LCD Control Interface pins (shield D10)
|
||||
*/
|
||||
#define ADAFRUIT_802_LCD_CS_PIN GPIO_PIN_14
|
||||
#define ADAFRUIT_802_LCD_CS_GPIO_PORT GPIOD
|
||||
#define ADAFRUIT_802_LCD_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_LCD_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE()
|
||||
|
||||
/**
|
||||
* @brief LCD Data/Command Interface pins (shield D8)
|
||||
*/
|
||||
#if defined (USE_NUCLEO_H743ZI2)
|
||||
#define ADAFRUIT_802_LCD_DC_PIN GPIO_PIN_3
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_PORT GPIOF
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
|
||||
#elif defined (USE_NUCLEO_H745ZI_Q) || defined (USE_NUCLEO_H7A3ZI_Q)
|
||||
#define ADAFRUIT_802_LCD_DC_PIN GPIO_PIN_9
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_PORT GPIOG
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_CLK_DISABLE() __HAL_RCC_GPIOG_CLK_DISABLE()
|
||||
#else /* USE_NUCLEO_H743ZI */
|
||||
#define ADAFRUIT_802_LCD_DC_PIN GPIO_PIN_12
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_PORT GPIOF
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
|
||||
#endif
|
||||
/**
|
||||
* @brief SD Control Lines management
|
||||
*/
|
||||
#define ADAFRUIT_802_SD_CS_LOW() HAL_GPIO_WritePin(ADAFRUIT_802_SD_CS_GPIO_PORT, ADAFRUIT_802_SD_CS_PIN, GPIO_PIN_RESET)
|
||||
#define ADAFRUIT_802_SD_CS_HIGH() HAL_GPIO_WritePin(ADAFRUIT_802_SD_CS_GPIO_PORT, ADAFRUIT_802_SD_CS_PIN, GPIO_PIN_SET)
|
||||
|
||||
/**
|
||||
* @brief LCD Control Lines management
|
||||
*/
|
||||
#define ADAFRUIT_802_LCD_CS_LOW() HAL_GPIO_WritePin(ADAFRUIT_802_LCD_CS_GPIO_PORT, ADAFRUIT_802_LCD_CS_PIN, GPIO_PIN_RESET)
|
||||
#define ADAFRUIT_802_LCD_CS_HIGH() HAL_GPIO_WritePin(ADAFRUIT_802_LCD_CS_GPIO_PORT, ADAFRUIT_802_LCD_CS_PIN, GPIO_PIN_SET)
|
||||
#define ADAFRUIT_802_LCD_DC_LOW() HAL_GPIO_WritePin(ADAFRUIT_802_LCD_DC_GPIO_PORT, ADAFRUIT_802_LCD_DC_PIN, GPIO_PIN_RESET)
|
||||
#define ADAFRUIT_802_LCD_DC_HIGH() HAL_GPIO_WritePin(ADAFRUIT_802_LCD_DC_GPIO_PORT, ADAFRUIT_802_LCD_DC_PIN, GPIO_PIN_SET)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ADAFRUIT_802_CONF_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
@ -0,0 +1,172 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file adafruit_802_conf.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file includes the nucleo configuration and errno files
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef ADAFRUIT_802_CONF_H
|
||||
#define ADAFRUIT_802_CONF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32l4xx_nucleo_conf.h"
|
||||
#include "stm32l4xx_nucleo_errno.h"
|
||||
#include "stm32l4xx_nucleo_bus.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ADAFRUIT_802
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_CONFIG Config
|
||||
* @{
|
||||
*/
|
||||
|
||||
#if !defined (USE_NUCLEO_64) && !defined (USE_NUCLEO_144)
|
||||
#error "Board Pin number not defined"
|
||||
#endif
|
||||
|
||||
/** @defgroup ADAFRUIT_802_CONFIG_Exported_Constants Exported Constants
|
||||
* @{
|
||||
*/
|
||||
#define BUS_SPIx_Init BSP_SPI1_Init
|
||||
#define BUS_SPIx_Recv BSP_SPI1_Recv
|
||||
#define BUS_SPIx_Send BSP_SPI1_Send
|
||||
#define BUS_SPIx_SendRecv BSP_SPI1_SendRecv
|
||||
|
||||
/**
|
||||
* @brief ADC Interface pins
|
||||
* used to detect motion of Joystick available on Adafruit 1.8" TFT shield
|
||||
*/
|
||||
|
||||
#define ADAFRUIT_802_ADCx ADC1
|
||||
#define ADAFRUIT_802_ADCx_CLK_ENABLE() __HAL_RCC_ADC_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_ADCx_CLK_DISABLE() __HAL_RCC_ADC_CLK_DISABLE()
|
||||
|
||||
#if defined (USE_NUCLEO_64)
|
||||
#define ADAFRUIT_802_ADCx_CHANNEL ADC_CHANNEL_15
|
||||
#define ADAFRUIT_802_ADCx_GPIO_PORT GPIOB
|
||||
#define ADAFRUIT_802_ADCx_GPIO_PIN GPIO_PIN_0
|
||||
#define ADAFRUIT_802_ADCx_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_ADCx_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
|
||||
#else /* USE_NUCLEO_144 */
|
||||
#define ADAFRUIT_802_ADCx_CHANNEL ADC_CHANNEL_2
|
||||
|
||||
#define ADAFRUIT_802_ADCx_GPIO_PORT GPIOC
|
||||
#define ADAFRUIT_802_ADCx_GPIO_PIN GPIO_PIN_1
|
||||
#define ADAFRUIT_802_ADCx_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_ADCx_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
|
||||
#endif
|
||||
|
||||
#define ADAFRUIT_802_ADCx_RANK 1U
|
||||
#define ADAFRUIT_802_ADCx_SAMPLETIME ADC_SAMPLETIME_24CYCLES_5
|
||||
#define ADAFRUIT_802_ADCx_PRESCALER ADC_CLOCK_SYNC_PCLK_DIV4
|
||||
#define ADAFRUIT_802_ADCx_POLL_TIMEOUT 10U
|
||||
|
||||
#if defined (USE_NUCLEO_64)
|
||||
/**
|
||||
* @brief SD Control Interface pins (shield D4)
|
||||
*/
|
||||
#define ADAFRUIT_802_SD_CS_PIN GPIO_PIN_5
|
||||
#define ADAFRUIT_802_SD_CS_GPIO_PORT GPIOB
|
||||
#define ADAFRUIT_802_SD_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_SD_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
|
||||
|
||||
/**
|
||||
* @brief LCD Control Interface pins (shield D10)
|
||||
*/
|
||||
#define ADAFRUIT_802_LCD_CS_PIN GPIO_PIN_6
|
||||
#define ADAFRUIT_802_LCD_CS_GPIO_PORT GPIOB
|
||||
#define ADAFRUIT_802_LCD_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_LCD_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
|
||||
|
||||
/**
|
||||
* @brief LCD Data/Command Interface pins (shield D8)
|
||||
*/
|
||||
#define ADAFRUIT_802_LCD_DC_PIN GPIO_PIN_9
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_PORT GPIOA
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
|
||||
#else /* USE_NUCLEO_144 */
|
||||
/**
|
||||
* @brief SD Control Interface pins (shield D4)
|
||||
*/
|
||||
#define ADAFRUIT_802_SD_CS_PIN GPIO_PIN_14
|
||||
#define ADAFRUIT_802_SD_CS_GPIO_PORT GPIOF
|
||||
#define ADAFRUIT_802_SD_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_SD_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
|
||||
|
||||
/**
|
||||
* @brief LCD Control Interface pins (shield D10)
|
||||
*/
|
||||
#define ADAFRUIT_802_LCD_CS_PIN GPIO_PIN_14
|
||||
#define ADAFRUIT_802_LCD_CS_GPIO_PORT GPIOD
|
||||
#define ADAFRUIT_802_LCD_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_LCD_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE()
|
||||
|
||||
/**
|
||||
* @brief LCD Data/Command Interface pins (shield D8)
|
||||
*/
|
||||
#define ADAFRUIT_802_LCD_DC_PIN GPIO_PIN_12
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_PORT GPIOF
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief SD Control Lines management
|
||||
*/
|
||||
#define ADAFRUIT_802_SD_CS_LOW() HAL_GPIO_WritePin(ADAFRUIT_802_SD_CS_GPIO_PORT, ADAFRUIT_802_SD_CS_PIN, GPIO_PIN_RESET)
|
||||
#define ADAFRUIT_802_SD_CS_HIGH() HAL_GPIO_WritePin(ADAFRUIT_802_SD_CS_GPIO_PORT, ADAFRUIT_802_SD_CS_PIN, GPIO_PIN_SET)
|
||||
|
||||
/**
|
||||
* @brief LCD Control Lines management
|
||||
*/
|
||||
#define ADAFRUIT_802_LCD_CS_LOW() HAL_GPIO_WritePin(ADAFRUIT_802_LCD_CS_GPIO_PORT, ADAFRUIT_802_LCD_CS_PIN, GPIO_PIN_RESET)
|
||||
#define ADAFRUIT_802_LCD_CS_HIGH() HAL_GPIO_WritePin(ADAFRUIT_802_LCD_CS_GPIO_PORT, ADAFRUIT_802_LCD_CS_PIN, GPIO_PIN_SET)
|
||||
#define ADAFRUIT_802_LCD_DC_LOW() HAL_GPIO_WritePin(ADAFRUIT_802_LCD_DC_GPIO_PORT, ADAFRUIT_802_LCD_DC_PIN, GPIO_PIN_RESET)
|
||||
#define ADAFRUIT_802_LCD_DC_HIGH() HAL_GPIO_WritePin(ADAFRUIT_802_LCD_DC_GPIO_PORT, ADAFRUIT_802_LCD_DC_PIN, GPIO_PIN_SET)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ADAFRUIT_802_CONF_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
@ -0,0 +1,133 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file adafruit_802_conf.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file includes the nucleo configuration and errno files
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef ADAFRUIT_802_CONF_H
|
||||
#define ADAFRUIT_802_CONF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32wlxx_nucleo_conf.h"
|
||||
#include "stm32wlxx_nucleo_errno.h"
|
||||
#include "stm32wlxx_nucleo_bus.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ADAFRUIT_802
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_CONFIG Config
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_CONFIG_Exported_Constants Exported Constants
|
||||
* @{
|
||||
*/
|
||||
#define BUS_SPIx_Init BSP_SPI1_Init
|
||||
#define BUS_SPIx_Recv BSP_SPI1_Recv
|
||||
#define BUS_SPIx_Send BSP_SPI1_Send
|
||||
#define BUS_SPIx_SendRecv BSP_SPI1_SendRecv
|
||||
|
||||
/**
|
||||
* @brief ADC Interface pins
|
||||
* used to detect motion of Joystick available on Adafruit 1.8" TFT shield
|
||||
*/
|
||||
|
||||
#define ADAFRUIT_802_ADCx ADC1
|
||||
#define ADAFRUIT_802_ADCx_CLK_ENABLE() __HAL_RCC_ADC_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_ADCx_CLK_DISABLE() __HAL_RCC_ADC_CLK_DISABLE()
|
||||
#define ADAFRUIT_802_ADCx_CHANNEL ADC_CHANNEL_3
|
||||
|
||||
#define ADAFRUIT_802_ADCx_GPIO_PORT GPIOB
|
||||
#define ADAFRUIT_802_ADCx_GPIO_PIN GPIO_PIN_4
|
||||
#define ADAFRUIT_802_ADCx_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_ADCx_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
|
||||
|
||||
#define ADAFRUIT_802_ADCx_RANK ADC_REGULAR_RANK_1
|
||||
#define ADAFRUIT_802_ADCx_SAMPLETIME LL_ADC_SAMPLINGTIME_COMMON_1
|
||||
#define ADAFRUIT_802_ADCx_PRESCALER ADC_CLOCK_SYNC_PCLK_DIV4
|
||||
#define ADAFRUIT_802_ADCx_POLL_TIMEOUT 10U
|
||||
|
||||
/**
|
||||
* @brief SD Control Interface pins (shield D4)
|
||||
*/
|
||||
#define ADAFRUIT_802_SD_CS_PIN GPIO_PIN_5
|
||||
#define ADAFRUIT_802_SD_CS_GPIO_PORT GPIOB
|
||||
#define ADAFRUIT_802_SD_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_SD_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
|
||||
|
||||
/**
|
||||
* @brief LCD Control Interface pins (shield D10)
|
||||
*/
|
||||
#define ADAFRUIT_802_LCD_CS_PIN GPIO_PIN_4
|
||||
#define ADAFRUIT_802_LCD_CS_GPIO_PORT GPIOA
|
||||
#define ADAFRUIT_802_LCD_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_LCD_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
|
||||
|
||||
/**
|
||||
* @brief LCD Data/Command Interface pins (shield D8)
|
||||
*/
|
||||
#define ADAFRUIT_802_LCD_DC_PIN GPIO_PIN_2
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_PORT GPIOC
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
|
||||
#define ADAFRUIT_802_LCD_DC_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
|
||||
|
||||
/**
|
||||
* @brief SD Control Lines management
|
||||
*/
|
||||
#define ADAFRUIT_802_SD_CS_LOW() HAL_GPIO_WritePin(ADAFRUIT_802_SD_CS_GPIO_PORT, ADAFRUIT_802_SD_CS_PIN, GPIO_PIN_RESET)
|
||||
#define ADAFRUIT_802_SD_CS_HIGH() HAL_GPIO_WritePin(ADAFRUIT_802_SD_CS_GPIO_PORT, ADAFRUIT_802_SD_CS_PIN, GPIO_PIN_SET)
|
||||
|
||||
/**
|
||||
* @brief LCD Control Lines management
|
||||
*/
|
||||
#define ADAFRUIT_802_LCD_CS_LOW() HAL_GPIO_WritePin(ADAFRUIT_802_LCD_CS_GPIO_PORT, ADAFRUIT_802_LCD_CS_PIN, GPIO_PIN_RESET)
|
||||
#define ADAFRUIT_802_LCD_CS_HIGH() HAL_GPIO_WritePin(ADAFRUIT_802_LCD_CS_GPIO_PORT, ADAFRUIT_802_LCD_CS_PIN, GPIO_PIN_SET)
|
||||
#define ADAFRUIT_802_LCD_DC_LOW() HAL_GPIO_WritePin(ADAFRUIT_802_LCD_DC_GPIO_PORT, ADAFRUIT_802_LCD_DC_PIN, GPIO_PIN_RESET)
|
||||
#define ADAFRUIT_802_LCD_DC_HIGH() HAL_GPIO_WritePin(ADAFRUIT_802_LCD_DC_GPIO_PORT, ADAFRUIT_802_LCD_DC_PIN, GPIO_PIN_SET)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ADAFRUIT_802_CONF_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
273
lib/main/STM32H7/Drivers/BSP/Adafruit_Shield/Release_Notes.html
Normal file
|
@ -0,0 +1,273 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
<title>Release Notes for Adafruit_Shield Driver</title>
|
||||
<style type="text/css">
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
span.underline{text-decoration: underline;}
|
||||
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="_htmresc/mini-st.css" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-4">
|
||||
<div class="card fluid">
|
||||
<div class="sectione dark">
|
||||
<center>
|
||||
<h1 id="release-notes-for-adafruit_shield-driver"><strong>Release Notes for Adafruit_Shield Driver</strong></h1>
|
||||
<p>Copyright © 2014 STMicroelectronics<br />
|
||||
</p>
|
||||
<a href="https://www.st.com" class="logo"><img src="_htmresc/st_logo.png" alt="ST logo" /></a>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
<h1 id="license">License</h1>
|
||||
This software component is licensed by ST under BSD 3-Clause license, the “License”; You may not use this component except in compliance with the License. You may obtain a copy of the License at:
|
||||
<center>
|
||||
<a href="https://opensource.org/licenses/BSD-3-Clause">https://opensource.org/licenses/BSD-3-Clause</a>
|
||||
</center>
|
||||
<h1 id="purpose">Purpose</h1>
|
||||
<p>The BSP (Board Specific Package) drivers are parts of the STM32Cube package based on the HAL drivers and provide a set of high level APIs relative to the hardware components and features in the evaluation boards, discovery kits and nucleo boards coming with the STM32Cube package for a given STM32 serie.</p>
|
||||
<p>The BSP drivers allow a quick access to the board’s services using high level APIs and without any specific configuration as the link with the HAL and the external components is done in intrinsic within the drivers.</p>
|
||||
<p>From project settings points of view, user has only to add the necessary driver’s files in the workspace and call the needed functions from examples. However some low level configuration functions are weak and can be overridden by the applications if user wants to change some BSP drivers default behavior.</p>
|
||||
</div>
|
||||
<div class="col-sm-12 col-lg-8">
|
||||
<h1 id="update-history">Update History</h1>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section18" checked aria-hidden="true"> <label for="collapse-section18" aria-hidden="true"><strong>V5.0.1 / 13-March-2020</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Minor changes to fix typos</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section17" aria-hidden="true"> <label for="collapse-section17" aria-hidden="true"><strong>V5.0.0 / 25-February-2020</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-1">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Rename GUI_Drv_t into UTILS_LCD_Drv_t</li>
|
||||
</ul>
|
||||
<h2 id="backward-compatibility">Backward Compatibility</h2>
|
||||
<ul>
|
||||
<li>This version breaks the compatibility with previous versions</li>
|
||||
</ul>
|
||||
<h2 id="dependencies">Dependencies</h2>
|
||||
<ul>
|
||||
<li>Components/common v7.0.0</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section16" aria-hidden="true"> <label for="collapse-section16" aria-hidden="true"><strong>V4.0.4 / 15-October-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-2">Main Changes</h2>
|
||||
<ul>
|
||||
<li>adafruit_802.c
|
||||
<ul>
|
||||
<li>Updated to support STM32WLxx devices</li>
|
||||
</ul></li>
|
||||
<li>Add Adafruit_Config/adafruit_802_conf_STM32WLxx_Nucleo.h
|
||||
<ul>
|
||||
<li>Remove support of USE_NUCLEO_H7A3ZI nucleo board</li>
|
||||
</ul></li>
|
||||
<li>Update st_logo.png inclusion path in Release notes</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section15" aria-hidden="true"> <label for="collapse-section15" aria-hidden="true"><strong>V4.0.3 / 25-June-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-3">Main Changes</h2>
|
||||
<ul>
|
||||
<li>adafruit_802_sd.c
|
||||
<ul>
|
||||
<li>Update SD token for Start Multiple Block Write operation to 0xFC instead of 0xFD</li>
|
||||
</ul></li>
|
||||
<li>Adafruit_Config/adafruit_802_conf_STM32H7xx_Nucleo.h
|
||||
<ul>
|
||||
<li>Remove support of USE_NUCLEO_H7A3ZI nucleo board</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section14" aria-hidden="true"> <label for="collapse-section14" aria-hidden="true"><strong>V4.0.2 / 30-May-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-4">Main Changes</h2>
|
||||
<ul>
|
||||
<li>stm32_adafruit_sd.h
|
||||
<ul>
|
||||
<li>Remove volatile qualification for SD_CID structure’s fields</li>
|
||||
</ul></li>
|
||||
<li>Adafruit_Config/adafruit_802_conf_STM32H7xx_Nucleo.h
|
||||
<ul>
|
||||
<li>Add support of USE_NUCLEO_H7A3ZI_Q nucleo board</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section13" aria-hidden="true"> <label for="collapse-section13" aria-hidden="true"><strong>V4.0.1 / 25-April-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-5">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Add adafruit_802_conf_STM32H7xx_Nucleo.h file under Adafruit_Config folder</li>
|
||||
<li>adafruit_802_lcd.c/.h:
|
||||
<ul>
|
||||
<li>Update context content</li>
|
||||
<li>Update checks on functions’ returned value</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section12" aria-hidden="true"> <label for="collapse-section12" aria-hidden="true"><strong>V4.0.0 / 12-April-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-6">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Official release of component drivers for Adafruit_Shield in line with STM32Cube BSP drivers development guidelines (UM2298)</li>
|
||||
</ul>
|
||||
<h2 id="backward-compatibility-1">Backward Compatibility</h2>
|
||||
<p>This version breaks the compatibility with previous versions</p>
|
||||
<h2 id="dependencies-1">Dependencies</h2>
|
||||
<ul>
|
||||
<li>Components/common v6.0.0</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section9" aria-hidden="true"> <label for="collapse-section9" aria-hidden="true"><strong>V3.0.3 / 30-April-2018</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-7">Main Changes</h2>
|
||||
<ul>
|
||||
<li>stm32_adafruit_sd.c:
|
||||
<ul>
|
||||
<li>Fix BSP_SD_ReadBlocks and BSP_SD_WriteBlocks to support SDHC cards</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section8" aria-hidden="true"> <label for="collapse-section8" aria-hidden="true"><strong>V3.0.2 / 24-August-2017</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-8">Main Changes</h2>
|
||||
<ul>
|
||||
<li>stm32_adafruit_lcd.c:
|
||||
<ul>
|
||||
<li>Fix compilation errors with SW4STM32 toolchain</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section7" aria-hidden="true"> <label for="collapse-section7" aria-hidden="true"><strong>V3.0.1 / 02-June-2017</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-9">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Add general description of BSP drivers</li>
|
||||
<li>Add Dependencies section</li>
|
||||
<li>Support of PDSC</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section6" aria-hidden="true"> <label for="collapse-section6" aria-hidden="true"><strong>V3.0.0 / 23-December-2016</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-10">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Update BSP_SD_ReadBlocks and BSP_SD_WriteBlocks following new HAL SD drivers implementation</li>
|
||||
<li>Update BSP_SD_Erase implementation to manage SDHC and SDSC cards</li>
|
||||
<li>Fix block size to 512 bytes for all card types</li>
|
||||
</ul>
|
||||
<h2 id="backward-compatibility-2">Backward Compatibility</h2>
|
||||
<p>These Adafruit BSP drivers break the compatibility with previous versions.</p>
|
||||
<h2 id="dependencies-2">Dependencies</h2>
|
||||
<p>If FatFs is required, “FatFS R0.11 ST modified 20161223” must be used with this version of Adafruit BSP drivers.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section5" aria-hidden="true"> <label for="collapse-section5" aria-hidden="true"><strong>V2.0.1 / 04-November-2015</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-11">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Fix GNU GCC warning on missing break instruction in SD_GetDataResponse()</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section4" aria-hidden="true"> <label for="collapse-section4" aria-hidden="true"><strong>V2.0.0 / 10-September-2015</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-12">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Improve SD over SPI protocol implementation</li>
|
||||
<li><strong>Note</strong>
|
||||
<ul>
|
||||
<li>This new implementation requires to increase Heap_Size by 0x200</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<h2 id="dependencies-3">Dependencies</h2>
|
||||
<ul>
|
||||
<li>This driver version needs BSP Nucleo driver V2.0.0 and later</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section3" aria-hidden="true"> <label for="collapse-section3" aria-hidden="true"><strong>V1.1.1 / 21-November-2014</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-13">Main Changes</h2>
|
||||
<ul>
|
||||
<li>stm32_adafruit_sd.c
|
||||
<ul>
|
||||
<li>Add workaround for the issue seen on some STM32 Nucleo boards; reading the SD card status will return an error</li>
|
||||
<li>A fix will be implemented in next release</li>
|
||||
</ul></li>
|
||||
<li>stm32_adafruit_lcd.h:
|
||||
<ul>
|
||||
<li>Change “" by”/" in the include path to fix compilation issue under Linux</li>
|
||||
</ul></li>
|
||||
<li>Miscellaneous:
|
||||
<ul>
|
||||
<li>Comments update</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section2" aria-hidden="true"> <label for="collapse-section2" aria-hidden="true"><strong>V1.1.0 / 22-July-2014</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-14">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Add new user API BSP_LCD_DrawBitmap() to draw a bitmap picture loaded in the STM32 MCU internal memory</li>
|
||||
<li>Add new static API SetDisplayWindow(), needed by BSP_LCD_DrawBitmap()</li>
|
||||
<li>Update static API DrawChar()</li>
|
||||
</ul>
|
||||
<h2 id="dependencies-4">Dependencies</h2>
|
||||
<p>This driver version needs ST7735 component driver V1.1.0 and later.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section1" aria-hidden="true"> <label for="collapse-section1" aria-hidden="true"><strong>V1.0.0 / 22-April-2014</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-15">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First official release of <strong>Adafruit Shield</strong> driver</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="sticky">
|
||||
For complete documentation on <mark>STM32 Microcontrollers</mark> , visit: <span style="font-color: blue;"><a href="http://www.st.com/STM32">www.st.com</a></span>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
468
lib/main/STM32H7/Drivers/BSP/Adafruit_Shield/adafruit_802.c
Normal file
|
@ -0,0 +1,468 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file adafruit_802.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides set of firmware functions to manage:
|
||||
* - Joystick available on Adafruit 1.8" TFT LCD shield (reference ID 802)
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "adafruit_802.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ADAFRUIT_802
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ADAFRUIT_802_LOW_LEVEL
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_LOW_LEVEL_Private_Variables LOW LEVEL Private Variables
|
||||
* @{
|
||||
*/
|
||||
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
|
||||
static uint32_t IsJoyMspCbValid = 0;
|
||||
#endif
|
||||
|
||||
static ADC_HandleTypeDef hJoyHandle;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_LOW_LEVEL_Private_FunctionPrototypes LOW LEVEL Private FunctionPrototypes
|
||||
* @{
|
||||
*/
|
||||
static void JOY1_MspInit(ADC_HandleTypeDef *hadc);
|
||||
static void JOY1_MspDeInit(ADC_HandleTypeDef *hadc);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup ADAFRUIT_802_LOW_LEVEL_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Configures the joystick.
|
||||
* @param JOY Joystick to be initialized
|
||||
* @param JoyMode Button mode.
|
||||
* This parameter is not used as the ADC pin should be always configured
|
||||
* in analog mode.
|
||||
* @param JoyPins There are no physical pins but voltage levels
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t ADAFRUIT_802_JOY_Init(JOY_TypeDef JOY, JOYMode_TypeDef JoyMode, JOYPin_TypeDef JoyPins)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
UNUSED(JoyPins);
|
||||
UNUSED(JoyMode);
|
||||
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
if(JOY >= JOYn)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 0)
|
||||
/* Init the UART Msp */
|
||||
JOY1_MspInit(&hJoyHandle);
|
||||
#else
|
||||
if(IsJoyMspCbValid == 0U)
|
||||
{
|
||||
if(ADAFRUIT_802_JOY_RegisterDefaultMspCallbacks(JOY) != BSP_ERROR_NONE)
|
||||
{
|
||||
return BSP_ERROR_MSP_FAILURE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if(MX_ADAFRUIT_802_ADC_Init(&hJoyHandle) != HAL_OK)
|
||||
{
|
||||
ret = BSP_ERROR_PERIPH_FAILURE;
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(ADC_CALFACT_CALFACT_S)
|
||||
/* Run ADC calibration */
|
||||
#if defined(ADC_CR_ADCALLIN)
|
||||
if(HAL_ADCEx_Calibration_Start(&hJoyHandle, ADC_CALIB_OFFSET, ADC_SINGLE_ENDED) != HAL_OK)
|
||||
{
|
||||
ret = BSP_ERROR_PERIPH_FAILURE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(HAL_ADCEx_Calibration_Start(&hJoyHandle, ADC_CALIB_OFFSET_LINEARITY, ADC_SINGLE_ENDED) != HAL_OK)
|
||||
{
|
||||
ret = BSP_ERROR_PERIPH_FAILURE;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if(HAL_ADCEx_Calibration_Start(&hJoyHandle, ADC_SINGLE_ENDED) != HAL_OK)
|
||||
{
|
||||
ret = BSP_ERROR_PERIPH_FAILURE;
|
||||
}
|
||||
#endif
|
||||
#endif /* defined(ADC_CALFACT_CALFACT_S) */
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DeInit joystick GPIOs.
|
||||
* @param JOY Joystick to be de-initialized
|
||||
* @param JoyPins There are no physical pins but voltage levels
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t ADAFRUIT_802_JOY_DeInit(JOY_TypeDef JOY, JOYPin_TypeDef JoyPins)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
UNUSED(JoyPins);
|
||||
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
/* ADC configuration */
|
||||
hJoyHandle.Instance = ADAFRUIT_802_ADCx;
|
||||
|
||||
if(JOY >= JOYn)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 0)
|
||||
JOY1_MspDeInit(&hJoyHandle);
|
||||
#endif /* (USE_HAL_UART_REGISTER_CALLBACKS == 0) */
|
||||
|
||||
if(HAL_ADC_DeInit(&hJoyHandle) != HAL_OK)
|
||||
{
|
||||
ret = BSP_ERROR_PERIPH_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns the Joystick key pressed.
|
||||
* @param JOY Joystick to get its pins' state
|
||||
* @retval BSP error code if value is negative or one of the following values:
|
||||
* - JOY_NONE : 3.3 V / 4095
|
||||
* - JOY_SEL : 1.055 V / 1308
|
||||
* - JOY_DOWN : 0.71 V / 88
|
||||
* - JOY_LEFT : 3.0 V / 3720
|
||||
* - JOY_RIGHT : 0.595 V / 737
|
||||
* - JOY_UP : 1.65 V / 2046
|
||||
*/
|
||||
int32_t ADAFRUIT_802_JOY_GetState(JOY_TypeDef JOY)
|
||||
{
|
||||
int32_t ret;
|
||||
uint32_t keyconvertedvalue;
|
||||
|
||||
if(JOY >= JOYn)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}/* Start the conversion process */
|
||||
else if(HAL_ADC_Start(&hJoyHandle) != HAL_OK)
|
||||
{
|
||||
ret = BSP_ERROR_PERIPH_FAILURE;
|
||||
}/* Wait for the end of conversion */
|
||||
else if(HAL_ADC_PollForConversion(&hJoyHandle, ADAFRUIT_802_ADCx_POLL_TIMEOUT) != HAL_OK)
|
||||
{
|
||||
ret = BSP_ERROR_PERIPH_FAILURE;
|
||||
}/* Check if the continuous conversion of regular channel is finished */
|
||||
else if((HAL_ADC_GetState(&hJoyHandle) & HAL_ADC_STATE_REG_EOC) != HAL_ADC_STATE_REG_EOC)
|
||||
{
|
||||
ret = BSP_ERROR_BUSY;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Get the converted value of regular channel */
|
||||
keyconvertedvalue = HAL_ADC_GetValue(&hJoyHandle);
|
||||
|
||||
if((keyconvertedvalue > 2010U) && (keyconvertedvalue < 2500U))
|
||||
{
|
||||
ret = (int32_t)JOY_UP;
|
||||
}
|
||||
else if((keyconvertedvalue > 680U) && (keyconvertedvalue < 900U))
|
||||
{
|
||||
ret = (int32_t)JOY_RIGHT;
|
||||
}
|
||||
else if((keyconvertedvalue > 1270U) && (keyconvertedvalue < 1500U))
|
||||
{
|
||||
ret = (int32_t)JOY_SEL;
|
||||
}
|
||||
else if((keyconvertedvalue > 50U) && (keyconvertedvalue < 200U))
|
||||
{
|
||||
ret = (int32_t)JOY_DOWN;
|
||||
}
|
||||
else if((keyconvertedvalue > 3400U) && (keyconvertedvalue < 3760U))
|
||||
{
|
||||
ret = (int32_t)JOY_LEFT;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = (int32_t)JOY_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Return the code of the Joystick key pressed */
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configures ADC peripheral
|
||||
* @param hadc ADC handle
|
||||
* @retval HAL error code
|
||||
*/
|
||||
__weak HAL_StatusTypeDef MX_ADAFRUIT_802_ADC_Init(ADC_HandleTypeDef *hadc)
|
||||
{
|
||||
HAL_StatusTypeDef ret = HAL_OK;
|
||||
ADC_ChannelConfTypeDef sConfig;
|
||||
|
||||
/* ADC configuration */
|
||||
hadc->Instance = ADAFRUIT_802_ADCx;
|
||||
hadc->Init.ClockPrescaler = ADAFRUIT_802_ADCx_PRESCALER;
|
||||
hadc->Init.Resolution = ADC_RESOLUTION_12B;
|
||||
#if defined(ADC_CR2_ALIGN)
|
||||
hadc->Init.DataAlign = ADC_DATAALIGN_RIGHT;
|
||||
#endif
|
||||
hadc->Init.ScanConvMode = (uint32_t)DISABLE;
|
||||
#if defined(ADC_EOC_SINGLE_CONV)
|
||||
hadc->Init.EOCSelection = ADC_EOC_SINGLE_CONV;
|
||||
#endif
|
||||
hadc->Init.ContinuousConvMode = DISABLE;
|
||||
hadc->Init.NbrOfConversion = 1;
|
||||
hadc->Init.DiscontinuousConvMode = DISABLE;
|
||||
#if defined(ADC_CFGR_DISCNUM)
|
||||
hadc->Init.NbrOfDiscConversion = 0;
|
||||
#endif
|
||||
hadc->Init.ExternalTrigConv = ADC_SOFTWARE_START;
|
||||
hadc->Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE;
|
||||
#if defined(ADC_CR2_DMA)
|
||||
hadc->Init.DMAContinuousRequests = DISABLE;
|
||||
#endif
|
||||
#if defined(ADC_SMPR_SMP1) && defined(ADC_SMPR_SMP2)
|
||||
hadc->Init.SamplingTimeCommon1 = ADC_SAMPLETIME_39CYCLES_5;
|
||||
hadc->Init.SamplingTimeCommon2 = ADC_SAMPLETIME_39CYCLES_5;
|
||||
#endif
|
||||
#if defined(ADC_CFGR2_LFTRIG)
|
||||
hadc->Init.TriggerFrequencyMode = ADC_TRIGGER_FREQ_HIGH;
|
||||
#endif
|
||||
|
||||
if (HAL_ADC_Init(hadc) != HAL_OK)
|
||||
{
|
||||
ret = HAL_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
/**Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.
|
||||
*/
|
||||
sConfig.Channel = ADAFRUIT_802_ADCx_CHANNEL;
|
||||
sConfig.Rank = ADAFRUIT_802_ADCx_RANK;
|
||||
sConfig.SamplingTime = ADAFRUIT_802_ADCx_SAMPLETIME;
|
||||
#if defined(ADC_OFR1_OFFSET1)
|
||||
sConfig.Offset = 0;
|
||||
#endif
|
||||
#if defined(ADC_SINGLE_ENDED)
|
||||
sConfig.SingleDiff = ADC_SINGLE_ENDED;
|
||||
#endif
|
||||
#if defined(ADC_OFFSET_NONE)
|
||||
sConfig.OffsetNumber = ADC_OFFSET_NONE;
|
||||
#endif
|
||||
if (HAL_ADC_ConfigChannel(hadc, &sConfig) != HAL_OK)
|
||||
{
|
||||
ret = HAL_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
|
||||
/**
|
||||
* @brief Register Default ADCx Bus Msp Callbacks
|
||||
* @param JOY Joystick to be configured.
|
||||
* This parameter can be JOY1
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t ADAFRUIT_802_JOY_RegisterDefaultMspCallbacks(JOY_TypeDef JOY)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
if(JOY >= JOYn)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
__HAL_ADC_RESET_HANDLE_STATE(&hJoyHandle);
|
||||
|
||||
/* Register default MspInit/MspDeInit Callback */
|
||||
if(HAL_ADC_RegisterCallback(&hJoyHandle, HAL_ADC_MSPINIT_CB_ID, JOY1_MspInit) != HAL_OK)
|
||||
{
|
||||
ret = BSP_ERROR_PERIPH_FAILURE;
|
||||
}
|
||||
else if(HAL_ADC_RegisterCallback(&hJoyHandle, HAL_ADC_MSPDEINIT_CB_ID, JOY1_MspDeInit) != HAL_OK)
|
||||
{
|
||||
ret = BSP_ERROR_PERIPH_FAILURE;
|
||||
}
|
||||
else
|
||||
{
|
||||
IsJoyMspCbValid = 1U;
|
||||
}
|
||||
}
|
||||
|
||||
/* BSP status */
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Register ADCx Bus Msp Callback registering
|
||||
* @param JOY Joystick to be configured.
|
||||
* This parameter can be JOY1
|
||||
* @param Callbacks pointer to ADCx MspInit/MspDeInit callback functions
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t ADAFRUIT_802_JOY_RegisterMspCallbacks(JOY_TypeDef JOY, ADAFRUIT_802_JOY_Cb_t *Callback)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
if(JOY >= JOYn)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
__HAL_ADC_RESET_HANDLE_STATE(&hJoyHandle);
|
||||
|
||||
/* Register MspInit/MspDeInit Callbacks */
|
||||
if(HAL_ADC_RegisterCallback(&hJoyHandle, HAL_ADC_MSPINIT_CB_ID, Callback->pMspInitCb) != HAL_OK)
|
||||
{
|
||||
ret = BSP_ERROR_PERIPH_FAILURE;
|
||||
}
|
||||
else if(HAL_ADC_RegisterCallback(&hJoyHandle, HAL_ADC_MSPDEINIT_CB_ID, Callback->pMspDeInitCb) != HAL_OK)
|
||||
{
|
||||
ret = BSP_ERROR_PERIPH_FAILURE;
|
||||
}
|
||||
else
|
||||
{
|
||||
IsJoyMspCbValid = 1U;
|
||||
}
|
||||
}
|
||||
|
||||
/* BSP status */
|
||||
return ret;
|
||||
}
|
||||
#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_LOW_LEVEL_Private_Functions LOW LEVEL Private Functions
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @brief Initializes ADC MSP.
|
||||
* @param hadc ADC handle
|
||||
* @retval None
|
||||
*/
|
||||
static void JOY1_MspInit(ADC_HandleTypeDef *hadc)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
#if defined (RCC_ADCCLKSOURCE_SYSCLK) || defined (RCC_ADC12CLKSOURCE_SYSCLK)
|
||||
RCC_PeriphCLKInitTypeDef RCC_PeriphCLKInitStruct;
|
||||
#endif
|
||||
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
UNUSED(hadc);
|
||||
|
||||
/*** Configure the GPIOs ***/
|
||||
/* Enable GPIO clock */
|
||||
ADAFRUIT_802_ADCx_GPIO_CLK_ENABLE();
|
||||
|
||||
/* Configure the selected ADC Channel as analog input */
|
||||
GPIO_InitStruct.Pin = ADAFRUIT_802_ADCx_GPIO_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
|
||||
#if defined (RCC_ADCCLKSOURCE_SYSCLK) || defined (RCC_ADC12CLKSOURCE_SYSCLK)
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||
#endif
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(ADAFRUIT_802_ADCx_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/*** Configure the ADC peripheral ***/
|
||||
/* Enable ADC clock */
|
||||
ADAFRUIT_802_ADCx_CLK_ENABLE();
|
||||
|
||||
#if defined (RCC_ADCCLKSOURCE_SYSCLK)
|
||||
/* Configure SYSCLK as source clock for ADC */
|
||||
RCC_PeriphCLKInitStruct.PeriphClockSelection = RCC_PERIPHCLK_ADC;
|
||||
RCC_PeriphCLKInitStruct.AdcClockSelection = RCC_ADCCLKSOURCE_SYSCLK;
|
||||
HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphCLKInitStruct);
|
||||
#elif defined (RCC_ADC12CLKSOURCE_SYSCLK)
|
||||
RCC_PeriphCLKInitStruct.PeriphClockSelection = RCC_PERIPHCLK_ADC12;
|
||||
RCC_PeriphCLKInitStruct.Adc12ClockSelection = RCC_ADC12CLKSOURCE_SYSCLK;
|
||||
HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphCLKInitStruct);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DeInitializes ADC MSP.
|
||||
* @param hadc ADC handle
|
||||
* @note ADC DeInit does not disable the GPIO clock
|
||||
* @retval None
|
||||
*/
|
||||
static void JOY1_MspDeInit(ADC_HandleTypeDef *hadc)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
UNUSED(hadc);
|
||||
|
||||
/*** DeInit the ADC peripheral ***/
|
||||
/* Disable ADC clock */
|
||||
ADAFRUIT_802_ADCx_CLK_DISABLE();
|
||||
|
||||
/* Configure the selected ADC Channel as analog input */
|
||||
GPIO_InitStruct.Pin = ADAFRUIT_802_ADCx_GPIO_PIN ;
|
||||
HAL_GPIO_DeInit(ADAFRUIT_802_ADCx_GPIO_PORT, GPIO_InitStruct.Pin);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
118
lib/main/STM32H7/Drivers/BSP/Adafruit_Shield/adafruit_802.h
Normal file
|
@ -0,0 +1,118 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file adafruit_802.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains definitions for:
|
||||
* - Joystick available on Adafruit 1.8" TFT LCD shield (reference ID 802)
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef ADAFRUIT_802_H
|
||||
#define ADAFRUIT_802_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "adafruit_802_conf.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802 ADAFRUIT_802
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_LOW_LEVEL STM32 ADAFRUIT_802 LOW LEVEL
|
||||
* @brief This file provides set of firmware functions to manage joystick
|
||||
* available on Adafruit shield.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_LOW_LEVEL_Exported_Types LOW LEVEL Exported Types
|
||||
* @{
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
JOY1 = 0U,
|
||||
JOYn
|
||||
}JOY_TypeDef;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
JOY_MODE_GPIO = 0U,
|
||||
JOY_MODE_EXTI = 1U,
|
||||
}JOYMode_TypeDef;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
JOY_NONE = 0x00U,
|
||||
JOY_SEL = 0x01U,
|
||||
JOY_DOWN = 0x02U,
|
||||
JOY_LEFT = 0x04U,
|
||||
JOY_RIGHT = 0x08U,
|
||||
JOY_UP = 0x10U,
|
||||
JOY_ALL = 0x1FU
|
||||
}JOYPin_TypeDef;
|
||||
|
||||
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
|
||||
typedef struct
|
||||
{
|
||||
pADC_CallbackTypeDef pMspInitCb;
|
||||
pADC_CallbackTypeDef pMspDeInitCb;
|
||||
}ADAFRUIT_802_JOY_Cb_t;
|
||||
#endif /* (USE_HAL_ADC_REGISTER_CALLBACKS == 1) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_LOW_LEVEL_Exported_Functions LOW LEVEL Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
int32_t ADAFRUIT_802_JOY_Init(JOY_TypeDef JOY, JOYMode_TypeDef JoyMode, JOYPin_TypeDef JoyPins);
|
||||
int32_t ADAFRUIT_802_JOY_DeInit(JOY_TypeDef JOY, JOYPin_TypeDef JoyPins);
|
||||
int32_t ADAFRUIT_802_JOY_GetState(JOY_TypeDef JOY);
|
||||
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
|
||||
int32_t ADAFRUIT_802_JOY_RegisterDefaultMspCallbacks(JOY_TypeDef JOY);
|
||||
int32_t ADAFRUIT_802_JOY_RegisterMspCallbacks(JOY_TypeDef JOY, ADAFRUIT_802_JOY_Cb_t *Callback);
|
||||
#endif /* (USE_HAL_ADC_REGISTER_CALLBACKS == 1) */
|
||||
HAL_StatusTypeDef MX_ADAFRUIT_802_ADC_Init(ADC_HandleTypeDef *hadc);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ADAFRUIT_802_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
@ -0,0 +1,80 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file adafruit_802_conf_template.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file includes the nucleo configuration file that contains definitions for:
|
||||
* - ADC information(GPIOs and configuration) used for Joystick
|
||||
* - SPI information(GPIOs and configuration) used for microSD and LCD available
|
||||
* on Adafruit 1.8" TFT LCD shield (reference ID 802)
|
||||
*
|
||||
*
|
||||
* There are two ways to use this file:
|
||||
* 1.
|
||||
* - Copy stm32_adafruit_conf_template.h to the application and rename it to stm32_adafruit_conf.h
|
||||
* - Fill stm32_adafruit_conf.h with adequate resources definition that can be directly
|
||||
* copied from "Adafruit_Config" folder depending on the used nucleo board.
|
||||
* - Un-comment and update the below lines with correct nucleo files
|
||||
*
|
||||
* 2.
|
||||
* - Copy the required configuration file from "Adafruit_Config" folder to the
|
||||
* application and rename it to stm32_adafruit_conf.h
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef ADAFRUIT_802_CONF_H
|
||||
#define ADAFRUIT_802_CONF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/* #include "stm32xxxx_nucleo_conf.h"
|
||||
#include "stm32xxxx_nucleo_errno.h"
|
||||
*/
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ADAFRUIT_802
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_CONFIG Config
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ADAFRUIT_802_CONF_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
776
lib/main/STM32H7/Drivers/BSP/Adafruit_Shield/adafruit_802_lcd.c
Normal file
|
@ -0,0 +1,776 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file adafruit_802_lcd.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file includes the driver for Liquid Crystal Display (LCD) module
|
||||
* mounted on the Adafruit 1.8" TFT LCD shield (reference ID 802),
|
||||
* that is used with the STM32 Nucleo board through SPI interface.
|
||||
******************************************************************************
|
||||
@verbatim
|
||||
How To use this driver:
|
||||
--------------------------
|
||||
- This driver is used to drive directly the LCD mounted on on the Adafruit 1.8" TFT LCD
|
||||
shield (reference ID 802)
|
||||
The following IP are implied : SPI
|
||||
|
||||
Driver description:
|
||||
---------------------
|
||||
+ Initialization steps:
|
||||
o Initialize the LCD with required orientation using the ADAFRUIT_802_LCD_Init() function.
|
||||
- LCD_ORIENTATION_PORTRAIT
|
||||
- LCD_ORIENTATION_PORTRAIT_ROT180
|
||||
- LCD_ORIENTATION_LANDSCAPE
|
||||
- LCD_ORIENTATION_LANDSCAPE_ROT180
|
||||
|
||||
o Enable the LCD display using the ADAFRUIT_802_LCD_DisplayOn() function.
|
||||
o Disable the LCD display using the ADAFRUIT_802_LCD_DisplayOff() function.
|
||||
o Write a pixel to the LCD memory using the ADAFRUIT_802_LCD_WritePixel() function.
|
||||
o Draw an horizontal line using the ADAFRUIT_802_LCD_DrawHLine() function.
|
||||
o Draw a vertical line using the ADAFRUIT_802_LCD_DrawVLine() function.
|
||||
o Draw a bitmap image using the ADAFRUIT_802_LCD_DrawBitmap() function.
|
||||
o Select the LCD layer to be used using the ADAFRUIT_802_LCD_SelectLayer() function.
|
||||
o Set the display brightness using the ADAFRUIT_802_LCD_SetBrightness() function.
|
||||
o Get the display brightness using the ADAFRUIT_802_LCD_GetBrightness() function.
|
||||
o Read a pixel from the LCD memory using the ADAFRUIT_802_LCD_ReadPixel() function.
|
||||
|
||||
+ Display on LCD
|
||||
o To draw and fill a basic shapes (dot, line, rectangle, circle, ellipse, .. bitmap)
|
||||
on LCD and display text, utility stm32_lcd.c/.h must be called. Once the LCD is initialized,
|
||||
user should call UTIL_LCD_SetFuncDriver() API to link board LCD drivers to UTIL LCD drivers.
|
||||
The basic lcd services, defined in lcd utility, are ready for use.
|
||||
|
||||
Note:
|
||||
--------
|
||||
- Regarding the "Instance" parameter, needed for all functions, it is used to select
|
||||
an LCD instance. On the "Adafruit 1.8" TFT LCD shield", only one LCD instance is availble. Then, this
|
||||
parameter should be 0.
|
||||
- The LCD support only 1 layer. Thus ADAFRUIT_802_LCD_SelectLayer function set always
|
||||
the Active Layer to 0
|
||||
- SetBrightness, GetBrightness and ReadPixel features are not supported
|
||||
|
||||
@endverbatim
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "adafruit_802_lcd.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ADAFRUIT_802
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ADAFRUIT_802_LCD
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup ADAFRUIT_802_LCD_Private_Variables LCD Private Variables
|
||||
* @{
|
||||
*/
|
||||
static void *Lcd_CompObj = NULL;
|
||||
static LCD_Drv_t *Lcd_Drv = NULL;
|
||||
ADAFRUIT_802_LCD_Ctx_t Lcd_Ctx[LCD_INSTANCES_NBR];
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup ADAFRUIT_802_LCD_Exported_Variables
|
||||
* @{
|
||||
*/
|
||||
const LCD_UTILS_Drv_t LCD_Driver =
|
||||
{
|
||||
ADAFRUIT_802_LCD_DrawBitmap,
|
||||
ADAFRUIT_802_LCD_FillRGBRect,
|
||||
ADAFRUIT_802_LCD_DrawHLine,
|
||||
ADAFRUIT_802_LCD_DrawVLine,
|
||||
ADAFRUIT_802_LCD_FillRect,
|
||||
ADAFRUIT_802_LCD_ReadPixel,
|
||||
ADAFRUIT_802_LCD_WritePixel,
|
||||
ADAFRUIT_802_LCD_GetXSize,
|
||||
ADAFRUIT_802_LCD_GetYSize,
|
||||
NULL,
|
||||
ADAFRUIT_802_LCD_GetPixelFormat
|
||||
};
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_LCD_Private_FunctionPrototypes LCD Private Function Prototypes
|
||||
* @{
|
||||
*/
|
||||
static int32_t ST7735_Probe(uint32_t Orientation);
|
||||
static int32_t LCD_IO_Init(void);
|
||||
static int32_t LCD_IO_DeInit(void);
|
||||
static int32_t LCD_IO_WriteReg(uint8_t Reg, uint8_t* pData, uint32_t Length);
|
||||
static int32_t LCD_IO_SendData(uint8_t *pData, uint32_t Length);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup ADAFRUIT_802_LCD_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Initializes the LCD with a given orientation.
|
||||
* @param Instance LCD Instance
|
||||
* @param orientation Select display orientation:
|
||||
* - LCD_ORIENTATION_PORTRAIT
|
||||
* - LCD_ORIENTATION_LANDSCAPE
|
||||
* - LCD_ORIENTATION_PORTRAIT_ROT180
|
||||
* - LCD_ORIENTATION_LANDSCAPE_ROT180
|
||||
* @retval Error status
|
||||
*/
|
||||
int32_t ADAFRUIT_802_LCD_Init(uint32_t Instance, uint32_t Orientation)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
if((Orientation > LCD_ORIENTATION_LANDSCAPE_ROT180) || (Instance >= LCD_INSTANCES_NBR))
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(ST7735_Probe(Orientation) != BSP_ERROR_NONE)
|
||||
{
|
||||
ret = BSP_ERROR_UNKNOWN_COMPONENT;
|
||||
}
|
||||
else if(ADAFRUIT_802_LCD_GetXSize(Instance, &Lcd_Ctx[Instance].XSize) != BSP_ERROR_NONE)
|
||||
{
|
||||
ret = BSP_ERROR_COMPONENT_FAILURE;
|
||||
}
|
||||
else if(ADAFRUIT_802_LCD_GetYSize(Instance, &Lcd_Ctx[Instance].YSize) != BSP_ERROR_NONE)
|
||||
{
|
||||
ret = BSP_ERROR_COMPONENT_FAILURE;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Clear the LCD screen with white color */
|
||||
ret = ADAFRUIT_802_LCD_FillRect(Instance, 0U, 0U, Lcd_Ctx[Instance].XSize, Lcd_Ctx[Instance].YSize, 0xFFFFFFFFU);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DeInitializes the LCD.
|
||||
* @param Instance LCD Instance
|
||||
* @retval Error status
|
||||
*/
|
||||
int32_t ADAFRUIT_802_LCD_DeInit(uint32_t Instance)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
if(Instance >= LCD_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = LCD_IO_DeInit();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gets the LCD Active LCD Pixel Format.
|
||||
* @param Instance LCD Instance
|
||||
* @param PixelFormat Active LCD Pixel Format
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t ADAFRUIT_802_LCD_GetPixelFormat(uint32_t Instance, uint32_t *PixelFormat)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
if(Instance >= LCD_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Only RGB565 format is supported */
|
||||
*PixelFormat = LCD_PIXEL_FORMAT_RGB565;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gets the LCD X size.
|
||||
* @param Instance LCD Instance
|
||||
* @param XSize LCD width
|
||||
* @retval Error status
|
||||
*/
|
||||
int32_t ADAFRUIT_802_LCD_GetXSize(uint32_t Instance, uint32_t *XSize)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
if(Instance >= LCD_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(Lcd_Drv->GetXSize(Lcd_CompObj, XSize) < 0)
|
||||
{
|
||||
ret = BSP_ERROR_COMPONENT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gets the LCD Y size.
|
||||
* @param Instance LCD Instance
|
||||
* @param YSize LCD hieght
|
||||
* @retval Error status
|
||||
*/
|
||||
int32_t ADAFRUIT_802_LCD_GetYSize(uint32_t Instance, uint32_t *YSize)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
if(Instance >= LCD_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(Lcd_Drv->GetYSize(Lcd_CompObj, YSize) < 0)
|
||||
{
|
||||
ret = BSP_ERROR_COMPONENT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reads an LCD pixel.
|
||||
* @param Instance LCD Instance
|
||||
* @param Xpos X position
|
||||
* @param Ypos Y position
|
||||
* @param Color RGB color
|
||||
* @retval Error status
|
||||
*/
|
||||
int32_t ADAFRUIT_802_LCD_ReadPixel(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t *Color)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
UNUSED(Instance);
|
||||
UNUSED(Xpos);
|
||||
UNUSED(Ypos);
|
||||
UNUSED(Color);
|
||||
return BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Draws a pixel on LCD.
|
||||
* @param Instance LCD Instance
|
||||
* @param Xpos X position
|
||||
* @param Ypos Y position
|
||||
* @param Color RGB color
|
||||
* @retval Error status
|
||||
*/
|
||||
int32_t ADAFRUIT_802_LCD_WritePixel(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Color)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
if(Instance >= LCD_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else if(Lcd_Drv->SetPixel != NULL)
|
||||
{
|
||||
if(Lcd_Drv->SetPixel(Lcd_CompObj, Xpos, Ypos, Color) < 0)
|
||||
{
|
||||
ret = BSP_ERROR_COMPONENT_FAILURE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Draws an horizontal line.
|
||||
* @param Instance LCD Instance
|
||||
* @param Xpos X position
|
||||
* @param Ypos Y position
|
||||
* @param Length Line length
|
||||
* @param Color RGB color
|
||||
* @retval Error status
|
||||
*/
|
||||
int32_t ADAFRUIT_802_LCD_DrawHLine(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
if(Instance >= LCD_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else if(Lcd_Drv->DrawHLine != NULL)
|
||||
{
|
||||
if(Lcd_Drv->DrawHLine(Lcd_CompObj, Xpos, Ypos, Length, Color) < 0)
|
||||
{
|
||||
ret = BSP_ERROR_COMPONENT_FAILURE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Draws a vertical line.
|
||||
* @param Instance LCD Instance
|
||||
* @param Xpos X position
|
||||
* @param Ypos Y position
|
||||
* @param Length Line length
|
||||
* @param Color RGB color
|
||||
* @retval Error status
|
||||
*/
|
||||
int32_t ADAFRUIT_802_LCD_DrawVLine(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
if(Instance >= LCD_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else if(Lcd_Drv->DrawVLine != NULL)
|
||||
{
|
||||
if(Lcd_Drv->DrawVLine(Lcd_CompObj, Xpos, Ypos, Length, Color) < 0)
|
||||
{
|
||||
ret = BSP_ERROR_COMPONENT_FAILURE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Draws a bitmap picture (16 bpp).
|
||||
* @param Instance LCD Instance
|
||||
* @param Xpos Bmp X position in the LCD
|
||||
* @param Ypos Bmp Y position in the LCD
|
||||
* @param pBmp Pointer to Bmp picture address.
|
||||
* @retval Error status
|
||||
*/
|
||||
int32_t ADAFRUIT_802_LCD_DrawBitmap(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint8_t *pBmp)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
if(Instance >= LCD_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else if(Lcd_Drv->DrawBitmap != NULL)
|
||||
{
|
||||
if(Lcd_Drv->DrawBitmap(Lcd_CompObj, Xpos, Ypos, pBmp) < 0)
|
||||
{
|
||||
ret = BSP_ERROR_COMPONENT_FAILURE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Draws a full RGB rectangle
|
||||
* @param Instance LCD Instance.
|
||||
* @param Xpos specifies the X position.
|
||||
* @param Ypos specifies the Y position.
|
||||
* @param pData pointer to RGB data
|
||||
* @param Width specifies the rectangle width.
|
||||
* @param Height Specifies the rectangle height
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t ADAFRUIT_802_LCD_FillRGBRect(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint8_t *pData, uint32_t Width, uint32_t Height)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
if (Instance >= LCD_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else if(Lcd_Drv->FillRGBRect != NULL)
|
||||
{
|
||||
/* Draw the horizontal line on LCD */
|
||||
if (Lcd_Drv->FillRGBRect(Lcd_CompObj, Xpos, Ypos, pData, Width, Height) < 0)
|
||||
{
|
||||
ret = BSP_ERROR_COMPONENT_FAILURE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Draws a full rectangle.
|
||||
* @param Instance LCD instance
|
||||
* @param Xpos X position
|
||||
* @param Ypos Y position
|
||||
* @param Width Rectangle width
|
||||
* @param Height Rectangle height
|
||||
* @param Color RGB color
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t ADAFRUIT_802_LCD_FillRect(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Width, uint32_t Height, uint32_t Color)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
if(Instance >= LCD_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else if(Lcd_Drv->FillRect != NULL)
|
||||
{
|
||||
if(Lcd_Drv->FillRect(Lcd_CompObj, Xpos, Ypos, Width, Height, Color) < 0)
|
||||
{
|
||||
ret = BSP_ERROR_COMPONENT_FAILURE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enables the display.
|
||||
* @param Instance LCD Instance
|
||||
* @retval Error status
|
||||
*/
|
||||
int32_t ADAFRUIT_802_LCD_DisplayOn(uint32_t Instance)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
if(Instance >= LCD_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else if(Lcd_Drv->DisplayOn != NULL)
|
||||
{
|
||||
if(Lcd_Drv->DisplayOn(Lcd_CompObj) < 0)
|
||||
{
|
||||
ret = BSP_ERROR_COMPONENT_FAILURE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disables the display.
|
||||
* @param Instance LCD Instance
|
||||
* @retval Error status
|
||||
*/
|
||||
int32_t ADAFRUIT_802_LCD_DisplayOff(uint32_t Instance)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
if(Instance >= LCD_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else if(Lcd_Drv->DisplayOff != NULL)
|
||||
{
|
||||
if(Lcd_Drv->DisplayOff(Lcd_CompObj) < 0)
|
||||
{
|
||||
ret = BSP_ERROR_COMPONENT_FAILURE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Set the brightness value
|
||||
* @param Instance LCD Instance
|
||||
* @param Brightness [00: Min (black), 100 Max]
|
||||
* @retval Error status
|
||||
*/
|
||||
int32_t ADAFRUIT_802_LCD_SetBrightness(uint32_t Instance, uint32_t Brightness)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
if(Instance >= LCD_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else if(Lcd_Drv->SetBrightness != NULL)
|
||||
{
|
||||
if(Lcd_Drv->SetBrightness(Lcd_CompObj, Brightness) < 0)
|
||||
{
|
||||
ret = BSP_ERROR_COMPONENT_FAILURE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the brightness value
|
||||
* @param Instance LCD Instance
|
||||
* @param Brightness [00: Min (black), 100 Max]
|
||||
* @retval Error status
|
||||
*/
|
||||
int32_t ADAFRUIT_802_LCD_GetBrightness(uint32_t Instance, uint32_t *Brightness)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
if(Instance >= LCD_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else if(Lcd_Drv->GetBrightness != NULL)
|
||||
{
|
||||
if(Lcd_Drv->GetBrightness(Lcd_CompObj, Brightness) < 0)
|
||||
{
|
||||
ret = BSP_ERROR_COMPONENT_FAILURE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_LCD_Private_Functions LCD Private Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Register Bus IOs if component ID is OK
|
||||
* @param Orientation Display orientation
|
||||
* @retval Error status
|
||||
*/
|
||||
static int32_t ST7735_Probe(uint32_t Orientation)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
ST7735_IO_t IOCtx;
|
||||
static ST7735_Object_t ST7735Obj;
|
||||
|
||||
/* Configure the audio driver */
|
||||
IOCtx.Address = 0;
|
||||
IOCtx.Init = LCD_IO_Init;
|
||||
IOCtx.DeInit = LCD_IO_DeInit;
|
||||
IOCtx.GetTick = BSP_GetTick;
|
||||
IOCtx.WriteReg = LCD_IO_WriteReg;
|
||||
IOCtx.SendData = LCD_IO_SendData;
|
||||
|
||||
if(ST7735_RegisterBusIO(&ST7735Obj, &IOCtx) != ST7735_OK)
|
||||
{
|
||||
ret = BSP_ERROR_BUS_FAILURE;
|
||||
}
|
||||
else
|
||||
{
|
||||
Lcd_CompObj = &ST7735Obj;
|
||||
|
||||
Lcd_Drv = (LCD_Drv_t *) &ST7735_LCD_Driver;
|
||||
if(Lcd_Drv->Init(Lcd_CompObj, ST7735_FORMAT_DEFAULT, Orientation) != ST7735_OK)
|
||||
{
|
||||
ret = BSP_ERROR_COMPONENT_FAILURE;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initializes the LCD
|
||||
* @retval None
|
||||
*/
|
||||
static int32_t LCD_IO_Init(void)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
|
||||
/* LCD_CS_GPIO and LCD_DC_GPIO Periph clock enable */
|
||||
ADAFRUIT_802_LCD_CS_GPIO_CLK_ENABLE();
|
||||
ADAFRUIT_802_LCD_DC_GPIO_CLK_ENABLE();
|
||||
|
||||
/* Configure LCD_CS_PIN pin: LCD Card CS pin */
|
||||
GPIO_InitStruct.Pin = ADAFRUIT_802_LCD_CS_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||
HAL_GPIO_Init(ADAFRUIT_802_LCD_CS_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* Configure LCD_DC_PIN pin: LCD Card DC pin */
|
||||
GPIO_InitStruct.Pin = ADAFRUIT_802_LCD_DC_PIN;
|
||||
HAL_GPIO_Init(ADAFRUIT_802_LCD_DC_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* LCD chip select high */
|
||||
ADAFRUIT_802_LCD_CS_HIGH();
|
||||
|
||||
/* LCD SPI Config */
|
||||
if(BUS_SPIx_Init() != BSP_ERROR_NONE)
|
||||
{
|
||||
ret = BSP_ERROR_NO_INIT;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief De-Initializes the LCD
|
||||
* @retval None
|
||||
*/
|
||||
static int32_t LCD_IO_DeInit(void)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
|
||||
/* LCD chip de-select high */
|
||||
ADAFRUIT_802_LCD_CS_LOW();
|
||||
|
||||
/* Configure LCD_CS_PIN pin: LCD Card CS pin */
|
||||
GPIO_InitStruct.Pin = ADAFRUIT_802_LCD_CS_PIN;
|
||||
HAL_GPIO_DeInit(ADAFRUIT_802_LCD_CS_GPIO_PORT, GPIO_InitStruct.Pin);
|
||||
|
||||
/* Configure LCD_DC_PIN pin: LCD Card DC pin */
|
||||
GPIO_InitStruct.Pin = ADAFRUIT_802_LCD_DC_PIN;
|
||||
HAL_GPIO_DeInit(ADAFRUIT_802_LCD_DC_GPIO_PORT, GPIO_InitStruct.Pin);
|
||||
|
||||
/* LCD_CS_GPIO and LCD_DC_GPIO Periph clock disable */
|
||||
ADAFRUIT_802_LCD_CS_GPIO_CLK_DISABLE();
|
||||
ADAFRUIT_802_LCD_DC_GPIO_CLK_DISABLE();
|
||||
|
||||
return BSP_ERROR_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Writes command to select the LCD register.
|
||||
* @param Reg Address of the selected register.
|
||||
* @param pData pointer to data to write to the register
|
||||
* @param Length length of data to write to the register
|
||||
* @retval Error status
|
||||
*/
|
||||
static int32_t LCD_IO_WriteReg(uint8_t Reg, uint8_t* pData, uint32_t Length)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
/* Reset LCD control line CS */
|
||||
ADAFRUIT_802_LCD_CS_LOW();
|
||||
|
||||
/* Set LCD data/command line DC to Low */
|
||||
ADAFRUIT_802_LCD_DC_LOW();
|
||||
|
||||
/* Send Command */
|
||||
if(BUS_SPIx_Send(&Reg, 1) != BSP_ERROR_NONE)
|
||||
{
|
||||
ret = BSP_ERROR_PERIPH_FAILURE;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Deselect : Chip Select high */
|
||||
ADAFRUIT_802_LCD_CS_HIGH();
|
||||
|
||||
/* Send Data */
|
||||
ret = LCD_IO_SendData(pData, Length);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send data to select the LCD GRAM.
|
||||
* @param pData pointer to data to write to LCD GRAM.
|
||||
* @param Length length of data to write to LCD GRAM
|
||||
* @retval Error status
|
||||
*/
|
||||
static int32_t LCD_IO_SendData(uint8_t *pData, uint32_t Length)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
if(Length != 0U)
|
||||
{
|
||||
/* Reset LCD control line CS */
|
||||
ADAFRUIT_802_LCD_CS_LOW();
|
||||
|
||||
/* Set LCD data/command line DC to High */
|
||||
ADAFRUIT_802_LCD_DC_HIGH();
|
||||
|
||||
if(BUS_SPIx_Send(pData, Length) != BSP_ERROR_NONE)
|
||||
{
|
||||
ret = BSP_ERROR_PERIPH_FAILURE;
|
||||
}
|
||||
|
||||
/* Deselect : Chip Select high */
|
||||
ADAFRUIT_802_LCD_CS_HIGH();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
138
lib/main/STM32H7/Drivers/BSP/Adafruit_Shield/adafruit_802_lcd.h
Normal file
|
@ -0,0 +1,138 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file adafruit_802_lcd.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains the common defines and functions prototypes for
|
||||
* the adafruit_802_lcd.c driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef ADAFRUIT_802_LCD_H
|
||||
#define ADAFRUIT_802_LCD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "adafruit_802.h"
|
||||
#include "adafruit_802_conf.h"
|
||||
#include "lcd.h"
|
||||
#include "../Components/st7735/st7735.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ADAFRUIT_802
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_LCD LCD
|
||||
* @{
|
||||
*/
|
||||
/** @defgroup ADAFRUIT_802_LCD_Exported_Variables LCD Exported Variables
|
||||
* @{
|
||||
*/
|
||||
extern const LCD_UTILS_Drv_t LCD_Driver;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_LCD_Exported_Constants LCD Exported Constants
|
||||
* @{
|
||||
*/
|
||||
#define LCD_INSTANCES_NBR 1U
|
||||
|
||||
#define LCD_ORIENTATION_PORTRAIT 0x00U /* Portrait orientation choice of LCD screen */
|
||||
#define LCD_ORIENTATION_PORTRAIT_ROT180 0x01U /* Portrait rotated 180° orientation choice of LCD screen */
|
||||
#define LCD_ORIENTATION_LANDSCAPE 0x02U /* Landscape orientation choice of LCD screen */
|
||||
#define LCD_ORIENTATION_LANDSCAPE_ROT180 0x03U /* Landscape rotated 180° orientation choice of LCD screen */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_LCD_Exported_Types LCD Exported Types
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t XSize;
|
||||
uint32_t YSize;
|
||||
uint32_t PixelFormat;
|
||||
uint32_t IsMspCallbacksValid;
|
||||
} ADAFRUIT_802_LCD_Ctx_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup ADAFRUIT_802_LCD_Exported_Variables
|
||||
* @{
|
||||
*/
|
||||
extern ADAFRUIT_802_LCD_Ctx_t Lcd_Ctx[LCD_INSTANCES_NBR];
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_LCD_Exported_Functions LCD Exported Functions
|
||||
* @{
|
||||
*/
|
||||
int32_t ADAFRUIT_802_LCD_Init(uint32_t Instance, uint32_t Orientation);
|
||||
int32_t ADAFRUIT_802_LCD_DeInit(uint32_t Instance);
|
||||
|
||||
/* LCD generic APIs: Display control */
|
||||
int32_t ADAFRUIT_802_LCD_DisplayOn(uint32_t Instance);
|
||||
int32_t ADAFRUIT_802_LCD_DisplayOff(uint32_t Instance);
|
||||
int32_t ADAFRUIT_802_LCD_SetBrightness(uint32_t Instance, uint32_t Brightness);
|
||||
int32_t ADAFRUIT_802_LCD_GetBrightness(uint32_t Instance, uint32_t *Brightness);
|
||||
int32_t ADAFRUIT_802_LCD_GetXSize(uint32_t Instance, uint32_t *XSize);
|
||||
int32_t ADAFRUIT_802_LCD_GetYSize(uint32_t Instance, uint32_t *YSize);
|
||||
|
||||
/* LCD generic APIs: Draw operations. This list of APIs is required for
|
||||
lcd gfx utilities */
|
||||
int32_t ADAFRUIT_802_LCD_GetPixelFormat(uint32_t Instance, uint32_t *PixelFormat);
|
||||
int32_t ADAFRUIT_802_LCD_DrawBitmap(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint8_t *pBmp);
|
||||
int32_t ADAFRUIT_802_LCD_FillRGBRect(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint8_t *pData, uint32_t Width, uint32_t Height);
|
||||
int32_t ADAFRUIT_802_LCD_DrawHLine(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color);
|
||||
int32_t ADAFRUIT_802_LCD_DrawVLine(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color);
|
||||
int32_t ADAFRUIT_802_LCD_FillRect(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Width, uint32_t Height, uint32_t Color);
|
||||
int32_t ADAFRUIT_802_LCD_ReadPixel(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t *Color);
|
||||
int32_t ADAFRUIT_802_LCD_WritePixel(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Color);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ADAFRUIT_802_LCD_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
1617
lib/main/STM32H7/Drivers/BSP/Adafruit_Shield/adafruit_802_sd.c
Normal file
223
lib/main/STM32H7/Drivers/BSP/Adafruit_Shield/adafruit_802_sd.h
Normal file
|
@ -0,0 +1,223 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file adafruit_802_sd.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains the common defines and functions prototypes for
|
||||
* the adafruit_802_sd.c driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef ADAFRUIT_802_SD_H
|
||||
#define ADAFRUIT_802_SD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "adafruit_802_conf.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ADAFRUIT_802
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_SD SD
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_SD_Exported_Types SD Exported Types
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Reserved1:2U; /* Reserved */
|
||||
uint32_t DeviceSize:12U; /* Device Size */
|
||||
uint32_t MaxRdCurrentVDDMin:3U; /* Max. read current @ VDD min */
|
||||
uint32_t MaxRdCurrentVDDMax:3U; /* Max. read current @ VDD max */
|
||||
uint32_t MaxWrCurrentVDDMin:3U; /* Max. write current @ VDD min */
|
||||
uint32_t MaxWrCurrentVDDMax:3U; /* Max. write current @ VDD max */
|
||||
uint32_t DeviceSizeMul:3U; /* Device size multiplier */
|
||||
} SD_Version_1_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Reserved1:6U; /* Reserved */
|
||||
uint32_t DeviceSize:22U; /* Device Size */
|
||||
uint32_t Reserved2:1U; /* Reserved */
|
||||
} SD_Version_2_t;
|
||||
|
||||
/**
|
||||
* @brief Card Specific Data: CSD Register
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
/* Header part */
|
||||
uint32_t CSDStruct:2U; /* CSD structure */
|
||||
uint32_t Reserved1:6U; /* Reserved */
|
||||
uint32_t TAAC:8U; /* Data read access-time 1 */
|
||||
uint32_t NSAC:8U; /* Data read access-time 2 in CLK cycles */
|
||||
uint32_t MaxBusClkFrec:8U; /* Max. bus clock frequency */
|
||||
uint32_t CardComdClasses:12U; /* Card command classes */
|
||||
uint32_t RdBlockLen:4U; /* Max. read data block length */
|
||||
uint32_t PartBlockRead:1U; /* Partial blocks for read allowed */
|
||||
uint32_t WrBlockMisalign:1U; /* Write block misalignment */
|
||||
uint32_t RdBlockMisalign:1U; /* Read block misalignment */
|
||||
uint32_t DSRImpl:1U; /* DSR implemented */
|
||||
|
||||
/* v1 or v2 struct */
|
||||
union csd_version
|
||||
{
|
||||
SD_Version_1_t v1;
|
||||
SD_Version_2_t v2;
|
||||
} version;
|
||||
|
||||
uint32_t EraseSingleBlockEnable:1U; /* Erase single block enable */
|
||||
uint32_t EraseSectorSize:7U; /* Erase group size multiplier */
|
||||
uint32_t WrProtectGrSize:7U; /* Write protect group size */
|
||||
uint32_t WrProtectGrEnable:1U; /* Write protect group enable */
|
||||
uint32_t Reserved2:2U; /* Reserved */
|
||||
uint32_t WrSpeedFact:3U; /* Write speed factor */
|
||||
uint32_t MaxWrBlockLen:4U; /* Max. write data block length */
|
||||
uint32_t WriteBlockPartial:1U; /* Partial blocks for write allowed */
|
||||
uint32_t Reserved3:5U; /* Reserved */
|
||||
uint32_t FileFormatGrouop:1U; /* File format group */
|
||||
uint32_t CopyFlag:1U; /* Copy flag (OTP) */
|
||||
uint32_t PermWrProtect:1U; /* Permanent write protection */
|
||||
uint32_t TempWrProtect:1U; /* Temporary write protection */
|
||||
uint32_t FileFormat:2U; /* File Format */
|
||||
uint32_t Reserved4:2U; /* Reserved */
|
||||
uint32_t crc:7U; /* Reserved */
|
||||
uint32_t Reserved5:1U; /* always 1*/
|
||||
|
||||
} SD_CardSpecificData_t;
|
||||
|
||||
/**
|
||||
* @brief Card Identification Data: CID Register
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t ManufacturerID; /* ManufacturerID */
|
||||
uint32_t OEM_AppliID; /* OEM/Application ID */
|
||||
uint32_t ProdName1; /* Product Name part1 */
|
||||
uint32_t ProdName2; /* Product Name part2*/
|
||||
uint32_t ProdRev; /* Product Revision */
|
||||
uint32_t ProdSN; /* Product Serial Number */
|
||||
uint32_t Reserved1; /* Reserved1 */
|
||||
uint32_t ManufactDate; /* Manufacturing Date */
|
||||
uint32_t CID_CRC; /* CID CRC */
|
||||
uint32_t Reserved2; /* always 1 */
|
||||
} SD_CardIdData_t;
|
||||
|
||||
/**
|
||||
* @brief SD Card information
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
SD_CardSpecificData_t Csd;
|
||||
SD_CardIdData_t Cid;
|
||||
uint32_t CardCapacity; /*!< Card Capacity */
|
||||
uint32_t CardBlockSize; /*!< Card Block Size */
|
||||
uint32_t LogBlockNbr; /*!< Specifies the Card logical Capacity in blocks */
|
||||
uint32_t LogBlockSize; /*!< Specifies logical block size in bytes */
|
||||
} SD_CardInfo_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_SPI_SD_Exported_Constants SD Exported Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Block Size
|
||||
*/
|
||||
#define ADAFRUIT_SD_BLOCK_SIZE 512U
|
||||
|
||||
/**
|
||||
* @brief SD instance number
|
||||
*/
|
||||
#define SD_INSTANCES_NBR 1UL
|
||||
|
||||
/**
|
||||
* @brief SD transfer state definition
|
||||
*/
|
||||
#define SD_TRANSFER_OK 0U
|
||||
#define SD_TRANSFER_BUSY 1U
|
||||
|
||||
/**
|
||||
* @brief SD detection on its memory slot
|
||||
*/
|
||||
#define SD_PRESENT 1UL
|
||||
#define SD_NOT_PRESENT 0UL
|
||||
|
||||
/**
|
||||
* @brief SD capacity type
|
||||
*/
|
||||
#define ADAFRUIT_802_CARD_SDSC 0UL /* SD Standard Capacity */
|
||||
#define ADAFRUIT_802_CARD_SDHC 1UL /* SD High Capacity */
|
||||
|
||||
/**
|
||||
* @brief SD Card information structure
|
||||
*/
|
||||
#define ADAFRUIT_802_SD_CardInfo_t SD_CardInfo_t
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ADAFRUIT_802_SD_Exported_Functions SD Exported Functions
|
||||
* @{
|
||||
*/
|
||||
int32_t ADAFRUIT_802_SD_Init(uint32_t Instance);
|
||||
int32_t ADAFRUIT_802_SD_DeInit(uint32_t Instance);
|
||||
int32_t ADAFRUIT_802_SD_DetectITConfig(uint32_t Instance);
|
||||
int32_t ADAFRUIT_802_SD_ReadBlocks(uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr);
|
||||
int32_t ADAFRUIT_802_SD_WriteBlocks(uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr);
|
||||
int32_t ADAFRUIT_802_SD_ReadBlocks_DMA(uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr);
|
||||
int32_t ADAFRUIT_802_SD_WriteBlocks_DMA(uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr);
|
||||
int32_t ADAFRUIT_802_SD_ReadBlocks_IT(uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr);
|
||||
int32_t ADAFRUIT_802_SD_WriteBlocks_IT(uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr);
|
||||
int32_t ADAFRUIT_802_SD_Erase(uint32_t Instance, uint32_t BlockIdx, uint32_t BlocksNbr);
|
||||
int32_t ADAFRUIT_802_SD_GetCardState(uint32_t Instance);
|
||||
int32_t ADAFRUIT_802_SD_GetCardInfo(uint32_t Instance, ADAFRUIT_802_SD_CardInfo_t *CardInfo);
|
||||
int32_t ADAFRUIT_802_SD_IsDetected(uint32_t Instance);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ADAFRUIT_802_SD_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
@ -0,0 +1,211 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
<title>Release Notes for BSP Common Components Drivers</title>
|
||||
<style type="text/css">
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
span.underline{text-decoration: underline;}
|
||||
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="_htmresc/mini-st.css" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-4">
|
||||
<div class="card fluid">
|
||||
<div class="sectione dark">
|
||||
<center>
|
||||
<h1 id="release-notes-for-bsp-common-components-drivers"><small>Release Notes for</small> <mark>BSP Common Components Drivers</mark></h1>
|
||||
<p>Copyright © 2014 STMicroelectronics<br />
|
||||
</p>
|
||||
<a href="https://www.st.com" class="logo"><img src="_htmresc/st_logo.png" alt="ST logo" /></a>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
<h1 id="license">License</h1>
|
||||
<p>Licensed by ST under BSD 3-Clause license (the "License"). You may not use this package except in compliance with the License. You may obtain a copy of the License at:</p>
|
||||
<p><a href="https://opensource.org/licenses/BSD-3-Clause">https://opensource.org/licenses/BSD-3-Clause</a></p>
|
||||
<h1 id="purpose">Purpose</h1>
|
||||
<p>This directory contains the BSP Common components drivers.</p>
|
||||
</div>
|
||||
<div class="col-sm-12 col-lg-8">
|
||||
<h1 id="update-history">Update History</h1>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section16" checked aria-hidden="true"> <label for="collapse-section16" aria-hidden="true">V7.0.0 / 25-February-2020</label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<h3 id="component-release">Component release</h3>
|
||||
<ul>
|
||||
<li>Rename GUI_Drv_t structure into UTILS_LCD_Drv_t</li>
|
||||
</ul>
|
||||
<h2 id="backward-compatibility">Backward Compatibility</h2>
|
||||
<ul>
|
||||
<li>This release breaks compatibility with previous versions.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section15" aria-hidden="true"> <label for="collapse-section15" aria-hidden="true">V6.0.1 / 15-October-2019</label>
|
||||
<div>
|
||||
<h2 id="main-changes-1">Main Changes</h2>
|
||||
<h3 id="component-release-1">Component release</h3>
|
||||
<ul>
|
||||
<li>Update st_logo.png inclusion path in Release notes.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section14" aria-hidden="true"> <label for="collapse-section14" aria-hidden="true">V6.0.0 / 12-April-2019</label>
|
||||
<div>
|
||||
<h2 id="main-changes-2">Main Changes</h2>
|
||||
<h3 id="component-release-2">Component release</h3>
|
||||
<p>Official release of BSP Common components drivers in line with STM32Cube BSP drivers development guidelines (UM2298).</p>
|
||||
<h2 id="backward-compatibility-1">Backward Compatibility</h2>
|
||||
<p>This release breaks compatibility with previous versions.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section13" aria-hidden="true"> <label for="collapse-section13" aria-hidden="true">V5.1.1 / 31-August-2018</label>
|
||||
<div>
|
||||
<h2 id="main-changes-3">Main Changes</h2>
|
||||
<p>Reformat the BSD 3-Clause license declaration in the files header (replace license terms by a web reference to OSI website where those terms lie)<br />
|
||||
Correct sensor names in headers files hsensor.h and psensor.h</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section12" aria-hidden="true"> <label for="collapse-section12" aria-hidden="true">V5.1.0 / 21-November-2017</label>
|
||||
<div>
|
||||
<h2 id="main-changes-4">Main Changes</h2>
|
||||
<p>Add dpredriver.h: support of DP redriver class<br />
|
||||
Add pwrmon.h: support of power monitor class<br />
|
||||
Add usbtypecswitch.h: support of USB type C switch class</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section11" aria-hidden="true"> <label for="collapse-section11" aria-hidden="true">V5.0.0 / 01-March-2017</label>
|
||||
<div>
|
||||
<h2 id="main-changes-5">Main Changes</h2>
|
||||
<p>Add hsensor.h: support of humidity class<br />
|
||||
Add psensor.h: support of pressure class<br />
|
||||
Update tsensor.h: Temperature can be negative<br />
|
||||
Update accelero.h: LowPower API can enable or disable the low power mode<br />
|
||||
Update magneto.h: LowPower API can enable or disable the low power mode</p>
|
||||
<h2 id="backward-compatibility-2">Backward Compatibility</h2>
|
||||
<p>This release breaks compatibility with previous versions.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section10" aria-hidden="true"> <label for="collapse-section10" aria-hidden="true">V4.0.1 / 21-July-2015</label>
|
||||
<div>
|
||||
<h2 id="main-changes-6">Main Changes</h2>
|
||||
<p>tsensor.h: Fix compilation issue on <em>TSENSOR_InitTypeDef</em></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section9" aria-hidden="true"> <label for="collapse-section9" aria-hidden="true">V4.0.0 / 22-June-2015</label>
|
||||
<div>
|
||||
<h2 id="main-changes-7">Main Changes</h2>
|
||||
<p>accelero.h: add <em>DeInit</em> field in <em>ACCELERO_DrvTypeDef</em> structure<br />
|
||||
audio.h: add <em>DeInit</em> field in <em>AUDIO_DrvTypeDef</em> structure<br />
|
||||
idd.h:</p>
|
||||
<ul>
|
||||
<li>add <em>Shunt0StabDelay</em>, <em>Shunt1StabDelay</em>, <em>Shunt2StabDelay</em>, <em>Shunt3StabDelay</em>, <em>Shunt4StabDelay</em> and <em>ShuntNbOnBoard</em> fields in <em>IDD_ConfigTypeDef</em> structure<br />
|
||||
</li>
|
||||
<li>rename <em>ShuntNumber</em> field to <em>ShuntNbUsed</em> in <em>IDD_ConfigTypeDef</em> structure</li>
|
||||
</ul>
|
||||
<p>magneto.h: add <em>DeInit</em> field in <em>MAGNETO_DrvTypeDef</em> structure</p>
|
||||
<h2 id="backward-compatibility-3">Backward Compatibility</h2>
|
||||
<p>This release breaks compatibility with previous versions.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section8" aria-hidden="true"> <label for="collapse-section8" aria-hidden="true">V3.0.0 / 28-April-2015</label>
|
||||
<div>
|
||||
<h2 id="main-changes-8">Main Changes</h2>
|
||||
<p>accelero.h: add <em>LowPower</em> field in <em>ACCELERO_DrvTypeDef</em> structure<br />
|
||||
magneto.h: add <em>LowPower</em> field in <em>MAGNETO_DrvTypeDef</em> structure<br />
|
||||
gyro.h: add <em>DeInit</em> and <em>LowPower</em> fields in <em>GYRO_DrvTypeDef</em> structure<br />
|
||||
camera.h: add CAMERA_COLOR_EFFECT_NONE define<br />
|
||||
idd.h:</p>
|
||||
<ul>
|
||||
<li>add <em>MeasureNb</em>, <em>DeltaDelayUnit</em> and <em>DeltaDelayValue</em> fields in <em>IDD_ConfigTypeDef</em> structure<br />
|
||||
</li>
|
||||
<li>rename <em>PreDelay</em> field to <em>PreDelayUnit</em> in <em>IDD_ConfigTypeDef</em> structure</li>
|
||||
</ul>
|
||||
<h2 id="backward-compatibility-4">Backward Compatibility</h2>
|
||||
<p>This release breaks compatibility with previous versions.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section7" aria-hidden="true"> <label for="collapse-section7" aria-hidden="true">V2.2.0 / 09-February-2015</label>
|
||||
<div>
|
||||
<h2 id="main-changes-9">Main Changes</h2>
|
||||
<p>Magnetometer driver function prototypes added (magneto.h file)<br />
|
||||
Update “idd.h” file to provide DeInit() and WakeUp() services in IDD current measurement driver</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section6" aria-hidden="true"> <label for="collapse-section6" aria-hidden="true">V2.1.0 / 06-February-2015</label>
|
||||
<div>
|
||||
<h2 id="main-changes-10">Main Changes</h2>
|
||||
<p>IDD current measurement driver function prototypes added (idd.h file)<br />
|
||||
io.h: add new typedef enum IO_PinState with IO_PIN_RESET and IO_PIN_SET values</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section5" aria-hidden="true"> <label for="collapse-section5" aria-hidden="true">V2.0.0 / 15-December-2014</label>
|
||||
<div>
|
||||
<h2 id="main-changes-11">Main Changes</h2>
|
||||
<p>Update “io.h” file to support MFX (Multi Function eXpander) device available on some STM32 boards</p>
|
||||
<ul>
|
||||
<li>add new entries for <em>IO_ModeTypedef</em> enumeration structure</li>
|
||||
<li>update the <em>IO_DrvTypeDef</em> structure</li>
|
||||
<li>Update all return values and function parameters to uint32_t</li>
|
||||
<li>Add a return value for <em>Config</em> field</li>
|
||||
</ul>
|
||||
<h2 id="backward-compatibility-5">Backward Compatibility</h2>
|
||||
<p>This release breaks compatibility with previous versions.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section4" aria-hidden="true"> <label for="collapse-section4" aria-hidden="true">V1.2.1 / 02-December-2014</label>
|
||||
<div>
|
||||
<h2 id="main-changes-12">Main Changes</h2>
|
||||
<p>gyro.h: change “__GIRO_H” by “__GYRO_H” to fix compilation issue under Mac OS</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section3" aria-hidden="true"> <label for="collapse-section3" aria-hidden="true">V1.2.0 / 18-June-2014</label>
|
||||
<div>
|
||||
<h2 id="main-changes-13">Main Changes</h2>
|
||||
<p>EPD (E Paper Display) driver function prototype added (epd.h file)</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section2" aria-hidden="true"> <label for="collapse-section2" aria-hidden="true">V1.1.0 / 21-March-2014</label>
|
||||
<div>
|
||||
<h2 id="main-changes-14">Main Changes</h2>
|
||||
<p>Temperature Sensor driver function prototype added</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section1" aria-hidden="true"> <label for="collapse-section1" aria-hidden="true">V1.0.0 / 18-February-2014</label>
|
||||
<div>
|
||||
<h2 id="main-changes-15">Main Changes</h2>
|
||||
<p>First official release with Accelerometer, Audio, Camera, Gyroscope, IO, LCD and Touch Screen drivers function prototypes</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="sticky">
|
||||
For complete documentation on <mark>STM32 Microcontrollers</mark> , visit: <a href="http://www.st.com/STM32">http://www.st.com/STM32</a>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
285
lib/main/STM32H7/Drivers/BSP/Components/Common/Release_Notes.md
Normal file
|
@ -0,0 +1,285 @@
|
|||
---
|
||||
pagetitle: Release Notes for BSP Common Components Drivers
|
||||
lang: en
|
||||
---
|
||||
|
||||
::: {.row}
|
||||
::: {.col-sm-12 .col-lg-4}
|
||||
|
||||
::: {.card .fluid}
|
||||
::: {.sectione .dark}
|
||||
<center>
|
||||
# <small>Release Notes for</small> <mark>BSP Common Components Drivers</mark>
|
||||
Copyright © 2014 STMicroelectronics\
|
||||
|
||||
[](https://www.st.com){.logo}
|
||||
</center>
|
||||
:::
|
||||
:::
|
||||
|
||||
# License
|
||||
|
||||
Licensed by ST under BSD 3-Clause license (the \"License\"). You may
|
||||
not use this package except in compliance with the License. You may
|
||||
obtain a copy of the License at:
|
||||
|
||||
[https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause)
|
||||
|
||||
# Purpose
|
||||
|
||||
This directory contains the BSP Common components drivers.
|
||||
|
||||
:::
|
||||
|
||||
::: {.col-sm-12 .col-lg-8}
|
||||
# Update History
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section16" checked aria-hidden="true">
|
||||
<label for="collapse-section16" aria-hidden="true">V7.0.0 / 25-February-2020</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
### Component release
|
||||
|
||||
- Rename GUI_Drv_t structure into UTILS_LCD_Drv_t
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
- This release breaks compatibility with previous versions.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section15" aria-hidden="true">
|
||||
<label for="collapse-section15" aria-hidden="true">V6.0.1 / 15-October-2019</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
### Component release
|
||||
|
||||
- Update st_logo.png inclusion path in Release notes.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section14" aria-hidden="true">
|
||||
<label for="collapse-section14" aria-hidden="true">V6.0.0 / 12-April-2019</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
### Component release
|
||||
|
||||
Official release of BSP Common components drivers in line with STM32Cube BSP drivers development guidelines (UM2298).
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
This release breaks compatibility with previous versions.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section13" aria-hidden="true">
|
||||
<label for="collapse-section13" aria-hidden="true">V5.1.1 / 31-August-2018</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
Reformat the BSD 3-Clause license declaration in the files header (replace license terms by a web reference to OSI website where those terms lie)
|
||||
Correct sensor names in headers files hsensor.h and psensor.h
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section12" aria-hidden="true">
|
||||
<label for="collapse-section12" aria-hidden="true">V5.1.0 / 21-November-2017</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
Add dpredriver.h: support of DP redriver class
|
||||
Add pwrmon.h: support of power monitor class
|
||||
Add usbtypecswitch.h: support of USB type C switch class
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section11" aria-hidden="true">
|
||||
<label for="collapse-section11" aria-hidden="true">V5.0.0 / 01-March-2017</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
Add hsensor.h: support of humidity class
|
||||
Add psensor.h: support of pressure class
|
||||
Update tsensor.h: Temperature can be negative
|
||||
Update accelero.h: LowPower API can enable or disable the low power mode
|
||||
Update magneto.h: LowPower API can enable or disable the low power mode
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
This release breaks compatibility with previous versions.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section10" aria-hidden="true">
|
||||
<label for="collapse-section10" aria-hidden="true">V4.0.1 / 21-July-2015</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
tsensor.h: Fix compilation issue on *TSENSOR_InitTypeDef*
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section9" aria-hidden="true">
|
||||
<label for="collapse-section9" aria-hidden="true">V4.0.0 / 22-June-2015</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
accelero.h: add *DeInit* field in *ACCELERO_DrvTypeDef* structure
|
||||
audio.h: add *DeInit* field in *AUDIO_DrvTypeDef* structure
|
||||
idd.h:
|
||||
|
||||
- add *Shunt0StabDelay*, *Shunt1StabDelay*, *Shunt2StabDelay*, *Shunt3StabDelay*, *Shunt4StabDelay* and *ShuntNbOnBoard* fields in *IDD_ConfigTypeDef* structure
|
||||
- rename *ShuntNumber* field to *ShuntNbUsed* in *IDD_ConfigTypeDef* structure
|
||||
|
||||
magneto.h: add *DeInit* field in *MAGNETO_DrvTypeDef* structure
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
This release breaks compatibility with previous versions.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section8" aria-hidden="true">
|
||||
<label for="collapse-section8" aria-hidden="true">V3.0.0 / 28-April-2015</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
accelero.h: add *LowPower* field in *ACCELERO_DrvTypeDef* structure
|
||||
magneto.h: add *LowPower* field in *MAGNETO_DrvTypeDef* structure
|
||||
gyro.h: add *DeInit* and *LowPower* fields in *GYRO_DrvTypeDef* structure
|
||||
camera.h: add CAMERA_COLOR_EFFECT_NONE define
|
||||
idd.h:
|
||||
|
||||
- add *MeasureNb*, *DeltaDelayUnit* and *DeltaDelayValue* fields in *IDD_ConfigTypeDef* structure
|
||||
- rename *PreDelay* field to *PreDelayUnit* in *IDD_ConfigTypeDef* structure
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
This release breaks compatibility with previous versions.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section7" aria-hidden="true">
|
||||
<label for="collapse-section7" aria-hidden="true">V2.2.0 / 09-February-2015</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
Magnetometer driver function prototypes added (magneto.h file)
|
||||
Update "idd.h" file to provide DeInit() and WakeUp() services in IDD current measurement driver
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section6" aria-hidden="true">
|
||||
<label for="collapse-section6" aria-hidden="true">V2.1.0 / 06-February-2015</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
IDD current measurement driver function prototypes added (idd.h file)
|
||||
io.h: add new typedef enum IO_PinState with IO_PIN_RESET and IO_PIN_SET values
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section5" aria-hidden="true">
|
||||
<label for="collapse-section5" aria-hidden="true">V2.0.0 / 15-December-2014</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
Update "io.h" file to support MFX (Multi Function eXpander) device available on some STM32 boards
|
||||
|
||||
- add new entries for *IO_ModeTypedef* enumeration structure
|
||||
- update the *IO_DrvTypeDef* structure
|
||||
- Update all return values and function parameters to uint32_t
|
||||
- Add a return value for *Config* field
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
This release breaks compatibility with previous versions.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section4" aria-hidden="true">
|
||||
<label for="collapse-section4" aria-hidden="true">V1.2.1 / 02-December-2014</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
gyro.h: change “__GIRO_H” by “__GYRO_H” to fix compilation issue under Mac OS
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section3" aria-hidden="true">
|
||||
<label for="collapse-section3" aria-hidden="true">V1.2.0 / 18-June-2014</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
EPD (E Paper Display) driver function prototype added (epd.h file)
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section2" aria-hidden="true">
|
||||
<label for="collapse-section2" aria-hidden="true">V1.1.0 / 21-March-2014</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
Temperature Sensor driver function prototype added
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section1" aria-hidden="true">
|
||||
<label for="collapse-section1" aria-hidden="true">V1.0.0 / 18-February-2014</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
First official release with Accelerometer, Audio, Camera, Gyroscope, IO, LCD and Touch Screen drivers function prototypes
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
:::
|
||||
:::
|
||||
|
||||
<footer class="sticky">
|
||||
For complete documentation on <mark>STM32 Microcontrollers</mark> ,
|
||||
visit: [http://www.st.com/STM32](http://www.st.com/STM32)
|
||||
</footer>
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
108
lib/main/STM32H7/Drivers/BSP/Components/Common/audio.h
Normal file
|
@ -0,0 +1,108 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file audio.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the common defines and functions prototypes
|
||||
* for the Audio driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef AUDIO_H
|
||||
#define AUDIO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup AUDIO
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup AUDIO_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup AUDIO_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/** @defgroup AUDIO_Driver_structure Audio Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int32_t (*Init )(void*, void*);
|
||||
int32_t (*DeInit )(void*);
|
||||
int32_t (*ReadID )(void*, uint32_t*);
|
||||
int32_t (*Play )(void*);
|
||||
int32_t (*Pause )(void*);
|
||||
int32_t (*Resume )(void*);
|
||||
int32_t (*Stop )(void*, uint32_t);
|
||||
int32_t (*SetFrequency )(void*, uint32_t);
|
||||
int32_t (*GetFrequency )(void*);
|
||||
int32_t (*SetVolume )(void*, uint32_t, uint8_t);
|
||||
int32_t (*GetVolume )(void*, uint32_t, uint8_t*);
|
||||
int32_t (*SetMute )(void*, uint32_t);
|
||||
int32_t (*SetOutputMode )(void*, uint32_t);
|
||||
int32_t (*SetResolution )(void*, uint32_t);
|
||||
int32_t (*GetResolution )(void*, uint32_t*);
|
||||
int32_t (*SetProtocol )(void*, uint32_t);
|
||||
int32_t (*GetProtocol )(void*, uint32_t*);
|
||||
int32_t (*Reset )(void*);
|
||||
}AUDIO_Drv_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* AUDIO_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
106
lib/main/STM32H7/Drivers/BSP/Components/Common/camera.h
Normal file
|
@ -0,0 +1,106 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file camera.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the common defines and functions prototypes
|
||||
* for the camera driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef CAMERA_H
|
||||
#define CAMERA_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup CAMERA
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup CAMERA_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup CAMERA_Driver_structure Camera Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int32_t (*Init )(void*, uint32_t, uint32_t);
|
||||
int32_t (*DeInit )(void*);
|
||||
int32_t (*ReadID )(void*, uint32_t*);
|
||||
int32_t (*GetCapabilities )(void*, void*);
|
||||
int32_t (*SetLightMode )(void*, uint32_t);
|
||||
int32_t (*SetColorEffect )(void*, uint32_t);
|
||||
int32_t (*SetBrightness )(void*, int32_t);
|
||||
int32_t (*SetSaturation )(void*, int32_t);
|
||||
int32_t (*SetContrast )(void*, int32_t);
|
||||
int32_t (*SetHueDegree )(void*, int32_t);
|
||||
int32_t (*MirrorFlipConfig )(void*, uint32_t);
|
||||
int32_t (*ZoomConfig )(void*, uint32_t);
|
||||
int32_t (*SetResolution )(void*, uint32_t);
|
||||
int32_t (*GetResolution )(void*, uint32_t*);
|
||||
int32_t (*SetPixelFormat )(void*, uint32_t);
|
||||
int32_t (*GetPixelFormat )(void*, uint32_t*);
|
||||
int32_t (*NightModeConfig )(void*, uint32_t);
|
||||
}CAMERA_Drv_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup CAMERA_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CAMERA_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
104
lib/main/STM32H7/Drivers/BSP/Components/Common/dpredriver.h
Normal file
|
@ -0,0 +1,104 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file dpredriver.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the functions prototypes for the
|
||||
* DisplayPort Linear Redriver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __DPREDRIVER_H
|
||||
#define __DPREDRIVER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup DPREDRIVER
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup DPREDRIVER_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup DPREDRIVER_Channel_Identifier Channel Identifier
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
CHANNEL_DP0 = 0,
|
||||
CHANNEL_DP1,
|
||||
CHANNEL_DP2,
|
||||
CHANNEL_DP3,
|
||||
CHANNEL_RX1,
|
||||
CHANNEL_RX2,
|
||||
CHANNEL_SSTX
|
||||
} DPREDRIVER_ChannelId_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup DPREDRIVER_Driver_structure DisplayPort Linear Redriver Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t (*Init)(uint16_t);
|
||||
void (*DeInit)(uint16_t);
|
||||
uint32_t (*PowerOn)(uint16_t);
|
||||
uint32_t (*PowerOff)(uint16_t);
|
||||
uint32_t (*SetEQGain)(uint16_t, DPREDRIVER_ChannelId_t, uint8_t);
|
||||
uint32_t (*EnableChannel)(uint16_t, DPREDRIVER_ChannelId_t);
|
||||
uint32_t (*DisableChannel)(uint16_t, DPREDRIVER_ChannelId_t);
|
||||
}DPREDRIVER_Drv_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __DPREDRIVER_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
100
lib/main/STM32H7/Drivers/BSP/Components/Common/env_sensor.h
Normal file
|
@ -0,0 +1,100 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file env_sensor.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the functions prototypes for the
|
||||
* temperature driver
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2017 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef ENV_SENSORS_H
|
||||
#define ENV_SENSORS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup COMPONENTS COMPONENTS
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup COMMON COMMON
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ENV_SENSORS ENV_SENSORS
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ENV_SENSORS_Public_Types ENV_SENSORS Public types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief ENV_SENSORS driver structure definition
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Init ) ( void * );
|
||||
int32_t ( *DeInit ) ( void * );
|
||||
int32_t ( *ReadID ) ( void *, uint8_t * );
|
||||
int32_t ( *GetCapabilities ) ( void *, void * );
|
||||
} ENV_SENSOR_CommonDrv_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Enable ) ( void * );
|
||||
int32_t ( *Disable ) ( void * );
|
||||
int32_t ( *GetOutputDataRate ) ( void *, float * );
|
||||
int32_t ( *SetOutputDataRate ) ( void *, float );
|
||||
int32_t ( *GetValue ) ( void *, float * );
|
||||
} ENV_SENSOR_FuncDrv_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ENV_SENSORS_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
97
lib/main/STM32H7/Drivers/BSP/Components/Common/epd.h
Normal file
|
@ -0,0 +1,97 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file epd.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the
|
||||
* EPD (E Paper Display) driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2015 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __EPD_H
|
||||
#define __EPD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Common
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup EPD
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup EPD_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup EPD_Driver_structure E Paper Display Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
void (*Init)(void);
|
||||
void (*WritePixel)(uint8_t);
|
||||
|
||||
/* Optimized operation */
|
||||
void (*SetDisplayWindow)(uint16_t, uint16_t, uint16_t, uint16_t);
|
||||
void (*RefreshDisplay)(void);
|
||||
void (*CloseChargePump)(void);
|
||||
|
||||
uint16_t (*GetEpdPixelWidth)(void);
|
||||
uint16_t (*GetEpdPixelHeight)(void);
|
||||
void (*DrawImage)(uint16_t, uint16_t, uint16_t, uint16_t, uint8_t*);
|
||||
}
|
||||
EPD_DrvTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EPD_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
98
lib/main/STM32H7/Drivers/BSP/Components/Common/idd.h
Normal file
|
@ -0,0 +1,98 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file idd.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the IDD driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef IDD_H
|
||||
#define IDD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup IDD
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup IDD_Exported_Types IDD Exported Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup IDD_Driver_structure IDD Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int32_t (*Init )(void*);
|
||||
int32_t (*DeInit )(void*);
|
||||
int32_t (*ReadID )(void*, uint32_t*);
|
||||
int32_t (*Reset )(void*);
|
||||
int32_t (*LowPower )(void*);
|
||||
int32_t (*WakeUp )(void*);
|
||||
int32_t (*Start )(void*);
|
||||
int32_t (*Config )(void*, void*);
|
||||
int32_t (*GetValue )(void*, uint32_t*);
|
||||
int32_t (*EnableIT )(void*);
|
||||
int32_t (*DisableIT )(void*);
|
||||
int32_t (*ITStatus )(void*);
|
||||
int32_t (*ClearIT )(void*);
|
||||
int32_t (*ErrorEnableIT )(void*);
|
||||
int32_t (*ErrorClearIT )(void*);
|
||||
int32_t (*ErrorGetITStatus)(void*);
|
||||
int32_t (*ErrorDisableIT )(void*);
|
||||
int32_t (*ErrorGetSrc )(void*);
|
||||
int32_t (*ErrorGetCode )(void*);
|
||||
}IDD_Drv_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* IDD_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
90
lib/main/STM32H7/Drivers/BSP/Components/Common/io.h
Normal file
|
@ -0,0 +1,90 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file io.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the IO driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef IO_H
|
||||
#define IO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup IO
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup IO_Exported_Types IO Exported Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup IO_Driver_structure IO Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int32_t (*Init )(void*, void*);
|
||||
int32_t (*DeInit )(void*);
|
||||
int32_t (*ReadID )(void*, uint32_t*);
|
||||
int32_t (*Reset )(void*);
|
||||
int32_t (*Start )(void*, uint32_t);
|
||||
int32_t (*WritePin )(void*, uint32_t, uint8_t);
|
||||
int32_t (*ReadPin )(void*, uint32_t);
|
||||
int32_t (*EnableIT )(void*);
|
||||
int32_t (*DisableIT )(void*);
|
||||
int32_t (*ITStatus )(void*, uint32_t);
|
||||
int32_t (*ClearIT )(void*, uint32_t);
|
||||
}IO_Drv_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* IO_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
133
lib/main/STM32H7/Drivers/BSP/Components/Common/lcd.h
Normal file
|
@ -0,0 +1,133 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file lcd.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the LCD driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef LCD_H
|
||||
#define LCD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup LCD
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup LCD_Exported_Constants LCD Exported Constants
|
||||
* @{
|
||||
*/
|
||||
#define LCD_PIXEL_FORMAT_ARGB8888 0x00000000U /*!< ARGB8888 LTDC pixel format */
|
||||
#define LCD_PIXEL_FORMAT_RGB888 0x00000001U /*!< RGB888 LTDC pixel format */
|
||||
#define LCD_PIXEL_FORMAT_RGB565 0x00000002U /*!< RGB565 LTDC pixel format */
|
||||
#define LCD_PIXEL_FORMAT_ARGB1555 0x00000003U /*!< ARGB1555 LTDC pixel format */
|
||||
#define LCD_PIXEL_FORMAT_ARGB4444 0x00000004U /*!< ARGB4444 LTDC pixel format */
|
||||
#define LCD_PIXEL_FORMAT_L8 0x00000005U /*!< L8 LTDC pixel format */
|
||||
#define LCD_PIXEL_FORMAT_AL44 0x00000006U /*!< AL44 LTDC pixel format */
|
||||
#define LCD_PIXEL_FORMAT_AL88 0x00000007U /*!< AL88 LTDC pixel format */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LCD_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup LCD_Driver_structure LCD Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *DrawBitmap ) (uint32_t, uint32_t, uint32_t, uint8_t *);
|
||||
int32_t ( *FillRGBRect ) (uint32_t, uint32_t, uint32_t, uint8_t*, uint32_t, uint32_t);
|
||||
int32_t ( *DrawHLine ) (uint32_t, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
int32_t ( *DrawVLine ) (uint32_t, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
int32_t ( *FillRect ) (uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
int32_t ( *GetPixel ) (uint32_t, uint32_t, uint32_t, uint32_t*);
|
||||
int32_t ( *SetPixel ) (uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
int32_t ( *GetXSize ) (uint32_t, uint32_t *);
|
||||
int32_t ( *GetYSize ) (uint32_t, uint32_t *);
|
||||
int32_t ( *SetLayer ) (uint32_t, uint32_t);
|
||||
int32_t ( *GetFormat ) (uint32_t, uint32_t *);
|
||||
} LCD_UTILS_Drv_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* Control functions */
|
||||
int32_t (*Init )(void*, uint32_t, uint32_t);
|
||||
int32_t (*DeInit )(void*);
|
||||
int32_t (*ReadID )(void*, uint32_t*);
|
||||
int32_t (*DisplayOn )(void*);
|
||||
int32_t (*DisplayOff )(void*);
|
||||
int32_t (*SetBrightness )(void*, uint32_t);
|
||||
int32_t (*GetBrightness )(void*, uint32_t*);
|
||||
int32_t (*SetOrientation )(void*, uint32_t);
|
||||
int32_t (*GetOrientation )(void*, uint32_t*);
|
||||
|
||||
/* Drawing functions*/
|
||||
int32_t ( *SetCursor ) (void*, uint32_t, uint32_t);
|
||||
int32_t ( *DrawBitmap ) (void*, uint32_t, uint32_t, uint8_t *);
|
||||
int32_t ( *FillRGBRect ) (void*, uint32_t, uint32_t, uint8_t*, uint32_t, uint32_t);
|
||||
int32_t ( *DrawHLine ) (void*, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
int32_t ( *DrawVLine ) (void*, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
int32_t ( *FillRect ) (void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
int32_t ( *GetPixel ) (void*, uint32_t, uint32_t, uint32_t*);
|
||||
int32_t ( *SetPixel ) (void*, uint32_t, uint32_t, uint32_t);
|
||||
int32_t ( *GetXSize ) (void*, uint32_t *);
|
||||
int32_t ( *GetYSize ) (void*, uint32_t *);
|
||||
}LCD_Drv_t;
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LCD_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
104
lib/main/STM32H7/Drivers/BSP/Components/Common/motion_sensor.h
Normal file
|
@ -0,0 +1,104 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file motion_sensor.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the functions prototypes for the
|
||||
* accelerometer driver
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2017 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef MOTION_SENSOR_H
|
||||
#define MOTION_SENSOR_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup COMPONENTS COMPONENTS
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup COMMON COMMON
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup MOTION_SENSOR MOTION SENSOR
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup MOTION_SENSOR_Public_Types MOTION SENSOR Public types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief MOTION_SENSOR driver structure definition
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Init ) ( void * );
|
||||
int32_t ( *DeInit ) ( void * );
|
||||
int32_t ( *ReadID ) ( void *, uint8_t * );
|
||||
int32_t ( *GetCapabilities ) ( void *, void * );
|
||||
} MOTION_SENSOR_CommonDrv_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Enable ) ( void * );
|
||||
int32_t ( *Disable ) ( void * );
|
||||
int32_t ( *GetSensitivity ) ( void *, float * );
|
||||
int32_t ( *GetOutputDataRate ) ( void *, float * );
|
||||
int32_t ( *SetOutputDataRate ) ( void *, float );
|
||||
int32_t ( *GetFullScale ) ( void *, int32_t * );
|
||||
int32_t ( *SetFullScale ) ( void *, int32_t );
|
||||
int32_t ( *GetAxes ) ( void *, void * );
|
||||
int32_t ( *GetAxesRaw ) ( void *, void * );
|
||||
} MOTION_SENSOR_FuncDrv_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MOTION_SENSOR_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
246
lib/main/STM32H7/Drivers/BSP/Components/Common/pwrmon.h
Normal file
|
@ -0,0 +1,246 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file pwrmon.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the functions prototypes for the
|
||||
* Current/Power Monitor device driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __PWRMON_H
|
||||
#define __PWRMON_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup PWRMON
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Operating_Mode_enum Power Monitor Operating Mode enums
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
OPERATING_MODE_TRIGGERED = 0,
|
||||
OPERATING_MODE_CONTINUOUS,
|
||||
OPERATING_MODE_NB
|
||||
} PWRMON_OperatingMode_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Conversion_Time_enum Power Monitor Conversion_Time enums
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
CONVERT_TIME_140 = 0,
|
||||
CONVERT_TIME_204,
|
||||
CONVERT_TIME_332,
|
||||
CONVERT_TIME_588,
|
||||
CONVERT_TIME_1100,
|
||||
CONVERT_TIME_2116,
|
||||
CONVERT_TIME_4156,
|
||||
CONVERT_TIME_8244,
|
||||
CONVERT_TIME_NB
|
||||
} PWRMON_ConvertTime_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Conversion_Time_enum Power Monitor Conversion_Time enums
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
AVERAGING_MODE_1 = 0,
|
||||
AVERAGING_MODE_4,
|
||||
AVERAGING_MODE_16,
|
||||
AVERAGING_MODE_64,
|
||||
AVERAGING_MODE_128,
|
||||
AVERAGING_MODE_256,
|
||||
AVERAGING_MODE_512,
|
||||
AVERAGING_MODE_1024,
|
||||
AVERAGING_MODE_NB
|
||||
} PWRMON_AveragingMode_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Device_Configuration_structure Power Monitor Device Configuration structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
PWRMON_ConvertTime_t ShuntConvertTime;
|
||||
PWRMON_ConvertTime_t BusConvertTime;
|
||||
PWRMON_AveragingMode_t AveragingMode;
|
||||
} PWRMON_Config_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Alert_Polarity_enum Power Monitor Alert Polarity enums
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
ALERT_POLARITY_NORMAL = 0,
|
||||
ALERT_POLARITY_INVERTED,
|
||||
ALERT_POLARITY_NB
|
||||
} PWRMON_AlertPolarity_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Alert_Latch_Enable_enum Power Monitor Alert Latch Enable enums
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
ALERT_LATCH_DISABLE = 0,
|
||||
ALERT_LATCH_ENABLE,
|
||||
ALERT_LATCH_NB
|
||||
} PWRMON_AlertLatchEnable_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Alert_Function_enum Power Monitor Alert Function enums
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
ALERT_FUNCTION_NONE = 0,
|
||||
ALERT_FUNCTION_SOL,
|
||||
ALERT_FUNCTION_SUL,
|
||||
ALERT_FUNCTION_BOL,
|
||||
ALERT_FUNCTION_BUL,
|
||||
ALERT_FUNCTION_POL,
|
||||
ALERT_FUNCTION_NB,
|
||||
} PWRMON_AlertFunction_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Alert_Configuration_structure Power Monitor Alert Configuration structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
PWRMON_AlertPolarity_t Polarity;
|
||||
PWRMON_AlertLatchEnable_t LatchEnable;
|
||||
} PWRMON_AlertPinConfig_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Voltage_Input_enum Power Monitor Voltage Input enums
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
VOLTAGE_INPUT_SHUNT = 0,
|
||||
VOLTAGE_INPUT_BUS,
|
||||
VOLTAGE_INPUT_ALL,
|
||||
VOLTAGE_INPUT_NB
|
||||
} PWRMON_InputSignal_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Flag_enum Power Monitor Flag enums
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
FLAG_ALERT_FUNCTION = 0,
|
||||
FLAG_CONVERSION_READY,
|
||||
FLAG_MATH_OVERFLOW,
|
||||
FLAG_NB
|
||||
} PWRMON_Flag_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Driver_structure Power Monitor Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
void (*Init)(uint16_t, PWRMON_Config_t *);
|
||||
void (*DeInit)(uint16_t);
|
||||
uint16_t (*ReadId)(uint16_t);
|
||||
void (*Reset)(uint16_t);
|
||||
void (*SetCalibration)(uint16_t, uint16_t);
|
||||
uint16_t (*GetCalibration)(uint16_t);
|
||||
void (*SetAlertFunction)(uint16_t, PWRMON_AlertFunction_t);
|
||||
PWRMON_AlertFunction_t (*GetAlertFunction)(uint16_t);
|
||||
void (*AlertPinConfig)(uint16_t, PWRMON_AlertPinConfig_t *);
|
||||
void (*SetVBusThreshold)(uint16_t, uint16_t);
|
||||
uint16_t (*GetVBusThreshold)(uint16_t);
|
||||
void (*SetVShuntThreshold)(uint16_t, int16_t);
|
||||
int16_t (*GetVShuntThreshold)(uint16_t);
|
||||
void (*SetPowerThreshold)(uint16_t, uint32_t);
|
||||
uint32_t (*GetPowerThreshold)(uint16_t);
|
||||
void (*AlertThresholdEnableIT)(uint16_t);
|
||||
void (*AlertThresholdDisableIT)(uint16_t);
|
||||
void (*ConversionReadyEnableIT)(uint16_t);
|
||||
void (*ConversionReadyDisableIT)(uint16_t);
|
||||
void (*StartConversion)(uint16_t, PWRMON_InputSignal_t, PWRMON_OperatingMode_t);
|
||||
void (*StopConversion)(uint16_t);
|
||||
uint16_t (*GetVBus)(uint16_t);
|
||||
int16_t (*GetVShunt)(uint16_t);
|
||||
uint16_t (*GetPower)(uint16_t);
|
||||
int16_t (*GetCurrent)(uint16_t);
|
||||
uint8_t (*GetFlag)(uint16_t, PWRMON_Flag_t);
|
||||
} PWRMON_Drv_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __PWRMON_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
93
lib/main/STM32H7/Drivers/BSP/Components/Common/ts.h
Normal file
|
@ -0,0 +1,93 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file ts.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the Touch Screen driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef TS_H
|
||||
#define TS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup TS
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup TS_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup TS_Driver_structure Touch Sensor Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Init ) (void *);
|
||||
int32_t ( *DeInit ) (void *);
|
||||
int32_t ( *GestureConfig ) (void *, void*);
|
||||
int32_t ( *ReadID ) (void *, uint32_t *);
|
||||
int32_t ( *GetState ) (void *, void*);
|
||||
int32_t ( *GetMultiTouchState ) (void *, void*);
|
||||
int32_t ( *GetGesture ) (void *, void*);
|
||||
int32_t ( *GetCapabilities ) (void *, void*);
|
||||
int32_t ( *EnableIT ) (void *);
|
||||
int32_t ( *DisableIT ) (void *);
|
||||
int32_t ( *ClearIT ) (void *);
|
||||
int32_t ( *ITStatus ) (void *);
|
||||
}TS_Drv_t;
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* TS_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
114
lib/main/STM32H7/Drivers/BSP/Components/Common/usbtypecswitch.h
Normal file
|
@ -0,0 +1,114 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file usbtypecswitch.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the functions prototypes for the
|
||||
* crossbar switch device for USB Type-C systems.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __USBTYPECSWITCH_H
|
||||
#define __USBTYPECSWITCH_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup TYPECSWITCH
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup TYPECSWITCH_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
USB_NORMAL = 0,
|
||||
USB_FLIPPED,
|
||||
DFP_D_PIN_ASSIGNMENT_A_NORMAL,
|
||||
DFP_D_PIN_ASSIGNMENT_A_FLIPPED,
|
||||
DFP_D_PIN_ASSIGNMENT_B_NORMAL,
|
||||
DFP_D_PIN_ASSIGNMENT_B_FLIPPED,
|
||||
DFP_D_PIN_ASSIGNMENT_C_NORMAL,
|
||||
DFP_D_PIN_ASSIGNMENT_C_FLIPPED,
|
||||
DFP_D_PIN_ASSIGNMENT_D_NORMAL,
|
||||
DFP_D_PIN_ASSIGNMENT_D_FLIPPED,
|
||||
DFP_D_PIN_ASSIGNMENT_E_NORMAL,
|
||||
DFP_D_PIN_ASSIGNMENT_E_FLIPPED,
|
||||
DFP_D_PIN_ASSIGNMENT_F_NORMAL,
|
||||
DFP_D_PIN_ASSIGNMENT_F_FLIPPED,
|
||||
UFP_D_PIN_ASSIGNMENT_A_NORMAL,
|
||||
UFP_D_PIN_ASSIGNMENT_A_FLIPPED,
|
||||
UFP_D_PIN_ASSIGNMENT_B_NORMAL,
|
||||
UFP_D_PIN_ASSIGNMENT_B_FLIPPED,
|
||||
UFP_D_PIN_ASSIGNMENT_C_NORMAL,
|
||||
UFP_D_PIN_ASSIGNMENT_C_FLIPPED,
|
||||
UFP_D_PIN_ASSIGNMENT_D_NORMAL,
|
||||
UFP_D_PIN_ASSIGNMENT_D_FLIPPED,
|
||||
UFP_D_PIN_ASSIGNMENT_E_NORMAL,
|
||||
UFP_D_PIN_ASSIGNMENT_E_FLIPPED,
|
||||
UFP_D_PIN_ASSIGNMENT_F_NORMAL,
|
||||
UFP_D_PIN_ASSIGNMENT_F_FLIPPED
|
||||
} TYPECSWITCH_Mode_t;
|
||||
|
||||
/** @defgroup TYPECSWITCH_Driver_structure USB Type-C Crossbar Switch Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t (*Init)(uint16_t);
|
||||
void (*DeInit)(uint16_t);
|
||||
uint32_t (*PowerOn)(uint16_t);
|
||||
uint32_t (*PowerOff)(uint16_t);
|
||||
uint32_t (*SetMode)(uint16_t, TYPECSWITCH_Mode_t);
|
||||
uint32_t (*IsSupportedMode)(TYPECSWITCH_Mode_t);
|
||||
} TYPECSWITCH_Drv_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __USBTYPECSWITCH_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
@ -0,0 +1,89 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
<title>Release Notes for ADV7533 Component Driver</title>
|
||||
<style type="text/css">
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
span.underline{text-decoration: underline;}
|
||||
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="_htmresc/mini-st.css" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-4">
|
||||
<div class="card fluid">
|
||||
<div class="sectione dark">
|
||||
<center>
|
||||
<h1 id="release-notes-for-adv7533-component-driver"><strong>Release Notes for ADV7533 Component Driver</strong></h1>
|
||||
<p>Copyright © 2016 STMicroelectronics<br />
|
||||
</p>
|
||||
<a href="https://www.st.com" class="logo"><img src="_htmresc/st_logo.png" alt="ST logo" /></a>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
<h1 id="license">License</h1>
|
||||
This software component is licensed by ST under BSD 3-Clause license, the “License”; You may not use this component except in compliance with the License. You may obtain a copy of the License at:
|
||||
<center>
|
||||
<a href="https://opensource.org/licenses/BSD-3-Clause">https://opensource.org/licenses/BSD-3-Clause</a>
|
||||
</center>
|
||||
<h1 id="purpose">Purpose</h1>
|
||||
<p>This driver provides a set of HDMI(audio and display) functions offered by ADV7533 component</p>
|
||||
</div>
|
||||
<div class="col-sm-12 col-lg-8">
|
||||
<h1 id="update-history">Update History</h1>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true"> <label for="collapse-section3" aria-hidden="true"><strong>V2.0.1 / 23-November-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Update st_logo.png inclusion path in Release notes</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true"> <label for="collapse-section2" aria-hidden="true"><strong>V2.0.0 / 14-October-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-1">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First Official release of ADV7533 BSP drivers in line with STM32Cube BSP drivers development guidelines (UM2298)</li>
|
||||
<li>The component drivers are composed of
|
||||
<ul>
|
||||
<li>component core drivers files: adv7533.h/.c</li>
|
||||
<li>component register drivers files: adv7533_reg.h/.c</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<h2 id="backward-compatibility">Backward Compatibility</h2>
|
||||
<ul>
|
||||
<li>This version breaks the compatibility with previous version</li>
|
||||
</ul>
|
||||
<h2 id="dependencies">Dependencies</h2>
|
||||
<p>This software release is compatible with:</p>
|
||||
<ul>
|
||||
<li>BSP Common v6.0.1 or above</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true"> <label for="collapse-section1" aria-hidden="true"><strong>V1.0.0 / 26-August-2016</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-2">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First official release of ADV7533 HDMI component driver</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="sticky">
|
||||
For complete documentation on <mark>STM32 Microcontrollers</mark> , visit: <span style="font-color: blue;"><a href="http://www.st.com/STM32">www.st.com</a></span>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,92 @@
|
|||
---
|
||||
pagetitle: Release Notes for ADV7533 Component Driver
|
||||
lang: en
|
||||
---
|
||||
|
||||
::: {.row}
|
||||
::: {.col-sm-12 .col-lg-4}
|
||||
|
||||
::: {.card .fluid}
|
||||
::: {.sectione .dark}
|
||||
<center>
|
||||
# **Release Notes for ADV7533 Component Driver**
|
||||
Copyright © 2016 STMicroelectronics\
|
||||
|
||||
[](https://www.st.com){.logo}
|
||||
</center>
|
||||
:::
|
||||
:::
|
||||
|
||||
# License
|
||||
|
||||
This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this component except in
|
||||
compliance with the License. You may obtain a copy of the License at:
|
||||
<center>
|
||||
[https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause)
|
||||
</center>
|
||||
|
||||
# Purpose
|
||||
|
||||
This driver provides a set of HDMI(audio and display) functions offered by ADV7533 component
|
||||
|
||||
:::
|
||||
|
||||
::: {.col-sm-12 .col-lg-8}
|
||||
# Update History
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true">
|
||||
<label for="collapse-section3" aria-hidden="true">__V2.0.1 / 23-November-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update st_logo.png inclusion path in Release notes
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true">
|
||||
<label for="collapse-section2" aria-hidden="true">__V2.0.0 / 14-October-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- First Official release of ADV7533 BSP drivers in line with STM32Cube BSP drivers development guidelines (UM2298)
|
||||
- The component drivers are composed of
|
||||
- component core drivers files: adv7533.h/.c
|
||||
- component register drivers files: adv7533_reg.h/.c
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
- This version breaks the compatibility with previous version
|
||||
|
||||
## Dependencies
|
||||
|
||||
This software release is compatible with:
|
||||
|
||||
- BSP Common v6.0.1 or above
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true">
|
||||
<label for="collapse-section1" aria-hidden="true">__V1.0.0 / 26-August-2016__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- First official release of ADV7533 HDMI component driver
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
:::
|
||||
:::
|
||||
|
||||
<footer class="sticky">
|
||||
For complete documentation on <mark>STM32 Microcontrollers</mark> ,
|
||||
visit: [[www.st.com](http://www.st.com/STM32)]{style="font-color: blue;"}
|
||||
</footer>
|
1700
lib/main/STM32H7/Drivers/BSP/Components/adv7533/_htmresc/mini-st.css
Normal file
After Width: | Height: | Size: 18 KiB |
1156
lib/main/STM32H7/Drivers/BSP/Components/adv7533/adv7533.c
Normal file
272
lib/main/STM32H7/Drivers/BSP/Components/adv7533/adv7533.h
Normal file
|
@ -0,0 +1,272 @@
|
|||
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file adv7533.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the constants parameters for the ADV7533
|
||||
* which is the HDMI bridge between DSI and HDMI
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2016 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef ADV7533_H
|
||||
#define ADV7533_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "adv7533_reg.h"
|
||||
#include <stddef.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ADV7533
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ADV7533_Exported_Types Exported Types
|
||||
* @{
|
||||
*/
|
||||
typedef int32_t (*ADV7533_Init_Func) (void);
|
||||
typedef int32_t (*ADV7533_DeInit_Func) (void);
|
||||
typedef int32_t (*ADV7533_GetTick_Func) (void);
|
||||
typedef int32_t (*ADV7533_Delay_Func) (uint32_t);
|
||||
typedef int32_t (*ADV7533_WriteReg_Func)(uint16_t, uint16_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*ADV7533_ReadReg_Func) (uint16_t, uint16_t, uint8_t*, uint16_t);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Frequency;
|
||||
} ADV7533_Init_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ADV7533_Init_Func Init;
|
||||
ADV7533_DeInit_Func DeInit;
|
||||
uint16_t Address;
|
||||
ADV7533_WriteReg_Func WriteReg;
|
||||
ADV7533_ReadReg_Func ReadReg;
|
||||
ADV7533_GetTick_Func GetTick;
|
||||
} ADV7533_IO_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ADV7533_IO_t IO;
|
||||
adv7533_ctx_t Ctx;
|
||||
uint8_t IsInitialized;
|
||||
} ADV7533_Object_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Init ) ( ADV7533_Object_t *, ADV7533_Init_t* );
|
||||
int32_t ( *DeInit ) ( ADV7533_Object_t * );
|
||||
int32_t ( *ReadID ) ( ADV7533_Object_t *, uint32_t *);
|
||||
int32_t ( *Play ) ( ADV7533_Object_t * );
|
||||
int32_t ( *Pause ) ( ADV7533_Object_t * );
|
||||
int32_t ( *Resume ) ( ADV7533_Object_t * );
|
||||
int32_t ( *Stop ) ( ADV7533_Object_t *, uint32_t );
|
||||
int32_t ( *SetFrequency ) ( ADV7533_Object_t *, uint32_t );
|
||||
int32_t ( *GetFrequency ) ( ADV7533_Object_t *, uint32_t* );
|
||||
int32_t ( *SetVolume ) ( ADV7533_Object_t *, uint8_t, uint8_t );
|
||||
int32_t ( *GetVolume ) ( ADV7533_Object_t *, uint8_t );
|
||||
int32_t ( *SetMute ) ( ADV7533_Object_t *, uint16_t );
|
||||
int32_t ( *SetOutputMode ) ( ADV7533_Object_t *, uint16_t );
|
||||
int32_t ( *SetResolution ) ( ADV7533_Object_t *, uint32_t );
|
||||
int32_t ( *GetResolution ) ( ADV7533_Object_t *, uint32_t *);
|
||||
int32_t ( *SetProtocol ) ( ADV7533_Object_t *, uint16_t );
|
||||
int32_t ( *GetProtocol ) ( ADV7533_Object_t *);
|
||||
int32_t ( *Reset ) ( ADV7533_Object_t * );
|
||||
} ADV7533_Drv_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* Control functions */
|
||||
int32_t (*Init )(ADV7533_Object_t*, uint32_t, uint32_t);
|
||||
int32_t (*DeInit )(ADV7533_Object_t*);
|
||||
int32_t (*ReadID )(ADV7533_Object_t*, uint32_t*);
|
||||
int32_t (*DisplayOn )(ADV7533_Object_t*);
|
||||
int32_t (*DisplayOff )(ADV7533_Object_t*);
|
||||
int32_t (*SetBrightness )(ADV7533_Object_t*, uint32_t);
|
||||
int32_t (*GetBrightness )(ADV7533_Object_t*, uint32_t*);
|
||||
int32_t (*SetOrientation )(ADV7533_Object_t*, uint32_t);
|
||||
int32_t (*GetOrientation )(ADV7533_Object_t*, uint32_t*);
|
||||
|
||||
/* Drawing functions*/
|
||||
int32_t ( *SetCursor ) (ADV7533_Object_t*, uint32_t, uint32_t);
|
||||
int32_t ( *DrawBitmap ) (ADV7533_Object_t*, uint32_t, uint32_t, uint8_t *);
|
||||
int32_t (*FillRGBRect ) (ADV7533_Object_t*, uint32_t, uint32_t, uint8_t *, uint32_t, uint32_t);
|
||||
int32_t ( *DrawHLine ) (ADV7533_Object_t*, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
int32_t ( *DrawVLine ) (ADV7533_Object_t*, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
int32_t ( *FillRect ) (ADV7533_Object_t*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
int32_t ( *GetPixel ) (ADV7533_Object_t*, uint32_t, uint32_t, uint32_t*);
|
||||
int32_t ( *SetPixel ) (ADV7533_Object_t*, uint32_t, uint32_t, uint32_t);
|
||||
int32_t ( *GetXSize ) (ADV7533_Object_t*, uint32_t *);
|
||||
int32_t ( *GetYSize ) (ADV7533_Object_t*, uint32_t *);
|
||||
} ADV7533_LcdDrv_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ADV7533_Exported_Constants Exported Constants
|
||||
* @{
|
||||
*/
|
||||
#define ADV7533_OK (0)
|
||||
#define ADV7533_ERROR (-1)
|
||||
|
||||
/**
|
||||
* @brief AUDIO FREQUENCY
|
||||
*/
|
||||
#define ADV7533_FREQUENCY_192K 192000
|
||||
#define ADV7533_FREQUENCY_176K 176400
|
||||
#define ADV7533_FREQUENCY_96K 96000
|
||||
#define ADV7533_FREQUENCY_88K 88200
|
||||
#define ADV7533_FREQUENCY_48K 48000
|
||||
#define ADV7533_FREQUENCY_44K 44100
|
||||
#define ADV7533_FREQUENCY_32K 32000
|
||||
#define ADV7533_FREQUENCY_22K 22050
|
||||
#define ADV7533_FREQUENCY_16K 16000
|
||||
#define ADV7533_FREQUENCY_11K 11025
|
||||
#define ADV7533_FREQUENCY_8K 8000
|
||||
|
||||
/**
|
||||
* @brief HDMI audio output DEVICE
|
||||
*/
|
||||
#define OUTPUT_DEVICE_ADV7533_HDMI 0x1000U
|
||||
|
||||
/**
|
||||
* @brief ADV7533 I2C Addresses 0x7A / 0x78
|
||||
*/
|
||||
#define ADV7533_MAIN_I2C_ADDR 0x7AU
|
||||
#define ADV7533_CEC_DSI_I2C_ADDR 0x78U
|
||||
|
||||
/**
|
||||
* @brief ADV7533 Aspect ratio
|
||||
*/
|
||||
#define ADV7533_ASPECT_RATIO_16_9 00U
|
||||
#define ADV7533_ASPECT_RATIO_4_3 01U
|
||||
|
||||
/**
|
||||
* @brief ADV7533 Aspect ratio
|
||||
*/
|
||||
#define ADV7533_MODE_HDMI 00U
|
||||
#define ADV7533_MODE_DVI 01U
|
||||
|
||||
/**
|
||||
* @brief ADV7533 Main Features Parameters
|
||||
*/
|
||||
|
||||
/** @Brief adv7533 ID
|
||||
*/
|
||||
#define ADV7533_ID 0x7533U
|
||||
|
||||
/* MUTE commands */
|
||||
#define ADV7533_MUTE_ON 1U
|
||||
#define ADV7533_MUTE_OFF 0U
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
|
||||
/** @defgroup ADV7533_Exported_Macros ADV7533 Exported Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup ADV7533_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
int32_t ADV7533_RegisterBusIO (ADV7533_Object_t *pObj, ADV7533_IO_t *pIO);
|
||||
/*------------------------------------------------------------------------------
|
||||
HDMI video functions
|
||||
------------------------------------------------------------------------------*/
|
||||
int32_t ADV7533_Init(ADV7533_Object_t *pObj, uint32_t ColorCoding, uint32_t Orientation);
|
||||
int32_t ADV7533_DisplayOn(ADV7533_Object_t *pObj);
|
||||
int32_t ADV7533_DisplayOff(ADV7533_Object_t *pObj);
|
||||
int32_t ADV7533_Configure(ADV7533_Object_t *pObj, uint8_t LaneNumber);
|
||||
int32_t ADV7533_PatternEnable(ADV7533_Object_t *pObj);
|
||||
int32_t ADV7533_PatternDisable(ADV7533_Object_t *pObj);
|
||||
|
||||
int32_t ADV7533_SetBrightness(ADV7533_Object_t *pObj, uint32_t Brightness);
|
||||
int32_t ADV7533_GetBrightness(ADV7533_Object_t *pObj, uint32_t *Brightness);
|
||||
int32_t ADV7533_SetOrientation(ADV7533_Object_t *pObj, uint32_t Orientation);
|
||||
int32_t ADV7533_GetOrientation(ADV7533_Object_t *pObj, uint32_t *Orientation);
|
||||
|
||||
|
||||
int32_t ADV7533_SetCursor(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos);
|
||||
int32_t ADV7533_DrawBitmap(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint8_t *pBmp);
|
||||
int32_t ADV7533_FillRGBRect(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint8_t *pData, uint32_t Width, uint32_t Height);
|
||||
int32_t ADV7533_DrawHLine(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color);
|
||||
int32_t ADV7533_DrawVLine(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color);
|
||||
int32_t ADV7533_FillRect(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Width, uint32_t Height, uint32_t Color);
|
||||
int32_t ADV7533_SetPixel(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Color);
|
||||
int32_t ADV7533_GetPixel(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t *Color);
|
||||
int32_t ADV7533_GetXSize(ADV7533_Object_t *pObj, uint32_t *XSize);
|
||||
int32_t ADV7533_GetYSize(ADV7533_Object_t *pObj, uint32_t *YSize);
|
||||
/*------------------------------------------------------------------------------
|
||||
HDMI Audio functions
|
||||
------------------------------------------------------------------------------*/
|
||||
int32_t ADV7533_AudioInit(ADV7533_Object_t *pObj, ADV7533_Init_t *pInit);
|
||||
int32_t ADV7533_DeInit(ADV7533_Object_t *pObj);
|
||||
int32_t ADV7533_ReadID(ADV7533_Object_t *pObj, uint32_t *Id);
|
||||
int32_t ADV7533_Play(ADV7533_Object_t *pObj);
|
||||
int32_t ADV7533_Pause(ADV7533_Object_t *pObj);
|
||||
int32_t ADV7533_Resume(ADV7533_Object_t *pObj);
|
||||
int32_t ADV7533_Stop(ADV7533_Object_t *pObj, uint32_t CodecPdwnMode);
|
||||
int32_t ADV7533_SetVolume(ADV7533_Object_t *pObj, uint8_t Volume, uint8_t InputOutput);
|
||||
int32_t ADV7533_GetVolume(ADV7533_Object_t *pObj, uint8_t InputOutput);
|
||||
int32_t ADV7533_SetMute(ADV7533_Object_t *pObj, uint16_t Cmd);
|
||||
int32_t ADV7533_SetOutputMode(ADV7533_Object_t *pObj, uint16_t Output);
|
||||
int32_t ADV7533_SetResolution(ADV7533_Object_t *pObj, uint32_t Resolution);
|
||||
int32_t ADV7533_GetResolution(ADV7533_Object_t *pObj, uint32_t *Resolution);
|
||||
int32_t ADV7533_SetProtocol(ADV7533_Object_t *pObj, uint16_t Protocol);
|
||||
int32_t ADV7533_GetProtocol(ADV7533_Object_t *pObj);
|
||||
int32_t ADV7533_SetFrequency(ADV7533_Object_t *pObj, uint32_t AudioFreq);
|
||||
int32_t ADV7533_GetFrequency(ADV7533_Object_t *pObj, uint32_t *Frequency);
|
||||
int32_t ADV7533_Reset(ADV7533_Object_t *pObj);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Audio driver structure */
|
||||
extern ADV7533_Drv_t ADV7533_Driver;
|
||||
/* LCD driver structure */
|
||||
extern ADV7533_LcdDrv_t ADV7533_LCD_Driver;
|
||||
#endif /* ADV7533_H */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
@ -0,0 +1,94 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file adv7533_reg.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides the ADV7533 DSI to HDMI bridge driver
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2016 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "adv7533_reg.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ADV7533
|
||||
* @brief This file provides a set of functions needed to drive the
|
||||
* adv7533 DSI-HDMI bridge.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private types -------------------------------------------------------------*/
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
/* Private constants ---------------------------------------------------------*/
|
||||
/** @defgroup ADV7533_Private_Constants ADV7533 Private Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup ADV7533_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
/* Private functions ---------------------------------------------------------*/
|
||||
|
||||
/************** Generic Function *******************/
|
||||
/*******************************************************************************
|
||||
* Function Name : adv7533_read_reg
|
||||
* Description : Generic Reading function. It must be fullfilled with either
|
||||
* I2C or SPI reading functions
|
||||
* Input : register Address, length of buffer
|
||||
* Output : Data Read
|
||||
*******************************************************************************/
|
||||
int32_t adv7533_read_reg(adv7533_ctx_t *ctx, uint16_t reg, uint8_t *pdata, uint16_t length)
|
||||
{
|
||||
return ctx->ReadReg(ctx->handle, reg, pdata, length);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : adv7533_write_reg
|
||||
* Description : Generic Writing function. It must be fullfilled with either
|
||||
* I2C or SPI writing function
|
||||
* Input : register Address, Data to be written, length of buffer
|
||||
* Output : None
|
||||
*******************************************************************************/
|
||||
int32_t adv7533_write_reg(adv7533_ctx_t *ctx, uint16_t reg, uint8_t *pdata, uint16_t length)
|
||||
{
|
||||
return ctx->WriteReg(ctx->handle, reg, pdata, length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
144
lib/main/STM32H7/Drivers/BSP/Components/adv7533/adv7533_reg.h
Normal file
|
@ -0,0 +1,144 @@
|
|||
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file adv7533_reg.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the constants parameters for the ADV7533
|
||||
* which is the HDMI bridge between DSI and HDMI
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2016 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef ADV7533_REG_H
|
||||
#define ADV7533_REG_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ADV7533
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ADV7533_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief ADV7533 Main Registers
|
||||
*/
|
||||
#define ADV7533_MAIN_SYNC_REG 0x17U
|
||||
#define ADV7533_MAIN_POWER_DOWN_REG 0x41U
|
||||
#define ADV7533_MAIN_HPG_REG 0x42U
|
||||
|
||||
/**
|
||||
* @brief ADV7533 Main Features Parameters
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief ADV7533 CEC DSI Registers
|
||||
*/
|
||||
#define ADV7533_CEC_DSI_INTERNAL_TIMING_REG 0x27U
|
||||
#define ADV7533_CEC_DSI_TOTAL_WIDTH_H_REG 0x28U
|
||||
#define ADV7533_CEC_DSI_TOTAL_WIDTH_L_REG 0x29U
|
||||
#define ADV7533_CEC_DSI_HSYNC_H_REG 0x2AU
|
||||
#define ADV7533_CEC_DSI_HSYNC_L_REG 0x2BU
|
||||
#define ADV7533_CEC_DSI_HFP_H_REG 0x2CU
|
||||
#define ADV7533_CEC_DSI_HFP_L_REG 0x2DU
|
||||
#define ADV7533_CEC_DSI_HBP_H_REG 0x2EU
|
||||
#define ADV7533_CEC_DSI_HBP_L_REG 0x2FU
|
||||
|
||||
#define ADV7533_CEC_DSI_TOTAL_HEIGHT_H_REG 0x30U
|
||||
#define ADV7533_CEC_DSI_TOTAL_HEIGHT_L_REG 0x31U
|
||||
#define ADV7533_CEC_DSI_VSYNC_H_REG 0x32U
|
||||
#define ADV7533_CEC_DSI_VSYNC_L_REG 0x33U
|
||||
#define ADV7533_CEC_DSI_VFP_H_REG 0x34U
|
||||
#define ADV7533_CEC_DSI_VFP_L_REG 0x35U
|
||||
#define ADV7533_CEC_DSI_VBP_H_REG 0x36U
|
||||
#define ADV7533_CEC_DSI_VBP_L_REG 0x37U
|
||||
|
||||
/** @Brief device ID register
|
||||
*/
|
||||
#define ADV7533_CHIPID_ADDR0 0x00U
|
||||
#define ADV7533_CHIPID_ADDR1 0x01U
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
|
||||
/** @defgroup ADV7533_Exported_Macros ADV7533 Exported Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/** @addtogroup ADV7533_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
typedef int32_t (*ADV7533_Write_Func)(void *, uint16_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*ADV7533_Read_Func) (void *, uint16_t, uint8_t*, uint16_t);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ADV7533_Write_Func WriteReg;
|
||||
ADV7533_Read_Func ReadReg;
|
||||
void *handle;
|
||||
} adv7533_ctx_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup ADV7533_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
int32_t adv7533_write_reg(adv7533_ctx_t *ctx, uint16_t reg, uint8_t *pdata, uint16_t length );
|
||||
int32_t adv7533_read_reg(adv7533_ctx_t *ctx, uint16_t reg, uint8_t *pdata, uint16_t length );
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ADV7533_REG_H */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
@ -0,0 +1,84 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
<title>Release Notes for AMPIRE480272 Component Driver</title>
|
||||
<style type="text/css">
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
span.underline{text-decoration: underline;}
|
||||
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="_htmresc/mini-st.css" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-4">
|
||||
<div class="card fluid">
|
||||
<div class="sectione dark">
|
||||
<center>
|
||||
<h1 id="release-notes-for-ampire480272-component-driver"><strong>Release Notes for AMPIRE480272 Component Driver</strong></h1>
|
||||
<p>Copyright © 2014 STMicroelectronics<br />
|
||||
</p>
|
||||
<a href="https://www.st.com" class="logo"><img src="_htmresc/st_logo.png" alt="ST logo" /></a>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
<h1 id="license">License</h1>
|
||||
This software component is licensed by ST under BSD 3-Clause license, the “License”; You may not use this component except in compliance with the License. You may obtain a copy of the License at:
|
||||
<center>
|
||||
<a href="https://opensource.org/licenses/BSD-3-Clause">https://opensource.org/licenses/BSD-3-Clause</a>
|
||||
</center>
|
||||
<h1 id="purpose">Purpose</h1>
|
||||
<p>This driver provides a set of timings required for Ampire480272 LCD component</p>
|
||||
</div>
|
||||
<div class="col-sm-12 col-lg-8">
|
||||
<h1 id="update-history">Update History</h1>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section4" checked aria-hidden="true"> <label for="collapse-section4" aria-hidden="true"><strong>V1.0.3 / 23-November-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Update st_logo.png inclusion path in Release notes.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true"> <label for="collapse-section3" aria-hidden="true"><strong>V1.0.2 / 14-October-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-1">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Update Release_Notes generation sources</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true"> <label for="collapse-section2" aria-hidden="true"><strong>V1.0.1 / 07-April-2017</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-2">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Update comments to be used for PDSC generation</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true"> <label for="collapse-section1" aria-hidden="true"><strong>V1.0.0 / 18-February-2014</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-3">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First official release of ampire480272 LCD component driver</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="sticky">
|
||||
For complete documentation on <mark>STM32 Microcontrollers</mark> , visit: <span style="font-color: blue;"><a href="http://www.st.com/STM32">www.st.com</a></span>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,91 @@
|
|||
---
|
||||
pagetitle: Release Notes for AMPIRE480272 Component Driver
|
||||
lang: en
|
||||
---
|
||||
|
||||
::: {.row}
|
||||
::: {.col-sm-12 .col-lg-4}
|
||||
|
||||
::: {.card .fluid}
|
||||
::: {.sectione .dark}
|
||||
<center>
|
||||
# **Release Notes for AMPIRE480272 Component Driver**
|
||||
Copyright © 2014 STMicroelectronics\
|
||||
|
||||
[](https://www.st.com){.logo}
|
||||
</center>
|
||||
:::
|
||||
:::
|
||||
|
||||
# License
|
||||
|
||||
This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this component except in
|
||||
compliance with the License. You may obtain a copy of the License at:
|
||||
<center>
|
||||
[https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause)
|
||||
</center>
|
||||
|
||||
# Purpose
|
||||
|
||||
This driver provides a set of timings required for Ampire480272 LCD component
|
||||
|
||||
:::
|
||||
|
||||
::: {.col-sm-12 .col-lg-8}
|
||||
# Update History
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section4" checked aria-hidden="true">
|
||||
<label for="collapse-section4" aria-hidden="true">__V1.0.3 / 23-November-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update st_logo.png inclusion path in Release notes.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true">
|
||||
<label for="collapse-section3" aria-hidden="true">__V1.0.2 / 14-October-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update Release_Notes generation sources
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true">
|
||||
<label for="collapse-section2" aria-hidden="true">__V1.0.1 / 07-April-2017__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update comments to be used for PDSC generation
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true">
|
||||
<label for="collapse-section1" aria-hidden="true">__V1.0.0 / 18-February-2014__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- First official release of ampire480272 LCD component driver
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
:::
|
||||
:::
|
||||
|
||||
<footer class="sticky">
|
||||
For complete documentation on <mark>STM32 Microcontrollers</mark> ,
|
||||
visit: [[www.st.com](http://www.st.com/STM32)]{style="font-color: blue;"}
|
||||
</footer>
|
After Width: | Height: | Size: 18 KiB |
|
@ -0,0 +1,119 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file ampire480272.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the constants parameters for the ampire480272
|
||||
* LCD component.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
|
||||
*
|
||||
* 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 STMicroelectronics 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 HOLDER 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __AMPIRE480272_H
|
||||
#define __AMPIRE480272_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ampire480272
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup AMPIRE480272_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup AMPIRE480272_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief AMPIRE480272 Size
|
||||
*/
|
||||
#define AMPIRE480272_WIDTH ((uint16_t)480) /* LCD PIXEL WIDTH */
|
||||
#define AMPIRE480272_HEIGHT ((uint16_t)272) /* LCD PIXEL HEIGHT */
|
||||
|
||||
/**
|
||||
* @brief AMPIRE480272 Timing
|
||||
*/
|
||||
#define AMPIRE480272_HSYNC ((uint16_t)41) /* Horizontal synchronization */
|
||||
#define AMPIRE480272_HBP ((uint16_t)2) /* Horizontal back porch */
|
||||
#define AMPIRE480272_HFP ((uint16_t)2) /* Horizontal front porch */
|
||||
#define AMPIRE480272_VSYNC ((uint16_t)10) /* Vertical synchronization */
|
||||
#define AMPIRE480272_VBP ((uint16_t)2) /* Vertical back porch */
|
||||
#define AMPIRE480272_VFP ((uint16_t)2) /* Vertical front porch */
|
||||
|
||||
/**
|
||||
* @brief AMPIRE480272 frequency divider
|
||||
*/
|
||||
#define AMPIRE480272_FREQUENCY_DIVIDER 5 /* LCD Frequency divider */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup AMPIRE480272_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __AMPIRE480272_H */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
@ -0,0 +1,84 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
<title>Release Notes for AMPIRE640480 Component Driver</title>
|
||||
<style type="text/css">
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
span.underline{text-decoration: underline;}
|
||||
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="_htmresc/mini-st.css" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-4">
|
||||
<div class="card fluid">
|
||||
<div class="sectione dark">
|
||||
<center>
|
||||
<h1 id="release-notes-for-ampire640480-component-driver"><strong>Release Notes for AMPIRE640480 Component Driver</strong></h1>
|
||||
<p>Copyright © 2014 STMicroelectronics<br />
|
||||
</p>
|
||||
<a href="https://www.st.com" class="logo"><img src="_htmresc/st_logo.png" alt="ST logo" /></a>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
<h1 id="license">License</h1>
|
||||
This software component is licensed by ST under BSD 3-Clause license, the “License”; You may not use this component except in compliance with the License. You may obtain a copy of the License at:
|
||||
<center>
|
||||
<a href="https://opensource.org/licenses/BSD-3-Clause">https://opensource.org/licenses/BSD-3-Clause</a>
|
||||
</center>
|
||||
<h1 id="purpose">Purpose</h1>
|
||||
<p>This driver provides a set of timings required for Ampire640480 LCD component</p>
|
||||
</div>
|
||||
<div class="col-sm-12 col-lg-8">
|
||||
<h1 id="update-history">Update History</h1>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section4" checked aria-hidden="true"> <label for="collapse-section4" aria-hidden="true"><strong>V1.0.3 / 23-November-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Update st_logo.png inclusion path in Release notes.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true"> <label for="collapse-section3" aria-hidden="true"><strong>V1.0.2 / 14-October-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-1">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Update Release_Notes generation sources</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true"> <label for="collapse-section2" aria-hidden="true"><strong>V1.0.1 / 07-April-2017</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-2">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Update comments to be used for PDSC generation</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true"> <label for="collapse-section1" aria-hidden="true"><strong>V1.0.0 / 18-February-2014</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-3">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First official release of ampire640480 LCD component driver</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="sticky">
|
||||
For complete documentation on <mark>STM32 Microcontrollers</mark> , visit: <span style="font-color: blue;"><a href="http://www.st.com/STM32">www.st.com</a></span>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,91 @@
|
|||
---
|
||||
pagetitle: Release Notes for AMPIRE640480 Component Driver
|
||||
lang: en
|
||||
---
|
||||
|
||||
::: {.row}
|
||||
::: {.col-sm-12 .col-lg-4}
|
||||
|
||||
::: {.card .fluid}
|
||||
::: {.sectione .dark}
|
||||
<center>
|
||||
# **Release Notes for AMPIRE640480 Component Driver**
|
||||
Copyright © 2014 STMicroelectronics\
|
||||
|
||||
[](https://www.st.com){.logo}
|
||||
</center>
|
||||
:::
|
||||
:::
|
||||
|
||||
# License
|
||||
|
||||
This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this component except in
|
||||
compliance with the License. You may obtain a copy of the License at:
|
||||
<center>
|
||||
[https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause)
|
||||
</center>
|
||||
|
||||
# Purpose
|
||||
|
||||
This driver provides a set of timings required for Ampire640480 LCD component
|
||||
|
||||
:::
|
||||
|
||||
::: {.col-sm-12 .col-lg-8}
|
||||
# Update History
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section4" checked aria-hidden="true">
|
||||
<label for="collapse-section4" aria-hidden="true">__V1.0.3 / 23-November-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update st_logo.png inclusion path in Release notes.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true">
|
||||
<label for="collapse-section3" aria-hidden="true">__V1.0.2 / 14-October-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update Release_Notes generation sources
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true">
|
||||
<label for="collapse-section2" aria-hidden="true">__V1.0.1 / 07-April-2017__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update comments to be used for PDSC generation
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true">
|
||||
<label for="collapse-section1" aria-hidden="true">__V1.0.0 / 18-February-2014__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- First official release of ampire640480 LCD component driver
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
:::
|
||||
:::
|
||||
|
||||
<footer class="sticky">
|
||||
For complete documentation on <mark>STM32 Microcontrollers</mark> ,
|
||||
visit: [[www.st.com](http://www.st.com/STM32)]{style="font-color: blue;"}
|
||||
</footer>
|
After Width: | Height: | Size: 18 KiB |
|
@ -0,0 +1,119 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file ampire640480.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the constants parameters for the ampire640480
|
||||
* LCD component.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
|
||||
*
|
||||
* 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 STMicroelectronics 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 HOLDER 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __AMPIRE640480_H
|
||||
#define __AMPIRE640480_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ampire640480
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup AMPIRE640480_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup AMPIRE640480_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief AMPIRE640480 Size
|
||||
*/
|
||||
#define AMPIRE640480_WIDTH ((uint16_t)640) /* LCD PIXEL WIDTH */
|
||||
#define AMPIRE640480_HEIGHT ((uint16_t)480) /* LCD PIXEL HEIGHT */
|
||||
|
||||
/**
|
||||
* @brief AMPIRE640480 Timing
|
||||
*/
|
||||
#define AMPIRE640480_HSYNC ((uint16_t)30) /* Horizontal synchronization */
|
||||
#define AMPIRE640480_HBP ((uint16_t)114) /* Horizontal back porch */
|
||||
#define AMPIRE640480_HFP ((uint16_t)16) /* Horizontal front porch */
|
||||
#define AMPIRE640480_VSYNC ((uint16_t)3) /* Vertical synchronization */
|
||||
#define AMPIRE640480_VBP ((uint16_t)32) /* Vertical back porch */
|
||||
#define AMPIRE640480_VFP ((uint16_t)10) /* Vertical front porch */
|
||||
|
||||
/**
|
||||
* @brief AMPIRE640480 frequency divider
|
||||
*/
|
||||
#define AMPIRE640480_FREQUENCY_DIVIDER 3 /* LCD Frequency divider */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup AMPIRE640480_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __AMPIRE640480_H */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
@ -0,0 +1,91 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
<title>Release Notes for CS42L51 Component Driver</title>
|
||||
<style type="text/css">
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
span.underline{text-decoration: underline;}
|
||||
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="_htmresc/mini-st.css" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-4">
|
||||
<div class="card fluid">
|
||||
<div class="sectione dark">
|
||||
<center>
|
||||
<h1 id="release-notes-for-cs42l51-component-driver"><strong>Release Notes for CS42L51 Component Driver</strong></h1>
|
||||
<p>Copyright © 2017 STMicroelectronics<br />
|
||||
</p>
|
||||
<a href="https://www.st.com" class="logo"><img src="_htmresc/st_logo.png" alt="ST logo" /></a>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
<h1 id="license">License</h1>
|
||||
This software component is licensed by ST under BSD 3-Clause license, the “License”; You may not use this component except in compliance with the License. You may obtain a copy of the License at:
|
||||
<center>
|
||||
<a href="https://opensource.org/licenses/BSD-3-Clause">https://opensource.org/licenses/BSD-3-Clause</a>
|
||||
</center>
|
||||
<h1 id="purpose">Purpose</h1>
|
||||
<p>This driver provides a set of audio functions offered by CS42L51 codec component</p>
|
||||
</div>
|
||||
<div class="col-sm-12 col-lg-8">
|
||||
<h1 id="update-history">Update History</h1>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true"> <label for="collapse-section3" aria-hidden="true"><strong>V2.0.1 / 30-October-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Update st_logo.png inclusion path in Release notes.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true"> <label for="collapse-section2" aria-hidden="true"><strong>V2.0.0 / 14-October-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-1">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First Official release of CS42L51 BSP drivers in line with STM32Cube BSP drivers development guidelines (UM2298)</li>
|
||||
<li>The component drivers are composed of
|
||||
<ul>
|
||||
<li>component core drivers files: cs42l51.h/.c</li>
|
||||
<li>component register drivers files: cs42l51_regs.h/.c</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<h2 id="backward-compatibility">Backward Compatibility</h2>
|
||||
<ul>
|
||||
<li>This version breaks the compatibility with previous versions</li>
|
||||
</ul>
|
||||
<h2 id="dependencies">Dependencies</h2>
|
||||
<ul>
|
||||
<li><p>This software release is compatible with:</p>
|
||||
<ul>
|
||||
<li>BSP Common v6.0.1 or above</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true"> <label for="collapse-section1" aria-hidden="true"><strong>V1.0.0 / 17-February-2017</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-2">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First official release of <strong>CS42L51</strong> Audio codec Component drivers</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="sticky">
|
||||
For complete documentation on <mark>STM32 Microcontrollers</mark> , visit: <span style="font-color: blue;"><a href="http://www.st.com/STM32">www.st.com</a></span>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,92 @@
|
|||
---
|
||||
pagetitle: Release Notes for CS42L51 Component Driver
|
||||
lang: en
|
||||
---
|
||||
|
||||
::: {.row}
|
||||
::: {.col-sm-12 .col-lg-4}
|
||||
|
||||
::: {.card .fluid}
|
||||
::: {.sectione .dark}
|
||||
<center>
|
||||
# **Release Notes for CS42L51 Component Driver**
|
||||
Copyright © 2017 STMicroelectronics\
|
||||
|
||||
[](https://www.st.com){.logo}
|
||||
</center>
|
||||
:::
|
||||
:::
|
||||
|
||||
# License
|
||||
|
||||
This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this component except in
|
||||
compliance with the License. You may obtain a copy of the License at:
|
||||
<center>
|
||||
[https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause)
|
||||
</center>
|
||||
|
||||
# Purpose
|
||||
|
||||
This driver provides a set of audio functions offered by CS42L51 codec component
|
||||
|
||||
:::
|
||||
|
||||
::: {.col-sm-12 .col-lg-8}
|
||||
# Update History
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true">
|
||||
<label for="collapse-section3" aria-hidden="true">__V2.0.1 / 30-October-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update st_logo.png inclusion path in Release notes.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true">
|
||||
<label for="collapse-section2" aria-hidden="true">__V2.0.0 / 14-October-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- First Official release of CS42L51 BSP drivers in line with STM32Cube BSP drivers development guidelines (UM2298)
|
||||
- The component drivers are composed of
|
||||
- component core drivers files: cs42l51.h/.c
|
||||
- component register drivers files: cs42l51_regs.h/.c
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
- This version breaks the compatibility with previous versions
|
||||
|
||||
## Dependencies
|
||||
|
||||
- This software release is compatible with:
|
||||
|
||||
- BSP Common v6.0.1 or above
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true">
|
||||
<label for="collapse-section1" aria-hidden="true">__V1.0.0 / 17-February-2017__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- First official release of **CS42L51** Audio codec Component drivers
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
:::
|
||||
:::
|
||||
|
||||
<footer class="sticky">
|
||||
For complete documentation on <mark>STM32 Microcontrollers</mark> ,
|
||||
visit: [[www.st.com](http://www.st.com/STM32)]{style="font-color: blue;"}
|
||||
</footer>
|
1700
lib/main/STM32H7/Drivers/BSP/Components/cs42l51/_htmresc/mini-st.css
Normal file
After Width: | Height: | Size: 18 KiB |
722
lib/main/STM32H7/Drivers/BSP/Components/cs42l51/cs42l51.c
Normal file
|
@ -0,0 +1,722 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file cs42l51.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides the CS42L51 Audio Codec driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "cs42l51.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup cs42l51
|
||||
* @brief This file provides a set of functions needed to drive the
|
||||
* CS42L51 audio codec.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup CS42L51_Private_Types Private Types
|
||||
* @{
|
||||
*/
|
||||
/* Audio codec driver structure initialization */
|
||||
CS42L51_Drv_t CS42L51_Driver =
|
||||
{
|
||||
CS42L51_Init,
|
||||
CS42L51_DeInit,
|
||||
CS42L51_ReadID,
|
||||
CS42L51_Play,
|
||||
CS42L51_Pause,
|
||||
CS42L51_Resume,
|
||||
CS42L51_Stop,
|
||||
CS42L51_SetFrequency,
|
||||
CS42L51_GetFrequency,
|
||||
CS42L51_SetVolume,
|
||||
CS42L51_GetVolume,
|
||||
CS42L51_SetMute,
|
||||
CS42L51_SetOutputMode,
|
||||
CS42L51_SetResolution,
|
||||
CS42L51_GetResolution,
|
||||
CS42L51_SetProtocol,
|
||||
CS42L51_GetProtocol,
|
||||
CS42L51_Reset
|
||||
};
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup CS42L51_Private_Variables Private Variables
|
||||
* @{
|
||||
*/
|
||||
static uint32_t CS42L51_CurrentDevices = CS42L51_OUT_NONE;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup CS42L51_Function_Prototypes Function Prototypes
|
||||
* @{
|
||||
*/
|
||||
static int32_t CS42L51_ReadRegWrap(void *handle, uint16_t Reg, uint8_t* Data, uint16_t Length);
|
||||
static int32_t CS42L51_WriteRegWrap(void *handle, uint16_t Reg, uint8_t* Data, uint16_t Length);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup CS42L51_Private_Functions Private Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Initializes the audio codec and the control interface.
|
||||
* @param pObj pointer to component object
|
||||
* @param pInit pointer de component init structure
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_Init(CS42L51_Object_t *pObj, CS42L51_Init_t *pInit)
|
||||
{
|
||||
int32_t ret = 0;
|
||||
uint8_t tmp;
|
||||
|
||||
if(pObj->IsInitialized == 0U)
|
||||
{
|
||||
/* Set the device in standby mode */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
tmp |= 0x01U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
|
||||
/* Set all power down bits to 1 */
|
||||
tmp = 0x7FU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
tmp |= 0x0EU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
|
||||
pObj->IsInitialized = 1U;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Set all power down bits to 1 exept PDN to mute ADCs and DACs*/
|
||||
tmp = 0x7EU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
tmp |= 0x0EU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
|
||||
/* Disable zero cross and soft ramp */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_DAC_CTRL, &tmp, 1);
|
||||
tmp &= 0xFCU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_DAC_CTRL, &tmp, 1);
|
||||
|
||||
/* Power control : Enter standby (PDN = 1) */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
tmp |= 0x01U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
}
|
||||
|
||||
|
||||
/* Mic Power and Speed Control : Auto detect on, Speed mode SSM, tri state off, MCLK divide by 2 off */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
tmp = ((tmp & 0x0EU) | 0xA0U);
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
|
||||
/* Interface control : Loopback off, Slave, I2S (SDIN and SOUT), Digital mix off, Mic mix off */
|
||||
tmp = 0x0CU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_INTERFACE_CTRL, &tmp, 1);
|
||||
|
||||
/* Mic control : ADC single volume off, ADCB boost off, ADCA boost off, MicBias on AIN3B/MICIN2 pin, MicBias level 0.8xVA, MICB boost 32db, MICA boost 32dB */
|
||||
tmp = 0x03U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_MIC_CTRL, &tmp, 1);
|
||||
|
||||
/* ADC control : ADCB HPF on, ADCB HPF freeze off, ADCA HPF on, ADCA HPF freeze off, Soft ramp B on, Zero cross B on, Soft ramp A on, Zero cross A on */
|
||||
tmp = 0xAFU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_ADC_CTRL, &tmp, 1);
|
||||
|
||||
/* DAC output control : HP Gain to 1, Single volume control off, PCM invert signals polarity off, DAC channels mute on */
|
||||
tmp = 0xC3U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_DAC_OUTPUT_CTRL, &tmp, 1);
|
||||
|
||||
/* DAC control : Signal processing to DAC, Freeze off, De-emphasis off, Analog output auto mute off, DAC soft ramp */
|
||||
tmp = 0x42U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_DAC_CTRL, &tmp, 1);
|
||||
|
||||
/* ALCA and PGAA Control : ALCA soft ramp disable on, ALCA zero cross disable on, PGA A Gain +8dB */
|
||||
tmp = 0xD0U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_ALCA_PGAA_CTRL, &tmp, 1);
|
||||
|
||||
/* ALCB and PGAB Control : ALCB soft ramp disable on, ALCB zero cross disable on, PGA B Gain +8dB */
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_ALCB_PGAB_CTRL, &tmp, 1);
|
||||
|
||||
/* ADCA Attenuator : 0dB */
|
||||
tmp = 0x00U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_ADCA_ATTENUATOR, &tmp, 1);
|
||||
|
||||
/* ADCB Attenuator : 0dB */
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_ADCB_ATTENUATOR, &tmp, 1);
|
||||
|
||||
/* ADCA mixer volume control : ADCA mixer channel mute on, ADCA mixer volume 0dB */
|
||||
tmp = 0x80U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_ADCA_MIXER_VOL_CTRL, &tmp, 1);
|
||||
|
||||
/* ADCB mixer volume control : ADCB mixer channel mute on, ADCB mixer volume 0dB */
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_ADCB_MIXER_VOL_CTRL, &tmp, 1);
|
||||
|
||||
/* PCMA mixer volume control : PCMA mixer channel mute off, PCMA mixer volume 0dB */
|
||||
tmp = 0x00U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PCMA_MIXER_VOL_CTRL, &tmp, 1);
|
||||
|
||||
/* PCMB mixer volume control : PCMB mixer channel mute off, PCMB mixer volume 0dB */
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PCMB_MIXER_VOL_CTRL, &tmp, 1);
|
||||
|
||||
/* PCM channel mixer : AOUTA Left, AOUTB Right */
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_ADC_PCM_CHANNEL_MIXER, &tmp, 1);
|
||||
|
||||
if((pInit->OutputDevice & CS42L51_OUT_HEADPHONE) == CS42L51_OUT_HEADPHONE)
|
||||
{
|
||||
tmp = VOLUME_CONVERT(pInit->Volume);
|
||||
/* AOUTA volume control : AOUTA volume */
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_AOUTA_VOL_CTRL, &tmp, 1);
|
||||
/* AOUTB volume control : AOUTB volume */
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_AOUTB_VOL_CTRL, &tmp, 1);
|
||||
}
|
||||
|
||||
/* ALC enable and attack rate : ALCB and ALCA enable, fastest attack */
|
||||
tmp = 0x40U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_ALC_ENABLE_AND_ATTACK_RATE, &tmp, 1);
|
||||
|
||||
/* Store current devices */
|
||||
CS42L51_CurrentDevices = (pInit->OutputDevice | pInit->InputDevice);
|
||||
|
||||
if(ret != CS42L51_OK)
|
||||
{
|
||||
ret = CS42L51_ERROR;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Deinitializes the audio codec.
|
||||
* @param pObj pointer to component object
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_DeInit(CS42L51_Object_t *pObj)
|
||||
{
|
||||
if(pObj->IsInitialized == 1U)
|
||||
{
|
||||
pObj->IsInitialized = 0U;
|
||||
}
|
||||
|
||||
return CS42L51_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the CS42L51 ID.
|
||||
* @param pObj pointer to component object
|
||||
* @param Id component ID
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_ReadID(CS42L51_Object_t *pObj, uint32_t *Id)
|
||||
{
|
||||
int32_t ret;
|
||||
uint8_t cs42l51_id;
|
||||
|
||||
/* Initialize the Control interface of the Audio Codec */
|
||||
pObj->IO.Init();
|
||||
|
||||
/* Get ID from component */
|
||||
ret = cs42l51_read_reg(&pObj->Ctx, CS42L51_CHIP_ID, &cs42l51_id, 1);
|
||||
|
||||
*Id = cs42l51_id;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Start the audio Codec play feature.
|
||||
* @note For this codec no Play options are required.
|
||||
* @param pObj pointer to component object
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_Play(CS42L51_Object_t *pObj)
|
||||
{
|
||||
int32_t ret = 0;
|
||||
uint8_t tmp;
|
||||
|
||||
if((CS42L51_CurrentDevices & CS42L51_OUT_HEADPHONE) == CS42L51_OUT_HEADPHONE)
|
||||
{
|
||||
/* Unmute the output first */
|
||||
ret += CS42L51_SetMute(pObj, CS42L51_MUTE_OFF);
|
||||
|
||||
/* DAC control : Signal processing to DAC, Freeze off, De-emphasis off, Analog output auto mute off, DAC soft ramp */
|
||||
tmp = 0x42U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_DAC_CTRL, &tmp, 1);
|
||||
|
||||
/* Power control 1 : PDN_DACA, PDN_DACB disable. */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
tmp &= 0x9FU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
}
|
||||
|
||||
if((CS42L51_CurrentDevices & CS42L51_IN_LINE1) == CS42L51_IN_LINE1)
|
||||
{
|
||||
/* ADC Input Select, Invert and Mute : AIN1B to PGAB, AIN1A to PGAA, ADCB invert off, ADCA invert off, ADCB mute off, ADCA mute off */
|
||||
tmp = 0x00U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_ADCX_INPUT_SELECT, &tmp, 1);
|
||||
|
||||
/* Power control 1 : PDN_PGAA, PDN_PGAA, PDN_ADCB, PDN_ADCA disable. */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
tmp &= 0xF9U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
|
||||
/* Mic Power and Speed Control : PDN_MICA, PDN_MICB, PDN_MIC_BIAS disable. */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
tmp &= 0xFFU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
}
|
||||
|
||||
if((CS42L51_CurrentDevices & CS42L51_IN_MIC1) == CS42L51_IN_MIC1)
|
||||
{
|
||||
/* ADC Input Select, Invert and Mute : AIN1B to PGAB, AIN3A to PreAmp to PGAA, ADCB invert off, ADCA invert off, ADCB mute on, ADCA mute off */
|
||||
tmp = 0x32U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_ADCX_INPUT_SELECT, &tmp, 1);
|
||||
|
||||
/* Power control 1 : PDN_PGAA, PDN_ADCA disable. */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
tmp &= 0xF5U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
|
||||
/* Mic Power and Speed Control : PDN_MICA, PDN_MIC_BIAS disable. */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
tmp &= 0xF9U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
}
|
||||
|
||||
if((CS42L51_CurrentDevices & CS42L51_IN_MIC2) == CS42L51_IN_MIC2)
|
||||
{
|
||||
/* Power control 1 : PDN_PGAB, PDN_ADCB disable. */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
tmp &= 0xEBU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
|
||||
/* Mic Power and Speed Control : PDN_MICB, PDN_MIC_BIAS disable. */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
tmp &= 0xF5U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
}
|
||||
|
||||
/* Power control : Exit standby (PDN = 0) */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
tmp &= 0xFEU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pauses playing on the audio codec.
|
||||
* @param pObj pointer to component object
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_Pause(CS42L51_Object_t *pObj)
|
||||
{
|
||||
/* Pause the audio file playing */
|
||||
if(CS42L51_SetMute(pObj, CS42L51_MUTE_ON) != CS42L51_OK)
|
||||
{
|
||||
return CS42L51_ERROR;
|
||||
}
|
||||
|
||||
return CS42L51_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Resumes playing on the audio codec.
|
||||
* @param pObj pointer to component object
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_Resume(CS42L51_Object_t *pObj)
|
||||
{
|
||||
/* Resumes the audio file playing */
|
||||
return CS42L51_SetMute(pObj, CS42L51_MUTE_OFF);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Stops audio Codec playing. It powers down the codec.
|
||||
* @param pObj pointer to component object
|
||||
* @param CodecPdwnMode selects the power down mode.
|
||||
* - CS42L51_PDWN_SW: only mutes the audio codec. When resuming from this
|
||||
* mode the codec keeps the previous initialization
|
||||
* (no need to re-Initialize the codec registers).
|
||||
* - CS42L51_PDWN_HW: Physically power down the codec. When resuming from this
|
||||
* mode, the codec is set to default configuration
|
||||
* (user should re-Initialize the codec in order to
|
||||
* play again the audio stream).
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_Stop(CS42L51_Object_t *pObj, uint32_t CodecPdwnMode)
|
||||
{
|
||||
int32_t ret;
|
||||
uint8_t tmp;
|
||||
|
||||
/* Mute the output first */
|
||||
ret = CS42L51_SetMute(pObj, CS42L51_MUTE_ON);
|
||||
|
||||
if (CodecPdwnMode == CS42L51_PDWN_SW)
|
||||
{
|
||||
/* Only output mute required*/
|
||||
}
|
||||
else /* CS42L51_PDWN_HW */
|
||||
{
|
||||
/* Set all power down bits to 1 exept PDN to mute ADCs and DACs*/
|
||||
tmp = 0x7EU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
tmp |= 0x0EU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
|
||||
/* Disable zero cross and soft ramp */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_DAC_CTRL, &tmp, 1);
|
||||
tmp &= 0xFCU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_DAC_CTRL, &tmp, 1);
|
||||
|
||||
/* Power control : Enter standby (PDN = 1) */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
tmp |= 0x01U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
}
|
||||
|
||||
if(ret != CS42L51_OK)
|
||||
{
|
||||
ret = CS42L51_ERROR;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set higher or lower the codec volume level.
|
||||
* @param pObj pointer to component object
|
||||
* @param InputOutput Input or Output volume
|
||||
* @param Volume a byte value from 0 to 255
|
||||
* (refer to codec registers description for more details).
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_SetVolume(CS42L51_Object_t *pObj, uint32_t InputOutput, uint8_t Volume)
|
||||
{
|
||||
int32_t ret;
|
||||
uint8_t convertedvol;
|
||||
|
||||
if(InputOutput != VOLUME_OUTPUT)
|
||||
{
|
||||
ret = CS42L51_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
convertedvol = VOLUME_CONVERT(Volume);
|
||||
|
||||
/* AOUTA volume control : AOUTA volume */
|
||||
ret = cs42l51_write_reg(&pObj->Ctx, CS42L51_AOUTA_VOL_CTRL, &convertedvol, 1);
|
||||
/* AOUTB volume control : AOUTB volume */
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_AOUTB_VOL_CTRL, &convertedvol, 1);
|
||||
}
|
||||
|
||||
if(ret != CS42L51_OK)
|
||||
{
|
||||
ret = CS42L51_ERROR;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get higher or lower the codec volume level.
|
||||
* @param pObj pointer to component object
|
||||
* @param InputOutput Input or Output volume
|
||||
* @param Volume audio volume
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_GetVolume(CS42L51_Object_t *pObj, uint32_t InputOutput, uint8_t *Volume)
|
||||
{
|
||||
int32_t ret;
|
||||
uint8_t tmp;
|
||||
|
||||
if(InputOutput != VOLUME_OUTPUT)
|
||||
{
|
||||
ret = CS42L51_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = cs42l51_read_reg(&pObj->Ctx, CS42L51_AOUTA_VOL_CTRL, &tmp, 1);
|
||||
*Volume = VOLUME_INVERT(tmp);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enables or disables the mute feature on the audio codec.
|
||||
* @param pObj pointer to component object
|
||||
* @param Cmd CS42L51_MUTE_ON to enable the mute or CS42L51_MUTE_OFF to disable the
|
||||
* mute mode.
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_SetMute(CS42L51_Object_t *pObj, uint32_t Cmd)
|
||||
{
|
||||
int32_t ret;
|
||||
uint8_t tmp;
|
||||
|
||||
ret = cs42l51_read_reg(&pObj->Ctx, CS42L51_DAC_OUTPUT_CTRL, &tmp, 1);
|
||||
|
||||
/* Set the Mute mode */
|
||||
if(Cmd == CS42L51_MUTE_ON)
|
||||
{
|
||||
tmp |= 0x03U;
|
||||
}
|
||||
else /* CS42L51_MUTE_OFF Disable the Mute */
|
||||
{
|
||||
tmp &= 0xFCU;
|
||||
}
|
||||
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_DAC_OUTPUT_CTRL, &tmp, 1);
|
||||
|
||||
if(ret != CS42L51_OK)
|
||||
{
|
||||
ret = CS42L51_ERROR;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Switch dynamically (while audio file is played) the output target
|
||||
* (speaker or headphone).
|
||||
* @param pObj pointer to component object
|
||||
* @param Output Only CS42L51_OUT_HEADPHONE output is supported
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_SetOutputMode(CS42L51_Object_t *pObj, uint32_t Output)
|
||||
{
|
||||
(void)(pObj);
|
||||
(void)(Output);
|
||||
|
||||
/* This feature is not supported */
|
||||
return CS42L51_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set Audio resolution.
|
||||
* @param pObj pointer to component object
|
||||
* @param Resolution Audio resolution. Can be:
|
||||
* CS42L51_RESOLUTION_16b, CS42L51_RESOLUTION_18b,
|
||||
* CS42L51_RESOLUTION_20b or CS42L51_RESOLUTION_24b
|
||||
* @note This is applicable only for CS42L51_PROTOCOL_R_JUSTIFIED protocol
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_SetResolution(CS42L51_Object_t *pObj, uint32_t Resolution)
|
||||
{
|
||||
(void)(pObj);
|
||||
(void)(Resolution);
|
||||
|
||||
/* This feature is not supported */
|
||||
return CS42L51_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get Audio resolution.
|
||||
* @param pObj pointer to component object
|
||||
* @retval Audio resolution
|
||||
*/
|
||||
int32_t CS42L51_GetResolution(CS42L51_Object_t *pObj, uint32_t *Resolution)
|
||||
{
|
||||
(void)(pObj);
|
||||
(void)(Resolution);
|
||||
|
||||
/* This feature is not supported */
|
||||
return CS42L51_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set Audio Protocol.
|
||||
* @param pObj pointer to component object
|
||||
* @param Protocol Audio Protocol. Can be:
|
||||
* CS42L51_PROTOCOL_R_JUSTIFIED, CS42L51_PROTOCOL_L_JUSTIFIED
|
||||
* or CS42L51_PROTOCOL_I2S
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_SetProtocol(CS42L51_Object_t *pObj, uint32_t Protocol)
|
||||
{
|
||||
(void)(pObj);
|
||||
(void)(Protocol);
|
||||
|
||||
/* This feature is not supported */
|
||||
return CS42L51_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get Audio Protocol.
|
||||
* @param pObj pointer to component object
|
||||
* @param Protocol pointer to protocol value
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_GetProtocol(CS42L51_Object_t *pObj, uint32_t *Protocol)
|
||||
{
|
||||
(void)(pObj);
|
||||
(void)(Protocol);
|
||||
|
||||
/* This feature is not supported */
|
||||
return CS42L51_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets new frequency.
|
||||
* @param pObj pointer to component object
|
||||
* @param AudioFreq Audio frequency
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_SetFrequency(CS42L51_Object_t *pObj, uint32_t AudioFreq)
|
||||
{
|
||||
(void)(pObj);
|
||||
(void)(AudioFreq);
|
||||
|
||||
/* This feature is not supported */
|
||||
return CS42L51_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get frequency.
|
||||
* @param pObj pointer to component object
|
||||
* @param AudioFreq Audio frequency
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_GetFrequency(CS42L51_Object_t *pObj, uint32_t *AudioFreq)
|
||||
{
|
||||
(void)(pObj);
|
||||
(void)(AudioFreq);
|
||||
|
||||
/* This feature is not supported */
|
||||
return CS42L51_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Resets cs42l51 registers.
|
||||
* @param pObj pointer to component object
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_Reset(CS42L51_Object_t *pObj)
|
||||
{
|
||||
/* De-Initialize Audio Codec interface */
|
||||
pObj->IO.DeInit();
|
||||
|
||||
/* Initialize Audio Codec interface */
|
||||
pObj->IO.Init();
|
||||
|
||||
return CS42L51_OK;
|
||||
}
|
||||
|
||||
/******************** Static functions ****************************************/
|
||||
/**
|
||||
* @brief Function
|
||||
* @param Component object pointer
|
||||
* @retval error status
|
||||
*/
|
||||
int32_t CS42L51_RegisterBusIO (CS42L51_Object_t *pObj, CS42L51_IO_t *pIO)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
if (pObj == NULL)
|
||||
{
|
||||
ret = CS42L51_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
pObj->IO.Init = pIO->Init;
|
||||
pObj->IO.DeInit = pIO->DeInit;
|
||||
pObj->IO.Address = pIO->Address;
|
||||
pObj->IO.WriteReg = pIO->WriteReg;
|
||||
pObj->IO.ReadReg = pIO->ReadReg;
|
||||
pObj->IO.GetTick = pIO->GetTick;
|
||||
|
||||
pObj->Ctx.ReadReg = CS42L51_ReadRegWrap;
|
||||
pObj->Ctx.WriteReg = CS42L51_WriteRegWrap;
|
||||
pObj->Ctx.handle = pObj;
|
||||
|
||||
if(pObj->IO.Init != NULL)
|
||||
{
|
||||
ret = pObj->IO.Init();
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = CS42L51_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Function
|
||||
* @param handle Component object handle
|
||||
* @param Reg The target register address to write
|
||||
* @param pData The target register value to be written
|
||||
* @param Length buffer size to be written
|
||||
* @retval error status
|
||||
*/
|
||||
static int32_t CS42L51_ReadRegWrap(void *handle, uint16_t Reg, uint8_t* pData, uint16_t Length)
|
||||
{
|
||||
CS42L51_Object_t *pObj = (CS42L51_Object_t *)handle;
|
||||
|
||||
return pObj->IO.ReadReg(pObj->IO.Address, Reg, pData, Length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Function
|
||||
* @param handle Component object handle
|
||||
* @param Reg The target register address to write
|
||||
* @param pData The target register value to be written
|
||||
* @param Length buffer size to be written
|
||||
* @retval error status
|
||||
*/
|
||||
static int32_t CS42L51_WriteRegWrap(void *handle, uint16_t Reg, uint8_t* pData, uint16_t Length)
|
||||
{
|
||||
CS42L51_Object_t *pObj = (CS42L51_Object_t *)handle;
|
||||
|
||||
return pObj->IO.WriteReg(pObj->IO.Address, Reg, pData, Length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
219
lib/main/STM32H7/Drivers/BSP/Components/cs42l51/cs42l51.h
Normal file
|
@ -0,0 +1,219 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file cs42l51.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the
|
||||
* cs42l51.c driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef CS42L51_H
|
||||
#define CS42L51_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "cs42l51_reg.h"
|
||||
#include <stddef.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup CS42L51
|
||||
* @{
|
||||
*/
|
||||
typedef int32_t (*CS42L51_Init_Func) (void);
|
||||
typedef int32_t (*CS42L51_DeInit_Func) (void);
|
||||
typedef int32_t (*CS42L51_GetTick_Func) (void);
|
||||
typedef int32_t (*CS42L51_Delay_Func) (uint32_t);
|
||||
typedef int32_t (*CS42L51_WriteReg_Func)(uint16_t, uint16_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*CS42L51_ReadReg_Func) (uint16_t, uint16_t, uint8_t*, uint16_t);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
CS42L51_Init_Func Init;
|
||||
CS42L51_DeInit_Func DeInit;
|
||||
uint16_t Address;
|
||||
CS42L51_WriteReg_Func WriteReg;
|
||||
CS42L51_ReadReg_Func ReadReg;
|
||||
CS42L51_GetTick_Func GetTick;
|
||||
} CS42L51_IO_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
CS42L51_IO_t IO;
|
||||
cs42l51_ctx_t Ctx;
|
||||
uint8_t IsInitialized;
|
||||
} CS42L51_Object_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t InputDevice;
|
||||
uint32_t OutputDevice;
|
||||
uint32_t Frequency;
|
||||
uint32_t Resolution;
|
||||
uint32_t Volume;
|
||||
} CS42L51_Init_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Init ) ( CS42L51_Object_t *, CS42L51_Init_t* );
|
||||
int32_t ( *DeInit ) ( CS42L51_Object_t * );
|
||||
int32_t ( *ReadID ) ( CS42L51_Object_t *, uint32_t * );
|
||||
int32_t ( *Play ) ( CS42L51_Object_t * );
|
||||
int32_t ( *Pause ) ( CS42L51_Object_t * );
|
||||
int32_t ( *Resume ) ( CS42L51_Object_t * );
|
||||
int32_t ( *Stop ) ( CS42L51_Object_t *, uint32_t );
|
||||
int32_t ( *SetFrequency ) ( CS42L51_Object_t *, uint32_t );
|
||||
int32_t ( *GetFrequency ) ( CS42L51_Object_t *, uint32_t*);
|
||||
int32_t ( *SetVolume ) ( CS42L51_Object_t *, uint32_t, uint8_t );
|
||||
int32_t ( *GetVolume ) ( CS42L51_Object_t *, uint32_t, uint8_t*);
|
||||
int32_t ( *SetMute ) ( CS42L51_Object_t *, uint32_t );
|
||||
int32_t ( *SetOutputMode ) ( CS42L51_Object_t *, uint32_t );
|
||||
int32_t ( *SetResolution ) ( CS42L51_Object_t *, uint32_t );
|
||||
int32_t ( *GetResolution ) ( CS42L51_Object_t *, uint32_t*);
|
||||
int32_t ( *SetProtocol ) ( CS42L51_Object_t *, uint32_t );
|
||||
int32_t ( *GetProtocol ) ( CS42L51_Object_t *, uint32_t*);
|
||||
int32_t ( *Reset ) ( CS42L51_Object_t * );
|
||||
} CS42L51_Drv_t;
|
||||
|
||||
|
||||
/** @defgroup CS42L51_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
#define CS42L51_OK (0)
|
||||
#define CS42L51_ERROR (-1)
|
||||
|
||||
/******************************************************************************/
|
||||
/*************************** Codec User defines ******************************/
|
||||
/******************************************************************************/
|
||||
/* Audio Input Device */
|
||||
#define CS42L51_IN_NONE 0x0000U
|
||||
#define CS42L51_IN_MIC1 0x0100U
|
||||
#define CS42L51_IN_MIC2 0x0200U
|
||||
#define CS42L51_IN_LINE1 0x0400U
|
||||
#define CS42L51_IN_LINE2 0x0800U
|
||||
#define CS42L51_IN_LINE3 0x1000U
|
||||
|
||||
/* Audio Output Device */
|
||||
#define CS42L51_OUT_NONE 0x0000U
|
||||
#define CS42L51_OUT_HEADPHONE 0x0001U
|
||||
|
||||
/* AUDIO FREQUENCY */
|
||||
#define CS42L51_FREQUENCY_192K 192000
|
||||
#define CS42L51_FREQUENCY_176K 176400
|
||||
#define CS42L51_FREQUENCY_96K 96000
|
||||
#define CS42L51_FREQUENCY_88K 88200
|
||||
#define CS42L51_FREQUENCY_48K 48000
|
||||
#define CS42L51_FREQUENCY_44K 44100
|
||||
#define CS42L51_FREQUENCY_32K 32000
|
||||
#define CS42L51_FREQUENCY_22K 22050
|
||||
#define CS42L51_FREQUENCY_16K 16000
|
||||
#define CS42L51_FREQUENCY_11K 11025
|
||||
#define CS42L51_FREQUENCY_8K 8000
|
||||
|
||||
/* AUDIO RESOLUTION */
|
||||
#define CS42L51_RESOLUTION_16b 0x05U
|
||||
#define CS42L51_RESOLUTION_18b 0x04U
|
||||
#define CS42L51_RESOLUTION_20b 0x03U
|
||||
#define CS42L51_RESOLUTION_24b 0x02U
|
||||
|
||||
/* Codec stop options */
|
||||
#define CS42L51_PDWN_HW 0x00U
|
||||
#define CS42L51_PDWN_SW 0x01U
|
||||
|
||||
/* Volume Input Output selection */
|
||||
#define VOLUME_INPUT 0U
|
||||
#define VOLUME_OUTPUT 1U
|
||||
|
||||
/* MUTE commands */
|
||||
#define CS42L51_MUTE_ON 1U
|
||||
#define CS42L51_MUTE_OFF 0U
|
||||
|
||||
/* AUDIO PROTOCOL */
|
||||
#define CS42L51_PROTOCOL_L_JUSTIFIED 0U
|
||||
#define CS42L51_PROTOCOL_I2S 1U
|
||||
#define CS42L51_PROTOCOL_R_JUSTIFIED 2U
|
||||
|
||||
#define VOLUME_CONVERT(Volume) (((Volume) >= 100U) ? 0U : ((uint8_t)((((Volume) * 2U) + 56U))))
|
||||
#define VOLUME_INVERT(Volume) (((Volume) == 0U) ? 100U : ((uint8_t)(((Volume) - 56U) / 2U)))
|
||||
|
||||
/**
|
||||
* @brief CS42L51 ID
|
||||
*/
|
||||
#define CS42L51_ID 0xD8U
|
||||
#define CS42L51_ID_MASK 0xF8U
|
||||
|
||||
/** @defgroup CS42L51_Exported_Macros
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup CS42L51_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
Audio Codec functions
|
||||
------------------------------------------------------------------------------*/
|
||||
/* High Layer codec functions */
|
||||
int32_t CS42L51_RegisterBusIO (CS42L51_Object_t *pObj, CS42L51_IO_t *pIO);
|
||||
int32_t CS42L51_Init(CS42L51_Object_t *pObj, CS42L51_Init_t *pInit);
|
||||
int32_t CS42L51_DeInit(CS42L51_Object_t *pObj);
|
||||
int32_t CS42L51_ReadID(CS42L51_Object_t *pObj, uint32_t *Id);
|
||||
int32_t CS42L51_Play(CS42L51_Object_t *pObj);
|
||||
int32_t CS42L51_Pause(CS42L51_Object_t *pObj);
|
||||
int32_t CS42L51_Resume(CS42L51_Object_t *pObj);
|
||||
int32_t CS42L51_Stop(CS42L51_Object_t *pObj, uint32_t CodecPdwnMode);
|
||||
int32_t CS42L51_SetVolume(CS42L51_Object_t *pObj, uint32_t InputOutput, uint8_t Volume);
|
||||
int32_t CS42L51_GetVolume(CS42L51_Object_t *pObj, uint32_t InputOutput, uint8_t *Volume);
|
||||
int32_t CS42L51_SetMute(CS42L51_Object_t *pObj, uint32_t Cmd);
|
||||
int32_t CS42L51_SetOutputMode(CS42L51_Object_t *pObj, uint32_t Output);
|
||||
int32_t CS42L51_SetResolution(CS42L51_Object_t *pObj, uint32_t Resolution);
|
||||
int32_t CS42L51_GetResolution(CS42L51_Object_t *pObj, uint32_t *Resolution);
|
||||
int32_t CS42L51_SetProtocol(CS42L51_Object_t *pObj, uint32_t Protocol);
|
||||
int32_t CS42L51_GetProtocol(CS42L51_Object_t *pObj, uint32_t *Protocol);
|
||||
int32_t CS42L51_SetFrequency(CS42L51_Object_t *pObj, uint32_t AudioFreq);
|
||||
int32_t CS42L51_GetFrequency(CS42L51_Object_t *pObj, uint32_t *AudioFreq);
|
||||
int32_t CS42L51_Reset(CS42L51_Object_t *pObj);
|
||||
|
||||
/* Audio driver structure */
|
||||
extern CS42L51_Drv_t CS42L51_Driver;
|
||||
|
||||
#endif /* CS42L51_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
@ -0,0 +1,76 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file cs42l51_reg.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides unitary register function to control the CS42L51
|
||||
* Audio Codec driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "cs42l51_reg.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup cs42l51
|
||||
* @brief This file provides a set of functions needed to drive the
|
||||
* CS42L51 audio codec.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/************** Generic Function *******************/
|
||||
/*******************************************************************************
|
||||
* Function Name : cs42l51_read_reg
|
||||
* Description : Generic Reading function. It must be fullfilled with either
|
||||
* I2C or SPI reading functions
|
||||
* Input : Register Address, length of buffer
|
||||
* Output : data Read
|
||||
*******************************************************************************/
|
||||
int32_t cs42l51_read_reg(cs42l51_ctx_t *ctx, uint16_t reg, uint8_t* data, uint16_t length)
|
||||
{
|
||||
return ctx->ReadReg(ctx->handle, reg, data, length);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : cs42l51_write_reg
|
||||
* Description : Generic Writing function. It must be fullfilled with either
|
||||
* I2C or SPI writing function
|
||||
* Input : Register Address, data to be written, length of buffer
|
||||
* Output : None
|
||||
*******************************************************************************/
|
||||
int32_t cs42l51_write_reg(cs42l51_ctx_t *ctx, uint16_t reg, uint8_t *data, uint16_t length)
|
||||
{
|
||||
return ctx->WriteReg(ctx->handle, reg, data, length);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
128
lib/main/STM32H7/Drivers/BSP/Components/cs42l51/cs42l51_reg.h
Normal file
|
@ -0,0 +1,128 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file cs42l51_reg.h
|
||||
* @author MCD Application Team
|
||||
* @brief Header of cs42l51_reg.c
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef CS42L51_REG_H
|
||||
#define CS42L51_REG_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup CS42L51
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup CS42L51_Exported_Constants CS42L51 Exported Constants
|
||||
* @{
|
||||
*/
|
||||
/******************************************************************************/
|
||||
/****************************** REGISTER MAPPING ******************************/
|
||||
/******************************************************************************/
|
||||
#define CS42L51_CHIP_ID 0x01U
|
||||
#define CS42L51_PWR_CTRL_1 0x02U
|
||||
#define CS42L51_MIC_PWR_SPEED_CTRL 0x03U
|
||||
#define CS42L51_INTERFACE_CTRL 0x04U
|
||||
#define CS42L51_MIC_CTRL 0x05U
|
||||
#define CS42L51_ADC_CTRL 0x06U
|
||||
#define CS42L51_ADCX_INPUT_SELECT 0x07U
|
||||
#define CS42L51_DAC_OUTPUT_CTRL 0x08U
|
||||
#define CS42L51_DAC_CTRL 0x09U
|
||||
#define CS42L51_ALCA_PGAA_CTRL 0x0AU
|
||||
#define CS42L51_ALCB_PGAB_CTRL 0x0BU
|
||||
#define CS42L51_ADCA_ATTENUATOR 0x0CU
|
||||
#define CS42L51_ADCB_ATTENUATOR 0x0DU
|
||||
#define CS42L51_ADCA_MIXER_VOL_CTRL 0x0EU
|
||||
#define CS42L51_ADCB_MIXER_VOL_CTRL 0x0FU
|
||||
#define CS42L51_PCMA_MIXER_VOL_CTRL 0x10U
|
||||
#define CS42L51_PCMB_MIXER_VOL_CTRL 0x11U
|
||||
#define CS42L51_BEEP_FREQ_AND_TIMING_CFG 0x12U
|
||||
#define CS42L51_BEEP_OFF_TIME_AND_VOL 0x13U
|
||||
#define CS42L51_BEEP_CFG_AND_TONE_CFG 0x14U
|
||||
#define CS42L51_TONE_CTRL 0x15U
|
||||
#define CS42L51_AOUTA_VOL_CTRL 0x16U
|
||||
#define CS42L51_AOUTB_VOL_CTRL 0x17U
|
||||
#define CS42L51_ADC_PCM_CHANNEL_MIXER 0x18U
|
||||
#define CS42L51_LIMITER_THR_SZC_DISABLE 0x19U
|
||||
#define CS42L51_LIMITER_RELEASE_RATE_REG 0x1AU
|
||||
#define CS42L51_LIMITER_ATTACK_RATE_REG 0x1BU
|
||||
#define CS42L51_ALC_ENABLE_AND_ATTACK_RATE 0x1CU
|
||||
#define CS42L51_ALC_RELEASE_RATE 0x1DU
|
||||
#define CS42L51_ALC_THR 0x1EU
|
||||
#define CS42L51_NOISE_GATE_CFG_AND_MISC 0x1FU
|
||||
#define CS42L51_STATUS 0x20U
|
||||
#define CS42L51_CHARGE_PUMP_FREQ 0x21U
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************** Generic Function *******************/
|
||||
|
||||
typedef int32_t (*CS42L51_Write_Func)(void *, uint16_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*CS42L51_Read_Func) (void *, uint16_t, uint8_t*, uint16_t);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
CS42L51_Write_Func WriteReg;
|
||||
CS42L51_Read_Func ReadReg;
|
||||
void *handle;
|
||||
} cs42l51_ctx_t;
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : Generic - All
|
||||
* Address : Generic - All
|
||||
* Bit Group Name: None
|
||||
* Permission : W
|
||||
*******************************************************************************/
|
||||
int32_t cs42l51_write_reg(cs42l51_ctx_t *ctx, uint16_t reg, uint8_t *data, uint16_t length);
|
||||
int32_t cs42l51_read_reg(cs42l51_ctx_t *ctx, uint16_t reg, uint8_t* data, uint16_t length);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CS42L51_REG_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
@ -0,0 +1,73 @@
|
|||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||
level of experience, education, socio-economic status, nationality, personal
|
||||
appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team via this [link](https://www.st.com/content/st_com/en/contact-us.html).
|
||||
All complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 1.4,
|
||||
available [here](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html).
|
||||
|
||||
For answers to common questions about this code of conduct, see the [FAQ section](https://www.contributor-covenant.org/faq).
|
|
@ -0,0 +1,40 @@
|
|||
# Contributing guide
|
||||
|
||||
This guide serves as a checklist before contributing to this repository. It mainly focuses on the steps to follow to submit an issue or a pull-request.
|
||||
|
||||
## 1. Issues
|
||||
|
||||
### 1.1 Before opening an issue
|
||||
|
||||
Please check the following points before posting an issue:
|
||||
* Make sure you are using the latest commit (major releases are tagged, but corrections are available as new commits).
|
||||
* Make sure your issue is a question/feedback/suggestions **related to** the software provided in this repository. Otherwise, please refer to section [3](CONTRIBUTING.md#3-support-requests-and-questions) below.
|
||||
* Make sure your issue is not already reported/fixed on GitHub or discussed on a previous issue. Do not forget to browse into the **closed** issues.
|
||||
|
||||
### 1.2 Posting the issue
|
||||
|
||||
When you have checked the previous points, create a new report from the **Issues** tab of this repository. A template is available [here](../../issues/new/choose) to help you report the issue you are facing or the enhancement you would like to propose.
|
||||
|
||||
## 2. Pull Requests
|
||||
|
||||
### 2.1 Before opening a pull-request
|
||||
|
||||
STMicrolectronics is happy to receive contributions from the community, based on an initial Contributor License Agreement (CLA) procedure.
|
||||
|
||||
* If you are an individual writing original source code and you are sure **you own the intellectual property**, then you need to sign an Individual [CLA](https://cla.st.com).
|
||||
* If you work for a company that wants also to allow you to contribute with your work, your company needs to provide a Corporate [CLA](https://cla.st.com) mentioning your GitHub account name.
|
||||
* If you are not sure that a CLA (Individual or Corporate) has been signed for your GitHub account you can check the [CLA](https://cla.st.com) dedicated page.
|
||||
|
||||
Please note that:
|
||||
* The Corporate CLA will always take precedence over the Individual CLA.
|
||||
* One CLA submission is sufficient, for any project proposed by STMicroelectronics.
|
||||
|
||||
### 2.2 How to proceed
|
||||
|
||||
* We recommend to engage first a communication thru an issue, in order to present your proposal, just to confirm that it corresponds to STMicroelectronics' domain or scope.
|
||||
* Then fork the project to your GitHub account to further develop your contribution. Please use the latest commit version.
|
||||
* Please, submit one pull-request per new feature or proposal. This will ease the analysis and the final merge if accepted.
|
||||
|
||||
## 3. Support requests and questions
|
||||
|
||||
For support requests or any other question related to the product, the tools, the environment, you can submit a post to the **ST Community** on the appropriate topic [page](https://community.st.com/s/topiccatalog).
|
34
lib/main/STM32H7/Drivers/BSP/Components/es_wifi/README.md
Normal file
|
@ -0,0 +1,34 @@
|
|||
# BSP STM32-ES-WIFI ES WIFI Component
|
||||
|
||||

|
||||
|
||||
## Overview
|
||||
|
||||
**STM32Cube** is an STMicroelectronics original initiative to ease developers' life by reducing efforts, time and cost.
|
||||
|
||||
**STM32Cube** covers the overall STM32 products portfolio. It includes a comprehensive embedded software platform delivered for each STM32 series.
|
||||
* The CMSIS modules (core and device) corresponding to the ARM(tm) core implemented in this STM32 product.
|
||||
* The STM32 HAL-LL drivers, an abstraction layer offering a set of APIs ensuring maximized portability across the STM32 portfolio.
|
||||
* The BSP drivers of each evaluation, demonstration or nucleo board provided for this STM32 series.
|
||||
* A consistent set of middleware libraries such as RTOS, USB, FatFS, graphics, touch sensing library...
|
||||
* A full set of software projects (basic examples, applications, and demonstrations) for each board provided for this STM32 series.
|
||||
|
||||
Two models of publication are proposed for the STM32Cube embedded software:
|
||||
* The monolithic **MCU Package**: all STM32Cube software modules of one STM32 series are present (Drivers, Middleware, Projects, Utilities) in the repository (usual name **STM32Cubexx**, xx corresponding to the STM32 series).
|
||||
* The **MCU component**: each STM32Cube software module being part of the STM32Cube MCU Package, is delivered as an individual repository, allowing the user to select and get only the required software functions.
|
||||
|
||||
## Description
|
||||
|
||||
This **stm32-es-wifi** MCU component repository is one element **common to all** STM32Cube MCU embedded software packages, providing the **ES-WIFI** BSP component part.
|
||||
|
||||
## Release note
|
||||
|
||||
Details about the content of this release are available in the release note [here](https://htmlpreview.github.io/?https://github.com/STMicroelectronics/stm32-es-wifi/blob/main/Release_Notes.html).
|
||||
|
||||
## Compatibility information
|
||||
|
||||
Please refer to the repository of the BSP **board** driver you are using to know which version of this BSP component driver to use. It is **crucial** that you use a consistent set of versions as indicated.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) guide.
|
|
@ -0,0 +1,147 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
<title>Release Notes for ES_WIFI Component Driver</title>
|
||||
<style type="text/css">
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
span.underline{text-decoration: underline;}
|
||||
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="../../../../_htmresc/mini-st.css" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-4">
|
||||
<div class="card fluid">
|
||||
<div class="sectione dark">
|
||||
<center>
|
||||
<h1 id="release-notes-for-es_wifi-component-driver"><small>Release Notes for</small> <mark>ES_WIFI Component Driver</mark></h1>
|
||||
<p>Copyright © 2017 STMicroelectronics<br />
|
||||
Microcontrollers Division - Application Team</p>
|
||||
<a href="https://www.st.com" class="logo"><img src="../../../../_htmresc/st_logo.png" alt="ST logo" /></a>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
<h1 id="license">License</h1>
|
||||
<p>Licensed by ST under BSD 3-Clause license (the "License"). You may not use this package except in compliance with the License. You may obtain a copy of the License at:</p>
|
||||
<p><a href="https://opensource.org/licenses/BSD-3-Clause">https://opensource.org/licenses/BSD-3-Clause</a></p>
|
||||
<h1 id="purpose">Purpose</h1>
|
||||
<p>This directory contains the ES_WIFI component driver.</p>
|
||||
</div>
|
||||
<div class="col-sm-12 col-lg-8">
|
||||
<h1 id="update-history">Update History</h1>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section25" checked aria-hidden="true"> <label for="collapse-section25" aria-hidden="true">V1.6.0 / 09-Apr-2020</label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Add country code definition in configuration file to allow higher WiFi channels support</li>
|
||||
<li>Replaced strtok() by strtok_r() to be thread-safe</li>
|
||||
<li>Add Sock info and Peer info functions</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section24" aria-hidden="true"> <label for="collapse-section24" aria-hidden="true">V1.5.0 / 21-Nov-2019</label>
|
||||
<div>
|
||||
<h2 id="main-changes-1">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Add partial support of new Inventek Module for Tiny Shark board</li>
|
||||
<li>Fix MISRA deviation</li>
|
||||
<li>Improve embedded TLS support API</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section23" aria-hidden="true"> <label for="collapse-section23" aria-hidden="true">V1.4.0 / 03-July-2019</label>
|
||||
<div>
|
||||
<h2 id="main-changes-2">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Set a default value to read and write time-out when non blocking</li>
|
||||
<li>Add ES_WIFI_MAX_SO_TIMEOUT</li>
|
||||
<li>Apply new template for sources</li>
|
||||
<li>New release notes format</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section22" aria-hidden="true"> <label for="collapse-section22" aria-hidden="true">V1.3.0 / 10-Sept-2018</label>
|
||||
<div>
|
||||
<h2 id="main-changes-3">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Add support of TLS connection based on internal WIFI module support</li>
|
||||
<li>Ability to list Access Point one by one from Inventek firmware version 3.5.2.5</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section20" aria-hidden="true"> <label for="collapse-section20" aria-hidden="true">V1.2.0 / 24-July-2018</label>
|
||||
<div>
|
||||
<h2 id="main-changes-4">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Add parameter to ES_WIFI_Ping() API to get the time for each ping.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section19" aria-hidden="true"> <label for="collapse-section19" aria-hidden="true">V1.1.2 / 07-June-2018</label>
|
||||
<div>
|
||||
<h2 id="main-changes-5">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Fix in UDP support along new Inventek FW versions >= C3.5.2.4.STM.RC11</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section185" aria-hidden="true"> <label for="collapse-section185" aria-hidden="true">V1.1.1 / 27-February-2018</label>
|
||||
<div>
|
||||
<h2 id="main-changes-6">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Improve TCP server command</li>
|
||||
<li>Improve Robustness on potential memory overflows</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section18" aria-hidden="true"> <label for="collapse-section18" aria-hidden="true">V1.1.0 / 05-February-2018</label>
|
||||
<div>
|
||||
<h2 id="main-changes-7">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Support for UDP sockets</li>
|
||||
<li>Spport for projects using RTOS</li>
|
||||
<li>Fix issue on never ending reads on stuffing bits</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section17" aria-hidden="true"> <label for="collapse-section17" aria-hidden="true">V1.0.1 / 31-August-2017</label>
|
||||
<div>
|
||||
<h2 id="main-changes-8">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Corrections for ES_WIFI WiFi component.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section16" aria-hidden="true"> <label for="collapse-section16" aria-hidden="true">V1.0.0 / 23-February-2017</label>
|
||||
<div>
|
||||
<h2 id="main-changes-9">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First official release of ES_WIFI WiFi component.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="sticky">
|
||||
For complete documentation on <mark>STM32 Microcontrollers</mark> , visit: <a href="http://www.st.com/STM32">http://www.st.com/STM32</a>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
31
lib/main/STM32H7/Drivers/BSP/Components/es_wifi/SECURITY.md
Normal file
|
@ -0,0 +1,31 @@
|
|||
# Report potential product security vulnerabilities
|
||||
|
||||
ST places a high priority on security, and our Product Security Incident
|
||||
Response Team (PSIRT) is committed to rapidly addressing potential security
|
||||
vulnerabilities affecting our products. PSIRT's long history and vast experience
|
||||
in security allows ST to perform clear analyses and provide appropriate guidance
|
||||
on mitigations and solutions when applicable.
|
||||
|
||||
If you wish to report potential security vulnerabilities regarding our products,
|
||||
**please do not report them through public GitHub issues.** Instead, we
|
||||
encourage you to report them to our ST PSIRT following the process described at:
|
||||
**https://www.st.com/content/st_com/en/security/report-vulnerabilities.html**
|
||||
|
||||
### IMPORTANT - READ CAREFULLY:
|
||||
|
||||
STMicroelectronics International N.V., on behalf of itself, its affiliates and
|
||||
subsidiaries, (collectively “ST”) takes all potential security vulnerability
|
||||
reports or other related communications (“Report(s)”) seriously. In order to
|
||||
review Your Report (the terms “You” and “Yours” include your employer, and all
|
||||
affiliates, subsidiaries and related persons or entities) and take actions as
|
||||
deemed appropriate, ST requires that we have the rights and Your permission to
|
||||
do so.
|
||||
|
||||
As such, by submitting Your Report to ST, You agree that You have the right to
|
||||
do so, and You grant to ST the rights to use the Report for purposes related to
|
||||
security vulnerability analysis, testing, correction, patching, reporting and
|
||||
any other related purpose or function.
|
||||
|
||||
By submitting Your Report, You agree that ST’s
|
||||
[Privacy Policy](https://www.st.com/content/st_com/en/common/privacy-portal.html)
|
||||
applies to all related communications.
|
2618
lib/main/STM32H7/Drivers/BSP/Components/es_wifi/es_wifi.c
Normal file
359
lib/main/STM32H7/Drivers/BSP/Components/es_wifi/es_wifi.h
Normal file
|
@ -0,0 +1,359 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file es_wifi.h
|
||||
* @author MCD Application Team
|
||||
* @brief header file for the es_wifi module.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2017 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef ES_WIFI_H
|
||||
#define ES_WIFI_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/*cstat -MISRAC2012-Dir-4.10 */
|
||||
#include "stdint.h"
|
||||
#include "string.h"
|
||||
#include "stdbool.h"
|
||||
#include "stdio.h"
|
||||
#include "es_wifi_conf.h"
|
||||
/*cstat +MISRAC2012-Dir-4.10 */
|
||||
|
||||
/* Exported Constants --------------------------------------------------------*/
|
||||
#define ES_WIFI_PAYLOAD_SIZE 1200
|
||||
#define ES_WIFI_MAX_SO_TIMEOUT 30000
|
||||
|
||||
typedef int8_t (*IO_Init_Func)(uint16_t );
|
||||
typedef int8_t (*IO_DeInit_Func)( void);
|
||||
typedef void (*IO_Delay_Func)(uint32_t);
|
||||
typedef int16_t (*IO_Send_Func)( uint8_t *, uint16_t len, uint32_t);
|
||||
typedef int16_t (*IO_Receive_Func)(uint8_t *, uint16_t len, uint32_t);
|
||||
|
||||
|
||||
/* Exported typedef ----------------------------------------------------------*/
|
||||
typedef enum {
|
||||
ES_WIFI_INIT = 0,
|
||||
ES_WIFI_RESET = 1
|
||||
}
|
||||
ES_WIFI_InitMode_t;
|
||||
|
||||
|
||||
typedef enum {
|
||||
ES_WIFI_STATUS_OK = 0,
|
||||
ES_WIFI_STATUS_REQ_DATA_STAGE = 1,
|
||||
ES_WIFI_STATUS_ERROR = 2,
|
||||
ES_WIFI_STATUS_TIMEOUT = 3,
|
||||
ES_WIFI_STATUS_IO_ERROR = 4,
|
||||
ES_WIFI_STATUS_UNEXPECTED_CLOSED_SOCKET = 5,
|
||||
ES_WIFI_STATUS_MODULE_CRASH = 6
|
||||
} ES_WIFI_Status_t;
|
||||
|
||||
#define ES_WIFI_ERROR_SPI_FAILED -1
|
||||
#define ES_WIFI_ERROR_WAITING_DRDY_RISING -2
|
||||
#define ES_WIFI_ERROR_WAITING_DRDY_FALLING -3
|
||||
#define ES_WIFI_ERROR_STUFFING_FOREVER -4
|
||||
#define ES_WIFI_ERROR_SPI_INIT -5
|
||||
|
||||
typedef enum {
|
||||
ES_WIFI_MODE_SINGLE = 0,
|
||||
ES_WIFI_MODE_MULTI = 1,
|
||||
} ES_WIFI_ConnMode_t;
|
||||
|
||||
typedef enum {
|
||||
ES_WIFI_TCP_CONNECTION = 0,
|
||||
ES_WIFI_UDP_CONNECTION = 1,
|
||||
ES_WIFI_UDP_LITE_CONNECTION = 2,
|
||||
ES_WIFI_TCP_SSL_CONNECTION = 3,
|
||||
ES_WIFI_MQTT_CONNECTION = 4,
|
||||
} ES_WIFI_ConnType_t;
|
||||
|
||||
/* Security settings for wifi network */
|
||||
typedef enum {
|
||||
ES_WIFI_SEC_OPEN = 0x00, /*!< Wifi is open */
|
||||
ES_WIFI_SEC_WEP = 0x01, /*!< Wired Equivalent Privacy option for wifi security. \note This mode can't be used when setting up ES_WIFI wifi */
|
||||
ES_WIFI_SEC_WPA = 0x02, /*!< Wi-Fi Protected Access */
|
||||
ES_WIFI_SEC_WPA2 = 0x03, /*!< Wi-Fi Protected Access 2 */
|
||||
ES_WIFI_SEC_WPA_WPA2= 0x04, /*!< Wi-Fi Protected Access with both modes */
|
||||
ES_WIFI_SEC_WPA2_TKIP= 0x05, /*!< Wi-Fi Protected Access with both modes */
|
||||
ES_WIFI_SEC_UNKNOWN = 0xFF, /*!< Wi-Fi Unknown Security mode */
|
||||
} ES_WIFI_SecurityType_t;
|
||||
|
||||
typedef enum {
|
||||
ES_WIFI_IPV4 = 0x00,
|
||||
ES_WIFI_IPV6 = 0x01,
|
||||
} ES_WIFI_IPVer_t;
|
||||
|
||||
typedef enum {
|
||||
ES_WIFI_AP_NONE = 0x00,
|
||||
ES_WIFI_AP_ASSIGNED = 0x01,
|
||||
ES_WIFI_AP_JOINED = 0x02,
|
||||
ES_WIFI_AP_ERROR = 0xFF,
|
||||
} ES_WIFI_APState_t;
|
||||
|
||||
typedef enum {
|
||||
ES_WIFI_FUNCTION_TLS = 0x00,
|
||||
ES_WIFI_FUNCTION_AWS = 0x01,
|
||||
} ES_WIFI_CredsFunction_t;
|
||||
|
||||
typedef enum {
|
||||
ES_WIFI_TLS_CHECK_NOTHING = 0x00,
|
||||
ES_WIFI_TLS_CHECK_ROOTCA = 0x01,
|
||||
ES_WIFI_TLS_CHECK_DEVICE_CERTS = 0x02
|
||||
} ES_WIFI_TlsCheckCertificatMode_t;
|
||||
|
||||
|
||||
#define ES_WIFI_TLS_MULTIPLE_WRITE_SLOT 3
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Port;
|
||||
uint32_t BaudRate;
|
||||
uint32_t DataWidth;
|
||||
uint32_t Parity;
|
||||
uint32_t StopBits;
|
||||
uint32_t Mode;
|
||||
} ES_WIFI_UARTConfig_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Configuration;
|
||||
uint32_t WPSPin;
|
||||
uint32_t VID;
|
||||
uint32_t PID;
|
||||
uint8_t MAC[6];
|
||||
uint8_t AP_IPAddress[4];
|
||||
uint32_t PS_Mode;
|
||||
uint32_t RadioMode;
|
||||
uint32_t CurrentBeacon;
|
||||
uint32_t PrevBeacon;
|
||||
uint32_t ProductName;
|
||||
} ES_WIFI_SystemConfig_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t* Address; /*!< Pointer to domain or IP to ping */
|
||||
uint32_t Time; /*!< Time in milliseconds needed for pinging */
|
||||
uint8_t Success; /*!< Status indicates if ping was successful */
|
||||
} ES_WIFI_Ping_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t SSID[ES_WIFI_MAX_SSID_NAME_SIZE + 1]; /*!< Service Set Identifier value.Wi-Fi spot name */
|
||||
ES_WIFI_SecurityType_t Security; /*!< Security of Wi-Fi spot. */
|
||||
int16_t RSSI; /*!< Signal strength of Wi-Fi spot */
|
||||
uint8_t MAC[6]; /*!< MAC address of spot */
|
||||
uint8_t Channel; /*!< Wi-Fi channel */
|
||||
} ES_WIFI_AP_t;
|
||||
|
||||
/* Access point configuration */
|
||||
typedef struct {
|
||||
uint8_t SSID[ES_WIFI_MAX_SSID_NAME_SIZE + 1]; /*!< Network public name for ESP AP mode */
|
||||
uint8_t Pass[ES_WIFI_MAX_PSWD_NAME_SIZE + 1]; /*!< Network password for ESP AP mode */
|
||||
ES_WIFI_SecurityType_t Security; /*!< Security of Wi-Fi access point */
|
||||
uint8_t Channel; /*!< Channel Wi-Fi is operating at */
|
||||
uint8_t MaxConnections; /*!< Max number of stations that are allowed to connect to ESP AP, between 1 and 4 */
|
||||
uint8_t Hidden; /*!< Set to 1 if network is hidden (not broadcast) or zero if visible */
|
||||
} ES_WIFI_APConfig_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t SSID[ES_WIFI_MAX_SSID_NAME_SIZE + 1]; /*!< Network public name for ESP AP mode */
|
||||
uint8_t IP_Addr[4]; /*!< IP Address */
|
||||
uint8_t MAC_Addr[6]; /*!< MAC address */
|
||||
} ES_WIFI_APSettings_t;
|
||||
|
||||
typedef struct {
|
||||
ES_WIFI_AP_t AP[ES_WIFI_MAX_DETECTED_AP];
|
||||
uint8_t nbr;
|
||||
} ES_WIFI_APs_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t SSID[ES_WIFI_MAX_SSID_NAME_SIZE + 1];
|
||||
uint8_t pswd[ES_WIFI_MAX_PSWD_NAME_SIZE + 1];
|
||||
ES_WIFI_SecurityType_t Security;
|
||||
uint8_t DHCP_IsEnabled;
|
||||
uint8_t JoinRetries;
|
||||
uint8_t IsConnected;
|
||||
uint8_t AutoConnect;
|
||||
ES_WIFI_IPVer_t IP_Ver;
|
||||
uint8_t IP_Addr[4];
|
||||
uint8_t IP_Mask[4];
|
||||
uint8_t Gateway_Addr[4];
|
||||
uint8_t DNS1[4];
|
||||
uint8_t DNS2[4];
|
||||
} ES_WIFI_Network_t;
|
||||
|
||||
typedef struct {
|
||||
ES_WIFI_ConnType_t Protocol;
|
||||
uint8_t Local_IP_Addr[4];
|
||||
uint16_t Local_Port;
|
||||
uint8_t Remote_IP_Addr[4];
|
||||
uint16_t Remote_Port;
|
||||
uint8_t TCP_Server;
|
||||
uint8_t UDP_Server;
|
||||
uint8_t TCP_Backlogs;
|
||||
uint8_t Accept_Loop;
|
||||
uint8_t Read_Mode;
|
||||
} ES_WIFI_Transport_t;
|
||||
|
||||
#if (ES_WIFI_USE_AWS == 1)
|
||||
typedef struct {
|
||||
ES_WIFI_ConnType_t Type;
|
||||
uint8_t Number;
|
||||
uint16_t RemotePort;
|
||||
uint8_t RemoteIP[4];
|
||||
uint8_t *PublishTopic;
|
||||
uint8_t *SubscribeTopic;
|
||||
uint8_t *ClientID;
|
||||
uint8_t MQTTMode;
|
||||
} ES_WIFI_AWS_Conn_t;
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
ES_WIFI_ConnType_t Type;
|
||||
ES_WIFI_TlsCheckCertificatMode_t TLScheckMode;
|
||||
uint8_t Number;
|
||||
uint16_t RemotePort;
|
||||
uint16_t LocalPort;
|
||||
uint8_t RemoteIP[4];
|
||||
char* Name;
|
||||
uint8_t Backlog;
|
||||
} ES_WIFI_Conn_t;
|
||||
|
||||
typedef struct {
|
||||
IO_Init_Func IO_Init;
|
||||
IO_DeInit_Func IO_DeInit;
|
||||
IO_Delay_Func IO_Delay;
|
||||
IO_Send_Func IO_Send;
|
||||
IO_Receive_Func IO_Receive;
|
||||
} ES_WIFI_IO_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t Product_ID[ES_WIFI_PRODUCT_ID_SIZE];
|
||||
uint8_t FW_Rev[ES_WIFI_FW_REV_SIZE];
|
||||
uint8_t API_Rev[ES_WIFI_API_REV_SIZE];
|
||||
uint8_t Stack_Rev[ES_WIFI_STACK_REV_SIZE];
|
||||
uint8_t RTOS_Rev[ES_WIFI_RTOS_REV_SIZE];
|
||||
uint8_t Product_Name[ES_WIFI_PRODUCT_NAME_SIZE];
|
||||
uint32_t CPU_Clock;
|
||||
ES_WIFI_SecurityType_t Security;
|
||||
ES_WIFI_Network_t NetSettings;
|
||||
ES_WIFI_APSettings_t APSettings;
|
||||
ES_WIFI_IO_t fops;
|
||||
uint8_t CmdData[ES_WIFI_DATA_SIZE];
|
||||
uint32_t Timeout;
|
||||
uint32_t BufferSize;
|
||||
} ES_WIFIObject_t;
|
||||
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
ES_WIFI_Status_t ES_WIFI_Init(ES_WIFIObject_t *Obj);
|
||||
ES_WIFI_Status_t ES_WIFI_DeInit(ES_WIFIObject_t *Obj);
|
||||
ES_WIFI_Status_t ES_WIFI_SetTimeout(ES_WIFIObject_t *Obj, uint32_t Timeout);
|
||||
ES_WIFI_Status_t ES_WIFI_ListAccessPoints(ES_WIFIObject_t *Obj, ES_WIFI_APs_t *APs);
|
||||
ES_WIFI_Status_t ES_WIFI_Connect(ES_WIFIObject_t *Obj, const char* SSID, const char* Password,
|
||||
ES_WIFI_SecurityType_t SecType);
|
||||
ES_WIFI_Status_t ES_WIFI_Disconnect(ES_WIFIObject_t *Obj);
|
||||
uint8_t ES_WIFI_IsConnected(ES_WIFIObject_t *Obj);
|
||||
ES_WIFI_Status_t ES_WIFI_GetNetworkSettings(ES_WIFIObject_t *Obj);
|
||||
ES_WIFI_Status_t ES_WIFI_GetMACAddress(ES_WIFIObject_t *Obj, uint8_t *mac);
|
||||
ES_WIFI_Status_t ES_WIFI_GetIPAddress(ES_WIFIObject_t *Obj, uint8_t *ipaddr);
|
||||
ES_WIFI_Status_t ES_WIFI_GetProductID(ES_WIFIObject_t *Obj, uint8_t *productID);
|
||||
ES_WIFI_Status_t ES_WIFI_GetFWRevID(ES_WIFIObject_t *Obj, uint8_t *FWRev);
|
||||
ES_WIFI_Status_t ES_WIFI_GetRTOSRev(ES_WIFIObject_t *Obj, uint8_t *RTOSRev);
|
||||
ES_WIFI_Status_t ES_WIFI_GetProductName(ES_WIFIObject_t *Obj, uint8_t *productName);
|
||||
ES_WIFI_Status_t ES_WIFI_GetAPIRev(ES_WIFIObject_t *Obj, uint8_t *APIRev);
|
||||
ES_WIFI_Status_t ES_WIFI_GetStackRev(ES_WIFIObject_t *Obj, uint8_t *StackRev);
|
||||
|
||||
|
||||
ES_WIFI_Status_t ES_WIFI_SetMACAddress(ES_WIFIObject_t *Obj, uint8_t *mac);
|
||||
ES_WIFI_Status_t ES_WIFI_ResetToFactoryDefault(ES_WIFIObject_t *Obj);
|
||||
ES_WIFI_Status_t ES_WIFI_ResetModule(ES_WIFIObject_t *Obj);
|
||||
ES_WIFI_Status_t ES_WIFI_HardResetModule(ES_WIFIObject_t *Obj);
|
||||
ES_WIFI_Status_t ES_WIFI_SetProductName(ES_WIFIObject_t *Obj, uint8_t *ProductName);
|
||||
#if (ES_WIFI_USE_PING == 1)
|
||||
ES_WIFI_Status_t ES_WIFI_Ping(ES_WIFIObject_t *Obj, uint8_t *address, uint16_t count, uint16_t interval_ms, int32_t res[]);
|
||||
#endif
|
||||
ES_WIFI_Status_t ES_WIFI_DNS_LookUp(ES_WIFIObject_t *Obj, const char *url, uint8_t *ipaddress);
|
||||
ES_WIFI_Status_t ES_WIFI_StartClientConnection(ES_WIFIObject_t *Obj, ES_WIFI_Conn_t *conn);
|
||||
ES_WIFI_Status_t ES_WIFI_StopClientConnection(ES_WIFIObject_t *Obj, ES_WIFI_Conn_t *conn);
|
||||
#if (ES_WIFI_USE_AWS == 1)
|
||||
ES_WIFI_Status_t ES_WIFI_StartAWSClientConnection(ES_WIFIObject_t *Obj, ES_WIFI_AWS_Conn_t *conn);
|
||||
#endif
|
||||
ES_WIFI_Status_t ES_WIFI_StartServerSingleConn(ES_WIFIObject_t *Obj, ES_WIFI_Conn_t *conn);
|
||||
ES_WIFI_Status_t ES_WIFI_WaitServerConnection(ES_WIFIObject_t *Obj,uint32_t Timeout,ES_WIFI_Conn_t *con);
|
||||
ES_WIFI_Status_t ES_WIFI_CloseServerConnection(ES_WIFIObject_t *Obj,int socket);
|
||||
ES_WIFI_Status_t ES_WIFI_StopServerSingleConn(ES_WIFIObject_t *Obj, int socket);
|
||||
|
||||
|
||||
ES_WIFI_Status_t ES_WIFI_StartServerMultiConn(ES_WIFIObject_t *Obj, ES_WIFI_Conn_t *conn);
|
||||
ES_WIFI_Status_t ES_WIFI_StopServerMultiConn(ES_WIFIObject_t *Obj);
|
||||
ES_WIFI_Status_t ES_WIFI_SendData(ES_WIFIObject_t *Obj, uint8_t Socket, uint8_t *pdata, uint16_t Reqlen , uint16_t *SentLen, uint32_t Timeout);
|
||||
ES_WIFI_Status_t ES_WIFI_SendDataTo(ES_WIFIObject_t *Obj, uint8_t Socket, uint8_t *pdata, uint16_t Reqlen , uint16_t *SentLen, uint32_t Timeout, uint8_t *IPaddr, uint16_t Port);
|
||||
ES_WIFI_Status_t ES_WIFI_ReceiveData(ES_WIFIObject_t *Obj, uint8_t Socket, uint8_t *pdata, uint16_t Reqlen, uint16_t *Receivedlen, uint32_t Timeout);
|
||||
ES_WIFI_Status_t ES_WIFI_ReceiveDataFrom(ES_WIFIObject_t *Obj, uint8_t Socket, uint8_t *pdata, uint16_t Reqlen, uint16_t *Receivedlen, uint32_t Timeout, uint8_t *IPaddr, uint16_t *pPort);
|
||||
ES_WIFI_Status_t ES_WIFI_ActivateAP(ES_WIFIObject_t *Obj, ES_WIFI_APConfig_t *ApConfig);
|
||||
ES_WIFI_APState_t ES_WIFI_WaitAPStateChange(ES_WIFIObject_t *Obj);
|
||||
ES_WIFI_Status_t ES_WIFI_PeerInfo(ES_WIFIObject_t *Obj, uint8_t Socket, uint8_t *IPaddr, uint16_t *pPort);
|
||||
ES_WIFI_Status_t ES_WIFI_SockInfo(ES_WIFIObject_t *Obj, uint8_t Socket, uint8_t *IPaddr, uint16_t *pPort);
|
||||
|
||||
#if (ES_WIFI_USE_FIRMWAREUPDATE == 1)
|
||||
ES_WIFI_Status_t ES_WIFI_OTA_Upgrade(ES_WIFIObject_t *Obj, uint8_t *link);
|
||||
#endif
|
||||
|
||||
#if (ES_WIFI_USE_UART == 1)
|
||||
ES_WIFI_Status_t ES_WIFI_SetUARTBaudRate(ES_WIFIObject_t *Obj, uint16_t BaudRate);
|
||||
ES_WIFI_Status_t ES_WIFI_GetUARTConfig(ES_WIFIObject_t *Obj, ES_WIFI_UARTConfig_t *pconf);
|
||||
#endif
|
||||
|
||||
ES_WIFI_Status_t ES_WIFI_GetSystemConfig(ES_WIFIObject_t *Obj, ES_WIFI_SystemConfig_t *pconf);
|
||||
|
||||
ES_WIFI_Status_t ES_WIFI_RegisterBusIO(ES_WIFIObject_t *Obj, IO_Init_Func IO_Init,
|
||||
IO_DeInit_Func IO_DeInit,
|
||||
IO_Delay_Func IO_Delay,
|
||||
IO_Send_Func IO_Send,
|
||||
IO_Receive_Func IO_Receive);
|
||||
|
||||
ES_WIFI_Status_t ES_WIFI_StoreCreds( ES_WIFIObject_t *Obj,
|
||||
ES_WIFI_CredsFunction_t credsFunction, uint8_t credSet,
|
||||
uint8_t* ca, uint16_t caLength,
|
||||
uint8_t* certificate, uint16_t certificateLength,
|
||||
uint8_t* key, uint16_t keyLength );
|
||||
|
||||
ES_WIFI_Status_t ES_WIFI_StoreCA( ES_WIFIObject_t *Obj,
|
||||
ES_WIFI_CredsFunction_t credsFunction,
|
||||
uint8_t credSet,
|
||||
uint8_t* ca,
|
||||
uint16_t caLength );
|
||||
|
||||
ES_WIFI_Status_t ES_WIFI_StoreCertificate( ES_WIFIObject_t *Obj,
|
||||
ES_WIFI_CredsFunction_t credsFunction,
|
||||
uint8_t credSet,
|
||||
uint8_t* certificate,
|
||||
uint16_t certificateLength );
|
||||
|
||||
ES_WIFI_Status_t ES_WIFI_StoreKey( ES_WIFIObject_t *Obj,
|
||||
ES_WIFI_CredsFunction_t credsFunction,
|
||||
uint8_t credSet,
|
||||
uint8_t* key,
|
||||
uint16_t keyLength );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ES_WIFI_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
@ -0,0 +1,91 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file es_wifi_conf.h
|
||||
* @author MCD Application Team
|
||||
* @brief ES_WIFI configuration.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2017 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef ES_WIFI_CONF_H
|
||||
#define ES_WIFI_CONF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//#define WIFI_USE_CMSIS_OS
|
||||
|
||||
#ifdef WIFI_USE_CMSIS_OS
|
||||
#include "cmsis_os.h"
|
||||
extern osMutexId es_wifi_mutex;
|
||||
|
||||
#define LOCK_SPI() osMutexWait(spi_mutex, 0)
|
||||
#define UNLOCK_SPI() osMutexRelease(spi_mutex)
|
||||
|
||||
#define LOCK_WIFI() osMutexWait(es_wifi_mutex, 0)
|
||||
#define UNLOCK_WIFI() osMutexRelease(es_wifi_mutex)
|
||||
|
||||
#define SEM_SIGNAL(a) osSemaphoreRelease(a)
|
||||
#define SEM_WAIT(a,timeout) osSemaphoreWait(a,timeout)
|
||||
|
||||
#else /* WIFI_USE_CMSIS_OS */
|
||||
|
||||
#define LOCK_SPI()
|
||||
#define LOCK_WIFI()
|
||||
#define UNLOCK_SPI()
|
||||
#define UNLOCK_WIFI()
|
||||
#define SEM_SIGNAL(a)
|
||||
#endif /* WIFI_USE_CMSIS_OS */
|
||||
|
||||
|
||||
#define ES_WIFI_MAX_SSID_NAME_SIZE 32
|
||||
#define ES_WIFI_MAX_PSWD_NAME_SIZE 32
|
||||
#define ES_WIFI_PRODUCT_ID_SIZE 32
|
||||
#define ES_WIFI_PRODUCT_NAME_SIZE 32
|
||||
#define ES_WIFI_FW_REV_SIZE 24
|
||||
#define ES_WIFI_API_REV_SIZE 16
|
||||
#define ES_WIFI_STACK_REV_SIZE 16
|
||||
#define ES_WIFI_RTOS_REV_SIZE 16
|
||||
|
||||
#define ES_WIFI_DATA_SIZE 1400
|
||||
#define ES_WIFI_MAX_DETECTED_AP 10
|
||||
|
||||
#define ES_WIFI_TIMEOUT 0xFFFF
|
||||
|
||||
#define ES_WIFI_USE_PING 1
|
||||
#define ES_WIFI_USE_AWS 0
|
||||
#define ES_WIFI_USE_FIRMWAREUPDATE 0
|
||||
#define ES_WIFI_USE_WPS 0
|
||||
|
||||
#define ES_WIFI_USE_SPI 0
|
||||
#define ES_WIFI_USE_UART (!ES_WIFI_USE_SPI)
|
||||
|
||||
/* Definitions of Country codes for "CN" AT command */
|
||||
/* Allows to change WiFi channels range */
|
||||
#define ES_WIFI_COUNTRY_FR "FR/0" /* allows WiFi channels 1-13 */
|
||||
#define ES_WIFI_COUNTRY_JP "JP/0" /* allows WiFi channels 1-14 (channel 14 low power) */
|
||||
#define ES_WIFI_COUNTRY_CA "CA/0" /* allows WiFi channels 1-12 (channel 12 low power) */
|
||||
#define ES_WIFI_COUNTRY_US "US/0" /* allows WiFi channels 1-11 (set by default) */
|
||||
/* define ES_WIFI_COUNTRY to one of ES_WIFI_COUNTRY_FR, ES_WIFI_COUNTRY_JP, ... */
|
||||
/* define it only if country is not US (US is the default setting) */
|
||||
/* #define ES_WIFI_COUNTRY ES_WIFI_COUNTRY_FR */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ES_WIFI_CONF_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
@ -0,0 +1,114 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
<title>Release Notes for EXC7200 Component Driver</title>
|
||||
<style type="text/css">
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
span.underline{text-decoration: underline;}
|
||||
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="_htmresc/mini-st.css" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-4">
|
||||
<div class="card fluid">
|
||||
<div class="sectione dark">
|
||||
<center>
|
||||
<h1 id="release-notes-for-exc7200-component-driver"><strong>Release Notes for EXC7200 Component Driver</strong></h1>
|
||||
<p>Copyright © 2015 STMicroelectronics<br />
|
||||
</p>
|
||||
<a href="https://www.st.com" class="logo"><img src="_htmresc/st_logo.png" alt="ST logo" /></a>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
<h1 id="license">License</h1>
|
||||
This software component is licensed by ST under BSD 3-Clause license, the “License”; You may not use this component except in compliance with the License. You may obtain a copy of the License at:
|
||||
<center>
|
||||
<a href="https://opensource.org/licenses/BSD-3-Clause">https://opensource.org/licenses/BSD-3-Clause</a>
|
||||
</center>
|
||||
<h1 id="purpose">Purpose</h1>
|
||||
<p>This driver provides a set of audio functions offered by EXC7200 TS component</p>
|
||||
</div>
|
||||
<div class="col-sm-12 col-lg-8">
|
||||
<h1 id="update-history">Update History</h1>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section5" checked aria-hidden="true"> <label for="collapse-section5" aria-hidden="true"><strong>V2.0.1 / 23-November-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Update st_logo.png inclusion path in Release notes</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section4" checked aria-hidden="true"> <label for="collapse-section4" aria-hidden="true"><strong>V2.0.0 / 14-October-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-1">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First Official release of EXC7200 BSP drivers in line with STM32Cube BSP drivers development guidelines (UM2298)</li>
|
||||
<li>The component drivers are composed of
|
||||
<ul>
|
||||
<li>component core drivers files: exc7200.h/.c</li>
|
||||
<li>component register drivers files: exc7200_reg.h/.c</li>
|
||||
<li>component configuration files: exc7200_conf_template.h</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<h2 id="backward-compatibility">Backward Compatibility</h2>
|
||||
<ul>
|
||||
<li>This version breaks the compatibility with previous versions</li>
|
||||
</ul>
|
||||
<h2 id="dependencies">Dependencies</h2>
|
||||
<ul>
|
||||
<li><p>This software release is compatible with:</p>
|
||||
<ul>
|
||||
<li>BSP Common v6.0.1 or above</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true"> <label for="collapse-section3" aria-hidden="true"><strong>V1.0.2 / 07-April-2017</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-2">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Update comments to be used for PDSC generation</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true"> <label for="collapse-section2" aria-hidden="true"><strong>V1.0.1 / 21-September-2015</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-3">Main Changes</h2>
|
||||
<ul>
|
||||
<li>exc7200.c:
|
||||
<ul>
|
||||
<li>Update the I2C slave read address within exc7200_TS_DetectTouch() function.</li>
|
||||
<li>Update exc7200_TS_GetXY() function to return correct Touch Screen positions.</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true"> <label for="collapse-section1" aria-hidden="true"><strong>V1.0.0 / 28-April-2015</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-4">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First official release of <strong>EXC7200</strong> Toush Screen Component drivers</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="sticky">
|
||||
For complete documentation on <mark>STM32 Microcontrollers</mark> , visit: <span style="font-color: blue;"><a href="http://www.st.com/STM32">www.st.com</a></span>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
119
lib/main/STM32H7/Drivers/BSP/Components/exc7200/Release_Notes.md
Normal file
|
@ -0,0 +1,119 @@
|
|||
---
|
||||
pagetitle: Release Notes for EXC7200 Component Driver
|
||||
lang: en
|
||||
---
|
||||
|
||||
::: {.row}
|
||||
::: {.col-sm-12 .col-lg-4}
|
||||
|
||||
::: {.card .fluid}
|
||||
::: {.sectione .dark}
|
||||
<center>
|
||||
# **Release Notes for EXC7200 Component Driver**
|
||||
Copyright © 2015 STMicroelectronics\
|
||||
|
||||
[](https://www.st.com){.logo}
|
||||
</center>
|
||||
:::
|
||||
:::
|
||||
|
||||
# License
|
||||
|
||||
This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this component except in
|
||||
compliance with the License. You may obtain a copy of the License at:
|
||||
<center>
|
||||
[https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause)
|
||||
</center>
|
||||
|
||||
# Purpose
|
||||
|
||||
This driver provides a set of audio functions offered by EXC7200 TS component
|
||||
|
||||
:::
|
||||
|
||||
::: {.col-sm-12 .col-lg-8}
|
||||
# Update History
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section5" checked aria-hidden="true">
|
||||
<label for="collapse-section5" aria-hidden="true">__V2.0.1 / 23-November-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update st_logo.png inclusion path in Release notes
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section4" checked aria-hidden="true">
|
||||
<label for="collapse-section4" aria-hidden="true">__V2.0.0 / 14-October-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- First Official release of EXC7200 BSP drivers in line with STM32Cube BSP drivers development guidelines (UM2298)
|
||||
- The component drivers are composed of
|
||||
- component core drivers files: exc7200.h/.c
|
||||
- component register drivers files: exc7200_reg.h/.c
|
||||
- component configuration files: exc7200_conf_template.h
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
- This version breaks the compatibility with previous versions
|
||||
|
||||
## Dependencies
|
||||
|
||||
- This software release is compatible with:
|
||||
|
||||
- BSP Common v6.0.1 or above
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true">
|
||||
<label for="collapse-section3" aria-hidden="true">__V1.0.2 / 07-April-2017__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update comments to be used for PDSC generation
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true">
|
||||
<label for="collapse-section2" aria-hidden="true">__V1.0.1 / 21-September-2015__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- exc7200.c:
|
||||
- Update the I2C slave read address within exc7200_TS_DetectTouch() function.
|
||||
- Update exc7200_TS_GetXY() function to return correct Touch Screen positions.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true">
|
||||
<label for="collapse-section1" aria-hidden="true">__V1.0.0 / 28-April-2015__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- First official release of **EXC7200** Toush Screen Component drivers
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
:::
|
||||
:::
|
||||
|
||||
<footer class="sticky">
|
||||
For complete documentation on <mark>STM32 Microcontrollers</mark> ,
|
||||
visit: [[www.st.com](http://www.st.com/STM32)]{style="font-color: blue;"}
|
||||
</footer>
|
1700
lib/main/STM32H7/Drivers/BSP/Components/exc7200/_htmresc/mini-st.css
Normal file
After Width: | Height: | Size: 18 KiB |
408
lib/main/STM32H7/Drivers/BSP/Components/exc7200/exc7200.c
Normal file
|
@ -0,0 +1,408 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file exc7200.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides a set of functions needed to manage the EXC7200
|
||||
* IO Expander devices.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2015 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "exc7200.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup EXC7200 EXC7200
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
/** @defgroup EXC7200_Exported_Variables EXC7200 Exported Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Touch screen driver structure initialization */
|
||||
EXC7200_TS_Drv_t EXC7200_TS_Driver =
|
||||
{
|
||||
EXC7200_Init,
|
||||
EXC7200_DeInit,
|
||||
EXC7200_GestureConfig,
|
||||
EXC7200_ReadID,
|
||||
EXC7200_GetState,
|
||||
EXC7200_GetMultiTouchState,
|
||||
EXC7200_GetGesture,
|
||||
EXC7200_GetCapabilities,
|
||||
EXC7200_EnableIT,
|
||||
EXC7200_DisableIT,
|
||||
EXC7200_ClearIT,
|
||||
EXC7200_ITStatus
|
||||
};
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup EXC7200_Private_Function_Prototypes EXC7200 Private Function Prototypes
|
||||
* @{
|
||||
*/
|
||||
static int32_t EXC7200_DetectTouch(EXC7200_Object_t *pObj, uint8_t *pData, uint32_t Length);
|
||||
static int32_t ReadRegWrap(void *handle, uint8_t Reg, uint8_t* Data, uint16_t Length);
|
||||
static int32_t WriteRegWrap(void *handle, uint8_t Reg, uint8_t* Data, uint16_t Length);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup EXC7200_Exported_Functions EXC7200 Exported Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Register IO bus to component object
|
||||
* @param Component object pointer
|
||||
* @retval error status
|
||||
*/
|
||||
int32_t EXC7200_RegisterBusIO (EXC7200_Object_t *pObj, EXC7200_IO_t *pIO)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
if (pObj == NULL)
|
||||
{
|
||||
ret = EXC7200_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
pObj->IO.Init = pIO->Init;
|
||||
pObj->IO.DeInit = pIO->DeInit;
|
||||
pObj->IO.Address = pIO->Address;
|
||||
pObj->IO.WriteReg = pIO->WriteReg;
|
||||
pObj->IO.ReadReg = pIO->ReadReg;
|
||||
pObj->IO.GetTick = pIO->GetTick;
|
||||
|
||||
pObj->Ctx.ReadReg = ReadRegWrap;
|
||||
pObj->Ctx.WriteReg = WriteRegWrap;
|
||||
pObj->Ctx.handle = pObj;
|
||||
|
||||
if(pObj->IO.Init != NULL)
|
||||
{
|
||||
ret = pObj->IO.Init();
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = EXC7200_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get EXC7200 sensor capabilities
|
||||
* @param pObj Component object pointer
|
||||
* @param Capabilities pointer to EXC7200 sensor capabilities
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t EXC7200_GetCapabilities(EXC7200_Object_t *pObj, EXC7200_Capabilities_t *Capabilities)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
(void)(pObj);
|
||||
|
||||
/* Store component's capabilities */
|
||||
Capabilities->MultiTouch = 0;
|
||||
Capabilities->Gesture = 0;
|
||||
Capabilities->MaxTouch = EXC7200_MAX_NB_TOUCH;
|
||||
Capabilities->MaxXl = EXC7200_MAX_X_LENGTH;
|
||||
Capabilities->MaxYl = EXC7200_MAX_Y_LENGTH;
|
||||
|
||||
return EXC7200_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initialize the EXC7200 communication bus
|
||||
* from MCU to EXC7200 : ie I2C channel initialization (if required).
|
||||
* @param pObj Component object pointer
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t EXC7200_Init(EXC7200_Object_t *pObj)
|
||||
{
|
||||
int32_t ret = EXC7200_OK;
|
||||
|
||||
if(pObj->IsInitialized == 0U)
|
||||
{
|
||||
/* Initialize IO BUS layer */
|
||||
if(pObj->IO.Init() != EXC7200_OK)
|
||||
{
|
||||
ret = EXC7200_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
pObj->IsInitialized = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief De-Initialize the EXC7200 communication bus
|
||||
* from MCU to EXC7200 : ie I2C channel initialization (if required).
|
||||
* @param pObj Component object pointer
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t EXC7200_DeInit(EXC7200_Object_t *pObj)
|
||||
{
|
||||
int32_t ret = EXC7200_OK;
|
||||
|
||||
if(pObj->IsInitialized == 1U)
|
||||
{
|
||||
if(pObj->IO.DeInit() != EXC7200_OK)
|
||||
{
|
||||
ret = EXC7200_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
pObj->IsInitialized = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure the EXC7200 gesture
|
||||
* from MCU to EXC7200 : ie I2C channel initialization (if required).
|
||||
* @param pObj Component object pointer
|
||||
* @param GestureInit Gesture init structure
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t EXC7200_GestureConfig(EXC7200_Object_t *pObj, EXC7200_Gesture_Init_t *GestureInit)
|
||||
{
|
||||
/* Feature not supported */
|
||||
return EXC7200_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read the EXC7200 device ID, pre initialize I2C in case of need to be
|
||||
* able to read the EXC7200 device ID, and verify this is a EXC7200.
|
||||
* @param pObj Component object pointer
|
||||
* @param Id Pointer to component ID value
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t EXC7200_ReadID(EXC7200_Object_t *pObj, uint32_t *Id)
|
||||
{
|
||||
int32_t ret = EXC7200_ERROR;
|
||||
uint8_t data;
|
||||
|
||||
if(exc7200_read_reg(&pObj->Ctx, EXC7200_READ_REG, &data, 1) == EXC7200_OK)
|
||||
{
|
||||
*Id = EXC7200_ID;
|
||||
ret = EXC7200_OK;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the touch screen X and Y positions values
|
||||
* @param pObj Component object pointer
|
||||
* @param State Single Touch stucture pointer
|
||||
* @retval Component status.
|
||||
*/
|
||||
int32_t EXC7200_GetState(EXC7200_Object_t *pObj, EXC7200_State_t *State)
|
||||
{
|
||||
uint8_t data[10];
|
||||
|
||||
State->TouchDetected = (uint32_t)EXC7200_DetectTouch(pObj, data, (uint32_t)sizeof(data));
|
||||
|
||||
/* Send back first ready X position to caller */
|
||||
State->TouchX = (((data[3]&0x00ff) << 4) | ((data[2]&0x00f0) >> 4)) << 1;
|
||||
/* Send back first ready Y position to caller */
|
||||
State->TouchY = (((data[5]&0x00ff) << 4) | ((data[4]&0x00f0) >> 4)) << 1;
|
||||
|
||||
/* Dummy Read to deactivate read mode */
|
||||
(void)EXC7200_DetectTouch(pObj, data, (uint32_t)sizeof(data));
|
||||
|
||||
return EXC7200_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the touch screen Xn and Yn positions values in multi-touch mode
|
||||
* @param pObj Component object pointer
|
||||
* @param State Multi Touch stucture pointer
|
||||
* @retval Component status.
|
||||
*/
|
||||
int32_t EXC7200_GetMultiTouchState(EXC7200_Object_t *pObj, EXC7200_MultiTouch_State_t *State)
|
||||
{
|
||||
/* Feature not supported */
|
||||
return EXC7200_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get Gesture ID
|
||||
* @param pObj Component object pointer
|
||||
* @param GestureId gesture ID
|
||||
* @retval Component status.
|
||||
*/
|
||||
int32_t EXC7200_GetGesture(EXC7200_Object_t *pObj, uint8_t *GestureId)
|
||||
{
|
||||
/* Feature not supported */
|
||||
return EXC7200_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure the EXC7200 device to generate IT on given INT pin
|
||||
* connected to MCU as EXTI.
|
||||
* @param pObj Component object pointer
|
||||
* @retval Component status.
|
||||
*/
|
||||
int32_t EXC7200_EnableIT(EXC7200_Object_t *pObj)
|
||||
{
|
||||
/* Feature not supported */
|
||||
return EXC7200_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure the EXC7200 device to stop generating IT on the given INT pin
|
||||
* connected to MCU as EXTI.
|
||||
* @param pObj Component object pointer
|
||||
* @retval Component status.
|
||||
*/
|
||||
int32_t EXC7200_DisableIT(EXC7200_Object_t *pObj)
|
||||
{
|
||||
/* Feature not supported */
|
||||
return EXC7200_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get IT status from EXC7200 interrupt status registers
|
||||
* Should be called Following an EXTI coming to the MCU to know the detailed
|
||||
* reason of the interrupt.
|
||||
* @note : This feature is not applicable to EXC7200.
|
||||
* @param pObj Component object pointer
|
||||
* @retval Component status.
|
||||
*/
|
||||
int32_t EXC7200_ITStatus(EXC7200_Object_t *pObj)
|
||||
{
|
||||
/* Feature not supported */
|
||||
return EXC7200_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear IT status in EXC7200 interrupt status clear registers
|
||||
* Should be called Following an EXTI coming to the MCU.
|
||||
* @note : This feature is not applicable to EXC7200.
|
||||
* @param pObj Component object pointer
|
||||
* @retval Component status.
|
||||
*/
|
||||
int32_t EXC7200_ClearIT(EXC7200_Object_t *pObj)
|
||||
{
|
||||
/* Feature not supported */
|
||||
return EXC7200_ERROR;
|
||||
}
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup EXC7200_Private_Functions EXC7200 Private Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Return if there is touches detected or not.
|
||||
* Get the touch screen X and Y positions values
|
||||
* @param pObj Component object pointer
|
||||
* @param pData Pointer to data buffer
|
||||
* @param Length Number of data to read
|
||||
* @retval Number of active touches detected (can be 0 or 1) or EXC7200_ERROR
|
||||
* in case of error
|
||||
*/
|
||||
static int32_t EXC7200_DetectTouch(EXC7200_Object_t *pObj, uint8_t *pData, uint32_t Length)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
/* Read TS data */
|
||||
if(exc7200_read_reg(&pObj->Ctx, EXC7200_READ_REG, pData, Length) != EXC7200_OK)
|
||||
{
|
||||
ret = EXC7200_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(pData[1] == 0x83U)
|
||||
{
|
||||
/* Touch detected */
|
||||
ret = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* If invalid number of touch detected, set it to zero */
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Wrap IO bus read function to component register red function
|
||||
* @param handle Component object handle
|
||||
* @param Reg The target register address to read
|
||||
* @param pData The target register value to be read
|
||||
* @param Length buffer size to be read
|
||||
* @retval Component status.
|
||||
*/
|
||||
static int32_t ReadRegWrap(void *handle, uint8_t Reg, uint8_t* pData, uint16_t Length)
|
||||
{
|
||||
EXC7200_Object_t *pObj = (EXC7200_Object_t *)handle;
|
||||
|
||||
return pObj->IO.ReadReg(pObj->IO.Address, Reg, pData, Length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Wrap IO bus write function to component register write function
|
||||
* @param handle Component object handle
|
||||
* @param Reg The target register address to write
|
||||
* @param pData The target register value to be written
|
||||
* @param Length buffer size to be written
|
||||
* @retval Component status.
|
||||
*/
|
||||
static int32_t WriteRegWrap(void *handle, uint8_t Reg, uint8_t* pData, uint16_t Length)
|
||||
{
|
||||
EXC7200_Object_t *pObj = (EXC7200_Object_t *)handle;
|
||||
|
||||
return pObj->IO.WriteReg(pObj->IO.Address, Reg, pData, Length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
191
lib/main/STM32H7/Drivers/BSP/Components/exc7200/exc7200.h
Normal file
|
@ -0,0 +1,191 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file exc7200.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the
|
||||
* exc7200.c IO expander driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2015 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef EXC7200_H
|
||||
#define EXC7200_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "exc7200_reg.h"
|
||||
#include <stddef.h>
|
||||
#include "exc7200_conf.h"
|
||||
|
||||
/* Macros --------------------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup EXC7200
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup EXC7200_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
#define EXC7200_OK (0)
|
||||
#define EXC7200_ERROR (-1)
|
||||
|
||||
/* Max detectable simultaneous touches */
|
||||
#define EXC7200_MAX_NB_TOUCH 1U
|
||||
|
||||
/* Touch EXC7200 IDs */
|
||||
#define EXC7200_ID 0x7200U
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup EXC7200_Exported_Types EXC7200 Exported Types
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Radian;
|
||||
uint32_t OffsetLeftRight;
|
||||
uint32_t OffsetUpDown;
|
||||
uint32_t DistanceLeftRight;
|
||||
uint32_t DistanceUpDown;
|
||||
uint32_t DistanceZoom;
|
||||
}EXC7200_Gesture_Init_t;
|
||||
|
||||
typedef int32_t (*EXC7200_Init_Func) (void);
|
||||
typedef int32_t (*EXC7200_DeInit_Func) (void);
|
||||
typedef int32_t (*EXC7200_GetTick_Func) (void);
|
||||
typedef int32_t (*EXC7200_Delay_Func) (uint32_t);
|
||||
typedef int32_t (*EXC7200_WriteReg_Func)(uint16_t, uint16_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*EXC7200_ReadReg_Func) (uint16_t, uint16_t, uint8_t*, uint16_t);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
EXC7200_Init_Func Init;
|
||||
EXC7200_DeInit_Func DeInit;
|
||||
uint16_t Address;
|
||||
EXC7200_WriteReg_Func WriteReg;
|
||||
EXC7200_ReadReg_Func ReadReg;
|
||||
EXC7200_GetTick_Func GetTick;
|
||||
} EXC7200_IO_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t TouchDetected;
|
||||
uint32_t TouchX;
|
||||
uint32_t TouchY;
|
||||
} EXC7200_State_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t TouchDetected;
|
||||
uint32_t TouchX[EXC7200_MAX_NB_TOUCH];
|
||||
uint32_t TouchY[EXC7200_MAX_NB_TOUCH];
|
||||
uint32_t TouchWeight[EXC7200_MAX_NB_TOUCH];
|
||||
uint32_t TouchEvent[EXC7200_MAX_NB_TOUCH];
|
||||
uint32_t TouchArea[EXC7200_MAX_NB_TOUCH];
|
||||
} EXC7200_MultiTouch_State_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
EXC7200_IO_t IO;
|
||||
exc7200_ctx_t Ctx;
|
||||
uint8_t IsInitialized;
|
||||
} EXC7200_Object_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t MultiTouch;
|
||||
uint8_t Gesture;
|
||||
uint8_t MaxTouch;
|
||||
uint32_t MaxXl;
|
||||
uint32_t MaxYl;
|
||||
} EXC7200_Capabilities_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Init ) ( EXC7200_Object_t *);
|
||||
int32_t ( *DeInit ) ( EXC7200_Object_t * );
|
||||
int32_t ( *GestureConfig ) ( EXC7200_Object_t *, EXC7200_Gesture_Init_t* );
|
||||
int32_t ( *ReadID ) ( EXC7200_Object_t *, uint32_t * );
|
||||
int32_t ( *GetState ) ( EXC7200_Object_t *, EXC7200_State_t* );
|
||||
int32_t ( *GetMultiTouchState ) ( EXC7200_Object_t *, EXC7200_MultiTouch_State_t* );
|
||||
int32_t ( *GetGesture ) ( EXC7200_Object_t *, uint8_t* );
|
||||
int32_t ( *GetCapabilities ) ( EXC7200_Object_t *, EXC7200_Capabilities_t * );
|
||||
int32_t ( *EnableIT ) ( EXC7200_Object_t * );
|
||||
int32_t ( *DisableIT ) ( EXC7200_Object_t * );
|
||||
int32_t ( *ClearIT ) ( EXC7200_Object_t * );
|
||||
int32_t ( *ITStatus ) ( EXC7200_Object_t * );
|
||||
} EXC7200_TS_Drv_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup EXC7200_Exported_Variables
|
||||
* @{
|
||||
*/
|
||||
extern EXC7200_TS_Drv_t EXC7200_TS_Driver;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup EXC7200_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
int32_t EXC7200_RegisterBusIO (EXC7200_Object_t *pObj, EXC7200_IO_t *pIO);
|
||||
int32_t EXC7200_Init(EXC7200_Object_t *pObj);
|
||||
int32_t EXC7200_DeInit(EXC7200_Object_t *pObj);
|
||||
int32_t EXC7200_GestureConfig(EXC7200_Object_t *pObj, EXC7200_Gesture_Init_t *GestureInit);
|
||||
int32_t EXC7200_ReadID(EXC7200_Object_t *pObj, uint32_t *Id);
|
||||
int32_t EXC7200_GetState(EXC7200_Object_t *pObj, EXC7200_State_t *State);
|
||||
int32_t EXC7200_GetMultiTouchState(EXC7200_Object_t *pObj, EXC7200_MultiTouch_State_t *State);
|
||||
int32_t EXC7200_GetGesture(EXC7200_Object_t *pObj, uint8_t *GestureId);
|
||||
int32_t EXC7200_EnableIT(EXC7200_Object_t *pObj);
|
||||
int32_t EXC7200_DisableIT(EXC7200_Object_t *pObj);
|
||||
int32_t EXC7200_ITStatus(EXC7200_Object_t *pObj);
|
||||
int32_t EXC7200_ClearIT(EXC7200_Object_t *pObj);
|
||||
int32_t EXC7200_GetCapabilities(EXC7200_Object_t *pObj, EXC7200_Capabilities_t *Capabilities);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* EXC7200_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
@ -0,0 +1,41 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file exc7200_conf_template.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains specific configuration for the
|
||||
* exc7200.c that can be modified by user.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2015 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef EXC7200_CONF_H
|
||||
#define EXC7200_CONF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/* Macros --------------------------------------------------------------------*/
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
#define EXC7200_MAX_X_LENGTH 4096U
|
||||
#define EXC7200_MAX_Y_LENGTH 4096U
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* EXC7200_CONF_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
@ -0,0 +1,82 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file exc7200_reg.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides unitary register function to control the exc7200 Touch
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2015 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "exc7200_reg.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup EXC7200
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup EXC7200_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Read EXC7200 component registers
|
||||
* @param ctx component contex
|
||||
* @param reg Register to read from
|
||||
* @param pdata Pointer to data buffer
|
||||
* @param length Number of data to read
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t exc7200_read_reg(exc7200_ctx_t *ctx, uint8_t reg, uint8_t* pdata, uint16_t length)
|
||||
{
|
||||
return ctx->ReadReg(ctx->handle, reg, pdata, length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Write EXC7200 component registers
|
||||
* @param ctx component contex
|
||||
* @param reg Register to write to
|
||||
* @param pdata Pointer to data buffer
|
||||
* @param length Number of data to write
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t exc7200_write_reg(exc7200_ctx_t *ctx, uint8_t reg, uint8_t *pdata, uint16_t length)
|
||||
{
|
||||
return ctx->WriteReg(ctx->handle, reg, pdata, length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
@ -0,0 +1,99 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file exc7200_reg.h
|
||||
* @author MCD Application Team
|
||||
* @brief Header of exc7200_regs.c
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2015 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef EXC7200_REG_H
|
||||
#define EXC7200_REG_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/* Macros --------------------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup EXC7200
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup EXC7200_Exported_Constants Exported Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* */
|
||||
#define EXC7200_READ_REG 0x09U
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup EXC7200_Exported_Types EXC7200 Exported Types
|
||||
* @{
|
||||
*/
|
||||
typedef int32_t (*EXC7200_Write_Func)(void *, uint8_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*EXC7200_Read_Func) (void *, uint8_t, uint8_t*, uint16_t);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
EXC7200_Write_Func WriteReg;
|
||||
EXC7200_Read_Func ReadReg;
|
||||
void *handle;
|
||||
} exc7200_ctx_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup EXC7200_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
int32_t exc7200_write_reg(exc7200_ctx_t *ctx, uint8_t reg, uint8_t *pbuf, uint16_t length);
|
||||
int32_t exc7200_read_reg(exc7200_ctx_t *ctx, uint8_t reg, uint8_t *pbuf, uint16_t length);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* EXC7200_REG_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
27
lib/main/STM32H7/Drivers/BSP/Components/exc80w32/LICENSE.md
Normal file
|
@ -0,0 +1,27 @@
|
|||
Copyright 2023 STMicroelectronics.
|
||||
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 copyright holder 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 HOLDER 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.
|
|
@ -0,0 +1,50 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
<title>Release Notes for EXC80W32 Component Driver</title>
|
||||
<style type="text/css">
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
span.underline{text-decoration: underline;}
|
||||
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="_htmresc/mini-st_2020.css" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
<link rel="icon" type="image/x-icon" href="_htmresc/favicon.png" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-4">
|
||||
<center>
|
||||
<h1 id="release-notes-for">Release Notes for</h1>
|
||||
<h1 id="exc80w32-component-driver"><mark>EXC80W32 Component Driver </mark></h1>
|
||||
<p>Copyright © 2024 STMicroelectronics<br />
|
||||
</p>
|
||||
<a href="https://www.st.com" class="logo"><img src="_htmresc/st_logo_2020.png" alt="ST logo" /></a>
|
||||
</center>
|
||||
<h1 id="purpose">Purpose</h1>
|
||||
<p>This driver provides a set of functions offered by EXC80W32 TS component.</p>
|
||||
</div>
|
||||
<div class="col-sm-12 col-lg-8">
|
||||
<h1 id="update-history"><strong>Update History</strong></h1>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section1_0_0" checked aria-hidden="true"> <label for="collapse-section1_0_0" aria-hidden="true"><strong>V1.0.0 / 03-July-2024</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First official release of <strong>EXC80W32</strong> Touch Screen component driver</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="sticky">
|
||||
For complete documentation on <mark>STM32 Microcontrollers</mark> , visit: <span style="font-color: blue;"><a href="http://www.st.com/STM32">www.st.com</a></span>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><g fill="#13254a"><path d="M100 .212C44.868.212 0 44.889 0 99.788c0 55.132 44.868 100 100 100s100-44.868 100-100C200 44.889 155.132.212 100 .212zm0 181.164c-44.974 0-81.587-36.614-81.587-81.587 0-44.762 36.614-81.164 81.587-81.164 44.995 0 81.587 36.402 81.587 81.164 0 44.973-36.592 81.587-81.587 81.587z" style="fill: #e6007e;"/><path d="M141.1 88.127h-29.439V58.688c0-6.392-5.185-11.598-11.598-11.598-6.413 0-11.619 5.206-11.619 11.598v29.439H58.476c-6.392 0-11.598 5.185-11.598 11.598 0 6.413 5.206 11.619 11.598 11.619h29.968v29.968c0 6.392 5.206 11.598 11.619 11.598 6.413 0 11.598-5.206 11.598-11.598v-29.968H141.1c6.392 0 11.598-5.206 11.598-11.619 0-6.413-5.206-11.598-11.598-11.598z" style="fill: #e6007e;"/></g></svg>
|
After Width: | Height: | Size: 830 B |
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><g fill="#03234b"><path d="M170.934 64.569l-.04-.055-29.049 40.038-.057.079h14.867a59.366 59.366 0 0 1-1.488 15.615c-1.158 5.318-3.807 13.448-9.848 21.977-2.766 4.118-6.375 7.726-9.208 10.408-3.426 2.857-7.461 6.095-12 8.376-8.121 4.568-17.881 7.138-28.225 7.432-10.907.248-20.201-2.61-26.072-5.052-8.283-3.479-14.111-7.807-16.85-10.078-1.254-.956-2.25-1.907-3.057-2.676a28.662 28.662 0 0 0-1.157-1.069 158.874 158.874 0 0 0-1.479-1.362l-4.435-3.956 3.569 4.81.183.243c.2.263.548.722 1.048 1.389.276.334.579.747.93 1.226l.008.01c.689.939 1.546 2.107 2.664 3.322 3 3.536 8.178 8.801 15.808 13.801 5.969 3.866 15.672 8.901 28.001 10.935a79.05 79.05 0 0 0 12.485.998c7.97 0 15.651-1.228 22.828-3.649 6.366-1.877 12.192-4.981 17.053-7.771 6.16-3.936 10.817-7.586 14.654-11.488 8.084-7.899 14.884-17.913 19.15-28.199 3.259-7.594 5.456-15.727 6.529-24.175l.055-.425.083-.641H200l-29.066-40.063zM58.159 99.232l-12.655.563c-.097-.881-.159-1.986-.227-3.474a59.184 59.184 0 0 1 1.446-16.56c1.157-5.316 3.804-13.444 9.848-21.977 2.168-3.228 5.009-6.44 9.208-10.415 3.41-2.849 7.432-6.08 12.005-8.375 8.114-4.568 17.87-7.138 28.213-7.432 10.9-.25 20.196 2.607 26.072 5.045 8.258 3.473 14.105 7.812 16.857 10.091 1.257.951 2.253 1.904 3.057 2.673l.017.016c.43.411.801.766 1.136 1.051.475.438.841.777 1.091 1.01l.138.128.248.229 4.04 3.613-3.165-4.456c-.058-.083-.312-.417-.73-.971l-.507-.67a28.922 28.922 0 0 1-.901-1.192l-.02-.027c-.69-.945-1.548-2.121-2.677-3.346-3.002-3.537-8.182-8.803-15.813-13.801-5.964-3.865-15.662-8.9-27.997-10.935-8.484-1.363-21.496-2.009-35.313 2.651-6.355 1.88-12.186 4.983-17.054 7.772-6.163 3.944-10.82 7.595-14.654 11.488-8.079 7.894-14.882 17.909-19.155 28.2-3.268 7.624-5.463 15.757-6.523 24.173-.436 3.281-.642 5.421-.664 6.926L0 101.831l30.683 38.727.042.053 27.38-41.298.054-.081z" style="fill: #e6007e;"/></g></svg>
|
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 4 KiB |