Watchdog, I32 setchlevel( u8 val ) – Acrosser AR-R5800A User Manual

Page 39

Advertising
background image

AR-B5800 User Manual

a GPIO port is configured as an Input port, the corresponding bit at *val is always ‘1’.

Return Value: If the function gets the values successfully, it returns 0. If any error, it returns –1.

4. Syntax:

i32 setChLevel( u8 val )

Description: Set the status bits of GPIO Output ports according to the variable ‘val’. The status bits at
the ports which are configured as input will not be affected.

Parameters: The parameter ‘val’ is an unsigned character. If a GPIO port is configured as an Output
port, a ‘1’ bit at ‘val’ directs the corresponding port to output a ‘1’. A ‘0’ bit directs this port to output a
‘0’. If a GPIO ports is configured as an Input port, the setting to these input port is ignored.

Return Value: If the function sets the values successfully, it returns 0. If any error, it returns –1.

Watchdog

1. Syntax:

u8 getWtdTimer(void)

Description: This function read the value of the watchdog time counter and return it to the caller.

Parameters: None.

Return Value: This function return the value of the time counter and return it to the caller as an
unsigned integer.


2. Syntax:

void setWtdTimer( u8 val )

Description: This function sets the watchdog timer register to the value ‘val’ and starts to count down.
The value could be 0 ~ 255. The unit is second. Setting the timer register to 0 disables the watchdog
function and stops the countdown.

Parameters: The parameter ‘val’ is the value to set to watchdog timer register. The range is 0 ~ 255.

Return Value: None.

39


Advertising
This manual is related to the following products: