@@ -85,7 +85,7 @@ class CANMessage : public CAN_Message {
85
85
class CAN : private NonCopyable <CAN> {
86
86
87
87
public:
88
- /* * Creates an CAN interface connected to specific pins.
88
+ /* * Creates a CAN interface connected to specific pins.
89
89
*
90
90
* @param rd read from transmitter
91
91
* @param td transmit to transmitter
@@ -94,11 +94,14 @@ class CAN : private NonCopyable<CAN> {
94
94
* @code
95
95
* #include "mbed.h"
96
96
*
97
+ *
97
98
* Ticker ticker;
98
99
* DigitalOut led1(LED1);
99
100
* DigitalOut led2(LED2);
100
- * CAN can1(p9, p10);
101
- * CAN can2(p30, p29);
101
+ * //The constructor takes in RX, and TX pin respectively.
102
+ * //These pins, for this example, are defined in mbed_app.json
103
+ * CAN can1(MBED_CONF_APP_CAN1_RD, MBED_CONF_APP_CAN1_TD);
104
+ * CAN can2(MBED_CONF_APP_CAN2_RD, MBED_CONF_APP_CAN2_TD);
102
105
*
103
106
* char counter = 0;
104
107
*
@@ -121,14 +124,15 @@ class CAN : private NonCopyable<CAN> {
121
124
* wait(0.2);
122
125
* }
123
126
* }
127
+ *
124
128
* @endcode
125
129
*/
126
130
CAN (PinName rd, PinName td);
127
131
128
132
/* * Initialize CAN interface and set the frequency
129
133
*
130
- * @param rd the rd pin
131
- * @param td the td pin
134
+ * @param rd the read pin
135
+ * @param td the transmit pin
132
136
* @param hz the bus frequency in hertz
133
137
*/
134
138
CAN (PinName rd, PinName td, int hz);
@@ -288,12 +292,14 @@ class CAN : private NonCopyable<CAN> {
288
292
289
293
static void _irq_handler (uint32_t id, CanIrqType type);
290
294
295
+ #if !defined(DOXYGEN_ONLY)
291
296
protected:
292
297
virtual void lock ();
293
298
virtual void unlock ();
294
299
can_t _can;
295
300
Callback<void ()> _irq[IrqCnt];
296
301
PlatformMutex _mutex;
302
+ #endif
297
303
};
298
304
299
305
} // namespace mbed
0 commit comments