4.1.1 Polled Driver
A short description of each file in the polled driver is shown in the table below.
File | Contains |
---|---|
main.c | Code example for the polled driver |
OWISWBitFunctions.c | Implementation of the software only bit-level functions |
OWIUARTBitFunctions.c | Implementation of the UART bit-level functions |
OWIBitFunctions.h | Common header file for OWISWBitFunctions.c and OWIUARTBitfunctions.c |
OWIHighLevelFunctions.c | High-level functions |
OWIHighLevelFunctions.h | Header file for OWIHighLevelFunctions.c |
OWIPolled.h | Configuration header file for the polled drivers |
- Open the Atmel Studio 7 project or IAR project. (After downloading .atzip from Atmel START and importing in Atmel Studio 7 or IAR.)
- Open the file OWIPolled.h for editing and locate the section named “User defines”
- Choose between ‘software only’ or ‘UART driver’ by uncommenting one of the lines as described in the file
- Move down to the section corresponding to the selected driver
- Adjust the defines in the section according to the hardware setup as described in the file
- The project is now ready to be compiled
- Driver mode can be selected as OWI_SOFTWARE_DRIVER or OWI_UART_DRIVER from the OWIPolled.h file. For OWI_UART_DRIVER mode, the open-drain circuit needs to be connected at TXD and RXD pins, as shown in the figure below. DQ is one wire interface from the 1-Wire device.