Skip to content

Commit

Permalink
Merge pull request #219 from Infineon/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
jaenrig-ifx authored Oct 24, 2022
2 parents b6e26b6 + 5aab1e8 commit 0188fdc
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 48 deletions.
38 changes: 31 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
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).

## Contents
- [Supported Microcontroller Boards](#supported-microcontroller-boards)
- [Additional Information](#additional-information)
- [Installation Instructions](#installation-instructions)
* [Prework for SEGGER J-Link](#prework-for-segger-j-link)
* [Using Arduino IDE](#using-arduino-ide)
* [Using PlatformIO IDE](#using-platformio-ide)
- [Additional Contributors](#additional-contributors)
- [Infineon's XMC Microcontroller Boards for Arduino](#infineons-xmc-microcontroller-boards-for-arduino)
- [Contents](#contents)
- [Supported Microcontroller Boards](#supported-microcontroller-boards)
- [Additional Information](#additional-information)
- [Installation Instructions](#installation-instructions)
- [Prework for SEGGER J-Link](#prework-for-segger-j-link)
- [Using Arduino IDE](#using-arduino-ide)
- [Separation of release packages from version 2.0.0 onwards](#separation-of-release-packages-from-version-200-onwards)
- [Using PlatformIO IDE](#using-platformio-ide)
- [Contributing and Third Party Libraries](#contributing-and-third-party-libraries)
- [Additional Contributors](#additional-contributors)

## Supported Microcontroller Boards

Expand Down Expand Up @@ -45,6 +49,8 @@ If you have already installed '[DAVE™ - Development Platform for XMC™ Microc

![J-Link](https://raw.githubusercontent.com/infineon/assets/master/Pictures/J-Link_Packages.png)

**Note:** The XMC-for-Arduino BSP installs the **XMC Flasher** tool used to flash the compiled firmware (.hex) into the XMC device. However this tool requires **Java(TM) SE Runtime Environment** to be installed in the host system. Java(TM) SE Runtime Environment version **1.8.0** is known to be compatible with the tool.

### Using Arduino IDE

![Preferences](https://raw.githubusercontent.com/infineon/assets/master/Pictures/Preferences.png)
Expand All @@ -66,6 +72,8 @@ To install the boards, please navigate to **Tools** > **Board** > **Boards Manag

![Infineon Board Entry](https://raw.githubusercontent.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://raw.githubusercontent.com/infineon/assets/master/Pictures/Board_List.png)
Expand All @@ -78,6 +86,22 @@ In the boards list **Tools** > **Board**, the XMC microcontroller boards are add
* 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.


#### Separation of release packages from version 2.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). 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.

![Board Manager](https://raw.githubusercontent.com/Infineon/Assets/version-2.x/Pictures/Boards_Manager_Entry_v2.png)

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

![Board list v1x](https://raw.githubusercontent.com/Infineon/Assets/version-2.x/Pictures/Board_List_v1x.png.jpg)

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

![Board list v1x](https://raw.githubusercontent.com/Infineon/Assets/version-2.x/Pictures/Board_List_v2x.png.jpg)


### Using PlatformIO IDE

- [What is PlatformIO?](http://docs.platformio.org/en/latest/what-is-platformio.html?utm_source=github&utm_medium=xmc-for-arduino)
Expand Down
4 changes: 2 additions & 2 deletions package/package_infineon_index.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"platforms":[
{
"name":"Infineon's XMC Microcontroller",
"name":"Infineon's XMC Microcontroller V2.x",
"architecture":"xmc",
"version":"",
"category":"Contributed",
Expand All @@ -19,7 +19,7 @@
"checksum":"",
"size":"",
"help":{
"online":""
"online":"https://github.com/Infineon/XMC-for-Arduino/wiki"
},
"boards":[
{
Expand Down
4 changes: 2 additions & 2 deletions platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

# The information about this Arduino compatible environment
# ---------
name=XMC Family
version=1.6.0
name=XMC Family V2.x
version=2.0.0

# Build related core definitions
# ---------
Expand Down
90 changes: 53 additions & 37 deletions variants/XMC4400/config/XMC4400_Platform2GO/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,23 +96,17 @@ extern uint8_t SCK;
#define A16 16
#define A17 17

#define LED1 66
#define LED2 63
#define LED1 65
#define LED2 62
#define LED_BUILTIN LED1

#define BUTTON1 69
#define BUTTON2 58
#define BUTTON1 68
#define BUTTON2 57

#define digitalPinToInterrupt(p) ((p) == 2 ? 0 : ((p) == 3 ? 1 : NOT_AN_INTERRUPT))

#ifdef ARDUINO_MAIN
// Mapping of digital pins and comments
/***
IMPORTANT NOTE
Entry at Arduino pin 14 is a PLACEHOLDER
Invalid pin assignment, but removing would lead to breaking legacy code, due to change
of other pin assignments.
***/
const XMC_PORT_PIN_t mapping_port_pin[]=
{
/* 0 */ {XMC_GPIO_PORT2, 15}, // RX P2.15 X1-4
Expand Down Expand Up @@ -169,29 +163,29 @@ const XMC_PORT_PIN_t mapping_port_pin[]=
/* 49 */ {XMC_GPIO_PORT15, 8}, // A16 / ETH_CLK P15.8 X1-38

//Additional pins for port X2 starting here
/* 51 */ {XMC_GPIO_PORT14, 8}, // A14 / DAC 0 Output P14.8 X2-33
/* 52 */ {XMC_GPIO_PORT15, 2}, // A12 - ADC Input P15.2 (INPUT ONLY) X2-32
/* 53 */ {XMC_GPIO_PORT14, 15}, // A11 - ADC Input P14.15 (INPUT ONLY) X2-29
/* 54 */ {XMC_GPIO_PORT15, 9}, // A17 - ADC Input / ETH_CRS P15.9 X2-27
/* 55 */ {XMC_GPIO_PORT14, 6}, // A6 / AN1_2GO_1 - ADC Input P14.6 (INPUT ONLY) X2-25
/* 56 */ {XMC_GPIO_PORT14, 12}, // A8 / AN1_2GO_2 - ADC Input P14.12 (INPUT ONLY) X2-23
/* 57 */ {XMC_GPIO_PORT14, 14}, // A10 / ADC Input P14.14 (INPUT ONLY) X2-21
/* 58 */ {XMC_GPIO_PORT3, 2}, // BUTTON2 P3.2 X2-17
/* 59 */ {XMC_GPIO_PORT0, 10}, // INT / GPIO3_2GO_1 P0.10 X2-15
/* 60 */ {XMC_GPIO_PORT0, 1}, // INT P0.1 X2-13
/* 61 */ {XMC_GPIO_PORT0, 3}, // INT / GPIO3_2GO_2 P0.3 X2-11
/* 62 */ {XMC_GPIO_PORT3, 5}, // CS_2GO_1 P3.5 (Chip Select - Slot 1) X2-3
/* 63 */ {XMC_GPIO_PORT0, 7}, // LED2 P0.7 X2-1
/* 64 */ {XMC_GPIO_PORT0, 8}, // QSPI_CLK P0.8 X2-4
/* 65 */ {XMC_GPIO_PORT0, 12}, // CS_MB P0.12 (Chip Select - MikroBUS) X2-10
/* 66 */ {XMC_GPIO_PORT0, 6}, // LED1 P0.6 X2-12
/* 67 */ {XMC_GPIO_PORT0, 4}, // ETH_TXEN P0.4 X2-14
/* 68 */ {XMC_GPIO_PORT0, 9}, // GPIO4_2GO_1 / PWM80-12 / PWM P0.9 X2-20
/* 69 */ {XMC_GPIO_PORT3, 1}, // BUTTON1 P3.1 X2-22
/* 70 */ {XMC_GPIO_PORT14, 13}, // A9 / AN2_2GO_2 - ADC Input P14.13 (INPUT ONLY) X2-26
/* 71 */ {XMC_GPIO_PORT14, 7}, // A7 / AN2_2GO_1 - ADC Input P14.7 (INPUT ONLY) X2-28
/* 72 */ {XMC_GPIO_PORT15, 3}, // A13 - ADC Input P15.3 (INPUT ONLY) X2-34
/* 73 */ {XMC_GPIO_PORT14, 9} // A15 / DAC 1 Output P14.9 X2-36
/* 50 */ {XMC_GPIO_PORT14, 8}, // A14 / DAC 0 Output P14.8 X2-33
/* 51 */ {XMC_GPIO_PORT15, 2}, // A12 - ADC Input P15.2 (INPUT ONLY) X2-32
/* 52 */ {XMC_GPIO_PORT14, 15}, // A11 - ADC Input P14.15 (INPUT ONLY) X2-29
/* 53 */ {XMC_GPIO_PORT15, 9}, // A17 - ADC Input / ETH_CRS P15.9 X2-27
/* 54 */ {XMC_GPIO_PORT14, 6}, // A6 / AN1_2GO_1 - ADC Input P14.6 (INPUT ONLY) X2-25
/* 55 */ {XMC_GPIO_PORT14, 12}, // A8 / AN1_2GO_2 - ADC Input P14.12 (INPUT ONLY) X2-23
/* 56 */ {XMC_GPIO_PORT14, 14}, // A10 / ADC Input P14.14 (INPUT ONLY) X2-21
/* 57 */ {XMC_GPIO_PORT3, 2}, // BUTTON2 P3.2 X2-17
/* 58 */ {XMC_GPIO_PORT0, 10}, // INT / GPIO3_2GO_1 P0.10 X2-15
/* 59 */ {XMC_GPIO_PORT0, 1}, // INT P0.1 X2-13
/* 60 */ {XMC_GPIO_PORT0, 3}, // INT / GPIO3_2GO_2 P0.3 X2-11
/* 61 */ {XMC_GPIO_PORT3, 5}, // CS_2GO_1 P3.5 (Chip Select - Slot 1) X2-3
/* 62 */ {XMC_GPIO_PORT0, 7}, // LED2 P0.7 X2-1
/* 63 */ {XMC_GPIO_PORT0, 8}, // QSPI_CLK P0.8 X2-4
/* 64 */ {XMC_GPIO_PORT0, 12}, // CS_MB P0.12 (Chip Select - MikroBUS) X2-10
/* 65 */ {XMC_GPIO_PORT0, 6}, // LED1 P0.6 X2-12
/* 66 */ {XMC_GPIO_PORT0, 4}, // ETH_TXEN P0.4 X2-14
/* 67 */ {XMC_GPIO_PORT0, 9}, // GPIO4_2GO_1 / PWM80-12 / PWM P0.9 X2-20
/* 68 */ {XMC_GPIO_PORT3, 1}, // BUTTON1 P3.1 X2-22
/* 69 */ {XMC_GPIO_PORT14, 13}, // A9 / AN2_2GO_2 - ADC Input P14.13 (INPUT ONLY) X2-26
/* 70 */ {XMC_GPIO_PORT14, 7}, // A7 / AN2_2GO_1 - ADC Input P14.7 (INPUT ONLY) X2-28
/* 71 */ {XMC_GPIO_PORT15, 3}, // A13 - ADC Input P15.3 (INPUT ONLY) X2-34
/* 72 */ {XMC_GPIO_PORT14, 9} // A15 / DAC 1 Output P14.9 X2-36
};
const uint8_t GND = ( sizeof( mapping_port_pin ) / sizeof( XMC_PORT_PIN_t ) );
const uint8_t NUM_DIGITAL = ( sizeof( mapping_port_pin ) / sizeof( XMC_PORT_PIN_t ) );;
Expand Down Expand Up @@ -235,17 +229,39 @@ const uint8_t NUM_PWM4 = ( sizeof( mapping_pwm4 ) / sizeof( XMC_PWM4_t ) );
const uint8_t mapping_pin_PWM8[][ 2 ] = {
{ 9, 0 }, // PWM3
{ 10, 1 }, // PWM4
<<<<<<< HEAD
{ 25, 2 }, // PWM
{ 29, 3 }, // PWM
{ 30, 4 }, // PWM
{ 45, 5 }, // PWM
{ 46, 6 }, // PWM
{ 48, 7 }, // PWM
{ 67, 8 }, // PWM
{ 255, 255 } };

/* Configurations of PWM channels for CCU8 type */
XMC_PWM8_t mapping_pwm8[] =
{
{CCU80, CCU80_CC83, 3, XMC_CCU8_SLICE_COMPARE_CHANNEL_1, mapping_port_pin[9], P0_11_AF_CCU80_OUT31, XMC_CCU8_SLICE_PRESCALER_64, PWM8_TIMER_PERIOD, DISABLED}, // PWM disabled 9 P0.11
{CCU80, CCU80_CC80, 0, XMC_CCU8_SLICE_COMPARE_CHANNEL_1, mapping_port_pin[10], P0_2_AF_CCU80_OUT01, XMC_CCU8_SLICE_PRESCALER_64, PWM8_TIMER_PERIOD, DISABLED}, // PWM disabled 10 P0.2
//additional pwm outputs starting here
{CCU80, CCU80_CC83, 3, XMC_CCU8_SLICE_COMPARE_CHANNEL_2, mapping_port_pin[25], P2_8_AF_CCU80_OUT32, XMC_CCU8_SLICE_PRESCALER_64, PWM8_TIMER_PERIOD, DISABLED}, // PWM disabled 25 P2.8
{CCU81, CCU81_CC82, 2, XMC_CCU8_SLICE_COMPARE_CHANNEL_1, mapping_port_pin[29], P2_0_AF_CCU81_OUT21, XMC_CCU8_SLICE_PRESCALER_64, PWM8_TIMER_PERIOD, DISABLED}, // PWM disabled 29 P2.0
{CCU80, CCU80_CC81, 1, XMC_CCU8_SLICE_COMPARE_CHANNEL_2, mapping_port_pin[30], P2_6_AF_CCU80_OUT13, XMC_CCU8_SLICE_PRESCALER_64, PWM8_TIMER_PERIOD, DISABLED}, // PWM disabled 30 P2.6
{CCU81, CCU81_CC80, 0, XMC_CCU8_SLICE_COMPARE_CHANNEL_2, mapping_port_pin[45], P5_7_AF_CCU81_OUT02, XMC_CCU8_SLICE_PRESCALER_64, PWM8_TIMER_PERIOD, DISABLED}, // PWM disabled 45 P5.7
{CCU80, CCU80_CC81, 1, XMC_CCU8_SLICE_COMPARE_CHANNEL_2, mapping_port_pin[31], P2_6_AF_CCU80_OUT13, XMC_CCU8_SLICE_PRESCALER_64, PWM8_TIMER_PERIOD, DISABLED}, // PWM disabled 31 P2.6
{CCU80, CCU80_CC80, 0, XMC_CCU8_SLICE_COMPARE_CHANNEL_2, mapping_port_pin[46], P2_7_AF_CCU80_OUT03, XMC_CCU8_SLICE_PRESCALER_64, PWM8_TIMER_PERIOD, DISABLED}, // PWM disabled 46 P2.7
{CCU80, CCU80_CC82, 2, XMC_CCU8_SLICE_COMPARE_CHANNEL_2, mapping_port_pin[48], P2_9_AF_CCU80_OUT22, XMC_CCU8_SLICE_PRESCALER_64, PWM8_TIMER_PERIOD, DISABLED}, // PWM disabled 48 P2.9
{CCU80, CCU80_CC81, 1, XMC_CCU8_SLICE_COMPARE_CHANNEL_2, mapping_port_pin[67], P0_9_AF_CCU80_OUT12, XMC_CCU8_SLICE_PRESCALER_64, PWM8_TIMER_PERIOD, DISABLED} // PWM disabled 67 P0.9
};

const uint8_t NUM_PWM8 = ( sizeof( mapping_pwm8 ) / sizeof( XMC_PWM8_t ) );
const uint8_t NUM_PWM = ( sizeof( mapping_pwm4 ) / sizeof( XMC_PWM4_t ) )
+ ( sizeof( mapping_pwm8 ) / sizeof( XMC_PWM8_t ) );

/* Analog Pin mappings and configurations */
#ifdef DAC
const uint8_t mapping_pin_DAC[][ 2 ] = {
{ 51, 0 },
{ 73, 1 },
{ 50, 0 },
{ 72, 1 },
{ 255, 255 } };

/* Analog Pin mappings and configurations */
Expand Down

0 comments on commit 0188fdc

Please sign in to comment.