MCUXpresso SDK API Reference Manual  Rev 2.16.000
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
 KBI configuration. More...
 

Typedefs

typedef enum _kbi_detect_mode kbi_detect_mode_t
 KBI detection mode. More...
 
typedef struct _kbi_config kbi_config_t
 KBI configuration. More...
 

Enumerations

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

Driver version

#define FSL_KBI_DRIVER_VERSION   (MAKE_VERSION(2, 0, 3))
 KBI driver version. 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...
 

Data Structure Documentation

struct _kbi_config

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::pinsEnabled
uint32_t _kbi_config::pinsEdge
kbi_detect_mode_t _kbi_config::mode

Macro Definition Documentation

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

Typedef Documentation

typedef struct _kbi_config kbi_config_t

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.