Commit e19ffa73 authored by Bruno Gomes's avatar Bruno Gomes

Libiop: CAN driver cleanup

refs #112663
parent 360276b3
This diff is collapsed.
/**
* @file
* @ingroup bsp_kit
* @defgroup sparc_bsp SPARC
* @ingroup sparc_bsp
* @brief Debug Definitions
*/
#ifndef __DEBUG_DEFS_H__
#define __DEBUG_DEFS_H__
#ifdef __cplusplus
extern "C" {
#endif
#ifdef DEBUG
#ifndef DEBUG_FLAGS
#define DEBUG_FLAGS 0
#endif
#define DBG(fmt, args...) do { iop_debug(" : %03d @ %18s()]:" fmt , __LINE__,__FUNCTION__,## args); } while(0)
#define DBG2(fmt) do { iop_debug(" : %03d @ %18s()]:" fmt , __LINE__,__FUNCTION__); } while(0)
#define DBGC(c,fmt, args...) do { if (DEBUG_FLAGS & c) { iop_debug(" : %03d @ %18s()]:" fmt , __LINE__,__FUNCTION__,## args); }} while(0)
#else
#define DBG(fmt, args...)
#define DBG2(fmt, args...)
#define DBGC(c, fmt, args...)
#endif
#ifdef DEBUGFUNCS
#define FUNCDBG() do { iop_debug("%s\n\r",__FUNCTION__); } while(0)
#else
#define FUNCDBG()
#endif
#ifdef __cplusplus
}
#endif
#endif /* __DEBUG_DEFS_H__ */
......@@ -211,9 +211,6 @@ struct grcan_config {
};
typedef struct grcan_priv_ {
//~ struct drvmgr_dev *dev; /* Driver manager devi_busce */
//~ char devName[32]; /* Device Name */
unsigned int baseaddr, ram_base;
struct grcan_regs *regs;
int irq;
int minor;
......@@ -262,17 +259,6 @@ uint32_t iop_grcan_initialize(
uint32_t iop_grcan_open(iop_device_driver_t *iop_dev,
void *arg);
/*
* Open a GRCAN device by name. Finds device index then calls
* grcan_open(index).
*
* name: Device name to open
* dev_no: Device number matching name. Will be set if device found.
* return: Device handle to use with all other grcan_ API functions. The
* function returns NULL if device can not be opened or not found.
*/
//void *grcan_open_by_name(char *name, int *dev_no);
/*
* Close a GRCAN device
*
......@@ -287,14 +273,15 @@ uint32_t iop_grcan_close(iop_device_driver_t *iop_dev,
* Multiple CAN messages can be received in one call.
*
* d: Device handle
* msg: Pointer to receive messages
* count: Number of CAN messages to receive
* arg: iop wrapper
*
* return:
* >=0: Number of CAN messages received. This can be
* less than the count parameter.
* AIR_INVALID_PARAM: count parameter less than one or NULL msg.
* AIR_INVALID_PARAM: Invalid argument
* AIR_INVALID_SIZE Invalid iop buffer
* AIR_INVALID_MODE: Device not in started mode
* AIR_TIMED_OUT Nothing read
* GRCAN_RET_TIMEOUT: Timeout in non-blocking mode
* GRCAN_RET_BUSOFF: A read was interrupted by a bus-off error.
* Device has left started mode.
......@@ -311,14 +298,15 @@ uint32_t iop_grcan_read(
* Multiple CAN messages can be transmit in one call.
*
* d: Device handle
* msg: Pointer to messages to transmit
* count: Number of CAN messages to transmit
* arg: iop wrapper
*
* return:
* >=0: Number of CAN messages transmitted. This can be
* less than the count parameter.
* AIR_INVALID_PARAM: count parameter less than one.
* AIR_INVALID_PARAM: Invalid argument
* AIR_INVALID_SIZE Invalid iop buffer
* AIR_INVALID_MODE: Device not in started mode
* AIR_TIMED_OUT Nothing written
* GRCAN_RET_TIMEOUT: Timeout in non-blocking mode
* GRCAN_RET_BUSOFF: A write was interrupted by a Bus-off error.
* Device has left started mode
......@@ -353,12 +341,7 @@ int iop_grcan_get_state(iop_device_driver_t *iop_dev);
//int grcan_start(iop_device_driver_t *iop_dev);
/* stop to change baud rate/config or closing down */
int iop_grcan_stop(iop_device_driver_t *iop_dev);
/* Wait until all TX messages have been sent */
int iop_grcan_flush(iop_device_driver_t *iop_dev);
/*
* gmvs */
int iop_grcan_device_init(iop_device_driver_t *iop_dev);
/* Functions that require connection
* to be stopped
......@@ -372,7 +355,7 @@ int iop_grcan_set_selection(iop_device_driver_t *iop_dev, const struct grcan_sel
/* Set baudrate by using driver's baud rate timing calculation routines */
int iop_grcan_set_speed(iop_device_driver_t *iop_dev, unsigned int hz);
/* Set baudrate by specifying the timing registers manually */
//int grcan_set_btrs(iop_device_driver_t *iop_dev, const struct grcan_timing *timing);
int iop_grcan_set_btrs(iop_device_driver_t *iop_dev, const struct grcan_timing *timing);
/* Functions can be called whenever */
/* Enable/disable Blocking on reception (until at least one message has been received) */
......@@ -394,8 +377,6 @@ int iop_grcan_set_afilter(iop_device_driver_t *iop_dev, const struct grcan_filte
/* Get status register of GRCAN core */
int iop_grcan_get_status(iop_device_driver_t *iop_dev, unsigned int *status);
//void grcan_register_drv(void);
#ifdef __cplusplus
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment