MCUXpresso SDK API Reference Manual
Rev. 0
NXP Semiconductors
|
The MCUXpresso SDK provides a peripheral driver for the Touch Screen Controller(TSC) module of MCUXpresso SDK devices.
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/fsl_tsc
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/fsl_tsc
Data Structures | |
struct | tsc_config_t |
@ Controller configuration. More... | |
Macros | |
#define | FSL_TSC_DRIVER_VERSION (MAKE_VERSION(2, 0, 3)) |
TSC driver version. More... | |
Enumerations | |
enum | tsc_detection_mode_t { kTSC_Detection4WireMode = 0U, kTSC_Detection5WireMode = 1U } |
@ Controller detection mode. More... | |
enum | tsc_corrdinate_value_selection_t { kTSC_XCoordinateValueSelection = 0U, kTSC_YCoordinateValueSelection = 1U } |
@ Coordinate value mask. More... | |
enum | _tsc_interrupt_signal_mask { kTSC_IdleSoftwareSignalEnable = TSC_INT_SIG_EN_IDLE_SW_SIG_EN_MASK, kTSC_ValidSignalEnable = TSC_INT_SIG_EN_VALID_SIG_EN_MASK, kTSC_DetectSignalEnable, kTSC_MeasureSignalEnable = TSC_INT_SIG_EN_MEASURE_SIG_EN_MASK } |
@ Interrupt signal enable/disable mask. More... | |
enum | _tsc_interrupt_mask { kTSC_IdleSoftwareInterruptEnable, kTSC_DetectInterruptEnable, kTSC_MeasureInterruptEnable = TSC_INT_EN_MEASURE_INT_EN_MASK } |
@ Interrupt enable/disable mask. More... | |
enum | _tsc_interrupt_status_flag_mask { kTSC_IdleSoftwareFlag, kTSC_ValidSignalFlag, kTSC_DetectSignalFlag = TSC_INT_STATUS_DETECT_MASK, kTSC_MeasureSignalFlag } |
@ Interrupt Status flag mask. More... | |
enum | _tsc_adc_status_flag_mask { kTSC_ADCCOCOSignalFlag, kTSC_ADCConversionValueFlag = TSC_DEBUG_MODE_ADC_CONV_VALUE_MASK } |
@ ADC status flag mask. More... | |
enum | _tsc_status_flag_mask { kTSC_IntermediateStateFlag = TSC_DEBUG_MODE2_INTERMEDIATE_MASK, kTSC_DetectFiveWireFlag = TSC_DEBUG_MODE2_DETECT_FIVE_WIRE_MASK, kTSC_DetectFourWireFlag = TSC_DEBUG_MODE2_DETECT_FOUR_WIRE_MASK, kTSC_GlitchThresholdFlag = TSC_DEBUG_MODE2_DE_GLITCH_MASK, kTSC_StateMachineFlag } |
@ TSC status flag mask. More... | |
enum | tsc_state_machine_t { kTSC_IdleState = 0U << TSC_DEBUG_MODE2_STATE_MACHINE_SHIFT, kTSC_1stPreChargeState = 1U << TSC_DEBUG_MODE2_STATE_MACHINE_SHIFT, kTSC_1stDetectState = 2U << TSC_DEBUG_MODE2_STATE_MACHINE_SHIFT, kTSC_XMeasureState = 3U << TSC_DEBUG_MODE2_STATE_MACHINE_SHIFT, kTSC_YMeasureState = 4U << TSC_DEBUG_MODE2_STATE_MACHINE_SHIFT, kTSC_2ndPreChargeState = 5U << TSC_DEBUG_MODE2_STATE_MACHINE_SHIFT, kTSC_2ndDetectState = 6U << TSC_DEBUG_MODE2_STATE_MACHINE_SHIFT } |
TSC state machine. More... | |
enum | tsc_glitch_threshold_t { kTSC_glitchThresholdALT0 = 0U << TSC_DEBUG_MODE2_DE_GLITCH_SHIFT, kTSC_glitchThresholdALT1 = 1U << TSC_DEBUG_MODE2_DE_GLITCH_SHIFT, kTSC_glitchThresholdALT2 = 2U << TSC_DEBUG_MODE2_DE_GLITCH_SHIFT, kTSC_glitchThresholdALT3 } |
TSC glitch threshold. More... | |
enum | tsc_trigger_signal_t { kTSC_TriggerToChannel0 = 1U << 0U, kTSC_TriggerToChannel1 = 1U << 1U, kTSC_TriggerToChannel2 = 1U << 2U, kTSC_TriggerToChannel3 = 1U << 3U, kTSC_TriggerToChannel4 = 1U << 4U } |
@ Hardware trigger select signal, select which ADC channel to start conversion. More... | |
enum | tsc_port_source_t { kTSC_WiperPortSource = 0U, kTSC_YnlrPortSource = 1U, kTSC_YpllPortSource = 2U, kTSC_XnurPortSource = 3U, kTSC_XpulPortSource = 4U } |
@ TSC controller ports. More... | |
enum | tsc_port_mode_t { kTSC_PortOffMode = 0U, kTSC_Port200k_PullUpMode = 1U << 2U, kTSC_PortPullUpMode = 1U << 1U, kTSC_PortPullDownMode = 1U << 0U } |
@ TSC port mode. More... | |
Functions | |
void | TSC_Init (TSC_Type *base, const tsc_config_t *config) |
Initialize the TSC module. More... | |
void | TSC_Deinit (TSC_Type *base) |
De-initializes the TSC module. More... | |
void | TSC_GetDefaultConfig (tsc_config_t *config) |
Gets an available pre-defined settings for the controller's configuration. More... | |
static void | TSC_ReturnToIdleStatus (TSC_Type *base) |
Make the TSC module return to idle status after finish the current state operation. More... | |
static void | TSC_StartSenseDetection (TSC_Type *base) |
Start sense detection and (if work in auto-measure mode) measure after detect a touch. More... | |
static void | TSC_StartMeasure (TSC_Type *base) |
start measure X/Y coordinate value after detect a touch. More... | |
static void | TSC_DropMeasure (TSC_Type *base) |
Drop measure X/Y coordinate value after detect a touch and controller return to idle status. More... | |
static void | TSC_SoftwareReset (TSC_Type *base) |
This is a synchronization reset, which resets every register except IPS directly access ones. More... | |
uint32_t | TSC_GetMeasureValue (TSC_Type *base, tsc_corrdinate_value_selection_t selection) |
Get Y coordinate value or X coordinate value. More... | |
static void | TSC_EnableInterruptSignals (TSC_Type *base, uint32_t mask) |
Enable the interrupt signals. More... | |
static void | TSC_DisableInterruptSignals (TSC_Type *base, uint32_t mask) |
Disable the interrupt signals. More... | |
static void | TSC_EnableInterrupts (TSC_Type *base, uint32_t mask) |
Enable the interrupts. More... | |
static void | TSC_DisableInterrupts (TSC_Type *base, uint32_t mask) |
Disable the interrupts. More... | |
static uint32_t | TSC_GetInterruptStatusFlags (TSC_Type *base) |
Get interrupt status flags. More... | |
static void | TSC_ClearInterruptStatusFlags (TSC_Type *base, uint32_t mask) |
Clear interrupt status flags. More... | |
static uint32_t | TSC_GetADCStatusFlags (TSC_Type *base) |
Get the status flags of ADC working with TSC. More... | |
static uint32_t | TSC_GetStatusFlags (TSC_Type *base) |
Get the status flags of TSC. More... | |
struct tsc_config_t |
Data Fields | |
bool | enableAutoMeasure |
Enable the auto-measure. More... | |
uint32_t | measureDelayTime |
Set delay time(0U~0xFFFFFFU) to even potential distribution ready.It is a preparation for measure stage. More... | |
uint32_t | prechargeTime |
Set pre-charge time(1U~0xFFFFFFFFU) to make the upper layer of screen to charge to positive high. More... | |
tsc_detection_mode_t | detectionMode |
Select the detection mode. More... | |
bool tsc_config_t::enableAutoMeasure |
It indicates after detect touch, whether automatic start measurement
uint32_t tsc_config_t::measureDelayTime |
If measure dalay time is too short, maybe it would have an undesired effect on measure value.
uint32_t tsc_config_t::prechargeTime |
It is a preparation for detection stage. Pre-charge time must is greater than 0U, otherwise TSC could not work normally. If pre-charge dalay time is too short, maybe it would have an undesired effect on generation of valid signal(kTSC_ValidSignalFlag).
tsc_detection_mode_t tsc_config_t::detectionMode |
See "tsc_detection_mode_t".
#define FSL_TSC_DRIVER_VERSION (MAKE_VERSION(2, 0, 3)) |
Version 2.0.3.
enum tsc_detection_mode_t |
enum _tsc_interrupt_mask |
enum tsc_state_machine_t |
These seven states are TSC complete workflow.
enum tsc_trigger_signal_t |
enum tsc_port_source_t |
enum tsc_port_mode_t |
void TSC_Init | ( | TSC_Type * | base, |
const tsc_config_t * | config | ||
) |
base | TSC peripheral base address. |
config | Pointer to "tsc_config_t" structure. |
void TSC_Deinit | ( | TSC_Type * | base | ) |
base | TSC peripheral base address. |
void TSC_GetDefaultConfig | ( | tsc_config_t * | config | ) |
This function initializes the converter configuration structure with available settings. The default values of measureDelayTime and prechargeTime is tested on LCD8000-43T screen and work normally. The default values are:
config | Pointer to "tsc_config_t" structure. |
|
inlinestatic |
Application could check TSC status to confirm that the controller has return to idle status.
base | TSC peripheral base address. |
|
inlinestatic |
base | TSC peripheral base address. |
|
inlinestatic |
base | TSC peripheral base address. |
|
inlinestatic |
base | TSC peripheral base address. |
|
inlinestatic |
base | TSC peripheral base address. |
uint32_t TSC_GetMeasureValue | ( | TSC_Type * | base, |
tsc_corrdinate_value_selection_t | selection | ||
) |
The value is an ADC conversion value.
base | TSC peripheral base address. |
selection | Select alternative measure value which is Y coordinate value or X coordinate value. See "tsc_corrdinate_value_selection_t". |
|
inlinestatic |
Interrupt signal will be set when corresponding event happens. Specific events point to "_tsc_interrupt_signal_mask" . Specific interrupt signal point to "_tsc_interrupt_status_flag_mask";
base | TSC peripheral base address. |
mask | Interrupt signals mask. See "_tsc_interrupt_signal_mask". |
|
inlinestatic |
Interrupt signal will be set when corresponding event happens. Specific events point to "_tsc_interrupt_signal_mask". Specific interrupt signal point to "_tsc_interrupt_status_flag_mask";
base | TSC peripheral base address. |
mask | Interrupt signals mask. See "_tsc_interrupt_signal_mask". |
|
inlinestatic |
Notice: Only interrupts and signals are all enabled, interrupts could work normally.
base | TSC peripheral base address. |
mask | Interrupts mask. See "_tsc_interrupt_mask". |
|
inlinestatic |
base | TSC peripheral base address. |
mask | Interrupts mask. See "_tsc_interrupt_mask". |
|
inlinestatic |
Interrupt status falgs are valid when corresponding interrupt signals are enabled.
base | TSC peripheral base address. |
|
inlinestatic |
Interrupt status falgs are valid when corresponding interrupt signals are enabled.
base | TSC peripheral base address. |
mask | Status flags mask. See "_tsc_interrupt_status_flag_mask". |
|
inlinestatic |
base | TSC peripheral base address. |
|
inlinestatic |
base | TSC peripheral base address. |