radio add new device type
| | |
| | | Thumbs.db
|
| | | MDK-ARM/JLinkLog.txt
|
| | | *.TMP
|
| | | *.lst
|
| | | *.o
|
| | |
| | |
|
| | | BOARD_EXT_FP0 = 14,
|
| | |
|
| | | BOARD_V50_RADIO = 15, |
| | | BOARD_V50_RADIO_16 = 15, |
| | | BOARD_V50_RADIO_8 = 16, |
| | | |
| | | };
|
| | |
|
| | | #define BOARD_TYPE 15
|
| | | #define BOARD_TYPE 16 |
| | | #define BOARD_VER 1
|
| | | #define XLAT_FREQ 8
|
| | |
|
| | |
|
| | | #define GetBoardType() (BOARD_TYPE)
|
| | |
|
| | | #if ( BOARD_TYPE == 1)
|
| | | #define DINPUT 4
|
| | | #define DOUTPUT 4
|
| | | #elif (BOARD_TYPE == 2 || BOARD_TYPE == 4 || BOARD_TYPE == 6 || BOARD_TYPE == 8 || BOARD_TYPE == 10 || BOARD_TYPE == 11 || BOARD_TYPE == 16)
|
| | | #define DINPUT 8
|
| | | #define DOUTPUT 8
|
| | | #elif BOARD_TYPE == 3 || BOARD_TYPE == 5 || BOARD_TYPE == 7 || BOARD_TYPE == 9 || BOARD_TYPE == 13 || BOARD_TYPE == 15 |
| | | #define DINPUT 16
|
| | | #define DOUTPUT 16
|
| | | #elif BOARD_TYPE == 14 |
| | | #define DINPUT 0
|
| | | #define DOUTPUT 6
|
| | | #else |
| | | #define DINPUT 0
|
| | | #define DOUTPUT 0
|
| | | #endif
|
| | | extern volatile int PendSvCount;
|
| | |
|
| | | typedef struct tagUartStat
|
| | |
| | |
|
| | | typedef struct tagInfoBlock
|
| | | {
|
| | | USHORT nDeviceType;
|
| | | USHORT ProgVer;
|
| | | USHORT KLinkVer;
|
| | | USHORT nCapacity;
|
| | | // USHORT nBlockLenth;
|
| | | USHORT nDeviceTypeVer; //device type x.y
|
| | | // UCHAR nDevierVer;
|
| | | USHORT ProgVer; //prog version x.y
|
| | | USHORT KLinkVer; //x.y
|
| | | USHORT KBusVer; //x.y
|
| | | // USHORT KNetVer; //x.y
|
| | | // USHORT KWLVer; //x.y
|
| | | |
| | | UCHAR nCapacity1; // ? K
|
| | | UCHAR nCapacity2; // ? k
|
| | | |
| | | UCHAR nDInput;
|
| | | UCHAR nDOutput;
|
| | | UCHAR nAInput;
|
| | |
| | | UCHAR nHOutput;
|
| | | UCHAR nExt1;
|
| | | UCHAR nExt2;
|
| | | UCHAR nLogSize;
|
| | | UCHAR nPorts;
|
| | | UCHAR nManSize;
|
| | | UCHAR nAbility;
|
| | | UCHAR nSwitchBits;
|
| | | |
| | |
|
| | | }stKMInfoBlock;
|
| | |
|
| | |
| | | LL_GPIO_PIN_12|LL_GPIO_PIN_13|LL_GPIO_PIN_15;
|
| | |
|
| | | }
|
| | | else if (GetBoardType()==9 || GetBoardType()==10 || GetBoardType()==15 )
|
| | | else if (GetBoardType()==9 || GetBoardType()==10 || GetBoardType()==15 || BOARD_TYPE == 16 )
|
| | | {
|
| | | GPIO_InitStruct.Pin = LL_GPIO_PIN_3|LL_GPIO_PIN_5|LL_GPIO_PIN_6|LL_GPIO_PIN_7|
|
| | | LL_GPIO_PIN_11|LL_GPIO_PIN_1|LL_GPIO_PIN_2|LL_GPIO_PIN_10|
|
| | |
| | | GPIO_InitStruct.Pull = LL_GPIO_PULL_UP;
|
| | | LL_GPIO_Init(OE_PORT, &GPIO_InitStruct);
|
| | |
|
| | | #elif (BOARD_TYPE == 15)
|
| | | #elif (BOARD_TYPE == 15 || BOARD_TYPE == 16)
|
| | |
|
| | | // Radio Pins
|
| | | // busy pin
|
| | |
| | | //uint32_t * pUID = (uint32_t *)(UID_BASE);
|
| | | const stKMInfoBlock KMInfoBlock =
|
| | | {
|
| | | BOARD_TYPE, //nDeviceType
|
| | | (BOARD_TYPE<<8) + BOARD_VER, //nDeviceType BOARD_VER, //nDevieVer
|
| | | 0x0100, //ProgVer
|
| | | 0x0100, //KLinkVer
|
| | | 0x0100, //nCapacity
|
| | | 16, //nDInput;
|
| | | 16, //nDOutput
|
| | | 0x0100, //KBusVer
|
| | | // 0x0100, //KNetVer
|
| | | // 0x0100, //KWLVer
|
| | | |
| | | 4, //nCapacity1 ?K
|
| | | 1, //nCapacity2 ?k
|
| | | |
| | | DINPUT, //nDInput;
|
| | | DOUTPUT, //nDOutput
|
| | | |
| | | 0, //nAInput
|
| | | 0, //nAOutput
|
| | | 0, //nHInput
|
| | | 0, //nHOutput
|
| | | 0, //nExt1;
|
| | | 0, //nExt2;
|
| | | 0, //nLogSize;
|
| | | 0, //nPorts;
|
| | | 0, //nManSize;
|
| | | 0, //nAbility;
|
| | | 6, //nSwitchBits;
|
| | | };
|
| | | const char VersionStr[] __attribute__((at(FLASH_BASE + 0X1000))) //__attribute__((at(0X8001000)))
|
| | | = "3.00";
|
| | |
| | | return 0; //FP0
|
| | | case 15:
|
| | | return Input165_R(16);
|
| | | case 16:
|
| | | return Input165_R(8);
|
| | | |
| | | default:
|
| | | break;
|
| | | }
|
| | |
| | | case 14:
|
| | | return (~(LL_GPIO_ReadInputPort(GPIOA)>>4))&0x0f; //FP0
|
| | | case 15:
|
| | | case 16:
|
| | | return ReadConfig_5(); //Wireless Master Slave 8 in 8 o
|
| | | default:
|
| | |
|
| | |
| | | //Output595_16(Y);
|
| | | }
|
| | |
|
| | | #if (BOARD_TYPE == 9 || BOARD_TYPE == 10 || BOARD_TYPE == 15 )
|
| | | #if (BOARD_TYPE == 9 || BOARD_TYPE == 10 || BOARD_TYPE == 15 || BOARD_TYPE == 16)
|
| | | //#pragma message("9,10")
|
| | | // V4.2 管脚排列向右移动了一位。
|
| | | #define SRCLK1_0() LL_GPIO_ResetOutputPin(GPIOB,LL_GPIO_PIN_1)
|
| | |
| | | #include "../src/Ethernet/loopback.h"
|
| | | #elif (BOARD_TYPE == 14)
|
| | | #include "FP0.h"
|
| | | #elif (BOARD_TYPE == 15)
|
| | | #elif (BOARD_TYPE == 15 || BOARD_TYPE == 16)
|
| | | #include "KWireless.h"
|
| | | //#include "user.h"
|
| | | //#include "../src/radio/inc/sx126x-board.h"
|
| | |
| | | else{bKBusMaster=0;bKBusSlave=1;}
|
| | | nChilds=nAddr;
|
| | | FP0_Init();
|
| | | #elif (BOARD_TYPE == 15)
|
| | | #elif (BOARD_TYPE == 15 || BOARD_TYPE == 16)
|
| | | nAddr=KMem.EffJumperSW&0x0f;
|
| | | if (KMem.EffJumperSW == 0x1f) {bKBusRepeater=1;bKBusMaster=1;bKBusSlave=0;}
|
| | | else if ((KMem.EffJumperSW&0x10)!=0) {bKBusMaster=1;bKBusSlave=0;}
|
| | |
| | | #endif
|
| | |
|
| | | if (GetBoardType() == 7 || GetBoardType() ==8
|
| | | || GetBoardType() == 9 || GetBoardType() ==10 ||GetBoardType() ==13 ||GetBoardType() ==15 ) |
| | | || GetBoardType() == 9 || GetBoardType() ==10 ||GetBoardType() ==13 ||GetBoardType() ==15 || BOARD_TYPE == 16) |
| | | {
|
| | | displayInput(0xffff); //
|
| | | EnableDisIn(1); //Input Diaplay Enable 595
|
| | |
| | | StartPLC();
|
| | | }
|
| | | KMem.WX[7]=0x5a;
|
| | | #if (BOARD_TYPE == 15)
|
| | | #if (BOARD_TYPE == 15 || BOARD_TYPE == 16)
|
| | | KWireLessInit(KMem.EffJumperSW&0x20,KMem.EffJumperSW&0x1f);
|
| | | KWireLessStart();
|
| | | #endif
|
| | |
| | | #endif
|
| | |
|
| | | if (GetBoardType() == 7 || GetBoardType() ==8
|
| | | || GetBoardType() == 9 || GetBoardType() ==10 || GetBoardType() ==15) |
| | | || GetBoardType() == 9 || GetBoardType() ==10 || GetBoardType() ==15 || GetBoardType() ==16) |
| | | {
|
| | | displayInput(KMem.WX[0]);
|
| | | }
|
| | |
| | | }
|
| | | //*/
|
| | |
|
| | | #if (BOARD_TYPE == 15)
|
| | | #if (BOARD_TYPE == 15 || BOARD_TYPE == 16)
|
| | | Radio.IrqProcess( ); // Process Radio IRQ
|
| | | #endif
|
| | |
|
| | |
| | | if (bKBusSlave)
|
| | | {
|
| | | // BufferOut[0]=KMem.WX[0];
|
| | | #if (BOARD_TYPE == 15)
|
| | | #if (BOARD_TYPE == 15 || BOARD_TYPE == 16)
|
| | | // KBusSlaveFunc(2);
|
| | | // if (! KMem.RunStat) {BufferIn[0]=0;}
|
| | | // KMem.WY[0]=BufferIn[0];
|
| | |
| | | #endif
|
| | | //PutOutput (KMem.nRunCount>>8);
|
| | | //PutOutput(0x0f70);
|
| | | #if (BOARD_TYPE == 15) |
| | | #if (BOARD_TYPE == 15 || BOARD_TYPE == 16) |
| | | // KMem.WY[1]=KMem.nRunCount>>6;
|
| | | KMem.WY[1]=KMem.WX[0];
|
| | | KMem.WY[0]=KMem.WX[1];
|