Shopping Cart | 中文网站
 
 

Development Environment

Xilinx SDSoC (1)

HMI Solutions

MYD-Y6ULX-CHMI (i.MX 6UL/6ULL) (1)

MY-EVC5100S-HMI (TI AM335x) (1)

Single Board Computers

MYS-6ULX (NXP i.MX 6UL/6ULL) (2)

Rico Board (TI AM437x) (1)

Z-turn Board (Xilinx Zynq-7010/20) (1)

Z-turn Lite (Xilinx Z-7007S/7010) (1)

MYS-SAM9X5 (Atmel SAM9X5) (1)

MYS-SAM9G45 (Atmel SAM9G45) (1)

MYS-S5PV210 (Samsung S5PV210) (1)

CPU Modules

MYC-JX8MX (NXP i.MX8M) (1)

MYC-Y6ULX (NXP i.MX 6UL/6ULL) (1)

MYC-C7Z010/20 (Zynq-7010/20) (1)

MYC-Y7Z010/007S (Zynq-7010) (1)

MYC-C7Z015 (Xilinx Zynq-7015) (1)

MYC-C437X (TI AM437x) (1)

MYC-AM335X (TI AM335x) (1)

MCC-AM335X-Y (TI AM335x) (1)

MCC-AM335X-J (TI AM335x) (1)

MYC-IMX28X (NXP i.MX28) (1)

MYC-SAMA5D3X (Atmel A5D3) (1)

MYC-JA5D4X (Atmel A5D4) (1)

MYC-JA5D2X (Atmel A5D2) (1)

MCC-SAMA5D3X-C (Atmel A5D3) (1)

MYC-SAM9X5 (Atmel SAM9X5) (1)

MYC-SAM9X5-V2 (Atmel SAM9X5) (1)

MYC-S5PV210 (Samsung S5PV210) (1)

MYC-Exynos4412 (Samsung) (1)

Development Boards

MYD-C7Z015 (Xilinx Zynq-7015) (1)

MYD-C7Z010/20 (Zynq-7010/20) (1)

MYD-Y7Z010/007S (Zynq-7010) (1)

MYD-JX8MX (NXP i.MX8M) (1)

MYD-Y6ULX-HMI (i.MX 6UL/6ULL) (1)

MYD-Y6ULX (NXP i.MX 6UL/6ULL) (1)

MYD-IMX28X (NXP i.MX28) (1)

MYD-C437X (TI AM437x) (1)

MYD-C437X-PRU (TI AM437x) (1)

MYD-AM335X (TI AM335x) (1)

MYD-AM335X-J (TI AM335x) (1)

MYD-AM335X-Y (TI AM335x) (1)

MYD-JA5D2X (Atmel A5D2) (1)

MYD-JA5D4X (Atmel A5D4) (1)

MYD-SAMA5D3X (Atmel A5D3) (1)

MYD-SAMA5D3X-C (Atmel A5D3) (1)

MYD-SAM9X5 (Atmel SAM9X5) (1)

MYD-SAM9X5-V2 (Atmel SAM9X5) (1)

MYD-LPC185X (NXP LPC185x) (2)

MYD-LPC435X (NXP LPC435x) (2)

MYD-LPC1788 (NXP LPC1788) (1)

Add-on Options

Z-turn IO Cape (for Z-turn Board) (1)

Z-turn Lite IO Cape (for Z-turn Lite) (1)

MYD-Y7Z010/007S IO Cape (1)

MYB-Y6ULX-HMI-4GEXP (1)

MYB-6ULX (for MYS-6ULX) (1)

MY-LCD43TP LCD Module (1)

MY-LCD70TP LCD Module (1)

MY-LCD70TP-C LCD Module (1)

MY-WF003U USB WiFi Module (1)

MY-WF004S SDIO WiFi Module (1)

MY-CAM002U Camera Module (1)

MY-CAM011B BUS Camera Module (1)

MY-UART012U Convertor (1)

MY-CAM003M Camera Module (1)

MY-SODIMM200 Socket (1)

MY-ZB010C ZigBee Module (1)

MY-ZB010C-E ZigBee EVM (1)

    Product Updates
          Products >  Development Boards >  MYD-AM335X (TI AM335x) > MYD-AM335X Development Board
 
MYD-AM335X Development Board

MYD-AM335X Development Board

- MYC-AM335X CPU Module as Controller Board
- Up to 1GHz TI AM335X Series ARM Cortex-A8 Processors
- 512MB DDR3 SDRAM (256MB compatible)
- 512MB Nand Flash (256MB compatible)
- Serial ports, 4 x USB Host, OTG, 2 x Gigabit Ethernet, CAN, RS485, TF, Audio
- Supports HDMI and LCD Display
- Optional 4.3- or 7- inch LCD Module
- Supports for Linux 4.1.18
 

MYIR is a third party partner of TI, welcome to use MYIR's TI products!
We also offer custom design services, welcome your inquiry!

http://www.ti.com/devnet/docs/catalog/endequipmentproductfolder.tsp?actionPerformed=productFolder&productId=22720


The MYD-AM335X Development Board designed by MYIR is a high-performance ARM Evaluation Module (EVM) using the MYC-AM335X CPU module as the core controller board. It is based on up to 1GHz
Texas Instruments (TI) Sitara AM335x family of ARM Cortex-A8 Microprocessors (MPUs) that deliver high DMIPs at a low cost while also delivering optional 3D graphics acceleration and key peripherals. These TI Cortex-A8 MPUs include industrial interface options, such as EtherCAT and PROFIBUS, and can support the Linux, Android and Windows CE high-level operating systems. The combination of graphics and connectivity support makes TI AM335x MPUs ideal for home automation, industrial automation, enterprise/educational tablets, portable navigation devices and networking. The board can work in harsh environment supporting -40 to +85 Celsius extended temperature operation for industrial embedded applications.


MYD-AM335X Development Board


The TI AM335x consists of 6 pin-pin compatible devices (AM3352, AM3354, AM3356, AM3357, AM3358 and AM3359) with various options including speed grades, packages, graphics and peripherals. MYIR is using the 15x15 mm, 0.8-mm ball pitch, ZCZ package AM335x ARM CPU on the MYC-AM335X CPU Module which is an SOM (System on Module) and has the core components AM335x processor, 512MB DDR3 SDRAM, 512MB Nand Flash and Gigabit Ethernet PHY chip on board and can be served as the core of your embedded system. It has two 2.0mm pitch 60-pin male expansion connectors, one 2.0mm pitch 26-pin interface and one 2.0mm pitch 10-pin interface to allow extension of all the controller signals and ports to the base board through headers and connectors, thus exposing more features of the AM335x Cortex-A8 Processors.


MYC-AM335X CPU Module


The MYD-AM335X base board has extended many features and peripherals with the support of the MYC-AM335X SOM and some extended controller chips including two serial ports, four USB Host ports, one USB OTG port, dual Gigabit Ethernet ports, one CAN, one RS485, one Micro SD, HDMI, LCD, Touch screen and more others.


User can integrate a different MYC-AM335X SOM on the same base board, thus making six variants of AM335x evaluation boards.

MYD-AM3359 Development Board – with MYC-AM3359 CPU Module for TI AM3359

MYD-AM3358 Development Board – with MYC-AM3358 CPU Module for TI AM3358

MYD-AM3357 Development Board – with MYC-AM3357 CPU Module for TI AM3357

MYD-AM3356 Development Board – with MYC-AM3356 CPU Module for TI AM3356

MYD-AM3354 Development Board – with MYC-AM3354 CPU Module for TI AM3354

MYD-AM3352 Development Board – with MYC-AM3352 CPU Module for TI AM3352



The MYD-AM335X series ARM Cortex-A8 boards have many features in common only with some differences depending on the AM335x Cortex-A8 CPU features. You can get to know the differences from above image.


The MYD-AM335X board comes with Linux 4.1.18 software packages, detailed documents, necessary cable accessories as well as optional 4.3- and 7-inch LCD (with touch screen) to provide an AM335x starter kit and enable a quickly start of evaluation of AM335x Cortex-A8 MPUs.


Features

Mechanical Parameters

  • Dimensions: 130mm x 100mm (base board), 70mm x 50mm (CPU Module)
  • PCB Layers: 4-layer design (base board), 8-layer design (CPU Module)
  • Power supply: +5V/2A (base board), +3.3V/0.8A (CPU Module)
  • Working temperature: 0~70 Celsius (commercial grade) or -40~85 Celsius (industrial grade)

OS Support

  • Linux 4.1.18

The MYD-AM335X Controller Board (MYC-AM335X CPU Module)

Processor

  • TI AM3352, AM3354, AM3356, AM3357, AM3358, AM3359 (15x15 mm, 0.8-mm ball pitch, ZCZ package)
    - 800MHz ARM Cortex-A8 32-bit RISC MPU (Up to 1GHz)
    - NEON™ SIMD Coprocessor
    - 32KB/32KB of L1 Instruction/Data Cache with Single-Error Detection (parity)
    - 256KB of L2 Cache with Error Correcting Code (ECC)
    - SGX530 Graphics Engine
    - Programmable Real-Time Unit Subsystem

Memory

  • 512MB (2*256MB) DDR3 SDRAM (2*128MB compatible)
  • 512MB Nand Flash (256MB compatible)

Peripherals and Signals Routed to Pins

  • On-board Gigabit Ethernet PHY
  • One power indicator (Red LED)
  • One user LED (Green)
  • Two 2.0mm pitch 60-pin expansion connectors can carry out interfaces below
    - 2 x USB2.0 OTG ports
    - 6 x Serial ports
    - 2 x I2C
    - 1 x SPI
    - 7 x ADC
    - 2 x PWM
    - 3 x SDIO
  • One 2.0mm pitch 26-pin expansion connector
  • One 2.0mm pitch 10-pin expansion connector

The MYD-AM335X Base Board

  • Serial ports
    - 1 x 3-wire RS232 Debug serial port (DB9)
    - 1 x 3-wire RS232 serial port (UART1)
    - 1 x RS485 (with isolation)
  • USB
    - 4 x USB2.0 Host ports
    - 1 x USB2.0 OTG ports
  • 2 x 10/100/1000Mbps Ethernet interfaces
  • 1 x CAN interface (with isolation)
  • 1 x TF card slot
  • 1 x HDMI interface
  • 1 x LCD interface (16-bit true color, supports optional 4.3-inch and 7-inch TFT LCD with 4.3-inch resistive or 7-inch resistive or 7-inch capacitive touch screen)
  • 1 x 4-wire resistive touch screen interface
  • 1 x Audio input port (3.5mm jack)
  • 1 x Stereo Audio output port (3.5mm jack)
  • 4 x Buttons (1 x Reset button, 3 x User buttons)
  • 1 x Power indicator (Red LED)
  • 2 x 2.0mm 20-pin expansion connectors
    - 7 x ADC
    - 1 x SPI
    - 2 x I2C
    - 4 x UART

MYD-AM335X in the Video

http://youtu.be/FWbSG2Q-8NM



Hardware Specification

The MYD-AM335X series ARM Cortex-A8 boards have many features in common only with some differences depending on the AM335x Cotex-A8 CPU features. You can get to know the differences and more features of the AM335x series processors from below table. MYIR deliveries the MYD-AM3352 and MYD-AM3359 by default according to customer’s specified model. Other four models are only available for mass quantity demand.

The
TI AM335x microprocessors, based on the ARM Cortex-A8, operating at up to 1GHz, are enhanced with image, graphics processing, peripherals and industrial interface options such as EtherCAT and PROFIBUS. The device supports the following high-level operating systems (HLOSs) that are available free of charge from TI:

  • Linux®
  • Android™

The AM335x microprocessor contains these subsystems:

  • Microprocessor unit (MPU) subsystem based on the ARM Cortex-A8 microprocessor.
  • POWERVR SGX™ Graphics Accelerator subsystem for 3D graphics acceleration to support display and gaming effects.
  • The Programmable Real-Time Unit and Industrial Communication Subsystem (PRU-ICSS) is separate from the ARM core, allowing independent operation and clocking for greater efficiency and flexibility.
  • The PRU-ICSS enables additional peripheral interfaces and real-time protocols such as EtherCAT, PROFINET, EtherNet/IP, PROFIBUS, Ethernet Powerlink, Sercos, and others.

AM335x ARM Cortex™-A8 Processors

Core Feature

AM3352

AM3354

AM3356

AM3357

AM3358

AM3359

Package

15x15mm, 0.8mm (ZCZ)

CPU Speed (MHz)

300, 600, 800, 1000

600, 800,1000

300, 600,800

300, 600,800

600, 800,1000

800

Core Internal Memory

64KB SRAM shared w/
Data 32KB Cache, Programmable 32KB Cache

On-chip L2 (KB)

256

External Memory Interface

DDR2/DDR3/DDR3L/mDDR (LPDDR), 2x16-bit, NAND ECC

Graphics

-

3D Graphics

-

3D Graphics

OS Support

Linux, Android, RTOS, Windows Embedded, no-OS

Other Hardware Acceleration

Crypto Accelerator

Crypto
Accelerator

2 PRU-ICSS
Crypto Accelerator

2 PRU-ICSS
Crypto Accelerator   + EtherCAT slave support

2 PRU-ICSS
Crypto Accelerator

2 PRU-ICSS
Crypto Accelerator
+ EtherCAT slave support

10/100/1000 EMAC

2 port switch

USB 2.0 OTG + PHY

2

Serial Ports

6 UART, 2 SPI, 3 I2C, 2 McASP, 2 CAN, 8 Timers

System

EDMA, WDT, RTC, 3 eQEP, 3 eCAP, JTAG, ADC (8ch)

Parallel

3 MMC/SD/SDIO, GPIO


Function Block Diagram of MYD-AM335X



Dimension Chart of MYD-AM335X


Software Features

MYIR’s AM335x Starter Kit MYD-AM335X supports for Linux and is provided with software packages. Many peripheral drivers are in source code to help accelerate customers’ designs with a stable and reliable hardware and software platform. The software features are summarized as below:


OS

Item

Features

Description

Linux

Bootstrap program

SPL

The primary bootstrap

u-boot

The secondary bootstrap

Kernel

Version

Linux 4.1.18

Drivers

USB OTG, USB WiFi, Gigabit Ethernet, MMC/SD/TF, NandFlash, CAN, RS485, Audio, LCD Controller (supports 4.3- and 7-inch LCD), RTC, HDMI, Touch driver, Button, UART, LED

File system

Buildroot

With QT library (V5.6.2)

Provide image file and buildroot in source code

Examples

Audio, CAN, EEPROM, framebuffer, gpio, keypad, led, mtd, network, rtc, RS232, RS485




Relative Download and Links

You can download relative chip datasheet, products datasheet, user manual, software package from below. Any inquiry, please contact MYIR.


1 TI AM335x Datasheet 2.80 MB
2 TI AM335x Technical Reference Manual 19.7 MB
3 MYD-AM335X Development Board Overview 1.12 MB
4 MYC-AM335X CPU Module Overview 1.03 MB
5 MYC-AM335X CPU Module Dimensions 844 KB
6 MYD-AM335X Development Board Dimensions 138 KB



MYD-AM335X Development Board



MYC-AM335X CPU Module Top-view



MYC-AM335X CPU Module Bottom-view



MYD-AM335X Development Board Base Board


Price and Ordering

Item

Part No.

Unit Price

Ordering

MYD-AM335X Development Board
(commercial, 512MB DDR3, 512MB Flash)

MYD-C3352-512N512D-80-C

USD139

MYD-C3358-512N512D-100-C
USD139

MYD-AM335X Development Board

(industrial, 512MB DDR3, 512MB Flash)

MYD-C3352-512N512D-80-I USD159

MYD-C3358-512N512D-100-I
USD159

MYD-AM335X Development Board

(industrial, 256MB DDR3, 256MB Flash)

MYD-C3352-256N256D-80-I USD139

MYD-C3358-256N256D-100-I
USD139

MYC-AM335X CPU Module

(commercial, 512MB DDR3, 512MB Flash)

MYC-C3352-512N512D-80-C USD68
MYC-C3358-512N512D-100-C
USD68

MYC-AM335X CPU Module

(industrial, 512MB DDR3, 512MB Flash)

MYC-C3352-512N512D-80-I USD88
MYC-C3358-512N512D-100-I
USD88

MYC-AM335X CPU Module

(industrial, 256MB DDR3, 256MB Flash)

MYC-C3352-256N256D-80-I USD68

MYC-C3358-256N256D-100-I
USD68

MY-LCD43TP 4.3 inch LCD Module with resistive touch screen

MY-TFT043RV2

USD60

MY-LCD70TP 7 inch LCD Module with resistive touch screen

MY-TFT070RV2

USD99

MY-LCD70TP-C 7 inch LCD Module with capacitive touch screen
MY-TFT070CV2
USD99

Note:

1. One MYD-AM335X Development Board includes one CPU module MYC-AM335X mounted on the base board by default. If you need more CPU module, you can order extra ones.

2 . We deliver the board with 800MHz AM3352 or 1GHz AM3358 by default. If you need other CPU model, RAM or Flash configuration, please contact MYIR for availability.

3. Discount is available for mass orders. Please contact MYIR for inquires.

4. The boards of commercial grade  can work in temperature ranging from 0~70 Celsius. The boards of industrial grade can work in temperature ranging from -40~85 Celsius. The HDMI chip on board can only work in temperature ranging from -20~70 Celsius.

5. We accept custom design based on the MYD-AM335X, whether reducing, adding or modifying the existing hardware according to customer’s requirement.




Packing List

NO. Item Qty Description
1 MYD-AM335X board 1pc MYD-AM3352/MYD-AM3358
2 Power adapter 1pc 5V/2A Power adapter
3 Ethernet cable 1pc
4 USB Cable 1pc
5 MY-LCD43TP (optional) 1pc 4.3 inch LCD with resistive touch screen
6 MY-LCD70TP (optional) 1pc 7 inch LCD with resistive touch screen
7 MY-LCD70TP-C (optional) 1pc 7 inch LCD with capacitive touch screen
8 DVD 1pc user manual, base board schematic in PDF format, datasheet, software package


More FAQ >>


1. ARM Linux GPIO sample code

Question:
Please download the sample code package from below link: http://www.myirtech.com/download/code/gpio.tar.gz (include source code, Makefile and image which is compiled using arm-none-linux-gnueabi-gcc)

Answer:

Source code


001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034
035
036
037
038
039
040
041
042
043
044
045
046
047
048
049
050
051
052
053
054
055
056
057
058
059
060
061
062
063
064
065
066
067
068
069
070
071
072
073
074
075
076
077
078
079
080
081
082
083
084
085
086
087
088
089
090
091
092
093
094
095
096
097
098
099
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
/********************************************************************
*                 copyright (C) 2014 all rights reserved
*                         @file: gpio.c
*                   @Created: 2014-8-6 15:00
*                      @Author: conway chen
*           @Description: test gpios interrupt
*          @Modify Date: 2014-8-6 15:00
*********************************************************************/
#include<stdio.h>
#include <stdlib.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<unistd.h>
#include<errno.h>
#include<string.h>
#include <poll.h>
 
#define SYSFS_GPIO_DIR "/sys/class/gpio"
#define GPIO_LED 41
#define MAX_BUF 60
#define POLL_TIMEOUT (3 * 1000) /* 3 seconds */
#define OUT 1
#define IN 0
 
/**
 * brief: export the GPIO to user space
 * @Param: gpio: the GPIO number
 */
int gpio_export(unsigned int gpio)
{
        int fd ,len;
        char buf[MAX_BUF];
 
        fd = open(SYSFS_GPIO_DIR "/export" ,O_WRONLY);
        if (fd < 0) {
                perror("gpio/export");
                return fd;
        }
        len = snprintf(buf ,sizeof(buf) ,"%d" ,gpio);
        write(fd ,buf ,len);
        close(fd);
        return 0;
}
 
/**
 * brief: unexport the GPIO to user space
 * @Param: gpio: the GPIO number
 */ 
int gpio_unexport(unsigned int gpio)
{
        int fd ,len;
        char buf[MAX_BUF];
 
        fd = open(SYSFS_GPIO_DIR "/unexport" ,O_WRONLY);
        if (fd < 0) {
                perror("gpio/unexport");
                return fd;
        }
        len = snprintf(buf ,sizeof(buf) ,"%d" ,gpio);
        write(fd ,buf ,len);
        close(fd);
        return 0;
}
 
/**
 * brief: configure GPIO for input or output
 * @Param: gpio: the GPIO number
 * @Param: out_flag: the flag of output or input.It's value can be 1 or 0. 
 */
int gpio_set_dir(unsigned int gpio ,int out_flag)
{
        int fd ,len;
        char buf[MAX_BUF];
 
        len = snprintf(buf, sizeof(buf), SYSFS_GPIO_DIR "/gpio%d/direction", gpio);
        fd = open(buf ,O_WRONLY);
        if (fd < 0) {
                perror(buf);
                return fd;
        }
        if (out_flag)
                write(fd ,"out" ,4);
        else
                write(fd ,"in" ,3);
        close(fd);
        return 0;
}
 
/**
 * brief: Set the value of GPIO
 * @Param: gpio: the GPIO number
 * @Param: value: the value of GPIO. Supports values of 0 and 1.
 */ 
int gpio_set_value(unsigned int gpio, unsigned int value) 
    int fd, len; 
    char buf[MAX_BUF]; 
    
    len = snprintf(buf, sizeof(buf), SYSFS_GPIO_DIR "/gpio%d/value", gpio);     
    fd = open(buf, O_WRONLY);
        if (fd < 0) { 
        perror("gpio/set-value"); 
        return fd; 
    
    
    if (value) 
        write(fd, "1", 2); 
    else 
        write(fd, "0", 2); 
    
    close(fd); 
    return 0; 
}
 
/**
 * brief: get the value of GPIO
 * @Param: gpio: the GPIO number
 * @Param: value: pointer to the value of GPIO
 */
int gpio_get_value(unsigned int gpio, unsigned int *value)
{
        int fd, len;
        char ch;
        char buf[MAX_BUF];
 
        len = snprintf(buf ,sizeof(buf), SYSFS_GPIO_DIR "/gpio%d/value" ,gpio);
        fd = open(buf ,O_RDONLY);
        if (fd < 0) {
                perror("gpio_get_value");
                return fd;
        }
        read(fd ,&ch ,1);
        if (ch == '1')
                *value = 1;
        else if(ch == '0')
                        *value = 0;
        close(fd);
        return 0;
}
 
/**
 * brief: set the edge that trigger interrupt
 * @Param: gpio: the GPIO number
 * @Param: edge:  edge that trigger interrupt
 */
int gpio_set_edge(unsigned int gpio ,char *edge)
{
        int fd ,len;
        char buf[MAX_BUF];
 
        len = snprintf(buf ,sizeof(buf) ,SYSFS_GPIO_DIR "/gpio%d/edge" ,gpio);
        fd = open(buf ,O_WRONLY);
        if (fd < 0) {
                perror("gpio_set_edge");
                return fd;
        }
        write(fd ,edge ,strlen(edge) + 1);
        close(fd);
        return 0;
}
 
/**
 * brief: open gpio device and return the file descriptor
 * @Param: gpio: the GPIO number
 */ 
int gpio_fd_open(unsigned int gpio) 
    int fd, len; 
    char buf[MAX_BUF]; 
   
    len = snprintf(buf, sizeof(buf), SYSFS_GPIO_DIR "/gpio%d/value", gpio); 
    
    fd = open(buf, O_RDONLY | O_NONBLOCK ); 
    if (fd < 0) { 
        perror("gpio/fd_open"); 
    
    return fd; 
   
/**
 * brief: close gpio device
 * @Param: fd: the file descriptor of gpio
 */
int gpio_fd_close(int fd) 
    return close(fd); 
   
/**
 * @brief: main function
 * @Param: argc: number of parameters
 * @Param: argv: parameters list
 */ 
int main(int argc, char **argv) 
    struct pollfd *fdset; 
    int nfds = 1; 
    int gpio_fd, timeout, rc; 
    char *buf[MAX_BUF]; 
    unsigned int gpio; 
    int len;
    char *cmd;
    unsigned int value;
       
          fdset = (struct pollfd*)malloc(sizeof(struct pollfd)); 
   
    if (argc < 3) { 
        printf("Usage: %s <gpio-pin> <direction> [value]\n\n", argv[0]);       
        exit(-1); 
    }
    cmd = argv[2];
    gpio = atoi(argv[1]);
        gpio_export(gpio);
         
    if (strcmp(cmd, "interrupt") == 0) {
            printf("\n**************************GPIO interrupt***************************\n");