2 gpio and watchdog, 1 gpio – Acrosser AR-B6051 User Manual

Page 52

Advertising
background image

For example:

struct CanFilter varFilter;

i32 result;

varFilter.filterId = 3;

varFilter.filterType = STD_ID;

varFilter.filter = 0x555;

result = setCanFilter(&varFilter);

if( result != 0)

printf(“Fail to set up the filter!\n”);

Return Value: If this function sets the filter successfully, it returns 0,

any other returned value

stands for error.

6.3.2 GPIO and Watchdog

6.3.2.1 GPIO

1. Syntax:

i32 getChLevel(u8 *val )

Description: Get the status of GPIO input pins and output pins, and put the value at *val.

Parameters:

This function takes a pointer to an unsigned char variable as the parameter.

The bit0 ~ bit3 in the pointed variable ‘*val’ is the status of the output pins. The bit4 ~ bit7 in the

pointed variable ‘*val’ is the status of the input pins.

For example:

u8 val;

i32 result;

result = getChLevel( &val);

if(result != 0)

printf(“Fail to get GPIO status!\n”);

52

Advertising