Skip to content

Commit

Permalink
Merge pull request #262 from LinjingZhang/master
Browse files Browse the repository at this point in the history
update README and wiki for new flasher/ XMC1400
  • Loading branch information
LinjingZhang committed Jan 30, 2024
2 parents 6ef1627 + d4c7052 commit 734d8f0
Show file tree
Hide file tree
Showing 40 changed files with 1,136 additions and 70 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/publish_docs_to_wiki.yml
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.history
.vscode
pkg_build
35 changes: 35 additions & 0 deletions CONTRIBUTING.md
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.
2 changes: 1 addition & 1 deletion Libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ As all newer versions will be using architecture *xmc*.

If your library ALSO supports other boards and architectures, obviously leave those in as well.

Check [XMC-for-Arduino Wiki](https://github.com/Infineon/XMC-for-Arduino/wiki) for any additional information
Check [XMC-for-Arduino Wiki](https://github.com/Infineon/XMC-for-Arduino/wiki) for any additional information.
64 changes: 26 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[![Build Status](https://travis-ci.org/Infineon/XMC-for-Arduino.svg?branch=master)](https://travis-ci.org/Infineon/XMC-for-Arduino)
# Infineon's XMC Microcontroller Boards for Arduino

This repository integrates [Infineon's](https://www.infineon.com/) XMC microcontrollers into the [Arduino IDE](https://www.arduino.cc/en/main/software) and [PlatformIO IDE](https://platformio.org/platformio-ide?utm_source=github&utm_medium=xmc-for-arduino).
Expand All @@ -19,9 +18,10 @@ This repository integrates [Infineon's](https://www.infineon.com/) XMC microcont

## Supported Microcontroller Boards

* [XMC1100 XMC 2Go](https://www.infineon.com/cms/en/product/evaluation-boards/kit_xmc_2go_xmc1100_v1/)
* [XMC1100 2Go](https://www.infineon.com/cms/en/product/evaluation-boards/kit_xmc_2go_xmc1100_v1/)
* [XMC1100 Boot Kit](https://www.infineon.com/cms/en/product/evaluation-boards/kit_xmc11_boot_001/)
* [XMC1300 Boot Kit](https://www.infineon.com/cms/de/product/evaluation-boards/kit_xmc13_boot_001/)
* [XMC1400 2Go (placeholder)]()
* [XMC1400 Kit for Arduino](https://www.infineon.com/cms/en/product/evaluation-boards/kit_xmc1400_arduino/)
* [XMC4200 Platform 2Go](https://www.infineon.com/cms/en/product/evaluation-boards/kit_xmc_plt2go_xmc4200/)
* [XMC4400 Platform 2Go](https://www.infineon.com/cms/en/product/evaluation-boards/kit_xmc_plt2go_xmc4400//)
Expand All @@ -33,9 +33,10 @@ Please visit also the Wiki for additional information, e.g. datasheets, pin out

[XMC-for-Arduino Wiki](https://github.com/Infineon/XMC-for-Arduino/wiki)

* Page for [XMC1100 XMC 2Go](https://github.com/Infineon/XMC-for-Arduino/wiki/XMC-2Go)
* Page for [XMC1100 XMC 2Go](https://github.com/Infineon/XMC-for-Arduino/wiki/XMC1100-2Go)
* Page for [XMC1100 Boot Kit](https://github.com/Infineon/XMC-for-Arduino/wiki/XMC1100-Boot-Kit)
* Page for [XMC1300 Boot Kit](https://github.com/Infineon/XMC-for-Arduino/wiki/XMC1300-Boot-Kit)
* Page for [XMC1400 2Go (placeholder)](https://github.com/Infineon/XMC-for-Arduino/wiki/XMC1400-2Go)
* Page for [XMC1400 Kit for Arduino](https://github.com/Infineon/XMC-for-Arduino/wiki/XMC1400-Kit-for-Arduino)
* Page for [XMC4200 Platform 2Go](https://github.com/Infineon/XMC-for-Arduino/wiki/XMC4200-Platform2Go)
* Page for [XMC4400 Platform 2Go](https://github.com/Infineon/XMC-for-Arduino/wiki/XMC4400-Platform2Go)
Expand All @@ -47,14 +48,14 @@ Additionally, please consult the [releases](https://github.com/Infineon/XMC-for-

### Prework for SEGGER J-Link

In order to use and program the Infineon XMC microcontrollers in the Arduino IDE, [SEGGER J-Link](https://www.segger.com/downloads/jlink) must be installed on your PC. Please follow this link to [SEGGER J-Link](https://www.segger.com/downloads/jlink) and install the J-Link Software and Documentation Pack for your operating system.
If you have already installed '[DAVE™ - Development Platform for XMC™ Microcontrollers](https://infineoncommunity.com/dave-download_ID645)', you can skip this step as the respective drivers/programs are already installed on your system.

In order to use the Infineon XMC microcontrollers by this repository and program them, you need [SEGGER J-Link](https://www.segger.com/downloads/jlink) installed on your PC. Please follow this link [SEGGER J-Link](https://www.segger.com/downloads/jlink) and install the J-Link Software and Documentation Pack for your respective operating system (OS).
If you have already installed '[DAVE™ - Development Platform for XMC™ Microcontrollers](https://www.infineon.com/cms/de/product/microcontroller/32-bit-industrial-microcontroller-based-on-arm-registered-cortex-registered-m/dave-version-4-free-development-platform-for-code-generation/channel.html?channel=db3a30433580b37101359f8ee6963814)', you might skip this step as you should have the respective drivers on your system.
![J-Link](https://github.com/infineon/assets/master/Pictures/J-Link_Packages.png)

### Required tools

XMC-for-Arduino requires Python 3.x and `pyserial`. Make sure Python is installed in your machine and available in the system path.

You can check if it was successfully installed by opening your command line or terminal and typing:
```
python --version
Expand All @@ -65,13 +66,13 @@ With [pip](https://pip.pypa.io/en/stable/installation/) available, install the m
pip install pyserial
```

### Using Arduino IDE
### Integration in Arduino IDE
Please first download the Arduino IDE. This library only tested for Arduino IDE >=1.5, recommended to use Arduino IDE >=2.0.

![Preferences](https://github.com/infineon/assets/master/Pictures/Preferences.png)
![Preferences](resources/wiki/image/preference.png)

Paste the following URL into the 'Additional Boards Manager URLs' input field under **File** > **Preferences** to add Infineon's microcontroller boards to the Arduino IDE.


https://github.com/Infineon/XMC-for-Arduino/releases/latest/download/package_infineon_index.json

Easier to copy (no clickable link):
Expand All @@ -80,47 +81,34 @@ Easier to copy (no clickable link):
https://github.com/Infineon/XMC-for-Arduino/releases/latest/download/package_infineon_index.json
```

![Adding a Board JSON](https://github.com/infineon/assets/master/Pictures/Preferences_JSON.png)

To install the boards, please navigate to **Tools** > **Board** > **Boards Manager...** and search for XMC. You will find options to install the board files for the microcontrollers. Click "Install" to add the boards to your Arduino IDE.

![Infineon Board Entry](https://github.com/infineon/assets/master/Pictures/Boards_Manager_Entry.png)

**Note:** For information on separation of release packages from version 2.0.0 onwards, see [below](#Separation-of-release-packages-from-version-2.0.0-onwards).

In the boards list **Tools** > **Board**, the XMC microcontroller boards are added and can be used from now on.

![Board List](https://github.com/infineon/assets/master/Pictures/Board_List.png)

**Important Notes**

* This integration will only work for Arduino IDE >=1.5
* The XMC1100 Boot Kit has limitations if compared to the official Arduino boards (consult the [XMC-for-Arduino Wiki](https://github.com/Infineon/XMC-for-Arduino/wiki) for more information)
* Refer also to the LICENSE.md/txt file for further information
* Arduino 1.8.0 IDE might have problems with the XMC-for-Arduino releases
* XMC-for-Arduino support for 'arm-linux-gnueabihf' only until version 1.1.
![Adding a Board JSON](resources/wiki/image/preference_JSON.png)

To install the boards, please go now to **Tools** > **Board** > **Boards Manager...** and search for XMC. You will see options to install the board files for the microcontrollers. Click "Install" to add the boards to your Arduino IDE.

#### Separation of release packages from version 2.0.0 onwards
![Infineon Board Entry](resources/wiki/image/Boards_Manager_Entry.png)

Certain obsolete boards (see wiki) and non-functional libraries were removed from the board support package for the release version 2.0.0, alongwith some other major changes (see release notes). However, in order to support legacy code, these removed boards/libraries are still available as a part of release version 1.7.0. Hence, the release packages have been split as shown in the pictures below.
In the boards list **Tools** > **Board**, you will now find the supported XMC microcontroller boards.

![Board Manager](https://github.com/Infineon/Assets/version-2.x/Pictures/Boards_Manager_Entry_v2.png)
![Board List](resources/wiki/image/Boards_Manager_Entry.png)

The boards until version 1.7.0 have been clubbed under *XMC Family V1.x*.
### Notes

![Board list v1x](https://github.com/Infineon/Assets/version-2.x/Pictures/Board_List_v1x.png.jpg)
* **The differences of the boards included in this repository if compared to the Arduino boards**
* **Refer also to the LICENSE.md/txt file of the repositories for further information**
* **The Boot Kits have limitations if compared to the official Arduino boards (consult the [XMC-for-Arduino Wiki](https://github.com/Infineon/XMC-for-Arduino/wiki) for more information)**
* **XMC-for-Arduino support for 'arm-linux-gnueabihf' only until version 1.1.**

Any new board or feature integration will only be done in the *XMC Family V2.x*

![Board list v1x](https://github.com/Infineon/Assets/version-2.x/Pictures/Board_List_v2x.png.jpg)
### Release packages from version 3.0.0 onwards

Certain obsolete boards (see wiki) and non-functional libraries were removed from the board support package for the release version 2.0.0, alongwith some other major changes (see release notes). After version 3.0.0, the release index will not include library before version 2.0.0.

![Board Manager](resources/wiki/image/Support_v2.png)
### Known Issues

* :warning: While using the pins connected to the **LEDs** configured as **INPUT**, there might be some abberation in behavior due to the presence of the series resistor of the LED, as it causes a voltage drop on the pin. In case of such an occurance, it is advised to desolder the series resistor and the LED and thereby using the pin as INPUT.

### Using PlatformIO IDE
### Using PlatformIO IDE

- [What is PlatformIO?](http://docs.platformio.org/en/latest/what-is-platformio.html?utm_source=github&utm_medium=xmc-for-arduino)
- [PlatformIO IDE](http://platformio.org/platformio-ide?utm_source=github&utm_medium=xmc-for-arduino)
Expand All @@ -131,9 +119,9 @@ Any new board or feature integration will only be done in the *XMC Family V2.x*

## Contributing and Third Party Libraries

To contribute enhancements, fixes and the like see *Contributors.md*. in root folder
To contribute enhancements, fixes and the like see [CONTRIBUTINGS](./CONTRIBUTING.md).

Third Party or external library maintainers see *Libraries.md*. in root folder
Third Party or external library maintainers see [Libraries](./Libraries.md).

Also see [Wiki](https://github.com/Infineon/XMC-for-Arduino/wiki) for any additional information

Expand Down
131 changes: 131 additions & 0 deletions docs/Analog-Functions-and-Additions.md
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)
Loading

0 comments on commit 734d8f0

Please sign in to comment.