# api.py 
# Part of PyBBIO
# github.com/alexanderhiam/PyBBIO
# MIT License
# 
# Beaglebone platform API file.


from bbio.platform.platform import detect_platform 
PLATFORM = detect_platform()

if "3.8" in PLATFORM:
  from bone_3_8.adc import analog_init, analog_cleanup
  from bone_3_8.pwm import pwm_init, pwm_cleanup
  from serial_port import serial_cleanup
  
elif "3.2" in PLATFORM:
  from bone_3_2.adc import analog_init, analog_cleanup
  from bone_3_2.pwm import pwm_init, pwm_cleanup
  from serial_port import serial_cleanup
  
def platform_init():
  analog_init()
  pwm_init()

def platform_cleanup():
  analog_cleanup()
  pwm_cleanup()
  serial_cleanup()


[((10, 11, 10, 28), 'bbio.platform.platform.detect_platform', 'detect_platform', ({}, {}), '()', False, 'from bbio.platform.platform import detect_platform\n'), ((23, 2, 23, 15), 'bone_3_2.adc.analog_init', 'analog_init', ({}, {}), '()', False, 'from bone_3_2.adc import analog_init, analog_cleanup\n'), ((24, 2, 24, 12), 'bone_3_2.pwm.pwm_init', 'pwm_init', ({}, {}), '()', False, 'from bone_3_2.pwm import pwm_init, pwm_cleanup\n'), ((27, 2, 27, 18), 'bone_3_2.adc.analog_cleanup', 'analog_cleanup', ({}, {}), '()', False, 'from bone_3_2.adc import analog_init, analog_cleanup\n'), ((28, 2, 28, 15), 'bone_3_2.pwm.pwm_cleanup', 'pwm_cleanup', ({}, {}), '()', False, 'from bone_3_2.pwm import pwm_init, pwm_cleanup\n'), ((29, 2, 29, 18), 'serial_port.serial_cleanup', 'serial_cleanup', ({}, {}), '()', False, 'from serial_port import serial_cleanup\n')]