Revision 26dead12 include/DW1000/v1/deca_instance_v1.h

View differences:

include/DW1000/v1/deca_instance_v1.h
151 151
#define RX_RESPONSE1_TURNAROUND_6M81 (300) //takes about 100 us for response to come back
152 152
#define RX_RESPONSE1_TURNAROUND_110K (300) //takes about 100 us for response to come back
153 153

  
154
  /* For TAG HAL F1 */
155
  //#define RX_RESPONSE1_TURNAROUND (200) //takes about 200 us for the 1st response to come back (from A0)
156
  //#define RX_RESPONSE1_TURNAROUND_6M81 (300) //takes about 100 us for response to come back
157
  //#define RX_RESPONSE1_TURNAROUND_110K (18700) //takes about 100 us for response to come back
158

  
159
  /* For ANCHOR HAL F1 */
160
  //#define RX_RESPONSE1_TURNAROUND (300) //takes about 200 us for the 1st response to come back (from A0)
161
  //#define RX_RESPONSE1_TURNAROUND_6M81 (300) //takes about 100 us for response to come back
162
  //#define RX_RESPONSE1_TURNAROUND_110K (4700) //takes about 100 us for response to come back
163

  
164 154
  //Tag will range to 3 or 4 anchors
165 155
  //Each ranging exchange will consist of minimum of 3 messages (Poll, Response, Final)
166 156
  //and a maximum of 6 messages (Poll, Response x 4, Final)
......
248 238
    uint8_t fcs[2] ;                              	//  125-126  we allow space for the CRC as it is logically part of the message. However ScenSor TX calculates and adds these bytes.
249 239
  } srd_msg_dssl ;
250 240

  
251
  typedef struct
241
  typedef struct  __attribute__((packed))
252 242
  {
253 243
    uint8_t channelNumber ;       // valid range is 1 to 11
254 244
    uint8_t preambleCode ;        // 00 = use NS code, 1 to 24 selects code
......
279 269
  //in turn and the event queued up before the instance processed the TX event.
280 270
#define MAX_EVENT_NUMBER (6)
281 271

  
282
  typedef struct
272
  typedef struct  __attribute__((packed))
283 273
  {
284 274
    uint8_t  type;			// event type - if 0 there is no event in the queue
285 275
    uint8_t  type_save;		// holds the event type - does not clear (used to show what event has been processed)
......
307 297
    uint8_t gotit;			//stores the instance function which processed the event (used for debug)
308 298
  }event_data_t ;
309 299

  
310
extern event_data_t dw_event_g;   // TODO
300
extern event_data_t dw_event_g;
311 301

  
312 302
  // TX power and PG delay configuration structure
313
  typedef struct {
303
  typedef struct  __attribute__((packed)) {
314 304
    uint8_t PGdelay;
315 305

  
316 306
    //TX POWER
......
321 311
    uint32_t txPwr[2]; //
322 312
  }tx_struct;
323 313

  
324
  typedef struct
314
  typedef struct __attribute__((packed))
325 315
  {
326 316
    INST_MODE mode;				//instance mode (tag or anchor)
327 317

  
......
426 416
    int newRange;			//flag set when there is a new range to report TOF_REPORT_A2A or TOF_REPORT_T2A
427 417
    int newRangeAncAddress; //last 4 bytes of anchor address - used for printing/range output display
428 418
    int newRangeTagAddress; //last 4 bytes of tag address - used for printing/range output display
429
    int newRangeTime;
419
    uint32_t newRangeTime;
430 420

  
431 421
    uint8_t gatewayAnchor ; //set to TRUE = 1 if anchor address == GATEWAY_ANCHOR_ADDR
432 422

  
......
470 460
  void instance_close(void);
471 461
  // Call init, then call config, then call run. call close when finished
472 462
  // initialise the instance (application) structures and DW1000 device
473
//  int instance_init(void);
474
  int instance_init(DW1000Driver* drv);     //TODO
463
  int instance_init(DW1000Driver* drv);
475 464

  
476 465
  // configure the instance and DW1000 device
477 466
  void instance_config(instanceConfig_t *config, sfConfig_t *sfconfig, DW1000Driver* drv) ;
......
490 479
  // configure TX/RX callback functions that are called from DW1000 ISR
491 480
  void instance_rxcallback(const dwt_cb_data_t *rxd);
492 481
  void instance_txcallback(const dwt_cb_data_t *txd);
493
  /*TODO: add callbacks */
494 482
  void instance_rxtimeoutcallback(const dwt_cb_data_t *rxd);
495 483
  void instance_rxerrorcallback(const dwt_cb_data_t *rxd);
496 484

  
......
525 513
  int instancenewrangetagadd(void);
526 514
  int instancenewrangepolltim(void);
527 515
  int instancenewrange(void);
528
  int instancenewrangetim(void);
516
  uint32_t instancenewrangetim(void);
529 517

  
530 518
  uint64_t convertmicrosectodevicetimeu (double microsecu);
531 519
  double convertdevicetimetosec(int32_t dt);
......
562 550

  
563 551
  void instance_notify_DW1000_inIDLE(int idle);
564 552

  
565

  
566
  // TODO: The following Functions are added in user applciation (previously on the API )
567

  
568 553
  double dwt_getrangebias(uint8_t chan, float range, uint8_t prf);
569 554

  
570 555
  uint32_t dwt_getotptxpower(uint8_t prf, uint8_t chan);
......
573 558

  
574 559
  uint16_t dwt_readantennadelay(uint8_t prf);
575 560

  
576

  
577
  /* End of user application functions (Previously on API) */
578

  
579

  
580 561
  // configure TX power
581 562
  void instanceconfigtxpower(uint32_t txpower);
582 563
  void instancesettxpower(void);

Also available in: Unified diff