MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / configure

Function configure

bsp/loongson/ls1cdev/drivers/drv_can.c:239–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237#endif
238
239static 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
261static rt_err_t control(struct rt_can_device *can, int cmd, void *arg)
262{

Callers

nothing calls this directly

Calls 3

bxcan0_hw_initFunction · 0.85
bxcan_initFunction · 0.70
bxcan1_hw_initFunction · 0.70

Tested by

no test coverage detected