diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-10-01 08:59:14 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-10-01 09:01:29 +0200 |
commit | 5cb23f4b8870499b306cfb99186aa484ed0a47f1 (patch) | |
tree | 252a6308a828e16213d8cd2af024397383566988 /bsps/arm/atsam/include/bsp/atsam-i2c.h | |
parent | bsp/atsam: Use binary semaphore for SPI (diff) | |
download | rtems-5cb23f4b8870499b306cfb99186aa484ed0a47f1.tar.bz2 |
bsp/atsam: Use binary semaphore for I2C
Remove superfluous sleep before each I2C transfer. Reset I2C module
after transfer timeouts.
Update #3534.
Diffstat (limited to 'bsps/arm/atsam/include/bsp/atsam-i2c.h')
-rw-r--r-- | bsps/arm/atsam/include/bsp/atsam-i2c.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bsps/arm/atsam/include/bsp/atsam-i2c.h b/bsps/arm/atsam/include/bsp/atsam-i2c.h index 7425db9f7b..ae0fe97584 100644 --- a/bsps/arm/atsam/include/bsp/atsam-i2c.h +++ b/bsps/arm/atsam/include/bsp/atsam-i2c.h @@ -19,6 +19,7 @@ #include <libchip/include/pio.h> #include <bsp.h> +#include <rtems/thread.h> #include <dev/i2c/i2c.h> #ifdef __cplusplus @@ -54,9 +55,9 @@ typedef struct { uint32_t msg_todo; uint32_t current_msg_todo; uint8_t *current_msg_byte; - uint32_t input_clock; + uint32_t output_clock; bool read; - rtems_id task_id; + rtems_binary_semaphore sem; rtems_vector_number irq; } atsam_i2c_bus; |