cc26xx_cc13xx_hard_api.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Locha Inc
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
9 #pragma once
10 
21 #include "cc26xx_cc13xx.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
30 typedef struct {
32  uint32_t (* crc32)(uint8_t *data, uint32_t bytecount, uint32_t repeatcount);
33  uint32_t (* get_fl_size)(void);
34  uint32_t (* get_chip_id)(void);
35  uint32_t (* __reserved0)(uint32_t);
36  uint32_t (* __reserved1)(void);
37  uint32_t (* __reserved2)(uint8_t *, uint32_t, uint32_t);
38  void (* resetdev)(void);
39  uint32_t (* fletcher32)(uint16_t *data, uint16_t wordcount,
40  uint16_t repeatcount);
42  uint32_t (* min_val)(uint32_t *buffer, uint32_t datacount);
44  uint32_t (* max_val)(uint32_t *databuffer, uint32_t datacount);
46  uint32_t (* mean_val)(uint32_t *databuffer, uint32_t datacount);
48  uint32_t (* stdd_val)(uint32_t *databuffer, uint32_t datacount);
49  void (* hf_source_safe_switch)(void);
50  void (* __reserved3)(uint32_t);
51  void (* __reserved4)(uint32_t);
52  void (* compa_in)(uint8_t signal);
53  void (* compa_ref)(uint8_t signal);
54  void (* adc_compb_in)(uint8_t signal);
55 #ifdef CPU_VARIANT_X2
56  void (* dac_vref)(uint8_t signal);
57 #else
58  void (* compb_ref)(uint8_t signal);
59 #endif
60 } hard_api_t;
61 
65 #define HARD_API ((hard_api_t *) ROM_HARD_API_BASE)
66 
71 #define rom_hapi_crc32(a, b, c) (HARD_API->crc32((a), (b), (c)))
72 #define rom_hapi_get_flashsize() (HARD_API->get_fl_size())
73 #define rom_hapi_get_chipid() (HARD_API->get_chip_id())
74 #define rom_hapi_reset_device() (HARD_API->resetdev())
75 #define rom_hapi_fletcher32(a, b, c) (HARD_API->fletcher32((a), (b), (c)))
76 #define rom_hapi_min_value(a, b) (HARD_API->min_val((a), (b)))
77 #define rom_hapi_max_value(a, b) (HARD_API->max_val((a), (b)))
78 #define rom_hapi_mean_value(a, b) (HARD_API->mean_val((a), (b)))
79 #define rom_hapi_std_deviation_value(a, b) (HARD_API->stdd_val((a), (b)))
80 #define rom_hapi_hf_source_safe_switch() (HARD_API->hf_source_safe_switch())
81 #define rom_hapi_select_compa_input(a) (HARD_API->compa_in((a)))
82 #define rom_hapi_select_compa_ref(a) (HARD_API->compa_ref((a)))
83 #define rom_hapi_select_adc_compb_input(a) (HARD_API->adc_compb_in((a)))
84 #ifdef CPU_VARIANT_X2
85 #define rom_hapi_select_dac_vref(a) (HARD_API->dac_vref((a)))
86 #else
87 #define rom_hapi_select_compb_ref(a) (HARD_API->compb_vref((a)))
88 #endif
91 #ifdef __cplusplus
92 }
93 #endif
94 
CC26xx, CC13xx definitions.
uint32_t crc32(const void *buf, size_t size)
CRC-32 checksum.
uint32_t fletcher32(const uint16_t *buf, size_t words)
Fletcher's 32 bit checksum.
ROM Hard-API.