找回密码
 立即注册

使用微信账号登录

只需一步,快速开始

查看: 10440|回复: 16

[BC5系列] CSR蓝牙模块BC5的I/O口控制

[复制链接]
连续签到天数:1天
签到总天数:95天
签到总奖励:592金币
发表于 2012-12-29 20:38:12 | 显示全部楼层 |阅读模式

马上注册,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册  

×
本帖最后由 bluetooth 于 2012-12-29 20:40 编辑

CSR的BC5一共有13个IO口

include pio.h
直接调用'PioSet'函数,设置上1下0拉。
直接调用'PioSetDir'函数,设置输入0输出1
一般输入为弱上拉,直接调用’PioSetStrongBias‘函数,实现强上下拉,1为设置强,0为弱,不代表上下拉
另外还有复用引脚查询,设置
Kalimba用引脚查询,设置
@param mask The bit mask to use.
  @param bits The bits to use.
  This function is used to write the value of the data-output register. Only a
  subset of bits is written, controlled by the value of 'mask'; setting a bit in
  mask allows the corresponding bit in the output register to be changed according
  to the value of the bit in data. Note that bits not set in the mask lead to the
  corresponding output bits being set to the value shown in the data input register
  rather than the value stored in the data output register. i.e.
  \code
  foreach bit
     if mask[bit] is 1
         pioOut[bit] => data[bit]
     else
         pioOut[bit] => pioIn[bit]
  \endcode
  BlueCore (excluding BC01) has internal resistors which can be configured
  to either pull-up or pull-down mode when the pins are used for input. This
  is controlled by the value written to the output register using 'PioSet'.
  The resistors pull-down if the value is zero, and pull-up otherwise, so the
  following fragment sets pins 1 and 2 to inputs with pin 1 configured to
  pull-up and pin 2 configured to pull-down.
  \code
  PioSet(2|4, 2);
  PioSetDir(2|4, 0);
  \endcode

All BlueCore variants (above BC01) include weak internal pull-ups or
  pull-downs on pins which are being used as inputs. If the value set
  in the output register (for a pin which is being used as an input) is
  1, then the internal pull-up is enabled, otherwise the pin is pulled-down.
  On later BlueCore variants (not BC01, BC02-external), the pull-up or
  pull-down can be made stronger by writing a 1 into the corresponding bit
  in the bias register by calling this function.
  So to set pin 4 and 5 as inputs, 4 pulled up weakly, 5 pulled down strongly
  \code
   PioSetDir((1<<4)|(1<<5), 0);
   PioSet((1<<4)|(1<<5), (1<<4));
   PioSetStrongBias((1<<4)|(1<<5), (1<<5));
  \endcode
楼主热帖
积分商城 - 让您的金币更有价值!||官方Q群 - 让您的沟通更加及时!

暂无签到数据

发表于 2013-1-2 09:51:21 | 显示全部楼层
不错,又占了一个沙发!
积分商城 - 让您的金币更有价值!||官方Q群 - 让您的沟通更加及时!
回复 支持 反对

使用道具 举报

连续签到天数:1天
签到总天数:7天
签到总奖励:31金币
发表于 2013-1-21 12:08:33 | 显示全部楼层
学习了!感觉不够详细!
积分商城 - 让您的金币更有价值!||官方Q群 - 让您的沟通更加及时!
回复 支持 反对

使用道具 举报

连续签到天数:1天
签到总天数:7天
签到总奖励:31金币
发表于 2013-1-21 20:16:03 | 显示全部楼层
挣积分,积分!
积分商城 - 让您的金币更有价值!||官方Q群 - 让您的沟通更加及时!
回复 支持 反对

使用道具 举报

暂无签到数据

发表于 2013-4-23 12:55:12 | 显示全部楼层
下来学习学习
积分商城 - 让您的金币更有价值!||官方Q群 - 让您的沟通更加及时!
回复 支持 反对

使用道具 举报

暂无签到数据

发表于 2013-5-27 22:42:23 | 显示全部楼层
学习 学习了
积分商城 - 让您的金币更有价值!||官方Q群 - 让您的沟通更加及时!
回复 支持 反对

使用道具 举报

连续签到天数:1天
签到总天数:2天
签到总奖励:9金币
发表于 2013-9-4 23:35:46 | 显示全部楼层
谢谢楼主讲解
积分商城 - 让您的金币更有价值!||官方Q群 - 让您的沟通更加及时!
回复 支持 反对

使用道具 举报

暂无签到数据

发表于 2013-9-8 01:33:30 | 显示全部楼层
使用CSR蓝牙Chip进行Layout PCB注意事项
积分商城 - 让您的金币更有价值!||官方Q群 - 让您的沟通更加及时!
回复 支持 反对

使用道具 举报

暂无签到数据

发表于 2013-10-29 23:22:27 | 显示全部楼层
这个好好学习
积分商城 - 让您的金币更有价值!||官方Q群 - 让您的沟通更加及时!
回复 支持 反对

使用道具 举报

暂无签到数据

发表于 2013-12-9 09:34:28 | 显示全部楼层
谢谢!新手来学习了!
积分商城 - 让您的金币更有价值!||官方Q群 - 让您的沟通更加及时!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册  

本版积分规则

小黑屋|手机版|我爱蓝牙网 - 52Bluetooth

GMT+8, 2024-4-25 22:54 , Processed in 0.207339 second(s), 20 queries , Gzip On, MemCached On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表