Functions | |
| s32 | MIOS32_IIC_BS_Init (u32 mode) |
| s32 | MIOS32_IIC_BS_ScanBankSticks (void) |
| s32 | MIOS32_IIC_BS_CheckAvailable (u8 bs) |
| s32 | MIOS32_IIC_BS_Read (u8 bs, u16 address, u8 *buffer, u8 len) |
| s32 | MIOS32_IIC_BS_Write (u8 bs, u16 address, u8 *buffer, u8 len) |
| s32 | MIOS32_IIC_BS_CheckWriteFinished (u8 bs) |
This function checks the availability of a BankStick taken from the last results of MIOS32_IIC_BS_ScanBankSticks
| [in] | bs | BankStick number (0-7) |
0: BankStick not available
Has to be used after MIOS32_IIC_BS_Write (during write operation) to poll the device state
| [in] | bs | BankStick number (0-7) |
0 if BankStick available, write operation finished
-1 if error during IIC transfer
-2 if BankStick blocked by another task (retry it!)
-3 if BankStick wasn't available at last scan
Initializes BankSticks
| [in] | mode | currently only mode 0 supported |
Reads one or more bytes into a buffer
| [in] | bs | BankStick number (0-7) |
| [in] | address | BankStick address (depends on size) |
| [out] | buffer | destination buffer |
| [in] | len | number of bytes which should be read (1..64) |
-1 if error during IIC transfer
-2 if BankStick blocked by another task (retry it!)
-3 if BankStick wasn't available at last scan
-4 if invalid length
| s32 MIOS32_IIC_BS_ScanBankSticks | ( | void | ) |
Scans all BankSticks to check the availablility by sending dummy requests and checking the ACK response.
Per module, this procedure takes at least ca. 25 uS, if no module is connected ca. 75 uS (3 retries), or even more if we have to wait for completion of the previous IIC transfer. Therefore this function should only be rarely used (e.g. once per second), and the state should be saved somewhere in the application
-2 if BankStick blocked by another task (retry the scan!)
Writes one or more bytes into the BankStick
| [in] | bs | BankStick number (0-7) |
| [in] | address | BankStick address (depends on size) |
| [in] | buffer | source buffer |
| [in] | len | number of bytes which should be written (1..64) |
-1 if error during IIC transfer
-2 if BankStick blocked by another task (retry it!)
-3 if BankStick wasn't available at last scan
-4 if invalid length
1.4.7