|
TM STM32Fxxx HAL Libraries
v1.0.0
Libraries for STM32Fxxx (F0, F4 and F7 series) devices based on HAL drivers from ST from Tilen Majerle
|
Library Functions. More...
Functions | |
| void | TM_OneWire_Init (TM_OneWire_t *OneWireStruct, GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin) |
| Initializes OneWire bus. More... | |
| uint8_t | TM_OneWire_Reset (TM_OneWire_t *OneWireStruct) |
| Resets OneWire bus. More... | |
| uint8_t | TM_OneWire_ReadByte (TM_OneWire_t *OneWireStruct) |
| Reads byte from one wire bus. More... | |
| void | TM_OneWire_WriteByte (TM_OneWire_t *OneWireStruct, uint8_t byte) |
| Writes byte to bus. More... | |
| void | TM_OneWire_WriteBit (TM_OneWire_t *OneWireStruct, uint8_t bit) |
| Writes single bit to onewire bus. More... | |
| uint8_t | TM_OneWire_ReadBit (TM_OneWire_t *OneWireStruct) |
| Reads single bit from one wire bus. More... | |
| uint8_t | TM_OneWire_Search (TM_OneWire_t *OneWireStruct, uint8_t command) |
| Searches for OneWire devices on specific Onewire port. More... | |
| void | TM_OneWire_ResetSearch (TM_OneWire_t *OneWireStruct) |
| Resets search states. More... | |
| uint8_t | TM_OneWire_First (TM_OneWire_t *OneWireStruct) |
| Starts search, reset states first. More... | |
| uint8_t | TM_OneWire_Next (TM_OneWire_t *OneWireStruct) |
| Reads next device. More... | |
| uint8_t | TM_OneWire_GetROM (TM_OneWire_t *OneWireStruct, uint8_t index) |
| Gets ROM number from device from search. More... | |
| void | TM_OneWire_GetFullROM (TM_OneWire_t *OneWireStruct, uint8_t *firstIndex) |
| Gets all 8 bytes ROM value from device from search. More... | |
| void | TM_OneWire_Select (TM_OneWire_t *OneWireStruct, uint8_t *addr) |
| Selects specific slave on bus. More... | |
| void | TM_OneWire_SelectWithPointer (TM_OneWire_t *OneWireStruct, uint8_t *ROM) |
| Selects specific slave on bus with pointer address. More... | |
| uint8_t | TM_OneWire_CRC8 (uint8_t *addr, uint8_t len) |
| Calculates 8-bit CRC for 1-wire devices. More... | |
Library Functions.
| uint8_t TM_OneWire_CRC8 | ( | uint8_t * | addr, |
| uint8_t | len | ||
| ) |
Calculates 8-bit CRC for 1-wire devices.
| *addr | Pointer to 8-bit array of data to calculate CRC |
| len | Number of bytes to check |
| Calculated | CRC from input data |
| uint8_t TM_OneWire_First | ( | TM_OneWire_t * | OneWireStruct | ) |
Starts search, reset states first.
| *OneWireStruct | Pointer to TM_OneWire_t working onewire where to reset search values |
| Device | status:
|
| void TM_OneWire_GetFullROM | ( | TM_OneWire_t * | OneWireStruct, |
| uint8_t * | firstIndex | ||
| ) |
Gets all 8 bytes ROM value from device from search.
| *OneWireStruct | Pointer to TM_OneWire_t working onewire |
| *firstIndex | Pointer to first location for first byte, other bytes are automatically incremented |
| None |
| uint8_t TM_OneWire_GetROM | ( | TM_OneWire_t * | OneWireStruct, |
| uint8_t | index | ||
| ) |
Gets ROM number from device from search.
| *OneWireStruct | Pointer to TM_OneWire_t working onewire |
| index | Because each device has 8-bytes long ROm address, you have to call this 8 times, to get ROM bytes from 0 to 7 ROM byte for index (0 to 7) at current found device |
| void TM_OneWire_Init | ( | TM_OneWire_t * | OneWireStruct, |
| GPIO_TypeDef * | GPIOx, | ||
| uint16_t | GPIO_Pin | ||
| ) |
Initializes OneWire bus.
| *OneWireStruct | Pointer to TM_OneWire_t empty working onewire structure |
| *Pointer | to GPIO port used for onewire channel |
| GPIO_Pin | GPIO Pin on specific GPIOx to be used for onewire channel |
| None |
| uint8_t TM_OneWire_Next | ( | TM_OneWire_t * | OneWireStruct | ) |
Reads next device.
| *OneWireStruct | Pointer to TM_OneWire_t working onewire |
| Device | status:
|
| uint8_t TM_OneWire_ReadBit | ( | TM_OneWire_t * | OneWireStruct | ) |
Reads single bit from one wire bus.
| *OneWireStruct | Pointer to TM_OneWire_t working onewire structure |
| Bit | value:
|
| uint8_t TM_OneWire_ReadByte | ( | TM_OneWire_t * | OneWireStruct | ) |
Reads byte from one wire bus.
| *OneWireStruct | Pointer to TM_OneWire_t working onewire structure |
| Byte | from read operation |
| uint8_t TM_OneWire_Reset | ( | TM_OneWire_t * | OneWireStruct | ) |
Resets OneWire bus.
| *OneWireStruct | Pointer to TM_OneWire_t working onewire structure |
| None |
| void TM_OneWire_ResetSearch | ( | TM_OneWire_t * | OneWireStruct | ) |
Resets search states.
| *OneWireStruct | Pointer to TM_OneWire_t working onewire where to reset search values |
| None |
| uint8_t TM_OneWire_Search | ( | TM_OneWire_t * | OneWireStruct, |
| uint8_t | command | ||
| ) |
Searches for OneWire devices on specific Onewire port.
| *OneWireStruct | Pointer to TM_OneWire_t working onewire structure where to search |
| Device | status:
|
| void TM_OneWire_Select | ( | TM_OneWire_t * | OneWireStruct, |
| uint8_t * | addr | ||
| ) |
Selects specific slave on bus.
| *OneWireStruct | Pointer to TM_OneWire_t working onewire |
| *addr | Pointer to first location of 8-bytes long ROM address |
| None |
| void TM_OneWire_SelectWithPointer | ( | TM_OneWire_t * | OneWireStruct, |
| uint8_t * | ROM | ||
| ) |
Selects specific slave on bus with pointer address.
| *OneWireStruct | Pointer to TM_OneWire_t working onewire |
| *ROM | Pointer to first byte of ROM address |
| None |
| void TM_OneWire_WriteBit | ( | TM_OneWire_t * | OneWireStruct, |
| uint8_t | bit | ||
| ) |
Writes single bit to onewire bus.
| *OneWireStruct | Pointer to TM_OneWire_t working onewire structure |
| bit | Bit value to send, 1 or 0 |
| None |
| void TM_OneWire_WriteByte | ( | TM_OneWire_t * | OneWireStruct, |
| uint8_t | byte | ||
| ) |
Writes byte to bus.
| *OneWireStruct | Pointer to TM_OneWire_t working onewire structure |
| byte | 8-bit value to write over OneWire protocol |
| None |