nuttx/drivers/wireless/ieee80211/bcm43xxx/bcmf_core.h

83 lines
3.1 KiB
C
Raw Normal View History

2017-03-26 17:42:53 +02:00
/****************************************************************************
* drivers/wireless/ieee80211/bcm43xxx/bcmf_core.h
2017-03-26 17:42:53 +02:00
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
2017-03-26 17:42:53 +02:00
*
* http://www.apache.org/licenses/LICENSE-2.0
2017-03-26 17:42:53 +02:00
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
2017-03-26 17:42:53 +02:00
*
****************************************************************************/
#ifndef __DRIVERS_WIRELESS_IEEE80211_BCM43XXX_BCMF_CORE_H
#define __DRIVERS_WIRELESS_IEEE80211_BCM43XXX_BCMF_CORE_H
2017-03-26 17:42:53 +02:00
/****************************************************************************
* Included Files
****************************************************************************/
2017-03-26 17:42:53 +02:00
#include <stdint.h>
#include <stdbool.h>
#include "bcmf_sdio.h"
2017-03-26 17:42:53 +02:00
/****************************************************************************
* Public Functions Prototypes
****************************************************************************/
int bcmf_read_sbreg(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address,
2017-03-26 17:42:53 +02:00
uint8_t *reg, unsigned int len);
int bcmf_write_sbreg(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address,
2017-03-26 17:42:53 +02:00
uint8_t *reg, unsigned int len);
bool bcmf_core_isup(FAR struct bcmf_sdio_dev_s *sbus, unsigned int core);
2017-03-26 17:42:53 +02:00
void bcmf_core_disable(FAR struct bcmf_sdio_dev_s *sbus,
unsigned int core,
uint32_t prereset,
uint32_t reset);
void bcmf_core_reset(FAR struct bcmf_sdio_dev_s *sbus,
unsigned int core,
uint32_t prereset,
uint32_t reset,
uint32_t postreset);
2017-03-26 17:42:53 +02:00
int bcmf_core_upload_firmware(FAR struct bcmf_sdio_dev_s *sbus);
2017-03-26 17:42:53 +02:00
static inline int bcmf_read_sbregb(FAR struct bcmf_sdio_dev_s *sbus,
2017-03-26 17:42:53 +02:00
uint32_t address, uint8_t *reg)
{
return bcmf_read_sbreg(sbus, address, reg, 1);
2017-03-26 17:42:53 +02:00
}
static inline int bcmf_read_sbregw(FAR struct bcmf_sdio_dev_s *sbus,
2017-03-26 17:42:53 +02:00
uint32_t address, uint32_t *reg)
{
return bcmf_read_sbreg(sbus, address, (uint8_t *)reg, 4);
2017-03-26 17:42:53 +02:00
}
static inline int bcmf_write_sbregb(FAR struct bcmf_sdio_dev_s *sbus,
2017-03-26 17:42:53 +02:00
uint32_t address, uint8_t reg)
{
return bcmf_write_sbreg(sbus, address, &reg, 1);
2017-03-26 17:42:53 +02:00
}
static inline int bcmf_write_sbregw(FAR struct bcmf_sdio_dev_s *sbus,
2017-03-26 17:42:53 +02:00
uint32_t address, uint32_t reg)
{
return bcmf_write_sbreg(sbus, address, (uint8_t *)&reg, 4);
2017-03-26 17:42:53 +02:00
}
#endif /* __DRIVERS_WIRELESS_IEEE80211_BCM43XXX_BCMF_CORE_H */