wf200_bus.h

1 /*
2 * Copyright 2018, Silicon Laboratories Inc. All rights reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 
23 #pragma once
24 
25 #include "wf200_constants.h"
26 #include <stdint.h>
27 
28 /* High level WF200 bus API */
29 sl_status_t wf200_init_bus( void );
30 
31 sl_status_t wf200_reg_read( wf200_register_address_t address, void* buffer, uint32_t length );
32 
33 sl_status_t wf200_reg_write( wf200_register_address_t address, const void* buffer, uint32_t length );
34 
35 sl_status_t wf200_notify_bus_thread( void );
36 
37 
38 /* WF200 basic register API */
39 sl_status_t wf200_reg_read_16( wf200_register_address_t address, uint16_t* value_out );
40 
41 sl_status_t wf200_reg_write_16( wf200_register_address_t address, uint16_t value_in );
42 
43 sl_status_t wf200_reg_read_32( wf200_register_address_t address, uint32_t* value_out );
44 
45 sl_status_t wf200_reg_write_32( wf200_register_address_t address, uint32_t value_in );
46 
47 sl_status_t wf200_data_read( void* buffer, uint32_t length );
48 
49 sl_status_t wf200_data_write( const void* buffer, uint32_t length );
50 
51 sl_status_t wf200_apb_write_32( uint32_t address, uint32_t value_in );
52 
53 sl_status_t wf200_apb_read_32( uint32_t address, uint32_t* value_out );
54 
55 sl_status_t wf200_apb_write( uint32_t address, const void* buffer, uint32_t length );
56 
wf200_constants.h
wf200_constants.h contains defines, enums, structures and functions used by wf200 driver ...