Skip to content

improve can documentation #8385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 13, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions drivers/CAN.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class CANMessage : public CAN_Message {
class CAN : private NonCopyable<CAN> {

public:
/** Creates an CAN interface connected to specific pins.
/** Creates a CAN interface connected to specific pins.
*
* @param rd read from transmitter
* @param td transmit to transmitter
Expand All @@ -94,11 +94,14 @@ class CAN : private NonCopyable<CAN> {
* @code
* #include "mbed.h"
*
*
* Ticker ticker;
* DigitalOut led1(LED1);
* DigitalOut led2(LED2);
* CAN can1(p9, p10);
* CAN can2(p30, p29);
* //The constructor takes in RX, and TX pin respectively.
* //These pins, for this example, are defined in mbed_app.json
* CAN can1(MBED_CONF_APP_CAN1_RD, MBED_CONF_APP_CAN1_TD);
* CAN can2(MBED_CONF_APP_CAN2_RD, MBED_CONF_APP_CAN2_TD);
*
* char counter = 0;
*
Expand All @@ -121,14 +124,15 @@ class CAN : private NonCopyable<CAN> {
* wait(0.2);
* }
* }
*
* @endcode
*/
CAN(PinName rd, PinName td);

/** Initialize CAN interface and set the frequency
*
* @param rd the rd pin
* @param td the td pin
* @param rd the read pin
* @param td the transmit pin
* @param hz the bus frequency in hertz
*/
CAN(PinName rd, PinName td, int hz);
Expand Down Expand Up @@ -288,12 +292,14 @@ class CAN : private NonCopyable<CAN> {

static void _irq_handler(uint32_t id, CanIrqType type);

#if !defined(DOXYGEN_ONLY)
protected:
virtual void lock();
virtual void unlock();
can_t _can;
Callback<void()> _irq[IrqCnt];
PlatformMutex _mutex;
#endif
};

} // namespace mbed
Expand Down