advanced functions More...
Macros | |
#define | tucbot_twi_lockLib() |
function: locks the TWI for internal use | |
#define | tucbot_twi_unlockLib() |
function: unlocks the TWI from internal use | |
#define | tucbot_twi_lockLibGet() |
function: gets if the TWI is locked for internal use | |
#define | tucbot_twi_lockWrapper() |
function: locks the TWI-Wrapper | |
#define | tucbot_twi_unlockWrapper() |
function: unlocks the TWI-Wrapper | |
#define | tucbot_twi_lockWrapperGet() |
function: gets if the TWI-Wrapper is locked | |
#define | tucbot_twi_lockUserGet() |
function: gets if the TWI is locked by user | |
Functions | |
void | tucbot_twi_reset (void) |
Resets the TWI hardware. More... | |
void | tucbot_twi_resetHard (void) |
Disables the TWI hardware. More... | |
void | tucbot_twi_next (eTwiStructId id) |
The indexed data block is send or received next over the TWI. More... | |
uint8_t | tucbot_twi_checkId (eTwiStructId id) |
Internal helper function for checking the data block id. More... | |
eTwiStructId | tucbot_twi_incrementId (eTwiStructId id) |
Internal helper function for increasing the data block id. More... | |
eTwiStructId | tucbot_twi_validId (eTwiStructId id) |
Internal helper function for creating an valid data block id. More... | |
uint8_t | tucbot_twi_getAddress (eTwiStructId id) |
Internal helper function for returning the twi address of the data block id. More... | |
advanced functions
uint8_t tucbot_twi_checkId | ( | eTwiStructId | id | ) |
Internal helper function for checking the data block id.
id | value of the selected struct - see also eTwiStructId |
uint8_t tucbot_twi_getAddress | ( | eTwiStructId | id | ) |
Internal helper function for returning the twi address of the data block id.
id | value of the selected struct - see also eTwiStructId |
eTwiStructId tucbot_twi_incrementId | ( | eTwiStructId | id | ) |
Internal helper function for increasing the data block id.
The result will always be the next valid data block id.
id | value of the selected struct - see also eTwiStructId |
void tucbot_twi_next | ( | eTwiStructId | id | ) |
The indexed data block is send or received next over the TWI.
It's not enqueued like the other data blocks, but handled as soon as possible.
There exists only one flag for this fast single tranfer. If it is already set, it will not be overriden. To ensure tranfer as soon as possible this function might be called in a loop until the received or transmitted flags are set.
id | value of the selected struct - see also eTwiStructId |
void tucbot_twi_reset | ( | void | ) |
Resets the TWI hardware.
Resets the TWI to idle-mode by transmitting a stop-condition. This also flushes the internal buffers of the TWI and resets the error state.
void tucbot_twi_resetHard | ( | void | ) |
Disables the TWI hardware.
Like twi_reset() and tucbot_twi_reset(), this function flushes all software buffers and clears the last error code. Additionally, this function turns the TWI immediately off!
There is a dedicated reset counter in tucbot_twi to recognize all hard resets.
eTwiStructId tucbot_twi_validId | ( | eTwiStructId | id | ) |
Internal helper function for creating an valid data block id.
This function first calls tucbot_twi_checkId(). If the id is valid, it will be returned as is. Otherwise tucbot_twi_incrementId() will be called and returned.
id | value of the selected struct - see also eTwiStructId |