Hello,

On 05/31/2011 11:00 PM, [email protected] wrote:
> i want to use the MCP2515 microchip for CAN communication.
> Unfortunately i can't use the included kernelheader
> <linux/spi/spi.h>, because it's a custom spi-driver. To read the SPI
> i simply call a function with three parameters: struct of the
> spi-configuration(CS,bit length, Mastermode, ...), a char
> destination_register and a short data-buffer to read data. To write
> the SPI i call another function with three parameters: struct of the
> spi-configuration(CS,bit length, Mastermode, ...), a char
> destination_register and a short data field to write data.

> Can i just call my spi transfer functions inside the functions
> mcp251x_read_reg(struct spi_device *spi, uint8_t reg) and
> mcp251x_write_reg(struct spi_device *spi, u8 reg, uint8_t val) and
> everything in CANSocket works fine?

Just try it out. Without code I cannot help you.

However I strongly suggest to implement a standard Linux spi driver for
your SPI host adapter. Then the mcp and all other spi device drivers
will work out of the box.

regards, Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users

Reply via email to