Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

UM0851 Datasheet(PDF) 81 Page - STMicroelectronics

Part # UM0851
Description  SPEAr is a family of highly customizable ARM-based embedded
PDF  245 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

UM0851 Datasheet(HTML) 81 Page - STMicroelectronics

Back Button UM0851 Datasheet HTML 77Page - STMicroelectronics UM0851 Datasheet HTML 78Page - STMicroelectronics UM0851 Datasheet HTML 79Page - STMicroelectronics UM0851 Datasheet HTML 80Page - STMicroelectronics UM0851 Datasheet HTML 81Page - STMicroelectronics UM0851 Datasheet HTML 82Page - STMicroelectronics UM0851 Datasheet HTML 83Page - STMicroelectronics UM0851 Datasheet HTML 84Page - STMicroelectronics UM0851 Datasheet HTML 85Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 81 / 245 page
background image
UM0851
Communication device drivers
Doc ID 16604 Rev 2
81/245
adapter gets a number, counting from 0. You can examine /sys/class/i2c-dev/ to see what
number corresponds to which adapter. I2C device files are character device files with major
device number 89 and a minor device number corresponding to the number assigned as
explained above. They should be called "i2c-%d" (i2c-0, i2c-1, ...,i2c-10, ...). All 256 minor
device numbers are reserved for i2c.
4.5.4
Adding a new I2C client driver
To add a new client driver, you should be familiar with struct i2c_driver.The struct i2c_driver
describes an I2C chip driver. This structure is defined in the include/linux/i2c.h file. Only the
following fields are necessary to create a working chip driver.
/* set to a descriptive name of the I2C chip driver. This value shows up in the sysfs
file name created for every I2C chip device */
char name[I2C_NAME_SIZE];
/* called whenever a new I2C bus driver is loaded in the system. This function is
described in more detail below. */
int (*attach_adapter)(struct i2c_adapter *);
/* called when the i2c_client device is to be removed from the system. */
int (*detach_client)(struct i2c_client *);
static struct i2c_driver eeprom_driver = {
.driver = {
.name
= "eeprom",
},
.id
= I2C_DRIVERID_eeprom,
.attach_adapter = eeprom_attach_adapter,
.detach_client
= eeprom_detach_client,
};
Registering a chip driver
To register this I2C chip driver, the function i2c_add_driver() should be called with a pointer
to the struct i2c_driver.
static int __init eeprom_init(void)
{
return i2c_add_driver(&eeprom_driver);
}
Unregistering a chip driver
To unregister the I2C chip driver, the i2c_del_driver() function should be called with the
same pointer to the struct i2c_driver. I2c_del_driver() is defined in include/linux/i2c.h which
will internally call i2c_unregister_driver() defined in drivers/i2c/i2c-core.c
static void __exit eeprom_exit(void)
{
i2c_del_driver(&eeprom_driver);
}



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com