beautypg.com

Poweroff(), Analog_detect_enable(), E 53) – Maxim Integrated 73S12xxF Software User Manual

Page 53: Poweroff

background image


UG_12xxF_016

73S12xxF Software User Guide

Rev. 1.50

53

PowerOFF()

Purpose

Manage power consumption.

Synopsis

void PowerOFF ( IN unsigned int PowerSelect );

Parameters

PowerSelect: Input parameter
Specifies which internal devices to disable. The following possible values or any
combination (by OR’ing them) are allowed:

DISABLE_EICC

BIT14 // External Smart card.

DISABLE_VDDF

BIT13

DISABLE_UART

BIT12

DISABLE_PLL

BIT11

DISABLE_ANALOG

BIT10

DISABLE_USBXCVR BIT9
DISABLE_USB

BIT8

DISABLE_RTC

BIT7

DISABLE_KEYPAD

BIT6

DISABLE_ICC

BIT5

DISABLE_ USBCLK BIT4
DISABLE_LS_OSC

BIT3

// Bit 2 reserved.
CPU_HALT

BIT1

CPU_IDLE

BIT0


Return Codes None.

Devices which are already disabled will remain disabled. Any enabled interrupt will cause an exit from
this function.

CPU_HALT has precedence over CPU_IDLE. CPU_IDLE mode stops the clock going to the CPU, all
other clocks keep running.

CPU_HALT mode can be stopped by the USB and RTC interrupts (if available), by a key press, by ICC
insertion or removal or by Reset of the 73S12xxF. In order to use these external events to wake up the
CPU, they must first be individually initialized. For example,

ICC_InitUART()

or

KEY_Init ()

should be

called prior to calling PowerOFF (DISABLE_ICC) or PowerOFF (DISABLE_KEYPAD). Internally, the API
will configure INT0 to be active upon any of the events (key press, Smart Card event, etc..); thus an
application may setup its own INT0 interrupt service routine via Set_Event (eEXT0, ...) to customize its
specific needs upon waking up.

4.2.10 Analog Threshold Management Driver API – Available with all 73S12xxF Devices

This API controls the analog voltage comparison against the voltage on the ANA_IN pin. The API
includes:

ANALOG_Detect_Enable()

(page 53)

ANALOG_Detect_Disable()

(page 54)

ANALOG _Compare()

(page 54)


ANALOG_Detect_Enable()

Purpose

Select the analog threshold level and enable the interrupt according to the polarity setting.

Synopsis

void ANALOG_Detect_Enable (

IN Unsigned char threshold_select,

IN Unsigned char acomp_pol)