X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/446346b22245a238d8d70390797b9749eac03788..5282a3d5b5624f59a4a11b061368e523934fe5f0:/lincan/src/c_can.c diff --git a/lincan/src/c_can.c b/lincan/src/c_can.c index a0503b4..4c052c3 100644 --- a/lincan/src/c_can.c +++ b/lincan/src/c_can.c @@ -750,6 +750,29 @@ int c_can_stop_chip(struct canchip_t *pchip) return 0; } +int c_can_attach_to_chip(struct canchip_t *chip) +{ + return 0; +} + +int c_can_release_chip(struct canchip_t *chip) +{ + int temp; + + temp = c_can_read_reg_w(chip, CCCR); + + /* Disable IRQ generation */ + c_can_config_irqs(chip, 0); + + temp = c_can_read_reg_w(chip, CCCR); + + /* Power-down C_CAN, except this does nothing in the version 1.2 */ + c_can_stop_chip(chip); + + + return 0; +} + /////////////////////////////////////////////////////////////////////// /* *Check the TxOK bit of the Status Register and resets it afterwards. @@ -946,6 +969,8 @@ int c_can_register(struct chipspecops_t *chipspecops) chipspecops->remote_request=c_can_remote_request; chipspecops->enable_configuration=c_can_enable_configuration; chipspecops->disable_configuration=c_can_disable_configuration; + chipspecops->attach_to_chip=c_can_attach_to_chip; + chipspecops->release_chip=c_can_release_chip; chipspecops->set_btregs=c_can_set_btregs; chipspecops->start_chip=c_can_start_chip; chipspecops->stop_chip=c_can_stop_chip;