Mercurial > ecos
changeset 3079:b8d91bac2ba8
* Changes made to support CAN IO package update:
* cdl/can_lpc2xxx.cdl: CYGOPT_DEVS_CAN_LPC2XXX_EXTENDED_CFG_KEYS
replaced by CYG_IO_SET_CONFIG_CAN_RANGE_FILTER.
* include/can_lpc2xxx.h: Commented out unused and not implemented
things.
* src/can_lpc2xxx.c: CYGNUM_CAN_EVENT_OVERRUN_RX_HW instead of
CYGNUM_CAN_EVENT_OVERRUN_RX. CYGOPT_DEVS_CAN_LPC2XXX_EXTENDED_CFG_KEYS
replaced by CYG_IO_SET_CONFIG_CAN_RANGE_FILTER. can_lpc2xxx.h not
required any more. CYGNUM_CAN_MODE_LISTEN_ONLY_ENTER &
CYGNUM_CAN_MODE_LISTEN_ONLY_EXIT return -EINVAL.
[ Bugzilla 1001453 ]
| author | sergeig |
|---|---|
| date | Thu, 09 Feb 2012 21:37:33 +0000 |
| parents | 69195e72347f |
| children | df7356548951 |
| files | packages/devs/can/arm/lpc2xxx/current/ChangeLog packages/devs/can/arm/lpc2xxx/current/cdl/can_lpc2xxx.cdl packages/devs/can/arm/lpc2xxx/current/include/can_lpc2xxx.h packages/devs/can/arm/lpc2xxx/current/src/can_lpc2xxx.c |
| diffstat | 4 files changed, 37 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/packages/devs/can/arm/lpc2xxx/current/ChangeLog +++ b/packages/devs/can/arm/lpc2xxx/current/ChangeLog @@ -1,3 +1,17 @@ +2012-01-25 Bernard Fouché <bernard.fouche@kuantic.com> + + * Changes made to support CAN IO package update: + * cdl/can_lpc2xxx.cdl: CYGOPT_DEVS_CAN_LPC2XXX_EXTENDED_CFG_KEYS + replaced by CYG_IO_SET_CONFIG_CAN_RANGE_FILTER. + * include/can_lpc2xxx.h: Commented out unused and not implemented + things. + * src/can_lpc2xxx.c: CYGNUM_CAN_EVENT_OVERRUN_RX_HW instead of + CYGNUM_CAN_EVENT_OVERRUN_RX. CYGOPT_DEVS_CAN_LPC2XXX_EXTENDED_CFG_KEYS + replaced by CYG_IO_SET_CONFIG_CAN_RANGE_FILTER. can_lpc2xxx.h not + required any more. CYGNUM_CAN_MODE_LISTEN_ONLY_ENTER & + CYGNUM_CAN_MODE_LISTEN_ONLY_EXIT return -EINVAL. + [ Bugzilla 1001453 ] + 2008-07-21 Uwe Kindler <uwe_kindler@web.de> * cdl/can_lpc2xxx.cdl: Added CYGOPT_DEVS_CAN_LPC2XXX_ALIE to make
--- a/packages/devs/can/arm/lpc2xxx/current/cdl/can_lpc2xxx.cdl +++ b/packages/devs/can/arm/lpc2xxx/current/cdl/can_lpc2xxx.cdl @@ -84,8 +84,8 @@ cdl_package CYGPKG_DEVS_CAN_LPC2XXX { the configuration key CYG_IO_SET_CONFIG_CAN_MSGBUF is not supported by this driver." - cdl_option CYGOPT_DEVS_CAN_LPC2XXX_EXTENDED_CFG_KEYS { - display "Extended acceptance filtering" + cdl_option CYGOPT_DEVS_CAN_RANGE_FILTERING_CFG_KEYS { + display "Range filtering" flavor bool default_value 0 description " @@ -93,16 +93,12 @@ cdl_package CYGPKG_DEVS_CAN_LPC2XXX { message filters for reception of single CAN messages. The global LPC2xxx acceptance filter supports not only single message filters but also - message groups. A message group is defined by a + message ranges. A message range is defined by a lower bound CAN identifier and an upper bound CAN identifier. The acceptance filter will accept all messages within this range of CAN identifiers. The acceptance filter supports a number of message - groups for each CAN channel. The support of - message filter groups is not conform to the - standard API of the CAN I/O layer and should only - be used for application where portability is not - important." + ranges for each CAN channel." } cdl_option CYGOPT_DEVS_CAN_LPC2XXX_LUT_ERR_SUPP {
--- a/packages/devs/can/arm/lpc2xxx/current/include/can_lpc2xxx.h +++ b/packages/devs/can/arm/lpc2xxx/current/include/can_lpc2xxx.h @@ -64,13 +64,14 @@ //-------------------------------------------------------------------------- // Message filter configuration // -#define CYG_IO_SET_CONFIG_LPC2XXX_ACCFILT_GROUP CYG_IO_SET_CONFIG_CAN_ABORT + 0x10 // add message filter group +//#define CYG_IO_SET_CONFIG_LPC2XXX_ACCFILT_GROUP CYG_IO_SET_CONFIG_CAN_ABORT + 0x10 // add message filter group //-------------------------------------------------------------------------- // Mode setup of LPC2XXX // -#define CYGNUM_CAN_MODE_LPC2XXX_LISTEN_ONLY 0x80 // set controller in listen only mode +// NOT IMPLEMENTED! +//#define CYGNUM_CAN_MODE_LPC2XXX_LISTEN_ONLY 0x80 // set controller in listen only mode //========================================================================== @@ -79,12 +80,12 @@ // // structure for configuration of message filter groups // -typedef struct cyg_can_filtergroup_cfg_st -{ - cyg_can_id_type ext; - cyg_uint32 lower_id_bound; - cyg_uint32 upper_id_bound; -} cyg_can_filtergroup_cfg; +//typedef struct cyg_can_filtergroup_cfg_st +//{ +// cyg_can_id_type ext; +// cyg_uint32 lower_id_bound; +// cyg_uint32 upper_id_bound; +//} cyg_can_filtergroup_cfg; //---------------------------------------------------------------------------
--- a/packages/devs/can/arm/lpc2xxx/current/src/can_lpc2xxx.c +++ b/packages/devs/can/arm/lpc2xxx/current/src/can_lpc2xxx.c @@ -70,7 +70,6 @@ #include <cyg/io/io.h> #include <cyg/io/devtab.h> #include <cyg/io/can.h> -#include <cyg/io/can_lpc2xxx.h> #include <cyg/io/can_lpc2xxx_baudrates.h> @@ -1298,18 +1297,18 @@ static void lpc2xxx_enter_reset_mode(can } -#ifdef CYGOPT_DEVS_CAN_LPC2XXX_EXTENDED_CFG_KEYS +#ifdef CYGOPT_DEVS_CAN_RANGE_FILTERING_CFG_KEYS //=========================================================================== // Add message filter group //=========================================================================== static Cyg_ErrNo lpc2xxx_can_config_accfilt_group(can_channel *chan, const void* buf, cyg_uint32* len) { bool res; - cyg_can_filtergroup_cfg *filter_grp = (cyg_can_filtergroup_cfg *)buf; + cyg_can_filter_range_cfg *filter_grp = (cyg_can_filter_range_cfg *)buf; lpc2xxx_can_info_t *info = (lpc2xxx_can_info_t *)chan->dev_priv; - if (*len != sizeof(cyg_can_filtergroup_cfg)) + if (*len != sizeof(cyg_can_filter_range_cfg)) { return -EINVAL; } @@ -1339,7 +1338,7 @@ static Cyg_ErrNo lpc2xxx_can_config_accf #endif return res ? ENOERR : -EPERM; } -#endif // CYGOPT_DEVS_CAN_LPC2XXX_EXTENDED_CFG_KEYS +#endif // CYGOPT_DEVS_CAN_RANGE_FILTERING_CFG_KEYS //=========================================================================== @@ -1380,16 +1379,16 @@ static Cyg_ErrNo lpc2xxx_can_set_config( break; #endif // CYGOPT_IO_CAN_RUNTIME_MBOX_CFG -#ifdef CYGOPT_DEVS_CAN_LPC2XXX_EXTENDED_CFG_KEYS +#ifdef CYGOPT_DEVS_CAN_RANGE_FILTERING_CFG_KEYS // // Add message filter group to acceptance filter // - case CYG_IO_SET_CONFIG_LPC2XXX_ACCFILT_GROUP : + case CYG_IO_SET_CONFIG_CAN_RANGE_FILTER : { return lpc2xxx_can_config_accfilt_group(chan, buf, len); } break; -#endif // CYGOPT_DEVS_CAN_LPC2XXX_EXTENDED_CFG_KEYS +#endif // CYGOPT_DEVS_CAN_RANGE_FILTERING_CFG_KEYS // // Change CAN state of CAN module @@ -1418,6 +1417,8 @@ static Cyg_ErrNo lpc2xxx_can_set_config( case CYGNUM_CAN_MODE_START : lpc2xxx_start_module(chan); break; case CYGNUM_CAN_MODE_STANDBY : lpc2xxx_enter_lowpower_mode(chan); break; case CYGNUM_CAN_MODE_CONFIG : lpc2xxx_enter_reset_mode(chan); break; + case CYGNUM_CAN_MODE_LISTEN_ONLY_ENTER: return -EINVAL; + case CYGNUM_CAN_MODE_LISTEN_ONLY_EXIT: return -EINVAL; } } break; // case CYG_IO_SET_CONFIG_CAN_MODE : @@ -1645,7 +1646,7 @@ static bool lpc2xxx_can_getevent(can_cha HAL_READ_UINT32(CAN_CTRL_GSR(info), regval); if (regval & GSR_DATA_OVR) { - pevent->flags |= CYGNUM_CAN_EVENT_OVERRUN_RX; + pevent->flags |= CYGNUM_CAN_EVENT_OVERRUN_RX_HW; HAL_WRITE_UINT32(CAN_CTRL_CMR(info), CMR_CLEAR_DATA_OVR); } }
