Page 1 of 1

GPIO Pins and their channels

Posted: Tue Apr 21, 2015 6:37 pm
by atypical
Hello,

I am very new to developing with the crazyflie so let me know if I am on the wrong track.

I am a little confused which channels belong to which GPIO pins. I referred to this image to choose a pin Image

I decided to use PB5 (IO_2) and am trying to figure out what channels belong to each of these GPIO pins. If someone can point in the right direction I would really appreciate it. What I am looking for something like this

PB8 (IO_2) = Channel ?
PB5 (IO_2) = Channel ?
PB4 (IO_3) = Channel ?
PC12 (IO_4) = Channel ?


Thank you very much!

Re: GPIO Pins and their channels

Posted: Wed Apr 22, 2015 8:29 am
by tobias
Hi and welcome!

I'm not sure what you mean by channel?
We are working on an easier to use API other then the ST lib but for now that is what one has to work with. In exptest.c there are defines for what GPIO is to what pin and port:

Code: Select all

#define ET_GPIO_PORT_TX1  GPIOC
#define ET_GPIO_PIN_TX1   GPIO_Pin_10
#define ET_GPIO_PORT_RX1  GPIOC
#define ET_GPIO_PIN_RX1   GPIO_Pin_11

#define ET_GPIO_PORT_TX2  GPIOA
#define ET_GPIO_PIN_TX2   GPIO_Pin_2
#define ET_GPIO_PORT_RX2  GPIOA
#define ET_GPIO_PIN_RX2   GPIO_Pin_3

#define ET_GPIO_PORT_SCK  GPIOA
#define ET_GPIO_PIN_SCK   GPIO_Pin_5
#define ET_GPIO_PORT_MOSI GPIOA
#define ET_GPIO_PIN_MOSI  GPIO_Pin_6
#define ET_GPIO_PORT_MISO GPIOA
#define ET_GPIO_PIN_MISO  GPIO_Pin_7

#define ET_GPIO_PORT_SDA  GPIOB
#define ET_GPIO_PIN_SDA   GPIO_Pin_7
#define ET_GPIO_PORT_SCL  GPIOB
#define ET_GPIO_PIN_SCL   GPIO_Pin_6

#define ET_GPIO_PORT_IO1  GPIOB
#define ET_GPIO_PIN_IO1   GPIO_Pin_8
#define ET_GPIO_PORT_IO2  GPIOB
#define ET_GPIO_PIN_IO2   GPIO_Pin_5
#define ET_GPIO_PORT_IO3  GPIOB
#define ET_GPIO_PIN_IO3   GPIO_Pin_4
#define ET_GPIO_PORT_IO4  GPIOC
#define ET_GPIO_PIN_IO4   GPIO_Pin_12
You can use that file as a base for how to setup your GPIOs using the ST lib or did you want to use some other functionality such as PWM?