| 123456789101112131415161718192021222324252627 |
- #include "i2c.h"
- #include "gpio.h"
- #include <stdint.h>
- #include <TestEeprom.h>
- void testecr(){
- uint16_t add= EepromADD;
- uint8_t tab[3];
- tab[0]=0x00;
- tab[1]=0x00;
- tab[2]=0XAA;
- HAL_StatusTypeDef res;
- HAL_GPIO_WritePin(WC_GPIO_Port,WC_Pin,0);
- res = HAL_I2C_Master_Transmit(&hi2c3,add,tab,3,1000);
- }
- void testlec(){
- uint16_t add= EepromADD;
- uint8_t tab[2];
- tab[0]=0x00;
- tab[1]=0x00;
- uint8_t lec;
- HAL_StatusTypeDef res;
- HAL_GPIO_WritePin(WC_GPIO_Port,WC_Pin,1);
- res = HAL_I2C_Master_Transmit(&hi2c3,add,tab,2,1000);
- res = HAL_I2C_Master_Receive(&hi2c2,add,&lec,1,1000);
- }
|