blackhawk_tsc_access.h (28075B)
1 /***************************************************************************************** 2 ***************************************************************************************** 3 * * 4 * Revision : * 5 * * 6 * Description : Functions used internally and available in debug shell only * 7 * * 8 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 9 * 10 * Copyright 2007-2019 Broadcom Inc. All rights reserved. * 11 * No portions of this material may be reproduced in any form without * 12 * the written permission of: * 13 * Broadcom Corporation * 14 * 5300 California Avenue * 15 * Irvine, CA 92617 * 16 * * 17 * All information contained in this document is Broadcom Corporation * 18 * company private proprietary, and trade secret. * 19 */ 20 21 /** @file blackhawk_tsc_access.h 22 * Implementation of API uC access functions 23 */ 24 25 #ifndef BLACKHAWK_TSC_API_ACCESS_H 26 #define BLACKHAWK_TSC_API_ACCESS_H 27 28 #include "blackhawk_tsc_ipconfig.h" 29 #include "common/srds_api_err_code.h" 30 #include "common/srds_api_uc_common.h" 31 #include "common/srds_api_types.h" 32 #include "blackhawk_tsc_usr_includes.h" 33 34 typedef struct { 35 uint32_t ucode_size; 36 uint16_t stack_size; 37 uint16_t crc_value; 38 } ucode_info_t; 39 40 /*---------------------------------------------*/ 41 /* Serdes IP RAM access - Lane RAM Variables */ 42 /*---------------------------------------------*/ 43 /* rd - read; wr - write */ 44 /* b - byte; w - word */ 45 /* l - lane; c - core */ 46 /* uc - micro */ 47 /* s - signed */ 48 /*---------------------------------------------*/ 49 /** Unsigned Byte Read of a uC RAM Lane variable. 50 * Read access through Micro Register Interface for PMD IPs; through Serdes FW DSC Command Interface for external micro IPs. 51 * @param sa__ is an opaque state vector passed through to device access functions. 52 * @param *err_code Error Code generated by API (returns ERR_CODE_NONE if no errors) 53 * @param addr Address of RAM lane variable to be read 54 * @return 8bit unsigned value read from uC RAM 55 */ 56 uint8_t blackhawk_tsc_rdbl_uc_var(srds_access_t *sa__, err_code_t *err_code, uint16_t addr); 57 58 /** Unsigned Word Read of a uC RAM Lane variable. 59 * Read access through Micro Register Interface for PMD IPs; through Serdes FW DSC Command Interface for external micro IPs. 60 * @param sa__ is an opaque state vector passed through to device access functions. 61 * @param *err_code Error Code generated by API (returns ERR_CODE_NONE if no errors) 62 * @param addr Address of RAM lane variable to be read 63 * @return 16bit unsigned value read from uC RAM 64 */ 65 uint16_t blackhawk_tsc_rdwl_uc_var(srds_access_t *sa__, err_code_t *err_code, uint16_t addr); 66 67 /** Unsigned Byte Write of a uC RAM Lane variable. 68 * Write access through Micro Register Interface for PMD IPs; through Serdes FW DSC Command Interface for external micro IPs. 69 * @param sa__ is an opaque state vector passed through to device access functions. 70 * @param addr Address of RAM lane variable to be written 71 * @param wr_val 8bit unsigned value to be written to RAM variable 72 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 73 */ 74 err_code_t blackhawk_tsc_wrbl_uc_var(srds_access_t *sa__, uint16_t addr, uint8_t wr_val); 75 76 /** Unsigned Word Write of a uC RAM Lane variable. 77 * Write access through Micro Register Interface for PMD IPs; through Serdes FW DSC Command Interface for external micro IPs. 78 * @param sa__ is an opaque state vector passed through to device access functions. 79 * @param addr Address of RAM lane variable to be written 80 * @param wr_val 16bit unsigned value to be written to RAM variable 81 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 82 */ 83 err_code_t blackhawk_tsc_wrwl_uc_var(srds_access_t *sa__, uint16_t addr, uint16_t wr_val); 84 85 86 /* Signed version of above 4 functions */ 87 88 /** Signed Byte Read of a uC RAM Lane variable. 89 * Read access through Micro Register Interface for PMD IPs; through Serdes FW DSC Command Interface for external micro IPs. 90 * @param sa__ is an opaque state vector passed through to device access functions. 91 * @param *err_code Error Code generated by API (returns ERR_CODE_NONE if no errors) 92 * @param addr Address of RAM lane variable to be read 93 * @return 8bit signed value read from uC RAM 94 */ 95 int8_t blackhawk_tsc_rdbls_uc_var(srds_access_t *sa__, err_code_t *err_code, uint16_t addr); 96 97 /** Signed Word Read of a uC RAM Lane variable. 98 * Read access through Micro Register Interface for PMD IPs; through Serdes FW DSC Command Interface for external micro IPs. 99 * @param sa__ is an opaque state vector passed through to device access functions. 100 * @param *err_code Error Code generated by API (returns ERR_CODE_NONE if no errors) 101 * @param addr Address of RAM lane variable to be read 102 * @return 16bit signed value read from uC RAM 103 */ 104 int16_t blackhawk_tsc_rdwls_uc_var(srds_access_t *sa__, err_code_t *err_code, uint16_t addr); 105 106 /** Signed Byte Write of a uC RAM Lane variable. 107 * Write access through Micro Register Interface for PMD IPs; through Serdes FW DSC Command Interface for external micro IPs. 108 * @param sa__ is an opaque state vector passed through to device access functions. 109 * @param addr Address of RAM lane variable to be written 110 * @param wr_val 8bit signed value to be written to RAM variable 111 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 112 */ 113 err_code_t blackhawk_tsc_wrbls_uc_var(srds_access_t *sa__, uint16_t addr, int8_t wr_val); 114 115 /** Signed Word Write of a uC RAM Lane variable. 116 * Write access through Micro Register Interface for PMD IPs; through Serdes FW DSC Command Interface for external micro IPs. 117 * @param sa__ is an opaque state vector passed through to device access functions. 118 * @param addr Address of RAM lane variable to be written 119 * @param wr_val 16bit signed value to be written to RAM variable 120 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 121 */ 122 err_code_t blackhawk_tsc_wrwls_uc_var(srds_access_t *sa__, uint16_t addr, int16_t wr_val); 123 124 125 126 /*---------------------------------------------*/ 127 /* Serdes IP RAM access - Micro RAM Variables */ 128 /*---------------------------------------------*/ 129 /** Unsigned Byte Read of a uC RAM Micro variable. 130 * Read access through Micro Register Interface for PMD IPs; through Serdes FW DSC Command Interface for external micro IPs. 131 * @param sa__ is an opaque state vector passed through to device access functions. 132 * @param *err_code Error Code generated by API (returns ERR_CODE_NONE if no errors) 133 * @param addr Address of RAM Micro variable to be read 134 * @return 8bit unsigned value read from uC RAM 135 */ 136 uint8_t blackhawk_tsc_rdbuc_uc_var(srds_access_t *sa__, err_code_t *err_code, uint16_t addr); 137 138 /** Unsigned Word Read of a uC RAM Micro variable. 139 * Read access through Micro Register Interface for PMD IPs; through Serdes FW DSC Command Interface for external micro IPs. 140 * @param sa__ is an opaque state vector passed through to device access functions. 141 * @param *err_code Error Code generated by API (returns ERR_CODE_NONE if no errors) 142 * @param addr Address of RAM micro variable to be read 143 * @return 16bit unsigned value read from uC RAM 144 */ 145 uint16_t blackhawk_tsc_rdwuc_uc_var(srds_access_t *sa__, err_code_t *err_code, uint16_t addr); 146 147 /** Unsigned Byte Write of a uC RAM Micro variable. 148 * Write access through Micro Register Interface for PMD IPs; through Serdes FW DSC Command Interface for external micro IPs. 149 * @param sa__ is an opaque state vector passed through to device access functions. 150 * @param addr Address of RAM micro variable to be written 151 * @param wr_val 8bit unsigned value to be written to RAM variable 152 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 153 */ 154 err_code_t blackhawk_tsc_wrbuc_uc_var(srds_access_t *sa__, uint16_t addr, uint8_t wr_val); 155 156 /** Unsigned Word Write of a uC RAM Micro variable. 157 * Write access through Micro Register Interface for PMD IPs; through Serdes FW DSC Command Interface for external micro IPs. 158 * @param sa__ is an opaque state vector passed through to device access functions. 159 * @param addr Address of RAM micro variable to be written 160 * @param wr_val 16bit unsigned value to be written to RAM variable 161 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 162 */ 163 err_code_t blackhawk_tsc_wrwuc_uc_var(srds_access_t *sa__, uint16_t addr, uint16_t wr_val); 164 165 166 /* Signed version of above 4 functions */ 167 168 /** Signed Byte Read of a uC RAM Micro variable. 169 * Read access through Micro Register Interface for PMD IPs; through Serdes FW DSC Command Interface for external micro IPs. 170 * @param sa__ is an opaque state vector passed through to device access functions. 171 * @param *err_code Error Code generated by API (returns ERR_CODE_NONE if no errors) 172 * @param addr Address of RAM micro variable to be read 173 * @return 8bit signed value read from uC RAM 174 */ 175 int8_t blackhawk_tsc_rdbucs_uc_var(srds_access_t *sa__, err_code_t *err_code, uint16_t addr); 176 177 /** Signed Word Read of a uC RAM Micro variable. 178 * Read access through Micro Register Interface for PMD IPs; through Serdes FW DSC Command Interface for external micro IPs. 179 * @param sa__ is an opaque state vector passed through to device access functions. 180 * @param *err_code Error Code generated by API (returns ERR_CODE_NONE if no errors) 181 * @param addr Address of RAM micro variable to be read 182 * @return 16bit signed value read from uC RAM 183 */ 184 int16_t blackhawk_tsc_rdwucs_uc_var(srds_access_t *sa__, err_code_t *err_code, uint16_t addr); 185 186 /** Signed Byte Write of a uC RAM Micro variable. 187 * Write access through Micro Register Interface for PMD IPs; through Serdes FW DSC Command Interface for external micro IPs. 188 * @param sa__ is an opaque state vector passed through to device access functions. 189 * @param addr Address of RAM micro variable to be written 190 * @param wr_val 8bit signed value to be written to RAM variable 191 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 192 */ 193 err_code_t blackhawk_tsc_wrbucs_uc_var(srds_access_t *sa__, uint16_t addr, int8_t wr_val); 194 195 /** Signed Word Write of a uC RAM Micro variable. 196 * Write access through Micro Register Interface for PMD IPs; through Serdes FW DSC Command Interface for external micro IPs. 197 * @param sa__ is an opaque state vector passed through to device access functions. 198 * @param addr Address of RAM micro variable to be written 199 * @param wr_val 16bit signed value to be written to RAM variable 200 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 201 */ 202 err_code_t blackhawk_tsc_wrwucs_uc_var(srds_access_t *sa__, uint16_t addr, int16_t wr_val); 203 204 205 /*---------------------------------------------*/ 206 /* Serdes IP RAM access - Core RAM Variables */ 207 /*---------------------------------------------*/ 208 /** Unsigned Byte Read of a uC RAM Core variable. 209 * Read access through Micro Register Interface for PMD IPs; through Serdes FW DSC Command Interface for external micro IPs. 210 * @param sa__ is an opaque state vector passed through to device access functions. 211 * @param *err_code Error Code generated by API (returns ERR_CODE_NONE if no errors) 212 * @param addr Address of RAM core variable to be read 213 * @return 8bit unsigned value read from uC RAM 214 */ 215 uint8_t blackhawk_tsc_rdbc_uc_var(srds_access_t *sa__, err_code_t *err_code, uint8_t addr); 216 217 /** Unsigned Word Read of a uC RAM Core variable. 218 * Read access through Micro Register Interface for PMD IPs; through Serdes FW DSC Command Interface for external micro IPs. 219 * @param sa__ is an opaque state vector passed through to device access functions. 220 * @param *err_code Error Code generated by API (returns ERR_CODE_NONE if no errors) 221 * @param addr Address of RAM core variable to be read 222 * @return 16bit unsigned value read from uC RAM 223 */ 224 uint16_t blackhawk_tsc_rdwc_uc_var(srds_access_t *sa__, err_code_t *err_code, uint8_t addr); 225 226 /** Unsigned Byte Write of a uC RAM Core variable. 227 * Write access through Micro Register Interface for PMD IPs; through Serdes FW DSC Command Interface for external micro IPs. 228 * @param sa__ is an opaque state vector passed through to device access functions. 229 * @param addr Address of RAM core variable to be written 230 * @param wr_val 8bit unsigned value to be written to RAM variable 231 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 232 */ 233 err_code_t blackhawk_tsc_wrbc_uc_var(srds_access_t *sa__, uint8_t addr, uint8_t wr_val); 234 235 /** Unsigned Word Write of a uC RAM Core variable. 236 * Write access through Micro Register Interface for PMD IPs; through Serdes FW DSC Command Interface for external micro IPs. 237 * @param sa__ is an opaque state vector passed through to device access functions. 238 * @param addr Address of RAM core variable to be written 239 * @param wr_val 16bit unsigned value to be written to RAM variable 240 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 241 */ 242 err_code_t blackhawk_tsc_wrwc_uc_var(srds_access_t *sa__, uint8_t addr, uint16_t wr_val); 243 244 245 /* Signed version of above 4 functions */ 246 247 /** Signed Byte Read of a uC RAM Core variable. 248 * Read access through Micro Register Interface for PMD IPs; through Serdes FW DSC Command Interface for external micro IPs. 249 * @param sa__ is an opaque state vector passed through to device access functions. 250 * @param *err_code Error Code generated by API (returns ERR_CODE_NONE if no errors) 251 * @param addr Address of RAM core variable to be read 252 * @return 8bit signed value read from uC RAM 253 */ 254 int8_t blackhawk_tsc_rdbcs_uc_var(srds_access_t *sa__, err_code_t *err_code, uint8_t addr); 255 256 /** Signed Word Read of a uC RAM Core variable. 257 * Read access through Micro Register Interface for PMD IPs; through Serdes FW DSC Command Interface for external micro IPs. 258 * @param sa__ is an opaque state vector passed through to device access functions. 259 * @param *err_code Error Code generated by API (returns ERR_CODE_NONE if no errors) 260 * @param addr Address of RAM core variable to be read 261 * @return 16bit signed value read from uC RAM 262 */ 263 int16_t blackhawk_tsc_rdwcs_uc_var(srds_access_t *sa__, err_code_t *err_code, uint8_t addr); 264 265 /** Signed Byte Write of a uC RAM Core variable. 266 * Write access through Micro Register Interface for PMD IPs; through Serdes FW DSC Command Interface for external micro IPs. 267 * @param sa__ is an opaque state vector passed through to device access functions. 268 * @param addr Address of RAM core variable to be written 269 * @param wr_val 8bit signed value to be written to RAM variable 270 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 271 */ 272 err_code_t blackhawk_tsc_wrbcs_uc_var(srds_access_t *sa__, uint8_t addr, int8_t wr_val); 273 274 /** Signed Word Write of a uC RAM Core variable. 275 * Write access through Micro Register Interface for PMD IPs; through Serdes FW DSC Command Interface for external micro IPs. 276 * @param sa__ is an opaque state vector passed through to device access functions. 277 * @param addr Address of RAM core variable to be written 278 * @param wr_val 16bit signed value to be written to RAM variable 279 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 280 */ 281 err_code_t blackhawk_tsc_wrwcs_uc_var(srds_access_t *sa__, uint8_t addr, int16_t wr_val); 282 283 284 /*---------------------------------------------------*/ 285 /* Micro Commands through uC DSC Command Interface */ 286 /*---------------------------------------------------*/ 287 /** Issue a Micro command through the uC DSC Command Interface and return control immediately. 288 * @param sa__ is an opaque state vector passed through to device access functions. 289 * @param cmd Micro command to be issued 290 * @param supp_info Supplement information for the Micro command to be issued (RAM read/write address or Micro Control command) 291 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 292 */ 293 err_code_t blackhawk_tsc_pmd_uc_cmd_return_immediate(srds_access_t *sa__, enum srds_pmd_uc_cmd_enum cmd, uint8_t supp_info); 294 295 /** Issue a Micro command through the uC DSC Command Interface. Control returned only after command is finished. 296 * @param sa__ is an opaque state vector passed through to device access functions. 297 * @param cmd Micro command to be issued 298 * @param supp_info Supplement information for the Micro command to be issued (RAM read/write address or Micro Control command) 299 * @param timeout_ms Time interval in milliseconds inside which the command should be completed; else error issued 300 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 301 */ 302 err_code_t blackhawk_tsc_pmd_uc_cmd(srds_access_t *sa__, enum srds_pmd_uc_cmd_enum cmd, uint8_t supp_info, uint32_t timeout_ms); 303 304 /** Issue a Micro command with data through the uC DSC Command Interface and return control immediately. 305 * @param sa__ is an opaque state vector passed through to device access functions. 306 * @param cmd Micro command to be issued 307 * @param supp_info Supplement information for the Micro command to be issued (RAM write address) 308 * @param data Data to be written to dsc_data for use by uC 309 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 310 */ 311 err_code_t blackhawk_tsc_pmd_uc_cmd_with_data_return_immediate(srds_access_t *sa__, enum srds_pmd_uc_cmd_enum cmd, uint8_t supp_info, uint16_t data); 312 313 /** Issue a Micro command with data through the uC DSC Command Interface. Control returned only after command is finished. 314 * @param sa__ is an opaque state vector passed through to device access functions. 315 * @param cmd Micro command to be issued 316 * @param supp_info Supplement information for the Micro command to be issued (RAM write address) 317 * @param data Data to be written to dsc_data for use by uC 318 * @param timeout_ms Time interval in milliseconds inside which the command should be completed; else error issued 319 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 320 */ 321 err_code_t blackhawk_tsc_pmd_uc_cmd_with_data(srds_access_t *sa__, enum srds_pmd_uc_cmd_enum cmd, uint8_t supp_info, uint16_t data, uint32_t timeout_ms); 322 323 /** Issue a Micro Control command through the uC DSC Command Interface and return control immediately. 324 * @param sa__ is an opaque state vector passed through to device access functions. 325 * @param control Micro Control command to be issued 326 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 327 */ 328 err_code_t blackhawk_tsc_pmd_uc_control_return_immediate(srds_access_t *sa__, enum srds_pmd_uc_ctrl_cmd_enum control); 329 330 /** Issue a Micro Control command through the uC DSC Command Interface. Control returned only after command is finished. 331 * @param sa__ is an opaque state vector passed through to device access functions. 332 * @param control Micro Control command to be issued 333 * @param timeout_ms Time interval in milliseconds inside which the command should be completed; else error issued 334 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 335 */ 336 err_code_t blackhawk_tsc_pmd_uc_control(srds_access_t *sa__, enum srds_pmd_uc_ctrl_cmd_enum control, uint32_t timeout_ms); 337 338 /** Issue a Micro Control command through the uC DSC DIAG_EN Command Interface. Control returned only after command is finished. 339 * @param sa__ is an opaque state vector passed through to device access functions. 340 * @param control Micro DIAG Control command to be issued 341 * @param timeout_ms Time interval in milliseconds inside which the command should be completed; else error issued 342 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 343 */ 344 err_code_t blackhawk_tsc_pmd_uc_diag_cmd(srds_access_t *sa__, enum srds_pmd_uc_diag_cmd_enum control, uint32_t timeout_ms); 345 346 /*-------------------------------------------------------*/ 347 /* Program RAM access through Micro Register Interface */ 348 /*-------------------------------------------------------*/ 349 350 /** Unsigned Long Read of a uC Program RAM variable through Micro Register Interface. 351 * @param *err_code Error Code generated by API (returns ERR_CODE_NONE if no errors) 352 * @param sa__ is an opaque state vector passed through to device access functions. 353 * @param addr Address of Program RAM variable to be read 354 * @return 32bit unsigned value read from uC Program RAM 355 */ 356 uint32_t blackhawk_tsc_rd_long_uc_prog_ram(srds_access_t *sa__, err_code_t *err_code, uint16_t addr); 357 358 /** Block uC Program RAM read through Micro Register Interface. 359 * @param sa__ is an opaque state vector passed through to device access functions. 360 * @param *mem Pointer to memory location where the read values from the Block RAM read should be stored 361 * @param addr Starting Address of Program RAM block to be read 362 * @param cnt Number of byte locations to be read from the block 363 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 364 */ 365 err_code_t blackhawk_tsc_rdblk_uc_prog_ram(srds_access_t *sa__, uint8_t *mem, uint16_t addr, uint16_t cnt); 366 367 /*-----------------------------------------------*/ 368 /* RAM access through Micro Register Interface */ 369 /*-----------------------------------------------*/ 370 /* rd - read; wr - write */ 371 /* b - byte; w - word */ 372 /* l - lane; c - core */ 373 /* s - signed */ 374 /*-----------------------------------------------*/ 375 376 /** Unsigned Long Write of a uC RAM variable through Micro Register Interface. 377 * @param sa__ is an opaque state vector passed through to device access functions. 378 * @param addr Address of RAM variable to be written 379 * @param wr_val 32bit unsigned value to be written to RAM variable 380 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 381 */ 382 err_code_t blackhawk_tsc_wr_long_uc_ram(srds_access_t *sa__, uint16_t addr, uint32_t wr_val); 383 384 /** Unsigned Word Write of a uC RAM variable through Micro Register Interface. 385 * @param sa__ is an opaque state vector passed through to device access functions. 386 * @param addr Address of RAM variable to be written 387 * @param wr_val 16bit unsigned value to be written to RAM variable 388 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 389 */ 390 err_code_t blackhawk_tsc_wrw_uc_ram(srds_access_t *sa__, uint16_t addr, uint16_t wr_val); 391 392 /** Unsigned Byte Write of a uC RAM variable through Micro Register Interface. 393 * @param sa__ is an opaque state vector passed through to device access functions. 394 * @param addr Address of RAM variable to be written 395 * @param wr_val 8bit unsigned value to be written to RAM variable 396 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 397 */ 398 err_code_t blackhawk_tsc_wrb_uc_ram(srds_access_t *sa__, uint16_t addr, uint8_t wr_val); 399 400 /** Unigned Long Read of a uC RAM variable through Micro Register Interface. 401 * @param sa__ is an opaque state vector passed through to device access functions. 402 * @param *err_code Error Code generated by API (returns ERR_CODE_NONE if no errors) 403 * @param addr Address of RAM variable to be read 404 * @return 32bit unsigned value read from uC RAM 405 */ 406 uint32_t blackhawk_tsc_rd_long_uc_ram(srds_access_t *sa__, err_code_t *err_code, uint16_t addr); 407 408 /** Unigned Word Read of a uC RAM variable through Micro Register Interface. 409 * @param sa__ is an opaque state vector passed through to device access functions. 410 * @param *err_code Error Code generated by API (returns ERR_CODE_NONE if no errors) 411 * @param addr Address of RAM variable to be read 412 * @return 16bit unsigned value read from uC RAM 413 */ 414 uint16_t blackhawk_tsc_rdw_uc_ram(srds_access_t *sa__, err_code_t *err_code, uint16_t addr); 415 416 /** Unigned Byte Read of a uC RAM variable through Micro Register Interface. 417 * @param sa__ is an opaque state vector passed through to device access functions. 418 * @param *err_code Error Code generated by API (returns ERR_CODE_NONE if no errors) 419 * @param addr Address of RAM variable to be read 420 * @return 8bit unsigned value read from uC RAM 421 */ 422 uint8_t blackhawk_tsc_rdb_uc_ram(srds_access_t *sa__, err_code_t *err_code, uint16_t addr); 423 424 425 /* Signed versions of above 4 functions */ 426 427 /** Signed Word Write of a uC RAM variable through Micro Register Interface. 428 * @param sa__ is an opaque state vector passed through to device access functions. 429 * @param addr Address of RAM variable to be written 430 * @param wr_val 16bit signed value to be written to RAM variable 431 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 432 */ 433 err_code_t blackhawk_tsc_wrws_uc_ram(srds_access_t *sa__, uint16_t addr, int16_t wr_val); 434 435 /** Signed Byte Write of a uC RAM variable through Micro Register Interface. 436 * @param sa__ is an opaque state vector passed through to device access functions. 437 * @param addr Address of RAM variable to be written 438 * @param wr_val 8bit signed value to be written to RAM variable 439 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 440 */ 441 err_code_t blackhawk_tsc_wrbs_uc_ram(srds_access_t *sa__, uint16_t addr, int8_t wr_val); 442 443 /** Signed Word Read of a uC RAM variable through Micro Register Interface. 444 * @param sa__ is an opaque state vector passed through to device access functions. 445 * @param *err_code Error Code generated by API (returns ERR_CODE_NONE if no errors) 446 * @param addr Address of RAM variable to be read 447 * @return 16bit signed value read from uC RAM 448 */ 449 int16_t blackhawk_tsc_rdws_uc_ram(srds_access_t *sa__, err_code_t *err_code, uint16_t addr); 450 451 /** Signed Byte Read of a uC RAM variable through Micro Register Interface. 452 * @param sa__ is an opaque state vector passed through to device access functions. 453 * @param *err_code Error Code generated by API (returns ERR_CODE_NONE if no errors) 454 * @param addr Address of RAM variable to be read 455 * @return 8bit signed value read from uC RAM 456 */ 457 int8_t blackhawk_tsc_rdbs_uc_ram(srds_access_t *sa__, err_code_t *err_code, uint16_t addr); 458 459 /** Block RAM read through Micro Register Interface. 460 * @param sa__ is an opaque state vector passed through to device access functions. 461 * @param *mem Pointer to memory location where the read values from the Block RAM read should be stored 462 * @param addr Starting Address of RAM block to be read 463 * @param cnt Number of byte locations to be read from the block 464 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 465 */ 466 err_code_t blackhawk_tsc_rdblk_uc_ram(srds_access_t *sa__, uint8_t *mem, uint16_t addr, uint16_t cnt); 467 468 /*-----------------------*/ 469 /* Temperature reading */ 470 /*-----------------------*/ 471 472 /** Read die temperature in degrees Ceisius (as integer) 473 * @param sa__ is an opaque state vector passed through to device access functions. 474 * @param *die_temp Die temperature in degrees Celsius 475 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 476 */ 477 err_code_t blackhawk_tsc_read_die_temperature (srds_access_t *sa__, int16_t *die_temp); 478 479 /** Read die temperature in degrees Ceisius (as double) 480 * @param sa__ is an opaque state vector passed through to device access functions. 481 * @param *die_temp Die temperature in degrees Celsius (as double) 482 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 483 */ 484 err_code_t blackhawk_tsc_read_die_temperature_double (srds_access_t *sa__, USR_DOUBLE *die_temp); 485 486 #endif