Forum: Mikrocontroller und Digitale Elektronik STM32. PinBitAbfrage gefällt dem Compiler nicht


von Alex A. (Gast)


Lesenswert?

Hallo!

Habe gerade etwas total komisches :)
Ich will PA0 abfragen.
1
//User taster lesen
2
if(GPIO_ReadInputData(GPIOA, GPIO_Pin_0)){
3
Ebene2();
4
}
Und der Compiler sagt mir:
main.c:142:4: error: too many arguments to function 'GPIO_ReadInputData'

Benutze die standert GPIO lib von ST. Dort steht:
1
  * @brief  Reads the specified input port pin.
2
  * @param  GPIOx: where x can be (A..K) to select the GPIO peripheral for STM32F405xx/407xx and STM32F415xx/417xx devices
3
  *                      x can be (A..I) to select the GPIO peripheral for STM32F42xxx/43xxx devices.
4
  *                      x can be (A, B, C, D and H) to select the GPIO peripheral for STM32F401xx devices. 
5
  * @param  GPIO_Pin: specifies the port bit to read.
6
  *         This parameter can be GPIO_Pin_x where x can be (0..15).
7
  * @retval The input port pin value.
8
  */
9
uint8_t GPIO_ReadInputDataBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
10
{
11
  uint8_t bitstatus = 0x00;
12
13
  /* Check the parameters */
14
  assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
15
  assert_param(IS_GET_GPIO_PIN(GPIO_Pin));
16
17
.......

Also, was für`n Kack? :)

Komischerweise funktioniert if(GPIO_ReadOutputDataBit(GPIOG, 
GPIO_Pin_14)){
(Also OUTPUT lesen)


Danke
Grüße Alex S.

von Dr. Sommer (Gast)


Lesenswert?

Alex S. schrieb:
> uint8_t GPIO_ReadInputDataBit

Alex S. schrieb:
> if(GPIO_ReadInputData

Bemerkst du eine Diskrepanz??

von Steffen H. (Firma: www.shotech.de) (mc_sho) Benutzerseite


Lesenswert?

rufe doch einfach die richtige Funktion auf, dann passt das schon.

nicht GPIO_ReadInputData(...)  sondern GPIO_ReadInputDataBit(...)

von Alex A. (Gast)


Lesenswert?

Oh, ja :) Manchmal ist man ja echt blind.
Entschuldigung!

Danke schön.
Thema geschlossen.

Grüße Alex S.

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.