![Tews Technologies TIP810-SW-42 User Manual Download Page 11](http://html1.mh-extra.com/html/tews-technologies/tip810-sw-42/tip810-sw-42_user-manual_1093635011.webp)
TIP810-SW-42 - VxWorks Device Driver
Page 11 of 36
EXAMPLE
#include
“ipac_carrier.h”
#include
“tip810.h”
STATUS
result;
TIP810_DEVCONFIG
tip816Conf;
struct ipac_resource ipac;
/* IPAC CARRIER Driver initialization */
/*
** Find an IP module with manufacturer id MANUFACTOR_TEWS (0xB3)
** and model number MODEL_TIP810 (see tip810.h). This module uses
** interrupts on INT0 and we need need the 16bit memory space. The
** module need an IACK cycle for interrupt handling.
*/
result = ipFindDevice(MANUFACTOR_TEWS, MODEL_TIP810, 0,
IPAC_INT0_EN | IPAC_LEVEL_SENS | IPAC_CLK_8MHZ |
IPAC_MEM_16BIT | IPAC_IACK_CYC,
&ipac);
if (result == OK)
{
/*-------------------------------------------------------
Create the device "/t810A" for the first CAN device
..* Device specific parameters must be set up:
o reserve a read buffer for 1000 messages
o transfer rate = 100kbit/s, one sample per bit
o only messages with identifiers 128…135 passes the acceptance filter
-------------------------------------------------------*/
tip810Conf.ipac
= &ipac;
tip810Conf.filter.acceptance_code = 128 << 3;
tip810Conf.filter.acceptance_mask = (8 << 3) – 1;
tip810Conf.filter.single_filter
= 1;
tip810Conf.timing.timing_value
= T810_100KBIT;
tip810Conf.timing.three_samples
= 0;
result = tip816DevCreate( "/t810A",
0,
0,
(void*)&tip810Conf);
if (result == OK)
{
/* Device successfully created */
}