C51 COMPILER V9.59.0.0 STC8A_BMM 06/10/2021 16:46:57 PAGE 1 C51 COMPILER V9.59.0.0, COMPILATION OF MODULE STC8A_BMM OBJECT MODULE PLACED IN .\list\STC8A_BMM.obj COMPILER INVOKED BY: C:\Keil_v5\C51\BIN\C51.EXE STC8A_BMM.c LARGE OMF2 OPTIMIZE(8,SPEED) BROWSE DEBUG PRINT(.\list\STC8A -_BMM.lst) TABS(2) OBJECT(.\list\STC8A_BMM.obj) line level source 1 /*---------------------------------------------------------------------*/ 2 /* --- STC MCU Limited ------------------------------------------------*/ 3 /* --- STC 1T Series MCU Demo Programme -------------------------------*/ 4 /* --- Mobile: (86)13922805190 ----------------------------------------*/ 5 /* --- Fax: 86-0513-55012956,55012947,55012969 ------------------------*/ 6 /* --- Tel: 86-0513-55012928,55012929,55012966 ------------------------*/ 7 /* --- Web: www.STCMCU.com --------------------------------------------*/ 8 /* --- Web: www.STCMCUDATA.com ---------------------------------------*/ 9 /* --- QQ: 800003751 -------------------------------------------------*/ 10 /* Èç¹ûÒªÔÚ³ÌÐòÖÐʹÓô˴úÂë,ÇëÔÚ³ÌÐòÖÐ×¢Ã÷ʹÓÃÁËSTCµÄ×ÊÁϼ°³ÌÐò */ 11 /*---------------------------------------------------------------------*/ 12 13 #include "STC8A_BMM.h" 14 #include "STC8A_UART.h" 15 16 //======================================================================== 17 // º¯Êý: void BMM_ADC_Inilize(BMM_ADC_InitTypeDef *BMM) 18 // ÃèÊö: BMM ADC ³õʼ»¯³ÌÐò. 19 // ²ÎÊý: BMM: ½á¹¹²ÎÊý,Çë²Î¿¼BMM.hÀïµÄ¶¨Òå. 20 // ·µ»Ø: none. 21 // °æ±¾: V1.0, 2021-05-17 22 //======================================================================== 23 void BMM_ADC_Inilize(BMM_ADC_InitTypeDef *BMM) 24 { 25 1 EAXSFR(); /* MOVX A,@DPTR/MOVX @DPTR,AÖ¸ÁîµÄ²Ù×÷¶ÔÏóΪÀ©Õ¹SFR(XSFR) */ 26 1 BMM_ADC_STA = 0x00; 27 1 BMM_ADC_CHSW = BMM->BMM_Channel; 28 1 BMM_ADC_RXA = BMM->BMM_Buffer; 29 1 BMM_ADC_CFG2 = BMM->BMM_Times; 30 1 31 1 if(BMM->BMM_Enable == ENABLE) BMM_ADC_CR |= 0x80; //ʹÄÜADC BMM 32 1 else BMM_ADC_CR &= ~0x80; //½ûÖ¹ADC BMM 33 1 EAXRAM(); /* MOVX A,@DPTR/MOVX @DPTR,AÖ¸ÁîµÄ²Ù×÷¶ÔÏóΪÀ©Õ¹RAM(XRAM) */ 34 1 } 35 36 //======================================================================== 37 // º¯Êý: void BMM_M2M_Inilize(BMM_M2M_InitTypeDef *BMM) 38 // ÃèÊö: BMM M2M ³õʼ»¯³ÌÐò. 39 // ²ÎÊý: BMM: ½á¹¹²ÎÊý,Çë²Î¿¼BMM.hÀïµÄ¶¨Òå. 40 // ·µ»Ø: none. 41 // °æ±¾: V1.0, 2021-05-17 42 //======================================================================== 43 void BMM_M2M_Inilize(BMM_M2M_InitTypeDef *BMM) 44 { 45 1 EAXSFR(); /* MOVX A,@DPTR/MOVX @DPTR,AÖ¸ÁîµÄ²Ù×÷¶ÔÏóΪÀ©Õ¹SFR(XSFR) */ 46 1 BMM_M2M_STA = 0x00; 47 1 BMM_M2M_RXA = BMM->BMM_Rx_Buffer; 48 1 BMM_M2M_TXA = BMM->BMM_Tx_Buffer; 49 1 BMM_M2M_AMT = BMM->BMM_Length; 50 1 51 1 if(BMM->BMM_SRC_Dir == M2M_ADDR_DEC) BMM_M2M_CFG |= 0x20; //Êý¾Ý¶ÁÍêºóµØÖ·×Ô¼õ 52 1 else BMM_M2M_CFG &= ~0x20; //Êý¾Ý¶ÁÍêºóµØÖ·×Ô¼õ 53 1 if(BMM->BMM_DEST_Dir == M2M_ADDR_DEC) BMM_M2M_CFG |= 0x10; //Êý¾ÝдÈëºóµØÖ·×Ô¼õ 54 1 else BMM_M2M_CFG &= ~0x10; //Êý¾ÝдÈëºóµØÖ·×Ô¼õ C51 COMPILER V9.59.0.0 STC8A_BMM 06/10/2021 16:46:57 PAGE 2 55 1 56 1 if(BMM->BMM_Enable == ENABLE) BMM_M2M_CR |= 0x80; //ʹÄÜM2M BMM 57 1 else BMM_M2M_CR &= ~0x80; //½ûÖ¹M2M BMM 58 1 EAXRAM(); /* MOVX A,@DPTR/MOVX @DPTR,AÖ¸ÁîµÄ²Ù×÷¶ÔÏóΪÀ©Õ¹RAM(XRAM) */ 59 1 } 60 61 //======================================================================== 62 // º¯Êý: void BMM_SPI_Inilize(BMM_SPI_InitTypeDef *BMM) 63 // ÃèÊö: BMM SPI ³õʼ»¯³ÌÐò. 64 // ²ÎÊý: BMM: ½á¹¹²ÎÊý,Çë²Î¿¼BMM.hÀïµÄ¶¨Òå. 65 // ·µ»Ø: none. 66 // °æ±¾: V1.0, 2021-05-17 67 //======================================================================== 68 void BMM_SPI_Inilize(BMM_SPI_InitTypeDef *BMM) 69 { 70 1 EAXSFR(); /* MOVX A,@DPTR/MOVX @DPTR,AÖ¸ÁîµÄ²Ù×÷¶ÔÏóΪÀ©Õ¹SFR(XSFR) */ 71 1 BMM_SPI_STA = 0x00; 72 1 BMM_SPI_RXA = BMM->BMM_Rx_Buffer; 73 1 BMM_SPI_TXA = BMM->BMM_Tx_Buffer; 74 1 BMM_SPI_AMT = BMM->BMM_Length; 75 1 76 1 if(BMM->BMM_SS_Sel <= SPI_SS_P35) BMM_SPI_CFG2 = (BMM_SPI_CFG2 & 0xfc) | BMM->BMM_SS_Sel; //×Ô¶¯¿ØÖÆSS½ÅÑ -¡Ôñ 77 1 78 1 if(BMM->BMM_Tx_Enable == ENABLE) BMM_SPI_CFG |= 0x40; //ʹÄÜSPI·¢ËÍÊý¾Ý 79 1 else BMM_SPI_CFG &= ~0x40; //½ûÖ¹SPI·¢ËÍÊý¾Ý 80 1 81 1 if(BMM->BMM_Rx_Enable == ENABLE) BMM_SPI_CFG |= 0x20; //ʹÄÜSPI½ÓÊÕÊý¾Ý 82 1 else BMM_SPI_CFG &= ~0x20; //½ûÖ¹SPI½ÓÊÕÊý¾Ý 83 1 84 1 if(BMM->BMM_AUTO_SS == ENABLE) BMM_SPI_CFG2 |= 0x04; //ʹÄÜSS×Ô¶¯¿ØÖÆ 85 1 else BMM_SPI_CFG2 &= ~0x04; //½ûÖ¹SS×Ô¶¯¿ØÖÆ 86 1 87 1 if(BMM->BMM_Enable == ENABLE) BMM_SPI_CR |= 0x80; //ʹÄÜSPI BMM 88 1 else BMM_SPI_CR &= ~0x80; //½ûÖ¹SPI BMM 89 1 EAXRAM(); /* MOVX A,@DPTR/MOVX @DPTR,AÖ¸ÁîµÄ²Ù×÷¶ÔÏóΪÀ©Õ¹RAM(XRAM) */ 90 1 } 91 92 //======================================================================== 93 // º¯Êý: void BMM_UART_Inilize(u8 UARTx, BMM_UART_InitTypeDef *BMM) 94 // ÃèÊö: BMM UART ³õʼ»¯³ÌÐò. 95 // ²ÎÊý: UARTx: UART×éºÅ, BMM: ½á¹¹²ÎÊý,Çë²Î¿¼BMM.hÀïµÄ¶¨Òå. 96 // ·µ»Ø: none. 97 // °æ±¾: V1.0, 2021-05-17 98 //======================================================================== 99 void BMM_UART_Inilize(u8 UARTx, BMM_UART_InitTypeDef *BMM) 100 { 101 1 EAXSFR(); /* MOVX A,@DPTR/MOVX @DPTR,AÖ¸ÁîµÄ²Ù×÷¶ÔÏóΪÀ©Õ¹SFR(XSFR) */ 102 1 #ifdef UART1 103 1 if(UARTx == UART1) 104 1 { 105 2 BMM_UR1T_STA = 0x00; 106 2 BMM_UR1R_STA = 0x00; 107 2 BMM_UR1T_AMT = BMM->BMM_TX_Length; 108 2 BMM_UR1T_TXA = BMM->BMM_TX_Buffer; 109 2 BMM_UR1R_AMT = BMM->BMM_RX_Length; 110 2 BMM_UR1R_RXA = BMM->BMM_RX_Buffer; 111 2 112 2 if(BMM->BMM_TX_Enable == ENABLE) BMM_UR1T_CR |= 0x80; //ʹÄÜADC BMM 113 2 else BMM_UR1T_CR &= ~0x80; //½ûÖ¹ADC BMM 114 2 if(BMM->BMM_RX_Enable == ENABLE) BMM_UR1R_CR |= 0x80; //ʹÄÜADC BMM 115 2 else BMM_UR1R_CR &= ~0x80; //½ûÖ¹ADC BMM C51 COMPILER V9.59.0.0 STC8A_BMM 06/10/2021 16:46:57 PAGE 3 116 2 } 117 1 #endif 118 1 #ifdef UART2 if(UARTx == UART2) { BMM_UR2T_STA = 0x00; BMM_UR2R_STA = 0x00; BMM_UR2T_AMT = BMM->BMM_TX_Length; BMM_UR2T_TXA = BMM->BMM_TX_Buffer; BMM_UR2R_AMT = BMM->BMM_RX_Length; BMM_UR2R_RXA = BMM->BMM_RX_Buffer; if(BMM->BMM_TX_Enable == ENABLE) BMM_UR2T_CR |= 0x80; //ʹÄÜADC BMM else BMM_UR2T_CR &= ~0x80; //½ûÖ¹ADC BMM if(BMM->BMM_RX_Enable == ENABLE) BMM_UR2R_CR |= 0x80; //ʹÄÜADC BMM else BMM_UR2R_CR &= ~0x80; //½ûÖ¹ADC BMM } #endif 134 1 #ifdef UART3 if(UARTx == UART3) { BMM_UR3T_STA = 0x00; BMM_UR3R_STA = 0x00; BMM_UR3T_AMT = BMM->BMM_TX_Length; BMM_UR3T_TXA = BMM->BMM_TX_Buffer; BMM_UR3R_AMT = BMM->BMM_RX_Length; BMM_UR3R_RXA = BMM->BMM_RX_Buffer; if(BMM->BMM_TX_Enable == ENABLE) BMM_UR3T_CR |= 0x80; //ʹÄÜADC BMM else BMM_UR3T_CR &= ~0x80; //½ûÖ¹ADC BMM if(BMM->BMM_RX_Enable == ENABLE) BMM_UR3R_CR |= 0x80; //ʹÄÜADC BMM else BMM_UR3R_CR &= ~0x80; //½ûÖ¹ADC BMM } #endif 150 1 #ifdef UART4 if(UARTx == UART4) { BMM_UR4T_STA = 0x00; BMM_UR4R_STA = 0x00; BMM_UR4T_AMT = BMM->BMM_TX_Length; BMM_UR4T_TXA = BMM->BMM_TX_Buffer; BMM_UR4R_AMT = BMM->BMM_RX_Length; BMM_UR4R_RXA = BMM->BMM_RX_Buffer; if(BMM->BMM_TX_Enable == ENABLE) BMM_UR4T_CR |= 0x80; //ʹÄÜADC BMM else BMM_UR4T_CR &= ~0x80; //½ûÖ¹ADC BMM if(BMM->BMM_RX_Enable == ENABLE) BMM_UR4R_CR |= 0x80; //ʹÄÜADC BMM else BMM_UR4R_CR &= ~0x80; //½ûÖ¹ADC BMM } #endif 166 1 EAXRAM(); /* MOVX A,@DPTR/MOVX @DPTR,AÖ¸ÁîµÄ²Ù×÷¶ÔÏóΪÀ©Õ¹RAM(XRAM) */ 167 1 } 168 169 //======================================================================== 170 // º¯Êý: void BMM_LCM_Inilize(BMM_LCM_InitTypeDef *BMM) 171 // ÃèÊö: BMM LCM ³õʼ»¯³ÌÐò. 172 // ²ÎÊý: BMM: ½á¹¹²ÎÊý,Çë²Î¿¼BMM.hÀïµÄ¶¨Òå. 173 // ·µ»Ø: none. 174 // °æ±¾: V1.0, 2021-05-17 175 //======================================================================== 176 void BMM_LCM_Inilize(BMM_LCM_InitTypeDef *BMM) 177 { C51 COMPILER V9.59.0.0 STC8A_BMM 06/10/2021 16:46:57 PAGE 4 178 1 EAXSFR(); /* MOVX A,@DPTR/MOVX @DPTR,AÖ¸ÁîµÄ²Ù×÷¶ÔÏóΪÀ©Õ¹SFR(XSFR) */ 179 1 BMM_LCM_STA = 0x00; 180 1 BMM_LCM_RXA = BMM->BMM_Rx_Buffer; 181 1 BMM_LCM_TXA = BMM->BMM_Tx_Buffer; 182 1 BMM_LCM_AMT = BMM->BMM_Length; 183 1 184 1 if(BMM->BMM_Enable == ENABLE) BMM_LCM_CR |= 0x80; //ʹÄÜLCM BMM 185 1 else BMM_LCM_CR &= ~0x80; //½ûÖ¹LCM BMM 186 1 EAXRAM(); /* MOVX A,@DPTR/MOVX @DPTR,AÖ¸ÁîµÄ²Ù×÷¶ÔÏóΪÀ©Õ¹RAM(XRAM) */ 187 1 } MODULE INFORMATION: STATIC OVERLAYABLE CODE SIZE = 550 ---- CONSTANT SIZE = ---- ---- XDATA SIZE = ---- ---- PDATA SIZE = ---- ---- DATA SIZE = ---- ---- IDATA SIZE = ---- ---- BIT SIZE = ---- ---- EDATA SIZE = ---- ---- HDATA SIZE = ---- ---- XDATA CONST SIZE = ---- ---- FAR CONST SIZE = ---- ---- END OF MODULE INFORMATION. C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)