Commit f6475d94 authored by 赵康弘's avatar 赵康弘

docs: TPS2HB35AQPWPRQ1文件上传

parent 068e7a92
#include "SGM4591Q.h" #include "SGM4591Q.h"
#include "Simulated_IIC_2_Master.h" #include "Simulated_IIC_2_Master.h"
/*PIN端口控制命令*/
uint8_t SGM4591Q_Chip1_1_PIN0=0;
uint8_t SGM4591Q_Chip1_1_PIN1=0;
uint8_t SGM4591Q_Chip1_2_PIN0=0;
uint8_t SGM4591Q_Chip1_2_PIN1=0;
uint8_t SGM4591Q_Chip1_3_PIN0=0;
uint8_t SGM4591Q_Chip1_3_PIN1=0;
uint8_t SGM4591Q_Chip1_4_PIN0=0;
uint8_t SGM4591Q_Chip1_4_PIN1=0;
uint8_t SGM4591Q_Chip2_1_PIN0=0;
uint8_t SGM4591Q_Chip2_1_PIN1=0;
uint8_t SGM4591Q_Chip2_2_PIN0=0;
uint8_t SGM4591Q_Chip2_2_PIN1=0;
uint8_t SGM4591Q_Chip2_3_PIN0=0;
uint8_t SGM4591Q_Chip2_3_PIN1=0;
uint8_t SGM4591Q_Chip2_4_PIN0=0;
uint8_t SGM4591Q_Chip2_4_PIN1=0;
uint8_t SGM4591Q_Chip3_1_PIN0=0;
uint8_t SGM4591Q_Chip3_1_PIN1=0;
uint8_t SGM4591Q_Chip3_2_PIN0=0;
uint8_t SGM4591Q_Chip3_2_PIN1=0;
uint8_t SGM4591Q_Chip3_3_PIN0=0;
uint8_t SGM4591Q_Chip3_3_PIN1=0;
uint8_t SGM4591Q_Chip3_4_PIN0=0;
uint8_t SGM4591Q_Chip3_4_PIN1=0;
uint8_t SGM4591Q_Chip4_1_PIN0=0;
uint8_t SGM4591Q_Chip4_1_PIN1=0;
uint8_t SGM4591Q_Chip4_2_PIN0=0;
uint8_t SGM4591Q_Chip4_2_PIN1=0;
uint8_t SGM4591Q_Chip4_3_PIN0=0;
uint8_t SGM4591Q_Chip4_3_PIN1=0;
uint8_t SGM4591Q_Chip4_4_PIN0=0;
uint8_t SGM4591Q_Chip4_4_PIN1=0;
/*发送*/ /*发送*/
void SGM4591Q_IIC_Send(uint8_t Address, uint8_t Register, uint8_t Function) void SGM4591Q_IIC_Send(uint8_t Address, uint8_t Register, uint8_t Function)
{ {
...@@ -112,3 +151,74 @@ void SGM4591Q_Control(void) ...@@ -112,3 +151,74 @@ void SGM4591Q_Control(void)
SGM4591Q_U9_Out_Keep_P1 = SGM4591Q_U9_Out_P1; SGM4591Q_U9_Out_Keep_P1 = SGM4591Q_U9_Out_P1;
} }
} }
/*多次对引脚的控制,后面的操作不能影响之前的控制*/
/*
Chip:片选
Segment:段P0/P1
PIN:端口0--7
*/
void SGM4591Q_Global_Control(uint8_t Chip, uint8_t Segment, uint8_t PIN)
{
switch (Chip)
{
case SGM4591Q_Chip1_1:
if (Segment==SGM4591Q_Segment0)
{
SGM4591Q_IIC_Send(0xE8, 0x02, SGM4591Q_U9_Out_P0);
}
else
{
SGM4591Q_IIC_Send(0xE8, 0x02, SGM4591Q_U9_Out_P0);
}
break;
case SGM4591Q_Chip1_2:
break;
case SGM4591Q_Chip1_3:
break;
case SGM4591Q_Chip1_4:
break;
case SGM4591Q_Chip2_1:
break;
case SGM4591Q_Chip2_2:
break;
case SGM4591Q_Chip2_3:
break;
case SGM4591Q_Chip2_4:
break;
case SGM4591Q_Chip3_1:
break;
case SGM4591Q_Chip3_2:
break;
case SGM4591Q_Chip3_3:
break;
case SGM4591Q_Chip3_4:
break;
case SGM4591Q_Chip4_1:
break;
case SGM4591Q_Chip4_2:
break;
case SGM4591Q_Chip4_3:
break;
case SGM4591Q_Chip4_4:
break;
default:
break;
}
}
#include "TYW_stdint.h" #include "TYW_stdint.h"
/*SGM4591Q片选*/
typedef enum
{
SGM4591Q_Chip1_1 = 0,
SGM4591Q_Chip1_2,
SGM4591Q_Chip1_3,
SGM4591Q_Chip1_4,
SGM4591Q_Chip2_1,
SGM4591Q_Chip2_2,
SGM4591Q_Chip2_3,
SGM4591Q_Chip2_4,
SGM4591Q_Chip3_1,
SGM4591Q_Chip3_2,
SGM4591Q_Chip3_3,
SGM4591Q_Chip3_4,
SGM4591Q_Chip4_1,
SGM4591Q_Chip4_2,
SGM4591Q_Chip4_3,
SGM4591Q_Chip4_4,
} SGM4591Q_Chip;
/*SGM4591Q段选*/
typedef enum
{
SGM4591Q_Segment0 = 0,
SGM4591Q_Segment1,
} SGM4591Q_Segment;
/*SGM4591Q端口*/
#define SGM4591Q_PIN0 0x01u
#define SGM4591Q_PIN1 0x02u
#define SGM4591Q_PIN2 0x04u
#define SGM4591Q_PIN3 0x08u
#define SGM4591Q_PIN4 0x10u
#define SGM4591Q_PIN5 0x20u
#define SGM4591Q_PIN6 0x40u
#define SGM4591Q_PIN7 0x80u
extern uint16_t ADC_4; extern uint16_t ADC_4;
void SGM4591Q_IIC_Send(uint8_t Address,uint8_t Register,uint8_t Function); void SGM4591Q_IIC_Send(uint8_t Address,uint8_t Register,uint8_t Function);
......
#include "TPS2HB35AQPWPRQ1.h"
#include "SGM4591Q.h"
/*3A外发12片*2路*/
/*3A_OUT1*/
void TPS2HB35_SetOutput3A_OUT1(uint8_t state)
{
static Output3A_OUT1 = 0;
if (Output3A_OUT1 != state)
{
if (state==1)
{
SGM4591Q_IIC_Send(0xE8, 0x02, SGM4591Q_U9_Out_P0);
}
else
{
SGM4591Q_IIC_Send(0xE8, 0x02, SGM4591Q_U9_Out_P0);
}
Output3A_OUT1 = state;
}
}
/*3A_OUT2*/
void TPS2HB35_SetOutput3A_OUT2(uint8_t state)
{
static Output3A_OUT2 = 0;
if (Output3A_OUT2 != state)
{
Output3A_OUT2 = state;
}
}
/*3A_OUT3*/
void TPS2HB35_SetOutput3A_OUT3(uint8_t state)
{
static Output3A_OUT3 = 0;
if (Output3A_OUT3 != state)
{
Output3A_OUT3 = state;
}
}
/*3A_OUT4*/
void TPS2HB35_SetOutput3A_OUT4(uint8_t state)
{
static Output3A_OUT4 = 0;
if (Output3A_OUT4 != state)
{
Output3A_OUT4 = state;
}
}
/*3A_OUT5*/
void TPS2HB35_SetOutput3A_OUT5(uint8_t state)
{
static Output3A_OUT5 = 0;
if (Output3A_OUT5 != state)
{
Output3A_OUT5 = state;
}
}
/*3A_OUT6*/
void TPS2HB35_SetOutput3A_OUT6(uint8_t state)
{
static Output3A_OUT6 = 0;
if (Output3A_OUT6 != state)
{
Output3A_OUT6 = state;
}
}
/*3A_OUT7*/
void TPS2HB35_SetOutput3A_OUT7(uint8_t state)
{
static Output3A_OUT7 = 0;
if (Output3A_OUT7 != state)
{
Output3A_OUT7 = state;
}
}
/*3A_OUT8*/
void TPS2HB35_SetOutput3A_OUT8(uint8_t state)
{
static Output3A_OUT8 = 0;
if (Output3A_OUT8 != state)
{
Output3A_OUT8 = state;
}
}
/*3A_OUT9*/
void TPS2HB35_SetOutput3A_OUT9(uint8_t state)
{
static Output3A_OUT9 = 0;
if (Output3A_OUT9 != state)
{
Output3A_OUT9 = state;
}
}
/*3A_OUT10*/
void TPS2HB35_SetOutput3A_OUT10(uint8_t state)
{
static Output3A_OUT10 = 0;
if (Output3A_OUT10 != state)
{
Output3A_OUT10 = state;
}
}
/*3A_OUT11*/
void TPS2HB35_SetOutput3A_OUT11(uint8_t state)
{
static Output3A_OUT11 = 0;
if (Output3A_OUT11 != state)
{
Output3A_OUT11 = state;
}
}
/*3A_OUT12*/
void TPS2HB35_SetOutput3A_OUT12(uint8_t state)
{
static Output3A_OUT12 = 0;
if (Output3A_OUT12 != state)
{
Output3A_OUT12 = state;
}
}
/*3A_OUT13*/
void TPS2HB35_SetOutput3A_OUT13(uint8_t state)
{
static Output3A_OUT13 = 0;
if (Output3A_OUT13 != state)
{
Output3A_OUT13 = state;
}
}
/*3A_OUT14*/
void TPS2HB35_SetOutput3A_OUT14(uint8_t state)
{
static Output3A_OUT14 = 0;
if (Output3A_OUT14 != state)
{
Output3A_OUT14 = state;
}
}
/*3A_OUT15*/
void TPS2HB35_SetOutput3A_OUT15(uint8_t state)
{
static Output3A_OUT15 = 0;
if (Output3A_OUT15 != state)
{
Output3A_OUT15 = state;
}
}
/*3A_OUT16*/
void TPS2HB35_SetOutput3A_OUT16(uint8_t state)
{
static Output3A_OUT16 = 0;
if (Output3A_OUT16 != state)
{
Output3A_OUT16 = state;
}
}
/*3A_OUT17*/
void TPS2HB35_SetOutput3A_OUT17(uint8_t state)
{
static Output3A_OUT17 = 0;
if (Output3A_OUT17 != state)
{
Output3A_OUT17 = state;
}
}
/*3A_OUT18*/
void TPS2HB35_SetOutput3A_OUT18(uint8_t state)
{
static Output3A_OUT18 = 0;
if (Output3A_OUT18 != state)
{
Output3A_OUT18 = state;
}
}
/*3A_OUT19*/
void TPS2HB35_SetOutput3A_OUT19(uint8_t state)
{
static Output3A_OUT19 = 0;
if (Output3A_OUT19 != state)
{
Output3A_OUT19 = state;
}
}
/*3A_OUT20*/
void TPS2HB35_SetOutput3A_OUT20(uint8_t state)
{
static Output3A_OUT20 = 0;
if (Output3A_OUT20 != state)
{
Output3A_OUT20 = state;
}
}
/*3A_OUT21*/
void TPS2HB35_SetOutput3A_OUT21(uint8_t state)
{
static Output3A_OUT21 = 0;
if (Output3A_OUT21 != state)
{
Output3A_OUT21 = state;
}
}
/*3A_OUT22*/
void TPS2HB35_SetOutput3A_OUT22(uint8_t state)
{
static Output3A_OUT22 = 0;
if (Output3A_OUT22 != state)
{
Output3A_OUT22 = state;
}
}
/*3A_OUT23*/
void TPS2HB35_SetOutput3A_OUT23(uint8_t state)
{
static Output3A_OUT23 = 0;
if (Output3A_OUT23 != state)
{
Output3A_OUT23 = state;
}
}
/*3A_OUT24*/
void TPS2HB35_SetOutput3A_OUT24(uint8_t state)
{
static Output3A_OUT24 = 0;
if (Output3A_OUT24 != state)
{
Output3A_OUT24 = state;
}
}
/*5A外发10片*2路*/
/*5A_OUT1*/
void TPS2HB35_SetOutput5A_OUT1(uint8_t state)
{
static Output5A_OUT1 = 0;
if (Output5A_OUT1 != state)
{
Output5A_OUT1 = state;
}
}
/*5A_OUT2*/
void TPS2HB35_SetOutput5A_OUT2(uint8_t state)
{
static Output5A_OUT2 = 0;
if (Output5A_OUT2 != state)
{
Output5A_OUT2 = state;
}
}
/*5A_OUT3*/
void TPS2HB35_SetOutput5A_OUT3(uint8_t state)
{
static Output5A_OUT3 = 0;
if (Output5A_OUT3 != state)
{
Output5A_OUT3 = state;
}
}
/*5A_OUT4*/
void TPS2HB35_SetOutput5A_OUT4(uint8_t state)
{
static Output5A_OUT4 = 0;
if (Output5A_OUT4 != state)
{
Output5A_OUT4 = state;
}
}
/*5A_OUT5*/
void TPS2HB35_SetOutput5A_OUT5(uint8_t state)
{
static Output5A_OUT5 = 0;
if (Output5A_OUT5 != state)
{
Output5A_OUT5 = state;
}
}
/*5A_OUT6*/
void TPS2HB35_SetOutput5A_OUT6(uint8_t state)
{
static Output5A_OUT6 = 0;
if (Output5A_OUT6 != state)
{
Output5A_OUT6 = state;
}
}
/*5A_OUT7*/
void TPS2HB35_SetOutput5A_OUT7(uint8_t state)
{
static Output5A_OUT7 = 0;
if (Output5A_OUT7 != state)
{
Output5A_OUT7 = state;
}
}
/*5A_OUT8*/
void TPS2HB35_SetOutput5A_OUT8(uint8_t state)
{
static Output5A_OUT8 = 0;
if (Output5A_OUT8 != state)
{
Output5A_OUT8 = state;
}
}
/*5A_OUT9*/
void TPS2HB35_SetOutput5A_OUT9(uint8_t state)
{
static Output5A_OUT9 = 0;
if (Output5A_OUT9 != state)
{
Output5A_OUT9 = state;
}
}
/*5A_OUT10*/
void TPS2HB35_SetOutput5A_OUT10(uint8_t state)
{
static Output5A_OUT10 = 0;
if (Output5A_OUT10 != state)
{
Output5A_OUT10 = state;
}
}
/*5A_OUT11*/
void TPS2HB35_SetOutput5A_OUT11(uint8_t state)
{
static Output5A_OUT11 = 0;
if (Output5A_OUT11 != state)
{
Output5A_OUT11 = state;
}
}
/*5A_OUT12*/
void TPS2HB35_SetOutput5A_OUT12(uint8_t state)
{
static Output5A_OUT12 = 0;
if (Output5A_OUT12 != state)
{
Output5A_OUT12 = state;
}
}
/*5A_OUT13*/
void TPS2HB35_SetOutput5A_OUT13(uint8_t state)
{
static Output5A_OUT13 = 0;
if (Output5A_OUT13 != state)
{
Output5A_OUT13 = state;
}
}
/*5A_OUT14*/
void TPS2HB35_SetOutput5A_OUT14(uint8_t state)
{
static Output5A_OUT14 = 0;
if (Output5A_OUT14 != state)
{
Output5A_OUT14 = state;
}
}
/*5A_OUT15*/
void TPS2HB35_SetOutput5A_OUT15(uint8_t state)
{
static Output5A_OUT15 = 0;
if (Output5A_OUT15 != state)
{
Output5A_OUT15 = state;
}
}
/*5A_OUT16*/
void TPS2HB35_SetOutput5A_OUT16(uint8_t state)
{
static Output5A_OUT16 = 0;
if (Output5A_OUT16 != state)
{
Output5A_OUT16 = state;
}
}
/*5A_OUT17*/
void TPS2HB35_SetOutput5A_OUT17(uint8_t state)
{
static Output5A_OUT17 = 0;
if (Output5A_OUT17 != state)
{
Output5A_OUT17 = state;
}
}
/*5A_OUT18*/
void TPS2HB35_SetOutput5A_OUT18(uint8_t state)
{
static Output5A_OUT18 = 0;
if (Output5A_OUT18 != state)
{
Output5A_OUT18 = state;
}
}
/*5A_OUT19*/
void TPS2HB35_SetOutput5A_OUT19(uint8_t state)
{
static Output5A_OUT19 = 0;
if (Output5A_OUT19 != state)
{
Output5A_OUT19 = state;
}
}
/*5A_OUT20*/
void TPS2HB35_SetOutput5A_OUT20(uint8_t state)
{
static Output5A_OUT20 = 0;
if (Output5A_OUT20 != state)
{
Output5A_OUT20 = state;
}
}
/*10A外发4片*2路*/
/*10A_OUT1*/
void TPS2HB35_SetOutput10A_OUT1(uint8_t state)
{
static Output10A_OUT1 = 0;
if (Output10A_OUT1 != state)
{
Output10A_OUT1 = state;
}
}
/*10A_OUT2*/
void TPS2HB35_SetOutput10A_OUT2(uint8_t state)
{
static Output10A_OUT2 = 0;
if (Output10A_OUT2 != state)
{
Output10A_OUT2 = state;
}
}
/*10A_OUT3*/
void TPS2HB35_SetOutput10A_OUT3(uint8_t state)
{
static Output10A_OUT3 = 0;
if (Output10A_OUT3 != state)
{
Output10A_OUT3 = state;
}
}
/*10A_OUT4*/
void TPS2HB35_SetOutput10A_OUT4(uint8_t state)
{
static Output10A_OUT4 = 0;
if (Output10A_OUT4 != state)
{
Output10A_OUT4 = state;
}
}
/*10A_OUT5*/
void TPS2HB35_SetOutput10A_OUT5(uint8_t state)
{
static Output10A_OUT5 = 0;
if (Output10A_OUT5 != state)
{
Output10A_OUT5 = state;
}
}
/*10A_OUT6*/
void TPS2HB35_SetOutput10A_OUT6(uint8_t state)
{
static Output10A_OUT6 = 0;
if (Output10A_OUT6 != state)
{
Output10A_OUT6 = state;
}
}
/*10A_OUT7*/
void TPS2HB35_SetOutput10A_OUT7(uint8_t state)
{
static Output10A_OUT7 = 0;
if (Output10A_OUT7 != state)
{
Output10A_OUT7 = state;
}
}
/*10A_OUT8*/
void TPS2HB35_SetOutput10A_OUT8(uint8_t state)
{
static Output10A_OUT8 = 0;
if (Output10A_OUT8 != state)
{
Output10A_OUT8 = state;
}
}
/*15A外发14片*1路*/
/*15A_OUT1*/
void TPS2HB35_SetOutput15A_OUT1(uint8_t state)
{
static Output15A_OUT1 = 0;
if (Output15A_OUT1 != state)
{
Output15A_OUT1 = state;
}
}
/*15A_OUT2*/
void TPS2HB35_SetOutput15A_OUT2(uint8_t state)
{
static Output15A_OUT2 = 0;
if (Output15A_OUT2 != state)
{
Output15A_OUT2 = state;
}
}
/*15A_OUT3*/
void TPS2HB35_SetOutput15A_OUT3(uint8_t state)
{
static Output15A_OUT3 = 0;
if (Output15A_OUT3 != state)
{
Output15A_OUT3 = state;
}
}
/*15A_OUT4*/
void TPS2HB35_SetOutput15A_OUT4(uint8_t state)
{
static Output15A_OUT4 = 0;
if (Output15A_OUT4 != state)
{
Output15A_OUT4 = state;
}
}
/*15A_OUT5*/
void TPS2HB35_SetOutput15A_OUT5(uint8_t state)
{
static Output15A_OUT5 = 0;
if (Output15A_OUT5 != state)
{
Output15A_OUT5 = state;
}
}
/*15A_OUT6*/
void TPS2HB35_SetOutput15A_OUT6(uint8_t state)
{
static Output15A_OUT6 = 0;
if (Output15A_OUT6 != state)
{
Output15A_OUT6 = state;
}
}
/*15A_OUT7*/
void TPS2HB35_SetOutput15A_OUT7(uint8_t state)
{
static Output15A_OUT7 = 0;
if (Output15A_OUT7 != state)
{
Output15A_OUT7 = state;
}
}
/*15A_OUT8*/
void TPS2HB35_SetOutput15A_OUT8(uint8_t state)
{
static Output15A_OUT8 = 0;
if (Output15A_OUT8 != state)
{
Output15A_OUT8 = state;
}
}
/*15A_OUT9*/
void TPS2HB35_SetOutput15A_OUT9(uint8_t state)
{
static Output15A_OUT9 = 0;
if (Output15A_OUT9 != state)
{
Output15A_OUT9 = state;
}
}
/*15A_OUT10*/
void TPS2HB35_SetOutput15A_OUT10(uint8_t state)
{
static Output15A_OUT10 = 0;
if (Output15A_OUT10 != state)
{
Output15A_OUT10 = state;
}
}
/*15A_OUT11*/
void TPS2HB35_SetOutput15A_OUT11(uint8_t state)
{
static Output15A_OUT11 = 0;
if (Output15A_OUT11 != state)
{
Output15A_OUT11 = state;
}
}
/*15A_OUT12*/
void TPS2HB35_SetOutput15A_OUT12(uint8_t state)
{
static Output15A_OUT12 = 0;
if (Output15A_OUT12 != state)
{
Output15A_OUT12 = state;
}
}
/*15A_OUT13*/
void TPS2HB35_SetOutput15A_OUT13(uint8_t state)
{
static Output15A_OUT13 = 0;
if (Output15A_OUT13 != state)
{
Output15A_OUT13 = state;
}
}
/*15A_OUT14*/
void TPS2HB35_SetOutput15A_OUT14(uint8_t state)
{
static Output15A_OUT14 = 0;
if (Output15A_OUT14 != state)
{
Output15A_OUT14 = state;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment