Robobo
can.h File Reference

Controller Area Network (CAN) driver module for SAM. More...

#include "../chip.h"

Go to the source code of this file.

Classes

struct  can_mb_conf_t
 

Macros

#define GLOBAL_MAILBOX_MASK   0x000000ff
 
#define CAN_DISABLE_ALL_INTERRUPT_MASK   0xffffffff
 
#define CAN_BPS_1000K   1000
 
#define CAN_BPS_800K   800
 
#define CAN_BPS_500K   500
 
#define CAN_BPS_250K   250
 
#define CAN_BPS_125K   125
 
#define CAN_BPS_50K   50
 
#define CAN_BPS_25K   25
 
#define CAN_BPS_10K   10
 
#define CAN_BPS_5K   5
 
#define CAN_MB_DISABLE_MODE   0
 
#define CAN_MB_RX_MODE   1
 
#define CAN_MB_RX_OVER_WR_MODE   2
 
#define CAN_MB_TX_MODE   3
 
#define CAN_MB_CONSUMER_MODE   4
 
#define CAN_MB_PRODUCER_MODE   5
 
#define CAN_MAILBOX_TRANSFER_OK   0
 
#define CAN_MAILBOX_NOT_READY   0x01
 
#define CAN_MAILBOX_RX_OVER   0x02
 
#define CAN_MAILBOX_RX_NEED_RD_AGAIN   0x04
 

Functions

uint32_t can_init (Can *p_can, uint32_t ul_mck, uint32_t ul_baudrate)
 
void can_enable (Can *p_can)
 
void can_disable (Can *p_can)
 
void can_disable_low_power_mode (Can *p_can)
 
void can_enable_low_power_mode (Can *p_can)
 
void can_disable_autobaud_listen_mode (Can *p_can)
 
void can_enable_autobaud_listen_mode (Can *p_can)
 
void can_disable_overload_frame (Can *p_can)
 
void can_enable_overload_frame (Can *p_can)
 
void can_set_timestamp_capture_point (Can *p_can, uint32_t ul_flag)
 
void can_disable_time_triggered_mode (Can *p_can)
 
void can_enable_time_triggered_mode (Can *p_can)
 
void can_disable_timer_freeze (Can *p_can)
 
void can_enable_timer_freeze (Can *p_can)
 
void can_disable_tx_repeat (Can *p_can)
 
void can_enable_tx_repeat (Can *p_can)
 
void can_set_rx_sync_stage (Can *p_can, uint32_t ul_stage)
 
void can_enable_interrupt (Can *p_can, uint32_t dw_mask)
 
void can_disable_interrupt (Can *p_can, uint32_t dw_mask)
 
uint32_t can_get_interrupt_mask (Can *p_can)
 
uint32_t can_get_status (Can *p_can)
 
uint32_t can_get_internal_timer_value (Can *p_can)
 
uint32_t can_get_timestamp_value (Can *p_can)
 
uint8_t can_get_tx_error_cnt (Can *p_can)
 
uint8_t can_get_rx_error_cnt (Can *p_can)
 
void can_reset_internal_timer (Can *p_can)
 
void can_global_send_transfer_cmd (Can *p_can, uint8_t uc_mask)
 
void can_global_send_abort_cmd (Can *p_can, uint8_t uc_mask)
 
void can_mailbox_set_timemark (Can *p_can, uint8_t uc_index, uint16_t us_cnt)
 
uint32_t can_mailbox_get_status (Can *p_can, uint8_t uc_index)
 
void can_mailbox_send_transfer_cmd (Can *p_can, uint8_t uc_index)
 
void can_mailbox_send_abort_cmd (Can *p_can, uint8_t uc_index)
 
void can_mailbox_init (Can *p_can, can_mb_conf_t *p_mailbox)
 
uint32_t can_mailbox_read (Can *p_can, can_mb_conf_t *p_mailbox)
 
uint32_t can_mailbox_write (Can *p_can, can_mb_conf_t *p_mailbox)
 
uint32_t can_mailbox_tx_remote_frame (Can *p_can, can_mb_conf_t *p_mailbox)
 
void can_reset_all_mailbox (Can *p_can)
 
uint32_t can_reset_mailbox_data (can_mb_conf_t *p_mailbox)
 

Detailed Description

Controller Area Network (CAN) driver module for SAM.

Copyright (c) 2011 - 2012 Atmel Corporation. All rights reserved.

Macro Definition Documentation

#define CAN_BPS_1000K   1000

Define the typical baudrate for CAN communication in KHz.

#define CAN_DISABLE_ALL_INTERRUPT_MASK   0xffffffff

Disable all interrupt mask

#define CAN_MAILBOX_TRANSFER_OK   0

Define CAN mailbox transfer status code.

#define CAN_MB_DISABLE_MODE   0

Define the mailbox mode.

#define GLOBAL_MAILBOX_MASK   0x000000ff

Define the Mailbox mask for eight mailboxes.