这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 综合技术 » 电源与模拟 » 哪位大神用过HEF4894B这个12级的串转并移位寄存器

共1条 1/1 1 跳转至

哪位大神用过HEF4894B这个12级的串转并移位寄存器

菜鸟
2017-07-12 22:51:38     打赏

请问哪位大神用过HEF4894B这个12级的串转并移位寄存器

HEF4894B-v 9.0-2016.pdf

自己编写的驱动如下:
/* Transform data to QP0 ~ 11*/
void HEF4894_Trans(unsigned long data,unsigned char data_len)
{
  unsigned long  temp_data = 0;
  unsigned char i = 0;

  temp_data = data;

  HEF4894_STR = 0;  /* 锁存关 */
  HEF4894_OE  = 0;  /* 输出使能关 */
  HEF4894_D   = 0;  /* 数据输入0 */
  HEF4894_CP  = 0;  /* 时钟线0 */


  /* trans data to the register of HEF4894 */
  for(i=0;i<data_len;i++)
  {
    HEF4894_CP  = 0;
    if((temp_data & (unsigned long)0x0001) == 0)
    {
      HEF4894_D = 0;
    }
    else
    {
      HEF4894_D = 1;
    }
    HEF4894_CP  = 1;
    temp_data = temp_data>>1;
  }

  HEF4894_CP  = 0;     /* 时钟线0 */
  HEF4894_STR = 1;    /* 锁存使能 */
  HEF4894_OE  = 1;     /* 输出使能 */
}



共1条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]