background image

OPT3001EVM Linux Getting Started Guide

Felipe Balbi

August 18, 2014

Summary of Contents for OPT3001EVM

Page 1: ...OPT3001EVM Linux Getting Started Guide Felipe Balbi August 18 2014 ...

Page 2: ...This page is intentionally left blank ...

Page 3: ...tion 2 2 1 OPT3001 2 2 2 Beagle Bone Black 2 2 3 Linux Kernel 2 3 Hardware Platform 3 4 The Linux Kernel 5 4 1 Writing Our DeviceTree 5 4 2 Downloading The Correct Version 6 4 3 Kernel Configuration 7 5 Usage 13 6 Conclusion 15 ii ...

Page 4: ...scribe the necessary steps to connect OPT3001EVM to a BeagleBone Black development platform By the end of this User s Guide the reader should be able to verify function ality of the OPT3001 device and get results from light measurements 1 ...

Page 5: ...ements can be either continuous or single shot The control and interrupt system features autonomous operation allowing the processor to sleep while the sensor searches for appropriate wake up events The low power consumption and low power supply voltage capability make this device ideal for battery powered applications 2 2 Beagle Bone Black Beagle Bone Black is an Open Source Hardware Software Dev...

Page 6: ...way of connecting OPT3001EVM to the Beagle Bone Black using a standard 100 mil spacing breadboard Connected like that OPT3001 will show on Beagle Bone Black s I2C Bus 2 1 The following section will describe all the necessary steps to get OPT3001 working on our Beagle Bone Black 1note that I2C Bus numbers start at 0 so I2C Bus 2 is the third I2C Bus on Beagle Bone Black 3 ...

Page 7: ...CHAPTER 3 HARDWARE PLATFORM 4 Figure 3 1 connecting opt3001evm to beagle bone black ...

Page 8: ...own as DeviceTree With a DeviceTree source such as below we can tell Linux that we have an OPT3001 device sitting under I2C Bus 2 and can be accessed through I2C address 0x44 arch arm boot dts am335x boneblack dts i2c2 status okay pinctrl names default pinctrl 0 i2c2_pins clock frequency 400000 light 44 status okay pinctrl names default pinctrl 0 light_pins compatible opt3001 reg 0x44 interrupts e...

Page 9: ... table below Linux Version GIT URL v3 14 git git kernel org pub scm linux kernel git balbi usb git opt3001 v3 14 v3 15 git git kernel org pub scm linux kernel git balbi usb git opt3001 v3 15 v3 16 git git kernel org pub scm linux kernel git balbi usb git opt3001 v3 16 v3 17 git git kernel org pub scm linux kernel git balbi usb git opt3001 v3 17 To download any of those branches a certain level of ...

Page 10: ...mmon configuration for Texas Instru ments SoCs including AM335x Now we need to enable OPT3001 driver For that we will run make arch arm cross_compile arm linux menuconfig You should see a screen such as below in Figure 4 1 After that let s enable the industrial i o framework and opt3001 driver please follow the steps below and refer to the Screen Captures if necessary 1 navigate to Device Drivers ...

Page 11: ...CHAPTER 4 THE LINUX KERNEL 8 5 exit menuconfig by following all Exit buttons 6 when asked if you want to save the new configuration choose Yes see figure 4 10 ...

Page 12: ...CHAPTER 4 THE LINUX KERNEL 9 Figure 4 1 linux kernel configuration main window Figure 4 2 Navigating to Device Drivers Figure 4 3 Navigating to Industrial I O support ...

Page 13: ...CHAPTER 4 THE LINUX KERNEL 10 Figure 4 4 Industrial I O support after pressing M on the keyboard Figure 4 5 Industrial I O support after pressing Y on the keyboard Figure 4 6 Navigating to Light sensors ...

Page 14: ...CHAPTER 4 THE LINUX KERNEL 11 Figure 4 7 Navigating to Texas Instruments OPT3001 Light Sensors Figure 4 8 OPT3001 after pressing M on the keyboard Figure 4 9 OPT3001 after pressing Y on the keyboard ...

Page 15: ...CHAPTER 4 THE LINUX KERNEL 12 Figure 4 10 Exitting menuconfig ...

Page 16: ...events fire when such thresholds are reached In order to illustrate that we will make use of iio_event_monitor a tool which can be found at drivers staging iio Documentation iio_event_monitor c Let s setup some thresholds cd events ls verb in_illuminance_thresh_falling_en verb in_illuminance_thresh_falling_hysteresis verb in_illuminance_thresh_falling_value verb in_illuminance_thresh_rising_en ver...

Page 17: ...5473266 type illuminance channel 0 evtype thresh direction rising Event time 946685162934369540 type illuminance channel 0 evtype thresh direction falling Event time 946685165222147843 type illuminance channel 0 evtype thresh direction rising Event time 946685166824180824 type illuminance channel 0 evtype thresh direction falling ...

Page 18: ...clusion During this short Guide we have wired OPT3001EVM to a Beagle Bone Black using a standard breadboard we downloaded and compiled the Linux Kernel and also verified that OPT3001 driver functions as expected 15 ...

Page 19: ...This page is intentionally left blank ...

Reviews: