c2x2key 2.0.0.0
main.c File Reference

2x2 key Click example More...

#include "board.h"
#include "log.h"
#include "c2x2key.h"

Functions

void application_init (void)
 
void application_task (void)
 
int main (void)
 

Variables

uint8_t t1_state = 0
 
uint8_t t1_state_old = 1
 
uint8_t t2_state = 0
 
uint8_t t2_state_old = 1
 
uint8_t t3_state = 0
 
uint8_t t3_state_old = 1
 
uint8_t t4_state = 0
 
uint8_t t4_state_old = 1
 

Detailed Description

2x2 key Click example

Description

2x2 Key click has a 4 button keypad and allows multiple key presses.

The demo application is composed of two sections :

Application Init

Application Init performs Logger and Click initialization.

Application Task

This example code demonstrates the usage of 2X2 Key Click board. Detects whether any of the keys is pressed where results are being sent to the UART terminal where you can track changes.

Author
Mihajlo Djordjevic

Function Documentation

◆ application_init()

void application_init ( void )

Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG

Note
If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC, you will need to define them manually for log to work. See LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ main()

int main ( void )

Variable Documentation

◆ t1_state

uint8_t t1_state = 0

◆ t1_state_old

uint8_t t1_state_old = 1

◆ t2_state

uint8_t t2_state = 0

◆ t2_state_old

uint8_t t2_state_old = 1

◆ t3_state

uint8_t t3_state = 0

◆ t3_state_old

uint8_t t3_state_old = 1

◆ t4_state

uint8_t t4_state = 0

◆ t4_state_old

uint8_t t4_state_old = 1