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

docs: TPS2HB35AQPWPRQ1文件上传

parent 068e7a92
#include "SGM4591Q.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)
{
......@@ -112,3 +151,74 @@ void SGM4591Q_Control(void)
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"
/*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;
void SGM4591Q_IIC_Send(uint8_t Address,uint8_t Register,uint8_t Function);
......
This diff is collapsed.
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