xbmc
Functions
ir.c File Reference

Handles IR data. More...

#include <stdio.h>
#include <math.h>
#include <unistd.h>
#include "definitions.h"
#include "wiiuse_internal.h"
#include "ir.h"
Include dependency graph for ir.c:

Functions

void wiiuse_set_ir (struct wiimote_t *wm, int status)
 Set if the wiimote should track IR targets. More...
 
void wiiuse_set_ir_vres (struct wiimote_t *wm, unsigned int x, unsigned int y)
 Set the virtual screen resolution for IR tracking. More...
 
void wiiuse_set_ir_position (struct wiimote_t *wm, enum ir_position_t pos)
 Set the XY position for the IR cursor. More...
 
void wiiuse_set_aspect_ratio (struct wiimote_t *wm, enum aspect_t aspect)
 Set the aspect ratio of the TV/monitor. More...
 
void wiiuse_set_ir_sensitivity (struct wiimote_t *wm, int level)
 Set the IR sensitivity. More...
 
void calculate_basic_ir (struct wiimote_t *wm, byte *data)
 Calculate the data from the IR spots. More...
 
void calculate_extended_ir (struct wiimote_t *wm, byte *data)
 Calculate the data from the IR spots. More...
 
float calc_yaw (struct ir_t *ir)
 Calculate yaw given the IR data. More...
 

Detailed Description

Handles IR data.

Function Documentation

◆ calc_yaw()

float calc_yaw ( struct ir_t ir)

Calculate yaw given the IR data.

Parameters
irIR data structure.

◆ calculate_basic_ir()

void calculate_basic_ir ( struct wiimote_t wm,
byte *  data 
)

Calculate the data from the IR spots.

Basic IR mode.

Parameters
wmPointer to a wiimote_t structure.
dataData returned by the wiimote for the IR spots.

◆ calculate_extended_ir()

void calculate_extended_ir ( struct wiimote_t wm,
byte *  data 
)

Calculate the data from the IR spots.

Extended IR mode.

Parameters
wmPointer to a wiimote_t structure.
dataData returned by the wiimote for the IR spots.

◆ wiiuse_set_aspect_ratio()

void wiiuse_set_aspect_ratio ( struct wiimote_t wm,
enum aspect_t  aspect 
)

Set the aspect ratio of the TV/monitor.

Parameters
wmPointer to a wiimote_t structure.
aspectEither WIIUSE_ASPECT_16_9 or WIIUSE_ASPECT_4_3

◆ wiiuse_set_ir()

void wiiuse_set_ir ( struct wiimote_t wm,
int  status 
)

Set if the wiimote should track IR targets.

Parameters
wmPointer to a wiimote_t structure.
status1 to enable, 0 to disable.

◆ wiiuse_set_ir_position()

void wiiuse_set_ir_position ( struct wiimote_t wm,
enum ir_position_t  pos 
)

Set the XY position for the IR cursor.

Parameters
wmPointer to a wiimote_t structure.

◆ wiiuse_set_ir_sensitivity()

void wiiuse_set_ir_sensitivity ( struct wiimote_t wm,
int  level 
)

Set the IR sensitivity.

Parameters
wmPointer to a wiimote_t structure.
level1-5, same as Wii system sensitivity setting.

If the level is < 1, then level will be set to 1. If the level is > 5, then level will be set to 5.

◆ wiiuse_set_ir_vres()

void wiiuse_set_ir_vres ( struct wiimote_t wm,
unsigned int  x,
unsigned int  y 
)

Set the virtual screen resolution for IR tracking.

Parameters
wmPointer to a wiimote_t structure.
status1 to enable, 0 to disable.