I. The GPIO control of MTK Platform
GPIO configuration in the 1.1 kernel
Set Gpio18 to Gpio mode
Mt_set_gpio_mode (GPIO18, Gpio_mode_gpio);
Set GPIO18 orientation to Out
Mt_set_gpio_dir (GPIO18, gpio_dir_out);
Set Gpio18 height
Mt_set_gpio_out (GPIO18, Gpio_out_one); Low is zero
1.2 Upper level application control Gpio
cong@msi:/work/mtk/temp/gpiotest$ Cat Gpiotest.c
#include <stdio.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <dirent.h>
#include <unistd.h>
#include <string.h>
#include <sys/ioctl.h>
#include <linux/ioctl.h>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.