cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the Arduino Connectors with the STEVAL-STLCX01V1 with the STEVAL-STLCS01V1 MCU

RFink
Associate II

Hello.

I want to use the Arduino Connectors on the STEVAL-STLCX01V1 board.

I know that i need to use the GPIO functions (in the "stm32l4xx_hal_gpio.c" library):

void HAL_GPIO_Init(GPIO_TypeDef  *GPIOx, GPIO_InitTypeDef *GPIO_Init)
 
void HAL_GPIO_DeInit(GPIO_TypeDef  *GPIOx, uint32_t GPIO_Pin)
 
void GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
 
void HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState)
 
void HAL_GPIO_TogglePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)

But i don't know how to use them. I mean, for example, if i want to use the D2 pin in the CN9 Arduino Connectors, what do i write in the GPIOx and GPIO_Pin variable?

How do i know which pin in the Arduino Connectors correspond to it's GPIOx and GPIO_Pin variable?

Also, after i know the GPIOx and GPIO_Pin that i want to use, how do i use them? i mean, which functions do i use to operate those pins?

Thank you for your help,

Reshef Finkelstein

1 REPLY 1

The pins are usually described in the manual or expressed via a schematic. The arduino software hides this stuff in a board specific pin table.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..