75 SYS->IPRST1 &= ~SYS_IPRST1_PS2RST_Msk;
81 PS2->CTL &= ~PS2_CTL_TXFDEPTH_Msk;
85 PS2->CTL &= (~PS2_CTL_CLRFIFO_Msk);
98 PS2->CTL &= ~PS2_CTL_PS2EN_Msk;
122int32_t
PS2_Write(uint32_t *pu32Buf, uint32_t u32ByteCount)
124 uint32_t u32TxFIFO_Depth = 16;
125 uint32_t u32delayno, txcnt, remainder;
129 txcnt = u32ByteCount / u32TxFIFO_Depth;
131 remainder = u32ByteCount % u32TxFIFO_Depth;
132 if(remainder) txcnt++;
138 if (u32delayno >= u32TimeOutCount)
142 if(u32ByteCount >= u32TxFIFO_Depth)
151 if(u32delayno >= u32TimeOutCount)
155 if((txcnt == 1) && (remainder != 0))
158 PS2->TXDAT0 = pu32Buf[i];
159 PS2->TXDAT1 = pu32Buf[i+1];
160 PS2->TXDAT2 = pu32Buf[i+2];
161 PS2->TXDAT3 = pu32Buf[i+3];
172 if(u32delayno >= u32TimeOutCount)
NUC472/NUC442 peripheral access layer header file. This file contains all the peripheral register's d...
#define PS2_CTL_PS2EN_Msk
#define PS2_RXDAT_DAT_Msk
#define PS2_STATUS_TXEMPTY_Msk
#define PS2_CTL_CLRFIFO_Msk
#define SYS_IPRST1_PS2RST_Msk
int32_t PS2_Write(uint32_t *pu32Buf, uint32_t u32ByteCount)
This function use to transmit PS2 data.
void PS2_Close(void)
This function use to disable PS2 function.
#define PS2_SET_TX_BYTE_CNT(u32Count)
This function use to set TX FIFO length.
void PS2_DisableInt(uint32_t u32Mask)
The function is used to disable PS2 specified interrupt.
void PS2_EnableInt(uint32_t u32Mask)
The function is used to enable PS2 specified interrupt.
void PS2_Open(void)
This function use to enable PS2 function and set one byte per trnasfer.
uint8_t PS2_Read(void)
This function use to read PS2 Rx data.
#define TRUE
Boolean true, define to use in API parameters or return value.
#define FALSE
Boolean false, define to use in API parameters or return value.
NUC472/NUC442 PS2 Driver Header File.