Add Doc
This commit is contained in:
25
MOBIS/PRK3_(ADAS_Parking3)/Issue/Open_PMIC_Jira/Readme.txt
Normal file
25
MOBIS/PRK3_(ADAS_Parking3)/Issue/Open_PMIC_Jira/Readme.txt
Normal file
@@ -0,0 +1,25 @@
|
||||
Mobis CRC <20><><EFBFBD><EFBFBD>
|
||||
|
||||
void write_i2c_with_crc_test(const uint8 *data, uint32 length, IicSlaveConfigPtr LpSlaveConfig) {
|
||||
|
||||
//uint8 buffer[256]; // Ensure this is large enough
|
||||
|
||||
if (length + 2 > sizeof(buffer)) return; // Prevent overflow
|
||||
|
||||
// Copy data
|
||||
|
||||
for (uint8 i = 0; i < length+1; ++i) {
|
||||
|
||||
buffer[i] = data[i];
|
||||
|
||||
}
|
||||
|
||||
// Calculate and append CRC
|
||||
|
||||
buffer[length+1] = crc8(data, length+1);
|
||||
|
||||
// Send data + CRC over I2C
|
||||
|
||||
CddIic_Ch5Write(&buffer[1], length+1, LpSlaveConfig);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user