Port of flash_cc2531 to FreeBSD. This is likely more just include a wiringPi compatible library for FreeBSD. Any new files are BSD licensed and NOT GPLv3 license.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

137 regels
2.3 KiB

  1. #ifndef CCDEBUGGER_H
  2. #define CCDEBUGGER_H
  3. #define CC_ERROR_NONE 0
  4. #define CC_ERROR_NOT_ACTIVE 1
  5. #define CC_ERROR_NOT_DEBUGGING 2
  6. #define CC_ERROR_NOT_WIRED 3
  7. // defaŭltaj valoroj por pingloj
  8. // por restarigi al pinglo 35, DC al pinglo 36, DD al pinglo 38
  9. #define PIN_RST 24
  10. #define PIN_DC 27
  11. #define PIN_DD 28
  12. // alternativaj valoroj por pingloj
  13. // por restarigi al pinglo 3, DC al pinglo 11, DD al pinglo 13
  14. // Utila por pi 1.
  15. //#define PIN_RST 8
  16. //#define PIN_DC 0
  17. //#define PIN_DD 2
  18. int cc_init( int pinRST, int pinDC, int pinDD );
  19. void cc_delay( unsigned int d );
  20. void cc_setmult(int mult);
  21. uint8_t cc_error();
  22. void cc_reset();
  23. ////////////////////////////
  24. // High-Level interaction
  25. ////////////////////////////
  26. void cc_setActive( uint8_t on );
  27. /**
  28. * Enter debug mode
  29. */
  30. uint8_t cc_enter();
  31. /**
  32. * Exit from debug mode
  33. */
  34. uint8_t cc_exit();
  35. /**
  36. * Execute a CPU instructuion
  37. */
  38. uint8_t cc_exec( uint8_t oc0 );
  39. uint8_t cc_execi( uint8_t oc0, unsigned short c0 );
  40. uint8_t cc_exec2( uint8_t oc0, uint8_t oc1 );
  41. uint8_t cc_exec3( uint8_t oc0, uint8_t oc1, uint8_t oc2 );
  42. /**
  43. * Return chip ID
  44. */
  45. unsigned short cc_getChipID();
  46. /**
  47. * Return PC
  48. */
  49. unsigned short cc_getPC();
  50. /**
  51. * Return debug status
  52. */
  53. uint8_t cc_getStatus();
  54. /**
  55. * resume program exec
  56. */
  57. uint8_t cc_resume();
  58. /**
  59. * halt program exec
  60. */
  61. uint8_t cc_halt();
  62. /**
  63. * Step a single instruction
  64. */
  65. uint8_t cc_step();
  66. /**
  67. * Get debug configuration
  68. */
  69. uint8_t cc_getConfig();
  70. /**
  71. * Set debug configuration
  72. */
  73. uint8_t cc_setConfig( uint8_t config );
  74. /**
  75. * Massive erasure on the chip
  76. */
  77. uint8_t cc_chipErase();
  78. ////////////////////////////
  79. // Low-level interaction
  80. ////////////////////////////
  81. /**
  82. * Write to the debugger
  83. */
  84. uint8_t cc_write( uint8_t data );
  85. /**
  86. * Wait until we are ready to read & Switch to read mode
  87. */
  88. uint8_t cc_switchRead( uint8_t maxWaitCycles );
  89. /**
  90. * Switch to write mode
  91. */
  92. uint8_t cc_switchWrite();
  93. /**
  94. * Read from the debugger
  95. */
  96. uint8_t cc_read();
  97. /**
  98. * Update the debug instruction table
  99. */
  100. uint8_t cc_updateInstructionTable( uint8_t newTable[16] );
  101. /**
  102. * Get the instruction table version
  103. */
  104. uint8_t cc_getInstructionTableVersion();
  105. #endif