Classes | Macros | Enumerations | Functions | Variables
jr3_driver.cpp File Reference
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <sys/time.h>
#include <sys/neutrino.h>
#include <sys/iofunc.h>
#include <sys/dispatch.h>
#include <sys/mman.h>
#include <hw/pci.h>
#include "QNX101/jr3pci3.idm"
Include dependency graph for jr3_driver.cpp:

Go to the source code of this file.

Classes

struct  error_bits
 
struct  force_array
 
struct  force_sensor_data
 
struct  le_struct
 
struct  links
 
struct  raw_channel
 
struct  server_msg_t
 
struct  six_axis_array
 
struct  thresh_struct
 
struct  transform
 
struct  vect_bits
 
struct  warning_bits
 

Macros

#define DEVICEID   0x3112 /* for 2ch board */
 
#define Jr3DmAddrMask   0x6000
 
#define Jr3NoAddrMask   0x40000
 
#define Jr3ResetAddr   0x18000
 
#define min(a, b)   ((a) < (b) ? (a) : (b))
 
#define ReadJr3(addr)   (ReadJr3Dm((addr) | Jr3DmAddrMask))
 
#define ReadJr3Dm(addr)   (*(uint16_t volatile *)(ToJr3PciAddrH((addr))))
 
#define ReadJr3Pm(addr)
 
#define ToJr3PciAddrH(addr)   (((int)(addr) << 2) + Jr3BaseAddressH)
 
#define ToJr3PciAddrL(addr)   (((int)(addr) << 2) + Jr3BaseAddressL)
 
#define VENDORID   0x1762 /* Vendor ID of JR3 */
 
#define WriteJr3(addr, data)   WriteJr3Dm((addr) | Jr3DmAddrMask,data)
 
#define WriteJr3Dm(addr, data)   *(int volatile *)(ToJr3PciAddrH((addr))) = (int)(data)
 
#define WriteJr3Pm(addr, data)   WriteJr3Pm2((addr),(data) >> 8, (data))
 
#define WriteJr3Pm2(addr, data, data2)   (*(int volatile *)ToJr3PciAddrH((addr)) = (int)(data));(*(int volatile *)ToJr3PciAddrL((addr)) = (int)(data2))
 

Enumerations

enum  force_units {
  lbs_in_lbs_mils, N_dNm_mm10, kgf10_kgFcm_mm10, klbs_kin_lbs_mils,
  reserved_units_4, reserved_units_5, reserved_units_6, reserved_units_7
}
 
enum  link_types {
  end_x_form, tx, ty, tz,
  rx, ry, rz, neg
}
 

Functions

int download (unsigned int base0, unsigned int base1)
 
void get_force_sensor_info (force_sensor_data *data, char *msg)
 
int io_read (resmgr_context_t *ctp, io_read_t *msg, RESMGR_OCB_T *ocb)
 
int main (int argc, char **argv)
 
int message_callback (message_context_t *ctp, int type, unsigned flags, void *handle)
 
void wait_t (void)
 

Variables

static char * buffer = (char *) "Hello world\n"
 
static resmgr_connect_funcs_t ConnectFuncs
 
char * force_units_str []
 
static iofunc_attr_t IoFuncAttr
 
static resmgr_io_funcs_t IoFuncs
 
volatile uint32_t Jr3BaseAddress0H
 
volatile uint32_t Jr3BaseAddress0L
 
volatile uint32_t Jr3BaseAddress1H
 
volatile uint32_t Jr3BaseAddress1L
 
volatile uint32_t Jr3BaseAddressH
 
volatile uint32_t Jr3BaseAddressL
 
unsigned long MappedAddress
 

Macro Definition Documentation

#define DEVICEID   0x3112 /* for 2ch board */

Definition at line 34 of file jr3_driver.cpp.

#define Jr3DmAddrMask   0x6000

Definition at line 39 of file jr3_driver.cpp.

#define Jr3NoAddrMask   0x40000

Definition at line 38 of file jr3_driver.cpp.

#define Jr3ResetAddr   0x18000

Definition at line 37 of file jr3_driver.cpp.

#define min (   a,
  b 
)    ((a) < (b) ? (a) : (b))

Definition at line 22 of file jr3_driver.cpp.

#define ReadJr3 (   addr)    (ReadJr3Dm((addr) | Jr3DmAddrMask))

Definition at line 59 of file jr3_driver.cpp.

#define ReadJr3Dm (   addr)    (*(uint16_t volatile *)(ToJr3PciAddrH((addr))))

Definition at line 55 of file jr3_driver.cpp.

#define ReadJr3Pm (   addr)
Value:
(*(uint16_t volatile *)(ToJr3PciAddrH((addr))) << 8 |\
*(uint8_t volatile *)(ToJr3PciAddrL((addr))))
#define ToJr3PciAddrH(addr)
Definition: jr3_driver.cpp:43
#define ToJr3PciAddrL(addr)
Definition: jr3_driver.cpp:44

Definition at line 47 of file jr3_driver.cpp.

#define ToJr3PciAddrH (   addr)    (((int)(addr) << 2) + Jr3BaseAddressH)

Definition at line 43 of file jr3_driver.cpp.

#define ToJr3PciAddrL (   addr)    (((int)(addr) << 2) + Jr3BaseAddressL)

Definition at line 44 of file jr3_driver.cpp.

#define VENDORID   0x1762 /* Vendor ID of JR3 */

Definition at line 31 of file jr3_driver.cpp.

#define WriteJr3 (   addr,
  data 
)    WriteJr3Dm((addr) | Jr3DmAddrMask,data)

Definition at line 60 of file jr3_driver.cpp.

#define WriteJr3Dm (   addr,
  data 
)    *(int volatile *)(ToJr3PciAddrH((addr))) = (int)(data)

Definition at line 56 of file jr3_driver.cpp.

#define WriteJr3Pm (   addr,
  data 
)    WriteJr3Pm2((addr),(data) >> 8, (data))

Definition at line 52 of file jr3_driver.cpp.

#define WriteJr3Pm2 (   addr,
  data,
  data2 
)    (*(int volatile *)ToJr3PciAddrH((addr)) = (int)(data));(*(int volatile *)ToJr3PciAddrL((addr)) = (int)(data2))

Definition at line 50 of file jr3_driver.cpp.

Enumeration Type Documentation

Enumerator
lbs_in_lbs_mils 
N_dNm_mm10 
kgf10_kgFcm_mm10 
klbs_kin_lbs_mils 
reserved_units_4 
reserved_units_5 
reserved_units_6 
reserved_units_7 

Definition at line 174 of file jr3_driver.cpp.

enum link_types
Enumerator
end_x_form 
tx 
ty 
tz 
rx 
ry 
rz 
neg 

Definition at line 206 of file jr3_driver.cpp.

Function Documentation

int download ( unsigned int  base0,
unsigned int  base1 
)

Definition at line 329 of file jr3_driver.cpp.

void get_force_sensor_info ( force_sensor_data data,
char *  msg 
)

Definition at line 389 of file jr3_driver.cpp.

int io_read ( resmgr_context_t *  ctp,
io_read_t *  msg,
RESMGR_OCB_T *  ocb 
)

Definition at line 639 of file jr3_driver.cpp.

int main ( int  argc,
char **  argv 
)

Definition at line 506 of file jr3_driver.cpp.

int message_callback ( message_context_t *  ctp,
int  type,
unsigned  flags,
void handle 
)

Definition at line 430 of file jr3_driver.cpp.

void wait_t ( void  )

Definition at line 693 of file jr3_driver.cpp.

Variable Documentation

char* buffer = (char *) "Hello world\n"
static

Definition at line 25 of file jr3_driver.cpp.

resmgr_connect_funcs_t ConnectFuncs
static

Definition at line 62 of file jr3_driver.cpp.

char* force_units_str[]
Initial value:
=
{ (char *) "pound, inch*pound, inch*1000",
(char *) "Newton, Newton*meter*10, mm*10",
(char *) "kilogram-force*10, kilogram-Force*cm, mm*10",
(char *) "kilopound, kiloinch*pound, inch*1000" }

Definition at line 167 of file jr3_driver.cpp.

iofunc_attr_t IoFuncAttr
static

Definition at line 64 of file jr3_driver.cpp.

resmgr_io_funcs_t IoFuncs
static

Definition at line 63 of file jr3_driver.cpp.

volatile uint32_t Jr3BaseAddress0H

Definition at line 69 of file jr3_driver.cpp.

volatile uint32_t Jr3BaseAddress0L

Definition at line 70 of file jr3_driver.cpp.

volatile uint32_t Jr3BaseAddress1H

Definition at line 71 of file jr3_driver.cpp.

volatile uint32_t Jr3BaseAddress1L

Definition at line 72 of file jr3_driver.cpp.

volatile uint32_t Jr3BaseAddressH

Definition at line 67 of file jr3_driver.cpp.

volatile uint32_t Jr3BaseAddressL

Definition at line 68 of file jr3_driver.cpp.

unsigned long MappedAddress

Definition at line 40 of file jr3_driver.cpp.



hironx_ros_bridge
Author(s): Kei Okada , Isaac I.Y. Saito
autogenerated on Thu May 14 2020 03:52:05