|
EE445M RTOS
Taken at the University of Texas Spring 2015
|
#include <canpp.hpp>


Public Member Functions | |
| can () | |
| can (memory_address_t can_base, uint32_t can_interrupt, bool can_sender, uint32_t msg_length) | |
| virtual void | start (void) |
| virtual void | stop (void) |
| virtual uint32_t | ack (void) |
| void | pack (uint8_t *dest, uint32_t data, uint8_t offset=0) |
| void | transmit (uint8_t *data, uint32_t length, uint32_t id=1) |
| void | get (uint8_t *data) |
| void | error_tx (void) |
Public Member Functions inherited from interruptable | |
| interruptable () | |
Public Attributes | |
| semaphore | recv_sem |
Private Member Functions | |
| void | set_timing (void) |
| void | init (void) |
| uint32_t | count_message (void) |
Private Attributes | |
| memory_address_t | base |
| uint32_t | interrupt |
| bool | sender |
| tCANMsgObject | sCANMessage |
| uint32_t | errors_tx |
| uint32_t | errors_rx |
| uint32_t | messages_sent |
| uint32_t | messages_received |
| can::can | ( | memory_address_t | can_base, |
| uint32_t | can_interrupt, | ||
| bool | can_sender, | ||
| uint32_t | msg_length | ||
| ) |
Initialize a can node.
Definition at line 41 of file canpp.cpp.
References base, CAN_MSG_OBJ, can_sender, init(), interrupt, sCANMessage, and sender.

|
virtual |
Acknowledge CAN interrupt
Implements interruptable.
Definition at line 146 of file canpp.cpp.
References base, and count_message().
Referenced by CAN0_Handler().


|
private |
Add a message to the global count.
Definition at line 135 of file canpp.cpp.
References messages_received, messages_sent, and sender.
Referenced by ack().

| void can::error_tx | ( | void | ) |
Register a tx error.
Definition at line 97 of file canpp.cpp.
References errors_tx.
Referenced by CAN0_Handler().

| void can::get | ( | uint8_t * | data | ) |
Set mailbox for received can message data.
Definition at line 102 of file canpp.cpp.
References base, errors_rx, and sCANMessage.
Referenced by can_handler().

|
private |
Shared init between constructors.
Definition at line 17 of file canpp.cpp.
References base, ctlsys::enable_periph(), errors_rx, errors_tx, interrupt, messages_received, messages_sent, recv_sem, and start().
Referenced by can().


| void can::pack | ( | uint8_t * | dest, |
| uint32_t | data, | ||
| uint8_t | offset = 0 |
||
| ) |
|
private |
Configure CAN for 1 Mbit operation – http://bit.ly/1CW7hUO
Definition at line 75 of file canpp.cpp.
References base.
|
virtual |
Start CAN transmissions.
Implements interruptable.
Definition at line 85 of file canpp.cpp.
References base.
Referenced by init().

|
virtual |
Stop CAN transmissions.
Implements interruptable.
Definition at line 91 of file canpp.cpp.
References base.
| void can::transmit | ( | uint8_t * | data, |
| uint32_t | length, | ||
| uint32_t | id = 1 |
||
| ) |
Transmit a message via CAN.
note this function will cause the message to be transmtted immediately.
Definition at line 122 of file canpp.cpp.
References base, CAN_MSG_OBJ, and sCANMessage.
Referenced by can_transmitter().

|
private |
Definition at line 23 of file canpp.hpp.
Referenced by ack(), can(), get(), init(), set_timing(), start(), stop(), and transmit().
|
private |
|
private |
Definition at line 29 of file canpp.hpp.
Referenced by error_tx(), and init().
|
private |
|
private |
Definition at line 32 of file canpp.hpp.
Referenced by count_message(), and init().
|
private |
Definition at line 31 of file canpp.hpp.
Referenced by count_message(), and init().
| semaphore can::recv_sem |
Definition at line 69 of file canpp.hpp.
Referenced by CAN0_Handler(), can_handler(), and init().
|
private |
Definition at line 27 of file canpp.hpp.
Referenced by can(), get(), and transmit().
|
private |
Definition at line 25 of file canpp.hpp.
Referenced by can(), and count_message().