summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2005-10-28 09:32:09 +0000
committerSascha Hauer <s.hauer@pengutronix.de>2005-10-28 09:32:09 +0000
commitfe28211b084093a9a134e99ecd7184656ca3b069 (patch)
tree32ddeb1131864f14dee0e49e8e5f10b71f7fca80
parent553eb795765984501289705b2f948a09d1013640 (diff)
downloadcanutils-fe28211b084093a9a134e99ecd7184656ca3b069.tar.gz
set special baudrates rework
git-svn-id: https://iocaste.extern.pengutronix.de/svn/canutils/trunks/canutils-1.0-trunk@51 5fd5a299-6ef2-0310-aa18-8b01d7c39d8c
-rw-r--r--include/socket-can/can.h33
1 files changed, 28 insertions, 5 deletions
diff --git a/include/socket-can/can.h b/include/socket-can/can.h
index 45add2c..48744f4 100644
--- a/include/socket-can/can.h
+++ b/include/socket-can/can.h
@@ -87,10 +87,9 @@ enum CAN_BAUD {
*/
CAN_BAUD_MAX,
- /*!
- ** Use values for btr0, btr1 and btr2
- */
- CAN_BAUD_BTR = 0x80,
+ CAN_BAUD_BTR_SJA1000 = 0x80,
+ CAN_BAUD_BTR_C_CAN,
+ CAN_BAUD_BTR_NIOS,
};
@@ -165,10 +164,34 @@ enum CAN_STATE {
CAN_STATE_ERR_ACK = 0x50
};
+struct can_baudrate_sja1000 {
+ u_int8_t brp;
+ u_int8_t sjw;
+ u_int8_t tseg1;
+ u_int8_t tseg2;
+ u_int8_t sam;
+};
+
+struct can_baudrate_c_can {
+ u_int8_t brp;
+ u_int8_t sjw;
+ u_int8_t tseg1;
+ u_int8_t tseg2;
+};
+
+struct can_baudrate_nios {
+ u_int8_t prescale;
+ u_int8_t timea;
+ u_int8_t timeb;
+};
struct can_baudrate {
enum CAN_BAUD baudrate;
- unsigned char btr[3];
+ union {
+ struct can_baudrate_sja1000 sja1000;
+ struct can_baudrate_c_can c_can;
+ struct can_baudrate_nios nios;
+ } btr;
};