Danke für die Antworten.
Ich hatte vor eine State-Machine zu verwenden. Die Frage ist nur wo ich
diese dann aufrufen soll...
Ich nutze die Cube nicht, sondern mach alles direkt mit Registern.
Das mit den Callback-Funktionen ist interessant. Hab im Cube-Code
gesucht und folgendes gefunden:
1 | /**
|
2 | * @brief Master Tx Transfer completed callback.
|
3 | * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
4 | * the configuration information for the specified I2C.
|
5 | * @retval None
|
6 | */
|
7 | __weak void HAL_I2C_MasterTxCpltCallback(I2C_HandleTypeDef *hi2c)
|
8 | {
|
9 | /* Prevent unused argument(s) compilation warning */
|
10 | UNUSED(hi2c);
|
11 |
|
12 | /* NOTE : This function should not be modified, when the callback is needed,
|
13 | the HAL_I2C_MasterTxCpltCallback can be implemented in the user file
|
14 | */
|
15 | }
|
16 |
|
17 | /**
|
18 | * @brief Master Rx Transfer completed callback.
|
19 | * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
20 | * the configuration information for the specified I2C.
|
21 | * @retval None
|
22 | */
|
23 | __weak void HAL_I2C_MasterRxCpltCallback(I2C_HandleTypeDef *hi2c)
|
24 | {
|
25 | /* Prevent unused argument(s) compilation warning */
|
26 | UNUSED(hi2c);
|
27 |
|
28 | /* NOTE : This function should not be modified, when the callback is needed,
|
29 | the HAL_I2C_MasterRxCpltCallback can be implemented in the user file
|
30 | */
|
31 | }
|
Die Frage ist nur wie die sich das nun genau gedacht haben, bzw. ich hab
gehofft da was zu finden, von welchen Flags und Signalen die ausgehen,
dass die Kommunikation abgeschlossen ist.