Concept and role
It is unclear here that the basic architecture of GPIO in the actual computer, after all, is in the software level, to develop, so the hardware is ignorant. Especially in the kernel compilation process, there is a compilation problem, do not know how the kernel developers to solve the problem. The current problem is whether the server requires a GPIO module.In the actual MCU,
Mail: bookworepeng@Hotmail.com
QQ: 196568501
Author: drivemonkey
Undertake various embedded outsourcing projects (phone: 13410905075)
Two tools are available for Linux to debug gpio.
Dubugfs
The other is the gpio driver framework of Linux.
First, debugfs's usage for gpio debugging
1. debugfs on Mount
Mount-T debugfs/sys/kernel/debug
2. F
On a, with GPIO direct power to the LED, with high and low level for switch, not reliable. A GPIO is a signal, not a power supply. Moreover, a GPIO can only give poor 5mA or so, take more will burn (I did not burn do not know if it is really going to burn, but the instructions above is written). This is not playing, so I did the following transistor experiment.
Controller area network, is one of the most widely used fieldbus in the world. Initially,CANdesigned as a microcontroller in the automotive environment to communicate, in-vehicle electronic control devicesECUexchange of information between them, forming an electronic control network for automobiles. For example: engine management system, transmission controller, instrument equipment, electronic backbone system, are embeddedCANcontrol device. One byCANin a single network consisting of buses, it
1. Set the hardware environment as a macro definition to facilitate the hardware environment modification:
The setting contains three items: Gpio port, Gpio pin number, and GPIO port clock. Examples such as the following
#define Led1_pin gpio_pin_10
#define Led1_gpio_port gpioh
#define LED1_GPIO_CLK rcc_ Ahb1periph_gpioh
#define Led2
the Visual Studio 2015 development environmentRed, yellow, green 3 colors of light-emitting diodes220R ResistorGPIO Expansion BoardIDC LineDuPont LineBread Plate1. Installing componentsThe Gpio expansion board is first installed on the breadboard and then connected to the Gpio interface of the Raspberry Pi 2 via the IDC cable.The following start to connect the light-emitting diode, in order to ensure that
The STM32 I/O port can be configured in the following 8 modes: input float, input pull-up, input pull-down, analog input, open-drain output, push-pull output, push-pull multiplexing function and open-drain multiplexing function. Each I/O port is controlled by 7 registers: Configuration mode port configuration register CRL and CRH (mode, speed), data register IDR and ODR, set/reset register BSRR, reset register BRR, latch register Lckr.I/O port mode:
There are four small LED lights on the tianembedded 2440 Development Board. The random band test software is developed using C ++. However, I prefer the C # language, so through the analysis of the BSP package of tq2440, the four small LED lights are controlled through gpio ports. Therefore, as long as the C # is used to control the gpio port, it can make the LED light.
The key code is as follows:
First, d
Do not write homework to write a blog
Go straight to the topic
There are two pinsel0 and pinsel1 registers on the pins in the lpc2103, both of which are 32-bit widths.
Each of the two pinsel0 and pinsel1 registers controls a single pin. A single pin can have up to four features. Pinsel0 controls the p0.0 to ipv15 pins. Pinsel1 controls the pins of Segment 16 to segment 31.
The setting of the pinsel register takes only two steps. Find the pin you want to set. The second is the pin selection f
Target: A process on the board needs to read the value of the Gpio, when the Gpio value is 1 o'clock, the specified process is turned on, and when the Gpio is 0 o'clock, the specified process is killed.#include intMain () {FILE*pfile; while(1){ Const Char* FILEPATH ="/sys/class/gpio/gpio26/value"; Pfile= fopen
Android (Java) controls GPIO methods and time consumption analysis, androidgpio
The previous two Articles respectively introduced how to control gpio by using scripts and C code to read/sys/class/GPIO. In actual project debugging, you often need to control GPIO in the Java code. Its implementation is similar to that in
40 Gpio on a Raspberry Pi is the best thing to play.They can be directly controlled by c,/c++, Python, Java and other languages.Now, let's see how to do the same thing with node. js.Before you try, install node. js, and move to: 1. Prepare the Test foldermkdir/home/pi/documents/test-gpio-demo/2. Create a file Package.json{ "name":"Test-gpio-demo", "version":"0.
Normal through the file system access to the value of Ain serial port, you can use Fread and other file IO read/sys/bus/iio/devices/iio:device0/in_voltage*_raw content.
But this requires high frequency access to the ADC is very inefficient, the data needs to be copied from the disk to the kernel process space, and then copied to the user process space, consuming unnecessary resources.
This problem can be solved by memory innuendo, Mmap can realize the data copy of disk data to user main memory,
For beginners, why not control the output when using PB3 and PB4.
The following is an analysis of this issue.
First, after the STM32F10X series MCU is reset, the PA13/14/15 PB3/4 is configured as a JTAG feature by default. Sometimes in order to make full use of the resources of the MCU I/O port, theseThe port is set to a normal I/O port. Here's how:In Gpio_configuration (); Configure the GPIO ports used:
Gpio_pinremapconfig (gpio_remap_swj_disable,
Lesson 7 on BBB Board: gpio Programming Control
In the first class, we made a simple gpio port output high and low level output through the IO function to enable and disable the control of an LED indicator. This section uses the complete C ++ program, implement all the functions of the shell script in Lesson 4 to enable alternate shining of two LED lights.
Directly go to the functional program
1. Implement
In sdk1.1 (the latest SDK) officially provided by cpress, a large number of routines are provided for our reference during software development, just like the development of stm32, but it is not a library, just a reference routine.
First, let's look at a simple gpio example (gpioapp)
1.First, it is an error processing function. We don't need it, so this is an endless loop.
2.Cyfxdebuginit: uses the serial port as the debugging port with 115200bps.
Configuring Gpio pins in a non-platform mannerThe GPIO PIN is configured in a non-platform manner and is directly read and written to its Gpio group registers. Because the register physical address cannot be manipulated directly, all need to use IOREMAP to map the physical address of the GPIO register to a virtual addr
Cpress's official SDK1.1 (currently the latest SDK) provides a number of examples for us to develop the software as a reference, just like the development of STM32, but not the library, just a reference routine.
First look at a simple example of a gpio (Gpioapp)
1. first an error-handling function, we don't need it, so this is a dead loop.
2. Cyfxdebuginit This function, the serial port as the debug port with 115200bps.
3.
void CYFXGPIOINTRCB (
ui
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.