Functions | |
void | OneWireInit (uint32_t ui32Base, uint32_t ui32InitFlags) |
void | OneWireBusReset (uint32_t ui32Base) |
uint32_t | OneWireBusStatus (uint32_t ui32Base) |
void | OneWireDataGet (uint32_t ui32Base, uint32_t *pui32Data) |
bool | OneWireDataGetNonBlocking (uint32_t ui32Base, uint32_t *pui32Data) |
void | OneWireIntClear (uint32_t ui32Base, uint32_t ui32IntFlags) |
void | OneWireIntDisable (uint32_t ui32Base, uint32_t ui32IntFlags) |
void | OneWireIntEnable (uint32_t ui32Base, uint32_t ui32IntFlags) |
uint32_t | OneWireIntStatus (uint32_t ui32Base, bool bMasked) |
void | OneWireIntRegister (uint32_t ui32Base, void(*pfnHandler)(void)) |
void | OneWireIntUnregister (uint32_t ui32Base) |
void | OneWireDMADisable (uint32_t ui32Base, uint32_t ui32DMAFlags) |
void | OneWireDMAEnable (uint32_t ui32Base, uint32_t ui32DMAFlags) |
void | OneWireTransaction (uint32_t ui32Base, uint32_t ui32OpMode, uint32_t ui32Data, uint32_t ui32BitCnt) |
#define ONEWIRE_TXN_MASK |
Referenced by OneWireDMADisable(), OneWireDMAEnable(), and OneWireTransaction().
#define ONEWIRE_TXN_SIZE_LSHIFT 3 |
Referenced by OneWireTransaction().
#define ONEWIRE_TXN_BSIZE_LSHIFT 16 |
Referenced by OneWireTransaction().
#define ONEWIRE_INIT_SPD_STD 0x00000000 |
#define ONEWIRE_INIT_SPD_OD 0x00000020 |
#define ONEWIRE_INIT_READ_STD 0x00000000 |
#define ONEWIRE_INIT_READ_LATE 0x00000040 |
#define ONEWIRE_INIT_ATR 0x00000000 |
#define ONEWIRE_INIT_NO_ATR 0x00000080 |
#define ONEWIRE_INIT_STD_POL 0x00000000 |
#define ONEWIRE_INIT_ALT_POL 0x40000000 |
#define ONEWIRE_INIT_1_WIRE_CFG 0x00000000 |
#define ONEWIRE_INIT_2_WIRE_CFG 0x80000000 |
#define ONEWIRE_BUS_STATUS_BUSY 0x00000100 |
#define ONEWIRE_BUS_STATUS_NO_SLAVE 0x00000200 |
#define ONEWIRE_BUS_STATUS_STUCK 0x00000400 |
#define ONEWIRE_OP_RESET 0x00000001 |
Referenced by OneWireTransaction().
#define ONEWIRE_OP_READ 0x00000002 |
Referenced by OneWireTransaction().
#define ONEWIRE_OP_WRITE 0x00000004 |
Referenced by OneWireTransaction().
#define ONEWIRE_DMA_BUS_RESET 0x00000001 |
#define ONEWIRE_DMA_OP_READ 0x00000002 |
#define ONEWIRE_DMA_OP_MULTI_WRITE 0x00000004 |
#define ONEWIRE_DMA_OP_MULTI_READ 0x00000006 |
#define ONEWIRE_DMA_MODE_SG 0x00000008 |
#define ONEWIRE_DMA_OP_SZ_8 0x00000000 |
#define ONEWIRE_DMA_OP_SZ_16 0x00000800 |
#define ONEWIRE_DMA_OP_SZ_32 0x00001800 |
#define ONEWIRE_INT_RESET_DONE 0x00000001 |
#define ONEWIRE_INT_OP_DONE 0x00000002 |
#define ONEWIRE_INT_NO_SLAVE 0x00000004 |
#define ONEWIRE_INT_STUCK 0x00000008 |
#define ONEWIRE_INT_DMA_DONE 0x00000010 |
void OneWireInit | ( | uint32_t | ui32Base, |
uint32_t | ui32InitFlags | ||
) |
Initializes the 1-Wire module.
ui32Base | specifies the base address of the 1-Wire module. |
ui32InitFlags | provides the initialization flags. |
This function configures and initializes the 1-Wire interface for use.
The ui32InitFlags parameter is a combination of the following:
References ASSERT, HWREG, and ONEWIRE_O_CS.
void OneWireBusReset | ( | uint32_t | ui32Base | ) |
Issues a reset on the 1-Wire bus.
ui32Base | specifies the base address of the 1-Wire module. |
This function causes the 1-Wire module to generate a reset signal on the 1-Wire bus.
References ASSERT, HWREG, ONEWIRE_CS_RST, and ONEWIRE_O_CS.
uint32_t OneWireBusStatus | ( | uint32_t | ui32Base | ) |
Retrieves the 1-Wire bus condition status.
ui32Base | specifies the base address of the 1-Wire module. |
This function returns the 1-Wire bus conditions reported by the 1-Wire module. These conditions could be a logical OR of any of the following:
References ASSERT, HWREG, ONEWIRE_CS_BUSY, ONEWIRE_CS_NOATR, ONEWIRE_CS_STUCK, and ONEWIRE_O_CS.
void OneWireDataGet | ( | uint32_t | ui32Base, |
uint32_t * | pui32Data | ||
) |
Retrieves data from the 1-Wire interface.
ui32Base | specifies the base address of the 1-Wire module. |
pui32Data | is a pointer to storage to hold the read data. |
This function reads data from the 1-Wire module once all active bus operations are completed. By protocol definition, bit data defaults to a 1. Thus if a slave did not signal any 0-bit data, this read returns 0xffffffff.
References ASSERT, HWREG, ONEWIRE_CS_BUSY, ONEWIRE_O_CS, and ONEWIRE_O_DATR.
bool OneWireDataGetNonBlocking | ( | uint32_t | ui32Base, |
uint32_t * | pui32Data | ||
) |
Retrieves data from the 1-Wire interface.
ui32Base | specifies the base address of the 1-Wire module. |
pui32Data | is a pointer to storage to hold the read data. |
This function reads data from the 1-Wire module if there are no active operations on the bus. Otherwise it returns without reading the data from the module.
By protocol definition, bit data defaults to a 1. Thus if a slave did not signal any 0-bit data, this read returns 0xffffffff.
References ASSERT, HWREG, ONEWIRE_CS_BUSY, ONEWIRE_O_CS, and ONEWIRE_O_DATR.
void OneWireIntClear | ( | uint32_t | ui32Base, |
uint32_t | ui32IntFlags | ||
) |
Clears the 1-Wire module interrupt sources.
ui32Base | specifies the base address of the 1-Wire module. |
ui32IntFlags | is a bit mask of the interrupt sources to be cleared. |
This function clears the specified 1-Wire interrupt sources so that they no longer assert. This function must be called in the interrupt handler to keep the interrupts from being triggered again immediately upon exit. The ui32IntFlags parameter can be a logical OR of any of the following:
References ASSERT, HWREG, ONEWIRE_IM_DMA, ONEWIRE_IM_NOATR, ONEWIRE_IM_OPC, ONEWIRE_IM_RST, ONEWIRE_IM_STUCK, and ONEWIRE_O_ICR.
void OneWireIntDisable | ( | uint32_t | ui32Base, |
uint32_t | ui32IntFlags | ||
) |
Disables individual 1-Wire module interrupt sources.
ui32Base | specifies the base address of the 1-Wire module. |
ui32IntFlags | is a bit mask of the interrupt sources to be disabled. |
This function disables the indicated 1-Wire interrupt sources. The ui32IntFlags parameter can be a logical OR of any of the following:
References ASSERT, HWREG, ONEWIRE_IM_DMA, ONEWIRE_IM_NOATR, ONEWIRE_IM_OPC, ONEWIRE_IM_RST, ONEWIRE_IM_STUCK, and ONEWIRE_O_IM.
void OneWireIntEnable | ( | uint32_t | ui32Base, |
uint32_t | ui32IntFlags | ||
) |
Enables individual 1-Wire module interrupt sources.
ui32Base | specifies the base address of the 1-Wire module. |
ui32IntFlags | is a bit mask of the interrupt sources to be enabled. |
This function enables the indicated 1-Wire interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor. The ui32IntFlags parameter can be a logical OR of any of the following:
References ASSERT, HWREG, ONEWIRE_IM_DMA, ONEWIRE_IM_NOATR, ONEWIRE_IM_OPC, ONEWIRE_IM_RST, ONEWIRE_IM_STUCK, and ONEWIRE_O_IM.
uint32_t OneWireIntStatus | ( | uint32_t | ui32Base, |
bool | bMasked | ||
) |
Gets the current 1-Wire interrupt status.
ui32Base | specifies the base address of the 1-Wire module. |
bMasked | is false if the raw interrupt status is required or true if the masked interrupt status is required. |
This function returns the interrupt status for the 1-Wire module. Either the raw interrupt status or the status of interrupts that are allowed to reflect to the processor can be returned.
References ASSERT, HWREG, ONEWIRE_O_MIS, and ONEWIRE_O_RIS.
void OneWireIntRegister | ( | uint32_t | ui32Base, |
void(*)(void) | pfnHandler | ||
) |
Registers an interrupt handler for the 1-Wire module.
ui32Base | is the base address of the 1-Wire module. |
pfnHandler | is a pointer to the function to be called when the 1-Wire interrupt occurs. |
This function sets the handler to be called when a 1-Wire interrupt occurs. This function enables the global interrupt in the interrupt controller; specific 1-Wire interrupts must be enabled via OneWireIntEnable(). If necessary, it is the interrupt handler's responsibility to clear the interrupt source via OneWireIntClear().
References ASSERT.
void OneWireIntUnregister | ( | uint32_t | ui32Base | ) |
Unregisters an interrupt handler for the 1-Wire module.
ui32Base | is the base address of the 1-Wire module. |
This function clears the handler to be called when an 1-Wire interrupt occurs. This function also masks off the interrupt in the interrupt controller so that the interrupt handler no longer is called.
References ASSERT.
void OneWireDMADisable | ( | uint32_t | ui32Base, |
uint32_t | ui32DMAFlags | ||
) |
Disables 1-Wire DMA operations.
ui32Base | is the base address of the 1-Wire module. |
ui32DMAFlags | is a bit mask of the DMA features to disable. |
This function is used to disable 1-Wire DMA features that were enabled by OneWireDMAEnable(). The specified 1-Wire DMA features are disabled. The ui32DMAFlags parameter is a combination of the following:
References ASSERT, HWREG, ONEWIRE_O_CS, ONEWIRE_O_DMA, and ONEWIRE_TXN_MASK.
void OneWireDMAEnable | ( | uint32_t | ui32Base, |
uint32_t | ui32DMAFlags | ||
) |
Enables 1-Wire DMA operations.
ui32Base | is the base address of the 1-Wire module. |
ui32DMAFlags | is a bit mask of the DMA features to enable. |
This function enables the specified 1-Wire DMA features. The 1-Wire module can be configured for write operations, read operations, small write and read operations, and scatter-gather support of mixed operations.
The ui32DMAFlags parameter is a combination of the following:
References ASSERT, HWREG, ONEWIRE_DMA_DMAOP_RDMUL, ONEWIRE_DMA_DMAOP_RDSNG, ONEWIRE_DMA_SG, ONEWIRE_O_CS, ONEWIRE_O_DATW, ONEWIRE_O_DMA, ONEWIRE_TXN_MASK, and SysCtlDelay().
void OneWireTransaction | ( | uint32_t | ui32Base, |
uint32_t | ui32OpMode, | ||
uint32_t | ui32Data, | ||
uint32_t | ui32BitCnt | ||
) |
Performs a 1-Wire protocol transaction on the bus.
ui32Base | specifies the base address of the 1-Wire module. |
ui32OpMode | sets the transaction type. |
ui32Data | is the data for a write operation. |
ui32BitCnt | specifies the number of valid bits (1-32) for the operation. |
This function performs a 1-Wire protocol transaction, read and/or write, on the bus. The application should confirm the bus is idle before starting a read or write transaction.
The ui32OpMode defines the activity for the bus operations and is a logical OR of the following:
References ASSERT, HWREG, ONEWIRE_CS_OP_RD, ONEWIRE_CS_OP_WR, ONEWIRE_O_CS, ONEWIRE_O_DATW, ONEWIRE_OP_READ, ONEWIRE_OP_RESET, ONEWIRE_OP_WRITE, ONEWIRE_TXN_BSIZE_LSHIFT, ONEWIRE_TXN_MASK, and ONEWIRE_TXN_SIZE_LSHIFT.