AN2841 Freescale Semiconductor / Motorola, AN2841 Datasheet - Page 13

no-image

AN2841

Manufacturer Part Number
AN2841
Description
Using the Hall Decoder (HD) eTPU Function
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
4.1
4.1.1
These routines are used to initialize the eTPU channel(s) for the HD function(s). They differ in the number
of phases they initialize (1, 2, 3, or 4 phases) and the configuration of the Hall sensors (by 60deg, by
120deg, by 45deg, or by 90 and 45 deg).
Because the Revolution Counter and Direction are calculated only in configurations with 3 or 4 input
channels (phases), both the revolution_on_off and direction_on_off parameters are not used
in fs_etpu_hd_init_1ph(...) and fs_etpu_hd_init_2ph(...) functions dedicated for
one and two phases; see
The functions have the following parameters:
Freescale Semiconductor
channel_phaseA (uint8_t) - This is the Phase A channel number. This parameter should be
assigned a value of 0-31 for ETPU_A, and 64-95 for ETPU_B.
channel_phaseB (uint8_t) - This is the Phase B channel number. This parameter should be
assigned a value of 0-31 for ETPU_A, and 64-95 for ETPU_B.
channel_phaseC (uint8_t) - This is the Phase C channel number. This parameter should be
assigned a value of 0-31 for ETPU_A, and 64-95 for ETPU_B.
channel_phaseD (uint8_t) - This is the Phase D channel number. This parameter should be
assigned a value of 0-31 for ETPU_A, and 64-95 for ETPU_B.
timer (uint8_t) - This is the timer to use as a reference for the HD signals. This parameter should
be assigned a value of:
— FS_ETPU_TCR1
— FS_ETPU_TCR2
Initialization Function
int32_t fs_etpu_hd_init_1ph(...),
int32_t fs_etpu_hd_init_2ph(...),
int32_t fs_etpu_hd_init_3ph60(...),
int32_t fs_etpu_hd_init_3ph120(...),
int32_t fs_etpu_hd_init_4ph45(...),
int32_t fs_etpu_hd_init_4ph90and45(...)
uint8_t fs_etpu_hd_get_direction( uint8_t channel)
int24_t fs_etpu_hd_get_revolution_counter( uint8_t channel)
int24_t fs_etpu_hd_get_revolution_period( uint8_t channel)
int24_t fs_etpu_hd_get_sector_period( uint8_t channel)
uint8_t fs_etpu_hd_get_pin_state( uint8_t channel)
int24_t* fs_etpu_hd_get_revolution_period_ptr( uint8_t channel)
int24_t* fs_etpu_hd_get_sector_period_ptr( uint8_t channel)
Section 3, “Function
Using the Hall Decoder (HD) eTPU Function, Rev. 0
Description.”
C Level API for Function
13

Related parts for AN2841