AnsweredAssumed Answered

HAL_I2C_Master_Transmit() "too few arguments"

Question asked by Takayoshi Ishii on Jul 18, 2017
Latest reply on Jul 18, 2017 by Takayoshi Ishii

Hello, I'm new with STM32 and this is the first time for using I2C on STM32.

My environment is Keil5+cubeMX4.22.

 

I can make the config by cube and I wrote following code, but couldn't compile it.

 

uint8_t c[5] ={'a', 'b', 'c', 'd', 'e'};
HAL_I2C_Master_Transmit(&hi2c1, (uint16_t)0b00111110<<1, (uint8_t*)c, 1, 1000);

 

Build Output said "too few arguments" but I think the function has just four arguments, that as I wrote.

All error output is like this,

 

*** Using Compiler 'V5.06 update 5 (build 528)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
Build target 'moxom_a1'
compiling main.c...
../Src/main.c(102): error: #165: too few arguments in function call
HAL_I2C_Master_Transmit(&hi2c1, (uint16_t)0b00111110<<1, (uint8_t*)c, 1, 1000);
../Src/main.c(102): error: #18: expected a ")"
HAL_I2C_Master_Transmit(&hi2c1, (uint16_t)0b00111110<<1, (uint8_t*)c, 1, 1000);
../Src/main.c(100): warning: #177-D: variable "c" was declared but never referenced
uint8_t c[5] ={'a', 'b', 'c', 'd', 'e'};
../Src/main.c: 1 warning, 2 errors
"moxom_a1\moxom_a1.axf" - 2 Error(s), 1 Warning(s).
Target not created.
Build Time Elapsed: 00:00:01

Outcomes