Skip to content

Commit 32accc6

Browse files
Cruz Monrreal IICruz Monrreal II
authored andcommitted
Merge branch 'aashishc1988-write_a_thon' into rollup-aus_writathon
2 parents eb70b8a + b7f5566 commit 32accc6

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

drivers/CAN.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class CANMessage : public CAN_Message {
8585
class CAN : private NonCopyable<CAN> {
8686

8787
public:
88-
/** Creates an CAN interface connected to specific pins.
88+
/** Creates a CAN interface connected to specific pins.
8989
*
9090
* @param rd read from transmitter
9191
* @param td transmit to transmitter
@@ -94,11 +94,14 @@ class CAN : private NonCopyable<CAN> {
9494
* @code
9595
* #include "mbed.h"
9696
*
97+
*
9798
* Ticker ticker;
9899
* DigitalOut led1(LED1);
99100
* 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);
102105
*
103106
* char counter = 0;
104107
*
@@ -121,14 +124,15 @@ class CAN : private NonCopyable<CAN> {
121124
* wait(0.2);
122125
* }
123126
* }
127+
*
124128
* @endcode
125129
*/
126130
CAN(PinName rd, PinName td);
127131

128132
/** Initialize CAN interface and set the frequency
129133
*
130-
* @param rd the rd pin
131-
* @param td the td pin
134+
* @param rd the read pin
135+
* @param td the transmit pin
132136
* @param hz the bus frequency in hertz
133137
*/
134138
CAN(PinName rd, PinName td, int hz);
@@ -288,12 +292,14 @@ class CAN : private NonCopyable<CAN> {
288292

289293
static void _irq_handler(uint32_t id, CanIrqType type);
290294

295+
#if !defined(DOXYGEN_ONLY)
291296
protected:
292297
virtual void lock();
293298
virtual void unlock();
294299
can_t _can;
295300
Callback<void()> _irq[IrqCnt];
296301
PlatformMutex _mutex;
302+
#endif
297303
};
298304

299305
} // namespace mbed

0 commit comments

Comments
 (0)