Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- nclude <linux/kernel.h>
- #include <linux/module.h>
- #include <linux/fs.h>
- #include <linux/i2c.h>
- #include <linux/interrupt.h>
- #define SUCCESS 0
- #define mbedID 0x01
- int init_module(void);
- void cleanup_module(void);
- static const struct i2c_board_info rasp_i2c_devices[] = {
- { "mbed", mbedID },
- };
- /*
- * * This function is called when the module is loaded
- * */
- int init_module(void)
- {
- /* give major number 0 to get dynamic major number */
- /*
- * register your mbed on the I2C bus
- */
- i2c_register_board_info(0,rasp_i2c_devices,
- ARRAY_SIZE(rasp_i2c_devices));
- return SUCCESS;
- }
- void cleanup_module(void)
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement