#ifndef _TUI_PINPAD_STATE_H_
#define _TUI_PINPAD_STATE_H_

#include <stdint.h>

/** State of the pinpad */
#define SPAY_TUI_ST_NONE		0x00000000

#define _SPAY_TUI_ST_START		0x00000001
#define _SPAY_TUI_ST_REMOVE_START	0xfffffff0
#define _SPAY_TUI_ST_ENTER		0x00000002
#define _SPAY_TUI_ST_MATCH		0x00000004
#define _SPAY_TUI_ST_UNMATCH		0x00000008
#define _SPAY_TUI_ST_INVALID		0x00000010
#define _SPAY_TUI_ST_FIRST		0x00000100
#define _SPAY_TUI_ST_SECOND		0x00000200
#define _SPAY_TUI_ST_SETUP		0x00001000
#define _SPAY_TUI_ST_VERIFY		0x00002000

#define SPAY_TUI_ST_SETUP_START_FIRST		(_SPAY_TUI_ST_SETUP | _SPAY_TUI_ST_FIRST | _SPAY_TUI_ST_START)
#define SPAY_TUI_ST_SETUP_ENTER_FIRST		(_SPAY_TUI_ST_SETUP | _SPAY_TUI_ST_FIRST | _SPAY_TUI_ST_ENTER)
#define SPAY_TUI_ST_SETUP_ENTER_INVALID 	(_SPAY_TUI_ST_SETUP | _SPAY_TUI_ST_FIRST | _SPAY_TUI_ST_INVALID)
#define SPAY_TUI_ST_SETUP_START_SECOND		(_SPAY_TUI_ST_SETUP | _SPAY_TUI_ST_SECOND | _SPAY_TUI_ST_START)
#define SPAY_TUI_ST_SETUP_ENTER_SECOND		(_SPAY_TUI_ST_SETUP | _SPAY_TUI_ST_SECOND | _SPAY_TUI_ST_ENTER)
#define SPAY_TUI_ST_SETUP_MATCH			(_SPAY_TUI_ST_SETUP | _SPAY_TUI_ST_SECOND | _SPAY_TUI_ST_MATCH)
#define SPAY_TUI_ST_SETUP_UNMATCH		(_SPAY_TUI_ST_SETUP | _SPAY_TUI_ST_SECOND | _SPAY_TUI_ST_UNMATCH)

#define SPAY_TUI_ST_VERIFY_START		(_SPAY_TUI_ST_VERIFY | _SPAY_TUI_ST_START)
#define SPAY_TUI_ST_VERIFY_ENTER		(_SPAY_TUI_ST_VERIFY | _SPAY_TUI_ST_ENTER)
#define SPAY_TUI_ST_VERIFY_MATCH		(_SPAY_TUI_ST_VERIFY | _SPAY_TUI_ST_MATCH)
#define SPAY_TUI_ST_VERIFY_UNMATCH		(_SPAY_TUI_ST_VERIFY | _SPAY_TUI_ST_UNMATCH)

#define SPAY_TUI_ST_CANCELLED			0x3000	/** 'Cancel' pressed or something wrong */

#define SPAY_TUI_ST_SECURE_RESULT		0x4000	// secure result has been retrieved

#define PIN_TUI_ST_NONE 0x00000000
#define PIN_TUI_ST_BACKGROUND 0x00000001
#define PIN_TUI_ST_TOUCHABLE_VIEW 0x00000002

#ifdef __cplusplus
extern "C" {
#endif
	void setPinpadState(uint32_t state);
	uint32_t getPinpadState();
	void setPinResourceState(uint32_t state);
	uint32_t getPinResourceState();
#ifdef __cplusplus
}
#endif

#endif
