-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #262 from LinjingZhang/master
update README and wiki for new flasher/ XMC1400
- Loading branch information
Showing
40 changed files
with
1,136 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Publish docs to Wiki | ||
|
||
# Trigger this action only if there are changes pushed to the docs/** directory under the master branch | ||
on: | ||
push: | ||
paths: | ||
- docs/** # This includes all sub folders | ||
branches: | ||
- master | ||
|
||
env: | ||
USER_TOKEN: ${{ secrets.WIKI_ACTION_TOKEN }} # This is the repository secret | ||
USER_NAME: github-actions # Enter the username of your (bot) account | ||
USER_EMAIL: action@github.com # Enter the e-mail of your (bot) account | ||
OWNER: ${{ github.event.repository.owner.name }} # This is the repository owner | ||
REPOSITORY_NAME: ${{ github.event.repository.name }} # This is the repository name | ||
|
||
jobs: | ||
publish_docs_to_wiki: | ||
name: Publish docs to Wiki | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
# 1. Create folder named `tmp_wiki` | ||
# 2. Initialize Git | ||
# 3. Pull old Wiki content | ||
- name: Pull content from wiki | ||
run: | | ||
mkdir tmp_wiki | ||
cd tmp_wiki | ||
git init | ||
git config user.name $USER_NAME | ||
git config user.email $USER_EMAIL | ||
git pull https://$USER_TOKEN@github.com/$OWNER/$REPOSITORY_NAME.wiki.git | ||
# 4. Synchronize differences between `docs` & `tmp_wiki` | ||
# 5. Push new Wiki content | ||
- name: Push content to wiki | ||
run: | | ||
rsync -av --delete docs/ tmp_wiki/ --exclude .git | ||
cd tmp_wiki | ||
git add . | ||
git commit -m "Update Wiki content" | ||
git push -f --set-upstream https://$USER_TOKEN@github.com/$OWNER/$REPOSITORY_NAME.wiki.git master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.history | ||
.vscode | ||
pkg_build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# XMC-for-Arduino | ||
## Contributing to XMC-for-Arduino Project | ||
First important point **All Contributions** are welcomed. | ||
|
||
Please contribute and raise issues via the [github repository](https://github.com/Infineon/XMC-for-Arduino/tree/develop) | ||
|
||
Check the **develop** branch for any Beta releases fixes for any issues you may find. | ||
|
||
## Developer notes | ||
|
||
### General points on repository branches and flow | ||
|
||
1. _master_ branch is intended to be copy of release version | ||
2. Please make Pull Requests to _develop_ branch for review, inclusion and availability for others | ||
3. At next release _develop_ is merged into _master_ for release | ||
4. Other branches are for other tests and not to be treated as anything but work in progress for now | ||
5. Check [XMC-for-Arduino Wiki](https://github.com/Infineon/XMC-for-Arduino/wiki) for any additional information | ||
|
||
### Local Running using Arduino IDE (**ON WINDOWS**): | ||
Clone the repository in arduino folder: | ||
- Open Arduino and install any Infineon XMC library (e.g. 2.2.0) | ||
- Open the library location in Arduino program folder | ||
`C:\Users\"USERNAME"\AppData\Local\Arduino15\packages\Infineon\hardware\xmc` | ||
- Open git bash, type command: | ||
`git clone "HTTP_SSH_REPOSITORY" "LIBRARY_VERSION (e.g. 2.2.0)"` | ||
|
||
This is a workaround for current local compilation/testing. | ||
|
||
### CICD | ||
|
||
Currently github workflow is used for automaticaly build test and release. Workflows are defined by YAML file in the `.github/workflows` directory. | ||
To merge your PR, please try to add a git tag in the format `VX.Y.Z` (e.g. V3.3.0) to trigger the release process in your fork and pass the compilation tests. | ||
|
||
### WIKI | ||
Because of the limitations of the github wiki, it is difficult to create PR for changes of wiki. Please refer to the answer under: https://stackoverflow.com/questions/10642928/how-can-i-make-a-pull-request-for-a-wiki-page-on-github and create a ticket for your modifications. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
## wiring_analog after V1.2.1 | ||
Analog functions like analogRead and | ||
analogWrite etc. have changed after V1.2.1 to have extra safety measures to ensure invalid settings cannot be done and report errors. | ||
|
||
Additionally extra getter functions have been added so other libraries can access the resolution of read and write functions as number of bits and current maximum value possible. | ||
|
||
## Extra functions | ||
These functions return the analogue resolution as number of bits | ||
* uint8_t getAnalogReadBits( ) - range 8 to 12 | ||
* uint8_t getAnalogWriteBits( ) - range 8 to 16 | ||
|
||
These functions return the analogue resolution as its maximum value | ||
* uint16_t getAnalogReadMaximum( ) - range 255 to 4095 | ||
* uint16_t getAnalogWriteMaximum( ) - range 255 to 65535 | ||
|
||
This function enables the analog amplifiers at the ADC inputs with adjustible gain (for XMC1000 series) | ||
* uint32_t analogRead_variableGain( uint8_t channel, uint8_t gain_value ) \ | ||
The gain factor values can be found [here.](#analog-amplifiers-at-the-adc-inputs-with-adjustible-gain) | ||
|
||
## Default Values | ||
Read resolution default is 10 bits (0 to 1023) | ||
|
||
Write resolution default is 8 bits (0 to 255) | ||
## Error and Return Codes by Function | ||
Where possible functions do **NOT** action invalid parameters passed in. | ||
|
||
Functions return error codes or valid values so be sure which error code you are looking for as some functions can return 0 as a valid value (e.g. analogRead) so an out of range value is returned instead. | ||
<table align=centre border=0> | ||
<tr> | ||
<td><b>Function</b></td> | ||
<td><b>Valid Return</b></td> | ||
<td><b>Errors</b></td> | ||
</tr> | ||
<tr> | ||
<td>analogReadResolution</td> | ||
<td>8 to 12<br>as passed in</td> | ||
<td>255</td> | ||
</tr> | ||
<tr> | ||
<td>getAnalogReadBits</td> | ||
<td>8 to 12</td> | ||
<td> none</td> | ||
</tr> | ||
<tr> | ||
<td>getanalogReadMaximum</td> | ||
<td>255 to 4095</td> | ||
<td>none</td> | ||
</tr> | ||
<tr> | ||
<td>analogWriteResolution</td> | ||
<td>8 to 16<br>as passed in</td> | ||
<td>255</td> | ||
</tr> | ||
<tr> | ||
<td>getAnalogWriteBits</td> | ||
<td>8 to 16</td> | ||
<td> none</td> | ||
</tr> | ||
<tr> | ||
<td>getanalogWriteMaximum</td> | ||
<td>255 to 65535</td> | ||
<td>none</td> | ||
</tr> | ||
<tr> | ||
<td>analogRead</td> | ||
<td>0 to Maximum for Resolution </td> | ||
<td>0xFFFFFFFF usually invalid channel</td> | ||
</tr> | ||
<tr> | ||
<td>analogWrite</td> | ||
<td>0 success </td> | ||
<td>-1 = invalid value<br> | ||
-2 = wrong pin</td> | ||
</tr> | ||
<tr> | ||
<td>setAnalogWriteFrequency</td> | ||
<td>0 success </td> | ||
<td>-1 = invalid frequency<br> | ||
-2 = wrong pin</td> | ||
</tr> | ||
<tr> | ||
<td>analogReference</td> | ||
<td>none</td> | ||
<td>NULL function see below</td> | ||
</tr> | ||
</table> | ||
This should enable checks in software for valid operation and debugging problem code. | ||
|
||
## AREF Analogue Reference | ||
On all boards the Analogue Reference is set to use the internal power supply (however noisy), so the AREF pin is an **OUTPUT** of the AREF in use. Do **NOT** connect any external voltage source to this pin, or use shields that change this voltage. | ||
|
||
**CAUTION** any shorts on this pin especially to 0V (GND) will bring down the supply of the chip. | ||
|
||
The pin voltage is the current supply voltage to AREF for analogue conversions. | ||
|
||
This pin **CANNOT** be reassigned as GPIO (pinMode has no effect). | ||
|
||
### analogReference( ) | ||
This function has NO operation and will not match any call on parameters passed in with other libraries or examples that use this call. | ||
|
||
Any shields and examples that try to change this, will **NOT** function the same on these boards. | ||
|
||
## Analog amplifiers at the ADC inputs with adjustible gain | ||
Each analog input channel can be configured to be amplified by an adjustable gain factor, for XMC1000 series. To configure the gain, the `gain value` is to be selected in the `analogRead_variableGain()` function which translates to a `gain factor` as per the following table: | ||
|
||
<table align=centre border=0> | ||
<tr> | ||
<td><b>Gain value</b></td> | ||
<td><b>Gain factor</b></td> | ||
</tr> | ||
<tr> | ||
<td>0</td> | ||
<td>1</td> | ||
</tr> | ||
<tr> | ||
<td>1</td> | ||
<td>3</td> | ||
</tr> | ||
<tr> | ||
<td>2</td> | ||
<td>6</td> | ||
</tr> | ||
<tr> | ||
<td>3</td> | ||
<td>12</td> | ||
</tr> | ||
</table> | ||
|
||
For more information, please refer to the application note [here.](https://www.infineon.com/dgdl/Infineon-VADC-XMC1200_XMC1300-AP32304-AN-v01_10-EN.pdf?fileId=5546d4624e765da5014ed981f63136d6) | ||
|
||
[Home](https://github.com/Infineon/XMC-for-Arduino/wiki) |
Oops, something went wrong.