MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
KBI: Keyboard interrupt Driver

Overview

The MCUXpresso SDK provides a peripheral driver for the keyboard interrupt block of MCUXpresso SDK devices.

KBI Operations

KBI Initialization Operation

The KBI Initialize is to initialize for common configure: gate the KBI clock, configure enabled KBI pins, and enable the interrupt. The KBI Deinitialize is to disable the interrupt/pins and ungate the clock.

KBI Basic Operation

The KBI provide the function to enable/disable interrupts. KBI still provide functions to get and clear status flags.

Typical use case

Data Structures

struct  kbi_config_t
 KBI configuration. More...
 

Enumerations

enum  kbi_detect_mode_t {
  kKBI_EdgesDetect = 0,
  kKBI_EdgesLevelDetect
}
 KBI detection mode. More...
 

Driver version

#define FSL_KBI_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))
 KBI driver version 2.0.0. More...
 

Initialization and De-initialization

void KBI_Init (KBI_Type *base, kbi_config_t *configure)
 KBI initialize. More...
 
void KBI_Deinit (KBI_Type *base)
 Deinitializes the KBI module and gates the clock. More...
 

KBI Basic Operation

static void KBI_EnableInterrupts (KBI_Type *base)
 Enables the interrupt. More...
 
static void KBI_DisableInterrupts (KBI_Type *base)
 Disables the interrupt. More...
 
static bool KBI_IsInterruptRequestDetected (KBI_Type *base)
 Gets the KBI interrupt event status. More...
 
static void KBI_ClearInterruptFlag (KBI_Type *base)
 Clears KBI status flag. More...
 
static uint32_t KBI_GetSourcePinStatus (KBI_Type *base)
 Gets the KBI Source pin status. More...
 

Data Structure Documentation

struct kbi_config_t

Data Fields

uint32_t pinsEnabled
 The eight kbi pins, set 1 to enable the corresponding KBI interrupt pins. More...
 
uint32_t pinsEdge
 The edge selection for each kbi pin: 1 – rinsing edge, 0 – falling edge. More...
 
kbi_detect_mode_t mode
 The kbi detection mode. More...
 

Field Documentation

uint32_t kbi_config_t::pinsEnabled
uint32_t kbi_config_t::pinsEdge
kbi_detect_mode_t kbi_config_t::mode

Macro Definition Documentation

#define FSL_KBI_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))

Enumeration Type Documentation

Enumerator
kKBI_EdgesDetect 

The keyboard detects edges only.

kKBI_EdgesLevelDetect 

The keyboard detects both edges and levels.

Function Documentation

void KBI_Init ( KBI_Type *  base,
kbi_config_t configure 
)

This function ungates the KBI clock and initializes KBI. This function must be called before calling any other KBI driver functions.

Parameters
baseKBI peripheral base address.
configureThe KBI configuration structure pointer.
void KBI_Deinit ( KBI_Type *  base)

This function gates the KBI clock. As a result, the KBI module doesn't work after calling this function.

Parameters
baseKBI peripheral base address.
static void KBI_EnableInterrupts ( KBI_Type *  base)
inlinestatic
Parameters
baseKBI peripheral base address.
static void KBI_DisableInterrupts ( KBI_Type *  base)
inlinestatic
Parameters
baseKBI peripheral base address.
static bool KBI_IsInterruptRequestDetected ( KBI_Type *  base)
inlinestatic
Parameters
baseKBI peripheral base address.
Returns
The status of the KBI interrupt request is detected.
static void KBI_ClearInterruptFlag ( KBI_Type *  base)
inlinestatic
Parameters
baseKBI peripheral base address.
static uint32_t KBI_GetSourcePinStatus ( KBI_Type *  base)
inlinestatic
Parameters
baseKBI peripheral base address.
Returns
The status indicates the active pin defined as keyboard interrupt which is pushed.