NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Syscalls
Collaboration diagram for Syscalls:

Files

file  system_calls.h
 

Data Structures

struct  system_calls_pwm
 pwm related system calls More...
 
struct  system_calls_imu
 
struct  system_calls_leds
 
struct  system_calls_beeper
 
struct  system_calls_time
 
struct  system_eeprom_info
 
struct  system_calls_eeprom
 
struct  system_calls_range
 
struct  system_calls
 

Macros

#define SYSTEM_GYRO_RANGE   2000
 
#define SYSTEM_ACC_1G   1000
 
#define SYSTEM_GYRO_SCALE   ((float)SYSTEM_GYRO_RANGE / (int16_t)0x7fff)
 
#define sys_led_on(sys, id)   sys->leds.on(&(sys)->leds, id, true)
 
#define sys_led_off(sys, id)   sys->leds.on(&(sys)->leds, id, false)
 
#define sys_led_toggle(sys, id)   sys->leds.toggle(&(sys)->leds, id)
 
#define sys_beeper_on(sys)   sys->beeper.on(&(sys)->beeper, true)
 
#define sys_beeper_off(sys)   sys->beeper.on(&(sys)->beeper, false)
 
#define sys_millis(sys)   (sys->time.micros(&(sys)->time) / 1000)
 
#define sys_micros(sys)   (sys->time.micros(&(sys)->time))
 
#define sys_gyro_read(sys, data)   (sys->imu.read_gyro(&(sys)->imu, data))
 
#define sys_acc_read(sys, data)   (sys->imu.read_acc(&(sys)->imu, data))
 
#define sys_get_pressure(sys, data)   (sys->imu.read_pressure(&(sys)->imu, data))
 
#define sys_get_temperature(sys, data)   (sys->imu.read_temperature(&(sys)->imu, data))
 
#define sys_motor_write(sys, id, val)   (sys->pwm.write_motor(&(sys)->pwm, id, val))
 
#define sys_servo_write(sys, id, val)   (sys->pwm.write_servo(&(sys)->pwm, id, val))
 
#define sys_eeprom_write(sys, addr, src, size)   (sys->eeprom.write(&(sys)->eeprom, addr, src, size))
 
#define sys_eeprom_read(sys, dst, addr, size)   (sys->eeprom.read(&(sys)->eeprom, dst, addr, size))
 
#define sys_eeprom_get_info(sys, info)   (sys->eeprom.get_info(&(sys)->eeprom, info))
 
#define sys_eeprom_erase_page(sys, addr)   (sys->eeprom.erase_page(&(sys)->eeprom, addr))
 
#define sys_range_read(sys, deg, dst)   (sys->range.read_range(&(sys)->range, deg, dst))
 

Detailed Description

Macro Definition Documentation

#define sys_acc_read (   sys,
  data 
)    (sys->imu.read_acc(&(sys)->imu, data))
#define sys_beeper_off (   sys)    sys->beeper.on(&(sys)->beeper, false)
#define sys_beeper_on (   sys)    sys->beeper.on(&(sys)->beeper, true)
#define sys_eeprom_erase_page (   sys,
  addr 
)    (sys->eeprom.erase_page(&(sys)->eeprom, addr))
#define sys_eeprom_get_info (   sys,
  info 
)    (sys->eeprom.get_info(&(sys)->eeprom, info))
#define sys_eeprom_read (   sys,
  dst,
  addr,
  size 
)    (sys->eeprom.read(&(sys)->eeprom, dst, addr, size))
#define sys_eeprom_write (   sys,
  addr,
  src,
  size 
)    (sys->eeprom.write(&(sys)->eeprom, addr, src, size))
#define sys_get_pressure (   sys,
  data 
)    (sys->imu.read_pressure(&(sys)->imu, data))
#define sys_get_temperature (   sys,
  data 
)    (sys->imu.read_temperature(&(sys)->imu, data))
#define sys_gyro_read (   sys,
  data 
)    (sys->imu.read_gyro(&(sys)->imu, data))
#define sys_led_off (   sys,
  id 
)    sys->leds.on(&(sys)->leds, id, false)
#define sys_led_on (   sys,
  id 
)    sys->leds.on(&(sys)->leds, id, true)
#define sys_led_toggle (   sys,
  id 
)    sys->leds.toggle(&(sys)->leds, id)
#define sys_micros (   sys)    (sys->time.micros(&(sys)->time))
#define sys_millis (   sys)    (sys->time.micros(&(sys)->time) / 1000)
#define sys_motor_write (   sys,
  id,
  val 
)    (sys->pwm.write_motor(&(sys)->pwm, id, val))
#define sys_range_read (   sys,
  deg,
  dst 
)    (sys->range.read_range(&(sys)->range, deg, dst))
#define sys_servo_write (   sys,
  id,
  val 
)    (sys->pwm.write_servo(&(sys)->pwm, id, val))
#define SYSTEM_ACC_1G   1000

standard value for accelerometer readings that represents 1G. Drivers should use this value to scale accelerometer readings into this range.

#define SYSTEM_GYRO_RANGE   2000

standard maximum gyro rate in deg/s which the 2^15 (int16) gyro value range represents. System should use this value to scale the gyro readings to 2^15 range according to this value.

#define SYSTEM_GYRO_SCALE   ((float)SYSTEM_GYRO_RANGE / (int16_t)0x7fff)

Helper macro for multiplier to convert gyro reading into deg/s