⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 periphery.h

📁 MSP acquires data and sends through USB to PC. Check the link for PC capture software and project d
💻 H
字号:
/*
 * File:        periphery.h
 * Purpose:     Keyboard and joystick handler function headers
 * Author:      Peter Ivanov, Olimex Ltd.
 * Modified by:
 * Created:     2007-05-19 11:29:32
 * Last modify: 2007-10-03 21:03:39 ivanovp {Time-stamp}
 * Copyright:   (C) Peter Ivanov, 2007
 * Licence:     GPL
 */
/**
 * \file periphery.h
 * \brief Keyboard and joystick handler function headers
 * \author Peter Ivanov, Olimex Ltd.
 */
#ifndef __INCLUDE_PERIPHERY_H
#define __INCLUDE_PERIPHERY_H
#include "common.h"

extern volatile bool_t KBD_b1Pressed;
extern volatile bool_t KBD_b2Pressed;

typedef enum JOY_pos_T
{
    JOY_POS_LEFT    = 0x01,
    JOY_POS_RIGHT   = 0x02,
    JOY_POS_UP      = 0x04,
    JOY_POS_DOWN    = 0x08,
    JOY_POS_CENTER  = 0x10
} JOY_pos_t;

/**
 * This enum is used to detect which button has been pressed.
 * @see KBD_getButtonPressed()
 */
typedef enum KBD_buttonPressed_T
{
    KBD_LEFT        = JOY_POS_LEFT,     ///< Joystick pushed to left
    KBD_RIGHT       = JOY_POS_RIGHT,    ///< Joystick pushed to right
    KBD_UP          = JOY_POS_UP,       ///< Joystick pushed to up
    KBD_DOWN        = JOY_POS_DOWN,     ///< Joystick pushed to down
    KBD_CENTER      = JOY_POS_CENTER,   ///< The center of joystick pushed
    KBD_B1          = 0x20,             ///< Button 1 (OK) pressed
    KBD_B2          = 0x40,             ///< Button 2 (Quit) pressed
    KBD_OK          = KBD_B1,           ///< Button 1 (OK) pressed
    KBD_QUIT        = KBD_B2            ///< Button 2 (Quit) pressed
} KBD_buttonPressed_t;

void KBD_init (void);

inline uint8_t KBD_getB1 ();

inline uint8_t KBD_getB2 ();

void JOY_init (void);

JOY_pos_t JOY_getPosition(void);

KBD_buttonPressed_t KBD_getButtonPressed ();

void GPIO_init(void);

void ADC12_init (void);
inline void ADC12_setRefOn (void);
inline void ADC12_setRefOff (void);
unsigned int ADC12_get (uint16_t mctl);
uint16_t ADC12_getOS (uint16_t mctl);

float ADC12_getVCC (void);

float ADC12_getTempCelsius ();

#endif // __INCLUDE_PERIPHERY_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -