| 237 | #endif |
| 238 | |
| 239 | static rt_err_t configure(struct rt_can_device *can, struct can_configure *cfg) |
| 240 | { |
| 241 | CAN_TypeDef *pbxcan; |
| 242 | |
| 243 | pbxcan = ((struct ls1c_bxcan *) can->parent.user_data)->reg; |
| 244 | if (pbxcan == CAN0) |
| 245 | { |
| 246 | #ifdef USING_BXCAN0 |
| 247 | bxcan0_hw_init(); |
| 248 | bxcan_init(pbxcan, cfg->baud_rate, cfg->mode); |
| 249 | #endif |
| 250 | } |
| 251 | else if (pbxcan == CAN1) |
| 252 | { |
| 253 | #ifdef USING_BXCAN1 |
| 254 | bxcan1_hw_init(); |
| 255 | bxcan_init(pbxcan, cfg->baud_rate, cfg->mode); |
| 256 | #endif |
| 257 | } |
| 258 | return RT_EOK; |
| 259 | } |
| 260 | |
| 261 | static rt_err_t control(struct rt_can_device *can, int cmd, void *arg) |
| 262 | { |
nothing calls this directly
no test coverage detected