RTEMS 6.1-rc1
|
Data Structures | |
struct | mscan_context |
MSCAN context that has to be saved throughout the initialization mode. More... | |
Typedefs | |
typedef struct mpc5200_mscan | mscan |
MSCAN registers. | |
Functions | |
bool | mscan_enable (volatile mscan *m, unsigned bit_rate) |
Enables and initializes the MSCAN module m. More... | |
void | mscan_disable (volatile mscan *m) |
Disables the MSCAN module m. More... | |
void | mscan_interrupts_disable (volatile mscan *m) |
Disables all interrupts for the MSCAN module m. | |
bool | mscan_set_bit_rate (volatile mscan *m, unsigned bit_rate) |
Sets the bit rate for the MSCAN module m to can_bit_rate in [bits/s]. | |
void | mscan_initialization_mode_enter (volatile mscan *m, mscan_context *context) |
Enter initialization mode for the MSCAN module m. More... | |
void | mscan_initialization_mode_leave (volatile mscan *m, const mscan_context *context) |
Leave initialization mode for the MSCAN module m. More... | |
void | mscan_sleep_mode_enter (volatile mscan *m) |
Enter sleep mode for the MSCAN module m. | |
void | mscan_sleep_mode_leave (volatile mscan *m) |
Leave sleep mode for the MSCAN module m. | |
volatile uint8_t * | mscan_id_acceptance_register (volatile mscan *m, unsigned i) |
Returns the address of the CANIDAR register with index i of the MSCAN module m. More... | |
volatile uint8_t * | mscan_id_mask_register (volatile mscan *m, unsigned i) |
Returns the address of the CANIDMR register with index i of the MSCAN module m. More... | |
unsigned | mscan_filter_number (volatile mscan *m) |
Returns the number of active filters of the MSCAN module m. More... | |
bool | mscan_set_filter_number (volatile mscan *m, unsigned number) |
Sets the number of active filters of the MSCAN module m to number and returns true if number is valid. More... | |
bool | mscan_filter_operation (volatile mscan *m, bool set, unsigned index, uint32_t *id, uint32_t *mask) |
Sets or gets the filter ID and mask in id and mask depending on set of MSCAN module m. The filter is selected by the value of index. More... | |
void | mscan_filter_clear (volatile mscan *m) |
Sets the filter ID and mask registers of the MSCAN module m to default values. | |
void | mscan_get_error_counters (volatile mscan *m, unsigned *rec, unsigned *tec) |
Returns the receiver and transmitter error counter values in rec and tec of MSCAN module m. | |
MSCAN Transmitter Flag Register (CANTFLG) | |
#define | TFLG_TXE2 (1 << 2) |
#define | TFLG_TXE1 (1 << 1) |
#define | TFLG_TXE0 (1 << 0) |
MSCAN Transmitter Interrupt Enable Register (CANTIER) | |
#define | TIER_TXEI2 (1 << 2) |
#define | TIER_TXEI1 (1 << 1) |
#define | TIER_TXEI0 (1 << 0) |
MSCAN Transmitter Message Abort Request (CANTARQ) | |
#define | TARQ_ABTRQ2 (1 << 2) |
#define | TARQ_ABTRQ1 (1 << 1) |
#define | TARQ_ABTRQ0 (1 << 0) |
MSCAN Transmitter Message Abort Acknoledge (CANTAAK) | |
#define | TAAK_ABTRQ2 (1 << 2) |
#define | TAAK_ABTRQ1 (1 << 1) |
#define | TAAK_ABTRQ0 (1 << 0) |
MSCAN Transmit Buffer Selection (CANBSEL) | |
#define | BSEL_TX2 (1 << 2) |
#define | BSEL_TX1 (1 << 1) |
#define | BSEL_TX0 (1 << 0) |
MSCAN ID Acceptance Control Register (CANIDAC) | |
#define | IDAC_IDAM1 (1 << 5) |
#define | IDAC_IDAM0 (1 << 4) |
#define | IDAC_IDAM (IDAC_IDAM1 | IDAC_IDAM0) |
#define | IDAC_IDHIT(idac) ((idac) & 0x7) |
void mscan_disable | ( | volatile mscan * | m | ) |
Disables the MSCAN module m.
The module is set to sleep mode and disabled afterwards.
bool mscan_enable | ( | volatile mscan * | m, |
unsigned | bit_rate | ||
) |
Enables and initializes the MSCAN module m.
The module is set to listen only mode.
unsigned mscan_filter_number | ( | volatile mscan * | m | ) |
Returns the number of active filters of the MSCAN module m.
bool mscan_filter_operation | ( | volatile mscan * | m, |
bool | set, | ||
unsigned | index, | ||
uint32_t * | id, | ||
uint32_t * | mask | ||
) |
Sets or gets the filter ID and mask in id and mask depending on set of MSCAN module m. The filter is selected by the value of index.
Returns true if the operation was successful.
volatile uint8_t * mscan_id_acceptance_register | ( | volatile mscan * | m, |
unsigned | i | ||
) |
Returns the address of the CANIDAR register with index i of the MSCAN module m.
volatile uint8_t * mscan_id_mask_register | ( | volatile mscan * | m, |
unsigned | i | ||
) |
Returns the address of the CANIDMR register with index i of the MSCAN module m.
void mscan_initialization_mode_enter | ( | volatile mscan * | m, |
mscan_context * | context | ||
) |
Enter initialization mode for the MSCAN module m.
Saves the current MSCAN context in context.
void mscan_initialization_mode_leave | ( | volatile mscan * | m, |
const mscan_context * | context | ||
) |
Leave initialization mode for the MSCAN module m.
Saves the previous MSCAN context saved in context.
bool mscan_set_filter_number | ( | volatile mscan * | m, |
unsigned | number | ||
) |
Sets the number of active filters of the MSCAN module m to number and returns true if number is valid.