Forked.
Fork of mbed-dev by
Diff: targets/TARGET_NXP/TARGET_LPC15XX/can_api.c
- Revision:
- 167:e84263d55307
- Parent:
- 156:95d6b41a828b
diff -r c97ed07ec1a8 -r e84263d55307 targets/TARGET_NXP/TARGET_LPC15XX/can_api.c --- a/targets/TARGET_NXP/TARGET_LPC15XX/can_api.c Thu Jun 08 15:02:37 2017 +0100 +++ b/targets/TARGET_NXP/TARGET_LPC15XX/can_api.c Wed Jun 21 17:46:44 2017 +0100 @@ -415,8 +415,7 @@ return 1; } - -void can_init(can_t *obj, PinName rd, PinName td) { +void can_init_freq(can_t *obj, PinName rd, PinName td, int hz) { // Enable power and clock LPC_SYSCON->SYSAHBCLKCTRL1 |= (1UL << 7); LPC_SYSCON->PRESETCTRL1 |= (1UL << 7); @@ -430,7 +429,7 @@ LPC_SWM->PINASSIGN[6] &= ~(0x00FFFF00L); LPC_SWM->PINASSIGN[6] |= (rd << 16) | (td << 8); - can_frequency(obj, 100000); + can_frequency(obj, hz); // Resume operation LPC_C_CAN0->CANCNTL &= ~(1UL << 0); @@ -442,6 +441,10 @@ can_config_txmsgobj(obj); } +void can_init(can_t *obj, PinName rd, PinName td) { + can_init_freq(obj, rd, td, 100000); +} + void can_free(can_t *obj) { LPC_SYSCON->SYSAHBCLKCTRL1 &= ~(1UL << 7); LPC_SYSCON->PRESETCTRL1 &= ~(1UL << 7);