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 
19 #ifndef CC26XX_CC13XX_HARD_API_H
20 #define CC26XX_CC13XX_HARD_API_H
21 
22 #include "cc26xx_cc13xx.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
31 typedef struct {
33  uint32_t (* crc32)(uint8_t *data, uint32_t bytecount, uint32_t repeatcount);
34  uint32_t (* get_fl_size)(void);
35  uint32_t (* get_chip_id)(void);
36  uint32_t (* __reserved0)(uint32_t);
37  uint32_t (* __reserved1)(void);
38  uint32_t (* __reserved2)(uint8_t *, uint32_t, uint32_t);
39  void (* resetdev)(void);
40  uint32_t (* fletcher32)(uint16_t *data, uint16_t wordcount,
41  uint16_t repeatcount);
43  uint32_t (* min_val)(uint32_t *buffer, uint32_t datacount);
45  uint32_t (* max_val)(uint32_t *databuffer, uint32_t datacount);
47  uint32_t (* mean_val)(uint32_t *databuffer, uint32_t datacount);
49  uint32_t (* stdd_val)(uint32_t *databuffer, uint32_t datacount);
50  void (* hf_source_safe_switch)(void);
51  void (* __reserved3)(uint32_t);
52  void (* __reserved4)(uint32_t);
53  void (* compa_in)(uint8_t signal);
54  void (* compa_ref)(uint8_t signal);
55  void (* adc_compb_in)(uint8_t signal);
56 #ifdef CPU_VARIANT_X2
57  void (* dac_vref)(uint8_t signal);
58 #else
59  void (* compb_ref)(uint8_t signal);
60 #endif
61 } hard_api_t;
62 
66 #define HARD_API ((hard_api_t *) ROM_HARD_API_BASE)
67 
72 #define rom_hapi_crc32(a, b, c) (HARD_API->crc32((a), (b), (c)))
73 #define rom_hapi_get_flashsize() (HARD_API->get_fl_size())
74 #define rom_hapi_get_chipid() (HARD_API->get_chip_id())
75 #define rom_hapi_reset_device() (HARD_API->resetdev())
76 #define rom_hapi_fletcher32(a, b, c) (HARD_API->fletcher32((a), (b), (c)))
77 #define rom_hapi_min_value(a, b) (HARD_API->min_val((a), (b)))
78 #define rom_hapi_max_value(a, b) (HARD_API->max_val((a), (b)))
79 #define rom_hapi_mean_value(a, b) (HARD_API->mean_val((a), (b)))
80 #define rom_hapi_std_deviation_value(a, b) (HARD_API->stdd_val((a), (b)))
81 #define rom_hapi_hf_source_safe_switch() (HARD_API->hf_source_safe_switch())
82 #define rom_hapi_select_compa_input(a) (HARD_API->compa_in((a)))
83 #define rom_hapi_select_compa_ref(a) (HARD_API->compa_ref((a)))
84 #define rom_hapi_select_adc_compb_input(a) (HARD_API->adc_compb_in((a)))
85 #ifdef CPU_VARIANT_X2
86 #define rom_hapi_select_dac_vref(a) (HARD_API->dac_vref((a)))
87 #else
88 #define rom_hapi_select_compb_ref(a) (HARD_API->compb_vref((a)))
89 #endif
90 
92 #ifdef __cplusplus
93 }
94 #endif
95 
96 #endif /* CC26XX_CC13XX_HARD_API_H */
97 
fletcher32
uint32_t fletcher32(const uint16_t *buf, size_t words)
Fletcher's 32 bit checksum.
cc26xx_cc13xx.h
CC26xx, CC13xx definitions.
hard_api_t
ROM Hard-API.
Definition: cc26xx_cc13xx_hard_api.h:31