analogdevicesinc / TMC-API

TRINAMIC's IC API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

u16 typedef multiple declaration

dzid26 opened this issue · comments

I am not sure if the problem is in Arduino core library or TMC_api, but in order to compile, I had to comment out line 34 in helpers/Types.h:

typedef uint8_t  u8;
// typedef uint16_t u16;
typedef uint32_t u32;

Error message otherwise:

In file included from .pio\libdeps\nanoatmega328\TMC-API/tmc\helpers\Config.h:12:0,
from .pio\libdeps\nanoatmega328\TMC-API/tmc\helpers\API_Header.h:11,
from src\SPI_TMC.h:11,
from src\main.cpp:5:
.pio\libdeps\nanoatmega328\TMC-API/tmc\helpers\Types.h:34:18: error: conflicting declaration 'typedef uint16_t u16'
typedef uint16_t u16;
^
In file included from C:\Users\jareckir.platformio\packages\framework-arduinoavr\cores\arduino/Arduino.h:233:0,
from src\main.cpp:1:
C:\Users\jareckir.platformio\packages\framework-arduinoavr\cores\arduino/USBAPI.h:30:24: note: previous declaration as 'typedef short unsigned int u16'
typedef unsigned short u16;
^

Also, I needed to remove other ICs except one that I am using (TMC5160) because there were too many errors within them.

Both our API and the Arduino USBAPI.h declare the u8/u16/u32 types - and do so differently. The fix for that is to remove one of them, which you already applied.

This is an issue we stumbled upon earlier too. Hence we started changing the entire API to only use the types as defined by stdint.h (uint8_t etc.). Due to backwards compatibility issues we have not removed the old declarations - if we were to remove them, any customer application code using our u8/u16/u32 definitions would break.

What we can do is hide the definitions behind a compile switch, e.g. #define ENABLE_INTEGER_TYPEDEFS and have a well documented place where this should be written/commented out depending on whether a customer wants us to define these types or not.

Also, I needed to remove other ICs except one that I am using (TMC5160) because there were too many errors within them.

Regarding this - what errors are shown?

Your solution sounds like the best approach.

Regarding other errors -
I don't have too much experience with best practises with buildiing large projects, so it could be something wrong with my process.
The compiler builds everything present in the folder by defualt.
Here is what I get if I keep all the IC folders:

Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/nanoatmega328.html
PLATFORM: Atmel AVR 1.15.0 > Arduino Nano ATmega328
HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 30KB Flash
PACKAGES: toolchain-atmelavr 1.50400.190710 (5.4.0), framework-arduinoavr 4.1.2
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 7 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <SPI> 1.0
|-- <TMC-API> #116bf74
Building in release mode
Compiling .pio\build\nanoatmega328\src\main.cpp.o
Compiling .pio\build\nanoatmega328\lib0bc\TMC-API\tmc\ic\TMC2041\TMC2041.c.o
Compiling .pio\build\nanoatmega328\lib0bc\TMC-API\tmc\ic\TMC2130\TMC2130.c.o
Compiling .pio\build\nanoatmega328\lib0bc\TMC-API\tmc\ic\TMC2160\TMC2160.c.o
Compiling .pio\build\nanoatmega328\lib0bc\TMC-API\tmc\ic\TMC2208\TMC2208.c.o
Compiling .pio\build\nanoatmega328\lib0bc\TMC-API\tmc\ic\TMC2209\TMC2209.c.o
Compiling .pio\build\nanoatmega328\lib0bc\TMC-API\tmc\ic\TMC2224\TMC2224.c.o
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2041\TMC2041.c: In function 'tmc2041_writeDatagram':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2041\TMC2041.c:19:18: warning: left shift count >= width of type [-Wshift-count-overflow]
  int value = (x1 << 24) | (x2 << 16) | (x3 << 8) | x4;
                  ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2041\TMC2041.c:19:31: warning: left shift count >= width of type [-Wshift-count-overflow]
Compiling .pio\build\nanoatmega328\lib0bc\TMC-API\tmc\ic\TMC2225\TMC2225.c.o
  int value = (x1 << 24) | (x2 << 16) | (x3 << 8) | x4;
                                ^

.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2041\TMC2041.c: In function 'tmc2041_readInt':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2041\TMC2041.c:48:18: warning: left shift count >= width of type [-Wshift-count-overflow]
  return (data[1] << 24) | (data[2] << 16) | (data[3] << 8) | data[4];
                  ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2041\TMC2041.c:48:36: warning: left shift count >= width of type [-Wshift-count-overflow]
  return (data[1] << 24) | (data[2] << 16) | (data[3] << 8) | data[4];
                                     ^

.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2130\TMC2130.c: In function 'tmc2130_writeDatagram':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2130\TMC2130.c:22:22: warning: left shift count >= width of type [-Wshift-count-overflow]
  int32_t value = (x1 << 24) | (x2 << 16) | (x3 << 8) | x4;
                      ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2130\TMC2130.c:22:35: warning: left shift count >= width of type [-Wshift-count-overflow]
  int32_t value = (x1 << 24) | (x2 << 16) | (x3 << 8) | x4;
                                   ^
..pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2130\TMC2130.c: In function 'tmc2130_readInt':

.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2130\TMC2130.c:53:18: warning: left shift count >= width of type [-Wshift-count-overflow]
  return (data[1] << 24) | (data[2] << 16) | (data[3] << 8) | data[4];
                  ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2130\TMC2130.c:53:36: warning: left shift count >= width of type [-Wshift-count-overflow]
  return (data[1] << 24) | (data[2] << 16) | (data[3] << 8) | data[4];
                                    ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2160\TMC2160.c: In function 'tmc2160_writeDatagram':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2160\TMC2160.c:20:18: warning: left shift count >= width of type [-Wshift-count-overflow]
  int value = (x1 << 24) | (x2 << 16) | (x3 << 8) | x4;
                  ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2160\TMC2160.c:20:31: warning: left shift count >= width of type [-Wshift-count-overflow]
   int value = (x1 << 24) | (x2 << 16) | (x3 << 8) | x4;

                               ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2160\TMC2160.c: In function 'tmc2160_readInt':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2160\TMC2160.c:49:18: warning: left shift count >= width of type [-Wshift-count-overflow]
  return (data[1] << 24) | (data[2] << 16) | (data[3] << 8) | data[4];
                  ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2160\TMC2160.c:49:36: warning: left shift count >= width of type [-Wshift-count-overflow]
  return (data[1] << 24) | (data[2] << 16) | (data[3] << 8) | data[4];
                                    ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2208\TMC2208.c: In function 'tmc2208_readInt':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2208\TMC2208.c:71:18: warning: left shift count >= width of type [-Wshift-count-overflow]
  return (data[3] << 24) | (data[4] << 16) | (data[5] << 8) | data[6];
                  ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2208\TMC2208.c:71:36: warning: left shift count >= width of type [-Wshift-count-overflow]
  return (data[3] << 24) | (data[4] << 16) | (data[5] << 8) | data[6];
                                    ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2209\TMC2209.c: In function 'tmc2209_readInt':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2209\TMC2209.c:71:18: warning: left shift count >= width of type [-Wshift-count-overflow]
  return (data[3] << 24) | (data[4] << 16) | (data[5] << 8) | data[6];
                  ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2209\TMC2209.c:71:36: warning: left shift count >= width of type [-Wshift-count-overflow]
  return (data[3] << 24) | (data[4] << 16) | (data[5] << 8) | data[6];
                                    ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2225\TMC2225.c: In function 'tmc2225_readInt':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2225\TMC2225.c:71:18: warning: left shift count >= width of type [-Wshift-count-overflow]
  return (data[3] << 24) | (data[4] << 16) | (data[5] << 8) | data[6];
                   ^

.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2225\TMC2225.c:71:36: warning: left shift count >= width of type [-Wshift-count-overflow]
  return (data[3] << 24) | (data[4] << 16) | (data[5] << 8) | data[6];
                                    ^
Compiling .pio\build\nanoatmega328\lib0bc\TMC-API\tmc\ic\TMC2590\TMC2590.c.o
Compiling .pio\build\nanoatmega328\lib0bc\TMC-API\tmc\ic\TMC262\TMC262.c.o
Compiling .pio\build\nanoatmega328\lib0bc\TMC-API\tmc\ic\TMC2660\TMC2660.c.o
ICompiling .pio\build\nanoatmega328\lib0bc\TMC-API\tmc\ic\TMC4210\TMC4210.c.o
n file included from .pio\libdeps\nanoatmega328\TMC-API/tmc/helpers/API_Header.h:14:0,
                 from .pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2590\TMC2590.h:11,
Compiling .pio\build\nanoatmega328\lib0bc\TMC-API\tmc\ic\TMC424\TMC424.c.o
Compiling .pio\build\nanoatmega328\lib0bc\TMC-API\tmc\ic\TMC429\TMC429.c.o
                  from .pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2590\TMC2590.c:8:

.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2590\TMC2590.c: In function 'readWrite':
.pio\libdeps\nanoatmega328\TMC-API/tmc/helpers/Bits.h:76:65: warning: left shift count >= width of type [-Wshift-count-overflow]
  #define _8_32(__3, __2, __1, __0)                      (((__3) << BYTE3_SHIFT) | ((__2) << BYTE2_SHIFT) | ((__1) << BYTE1_SHIFT) | ((__0) << BYTE0_SHIFT))
                                                                 ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2590\TMC2590.c:88:43: note: in expansion of macro '_8_32'
  tmc2590->config->shadowRegister[rdsel] = _8_32(data[0], data[1], data[2], 0) >> 12;
                                           ^
.pio\libdeps\nanoatmega328\TMC-API/tmc/helpers/Bits.h:76:90: warning: left shift count >= width of type [-Wshift-count-overflow]
  #define _8_32(__3, __2, __1, __0)                      (((__3) << BYTE3_SHIFT) | ((__2) << BYTE2_SHIFT) | ((__1) << BYTE1_SHIFT) | ((__0) << BYTE0_SHIFT))
                                                                                          ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC2590\TMC2590.c:88:43: note: in expansion of macro '_8_32'
Compiling .pio\build\nanoatmega328\lib0bc\TMC-API\tmc\ic\TMC4330\TMC4330.c.o
  tmc2590->config->shadowRegister[rdsel] = _8_32(data[0], data[1], data[2], 0) >> 12;
                                           ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC262\TMC262.c: In function 'ReadWrite262':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC262\TMC262.c:116:49: error: 'FALSE' undeclared (first use in this function)
  *ReadInt = tmc5130_spi_readWrite(WriteInt>>16, FALSE);
                                                 ^
..pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC262\TMC262.c:116:49: note: each undeclared identifier is reported only once for each function it appears in

.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC262\TMC262.c:120:53: error: 'TRUE' undeclared (first use in this function)
  *ReadInt |= tmc5130_spi_readWrite(WriteInt & 0xFF, TRUE);
                                                     ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC262\TMC262.c: In function 'tmc262_initMotorDrivers':
..pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC262\TMC262.c:336:35: error: 'FALSE' undeclared (first use in this function)

  ChopperConfig.DisableFlag      = FALSE;
                                   ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC262\TMC262.c: In function 'tmc262_disable':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC262\TMC262.c:778:31: error: 'TRUE' undeclared (first use in this function)
   ChopperConfig.DisableFlag = TRUE;
                               ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC262\TMC262.c: In function 'tmc262_enable':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC262\TMC262.c:798:31: error: 'FALSE' undeclared (first use in this function)
   ChopperConfig.DisableFlag = FALSE;
                               ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c: In function 'ReadWrite424':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c:33:12: warning: implicit declaration of function 'ReadWriteSPI' [-Wimplicit-function-declaration]
  Read[0] = ReadWriteSPI(SPI_DEV_ENCODER, Write[0], FALSE);
            ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c:33:25: error: 'SPI_DEV_ENCODER' undeclared (first use in this function)
  Read[0] = ReadWriteSPI(SPI_DEV_ENCODER, Write[0], FALSE);
                         ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c:33:25: note: each undeclared identifier is reported only once for each function it appears in
..pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c:33:52: error: 'FALSE' undeclared (first use in this function)

  Read[0] = ReadWriteSPI(SPI_DEV_ENCODER, Write[0], FALSE);
                                                    ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c:36:52: error: 'TRUE' undeclared (first use in this function)
  Read[3] = ReadWriteSPI(SPI_DEV_ENCODER, Write[3], TRUE);
                                                    ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c: In function 'Write424Bytes':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c:52:15: error: 'SPI_DEV_ENCODER' undeclared (first use in this function)
   ReadWriteSPI(SPI_DEV_ENCODER, Address|TMC424_WRITE, FALSE);

               ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c:52:54: error: 'FALSE' undeclared (first use in this function)
  ReadWriteSPI(SPI_DEV_ENCODER, Address|TMC424_WRITE, FALSE);
                                                      ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c:55:40: error: 'TRUE' undeclared (first use in this function)
  ReadWriteSPI(SPI_DEV_ENCODER, LoByte, TRUE);
                                        ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c: In function 'SetEncoderPrescaler':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c:77:13: error: 'TMC423_ENC_CONF_1' undeclared (first use in this function)
   RegAddr = TMC423_ENC_CONF_1;
             ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c:80:13: error: 'TMC423_ENC_CONF_2' undeclared (first use in this function)
   RegAddr = TMC423_ENC_CONF_2;
             ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c:83:13: error: 'TMC423_ENC_CONF_3' undeclared (first use in this function)
   RegAddr = TMC423_ENC_CONF_3;
             ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c:93:2: warning: implicit declaration of function 'Write423Bytes' [-Wimplicit-function-declaration]
  Write423Bytes(RegAddr, 0, ps >> 16, ps >> 8, (uint8_t) ps);
  ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c: At top level:
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c:106:9: error: conflicting types for 'ReadEncoder'
 int32_t ReadEncoder(uint8_t Index)
         ^
IIn file included from .pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c:18:0:

.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.h:14:10: note: previous declaration of 'ReadEncoder' was here
  int32_t ReadEncoder(uint8_t Which423, uint8_t Index);
          ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c: In function 'ReadEncoder':
..pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c:114:17: error: 'TMC423_ENC_DATA_1' undeclared (first use in this function)

   Write424[0] = TMC423_ENC_DATA_1;
                 ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4210\TMC4210.c: In function 'ReadWrite4210':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c:117:17: error: 'TMC423_ENC_DATA_2' undeclared (first use in this function)
   Write424[0] = TMC423_ENC_DATA_2;
                 ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c:120:17: error: 'TMC423_ENC_DATA_3' undeclared (first use in this function)
   Write424[0] = TMC423_ENC_DATA_3;
                 ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c:131:24: warning: left shift count >= width of type [-Wshift-count-overflow]
  Position = (Read424[1]<<16) | (Read424[2]<<8) | Read424[3];
                        ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c: In function 'WriteEncoder':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c:154:13: error: 'TMC423_ENC_DATA_1' undeclared (first use in this function)
   RegAddr = TMC423_ENC_DATA_1;
             ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c:157:13: error: 'TMC423_ENC_DATA_2' undeclared (first use in this function)
   RegAddr = TMC423_ENC_DATA_2;
             ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c:160:13: error: 'TMC423_ENC_DATA_3' undeclared (first use in this function)
   RegAddr = TMC423_ENC_DATA_3;
             ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c: At top level:
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c:179:9: error: conflicting types for 'ReadEncoderNullChannel'
 uint8_t ReadEncoderNullChannel(uint8_t Index)
         ^
In file included from .pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.c:18:0:
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC424\TMC424.h:16:10: note: previous declaration of 'ReadEncoderNullChannel' was here
  uint8_t ReadEncoderNullChannel(uint8_t Which424, uint8_t Index);
          ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4210\TMC4210.c:34:12: warning: implicit declaration of function 'ReadWriteSPI' [-Wimplicit-function-declaration]
  Read[0] = ReadWriteSPI(SPI_DEV_TMC4210, Write[0], FALSE);
            ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4210\TMC4210.c:34:25: error: 'SPI_DEV_TMC4210' undeclared (first use in this function)
   Read[0] = ReadWriteSPI(SPI_DEV_TMC4210, Write[0], FALSE);

                         ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4210\TMC4210.c:34:25: note: each undeclared identifier is reported only once for each function it appears in
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4210\TMC4210.c:34:52: error: 'FALSE' undeclared (first use in this function)
  Read[0] = ReadWriteSPI(SPI_DEV_TMC4210, Write[0], FALSE);
                                                    ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4210\TMC4210.c:37:52: error: 'TRUE' undeclared (first use in this function)
  Read[3] = ReadWriteSPI(SPI_DEV_TMC4210, Write[3], TRUE);
                                                    ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4210\TMC4210.c:32:10: warning: unused variable 'Motor' [-Wunused-variable]
  uint8_t Motor;
          ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4210\TMC4210.c: At top level:
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4210\TMC4210.c:108:6: error: conflicting types for 'Write4210Short'
 void Write4210Short(uint8_t Address, int32_t Value)
      ^
In file included from .pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4210\TMC4210.c:18:0:
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4210\TMC4210.h:19:6: note: previous declaration of 'Write4210Short' was here
 void Write4210Short(uint8_t Address, int Value);
      ^
..pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4210\TMC4210.c:127:6: error: conflicting types for 'Write4210Int'

 void Write4210Int(uint8_t Address, int32_t Value)
      ^
In file included from .pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4210\TMC4210.c:18:0:
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4210\TMC4210.h:20:6: note: previous declaration of 'Write4210Int' was here
 void Write4210Int(uint8_t Address, int Value);
      ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4210\TMC4210.c: In function 'Read4210Status':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4330\TMC4330.c: In function 'tmc4330_writeDatagram':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4210\TMC4210.c:149:22: error: 'SPI_DEV_TMC4210' undeclared (first use in this function)
  return ReadWriteSPI(SPI_DEV_TMC4210, 0x01, TRUE);
                      ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4210\TMC4210.c:149:45: error: 'TRUE' undeclared (first use in this function)
  return ReadWriteSPI(SPI_DEV_TMC4210, 0x01, TRUE);
                                             ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4210\TMC4210.c: In function 'Read4210Int':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4210\TMC4210.c:241:19: warning: left shift count >= width of type [-Wshift-count-overflow]
  Result = (Read[1]<<16) | (Read[2]<<8) | Read[3];
                   ^
..pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4330\TMC4330.c:26:14: warning: left shift count >= width of type [-Wshift-count-overflow]

  value = (x1 << 24) | (x2 << 16) | (x3 << 8) | x4;
              ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4330\TMC4330.c:26:27: warning: left shift count >= width of type [-Wshift-count-overflow]
  value = (x1 << 24) | (x2 << 16) | (x3 << 8) | x4;
                           ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4210\TMC4210.c: In function 'Init4210':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4210\TMC4210.c:374:25: error: 'Motor' undeclared (first use in this function)
   Write4210Zero(addr | (Motor<<5));
                         ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.c: In function 'ReadWrite429':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.c:32:12: warning: implicit declaration of function 'ReadWriteSPI' [-Wimplicit-function-declaration]
  Read[0] = ReadWriteSPI(SPI_DEV_TMC429, Write[0], FALSE);
            ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.c:32:25: error: 'SPI_DEV_TMC429' undeclared (first use in this function)
  Read[0] = ReadWriteSPI(SPI_DEV_TMC429, Write[0], FALSE);
                         ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.c:32:25: note: each undeclared identifier is reported only once for each function it appears in
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.c:32:51: error: 'FALSE' undeclared (first use in this function)
  Read[0] = ReadWriteSPI(SPI_DEV_TMC429, Write[0], FALSE);
                                                   ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4210\TMC4210.c: In function 'Read4210Status':
..pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4210\TMC4210.c:150:1: warning: control reaches end of non-void function [-Wreturn-type]

 }
 ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.c:35:51: error: 'TRUE' undeclared (first use in this function)
  Read[3] = ReadWriteSPI(SPI_DEV_TMC429, Write[3], TRUE);
                                                    ^

.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.c: At top level:
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.c:106:6: error: conflicting types for 'Write429Short'
 void Write429Short(uint8_t Address, int32_t Value)
      ^
In file included from .pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.c:18:0:
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.h:19:7: note: previous declaration of 'Write429Short' was here
  void Write429Short(uint8_t Address, int Value);
       ^
*** [.pio\build\nanoatmega328\lib0bc\TMC-API\tmc\ic\TMC262\TMC262.c.o] Error 1
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.c:125:6: error: conflicting types for 'Write429Int'
 void Write429Int(uint8_t Address, int32_t Value)
      ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4330\TMC4330.c: In function 'tmc4330_readInt':
*** [.pio\build\nanoatmega328\lib0bc\TMC-API\tmc\ic\TMC424\TMC424.c.o] Error 1
In file included from .pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.c:18:0:
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.h:20:7: note: previous declaration of 'Write429Int' was here
  void Write429Int(uint8_t Address, int Value);
       ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4330\TMC4330.c:56:19: warning: left shift count >= width of type [-Wshift-count-overflow]
  value = (data[1] << 24) | (data[2] << 16) | (data[3] << 8) | data[4];
                   ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4330\TMC4330.c:56:37: warning: left shift count >= width of type [-Wshift-count-overflow]
  value = (data[1] << 24) | (data[2] << 16) | (data[3] << 8) | data[4];
                                     ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.c: In function 'Read429Status':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.c:147:22: error: 'SPI_DEV_TMC429' undeclared (first use in this function)
  return ReadWriteSPI(SPI_DEV_TMC429, 0x01, TRUE);
                      ^
*** [.pio\build\nanoatmega328\lib0bc\TMC-API\tmc\ic\TMC4210\TMC4210.c.o] Error 1
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.c:147:44: error: 'TRUE' undeclared (first use in this function)
  return ReadWriteSPI(SPI_DEV_TMC429, 0x01, TRUE);
                                            ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.c: In function 'Read429Int':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.c:239:19: warning: left shift count >= width of type [-Wshift-count-overflow]
  Result = (Read[1]<<16) | (Read[2]<<8) | (Read[3]);
                   ^
..pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.c: In function 'SetAMax':

.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.c:323:36: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
   p = AMax / ( 128.0 * (1<<ramp_div-pulse_div));  // Exponent positive or 0
                                    ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.c:325:37: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
   p = AMax / ( 128.0 / (1<<pulse_div-ramp_div));  // Exponent negative
                                     ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.c: In function 'Init429':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.c:379:25: error: 'TMC429_IDX_XLATCHED' undeclared (first use in this function)
   for(addr = 0; addr <= TMC429_IDX_XLATCHED; addr++)
                         ^
In file included from .pio\libdeps\nanoatmega328\TMC-API/tmc/helpers/API_Header.h:12:0,
                 from .pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4330\TMC4330.h:11,
                 from .pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4330\TMC4330.c:8:
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4330\TMC4330.c: In function 'tmc4330_calibrateClosedLoop':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.c: In function 'Read429Status':
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC429\TMC429.c:148:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
.pio\libdeps\nanoatmega328\TMC-API/tmc/helpers/Macros.h:33:36: warning: left shift count >= width of type [-Wshift-count-overflow]
  (((data) & (~(mask))) | (((value) << (shift)) & (mask)))
                                    ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4330\TMC4330.h:20:35: note: in expansion of macro 'FIELD_SET'
  (tmc4330_writeInt(tdef, address, FIELD_SET(tmc4330_readInt(tdef, address), mask, shift, value)))
                                   ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4330\TMC4330.c:288:3: note: in expansion of macro 'TMC4330_FIELD_UPDATE'
    TMC4330_FIELD_UPDATE(tmc4330, TMC4330_ENC_IN_CONF, TMC4330_CL_CALIBRATION_EN_MASK, TMC4330_CL_CALIBRATION_EN_SHIFT, 0);

   ^
.pio\libdeps\nanoatmega328\TMC-API/tmc/helpers/Macros.h:33:36: warning: left shift count >= width of type [-Wshift-count-overflow]
  (((data) & (~(mask))) | (((value) << (shift)) & (mask)))
                                    ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4330\TMC4330.h:20:35: note: in expansion of macro 'FIELD_SET'
  (tmc4330_writeInt(tdef, address, FIELD_SET(tmc4330_readInt(tdef, address), mask, shift, value)))
                                   ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4330\TMC4330.c:291:3: note: in expansion of macro 'TMC4330_FIELD_UPDATE'
   TMC4330_FIELD_UPDATE(tmc4330, TMC4330_ENC_IN_CONF, TMC4330_REGULATION_MODUS_MASK, TMC4330_REGULATION_MODUS_SHIFT, 1);
   ^
*** [.pio\build\nanoatmega328\lib0bc\TMC-API\tmc\ic\TMC429\TMC429.c.o] Error 1
.pio\libdeps\nanoatmega328\TMC-API/tmc/helpers/Macros.h:33:36: warning: left shift count >= width of type [-Wshift-count-overflow]
  (((data) & (~(mask))) | (((value) << (shift)) & (mask)))
                                    ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4330\TMC4330.h:20:35: note: in expansion of macro 'FIELD_SET'
  (tmc4330_writeInt(tdef, address, FIELD_SET(tmc4330_readInt(tdef, address), mask, shift, value)))
                                   ^
..pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4330\TMC4330.c:298:3: note: in expansion of macro 'TMC4330_FIELD_UPDATE'

   TMC4330_FIELD_UPDATE(tmc4330, TMC4330_ENC_IN_CONF, TMC4330_CL_CALIBRATION_EN_MASK, TMC4330_CL_CALIBRATION_EN_SHIFT, 1);
   ^
.pio\libdeps\nanoatmega328\TMC-API/tmc/helpers/Macros.h:33:36: warning: left shift count >= width of type [-Wshift-count-overflow]
  (((data) & (~(mask))) | (((value) << (shift)) & (mask)))
                                     ^

.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4330\TMC4330.h:20:35: note: in expansion of macro 'FIELD_SET'
  (tmc4330_writeInt(tdef, address, FIELD_SET(tmc4330_readInt(tdef, address), mask, shift, value)))
                                   ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4330\TMC4330.c:307:3: note: in expansion of macro 'TMC4330_FIELD_UPDATE'
   TMC4330_FIELD_UPDATE(tmc4330, TMC4330_ENC_IN_CONF, TMC4330_CL_CALIBRATION_EN_MASK, TMC4330_CL_CALIBRATION_EN_SHIFT, 0);
   ^
.pio\libdeps\nanoatmega328\TMC-API/tmc/helpers/Macros.h:33:36: warning: left shift count >= width of type [-Wshift-count-overflow]
  (((data) & (~(mask))) | (((value) << (shift)) & (mask)))
                                    ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4330\TMC4330.h:20:35: note: in expansion of macro 'FIELD_SET'
  (tmc4330_writeInt(tdef, address, FIELD_SET(tmc4330_readInt(tdef, address), mask, shift, value)))
                                   ^
.pio\libdeps\nanoatmega328\TMC-API\tmc\ic\TMC4330\TMC4330.c:309:3: note: in expansion of macro 'TMC4330_FIELD_UPDATE'
   TMC4330_FIELD_UPDATE(tmc4330, TMC4330_ENC_IN_CONF, TMC4330_REGULATION_MODUS_MASK, TMC4330_REGULATION_MODUS_SHIFT, 1);
   ^
================================================================== [FAILED] Took 5.65 seconds ========

Some of the errors from above snippet:
conflicting types for 'ReadEncoder'
'TMC423_ENC_CONF_1' undeclared
'SPI_DEV_ENCODER' undeclared
'TRUE' undeclared
'FALSE' undeclared

The warnings are due to the Arduino having a 16-bit int data type - sizeof(int) == 2 is true on Arduino. While technically wrong, these should all work fine in practise.

The errors are all coming from the ICs TMC262, TMC424, TMC4210 and TMC429. These have not been modified in a while and are not actively used in our reference project, the TMC-EvalSystem[1] - hence the issues with them. Removing them is the easiest way to deal with this for you, as you aren't using those.

[1]: This is the spot where the .c files for compilation are selected. Not all API files are in here: https://github.com/trinamic/TMC-EvalSystem/blob/c3bcfc27953a8fea07c24dbe2e4d3dffb0bdaf76/Makefile#L71

Fixed in 59c44a5

To fix the multiple typedef errors/warnings, uncomment the two new defines in Types.h or alternatively supply the defines through your build process. For example, when using a Makefile build, add the flags -DTMC_SKIP_UINT_TYPEDEFS -DTMC_SKIP_INT_TYPEDEFS to the compiler flags