Datasheet

Sensors
NXP Semiconductors 25
MMA8452Q
6.2 Portrait/landscape embedded function registers
For more details on the meaning of the different user-configurable settings and for example code refer to NXP application note
AN4068.
0x10: PL_STATUS portrait/landscape status register
This status register can be read to get updated information on any change in orientation by reading bit 7, or on the specifics of
the orientation by reading the other bits. For further understanding of portrait up, portrait down, landscape left, landscape right,
back and front orientations please refer to Figure 3. The interrupt is cleared when reading the PL_STATUS register.
NEWLP is set to 1 after the first orientation detection after a standby to active transition, and whenever a change in LO, BAFRO,
or LAPO occurs. NEWLP bit is cleared anytime PL_STATUS register is read.
The orientation mechanism state change is limited
to a maximum 1.25 g. LAPO BAFRO and LO continue to change when NEWLP is set. The current position is locked if the
absolute value of the acceleration experienced on any of the three axes is greater than 1.25 g.
0x11: Portrait/landscape configuration register
This register enables the portrait/landscape function and sets the behavior of the debounce counter.
0x10: PL_STATUS register (read only)
Bit
7
Bit
6
Bit
5
Bit
4
Bit
3
Bit
2
Bit
1
Bit
0
NEWLP LO 0 0 0 LAPO[1] LAPO[0] BAFRO
Table 19. PL_STATUS register description
Field Description
NEWLP
Landscape/portrait status change flag. Default value: 0.
0: No change, 1: BAFRO and/or LAPO and/or Z-tilt lockout value has changed
LO
Z-tilt angle lockout. Default value: 0.
0: Lockout condition has not been detected.
1: Z-tilt lockout trip angle has been exceeded. Lockout has been detected.
LAPO[1:0]
(1)
1. The default power up state is BAFRO = 0, LAPO = 0, and LO = 0.
Landscape/portrait orientation. Default value: 00
00: Portrait up: Equipment standing vertically in the normal orientation
01: Portrait down: Equipment standing vertically in the inverted orientation
10: Landscape right: Equipment is in landscape mode to the right
11: Landscape left: Equipment is in landscape mode to the left.
BAFRO
Back or front orientation. Default value: 0
0: Front: Equipment is in the front facing orientation.
1: Back: Equipment is in the back facing orientation.
0x11: PL_CFG register (read/write)
Bit
7
Bit
6
Bit
5
Bit
4
Bit
3
Bit
2
Bit
1
Bit
0
DBCNTM PL_EN 0 0 0 0 0 0
Table 20. PL_CFG description
Field Description
DBCNTM
Debounce counter mode selection. Default value: 1
0: Decrements debounce whenever condition of interest is no longer valid.
1: Clears counter whenever condition of interest is no longer valid.
PL_EN
Portrait/landscape detection enable. Default value: 0
0: Portrait/landscape detection is disabled.
1: Portrait/landscape detection is enabled.