GPIO On Simple Digital Interface (SDI) : Page 1 of 3

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

GPIO on Simple Digital Interface (SDI)

Fig1: Interface pins of SDI

Fig 2: 25 pin Connector pin configuration on UTLP

Page 1 of 3
GPIO on Simple Digital Interface (SDI)
Table 1: GPIO Pin number, names, whether they are in or out
Connector GPIO Pin number and Signal Description IN/OUT voltage
Pin No. name
1 GPIO140(UART2_ CTS) Configured as GPIO pin number 140 OUT 5V
2 GPIO141(UART2_ RTS) Configured as GPIO pin number 141 OUT 5V
3 GPIO142(UART2_ TX) Configured as GPIO pin number 142 OUT 5V
4 GPIO143(UART2_ RX) Configured as GPIO pin number 143 OUT 5V
5 GPT8_PWM_EVT Configured as PWM signal OUT 5V
6 GPIO158 (McBSP1_DX) Configured as GPIO pin number 158 OUT 5V
7 GPIO162 (McBSP1_CLKX) Configured as GPIO pin number 162 OUT 5V
8 GND Ground ------ ------
9 GPIO161 (McBSP1_FSX) Configured as GPIO pin number 161 OUT 5V
10 GPIO159 (McBSP1_DR) Configured as GPIO pin number 159 IN 5V
11 GPIO156 (McBSP1_CLKR) Configured as GPIO pin number 156 IN 5V
12 GND Ground ------ ------
13 GPIO157 (McBSP1_FSR) Configured as GPIO pin number 157 IN 5V
14 GPIO12 (MMC3_CLK) Configured as GPIO pin number 12 IN 5V
15 GPIO13 (MMC3_CMD) Configured as GPIO pin number 13 IN 5V
16 GPIO14 (MMC3_D4) Configured as GPIO pin number 14 IN 5V
17 GPIO17 (MMC3_D3) Configured as GPIO pin number 17 IN 5V
18 GPIO18 (MMC3_D0) Configured as GPIO pin number 18 IN 5V
19 GPIO19 (MMC3_D1) Configured as GPIO pin number 19 IN 5V
20 GPIO20 (MMC3_D2) Configured as GPIO pin number 20 IN 5V
21 GND Ground ------ ------
22 GPIO22 (MMC3_D6) Configured as GPIO pin number 22 OUT 5V
23 GPIO23 (MMC3_D5) Configured as GPIO pin number 23 OUT 5V
24 5V 5V power signal ------ 5V
25 5V 5V power signal ------ 5V

Page 2 of 3
GPIO on Simple Digital Interface (SDI)
The following code will read the data on GPIO pin 12 in normal mode

#include "macros.h"
#include <ulk.h>
int main(void) PROGRAM_ENTRY;

int main ()
{
// This program gets data from GPIO 12. Refer to GPIO pin number and
// signal name column in the Table 1 to know pin number to be used
// in the program
uint8 temp=0;
ulk_proc_gpio_init();
// Set up pull up on pin 12
ulk_proc_sys_pad_set_pull(12,03);
// Enable the input buffer
ulk_proc_sys_pad_set_dir(12,1);
// Set the pin in GPIO mode
ulk_proc_sys_pad_set_mux_mode(12,4);
// Make the pin as input only pin by disabling the output buffer
ulk_proc_gpio_set_dir(12,1);//
// Read the data on GPIO pin into temp. Note the usage of pointer
ulk_proc_gpio_get_data_in(12,&temp);//
//I am able to print this value on control panel correctly
ulk_cpanel_printf("value=%d",temp);
}

The following code will write some data on GPIO pin 140 in normal mode

#include "macros.h"
#include <ulk.h>
int main(void) PROGRAM_ENTRY;

int main ()
{
// This program writes data on GPIO 140. Refer to GPIO pin number and
// signal name column in the Table 1 to know pin number to be used
// in the program
uint8 temp=0;
ulk_proc_gpio_init();
// Disable pull
ulk_proc_sys_pad_set_pull(140,0);
// Set the pin in GPIO mode
ulk_proc_sys_pad_set_mux_mode(140,4);
// Make the pin as output pin by enabling the output buffer
ulk_proc_gpio_set_dir(140,0);//
// Put the data on GPIO pin from temp. No pointer needed here
ulk_proc_gpio_set_data_out(140,temp);
// Now you can verify this value on the 25 pin connector
// When checking don’t forget to connect both pin and ground
// to your multi-meter or oscilloscope
}

Refer to the GPIO test code to find out how to use GPIO using ioctls in lab mode

Page 3 of 3

You might also like