The EEPROM is a storage chip for storing small amounts of data. AT24C02 is a kind of EEPROM using the I2C interface.
AT24XXX EEPROM Working principle reference: http://blog.csdn.net/jklinux/article/details/74162876
Dev-interface is the interface to which the I2C controller is invoked by the application. Please refer to If you are not familiar with: http://blog.csdn.net/jklinux/article/details/78676741
Main
/EEPROM
Package, burn the firmware to the Development Board, and start the application to view the icon.
Summary:
The entire call process is: app
One problem is that this method changes the android native API. After all, it accesses the hardware. If you want to make a general app and want to use C/C ++ to improve efficiency, you can directly develop the ndk and compile the function into library files into the app project.
Another problem is hardware access permissions. If you do a generic app,
/* Chen 24c01 (1 k) memory I2C bus Experiment C language example single-byte and unsigned long integer read/write program sda scl can be any common I/O */// # Include # Define trytime 250// Number of attempts to perform the operation again when the operation fails// # Define SDA p42// Data line// # Define SCL p43// Clock line# Define i2cwrite 0xa0 // A2 A1 A0 is 0# Define i2cread 0xa1Unsigned char trytime;// Function declarationVoid i2c_write4byte (un
After the frequency of the DDR and arm changes, the I2C problem occurs again:
The previous processing logic is that when the sending buffer is empty, I will read the data in the receiving buffer, the result is determined based on the value of the data counter that reads the receiving buffer first after the interruption. The number of times the receiving FIFO is read is determined based on this value. The previous logic has always been good. This is b
2013Year4Month11Sunday afternoonI was lucky enough to attend the mobile Internet summit in Chengdu. During this Summit, the host asked HTC's General Manager Ren weiguang about how HTC competed with Samsung and apple, it can be understood as a
The knowledge about Android Bluetooth has been skipped. You can search for it in hundreds of times.
This code has been verified by the project and is completely OK
Directly go to the Code step:
Private descrithadapter adapter;
1. // obtain the
Source: BLE Android App control LED light implementationNote: refer to Amomcu source code Modification.Open the app and check if Bluetooth is turned onBluetoothadapter mbluetoothadapter;FinalBluetoothmanager Bluetoothmanager =(bluetoothmanager)
I²C transmits data between devices connected to the bus using only two lines (SDA and SCL). Each device is identified by a unique address (whether it is a microprocessor, LCD driver, memory, or keyboard interface) and can be used as a transmitter or
2. Use JNI to add service access interfaces at the application framework layer
The application cannot directly access the Hal layer. The JNI layer needs to access the Hal module and provide APIs. You can directly provide interfaces, but it is
Write Process
When the MCU performs write operations, it first sends the 7-bit address code of the device and the Write direction "0" (a total of 8 bits, that is, one byte ), after sending the message, the SDA line is released and 9th clock signals
IICVsSPIToday, in low-end digital communications applications, we are seen in IIC (inter-integrated circuit) and SPI (Serial peripheral Interface). The reason is that these two communication protocols are ideal for near- low-speed inter-chip
Data transfer format
(1) byte Transfer and response
Each byte must be an 8-bit length. During data transmission, the highest bit (MSB) is first transmitted. Each transmitted byte must follow one response bit (that is, a frame has nine digits ).
The following is a simple example:Only one host is set on the bus, and the host uses query read/writeMultiple slave machines are allowed on the bus, and the slave machine uses the hardware interruption function.*****************I started to use the
Clock stretching (stretching)Clock stretching pauses a transmission by pulling the SCL line down. The transfer continues until the SCL line is released high. Clock stretching is optional, in fact most slave devices do not include the SCL driver, so
I. About I2C
The I2C (Inter-Integrated Circuit) bus is a two-line serial bus developed by Philips to connect the microcontroller and its peripheral devices. The main advantage of I2C bus is its simplicity and effectiveness. The simplicity is embodied in the simple wiring. There are only two lines of data cable (SCL) and clock line (SDA), and the control is simpl
This article turns from: http://blog.csdn.net/qianjin0703/article/details/5894869
1. Overview
2. Data Structure
3. Adapter
4. I2c-core
5. Slave Device
1. Overview
1.1 Definition I2C inter-integrated circuit SMBUS System Management Bus, the I2C subset
1.2 Characteristics The amount of data exchanged is small. The required data transfer rate is low.
1.3 Speed Fas
Android 4.3 (API level 18) has started to introduce the core features of Bluetooth low energy (BLE, Bluetooth) and provides APIs that enable applications to scan devices, query services, The characteristics (attribute feature) of the read-write device. Compared to traditional Bluetooth, BLE is designed to significantly reduce power consumption. This makes it possible for low-power communication between Andr
consists of two parts: platform_device and platfrom_driver.
The general process for developing the underlying driver through the platform mechanism is: Define platform_device-> Register platform_device-> define platform_driver-> Register platform_driver.
The first thing to confirm is the device resource information, such as the device address and interrupt number.
In the 2.6 kernel, the platform device is described by the structure platform_device, which is defined in kernel \ include \ Li
. Register platform_device. Define platform_driver. Register platform_driver.The first thing to confirm is the device resource information, such as the device address and interrupt number.In the 2.6 kernel, the platform device is described by the structure platform_device, which is defined in kernel/include/Linux/platform_device.h,Struct platform_device {Const char * Name;U32 ID;Struct device dev;U32 num_resources;Struct resource * resource;};An important element of this structure is resource, w
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.