16FXlib
CAN System Services (can5.h)

Detailed Description

Overview
This library enables System Services.

Functions

uint8_t can5_init (void)
 
void can5_close (void)
 
uint8_t can5_isAlive (uint8_t address)
 
uint8_t can5_getNewAddress (void)
 

Service variables

#define CAN5_PING_TIMEOUT   200000
 
#define CAN5_ALIVE_TIMEOUT   20000
 
#define CAN5_PORT   0
 

Function Documentation

uint8_t can5_init ( void  )

Initializes the CAN controller. Also optains automatically an address for this controller. Interrupts are also activated.

Returns
1 if everything went fine, 0 if there was an error

Definition at line 35 of file can5.c.

void can5_close ( void  )

Closes the standard system message port (port 0)

Definition at line 116 of file can5.c.

uint8_t can5_isAlive ( uint8_t  address)

Checks if given address is online.

Parameters
addressAddress to be used
Returns
1 if address is online, 0 if is offline

Definition at line 54 of file can5.c.

uint8_t can5_getNewAddress ( void  )

Internal address to optain new address but can also be accessed from outside.

Returns
1 if everything went fine, 0 if there was an error

Definition at line 72 of file can5.c.