📄 armio32.h
字号:
//-------------------------------------------------------------------
#define ARMIO_SET_ALL_IO_CNTL(Dir) REG16(ARMIO_IO_CNTL)=Dir
//-------------------------------------------------------------------
// NAME : ARMIO_SET_CNTL
// DESCRIPTION : Configure emulation mode and ARMIO Module CKEn
// PARAMETERS : Free & Soft : Emulation config.
// CkEn : Ck Enable :ARMIO_CKEN / ARMIO_CKDIS
// RETURN VALUE: None
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_SET_CNTL(Free,Soft,CkEn) \
REG16(ARMIO_CNTL)= ((Free)<<ARMIO_FREE_POS)|\
((Soft)<<ARMIO_SOFT_POS)|\
((CkEn)<<ARMIO_CKEN_POS)
//-------------------------------------------------------------------
// NAME : ARMIO_GET_ALL_KBROW
// DESCRIPTION : Get Keybprd Row input
// PARAMETERS : None
// RETURN VALUE: Return Keybprd Row input
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_GET_ALL_KBROW() (REG16(ARMIO_KBR) & ROWS_MASK)
//-------------------------------------------------------------------
// NAME : ARMIO_GET_BIT_KBROW
// DESCRIPTION : Get One of the Keybprd Row input
// PARAMETERS : None
// RETURN VALUE: Get One of the Keybprd Row input
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_GET_BIT_KBROW(Bit) ARMIO_GET_BIT(REG16(ARMIO_KBR),Bit)
//-------------------------------------------------------------------
// NAME : ARMIO_GET_BIT_KBC_REG
// DESCRIPTION : Get one of the input rows
// PARAMETERS : Bit : Pin to get
// RETURN VALUE: Get one of the input rows
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_GET_BIT_KBCOL(Bit) ARMIO_GET_BIT(REG16(ARMIO_KBC),Bit)
//-------------------------------------------------------------------
// NAME : ARMIO_GET_ALL_KBC_REG
// DESCRIPTION : Get all columns keyboerd
// PARAMETERS : None
// RETURN VALUE: Get all columns keyboerd
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_GET_ALL_KBCOL() (REG16(ARMIO_KBC) & COLUMNS_MASK)
//-------------------------------------------------------------------
// NAME : ARMIO_SET_BIT_KBC_REG
// DESCRIPTION : Set one bit of the columns kbd
// PARAMETERS : Data : Value of the pin ARMIO_HIGH / ARMIO_LOW, Bit : Pin Nb
// RETURN VALUE: None
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_SET_BIT_KBCOL(Data,Bit) ARMIO_SET_BIT(REG16(ARMIO_KBC),Data,Bit)
//-------------------------------------------------------------------
// NAME : ARMIO_SET_ALL_KBC_REG
// DESCRIPTION : Set all bits of the columns kbd
// PARAMETERS : Data : 6 bits value
// RETURN VALUE: None
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_SET_ALL_KBCOL(Data) REG16(ARMIO_KBC)=(Data) & COLUMNS_MASK
//-------------------------------------------------------------------
// NAME : ARMIO_SET_GPIO_MODE
// DESCRIPTION : Config event mode and pin to get the event mode
// PARAMETERS : EventMode :ARMIO_ENEVT / ARMIO_DISEVT
// RETURN VALUE: None
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_SET_GPIO_MODE(EventMode,PinNb) \
REG16(ARMIO_GPIO_EVENT_MODE)=((EventMode)<<SET_GPIO_EVENT_MODE_POS)|\
((PinNb)<<PIN_SELECT_POS)
//-------------------------------------------------------------------
// NAME : ARMIO_GET_GPIO_EVENT_MODE
// DESCRIPTION : Get GPIO Evt mode
// PARAMETERS : None
// RETURN VALUE: Get GPIO Evt mode
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_GET_GPIO_EVENT_MODE() (REG16(ARMIO_GPIO_EVENT_MODE) & SET_GPIO_EVENT_MODE_POS)
//-------------------------------------------------------------------
// NAME : ARMIO_GET_GPIO_PIN_SELECTED
// DESCRIPTION : Get the GPIO pin selected
// PARAMETERS : None
// RETURN VALUE: Get the GPIO pin selected
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_GET_GPIO_PIN_SELECTED() \
((REG16(ARMIO_GPIO_EVENT_MODE)>>PIN_SELECT_POS) & PIN_SELECT_MASK)
//-------------------------------------------------------------------
// NAME : ARMIO_GET_BIT_GPIO_IE
// DESCRIPTION : Get one of the interrupts edge
// PARAMETERS : Pin to get
// RETURN VALUE: Get one of the interrupts edge
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_GET_BIT_GPIO_IE(Bit) ARMIO_GET_BIT(REG16(ARMIO_GPIO_IE),Bit)
//-------------------------------------------------------------------
// NAME : ARMIO_SET_BIT_GPIO_IE
// DESCRIPTION : Defines the GPIOs interrupt edge
// PARAMETERS : Edge :ARMIO_FALLING_EDGE / ARMIO_RISING_EDGE. Bit : Pin number
// RETURN VALUE: None
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_SET_BIT_GPIO_IE(Edge,Bit) ARMIO_SET_BIT(REG16(ARMIO_GPIO_IE),Edge,Bit)
//-------------------------------------------------------------------
// NAME : ARMIO_GET_ALL_GPIO_IE
// DESCRIPTION : Get all interrupts edge
// PARAMETERS : None
// RETURN VALUE: Get all interrupts edge
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_GET_ALL_GPIO_IE() REG16(ARMIO_GPIO_IE)
//-------------------------------------------------------------------
// NAME : ARMIO_SET_ALL_GPIO_IE
// DESCRIPTION : Set all interrupts edge
// PARAMETERS : 16 bits Edge value
// RETURN VALUE: Set all interrupts edge
// LIMITATIONS : NOne
//-------------------------------------------------------------------
#define ARMIO_SET_ALL_GPIO_IE(Edge) REG16(ARMIO_GPIO_IE)=(Edge)
//-------------------------------------------------------------------
// NAME : ARMIO_GET_KBD_IT
// DESCRIPTION : Return the keyboard interrupt state(enable or disable)
// PARAMETERS : None
// RETURN VALUE: None
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_GET_KBD_IT() (REG16(ARMIO_KBD_IT) & 0x1)
//-------------------------------------------------------------------
// NAME : ARMIO_GET_ALL_GPIO_IT
// DESCRIPTION : Get all the 16 bits interrupt register
// PARAMETERS : None
// RETURN VALUE: Get all the 16 bits interrupt register
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_GET_ALL_GPIO_IT() REG16(ARMIO_GPIO_IT)
//-------------------------------------------------------------------
// NAME : ARMIO_GET_BIT_GPIO_IT
// DESCRIPTION : Get one of the GPIO IT bit
// PARAMETERS : Bit : Pin number
// RETURN VALUE: Get one of the GPIO IT bit
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_GET_BIT_GPIO_IT(Bit) ARMIO_GET_BIT(REG16(ARMIO_GPIO_IT),Bit)
//-------------------------------------------------------------------
// NAME : ARMIO_SET_KBD_MASK_IT
// DESCRIPTION : Set Keyboard mask IT
// PARAMETERS : Data :ARMIO_ENABLE_IT / ARMIO_DISABLE_IT
// RETURN VALUE: None
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_SET_KBD_MASK_IT(Data) REG16(ARMIO_KBD_MASK_IT)=(Data) & 0x1
//-------------------------------------------------------------------
// NAME : ARMIO_GET_KBD_MASK_IT
// DESCRIPTION : Get keyboard mask IT
// PARAMETERS : None
// RETURN VALUE: Get keyboard mask IT
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_GET_KBD_MASK_IT() (REG16(ARMIO_KBD_MASK_IT) & 0x1)
//-------------------------------------------------------------------
// NAME : ARMIO_GET_BIT_GPIO_MIT
// DESCRIPTION : Get one of the GPIO mask IT
// PARAMETERS : Data :ARMIO_ENABLE_IT / ARMIO_DISABLE_IT
// RETURN VALUE: Get one of the GPIO mask IT
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_GET_BIT_GPIO_MIT(Bit) ARMIO_GET_BIT(REG16(ARMIO_GPIO_MASK_IT),Bit)
//-------------------------------------------------------------------
// NAME : ARMIO_SET_BIT_GPIO_MIT
// DESCRIPTION : Set one of the GPIO mask IT
// PARAMETERS : IT :ARMIO_ENABLE_IT / ARMIO_DISABLE_IT, Bit : Pin nb
// RETURN VALUE: None
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_SET_BIT_GPIO_MIT(IT,Bit) ARMIO_SET_BIT(REG16(ARMIO_GPIO_MASK_IT),IT,Bit)
//-------------------------------------------------------------------
// NAME : ARMIO_GET_ALL_GPIO_MIT
// DESCRIPTION : Get all the GPIO ITs
// PARAMETERS : None
// RETURN VALUE: Get all the GPIO ITs
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_GET_ALL_GPIO_MIT() REG16(ARMIO_GPIO_MASK_IT)
//-------------------------------------------------------------------
// NAME : ARMIO_SET_ALL_GPIO_MIT
// DESCRIPTION : Set all the 16 GPIOs IT
// PARAMETERS : ARMIO_GPIO_ENABLE_ALL_IT / ARMIO_GPIO_DISABLE_ALL_IT
// or a 16 bits value
// RETURN VALUE: None
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_SET_ALL_GPIO_MIT(IT) REG16(ARMIO_GPIO_MASK_IT)=IT
//-------------------------------------------------------------------
// NAME : ARMIO_GET_GPIO_DEBOUNCING
// DESCRIPTION : Get GPIO time dbouncing (see below to calculate the time value)
// PARAMETERS : None
// RETURN VALUE: Get GPIO time dbouncing (see below to calculate the time value)
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_GET_GPIO_DEBOUNCING() (REG16(ARMIO_GET_GPIO_DEBOUNCING) & 0x1FF)
//-------------------------------------------------------------------
// NAME : ARMIO_SET_GPIO_DEBOUNCING
// DESCRIPTION : Set the GPIO debouancing time
// PARAMETERS : Deboun :9 bits value=time of 500*Deboun<time (us)<500*(Deboun+1)
// RETURN VALUE: None
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_SET_GPIO_DEBOUNCING(Deboun) REG16(ARMIO_GPIO_DEBOUNCING)=(Deboun)&0x1FF
//-------------------------------------------------------------------
// NAME : ARMIO_GET_GPIO_LATCH_ALL
// DESCRIPTION : Register to read after debouncing time
// PARAMETERS : None
// RETURN VALUE: Register to read after debouncing time
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_GET_GPIO_LATCH_ALL() REG16(ARMIO_GPIO_LATCH_REG)
//-------------------------------------------------------------------
// NAME : ARMIO_GET_GPIO_LATCH_BIT
// DESCRIPTION : Get one bit of the register to read after debouncing time
// PARAMETERS : Bit : Pin number
// RETURN VALUE: Get one bit of the register to read after debouncing time
// LIMITATIONS : None
//-------------------------------------------------------------------
#define ARMIO_GET_GPIO_LATCH_BIT(Bit) ARMIO_GET_BIT(REG16(ARMIO_GPIO_LATCH_REG),Bit)
/*----------- ARMIO ---------------*/
/* -----------Prototypes --------- */
void ARMIO_TestRegistersAccess(void);
void ARMIO_TestResetValue(void);
void ARMIO_InitIO(char, char);
void ARMIO_InitAll(UWORD16);
UWORD16 ARMIO_ReadCntl(void);
char ARMIO_ReadIO(char);
UWORD16 ARMIO_ReadAll(void);
void ARMIO_WriteIO(char, char);
void ARMIO_WriteAll(UWORD16);
UWORD16 ARMIO_ReadOut(void);
char ARMIO_ReadKbRows(void);
char ARMIO_ReadKbRows8X8(void);
void ARMIO_WriteKbCol(char);
void ARMIO_Enable(void);
char ARMIO_ReadClk(void);
char ARMIO_ReadKbCol(void);
char ARMIO_ReadKbCol8X8(void);
UWORD16 ARMIO_ReadTim(void);
void TESTRESET_ArmIO(void);
/******************************************************************************
######### Adding of 6 Jog dial functions 08/27/1999 correction ################
################### Laurent MARTIN ############################################
*******************************************************************************/
void ARMIO_InitGpioMode(char,char);
void ARMIO_InitGpioITEdge (UWORD16);
UWORD16 ARMIO_ReadGpioLatch(void);
/******************************************************************************
############## end of Jog dial functions 08/27/1999 correction ################
*******************************************************************************/
/******************************************************************************
######### Adding of 1 Jog dial functions 05/02/2000 correction ################
################### Serge IMBERT ############################################
*******************************************************************************/
void ARMIO_WriteGpioDebouncing(char);
/******************************************************************************
############## end of Jog dial functions 05/02/2000 correction ################
*******************************************************************************/
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -