4.1.1 Polled Driver

A short description of each file in the polled driver is shown in the table below.

Table 4-1. Polled Driver Files
FileContains
main.cCode example for the polled driver
OWISWBitFunctions.cImplementation of the software only bit-level functions
OWIUARTBitFunctions.cImplementation of the UART bit-level functions
OWIBitFunctions.hCommon header file for OWISWBitFunctions.c and OWIUARTBitfunctions.c
OWIHighLevelFunctions.cHigh-level functions
OWIHighLevelFunctions.hHeader file for OWIHighLevelFunctions.c
OWIPolled.hConfiguration 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.
    Figure 4-1. Open Drain Circuit